apiuikit 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{CodeSamples-cudhC1Tt.cjs → CodeSamples-CaQ-Plnx.cjs} +1 -1
- package/dist/{CodeSamples-DlTU0NQt.js → CodeSamples-DevA5LND.js} +1 -1
- package/dist/{LogoExtension-CWmh9Ac1.cjs → LogoExtension-D0VY8gpU.cjs} +1 -1
- package/dist/{LogoExtension-CB2hokoQ.js → LogoExtension-DMBdjLMS.js} +1 -1
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.css +1 -1
- package/dist/apiuikit.es.js +1 -1
- package/dist/components/Section.d.ts +7 -1
- package/dist/config/config.d.ts +4 -0
- package/dist/helpers/marked.d.ts +11 -1
- package/dist/helpers/sanitize.d.ts +10 -0
- package/dist/hooks/useSystemColorScheme.d.ts +4 -0
- package/dist/{index-B0PAsEtK.js → index-BVwqtADi.js} +1 -1
- package/dist/{index-9nxb2bCY.js → index-BXI--_xO.js} +1 -1
- package/dist/{index-jpFnjoiM.cjs → index-BjVWe_rQ.cjs} +1 -1
- package/dist/index-DKItRZCR.cjs +182 -0
- package/dist/{index-JfEtoyra.cjs → index-Djr20zD8.cjs} +1 -1
- package/dist/{index-D1eDZSHR.js → index-vxDO_J_a.js} +6253 -5300
- package/dist/{protoToJsonSchema-BtR0DMuR.js → protoToJsonSchema-Br2jKuIZ.js} +1 -1
- package/dist/{protoToJsonSchema-sAcBTEqG.cjs → protoToJsonSchema-C2GoWuZu.cjs} +1 -1
- package/dist/{protobufSchemaParser-DQwQQY_N.cjs → protobufSchemaParser-Cbb8hQnz.cjs} +1 -1
- package/dist/{protobufSchemaParser-C5H7VtBA.js → protobufSchemaParser-DzWDLqeW.js} +2 -2
- package/dist/public/createSectionRoot.d.ts +13 -1
- package/package.json +2 -2
- package/dist/index-Dgi7m_9C.cjs +0 -180
package/dist/index-Dgi7m_9C.cjs
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";var yc=Object.create;var Xn=Object.defineProperty;var wc=Object.getOwnPropertyDescriptor;var kc=Object.getOwnPropertyNames;var vc=Object.getPrototypeOf,jc=Object.prototype.hasOwnProperty;var Sc=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ac=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of kc(t))!jc.call(e,s)&&s!==n&&Xn(e,s,{get:()=>t[s],enumerable:!(r=wc(t,s))||r.enumerable});return e};var Os=(e,t,n)=>(n=e!=null?yc(vc(e)):{},Ac(t||!e||!e.__esModule?Xn(n,"default",{value:e,enumerable:!0}):n,e));var se=(e,t,n)=>Sc(e,typeof t!="symbol"?t+"":t,n);const o=require("react/jsx-runtime"),g=require("react"),kt=require("react-dom"),Bo=require("isomorphic-dompurify"),Fr=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],zr=(e,t)=>{const n=t.length>0?t:Fr,r=(e%n.length+n.length)%n.length;return n[r]},ot={show:{sidebar:!0,info:!0,servers:!0,operations:!0,messages:!0,messageExamples:!1,schemas:!0},theme:{colors:{primary:{50:"#ddf4ff",100:"#b6e3ff",200:"#80ccff",300:"#54aeff",500:"#58a6ff",600:"#1f6feb",700:"#0d419d"}},light:{background:"#ffffff",surface:"#ffffff",border:"#e2e8f0",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#64748b"},dark:{background:"#0d1117",surface:"#161b22",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681"},depthColors:Fr},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},Hr=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",Nc=e=>typeof e=="object"&&e!==null;function Ec(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function Do(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let n=e;for(const r of t.slice(2).split("/")){if(!Nc(n))return;const s=Ec(r);if(s===void 0||(n=n[s],n===void 0))return}return n}function lt(e){const t=new Map;return n=>{if(t.has(n))return t.get(n);const r=Do(e,n);return t.set(n,r),r}}const Yn=e=>typeof e=="object"&&e!==null,$c=e=>e.replace(/^#\//,"").split("/").pop()??e,Ur=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Hr(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>Ur(r,t))),Fo=(e,t=new Set,n=new Set)=>{if(typeof e!="object"||e===null)return!1;if(t.has(e))return!0;if(n.has(e))return!1;if(n.add(e),Hr(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Fo(s,t,n))}finally{t.delete(e)}},Cc=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),_s=e=>e.length?`#/${e.map(Cc).join("/")}`:"#";function Nt(e){if(!Fo(e))return e;const t=new Map,n=new Set,r=new Map,s=(i,a)=>{if(Array.isArray(i)){if(n.has(i))return{$ref:r.get(i)};const c=t.get(i);if(c!==void 0)return c;const u=[];r.set(i,_s(a)),t.set(i,u),n.add(i);try{i.forEach((l,d)=>u.push(s(l,[...a,String(d)])))}finally{n.delete(i)}return u}if(Hr(i)){const c=Do(e,i.$ref),u=Yn(c)||Array.isArray(c);if(u&&!n.has(c)){const l=s(c,a);return Yn(l)&&l["x-parser-schema-id"]===void 0&&(l["x-parser-schema-id"]=$c(i.$ref)),l}if(c!==void 0&&!u)return c}if(Yn(i)){if(n.has(i))return{$ref:r.get(i)};const c=t.get(i);if(c!==void 0)return c;const u={};r.set(i,_s(a)),t.set(i,u),n.add(i);try{for(const[l,d]of Object.entries(i))u[l]=s(d,[...a,l])}finally{n.delete(i)}return u}return i};return s(e,[])}class ut extends g.Component{constructor(){super(...arguments);se(this,"state",{error:null});se(this,"reset",()=>{this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var s,i;console.error("[apiuikit] Rendering error:",n,r.componentStack),(i=(s=this.props).onError)==null||i.call(s,n,r)}componentDidUpdate(n){this.state.error&&n.resetKey!==this.props.resetKey&&this.reset()}render(){const{error:n}=this.state;if(!n)return this.props.children;const{fallback:r}=this.props;return typeof r=="function"?r(n,this.reset):r!==void 0?r:o.jsxs("div",{role:"alert",className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-surface p-6 text-foreground",children:[o.jsx("p",{className:"font-semibold text-foreground",children:"Something went wrong rendering this API specification."}),o.jsx("p",{className:"text-sm text-foreground-secondary break-words",children:n.message}),o.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md bg-primary-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600",children:"Try again"})]})}}const dt=g.createContext(null),Le=()=>{const e=g.useContext(dt);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},zo=()=>{const e=Le();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Ho=()=>{const e=Le();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},ke=Le;var jn=(e=>(e.SEND="send",e.RECEIVE="receive",e))(jn||{});const Tc="Contact",Ic="Email",Ms="License",Rs="External Documentation",Oc="Tags",_c="Implicit",Mc=`The Implicit flow is a simplified OAuth flow previously recommended
|
|
2
|
-
for native apps and JavaScript apps where the access token is returned
|
|
3
|
-
immediately without an extra authorization code exchange step.`,Rc="Client Credentials",Pc="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",Lc="Password",Bc="The Password grant type is a legacy way to exchange a user's credentials for an access token.",Dc="Authorization Code",Fc="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Uo="Connecting to a server",zc="",Sn=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],Hc=[50,100,200,300,500,600,700],Uc={kafka:{label:"Kafka",color:"bg-primary-100 text-primary-700 border-primary-200"},mqtt:{label:"MQTT",color:"bg-purple-100 text-purple-700 border-purple-200"},http:{label:"HTTP",color:"bg-blue-100 text-blue-700 border-blue-200"},https:{label:"HTTPS",color:"bg-blue-100 text-blue-700 border-blue-200"},ws:{label:"WebSocket",color:"bg-green-100 text-green-700 border-green-200"},wss:{label:"WebSocket Secure",color:"bg-green-100 text-green-700 border-green-200"},amqp:{label:"AMQP",color:"bg-yellow-100 text-yellow-700 border-yellow-200"},amqps:{label:"AMQPS",color:"bg-yellow-100 text-yellow-700 border-yellow-200"},ibmmq:{label:"IBM MQ",color:"bg-indigo-100 text-indigo-700 border-indigo-200"},solace:{label:"Solace",color:"bg-pink-100 text-pink-700 border-pink-200"},nats:{label:"NATS",color:"bg-teal-100 text-teal-700 border-teal-200"}},Wc=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],Kc={get:"bg-blue-100 text-blue-800",post:"bg-green-100 text-green-800",put:"bg-yellow-100 text-yellow-800",patch:"bg-orange-100 text-orange-800",delete:"bg-red-100 text-red-800",options:"bg-neutral-100 text-foreground-secondary",head:"bg-neutral-100 text-foreground-secondary",trace:"bg-neutral-100 text-foreground-secondary",[jn.SEND]:"bg-green-100 text-green-800",[jn.RECEIVE]:"bg-blue-100 text-blue-800"};function Wo(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${n} ${r} ${s}`}function Qn(e,t,n){if(e)for(const r of Hc){const s=e[r];s&&(n[`--color-${t}-${r}`]=Wo(s))}}const Gc=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],Vc={50:"15 23 42",100:"30 41 59",200:"51 65 85",300:"71 85 105",500:"148 163 184",600:"203 213 225",700:"226 232 240",800:"241 245 249",900:"248 250 252"};function Jc(e,t){var s,i,a,c,u,l;if(!t)return e??{};if(!e)return t;const n=(d,f)=>d||f?{...d,...f}:void 0,r=(d,f)=>d||f?{...d,...f}:void 0;return{...e,...t,colors:{primary:n((s=e.colors)==null?void 0:s.primary,(i=t.colors)==null?void 0:i.primary),secondary:n((a=e.colors)==null?void 0:a.secondary,(c=t.colors)==null?void 0:c.secondary),neutral:n((u=e.colors)==null?void 0:u.neutral,(l=t.colors)==null?void 0:l.neutral)},light:r(e.light,t.light),dark:r(e.dark,t.dark)}}function Zc(e,t){const n=e==null?void 0:e.mode;return n==="light"||n==="dark"?n:n==="system"?t?"dark":"light":e!=null&&e.dark&&!(e!=null&&e.light)?"dark":"light"}function Xc(e,t){const n={},r=t==="dark"?e.dark:e.light;if(t==="dark")for(const[s,i]of Object.entries(Vc))n[`--color-neutral-${s}`]=i;if(r)for(const[s,i]of Gc){const a=r[s];a&&(n[i]=Wo(a))}return e.colors&&(Qn(e.colors.primary,"primary",n),Qn(e.colors.secondary,"secondary",n),Qn(e.colors.neutral,"neutral",n)),n}const Yc=e=>e.endsWith(".tab"),Ps=new WeakMap;let Qc=0;const qc=e=>{const t=Ps.get(e);if(t)return t;const n=`plugin-${Qc++}`;return Ps.set(e,n),n};function Ko(e){const t=new Map;for(const n of e){const r=qc(n);for(const s of Object.keys(n.slots)){const i=n.slots[s];if(!i)continue;const a=t.get(s)??[];if(t.has(s)||t.set(s,a),Yc(s)){const c=i;a.push({id:`${s.replace(/\./g,"-")}-${r}`,pluginName:n.name,label:c.label,Component:c.component})}else a.push({id:`${s.replace(/\./g,"-")}-${r}`,pluginName:n.name,Component:i})}}return t}function el(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function tl(e){const[t,n]=g.useState(()=>e?el():!1);return g.useEffect(()=>{if(!e||typeof window>"u"||typeof window.matchMedia!="function")return;const r=window.matchMedia("(prefers-color-scheme: dark)");n(r.matches);const s=i=>n(i.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const nl=[];function Go(e,t,n=ot,r=nl){var $,I,P,M,U,X,S,k,C,D;const[s,i]=g.useState(null),[a,c]=g.useState(null),u=g.useMemo(()=>lt(t),[t]),l=(($=n.expand)==null?void 0:$.schemas)===!0,d=(P=(I=n.theme)==null?void 0:I.depthColors)!=null&&P.length?n.theme.depthColors:Fr,f=((M=n.show)==null?void 0:M.extensions)!==!1,p=((U=n.show)==null?void 0:U.codeSamples)!==!1,h=((X=n.show)==null?void 0:X.tryIt)===!0,m=n.topOffset,b=typeof m=="number"&&Number.isFinite(m)?Math.max(0,m):0,x=((S=n.sidePanel)==null?void 0:S.containment)??"viewport",w=(k=n.sidePanel)==null?void 0:k.topOffset,N=typeof w=="number"&&Number.isFinite(w)?Math.max(0,w):b,j=(C=n.markdown)==null?void 0:C.url,E=g.useMemo(()=>{if(typeof j=="function")return j;if(typeof j=="string")return()=>j},[j]),L=g.useMemo(()=>Ko(r),[r]),z=tl(((D=n.theme)==null?void 0:D.mode)==="system"),A=g.useMemo(()=>Zc(n.theme,z),[n.theme,z]),v=g.useMemo(()=>Xc(Jc(ot.theme,n.theme),A),[n.theme,A]);return{contextValue:g.useMemo(()=>({specType:e,document:t,deref:u,portalHost:s,rootElement:a,topOffset:b,sidePanelContainment:x,sidePanelTopOffset:N,defaultSchemaExpanded:l,depthColors:d,showExtensions:f,showCodeSamples:p,showTryIt:h,markdownUrl:E,plugins:r,pluginSlotRegistry:L,config:n,resolvedMode:A}),[e,t,u,s,a,b,x,N,l,d,f,p,h,E,r,L,n,A]),themeVars:v,resolvedMode:A,setPortalHost:i,setRootElement:c}}function Ln({document:e,config:t=ot,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=Go("asyncapi",e,t,n);return o.jsx(dt.Provider,{value:i,children:o.jsxs("div",{ref:l,"data-theme":c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:u,className:"asyncapi-portal-root"}),s]})})}const Wr="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function _e({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:c="columns",bottomSpacing:u=!0}){const l=c==="stacked",d=n!=null&&n!==!1,f=`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`;return o.jsxs("div",{className:`w-full mt-6 ${u?"mb-6":""} ${l?"":Wr}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:l?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:f,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${l?"flex-col":d&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${l?"w-full":"@lg:w-prose"} min-w-0`,children:t}),l?d&&o.jsx("div",{className:r?"@lg:sticky @lg:top-4":void 0,children:n}):o.jsx("div",{className:`@lg:pl-12 @lg:w-[400px] shrink-0 ${d?"":"hidden @lg:block"}`,"data-testid":"section-side-column",children:o.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function nt(...e){return e.filter(Boolean).join(" ")}function Et({className:e}){return o.jsx("svg",{className:e,id:"Layer_1",version:"1.1",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}const mn=(e,t)=>`${e?`${e}-`:""}tab-${t}`,gn=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function ft({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:c}){var b;const u=g.useId(),l=g.useRef([]),d=t??(a?"":((b=e[0])==null?void 0:b.id)??""),f=e.some(x=>!!x.icon),p=t?e.findIndex(x=>x.id===t):-1,h=p>=0?p:0,m=(x,w)=>{var E;if(e.length===0)return;const N=L=>(L+e.length)%e.length;let j=w;if(x.key==="ArrowRight"&&(x.preventDefault(),j=N(w+1)),x.key==="ArrowLeft"&&(x.preventDefault(),j=N(w-1)),x.key==="Home"&&(x.preventDefault(),j=0),x.key==="End"&&(x.preventDefault(),j=e.length-1),j!==w){const L=e[j];n(L.id),(E=l.current[j])==null||E.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:nt("@sm:hidden relative",f?"mt-0":"mt-4"),children:[o.jsx("label",{htmlFor:u,className:"sr-only",children:s}),o.jsxs("select",{id:u,name:"tabs",value:d,onChange:x=>n(x.target.value),className:"block w-full appearance-none rounded-md border border-border bg-surface py-2 pl-3 pr-9 text-sm text-foreground-secondary focus:border-secondary-500 focus:outline-none focus:ring-1 focus:ring-secondary-500",children:[a&&o.jsx("option",{value:"",children:a}),e.map(x=>o.jsx("option",{value:x.id,children:x.name},x.id))]}),o.jsx(Et,{className:"pointer-events-none absolute right-3 top-1/2 h-3 w-3 -translate-y-1/2 text-foreground-muted"})]}),o.jsx("div",{className:nt("hidden @sm:block",f||c==="segmented"?"":"mt-6"),children:c==="segmented"?o.jsx("div",{className:"inline-flex h-9.5 w-77.5 items-center gap-1 rounded-lg bg-neutral-100 p-1",role:"tablist","aria-label":r,children:e.map((x,w)=>{const N=x.id===t;return o.jsx("button",{ref:j=>{l.current[w]=j},id:mn(i,x.id),type:"button",role:"tab",tabIndex:w===h?0:-1,"aria-selected":N,"aria-controls":gn(i,x.id),onClick:()=>n(x.id),onKeyDown:j=>m(j,w),className:nt("h-full flex-1 cursor-pointer rounded-md text-sm font-medium transition-colors",N?"bg-surface text-foreground shadow-sm":"text-foreground-muted hover:text-foreground-secondary"),children:x.name},x.id)})}):f?o.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":r,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((x,w)=>{const N=x.id===t,j=x.icon;return o.jsx("button",{ref:E=>{l.current[w]=E},id:mn(i,x.id),type:"button",role:"tab",tabIndex:w===h?0:-1,"aria-selected":N,"aria-controls":gn(i,x.id),onClick:()=>n(x.id),onKeyDown:E=>m(E,w),className:nt("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",N?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[j?o.jsx(j,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:x.name})]})},x.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((x,w)=>{const N=x.id===t;return o.jsxs("button",{ref:j=>{l.current[w]=j},id:mn(i,x.id),type:"button",role:"tab",tabIndex:w===h?0:-1,"aria-selected":N,"aria-controls":gn(i,x.id),onClick:()=>n(x.id),onKeyDown:j=>m(j,w),className:nt(N?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",w===0?"rounded-l-lg":"",w===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 cursor-pointer overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),children:[o.jsx("span",{children:x.name}),o.jsx("span",{"aria-hidden":"true",className:nt(N?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},x.id)})})})]}):null}function rl({tabs:e,current:t,idPrefix:n,renderPanel:r}){return o.jsx(o.Fragment,{children:e.map(s=>{const i=s.id===t;return o.jsx("div",{id:gn(n,s.id),role:"tabpanel","aria-labelledby":mn(n,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:r(s,i)},s.id)})})}function Vo(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Kr(e){let t=e;for(;t&&t!==document.body;){if(Vo(t))return t;t=t.parentElement}return document.documentElement}function sl(e,t){if(!e||!t||!t.contains(e))return null;let n=e;for(;n;){if(Vo(n))return n;if(n===t)break;n=n.parentElement}return null}function Jo(e){const t=e.style.overflow,n=e.style.paddingRight,r=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",r>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+r}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function Zo({tabs:e,current:t,onChange:n}){const{rootElement:r,topOffset:s=0}=Le();if(!e.length)return null;const i=typeof document<"u"&&Kr(r)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full",children:o.jsx(ft,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky z-10 flex w-full justify-center bg-background pb-2",style:{top:i},children:o.jsx(_e,{content:a,stickySideContent:!1,bottomSpacing:!1})})}function ol(e,t){const[n,r]=g.useState("docked"),s=g.useRef(t);return s.current=t,g.useEffect(()=>{if(!e)return;let i=null,a=null;const c=()=>{a=null;const l=e.getBoundingClientRect().top,d=i===null?0:l-i;i=l,l>=0?r("docked"):s.current||d>0?r("pinned"):d<0?r("hidden"):r(f=>f==="docked"?"hidden":f)},u=()=>{a===null&&(a=requestAnimationFrame(c))};return c(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[e]),g.useEffect(()=>{t&&r(i=>i==="hidden"?"pinned":i)},[t]),n}const il=56,al=8;function Xo({logo:e,children:t,forceVisible:n=!1}){const{rootElement:r,topOffset:s=0}=Le(),i=ol(r,n),a=s,c=a+il+al,u={top:a,transform:`translateY(${i==="hidden"?`-${c}px`:"0px"})`,pointerEvents:i==="hidden"?"none":void 0};return o.jsx("header",{className:"document-topbar",style:u,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${Wr}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function Yo(e){if(e.length===0)return o.jsx("span",{children:"No allowed values."});if(e.length===1)return o.jsxs("span",{children:["Allowed value is ",o.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((r,s)=>o.jsxs(g.Fragment,{children:[o.jsx("code",{children:r}),", "," "]},s)),n=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function cl(e){return e.map(t=>`\`${t}\``).join(", ")}function pr(e,{align:t="center",gap:n=8,clearance:r=40,width:s=0,margin:i=8}={}){const a=e.getBoundingClientRect(),c=a.top<r?"bottom":"top",u=c==="top"?a.top-n:a.bottom+n;if(t==="center")return{top:u,left:a.left+a.width/2,placement:c};const l=a.right-s,d=window.innerWidth-s-i;return{top:u,left:Math.max(i,Math.min(l,d)),placement:c}}function ll(e){const t=[],n=/\{([^}]+)\}/g;let r=0,s;for(;(s=n.exec(e))!==null;)s.index>r&&t.push({type:"text",value:e.slice(r,s.index)}),t.push({type:"param",value:s[1]}),r=s.index+s[0].length;return r<e.length&&t.push({type:"text",value:e.slice(r)}),t}const Ls=360;function ul(e){let t=0;return e.map((n,r)=>n.type==="text"?o.jsx("span",{children:n.value},r):o.jsx("span",{className:`font-semibold ${Sn[t++%Sn.length]}`,children:`{${n.value}}`},r))}function qe({address:e,parameters:t,className:n="text-xs",truncate:r=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=ke(),[c,u]=g.useState(null),[l,d]=g.useState({top:0,left:0,placement:"top"}),[f,p]=g.useState(!1),[h,m]=g.useState(null),b=g.useRef(null),x=g.useId(),w=ll(e);let N=0;g.useEffect(()=>{if(!r)return;const y=b.current;if(!y)return;const $=()=>p(y.scrollWidth>y.clientWidth);$();const I=new ResizeObserver($);return I.observe(y),()=>I.disconnect()},[r,e]);const j=(y,$)=>{d(pr($)),u(y)},E=()=>u(null),L=y=>m(pr(y,{align:"end",width:Ls})),z=()=>m(null),A=w.map((y,$)=>{if(y.type==="text")return o.jsx("span",{children:y.value},$);const I=t==null?void 0:t[y.value],P=Sn[N++%Sn.length],M=c===$,U=!!I&&(I.description||I.type||I.default||I.enum&&I.enum.length>0||I.examples&&I.examples.length>0),X=`channel-address-tooltip-${$}`,S=U&&M?X:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:k=>U&&j($,k.currentTarget),onMouseLeave:E,children:[o.jsx("span",{className:`font-semibold ${P} ${U?"cursor-help underline decoration-dotted":""}`,role:U?"button":void 0,tabIndex:U?0:void 0,"aria-expanded":U?M:void 0,"aria-describedby":S,onFocus:k=>U&&j($,k.currentTarget),onBlur:E,onKeyDown:k=>{U&&((k.key==="Enter"||k.key===" ")&&(k.preventDefault(),j($,k.currentTarget)),k.key==="Escape"&&(k.preventDefault(),E(),k.currentTarget.blur()))},children:`{${y.value}}`}),U&&M&&a&&kt.createPortal(o.jsxs("div",{id:X,className:`fixed -translate-x-1/2 max-w-xs px-2.5 py-1.5 bg-neutral-50 text-foreground-muted text-xs rounded pointer-events-none z-[60] shadow-lg text-left leading-snug ${l.placement==="top"?"-translate-y-full":""}`,style:{top:l.top,left:l.left},children:[I.description&&o.jsx("div",{children:I.description}),I.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:I.type})}),I.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:I.default})]}),I.enum&&I.enum.length>0&&o.jsx("div",{className:"mt-1",children:Yo(I.enum)}),I.examples&&I.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",I.examples.join(", ")]})]}),a)]},$)}),v=i?"px-2 py-1 ":"";return r?o.jsxs("code",{className:`${v}rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[o.jsx("span",{ref:b,className:"overflow-hidden whitespace-nowrap min-w-0",children:A}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!h,"aria-describedby":h?x:void 0,className:"shrink-0 cursor-help px-0.5 text-foreground-muted hover:text-foreground-secondary focus:outline-none focus-visible:ring-1 focus-visible:ring-neutral-300 rounded",onMouseEnter:y=>L(y.currentTarget),onMouseLeave:z,onFocus:y=>L(y.currentTarget),onBlur:z,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),L(y.currentTarget)),y.key==="Escape"&&(y.preventDefault(),z(),y.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&h&&a&&kt.createPortal(o.jsx("div",{id:x,role:"tooltip",style:{top:h.top,left:h.left,width:Ls},className:`fixed z-[60] rounded-lg border border-border bg-surface px-3 py-2 shadow-lg pointer-events-none ${h.placement==="top"?"-translate-y-full":""}`,children:o.jsx("code",{className:"block break-all font-mono text-xs leading-relaxed text-foreground-secondary",children:ul(w)})}),a)]}):o.jsx("code",{className:`${v}rounded text-foreground-secondary break-all ${n}`,children:A})}const dl={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Ze({method:e,size:t="sm",className:n=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${dl[t]} ${Kc[e]} ${n}`,children:e}):null}function hr(e,t){const[n,r]=g.useState(null);return g.useLayoutEffect(()=>{if(!e||!t){r(null);return}let s=null;const i=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,r(e.getBoundingClientRect())}))};r(e.getBoundingClientRect());const a=new ResizeObserver(i);return a.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{s!==null&&cancelAnimationFrame(s),a.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),n}const Bs=6,fl=12,pl=8,hl=.7,ml=240;function gl(e,t){if(e===0)return 1/0;const n=Math.min(e*hl,ml)-pl*2,r=t*Bs+Math.max(0,t-1)*fl;return Math.max(1,Math.floor((n-r)/Bs))}function xl(e,t){const n=e.reduce((s,i)=>s+i,0);if(n<=t)return e;if(t<=e.length)return e.map(()=>1);const r=t-e.length;return e.map(s=>Math.min(s,1+Math.floor(s/n*r)))}const bl=12,yl=48,wl=40;function kl({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[i,a]=g.useState(!1),[c,u]=g.useState(!1),l=i||c,{rootElement:d,portalHost:f,topOffset:p=0}=ke(),h=g.useRef(null),m=g.useRef(null),[b,x]=g.useState(null),[w,N]=g.useState(null),j=g.useMemo(()=>e.filter(H=>H.items.length>0),[e]),E=g.useMemo(()=>j.filter(H=>H.isTab===!1||H.id===t),[j,t]),L=g.useMemo(()=>j.filter(H=>H.showInPopover!==!1),[j]),[z,A]=g.useState(null),v=g.useRef(null),y=g.useRef(null),$=g.useCallback((H,J)=>{A({section:H,key:J}),v.current={section:H,key:J},y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{v.current=null},600)},[]);g.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),g.useEffect(()=>{const J=e.filter(F=>F.items.length>0).flatMap(F=>F.items.map(pe=>({section:F.id,key:F.itemKey(pe),id:F.targetId(pe)}))).map(F=>({...F,el:document.getElementById(F.id)})).filter(F=>!!F.el);if(J.length===0)return;const R=new Map(J.map(F=>[F.el,F])),q=new Map,ne=new IntersectionObserver(F=>{for(const T of F)T.isIntersecting?q.set(T.target,T.boundingClientRect.top):q.delete(T.target);if(q.size===0)return;let pe=null,be=-1/0;for(const[T,O]of q)O>be&&(pe=T,be=O);const ye=pe&&R.get(pe);if(!ye)return;const $e=v.current;if($e){if(ye.section!==$e.section||ye.key!==$e.key)return;v.current=null}A({section:ye.section,key:ye.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return J.forEach(F=>ne.observe(F.el)),()=>ne.disconnect()},[e]);const I=(z==null?void 0:z.section)??t,P=z??s,M=hr(d,!0),U=typeof window>"u"?0:window.innerWidth,X=typeof window>"u"?0:window.innerHeight,S=!!M&&M.bottom>p&&M.top<X,k=Math.max((M==null?void 0:M.top)??p,p),C=Math.min((M==null?void 0:M.bottom)??X,X),D=Math.max(0,C-k),K=(k+C)/2,[Z,he]=g.useState(null);g.useLayoutEffect(()=>{if(!w||!d)return;const H=()=>{const R=w.getBoundingClientRect().left-d.getBoundingClientRect().left;he(q=>q===R?q:R)};H();const J=new ResizeObserver(H);return J.observe(w),J.observe(d),window.addEventListener("resize",H),()=>{J.disconnect(),window.removeEventListener("resize",H)}},[w,d]);const me=Z===null?null:((M==null?void 0:M.left)??0)+Z,ce=((M==null?void 0:M.left)??0)+bl,ae=me!==null?me-ce>=wl+yl:!!M&&M.width>=1024,Q=!!M&&!ae,B={opacity:S?1:0,pointerEvents:S?"auto":"none",transition:"opacity 0.2s ease"},Y={position:"fixed",top:K,left:ce,transform:"translateY(-50%)",zIndex:45,...B},ie={position:"sticky",bottom:0,height:0,zIndex:45,pointerEvents:"none"},te=hr(b,Q),ge=Q?{position:"fixed",bottom:te?X-te.top+8:68,right:te?U-te.right:16,zIndex:46}:{position:"fixed",top:K,left:ce,transform:"translateY(-50%)",maxHeight:`${Math.max(0,D-32)}px`,zIndex:46};g.useEffect(()=>{if(!i)return;const H=R=>{var q;R.key==="Escape"&&(a(!1),u(!1),(q=h.current)==null||q.focus())},J=R=>{var ne,F;const q=R.target;(ne=h.current)!=null&&ne.contains(q)||(F=m.current)!=null&&F.contains(q)||a(!1)};return document.addEventListener("keydown",H),document.addEventListener("mousedown",J),()=>{document.removeEventListener("keydown",H),document.removeEventListener("mousedown",J)}},[i]);const le=g.useCallback((H,J)=>{H.isTab!==!1&&n(H.id),J&&setTimeout(()=>{var R;(R=document.getElementById(J))==null||R.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),de=g.useMemo(()=>L.map(H=>{const J=I===H.id,R=(P==null?void 0:P.section)===H.id,q=H.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{le(H),$(H.id,""),Q&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${J?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(q,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${J?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${J?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:H.label}),o.jsx("span",{className:`ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 font-mono text-[10px] transition-colors ${J?"border border-primary-200 bg-primary-100 text-primary-700":"bg-neutral-100 text-foreground-muted"}`,children:H.items.length})]}),H.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:H.items.map(ne=>{const F=H.itemKey(ne),pe=R&&(P==null?void 0:P.key)===F;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{le(H,H.targetId(ne)),r(H.id,F),$(H.id,F),Q&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${pe?"bg-primary-50 font-medium text-primary-700":J?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:H.renderItem(ne,{isSelected:pe,isSectionActive:J})})},F)})})]},H.id)}),[L,I,P,Q,le,r,$]),Se=gl(D,E.length),fe=g.useMemo(()=>{const H=xl(E.map(J=>J.items.length),Se);return E.map((J,R)=>{const q=I===J.id,ne=J.items.length,F=H[R];let pe=-1;if((P==null?void 0:P.section)===J.id){const be=J.items.findIndex(ye=>J.itemKey(ye)===P.key);be>=0&&(pe=Math.min(F-1,Math.floor(be*F/ne)))}return o.jsxs("div",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${q?"w-6 bg-foreground-secondary":"w-4 bg-neutral-300 group-hover:bg-neutral-400"}`}),o.jsx("div",{className:"flex flex-col items-start gap-1",children:Array.from({length:F},(be,ye)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${ye===pe?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},ye))})]},J.id)})},[E,I,P,Se]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:N,"aria-hidden":"true",className:`w-full ${Wr}`,style:{height:0}}),!Q&&o.jsx("button",{ref:h,onClick:()=>a(H=>!H),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),title:l?"Close navigation":"Open navigation","aria-label":l?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2","aria-expanded":l,style:{...Y,visibility:S?"visible":"hidden"},children:fe}),Q&&o.jsx("div",{style:ie,children:o.jsx("button",{ref:H=>{h.current=H,x(H)},onClick:()=>a(H=>!H),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"absolute bottom-4 right-4 flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg","aria-expanded":l,style:{...B,visibility:S?"visible":"hidden"},children:o.jsxs("span",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})})}),f&&kt.createPortal(o.jsx("div",{ref:m,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`max-h-[70vh] w-96 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-border bg-background p-2 shadow-xl transition-all duration-150 ${Q?"origin-bottom-right":""} ${l?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:{...ge,visibility:l?"visible":"hidden"},children:de}),f)]})}function Qo({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:i}){return o.jsx(kl,{sections:e,activeSection:t,onTabChange:a=>n(a),onItemSelect:(a,c)=>{a!=="info"&&(a==="servers"?s==null||s(c):r==null||r(a,c))},selectedItem:i?{section:i.tab,key:i.key}:null})}function Gr({className:e,children:t,...n}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...n,children:t})}function vl(e){return o.jsxs(Gr,{stroke:"url(#icon-book-open-gradient)",...e,children:[o.jsxs("linearGradient",{id:"icon-book-open-gradient",x2:"1",y2:"1",children:[o.jsx("stop",{offset:"0%",className:"primary-gradient-color-stop"}),o.jsx("stop",{offset:"100%",className:"secondary-gradient-color-stop"})]}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})]})}function Vr({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M14 20C17.3137 20 20 17.3137 20 14C20 10.6863 17.3137 8 14 8C10.6863 8 8 10.6863 8 14C8 17.3137 10.6863 20 14 20ZM18 14C18 16.2091 16.2091 18 14 18C11.7909 18 10 16.2091 10 14C10 11.7909 11.7909 10 14 10C16.2091 10 18 11.7909 18 14Z"}),o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M0 12.9996V14.9996C0 16.5478 1.17261 17.822 2.67809 17.9826C2.80588 18.3459 2.95062 18.7011 3.11133 19.0473C2.12484 20.226 2.18536 21.984 3.29291 23.0916L4.70712 24.5058C5.78946 25.5881 7.49305 25.6706 8.67003 24.7531C9.1044 24.9688 9.55383 25.159 10.0163 25.3218C10.1769 26.8273 11.4511 28 12.9993 28H14.9993C16.5471 28 17.8211 26.8279 17.9821 25.3228C18.4024 25.175 18.8119 25.0046 19.2091 24.8129C20.3823 25.6664 22.0344 25.564 23.0926 24.5058L24.5068 23.0916C25.565 22.0334 25.6674 20.3813 24.814 19.2081C25.0054 18.8113 25.1757 18.4023 25.3234 17.9824C26.8282 17.8211 28 16.5472 28 14.9996V12.9996C28 11.452 26.8282 10.1782 25.3234 10.0169C25.1605 9.55375 24.9701 9.10374 24.7541 8.66883C25.6708 7.49189 25.5882 5.78888 24.5061 4.70681L23.0919 3.29259C21.9846 2.18531 20.2271 2.12455 19.0485 3.1103C18.7017 2.94935 18.3459 2.80441 17.982 2.67647C17.8207 1.17177 16.5468 0 14.9993 0H12.9993C11.4514 0 10.1773 1.17231 10.0164 2.6775C9.60779 2.8213 9.20936 2.98653 8.82251 3.17181C7.64444 2.12251 5.83764 2.16276 4.70782 3.29259L3.2936 4.7068C2.16377 5.83664 2.12352 7.64345 3.17285 8.82152C2.98737 9.20877 2.82199 9.60763 2.67809 10.0167C1.17261 10.1773 0 11.4515 0 12.9996ZM15.9993 3C15.9993 2.44772 15.5516 2 14.9993 2H12.9993C12.447 2 11.9993 2.44772 11.9993 3V3.38269C11.9993 3.85823 11.6626 4.26276 11.2059 4.39542C10.4966 4.60148 9.81974 4.88401 9.18495 5.23348C8.76836 5.46282 8.24425 5.41481 7.90799 5.07855L7.53624 4.70681C7.14572 4.31628 6.51256 4.31628 6.12203 4.7068L4.70782 6.12102C4.31729 6.51154 4.31729 7.14471 4.70782 7.53523L5.07958 7.90699C5.41584 8.24325 5.46385 8.76736 5.23451 9.18395C4.88485 9.8191 4.6022 10.4963 4.39611 11.2061C4.2635 11.6629 3.85894 11.9996 3.38334 11.9996H3C2.44772 11.9996 2 12.4474 2 12.9996V14.9996C2 15.5519 2.44772 15.9996 3 15.9996H3.38334C3.85894 15.9996 4.26349 16.3364 4.39611 16.7931C4.58954 17.4594 4.85042 18.0969 5.17085 18.6979C5.39202 19.1127 5.34095 19.6293 5.00855 19.9617L4.70712 20.2632C4.3166 20.6537 4.3166 21.2868 4.70712 21.6774L6.12134 23.0916C6.51186 23.4821 7.14503 23.4821 7.53555 23.0916L7.77887 22.8483C8.11899 22.5081 8.65055 22.4633 9.06879 22.7008C9.73695 23.0804 10.4531 23.3852 11.2059 23.6039C11.6626 23.7365 11.9993 24.1411 11.9993 24.6166V25C11.9993 25.5523 12.447 26 12.9993 26H14.9993C15.5516 26 15.9993 25.5523 15.9993 25V24.6174C15.9993 24.1418 16.3361 23.7372 16.7929 23.6046C17.5032 23.3985 18.1809 23.1157 18.8164 22.7658C19.233 22.5365 19.7571 22.5845 20.0934 22.9208L20.2642 23.0916C20.6547 23.4821 21.2879 23.4821 21.6784 23.0916L23.0926 21.6774C23.4831 21.2868 23.4831 20.6537 23.0926 20.2632L22.9218 20.0924C22.5855 19.7561 22.5375 19.232 22.7669 18.8154C23.1166 18.1802 23.3992 17.503 23.6053 16.7931C23.7379 16.3364 24.1425 15.9996 24.6181 15.9996H25C25.5523 15.9996 26 15.5519 26 14.9996V12.9996C26 12.4474 25.5523 11.9996 25 11.9996H24.6181C24.1425 11.9996 23.7379 11.6629 23.6053 11.2061C23.3866 10.4529 23.0817 9.73627 22.7019 9.06773C22.4643 8.64949 22.5092 8.11793 22.8493 7.77781L23.0919 7.53523C23.4824 7.14471 23.4824 6.51154 23.0919 6.12102L21.6777 4.7068C21.2872 4.31628 20.654 4.31628 20.2635 4.7068L19.9628 5.00748C19.6304 5.33988 19.1137 5.39096 18.6989 5.16979C18.0976 4.84915 17.4596 4.58815 16.7929 4.39467C16.3361 4.2621 15.9993 3.85752 15.9993 3.38187V3Z"})]})}function qo(e){return{id:"info",label:"Info",icon:vl,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function ei(e){return{id:"schemas",label:"Schemas",icon:Vr,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function ti({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.948 1.5H18.052C18.9505 1.49997 19.6997 1.49995 20.2945 1.57991C20.9223 1.66432 21.4891 1.84999 21.9445 2.30546C22.4 2.76093 22.5857 3.32773 22.6701 3.95552C22.7501 4.5503 22.75 5.29953 22.75 6.19801V6.302C22.75 7.20048 22.7501 7.9497 22.6701 8.54448C22.5857 9.17228 22.4 9.73907 21.9445 10.1945C21.4891 10.65 20.9223 10.8357 20.2945 10.9201C19.6997 11.0001 18.9505 11 18.052 11H5.94801C5.04953 11 4.3003 11.0001 3.70552 10.9201C3.07773 10.8357 2.51093 10.65 2.05546 10.1945C1.59999 9.73907 1.41432 9.17228 1.32991 8.54448C1.24995 7.9497 1.24997 7.20048 1.25 6.302V6.198C1.24997 5.29952 1.24995 4.5503 1.32991 3.95552C1.41432 3.32773 1.59999 2.76093 2.05546 2.30546C2.51093 1.84999 3.07773 1.66432 3.70552 1.57991C4.3003 1.49995 5.04952 1.49997 5.948 1.5ZM3.90539 3.06654C3.44393 3.12858 3.24644 3.2358 3.11612 3.36612C2.9858 3.49643 2.87858 3.69393 2.81654 4.15539C2.7516 4.63843 2.75 5.28599 2.75 6.25C2.75 7.21401 2.7516 7.86157 2.81654 8.34461C2.87858 8.80607 2.9858 9.00357 3.11612 9.13388C3.24644 9.2642 3.44393 9.37142 3.90539 9.43347C4.38843 9.49841 5.03599 9.5 6 9.5H18C18.964 9.5 19.6116 9.49841 20.0946 9.43347C20.5561 9.37142 20.7536 9.2642 20.8839 9.13388C21.0142 9.00357 21.1214 8.80607 21.1835 8.34461C21.2484 7.86157 21.25 7.21401 21.25 6.25C21.25 5.28599 21.2484 4.63843 21.1835 4.15539C21.1214 3.69393 21.0142 3.49643 20.8839 3.36612C20.7536 3.2358 20.5561 3.12858 20.0946 3.06654C19.6116 3.00159 18.964 3 18 3H6C5.03599 3 4.38843 3.00159 3.90539 3.06654ZM5.25 6.25C5.25 5.83579 5.58579 5.5 6 5.5H8C8.41422 5.5 8.75 5.83579 8.75 6.25C8.75 6.66422 8.41422 7 8 7H6C5.58579 7 5.25 6.66422 5.25 6.25ZM10.25 6.25C10.25 5.83579 10.5858 5.5 11 5.5H18C18.4142 5.5 18.75 5.83579 18.75 6.25C18.75 6.66422 18.4142 7 18 7H11C10.5858 7 10.25 6.66422 10.25 6.25ZM5.94801 12.5H18.052C18.9505 12.5 19.6997 12.4999 20.2945 12.5799C20.9223 12.6643 21.4891 12.85 21.9445 13.3055C22.4 13.7609 22.5857 14.3277 22.6701 14.9555C22.7501 15.5503 22.75 16.2995 22.75 17.198V17.302C22.75 18.2005 22.7501 18.9497 22.6701 19.5445C22.5857 20.1723 22.4 20.7391 21.9445 21.1945C21.4891 21.65 20.9223 21.8357 20.2945 21.9201C19.6997 22.0001 18.9505 22 18.052 22H5.94801C5.04953 22 4.30031 22.0001 3.70552 21.9201C3.07773 21.8357 2.51093 21.65 2.05546 21.1945C1.59999 20.7391 1.41432 20.1723 1.32991 19.5445C1.24995 18.9497 1.24997 18.2005 1.25 17.302V17.198C1.24997 16.2995 1.24995 15.5503 1.32991 14.9555C1.41432 14.3277 1.59999 13.7609 2.05546 13.3055C2.51093 12.85 3.07773 12.6643 3.70552 12.5799C4.30031 12.4999 5.04953 12.5 5.94801 12.5ZM3.90539 14.0665C3.44393 14.1286 3.24644 14.2358 3.11612 14.3661C2.9858 14.4964 2.87858 14.6939 2.81654 15.1554C2.7516 15.6384 2.75 16.286 2.75 17.25C2.75 18.214 2.7516 18.8616 2.81654 19.3446C2.87858 19.8061 2.9858 20.0036 3.11612 20.1339C3.24644 20.2642 3.44393 20.3714 3.90539 20.4335C4.38843 20.4984 5.03599 20.5 6 20.5H18C18.964 20.5 19.6116 20.4984 20.0946 20.4335C20.5561 20.3714 20.7536 20.2642 20.8839 20.1339C21.0142 20.0036 21.1214 19.8061 21.1835 19.3446C21.2484 18.8616 21.25 18.214 21.25 17.25C21.25 16.286 21.2484 15.6384 21.1835 15.1554C21.1214 14.6939 21.0142 14.4964 20.8839 14.3661C20.7536 14.2358 20.5561 14.1286 20.0946 14.0665C19.6116 14.0016 18.964 14 18 14H6C5.03599 14 4.38843 14.0016 3.90539 14.0665ZM5.25 17.25C5.25 16.8358 5.58579 16.5 6 16.5H8C8.41422 16.5 8.75 16.8358 8.75 17.25C8.75 17.6642 8.41422 18 8 18H6C5.58579 18 5.25 17.6642 5.25 17.25ZM10.25 17.25C10.25 16.8358 10.5858 16.5 11 16.5H18C18.4142 16.5 18.75 16.8358 18.75 17.25C18.75 17.6642 18.4142 18 18 18H11C10.5858 18 10.25 17.6642 10.25 17.25Z",fill:"currentColor"})})}function Bn({className:e}){return o.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64h261.44zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64h453.44zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64h133.44z"})})}function ni({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{d:"M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224H128zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64z"}),o.jsx("path",{d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224h784zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056z"})]})}const sn={};function jl({operations:e=sn,messages:t=sn,schemas:n=sn,servers:r=sn,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l,sidebarConfig:d}){const f=g.useMemo(()=>{const p=h=>{var b;return d!=null&&d.useChannelAddressAsIdentifier?((b=e[h])==null?void 0:b.channel)??null:null};return[qo(s),{id:"servers",label:"Servers",icon:ti,isTab:!1,items:Object.keys(r),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:Bn,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var b;const m=p(h);return m!=null&&m.address?o.jsx(qe,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:(b=e[h])==null?void 0:b.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:ni,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},ei(n)]},[e,t,n,r,s,d]);return o.jsx(Qo,{sections:f,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const $t=["get","put","post","delete","options","head","patch","trace"],ri=(e,t)=>`${e} ${t}`;function mr(e,t){const n=new Map;for(const r of[e==null?void 0:e.parameters,t==null?void 0:t.parameters])if(Array.isArray(r))for(const s of r)s&&typeof s=="object"&&n.set(`${s.in}:${s.name}`,s);return Array.from(n.values())}function vt(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?$t.filter(r=>n[r]).map(r=>({key:ri(r,t),method:r,path:t})):[]})}function Jr({className:e}){return o.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 6.873a9 9 0 011 4.127 9 9 0 01-1 4.127M5 6.873a9 9 0 00-1 4.127 9 9 0 001 4.127"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8.873a6 6 0 011 3.127 6 6 0 01-1 3.127M8 8.873a6 6 0 00-1 3.127 6 6 0 001 3.127"})]})}const Ds={},Sl={},Al=[];function Nl({paths:e=Ds,webhooks:t=Ds,schemas:n=Sl,servers:r=Al,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l}){const d=g.useMemo(()=>vt(e),[e]),f=g.useMemo(()=>vt(t),[t]),p=g.useMemo(()=>{const h=r.map((m,b)=>({key:`server-${b}`,url:m}));return[qo(s),{id:"servers",label:"Servers",icon:ti,isTab:!1,items:h,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>o.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:Bn,items:d,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx(qe,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:Jr,items:f,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m.path})]})},ei(n)]},[d,f,n,r,s]);return o.jsx(Qo,{sections:p,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const El=e=>o.jsxs("svg",{width:18,height:18,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"5"}),o.jsx("path",{d:"M14 14l-3.5-3.5"})]});function si({query:e,onQueryChange:t,results:n,onSelectResult:r,onOpenChange:s}){const i=g.useRef(null),a=g.useRef(null),[c,u]=g.useState(!1),[l,d]=g.useState(-1),f="asyncapi-search-results",p=v=>`asyncapi-search-result-${v}`,{portalHost:h,rootElement:m,topOffset:b=0}=ke(),x=()=>{u(!1),d(-1)};g.useEffect(()=>(s==null||s(c),()=>s==null?void 0:s(!1)),[c,s]);const w=g.useRef(!1),N=g.useRef(!1);g.useEffect(()=>{if(!m)return;const v=()=>{w.current=!0},y=()=>{w.current=!1};return m.addEventListener("mouseenter",v),m.addEventListener("mouseleave",y),()=>{m.removeEventListener("mouseenter",v),m.removeEventListener("mouseleave",y)}},[m]),g.useEffect(()=>{if(!m)return;const v=y=>{N.current=m.contains(y.target)};return document.addEventListener("mousedown",v,!0),()=>document.removeEventListener("mousedown",v,!0)},[m]),g.useEffect(()=>{if(!m)return;const v=y=>{!(y.metaKey||y.ctrlKey)||y.key.toLowerCase()!=="k"||!(m.contains(document.activeElement)||w.current||N.current)||(y.preventDefault(),u(!0))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[m]),g.useEffect(()=>{if(!c)return;const v=requestAnimationFrame(()=>{var y;return(y=a.current)==null?void 0:y.focus()});return()=>cancelAnimationFrame(v)},[c]),g.useEffect(()=>{if(!(!c||!h))return Jo(Kr(h))},[c,h]),g.useEffect(()=>{if(!c)return;const v=y=>{y.key==="Escape"&&x()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c]),g.useEffect(()=>{if(!c)return;const v=y=>{i.current&&!i.current.contains(y.target)&&x()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]),g.useEffect(()=>{l>=n.length&&d(n.length-1)},[l,n.length]),g.useEffect(()=>{var v;l<0||(v=document.getElementById(p(l)))==null||v.scrollIntoView({block:"nearest"})},[l]);const j=c&&e.trim().length>0,E=v=>{x(),r(v)},L=v=>{if(v.key==="Escape"){v.preventDefault(),x();return}if(j){if(v.key==="ArrowDown"){v.preventDefault(),d(y=>n.length===0?-1:Math.min(y+1,n.length-1));return}if(v.key==="ArrowUp"){v.preventDefault(),d(y=>n.length===0?-1:Math.max(y-1,0));return}if(v.key==="Home"){v.preventDefault(),n.length>0&&d(0);return}if(v.key==="End"){v.preventDefault(),n.length>0&&d(n.length-1);return}if((v.key==="Enter"||v.key===" ")&&l>=0&&n[l]){v.preventDefault(),E(n[l]);return}}},z=j?`${n.length} result${n.length===1?"":"s"} found`:"",A=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>u(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",children:o.jsx(El,{})}),c&&h&&kt.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:b},children:[o.jsx("div",{className:"absolute inset-0 bg-black/30"}),o.jsxs("div",{ref:i,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsx("div",{className:"p-4",children:o.jsx("input",{ref:a,id:"asyncapi-search",type:"search",value:e,onChange:v=>t(v.target.value),onKeyDown:L,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":j,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":l>=0?p(l):void 0,className:"w-full rounded-md bg-surface px-4 py-3 text-sm text-foreground placeholder:text-foreground-muted focus:outline-none"})}),o.jsx("div",{"aria-live":"polite",className:"sr-only",children:z}),j&&o.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?o.jsx("ul",{className:"divide-y divide-border",children:n.map((v,y)=>o.jsx("li",{children:o.jsxs("button",{id:p(y),type:"button",role:"option","aria-selected":l===y,onClick:()=>E(v),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===y?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:v.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:v.location}),v.subtitle&&o.jsxs("span",{children:["• ",v.subtitle]})]})]})},v.id))}):o.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 px-4 py-1.5 text-xs text-foreground-muted",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↑"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↓"}),"to navigate"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↵"}),"to select"]}),o.jsxs("span",{className:"flex items-center gap-1",children:["Press",o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:A?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]})]}),h)]})}function oi({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),o.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function ii({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}function Dn({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}const $l=["The following is API documentation in Markdown.","Use it to answer questions about this API and help write client code.","Stick to what is documented below - do not invent endpoints, fields, or behavior."];function ai(e){return`${["> ## Agent Instructions",...$l.map(n=>`> ${n}`)].join(`
|
|
4
|
-
`)}
|
|
5
|
-
|
|
6
|
-
${e.trimStart()}`}function ci({serialize:e,onOpenChange:t}){const[n,r]=g.useState(!1),[s,i]=g.useState(!1),a=g.useRef(null),c=g.useRef(void 0),{deref:u}=ke(),l=()=>ai(e(u));g.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),g.useEffect(()=>(t==null||t(n),()=>t==null?void 0:t(!1)),[n,t]),g.useEffect(()=>{if(!n)return;const p=h=>{h.key==="Escape"&&r(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]),g.useEffect(()=>{if(!n)return;const p=h=>{a.current&&!a.current.contains(h.target)&&r(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const d=async()=>{const p=l();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:p.length,hasClipboardApi:!!navigator.clipboard,isSecureContext:window.isSecureContext});try{if(!navigator.clipboard)throw new Error("navigator.clipboard is unavailable (requires a secure context: https or localhost)");await navigator.clipboard.writeText(p),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),i(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>i(!1),2e3)}catch(h){console.error("[MarkdownExportMenu] Copy for LLM failed:",h)}r(!1)},f=()=>{const p=l(),h=new Blob([p],{type:"text/markdown"}),m=URL.createObjectURL(h);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:m}),window.open(m,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(m),3e4),r(!1)};return o.jsxs("div",{ref:a,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>r(p=>!p),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":n,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",children:[s?o.jsx(ii,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(oi,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(Et,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-[41] w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:d,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:f,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[o.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),o.jsx(Dn,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const qn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),li=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Fs=Array.from(li),zs="#/components/schemas/",Cl=e=>e.replace(/~1/g,"/").replace(/~0/g,"~"),Tl=e=>{if(!e.startsWith(zs))return;const t=e.slice(zs.length).split("/")[0];return t?Cl(t):void 0},Zr=(e,t)=>{const n=new Map,r=new Map;for(const[s,i]of Object.entries(e??{}))if(qn(i)){n.has(i)||n.set(i,s);for(const a of Fs){const c=i[a];typeof c=="object"&&c!==null&&!r.has(c)&&r.set(c,{name:s,schema:i,key:a})}}return s=>{if(!qn(s))return;const i=n.get(s);if(i!==void 0)return i;for(const a of Fs){let c=s[a];if(qn(c)&&typeof c.$ref=="string"&&t&&(c=t(c.$ref)),typeof c!="object"||c===null)continue;const u=r.get(c);if(u&&u.key===a&&u.schema.type===s.type)return u.name}}},Ke=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),xn=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>xn(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,xn(r,t)]).join(" "):Ke(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,xn(r,t)]).join(" ")):"",Ee=e=>xn(e).trim().replace(/\s+/g," "),Il=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Hs=e=>e===null||typeof e!="object",Ol=e=>{if(!Ke(e))return e;const t={};for(const[n,r]of Object.entries(e))li.has(n)||(Hs(r)||Array.isArray(r)&&r.every(Hs))&&(t[n]=r);return t},ui=(e,t,n,r,s)=>{const i=`schema-${n}`,a=(u,l,d,f)=>{const p=`components.schemas.${n}${l.length?`.${l.join(".")}`:""}`,h=`Schemas > ${r}${d.length?` > ${d.join(" > ")}`:""}`,m=Ke(u)?u.description:void 0,b=l.length?`${r}.${l.join(".")}`:r;e.push({id:`schema-${n}-${l.join("-")||"root"}`,targetId:f?Il(n,f):i,type:"schema",tab:"schemas",key:n,name:b,path:p,location:h,subtitle:m,text:Ee([Ol(u)]),schemaFocusTokens:f&&f.length>0?f:void 0})},c=(u,l=[],d=[],f=[],p=new Set)=>{if(a(u,l,d,f),!Ke(u)||p.has(u)||(p.add(u),l.length>0&&(s==null?void 0:s(u))!==void 0))return;if(Ke(u.properties))for(const[m,b]of Object.entries(u.properties))c(b,[...l,"properties",m],[...d,m],f?[...f,"properties",m]:null,p);const h=u.items;Ke(h)?c(h,[...l,"items"],[...d,"items"],f?[...f,"items"]:null,p):Array.isArray(h)&&h.forEach((m,b)=>{c(m,[...l,`items[${b}]`],[...d,`items[${b}]`],null,p)});for(const m of["allOf","oneOf","anyOf"]){const b=u[m];Array.isArray(b)&&b.forEach((x,w)=>{c(x,[...l,`${m}[${w}]`],[...d,`${m}[${w}]`],f&&m!=="allOf"?[...f,`${m}[${w}]`]:null,p)})}Ke(u.additionalProperties)&&c(u.additionalProperties,[...l,"additionalProperties"],[...d,"additionalProperties"],null,p)};c(t)};function _l(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",i=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:i,text:Ee([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,i]of Object.entries(e.servers)){const a=i,c=a.description??s,u=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:u,text:Ee([s,c,u,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const l=a.security;Array.isArray(l)&&l.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:Ee(l)});const d=a.bindings,f=Ke(d)&&a.protocol?d[a.protocol]:void 0;f!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${a.protocol} configuration`,path:`servers.${s}.bindings.${a.protocol}`,location:`Servers > ${s} > ${a.protocol} configuration`,focusSection:`binding:${a.protocol}`,text:Ee(f)})}if(e.operations)for(const[s,i]of Object.entries(e.operations)){const a=i.title??s,c=i.summary??i.description??i.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:a,path:`operations.${s}`,location:`Operations > ${a}`,subtitle:c,text:Ee([s,a,c,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const u=i.security;Array.isArray(u)&&u.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${a} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:Ee(u)});const l=i.bindings;if(Ke(l))for(const[d,f]of Object.entries(l))f!=null&&t.push({id:`operation-${s}-bindings-${d}`,targetId:`operation-${s}-bindings-${d}`,type:"operation",tab:"operations",key:s,name:`${a} > ${d} configuration`,path:`operations.${s}.bindings.${d}`,location:`Operations > ${a} > ${d} configuration`,focusSection:`binding:${d}`,text:Ee(f)})}if((n=e.components)!=null&&n.messages)for(const[s,i]of Object.entries(e.components.messages)){const a=i.title??i.name??s,c=i.summary??i.description??i.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:a,path:`components.messages.${s}`,location:`Messages > ${a}`,subtitle:c,text:Ee([s,a,c,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:Ee(i.payload)}),i.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${a} > Headers`,focusSection:"headers",text:Ee(i.headers)})}if((r=e.components)!=null&&r.schemas){const s=Zr(e.components.schemas,lt(e));for(const[i,a]of Object.entries(e.components.schemas))ui(t,a,i,i,s)}return t}function et(e){return Array.isArray?Array.isArray(e):fi(e)==="[object Array]"}function Ml(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function gr(e){return e==null?"":Ml(e)}function we(e){return typeof e=="string"}function bn(e){return typeof e=="number"}function Rl(e){return e===!0||e===!1||Pl(e)&&fi(e)=="[object Boolean]"}function di(e){return typeof e=="object"}function Pl(e){return di(e)&&e!==null}function Ie(e){return e!=null}function on(e){return!e.trim().length}function fi(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ll="Incorrect 'index' type",xr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Bl=e=>`Invalid value for key ${e}`,Dl=e=>`Pattern length exceeds max of ${e}.`,Fl=e=>`Missing ${e} property in key`,zl=e=>`Property 'weight' in key '${e}' must be a positive integer`,Hl="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Us=Object.prototype.hasOwnProperty;var Ul=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=pi(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function pi(e){let t=null,n=null,r=null,s=1,i=null;if(we(e)||et(e))r=e,t=Ws(e),n=yn(e);else{if(!Us.call(e,"name"))throw new Error(Fl("name"));const a=e.name;if(r=a,Us.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(zl(yn(a)));t=Ws(a),n=yn(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function Ws(e){return et(e)?e:e.split(".")}function yn(e){return et(e)?e.join("."):e}function Wl(e,t){const n=[];let r=!1;const s=(i,a,c,u)=>{if(Ie(i))if(!a[c])n.push(u!==void 0?{v:i,i:u}:i);else{const l=i[a[c]];if(!Ie(l))return;if(c===a.length-1&&(we(l)||bn(l)||Rl(l)||typeof l=="bigint"))n.push(u!==void 0?{v:gr(l),i:u}:gr(l));else if(et(l)){r=!0;for(let d=0,f=l.length;d<f;d+=1)s(l[d],a,c+1,d)}else a.length&&s(l,a,c+1,u)}};return s(e,we(t)?t.split("."):t,0),r?n:n[0]}const Kl={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Gl={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Vl={location:0,threshold:.6,distance:100},Jl={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Wl,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},W=Object.freeze({...Gl,...Kl,...Vl,...Jl});function Zl(e){return e>=9&&e<=13||e===32||e===160}function Xl(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let u=0;u<s.length;u++)Zl(s.charCodeAt(u))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const c=Math.round(r/Math.pow(i,.5*e))/r;return n.set(i,c),c},clear(){n.clear()}}}var Xr=class{constructor({getFn:e=W.getFn,fieldNormWeight:t=W.fieldNormWeight}={}){this.norm=Xl(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(we(this.docs[0]))for(let n=0;n<e;n++){const r=this._createStringRecord(this.docs[n],n);r&&(this.records[t++]=r)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(xr);if(we(e)){const r=this._createStringRecord(e,t);return r&&this.records.push(r),r}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(xr);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const r of e)Number.isInteger(r)&&r>=0&&t.add(r);if(t.size===0)return;this.records=this.records.filter(r=>!t.has(r.i));const n=Array.from(t).sort((r,s)=>r-s);for(const r of this.records){let s=0,i=n.length;for(;s<i;){const a=s+i>>>1;n[a]<r.i?s=a+1:i=a}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!Ie(e)||on(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let r=0,s=this.keys.length;r<s;r++){const i=this.keys[r],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Ie(a)){if(et(a)){const c=[];for(let u=0,l=a.length;u<l;u+=1){const d=a[u];if(Ie(d)){if(we(d)){if(!on(d)){const f={v:d,i:u,n:this.norm.get(d)};c.push(f)}}else if(Ie(d.v)){const f=we(d.v)?d.v:gr(d.v);if(!on(f)){const p={v:f,i:d.i,n:this.norm.get(f)};c.push(p)}}}}n.$[r]=c}else if(we(a)&&!on(a)){const c={v:a,n:this.norm.get(a)};n.$[r]=c}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function hi(e,t,{getFn:n=W.getFn,fieldNormWeight:r=W.fieldNormWeight}={}){const s=new Xr({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(pi)),s.setSources(t),s.create(),s}function Yl(e,{getFn:t=W.getFn,fieldNormWeight:n=W.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new Xr({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function Ql(e=[],t=W.minMatchCharLength){const n=[];let r=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const c=e[i];c&&r===-1?r=i:!c&&r!==-1&&(s=i-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}function ql(e,t,n,{location:r=W.location,distance:s=W.distance,threshold:i=W.threshold,findAllMatches:a=W.findAllMatches,minMatchCharLength:c=W.minMatchCharLength,includeMatches:u=W.includeMatches,ignoreLocation:l=W.ignoreLocation}={}){if(t.length>32)throw new Error(Dl(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let h=i,m=p;const b=(y,$)=>{const I=y/d;if(l)return I;const P=Math.abs(p-$);return s?I+P/s:P?1:I},x=c>1||u,w=x?Array(f):[];let N;for(;(N=e.indexOf(t,m))>-1;){const y=b(0,N);if(h=Math.min(y,h),m=N+d,x){let $=0;for(;$<d;)w[N+$]=1,$+=1}}m=-1;let j=[],E=1,L=0,z=d+f;const A=1<<d-1;for(let y=0;y<d;y+=1){let $=0,I=z;for(;$<I;)b(y,p+I)<=h?$=I:z=I,I=Math.floor((z-$)/2+$);z=I;let P=Math.max(1,p-I+1);const M=a?f:Math.min(p+I,f)+d,U=Array(M+2);U[M+1]=(1<<y)-1;for(let X=M;X>=P;X-=1){const S=X-1,k=n[e[S]];if(U[X]=(U[X+1]<<1|1)&k,y&&(U[X]|=(j[X+1]|j[X])<<1|1|j[X+1]),U[X]&A&&(E=b(y,S),E<=h)){if(h=E,m=S,L=y,m<=p)break;P=Math.max(1,2*p-m)}}if(b(y+1,p)>h)break;j=U}if(x&&m>=0){const y=Math.min(f-1,m+d-1+L);for(let $=m;$<=y;$+=1)n[e[$]]&&(w[$]=1)}const v={isMatch:m>=0,score:Math.max(.001,E)};if(x){const y=Ql(w,c);y.length?u&&(v.indices=y):v.isMatch=!1}return v}function eu(e){const t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}function Yr(e){if(e.length<=1)return e;e.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){const s=t[t.length-1],i=e[n];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const mi={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},tu=new RegExp("["+Object.keys(mi).join("")+"]","g"),Ft=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(tu,t=>mi[t]):e=>e;var Qr=class{constructor(e,{location:t=W.location,threshold:n=W.threshold,distance:r=W.distance,includeMatches:s=W.includeMatches,findAllMatches:i=W.findAllMatches,minMatchCharLength:a=W.minMatchCharLength,isCaseSensitive:c=W.isCaseSensitive,ignoreDiacritics:u=W.ignoreDiacritics,ignoreLocation:l=W.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:l},e=c?e:e.toLowerCase(),e=u?Ft(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:eu(p),startIndex:h})},f=this.pattern.length;if(f>32){let p=0;const h=f%32,m=f-h;for(;p<m;)d(this.pattern.substr(p,32),p),p+=32;if(h){const b=f-32;d(this.pattern.substr(b),b)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?Ft(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:i,threshold:a,findAllMatches:c,minMatchCharLength:u,ignoreLocation:l}=this.options,d=[];let f=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:b,startIndex:x})=>{const{isMatch:w,score:N,indices:j}=ql(e,m,b,{location:s+x,distance:i,threshold:a,findAllMatches:c,minMatchCharLength:u,includeMatches:r,ignoreLocation:l});w&&(p=!0),f+=N,w&&j&&d.push(...j)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(h.indices=Yr(d)),h}};const nu=new Set(["fuzzy","include"]);function ru(e){return e.startsWith("inverse")}const br=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,r;const s=[],i=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+i,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new Qr(e,{location:t.location??W.location,threshold:t.threshold??W.threshold,distance:t.distance??W.distance,includeMatches:t.includeMatches??W.includeMatches,findAllMatches:t.findAllMatches??W.findAllMatches,minMatchCharLength:t.minMatchCharLength??W.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??W.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??W.ignoreDiacritics,ignoreLocation:t.ignoreLocation??W.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Ks=br.length,su="\0",ou="|";function iu(e){const t=[],n=e.length;let r=0;for(;r<n;){for(;r<n&&e[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&e[s]!==" "&&e[s]!=='"';)s++;if(s<n&&e[s]==='"'){for(s++;s<n;){if(e[s]==='"'){const i=s+1;if(i>=n||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=n||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s<n&&e[s]!==" ";)s++;t.push(e.substring(r,s)),r=s}}return t}function Gs(e,t){const n=e.match(t);return n?n[1]:null}function au(e,t={}){return e.replace(/\\\|/g,su).split(ou).map(n=>{const r=iu(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=r.length;i<a;i+=1){const c=r[i];let u=!1,l=-1;for(;!u&&++l<Ks;){const d=br[l],f=Gs(c,d.multiRegex);f&&(s.push(d.create(f,t)),u=!0)}if(!u)for(l=-1;++l<Ks;){const d=br[l],f=Gs(c,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var cu=class{constructor(e,{isCaseSensitive:t=W.isCaseSensitive,ignoreDiacritics:n=W.ignoreDiacritics,includeMatches:r=W.includeMatches,minMatchCharLength:s=W.minMatchCharLength,ignoreLocation:i=W.ignoreLocation,findAllMatches:a=W.findAllMatches,location:c=W.location,threshold:u=W.threshold,distance:l=W.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:c,threshold:u,distance:l},e=t?e:e.toLowerCase(),e=n?Ft(e):e,this.pattern=e,this.query=au(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;e=r?e:e.toLowerCase(),e=s?Ft(e):e;let i=0;const a=[];let c=0,u=!1;for(let l=0,d=t.length;l<d;l+=1){const f=t[l];a.length=0,i=0,u=!1;for(let p=0,h=f.length;p<h;p+=1){const m=f[p],{isMatch:b,indices:x,score:w}=m.search(e);if(b)i+=1,c+=w,ru(m.type)&&(u=!0),n&&(nu.has(m.type)?a.push(...x):a.push(x));else{c=0,i=0,a.length=0,u=!1;break}}if(i){const p={isMatch:!0,score:c/i};return u&&(p.hasInverse=!0),n&&(p.indices=Yr(a)),p}}return{isMatch:!1,score:1}}};const yr=[];function qr(...e){yr.push(...e)}function An(e,t){for(let n=0,r=yr.length;n<r;n+=1){const s=yr[n];if(s.condition(e,t))return new s(e,t)}return new Qr(e,t)}const Nn={AND:"$and",OR:"$or"},wr={PATH:"$path",PATTERN:"$val"},kr=e=>!!(e[Nn.AND]||e[Nn.OR]),lu=e=>!!e[wr.PATH],uu=e=>!et(e)&&di(e)&&!kr(e),Vs=e=>({[Nn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function gi(e,t,{auto:n=!0}={}){const r=s=>{if(we(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=An(s,t)),u}const i=Object.keys(s),a=lu(s);if(!a&&i.length>1&&!kr(s))return r(Vs(s));if(uu(s)){const u=a?s[wr.PATH]:i[0],l=a?s[wr.PATTERN]:s[u];if(!we(l))throw new Error(Bl(u));const d={keyId:yn(u),pattern:l};return n&&(d.searcher=An(l,t)),d}const c={children:[],operator:i[0]};return i.forEach(u=>{const l=s[u];et(l)&&l.forEach(d=>{c.children.push(r(d))})}),c};return kr(e)||(e=Vs(e)),r(e)}function vr(e,{ignoreFieldNorm:t=W.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:i})=>{const a=r?r.weight:null;n*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),n}function du(e,{ignoreFieldNorm:t=W.ignoreFieldNorm}){e.forEach(n=>{n.score=vr(n.matches,{ignoreFieldNorm:t})})}var fu=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let r=e;do{e=r;const s=2*e+1,i=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),i<n&&this.comparator(t[i],t[r])>0&&(r=i),r!==e){const a=t[e];t[e]=t[r],t[r]=a}}while(r!==e)}};function pu(e){const t=[];return e.matches.forEach(n=>{if(!Ie(n.indices)||!n.indices.length)return;const r={indices:n.indices,value:n.value};n.key&&(r.key=n.key.id),n.idx>-1&&(r.refIndex=n.idx),t.push(r)}),t}function hu(e,t,{includeMatches:n=W.includeMatches,includeScore:r=W.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=pu(s)),r&&(a.score=s.score),a})}const mu=/[\p{L}\p{M}\p{N}_]+/gu,Js=new WeakSet;function gu(e){Js.has(e)||(Js.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function xu(e){if(typeof e=="function"){let t=!1;return n=>{const r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?"array containing non-strings":typeof r}.`);return r}}return e instanceof RegExp?(e.global||gu(e),t=>t.match(e)||[]):t=>t.match(mu)||[]}function jr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=xu(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=Ft(s)),r(s)}}}var bu=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=jr({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:r,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of n){this.termSearchers.push(new Qr(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=r.get(i)||0,c=Math.log(1+(s-a+.5)/(a+.5));this.idfWeights.push(c)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,r=0,s=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let l=0;l<this.termSearchers.length;l++){const d=this.termSearchers[l].searchIn(e),f=this.idfWeights[l];r+=f,d.isMatch&&(s++,n+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<l:a.add(l)))}if(s===0)return{isMatch:!1,score:1};const c=r>0?1-n/r:0,u={isMatch:!0,score:Math.max(.001,c)};return this.options.includeMatches&&t.length&&(u.indices=Yr(t)),this.combineAll&&(this.useMask?u.matchedMask=i:u.matchedTerms=a,u.termCount=this.numTerms),u}};function er(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(n);a||(a=new Map,e.docTermFieldHits.set(n,a));for(const c of i)a.set(c,(a.get(c)||0)+1),e.df.set(c,(e.df.get(c)||0)+1)}function xi(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){er(e,i,s,r);return}if(a)for(let c=0;c<n;c++){const u=a[c];if(u)if(Array.isArray(u))for(const l of u)er(e,l.v,s,r);else er(e,u.v,s,r)}}function yu(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)xi(r,s,t,n);return r}function wu(e,t,n,r){xi(e,t,n,r)}function ku(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const r=e.docTermFieldHits.get(t);if(r){for(const[s,i]of r){const a=(e.df.get(s)||0)-i;a<=0?e.df.delete(s):e.df.set(s,a)}e.docTermFieldHits.delete(t)}}function Zs(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((c,u)=>c-u);for(const c of n)ku(e,c);const r=c=>{let u=0,l=n.length;for(;u<l;){const d=u+l>>>1;n[d]<c?u=d+1:l=d}return c-u},s=n[0],i=new Map;for(const[c,u]of e.docFieldCount)i.set(c>s?r(c):c,u);e.docFieldCount=i;const a=new Map;for(const[c,u]of e.docTermFieldHits)a.set(c>s?r(c):c,u);e.docTermFieldHits=a}var tt=class{constructor(e,t,n){this.options={...W,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Ul(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=An(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Xr))throw new Error(Ll);if(this._myIndex=t||hi(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=jr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=yu(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Ie(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=jr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});wu(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let r=0,s=this._docs.length;r<s;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Zs(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,i)=>!r.has(i)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(xr);this._invertedIndex&&Zs(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:c}=this.options;if(we(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return bn(n)&&n>-1&&(p=p.slice(0,n)),p}const u=i&&bn(n)&&n>0&&we(e),l=a,d=(p,h)=>l(p,h)||p.idx-h.idx;let f;if(u){const p=new fu(n,d);we(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:c}),f=p.extractSorted()}else f=we(e)?we(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),du(f,{ignoreFieldNorm:c}),i&&f.sort(we(e)?d:l),bn(n)&&n>-1&&(f=f.slice(0,n));return hu(f,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:c,i:u,n:l})=>{if(!Ie(c))return;const d=r.searchIn(c);if(d.isMatch){const f={score:d.score,value:c,norm:l,indices:d.indices};s&&(f.matchedMask=d.matchedMask,f.matchedTerms=d.matchedTerms,f.termCount=d.termCount);const p=[f];if(!s||this._coversAllTokens(p)){const h={item:c,idx:u,matches:p};t?(h.score=vr(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=gi(e,this.options),n=this._normalizedKeys(),r=(c,u,l)=>{if(!("children"in c)){const{keyId:h,searcher:m}=c;let b;return h===null?(b=[],n.forEach((x,w)=>{b.push(...this._findMatches({key:x,value:u[w],searcher:m}))})):b=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(u,h),searcher:m}),b&&b.length?[{idx:l,item:u,matches:b}]:[]}const{children:d,operator:f}=c,p=[];for(let h=0,m=d.length;h<m;h+=1){const b=d[h],x=r(b,u,l);if(x.length)p.push(...x);else if(f===Nn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:c,i:u})=>{if(Ie(c)){const l=r(t,c,u);l.length&&(i.has(u)||(i.set(u,{idx:u,item:c,matches:[]}),a.push(i.get(u))),l.forEach(({matches:d})=>{i.get(u).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),c=t?null:[];return i.forEach(({$:u,i:l})=>{if(!Ie(u))return;const d=[];let f=!1,p=!1;if(a.forEach((h,m)=>{const b=this._findMatches({key:h,value:u[m],searcher:r});b.length?(d.push(...b),b[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const h={idx:l,item:u,matches:d};t?(h.score=vr(h.matches,{ignoreFieldNorm:n}),t.insert(h)):c.push(h)}}),c}_findMatches({key:e,value:t,searcher:n}){if(!Ie(t))return[];const r=[];if(et(t))t.forEach(({v:s,i,n:a})=>{if(!Ie(s))return;const c=n.searchIn(s);if(c.isMatch){const u={score:c.score,key:e,value:s,idx:i,norm:a,indices:c.indices,hasInverse:c.hasInverse};c.termCount!==void 0&&(u.matchedMask=c.matchedMask,u.matchedTerms=c.matchedTerms,u.termCount=c.termCount),r.push(u)}});else{const{v:s,n:i}=t,a=n.searchIn(s);if(a.isMatch){const c={score:a.score,key:e,value:s,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(c.matchedMask=a.matchedMask,c.matchedTerms=a.matchedTerms,c.termCount=a.termCount),r.push(c)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const i of s)n.add(i)}return n.size===t}};tt.version="7.5.0";tt.createIndex=hi;tt.parseIndex=Yl;tt.config=W;tt.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(Hl);return An(e,{...W,...n}).searchIn(t)};tt.parseQuery=gi;qr(cu);qr(bu);tt.use=function(...e){e.forEach(t=>qr(t))};var vu=tt;function bi(e,t,n={}){const[r,s]=g.useState(""),[i,a]=g.useState(""),c=n.debounceMs??150;g.useEffect(()=>{const f=setTimeout(()=>a(r),c);return()=>clearTimeout(f)},[r,c]);const u=g.useMemo(()=>t(e),[e,t]),l=g.useMemo(()=>new vu(u,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[u,n.threshold]),d=g.useMemo(()=>i.trim()?l.search(i.trim(),{limit:n.limit??20}).map(f=>f.item):[],[l,i,n.limit]);return{query:r,setQuery:s,results:d,searchIndex:u}}function ju(e,t={}){return bi(e,_l,t)}const Sr="search-match",yi=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Su(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=s.nextNode();i;i=s.nextNode()){const a=(i.textContent??"").toLowerCase();let c=0;for(let u=a.indexOf(n);u!==-1;u=a.indexOf(n,c)){const l=document.createRange();l.setStart(i,u),l.setEnd(i,u+n.length),r.push(l),c=u+n.length}}return r}function Au(e,t){if(!yi())return;const n=Su(e,t);if(!n.length){CSS.highlights.delete(Sr);return}CSS.highlights.set(Sr,new Highlight(...n))}function tr(){yi()&&CSS.highlights.delete(Sr)}function Xs(e,t){const n=g.useRef(null);g.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:i}=e;let a=!1;const c=l=>{if(a)return;const d=document.getElementById(r);if(!d){l<40&&setTimeout(()=>c(l+1),50);return}if(n.current!==r){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}i&&u(0)},u=l=>{if(a)return;const d=document.getElementById(r);d&&Au(d,s),l<6&&setTimeout(()=>u(l+1),100)};return setTimeout(()=>c(0),50),()=>{a=!0}},[e,...t])}function wi({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s,initialLocation:i,onLocationChange:a,getTargetId:c}){var S;const u=((S=e[0])==null?void 0:S.id)??t,l=i&&(i.tab==="servers"||n(i.tab))?i.tab:null,[d,f]=g.useState(()=>l&&l!=="servers"?l:u),[p,h]=g.useState(()=>l),m=k=>{f(k),h(k)},[b,x]=g.useState(()=>{const k={};return l&&(i!=null&&i.key)&&(k[l]=i.key),k}),w=e.some(k=>k.id===d)?d:u,N={};for(const k of r)N[k.id]=k.visible?b[k.id]??null:null;const j=(k,C)=>x(D=>({...D,[k]:C})),[E,L]=g.useState(null),[z,A]=g.useState(null),[v,y]=g.useState(null),$=k=>{n(k.tab)?m(k.tab):k.tab==="servers"&&h("servers");const C={};for(const D of r)C[D.id]=D.id===k.tab?k.key:null;x(C),L(k.focusSection??null),A(k.tab==="schemas"&&k.schemaFocusTokens?{tokens:k.schemaFocusTokens,id:k.targetId}:null),k.tab==="schemas"&&tr(),y({targetId:k.targetId,query:s,highlight:k.tab!=="schemas"})},I=(k,C)=>{m(k),x(D=>{const K={...D};for(const Z of r)Z.id!=="servers"&&(K[Z.id]=Z.id===k?C:null);return K})},P=k=>{h("servers");const C={};for(const D of r)C[D.id]=D.id==="servers"?k:null;x(C)},M=k=>{n(k)&&m(k)},U=g.useMemo(()=>{for(const k of r){const C=N[k.id];if(C)return{tab:k.id,key:C}}return null},[...r.map(k=>N[k.id])]);Xs(v,[w,E,z,...r.map(k=>N[k.id])]);const[X]=g.useState(()=>l&&(i!=null&&i.key)&&c?{targetId:c(l,i.key),query:"",highlight:!1}:null);return Xs(X,[w]),g.useEffect(()=>{a==null||a(U?{tab:U.tab,key:U.key}:{tab:w,key:null})},[w,U]),g.useEffect(()=>{s.trim()||(y(null),tr())},[s]),g.useEffect(()=>tr,[]),{effectiveTab:w,focusTab:m,navActiveSection:p??w,selected:N,setSelectedKey:j,selectedNavItem:U,handleSearchSelect:$,handleNavItemSelect:I,handleNavServerSelect:P,handleContentTabChange:M,focusSection:E,schemaFocusTarget:z}}const V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ue=e=>V(e)?e:null,Ys="^[\0-ÿ]*$",Nu=Math.pow(-2,31),Eu=Math.pow(2,31)-1,$u=Math.pow(-2,63),Cu=Math.pow(2,63)-1,Tu={null:"null",boolean:"boolean",int:"integer",long:"integer",float:"number",double:"number",bytes:"string",string:"string",fixed:"string",map:"object",array:"array",enum:"string",record:"object",uuid:"string"},es=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function zt(e){const t=es(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ar(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=zt(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Qs(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function Iu(e,t){let n=e,r=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";n=e[+s],r.oneOf!==void 0&&(r=r.oneOf[0])}return{type:n,jsonSchema:r}}function Ou(e,t,n){if(!(t===void 0||n.examples||Array.isArray(e)))switch(e){case"boolean":n.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":n.examples=[parseInt(t,10)];break;default:n.examples=[t]}}function Nr(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Er(e,t,n){const{type:r,jsonSchema:s}=Iu(e,n);Ou(r,t.example,s);function i(...a){a.forEach(c=>{let u=!0;c==="minLength"||c==="maxLength"?u=t[c]>-1:c==="multipleOf"&&(u=t[c]>0),t[c]!==void 0&&u&&(s[c]=t[c])})}switch(r){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function ts(e,t,n){t!==void 0&&(e[t]=n)}function Ht(e,t){let n={};if(Array.isArray(e))return Mu(n,e,t);const r=es(e),s=typeof e=="string"?e:r.type;switch(n.type=Tu[s],s){case"int":{n.minimum=Nu,n.maximum=Eu;break}case"long":{n.minimum=$u,n.maximum=Cu;break}case"bytes":{n.pattern=Ys;break}case"fixed":{n.pattern=Ys,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=Ht(r.values,t);break}case"array":{n.items=Ht(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=_u(r,t,n);ts(t,zt(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[zt(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=Nr(r)?{...i}:i);break}}return Ar(r,n,t),Er(s,r,n),n}function _u(e,t,n){const r=new Map;for(const s of e.fields??[]){const i=typeof s.type=="string"?t[s.type]:void 0;if(i){const a=Nr(s)?{...i}:i;Qs(s,n,s.default!==void 0),Nr(s)&&(Ar(s,a,t),Er(s.type,s,a)),r.set(s.name,a)}else{const a=Ht(s.type,t);Qs(s,n,s.default!==void 0),Ar(s,a,t),Er(s.type,s,a),r.set(s.name,a),ts(t,zt(s.type),a)}}return r}function Mu(e,t,n){const r=[];let s=null;for(const i of t){const a=Ht(i,n);(typeof i=="string"?i:es(i).type)==="null"?s=a:(r.push(a),ts(n,zt(i),a))}return s&&r.push(s),e.oneOf=r,e}function $r(e){return Ht(e,{})}const qs=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),Ru=new Set(["record","enum","array","map","fixed"]),eo=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function ns(e){const t=[];return xt(e,"schema",t,new Set),t}function xt(e,t,n,r){if(typeof e=="string"){!qs.has(e)&&!eo.test(e)&&n.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&n.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>xt(i,`${t}[${a}]`,n,r));return}if(!V(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(r.has(e))return;r.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||V(s)?xt(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!qs.has(s)&&!Ru.has(s)&&!eo.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const c=`${t}.fields[${a}]`;if(!V(i)||typeof i.name!="string"){n.push(`${c}: field must have a string "name"`);return}xt(i.type,`${c}.type`,n,r)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&n.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?n.push(`${t}: array must have "items"`):xt(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):xt(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let En=null,nr=null;const Cr=new Set;function Pu(){return nr||(nr=Promise.resolve().then(()=>require("./protoToJsonSchema-sAcBTEqG.cjs")).then(e=>{En=e.protoToJsonSchema,Cr.forEach(t=>t())})),nr}function Lu(){return En||Pu(),En}function Bu(e){return Cr.add(e),()=>Cr.delete(e)}function to(){return En!==null}function Fn(){return g.useSyncExternalStore(Bu,to,to)}const Du="x-parser-original-payload",$n="x-lib-conversion-error",Fu=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,zu=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Kt(e){return typeof e=="string"&&Fu.test(e)}function Gt(e){return typeof e=="string"&&zu.test(e)}function ki(e){return V(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function vi(e){var t,n;if(typeof e!="string")return null;if(Kt(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Gt(e)){const r=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return r?`protobuf ${r}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function ji(e){return Kt(e)?"Avro":Gt(e)?"Protobuf":null}function Hu(e,t){return t?!1:!e||Kt(e)||Gt(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Uu=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Wu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Ku(e){return typeof e=="string"||Array.isArray(e)?!0:V(e)?typeof e.type=="string"&&Wu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Uu.some(t=>t in e):!1}function jt(e,t){let n=e;if(t&&V(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=Gu(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=ki(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function Gu(e){var a;if(!ki(e))return{schema:Ue(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[Du],s=(a=Ue(n))==null?void 0:a[$n];if(typeof s=="string")return{schema:Ue(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:Ue(n)??{},schemaFormat:t,originalSchema:r};if(Kt(t)&&Ku(n)){const c=ns(n);if(c.length>0)return{schema:Ue(n)??{},schemaFormat:t,originalSchema:n,conversionError:c[0]};try{return{schema:$r(n),schemaFormat:t,originalSchema:n}}catch(u){return{schema:Ue(n)??{},schemaFormat:t,originalSchema:n,conversionError:u instanceof Error?u.message:"Failed to convert Avro schema"}}}if(Gt(t)&&typeof n=="string"){const c=Lu();if(!c)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:c(n),schemaFormat:t,originalSchema:n}}catch(u){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:u instanceof Error?u.message:"Failed to convert Protobuf schema"}}}const i=Ue(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const ue=(e,t)=>`${"#".repeat(e)} ${t}`,_=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),mt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Vu={objects:new Set,refs:new Set},zn=(e,t)=>({schemas:e??{},nameOf:Zr(e,t),referenced:new Set}),Ju=e=>`#/components/schemas/${e.replace(/~/g,"~0").replace(/\//g,"~1")}`;function wn(e,t,n,r=Vu,s=!0){if(e===null||typeof e!="object")return e;if(n&&!s){const c=mt(e)&&typeof e.$ref=="string"?e.$ref:void 0,u=c!==void 0?(t==null?void 0:t(c))??e:e,l=n.nameOf(u);if(l!==void 0)return n.referenced.add(l),{$ref:Ju(l)};const d=c!==void 0?Tl(c):void 0;if(d!==void 0&&Object.prototype.hasOwnProperty.call(n.schemas,d))return n.referenced.add(d),{$ref:c}}if(r.objects.has(e)||mt(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const c=mt(e)?e["x-parser-schema-id"]:void 0;return typeof c=="string"?{$ref:`#/components/schemas/${c} (circular)`}:"[circular reference]"}const i={objects:new Set(r.objects).add(e),refs:mt(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(c=>wn(c,t,n,i,!1));if(mt(e)&&typeof e.$ref=="string"){const c=t==null?void 0:t(e.$ref);return mt(c)||Array.isArray(c)?wn(c,t,n,i,s):{$ref:e.$ref}}const a={};for(const[c,u]of Object.entries(e))a[c]=wn(u,t,n,i,!1);return a}function Cn(e,t,n,r){if(!t)return"";const s=wn(t,n,r);return`${ue(4,`\`${_(e)}\``)}
|
|
7
|
-
|
|
8
|
-
\`\`\`json
|
|
9
|
-
${JSON.stringify(s,null,2)}
|
|
10
|
-
\`\`\``}function yt(e,t,n,r){if(!t||typeof t=="boolean")return"";const{schema:s,description:i,conversionError:a,pendingConversion:c}=jt(t,n);if(c)return`${ue(4,`\`${_(e)}\``)}
|
|
11
|
-
|
|
12
|
-
_(schema conversion still in progress)_`;if(a)return`${ue(4,`\`${_(e)}\``)}
|
|
13
|
-
|
|
14
|
-
_(could not convert schema: ${_(a)})_`;const u=i&&!s.description?{...s,description:i}:s;return Cn(e,u,n,r)}function Si(e,t){const n=[],r=new Set;for(const s of e.referenced)r.has(s)||(r.add(s),n.push(yt(s,e.schemas[s],t,e)));return n.length?[ue(2,"Referenced Schemas"),...n].join(`
|
|
15
|
-
|
|
16
|
-
`):""}function Ai(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${_(e.in)}${e.name?`: \`${_(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${_(e.bearerFormat)})`:""}`;case"openIdConnect":return"OpenID Connect";case"oauth2":return"OAuth2";case"mutualTLS":return"Mutual TLS";case"X509":return"X.509 Certificate";case"userPassword":return"User / Password";case"plain":case"scramSha256":case"scramSha512":return"SASL";case"gssapi":return"SASL (GSSAPI)";case"symmetricEncryption":return"Symmetric Encryption";case"asymmetricEncryption":return"Asymmetric Encryption";default:return _(e.type)}}function Zu(e){if(!(e!=null&&e.length))return"";const t=[];for(const n of e)if(n!=null&&n.type&&(t.push(`- **${Ai(n)}**`),n.description&&t.push(` ${_(n.description)}`),n.type==="openIdConnect"&&n.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${_(n.openIdConnectUrl)}\``),n.type==="oauth2"))for(const[r,s]of Object.entries(n.flows??{})){t.push(` - Flow \`${_(r)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${_(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${_(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${_(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${_(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
|
|
17
|
-
`)].join(`
|
|
18
|
-
|
|
19
|
-
`):""}function Ni(e){const t=[],{info:n}=e;t.push(ue(1,_(n.title)));const r=[`**Version:** ${_(n.version)}`];if(n.license&&r.push(`**License:** ${_(n.license.name)}${n.license.url?` (${_(n.license.url)})`:""}`),n.contact){const s=[n.contact.name,n.contact.email].filter(Boolean).map(_).join(" ");s&&r.push(`**Contact:** ${s}`)}if(t.push(r.join(`
|
|
20
|
-
`)),n.description&&t.push(_(n.description)),e.servers&&Object.keys(e.servers).length){const s=[ue(2,"Servers")];for(const[i,a]of Object.entries(e.servers)){s.push(ue(3,_(i)));const c=[`**Host:** \`${_(a.host)}${a.pathname?_(a.pathname):""}\``];c.push(`**Protocol:** ${_(a.protocol)}${a.protocolVersion?` ${_(a.protocolVersion)}`:""}`),a.description&&c.push(_(a.description)),s.push(c.join(`
|
|
21
|
-
`));const u=Zu(a.security);u&&s.push(u)}t.push(s.join(`
|
|
22
|
-
|
|
23
|
-
`))}return t}function rs(e,t=lt(e)){var a,c,u,l;const n=Ni(e),r=zn((a=e.components)==null?void 0:a.schemas,t);if(e.operations&&Object.keys(e.operations).length){const d=[ue(2,"Operations")];for(const[f,p]of Object.entries(e.operations)){const h=p.channel;d.push(ue(3,`${_((c=p.action)==null?void 0:c.toUpperCase())} \`${_(f)}\``));const m=[];h!=null&&h.address&&m.push(`**Channel:** \`${_(h.address)}\``),p.summary&&m.push(_(p.summary)),p.description&&m.push(_(p.description));const b=p.messages??[];b.length&&m.push(`**Messages:** ${b.map(x=>`\`${_(x.name??x.title??"message")}\``).join(", ")}`),d.push(m.join(`
|
|
24
|
-
|
|
25
|
-
`))}n.push(d.join(`
|
|
26
|
-
|
|
27
|
-
`))}const s=(u=e.components)==null?void 0:u.messages;if(s&&Object.keys(s).length){const d=[ue(2,"Messages")];for(const[f,p]of Object.entries(s)){d.push(ue(3,_(p.title??p.name??f)));const h=[];p.summary&&h.push(_(p.summary)),p.description&&h.push(_(p.description)),p.contentType&&h.push(`**Content-Type:** \`${_(p.contentType)}\``),d.push(h.join(`
|
|
28
|
-
|
|
29
|
-
`)),p.payload&&d.push(yt("payload",p.payload,t,r)),p.headers&&d.push(yt("headers",p.headers,t,r))}n.push(d.join(`
|
|
30
|
-
|
|
31
|
-
`))}const i=(l=e.components)==null?void 0:l.schemas;if(i&&Object.keys(i).length){const d=[ue(2,"Schemas")];for(const[f,p]of Object.entries(i))d.push(yt(f,p,t,r));n.push(d.join(`
|
|
32
|
-
|
|
33
|
-
`))}return n.filter(Boolean).join(`
|
|
34
|
-
|
|
35
|
-
`)}function Xu(e,t,n,r){var u;const s=t.channel,i=[ue(3,`${_((u=t.action)==null?void 0:u.toUpperCase())} \`${_(e)}\``)],a=[];s!=null&&s.address&&a.push(`**Channel:** \`${_(s.address)}\``),t.summary&&a.push(_(t.summary)),t.description&&a.push(_(t.description)),i.push(a.join(`
|
|
36
|
-
|
|
37
|
-
`));const c=t.messages??[];for(const l of c){const d=[ue(4,_(l.title??l.name??"Message"))],f=[];l.summary&&f.push(_(l.summary)),l.description&&f.push(_(l.description)),l.contentType&&f.push(`**Content-Type:** \`${_(l.contentType)}\``),f.length&&d.push(f.join(`
|
|
38
|
-
|
|
39
|
-
`)),i.push(d.join(`
|
|
40
|
-
|
|
41
|
-
`)),l.payload&&i.push(yt("payload",l.payload,n,r)),l.headers&&i.push(yt("headers",l.headers,n,r))}return i.filter(Boolean).join(`
|
|
42
|
-
|
|
43
|
-
`)}function Ei(e,t,n=lt(e)){var a,c;const r=(a=e.operations)==null?void 0:a[t];if(!r)return"";const s=Ni(e),i=zn((c=e.components)==null?void 0:c.schemas,n);return s.push(Xu(t,r,n,i)),s.push(Si(i,n)),s.filter(Boolean).join(`
|
|
44
|
-
|
|
45
|
-
`)}function Yu(e,t){if(!e.length||!t)return"";const n=new Map;for(const i of e)for(const[a,c]of Object.entries(i)){if(!c.length)continue;const u=n.get(a)??[];n.set(a,Array.from(new Set([...u,...c])))}const r=Array.from(new Set(e.flatMap(i=>Object.keys(i)))),s=[];for(const i of r){const a=t[i];if(!a)continue;const c=n.get(i);if(s.push(`- **${Ai(a)}** (\`${_(i)}\`)`),a.description&&s.push(` ${_(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${_(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[u,l]of Object.entries(a.flows??{})){s.push(` - Flow \`${_(u)}\`:`),l.authorizationUrl&&s.push(` - Authorization URL: \`${_(l.authorizationUrl)}\``),l.tokenUrl&&s.push(` - Token URL: \`${_(l.tokenUrl)}\``),l.refreshUrl&&s.push(` - Refresh URL: \`${_(l.refreshUrl)}\``);const d=c!=null&&c.length?c:Object.keys(l.scopes??{});d.length&&s.push(` - ${c!=null&&c.length?"Required scopes":"Scopes"}: ${d.map(f=>`\`${_(f)}\``).join(", ")}`)}else c!=null&&c.length&&s.push(` - Required scopes: ${c.map(u=>`\`${_(u)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
|
|
46
|
-
`)].join(`
|
|
47
|
-
|
|
48
|
-
`):""}function $i(e,t,n,r,s,i,a){var h;const c=[ue(3,`${e.toUpperCase()} \`${_(t)}\``)],u=[];n.summary&&u.push(_(n.summary)),n.description&&u.push(_(n.description)),n.deprecated&&u.push("**Deprecated**");const l=n.security??a??[],d=Yu(l,i);d&&u.push(d);for(const m of["path","query","header","cookie"]){const b=(n.parameters??[]).filter(x=>x.in===m);if(b.length){u.push(`**${m[0].toUpperCase()}${m.slice(1)} Parameters:**`);for(const x of b){const w=x.schema;u.push(`- \`${_(x.name)}\`${x.required?" (required)":""}${w!=null&&w.type?` — ${_(w.type)}`:""}${x.description?`: ${_(x.description)}`:""}`)}}}c.push(u.join(`
|
|
49
|
-
|
|
50
|
-
`));const f=((h=n.requestBody)==null?void 0:h.content)??{};for(const[m,b]of Object.entries(f))c.push([`**Request Body** (\`${_(m)}\`)`,Cn("body",b.schema,r,s)].join(`
|
|
51
|
-
|
|
52
|
-
`));const p=n.responses??{};for(const[m,b]of Object.entries(p)){const x=[ue(4,`${m}${b.description?`: ${_(b.description)}`:""}`)];for(const[w,N]of Object.entries(b.content??{}))x.push([`**Body** (\`${_(w)}\`)`,Cn("body",N.schema,r,s)].join(`
|
|
53
|
-
|
|
54
|
-
`));c.push(x.join(`
|
|
55
|
-
|
|
56
|
-
`))}return c.join(`
|
|
57
|
-
|
|
58
|
-
`)}function ss(e,t=lt(e)){var c,u,l,d,f,p;const n=[],{info:r}=e;if(n.push(ue(1,_(r.title))),n.push(`**Version:** ${_(r.version)}`),r.description&&n.push(_(r.description)),(c=e.servers)!=null&&c.length){const h=[ue(2,"Servers")];for(const m of e.servers)h.push(`- \`${_(m.url)}\`${m.description?` — ${_(m.description)}`:""}`);n.push(h.join(`
|
|
59
|
-
`))}const s=zn((u=e.components)==null?void 0:u.schemas,t),i=e.paths?vt(e.paths):[];if(i.length){const h=[ue(2,"Endpoints")];for(const{method:m,path:b}of i){const x=(d=(l=e.paths)==null?void 0:l[b])==null?void 0:d[m];x&&h.push($i(m,b,x,t,s,(f=e.components)==null?void 0:f.securitySchemes,e.security))}n.push(h.join(`
|
|
60
|
-
|
|
61
|
-
`))}const a=(p=e.components)==null?void 0:p.schemas;if(a&&Object.keys(a).length){const h=[ue(2,"Schemas")];for(const[m,b]of Object.entries(a))h.push(Cn(m,b,t,s));n.push(h.join(`
|
|
62
|
-
|
|
63
|
-
`))}return n.filter(Boolean).join(`
|
|
64
|
-
|
|
65
|
-
`)}function Ci(e,t,n,r=lt(e)){var u,l,d,f,p;const s=(l=(u=e.paths)==null?void 0:u[n])==null?void 0:l[t];if(!s)return"";const i=[],{info:a}=e;if(i.push(ue(1,_(a.title))),i.push(`**Version:** ${_(a.version)}`),a.description&&i.push(_(a.description)),(d=e.servers)!=null&&d.length){const h=[ue(2,"Servers")];for(const m of e.servers)h.push(`- \`${_(m.url)}\`${m.description?` — ${_(m.description)}`:""}`);i.push(h.join(`
|
|
66
|
-
`))}const c=zn((f=e.components)==null?void 0:f.schemas,r);return i.push($i(t,n,s,r,c,(p=e.components)==null?void 0:p.securitySchemes,e.security)),i.push(Si(c,r)),i.filter(Boolean).join(`
|
|
67
|
-
|
|
68
|
-
`)}function Hn({label:e,children:t}){return o.jsx(ut,{fallback:null,onError:n=>console.error(`[apiuikit] plugin error in slot "${e}":`,n),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function Ti(){const{plugins:e,pluginSlotRegistry:t}=Le();return g.useMemo(()=>t??Ko(e??[]),[t,e])}function Ii(e){return Ti().get(e)??[]}function Vt({name:e,context:t}){const n=Ii(e);return n.length===0?null:o.jsx(o.Fragment,{children:n.map(({id:r,pluginName:s,Component:i})=>o.jsx(Hn,{label:`${e}:${s} (${r})`,children:o.jsx(i,{...t})},r))})}function Oi(e){return Ti().get(e)??[]}const Qu=/^(https?:|data:image\/)/i;function os(e){const t=typeof e=="string";if(!t&&(typeof e!="object"||e===null))return null;const{url:n,altText:r,backgroundColor:s}=t?{url:e,altText:void 0,backgroundColor:void 0}:e;return typeof n!="string"||!Qu.test(n)?null:{url:n,altText:typeof r=="string"&&r?r:void 0,backgroundColor:typeof s=="string"?s:void 0}}const _i={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},qu=()=>Promise.resolve().then(()=>require("./LogoExtension-CWmh9Ac1.cjs"));function is(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pt=is();function Mi(e){pt=e}var Bt={exec:()=>null};function re(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(je.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var je={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},ed=/^(?:[ \t]*(?:\n|$))+/,td=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Jt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,as=/(?:[*+-]|\d{1,9}[.)])/,Ri=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pi=re(Ri).replace(/bull/g,as).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),sd=re(Ri).replace(/bull/g,as).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),cs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,od=/^[^\n]+/,ls=/(?!\s*\])(?:\\.|[^\[\]\\])+/,id=re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ls).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ad=re(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,as).getRegex(),Un="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",us=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cd=re("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",us).replace("tag",Un).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Li=re(cs).replace("hr",Jt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Un).getRegex(),ld=re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Li).getRegex(),ds={blockquote:ld,code:td,def:id,fences:nd,heading:rd,hr:Jt,html:cd,lheading:Pi,list:ad,newline:ed,paragraph:Li,table:Bt,text:od},no=re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Jt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Un).getRegex(),ud={...ds,lheading:sd,table:no,paragraph:re(cs).replace("hr",Jt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",no).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Un).getRegex()},dd={...ds,html:re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",us).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Bt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:re(cs).replace("hr",Jt).replace("heading",` *#{1,6} *[^
|
|
69
|
-
]`).replace("lheading",Pi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},fd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bi=/^( {2,}|\\)\n(?!\s*$)/,hd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wn=/[\p{P}\p{S}]/u,fs=/[\s\p{P}\p{S}]/u,Di=/[^\s\p{P}\p{S}]/u,md=re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,fs).getRegex(),Fi=/(?!~)[\p{P}\p{S}]/u,gd=/(?!~)[\s\p{P}\p{S}]/u,xd=/(?:[^\s\p{P}\p{S}]|~)/u,bd=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,zi=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,yd=re(zi,"u").replace(/punct/g,Wn).getRegex(),wd=re(zi,"u").replace(/punct/g,Fi).getRegex(),Hi="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kd=re(Hi,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,fs).replace(/punct/g,Wn).getRegex(),vd=re(Hi,"gu").replace(/notPunctSpace/g,xd).replace(/punctSpace/g,gd).replace(/punct/g,Fi).getRegex(),jd=re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,fs).replace(/punct/g,Wn).getRegex(),Sd=re(/\\(punct)/,"gu").replace(/punct/g,Wn).getRegex(),Ad=re(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Nd=re(us).replace("(?:-->|$)","-->").getRegex(),Ed=re("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Nd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Tn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$d=re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Tn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ui=re(/^!?\[(label)\]\[(ref)\]/).replace("label",Tn).replace("ref",ls).getRegex(),Wi=re(/^!?\[(ref)\](?:\[\])?/).replace("ref",ls).getRegex(),Cd=re("reflink|nolink(?!\\()","g").replace("reflink",Ui).replace("nolink",Wi).getRegex(),ps={_backpedal:Bt,anyPunctuation:Sd,autolink:Ad,blockSkip:bd,br:Bi,code:pd,del:Bt,emStrongLDelim:yd,emStrongRDelimAst:kd,emStrongRDelimUnd:jd,escape:fd,link:$d,nolink:Wi,punctuation:md,reflink:Ui,reflinkSearch:Cd,tag:Ed,text:hd,url:Bt},Td={...ps,link:re(/^!?\[(label)\]\((.*?)\)/).replace("label",Tn).getRegex(),reflink:re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Tn).getRegex()},Tr={...ps,emStrongRDelimAst:vd,emStrongLDelim:wd,url:re(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Id={...Tr,br:re(Bi).replace("{2,}","*").getRegex(),text:re(Tr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},an={normal:ds,gfm:ud,pedantic:dd},Mt={normal:ps,gfm:Tr,breaks:Id,pedantic:Td},Od={"&":"&","<":"<",">":">",'"':""","'":"'"},ro=e=>Od[e];function Fe(e,t){if(t){if(je.escapeTest.test(e))return e.replace(je.escapeReplace,ro)}else if(je.escapeTestNoEncode.test(e))return e.replace(je.escapeReplaceNoEncode,ro);return e}function so(e){try{e=encodeURI(e).replace(je.percentDecode,"%")}catch{return null}return e}function oo(e,t){var i;const n=e.replace(je.findPipe,(a,c,u)=>{let l=!1,d=c;for(;--d>=0&&u[d]==="\\";)l=!l;return l?"|":" |"}),r=n.split(je.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(je.slashPipe,"|");return r}function Rt(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function _d(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function io(e,t,n,r,s){const i=t.href,a=t.title||null,c=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,u}function Md(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
|
|
70
|
-
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[c]=a;return c.length>=s.length?i.slice(s.length):i}).join(`
|
|
71
|
-
`)}var In=class{constructor(e){se(this,"options");se(this,"rules");se(this,"lexer");this.options=e||pt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Rt(n,`
|
|
72
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Md(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Rt(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Rt(t[0],`
|
|
73
|
-
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Rt(t[0],`
|
|
74
|
-
`).split(`
|
|
75
|
-
`),r="",s="";const i=[];for(;n.length>0;){let a=!1;const c=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))c.push(n[u]),a=!0;else if(!a)c.push(n[u]);else break;n=n.slice(u);const l=c.join(`
|
|
76
|
-
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
77
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
78
|
-
${l}`:l,s=s?`${s}
|
|
79
|
-
${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,n.length===0)break;const p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const h=p,m=h.raw+`
|
|
80
|
-
`+n.join(`
|
|
81
|
-
`),b=this.blockquote(m);i[i.length-1]=b,r=r.substring(0,r.length-h.raw.length)+b.raw,s=s.substring(0,s.length-h.text.length)+b.text;break}else if((p==null?void 0:p.type)==="list"){const h=p,m=h.raw+`
|
|
82
|
-
`+n.join(`
|
|
83
|
-
`),b=this.list(m);i[i.length-1]=b,r=r.substring(0,r.length-p.raw.length)+b.raw,s=s.substring(0,s.length-h.raw.length)+b.raw,n=m.substring(i.at(-1).raw.length).split(`
|
|
84
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let u=!1,l="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let f=t[2].split(`
|
|
85
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),p=e.split(`
|
|
86
|
-
`,1)[0],h=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):h?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(p)&&(l+=p+`
|
|
87
|
-
`,e=e.substring(p.length+1),u=!0),!u){const w=this.rules.other.nextBulletRegex(m),N=this.rules.other.hrRegex(m),j=this.rules.other.fencesBeginRegex(m),E=this.rules.other.headingBeginRegex(m),L=this.rules.other.htmlBeginRegex(m);for(;e;){const z=e.split(`
|
|
88
|
-
`,1)[0];let A;if(p=z,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),A=p):A=p.replace(this.rules.other.tabCharGlobal," "),j.test(p)||E.test(p)||L.test(p)||w.test(p)||N.test(p))break;if(A.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=`
|
|
89
|
-
`+A.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(f)||E.test(f)||N.test(f))break;d+=`
|
|
90
|
-
`+p}!h&&!p.trim()&&(h=!0),l+=z+`
|
|
91
|
-
`,e=e.substring(z.length+1),f=A.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(a=!0));let b=null,x;this.options.gfm&&(b=this.rules.other.listIsTask.exec(d),b&&(x=b[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:l,task:!!b,checked:x,loose:!1,text:d,tokens:[]}),s.raw+=l}const c=s.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u=0;u<s.items.length;u++)if(this.lexer.state.top=!1,s.items[u].tokens=this.lexer.blockTokens(s.items[u].text,[]),!s.loose){const l=s.items[u].tokens.filter(f=>f.type==="space"),d=l.length>0&&l.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let u=0;u<s.items.length;u++)s.items[u].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=oo(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
92
|
-
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const c of r)this.rules.other.tableAlignRight.test(c)?i.align.push("right"):this.rules.other.tableAlignCenter.test(c)?i.align.push("center"):this.rules.other.tableAlignLeft.test(c)?i.align.push("left"):i.align.push(null);for(let c=0;c<n.length;c++)i.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:i.align[c]});for(const c of s)i.rows.push(oo(c,i.header.length).map((u,l)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[l]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
93
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Rt(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=_d(t[2],"()");if(i===-2)return;if(i>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),io(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return io(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...r[0]].length-1;let a,c,u=i,l=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(c=[...a].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&i%3&&!((i+c)%3)){l+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+l);const f=[...r[0]][0].length,p=e.slice(0,i+r.index+f+c);if(Math.min(i,c)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Ge=class Ir{constructor(t){se(this,"tokens");se(this,"options");se(this,"state");se(this,"tokenizer");se(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||pt,this.options.tokenizer=this.options.tokenizer||new In,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:je,block:an.normal,inline:Mt.normal};this.options.pedantic?(n.block=an.pedantic,n.inline=Mt.pedantic):this.options.gfm&&(n.block=an.gfm,this.options.breaks?n.inline=Mt.breaks:n.inline=Mt.gfm),this.tokenizer.rules=n}static get rules(){return{block:an,inline:Mt}}static lex(t,n){return new Ir(n).lex(t)}static lexInline(t,n){return new Ir(n).inlineTokens(t)}lex(t){t=t.replace(je.carriageReturn,`
|
|
94
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,i,a;for(this.options.pedantic&&(t=t.replace(je.tabCharGlobal," ").replace(je.spaceLine,""));t;){let c;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(l=>(c=l.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);const l=n.at(-1);c.raw.length===1&&l!==void 0?l.raw+=`
|
|
95
|
-
`:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);const l=n.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
|
|
96
|
-
`+c.raw,l.text+=`
|
|
97
|
-
`+c.text,this.inlineQueue.at(-1).src=l.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);const l=n.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
|
|
98
|
-
`+c.raw,l.text+=`
|
|
99
|
-
`+c.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title});continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let u=t;if((a=this.options.extensions)!=null&&a.startBlock){let l=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(u=t.substring(0,l+1))}if(this.state.top&&(c=this.tokenizer.paragraph(u))){const l=n.at(-1);r&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=`
|
|
100
|
-
`+c.raw,l.text+=`
|
|
101
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(c),r=u.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);const l=n.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=`
|
|
102
|
-
`+c.raw,l.text+=`
|
|
103
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(c);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var c,u,l;let r=t,s=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let d;if((u=(c=this.options.extensions)==null?void 0:c.inline)!=null&&u.some(p=>(d=p.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const p=n.at(-1);d.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,a)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if((l=this.options.extensions)!=null&&l.startInline){let p=1/0;const h=t.slice(1);let m;this.options.extensions.startInline.forEach(b=>{m=b.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(f=t.substring(0,p+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},On=class{constructor(e){se(this,"options");se(this,"parser");this.options=e||pt}space(e){return""}code({text:e,lang:t,escaped:n}){var i;const r=(i=(t||"").match(je.notSpaceStart))==null?void 0:i[0],s=e.replace(je.endingNewline,"")+`
|
|
104
|
-
`;return r?'<pre><code class="language-'+Fe(r)+'">'+(n?s:Fe(s,!0))+`</code></pre>
|
|
105
|
-
`:"<pre><code>"+(n?s:Fe(s,!0))+`</code></pre>
|
|
106
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
107
|
-
${this.parser.parse(e)}</blockquote>
|
|
108
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
109
|
-
`}hr(e){return`<hr>
|
|
110
|
-
`}list(e){const t=e.ordered,n=e.start;let r="";for(let a=0;a<e.items.length;a++){const c=e.items[a];r+=this.listitem(c)}const s=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
|
|
111
|
-
`+r+"</"+s+`>
|
|
112
|
-
`}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Fe(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
113
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
114
|
-
`}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){const i=e.rows[s];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
115
|
-
<thead>
|
|
116
|
-
`+t+`</thead>
|
|
117
|
-
`+r+`</table>
|
|
118
|
-
`}tablerow({text:e}){return`<tr>
|
|
119
|
-
${e}</tr>
|
|
120
|
-
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
121
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Fe(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=so(e);if(s===null)return r;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+Fe(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=so(e);if(s===null)return Fe(n);e=s;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${Fe(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Fe(e.text)}},hs=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ve=class Or{constructor(t){se(this,"options");se(this,"renderer");se(this,"textRenderer");this.options=t||pt,this.options.renderer=this.options.renderer||new On,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hs}static parse(t,n){return new Or(n).parse(t)}static parseInline(t,n){return new Or(n).parseInline(t)}parse(t,n=!0){var s,i;let r="";for(let a=0;a<t.length;a++){const c=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[c.type]){const l=c,d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=d||"";continue}}const u=c;switch(u.type){case"space":{r+=this.renderer.space(u);continue}case"hr":{r+=this.renderer.hr(u);continue}case"heading":{r+=this.renderer.heading(u);continue}case"code":{r+=this.renderer.code(u);continue}case"table":{r+=this.renderer.table(u);continue}case"blockquote":{r+=this.renderer.blockquote(u);continue}case"list":{r+=this.renderer.list(u);continue}case"html":{r+=this.renderer.html(u);continue}case"paragraph":{r+=this.renderer.paragraph(u);continue}case"text":{let l=u,d=this.renderer.text(l);for(;a+1<t.length&&t[a+1].type==="text";)l=t[++a],d+=`
|
|
122
|
-
`+this.renderer.text(l);n?r+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):r+=d;continue}default:{const l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,n=this.renderer){var s,i;let r="";for(let a=0;a<t.length;a++){const c=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[c.type]){const l=this.options.extensions.renderers[c.type].call({parser:this},c);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=l||"";continue}}const u=c;switch(u.type){case"escape":{r+=n.text(u);break}case"html":{r+=n.html(u);break}case"link":{r+=n.link(u);break}case"image":{r+=n.image(u);break}case"strong":{r+=n.strong(u);break}case"em":{r+=n.em(u);break}case"codespan":{r+=n.codespan(u);break}case"br":{r+=n.br(u);break}case"del":{r+=n.del(u);break}case"text":{r+=n.text(u);break}default:{const l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},fr,kn=(fr=class{constructor(e){se(this,"options");se(this,"block");this.options=e||pt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ge.lex:Ge.lexInline}provideParser(){return this.block?Ve.parse:Ve.parseInline}},se(fr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),fr),Ki=class{constructor(...e){se(this,"defaults",is());se(this,"options",this.setOptions);se(this,"parse",this.parseMarkdown(!0));se(this,"parseInline",this.parseMarkdown(!1));se(this,"Parser",Ve);se(this,"Renderer",On);se(this,"TextRenderer",hs);se(this,"Lexer",Ge);se(this,"Tokenizer",In);se(this,"Hooks",kn);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(const i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const c of a.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of a.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{const u=a[c].flat(1/0);n=n.concat(this.walkTokens(u,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=t.renderers[s.name];i?t.renderers[s.name]=function(...a){let c=s.renderer.apply(this,a);return c===!1&&(c=i.apply(this,a)),c}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new On(this.defaults);for(const i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,c=n.renderer[a],u=s[a];s[a]=(...l)=>{let d=c.apply(s,l);return d===!1&&(d=u.apply(s,l)),d||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new In(this.defaults);for(const i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,c=n.tokenizer[a],u=s[a];s[a]=(...l)=>{let d=c.apply(s,l);return d===!1&&(d=u.apply(s,l)),d}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new kn;for(const i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,c=n.hooks[a],u=s[a];kn.passThroughHooks.has(i)?s[a]=l=>{if(this.defaults.async)return Promise.resolve(c.call(s,l)).then(f=>u.call(s,f));const d=c.call(s,l);return u.call(s,d)}:s[a]=(...l)=>{let d=c.apply(s,l);return d===!1&&(d=u.apply(s,l)),d}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let c=[];return c.push(i.call(this,a)),s&&(c=c.concat(s.call(this,a))),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ge.lex(e,t??this.defaults)}parser(e,t){return Ve.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const c=i.hooks?i.hooks.provideLexer():e?Ge.lex:Ge.lexInline,u=i.hooks?i.hooks.provideParser():e?Ve.parse:Ve.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(l=>c(l,i)).then(l=>i.hooks?i.hooks.processAllTokens(l):l).then(l=>i.walkTokens?Promise.all(this.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>u(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let l=c(n,i);i.hooks&&(l=i.hooks.processAllTokens(l)),i.walkTokens&&this.walkTokens(l,i.walkTokens);let d=u(l,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(l){return a(l)}}}onError(e,t){return n=>{if(n.message+=`
|
|
123
|
-
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+Fe(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},it=new Ki;function oe(e,t){return it.parse(e,t)}oe.options=oe.setOptions=function(e){return it.setOptions(e),oe.defaults=it.defaults,Mi(oe.defaults),oe};oe.getDefaults=is;oe.defaults=pt;oe.use=function(...e){return it.use(...e),oe.defaults=it.defaults,Mi(oe.defaults),oe};oe.walkTokens=function(e,t){return it.walkTokens(e,t)};oe.parseInline=it.parseInline;oe.Parser=Ve;oe.parser=Ve.parse;oe.Renderer=On;oe.TextRenderer=hs;oe.Lexer=Ge;oe.lexer=Ge.lex;oe.Tokenizer=In;oe.Hooks=kn;oe.parse=oe;oe.options;oe.setOptions;oe.use;oe.walkTokens;oe.parseInline;Ve.parse;Ge.lex;function Rd(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const n=ao(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(co(t));const r=e.highlight(t.text,n,t.lang||"");if(r instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");co(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=ao(n),i=s?e.langPrefix+uo(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${r?t:uo(t,!0)}
|
|
124
|
-
</code></pre>`}}}}function ao(e){return(e||"").match(/\S*/)[0]}function co(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Gi=/[&<>"']/,Pd=new RegExp(Gi.source,"g"),Vi=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ld=new RegExp(Vi.source,"g"),Bd={"&":"&","<":"<",">":">",'"':""","'":"'"},lo=e=>Bd[e];function uo(e,t){if(t){if(Gi.test(e))return e.replace(Pd,lo)}else if(Vi.test(e))return e.replace(Ld,lo);return e}var Dd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Fd(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}function Zi(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Zi(n)}),e}class fo{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Xi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Qe(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const zd="</span>",po=e=>!!e.scope,Hd=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class Ud{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Xi(t)}openNode(t){if(!po(t))return;const n=Hd(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){po(t)&&(this.buffer+=zd)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const ho=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class ms{constructor(){this.rootNode=ho(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=ho({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{ms._collapse(n)}))}}class Wd extends ms{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Ud(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ut(e){return e?typeof e=="string"?e:e.source:null}function Yi(e){return ht("(?=",e,")")}function Kd(e){return ht("(?:",e,")*")}function Gd(e){return ht("(?:",e,")?")}function ht(...e){return e.map(n=>Ut(n)).join("")}function Vd(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Kn(...e){return"("+(Vd(e).capture?"":"?:")+e.map(r=>Ut(r)).join("|")+")"}function Qi(e){return new RegExp(e.toString()+"|").exec("").length-1}function Jd(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Zd=new RegExp(Kn(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function gs(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Ut(r),a="";for(;i.length>0;){const c=Zd.exec(i);if(!c){a+=i;break}a+=i.substring(0,c.index),i=i.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?a+="\\"+String(Number(c[1])+s):(a+=c[0],(c[0]==="("||/^\(\?[<']/.test(c[0]))&&n++)}return a}).map(r=>`(${r})`).join(t)}const Xd=/\b\B/,qi="[a-zA-Z]\\w*",xs="[a-zA-Z_]\\w*",ea="\\b\\d+(\\.\\d+)?",ta="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",na="\\b(0b[01]+)",Yd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Qd=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=ht(t,/.*\b/,e.binary,/\b.*/)),Qe({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Wt={begin:"\\\\[\\s\\S]",relevance:0},qd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Wt]},ef={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Wt]},tf={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Gn=function(e,t,n={}){const r=Qe({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=Kn("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ht(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},nf=Gn("//","$"),rf=Gn("/\\*","\\*/"),sf=Gn("#","$"),of={scope:"number",begin:ea,relevance:0},af={scope:"number",begin:ta,relevance:0},cf={scope:"number",begin:na,relevance:0},lf={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Wt,{begin:/\[/,end:/\]/,relevance:0,contains:[Wt]}]},uf={scope:"title",begin:qi,relevance:0},df={scope:"title",begin:xs,relevance:0},ff={begin:"\\.\\s*"+xs,relevance:0},pf=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var cn=Object.freeze({__proto__:null,APOS_STRING_MODE:qd,BACKSLASH_ESCAPE:Wt,BINARY_NUMBER_MODE:cf,BINARY_NUMBER_RE:na,COMMENT:Gn,C_BLOCK_COMMENT_MODE:rf,C_LINE_COMMENT_MODE:nf,C_NUMBER_MODE:af,C_NUMBER_RE:ta,END_SAME_AS_BEGIN:pf,HASH_COMMENT_MODE:sf,IDENT_RE:qi,MATCH_NOTHING_RE:Xd,METHOD_GUARD:ff,NUMBER_MODE:of,NUMBER_RE:ea,PHRASAL_WORDS_MODE:tf,QUOTE_STRING_MODE:ef,REGEXP_MODE:lf,RE_STARTERS_RE:Yd,SHEBANG:Qd,TITLE_MODE:uf,UNDERSCORE_IDENT_RE:xs,UNDERSCORE_TITLE_MODE:df});function hf(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function mf(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function gf(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=hf,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function xf(e,t){Array.isArray(e.illegal)&&(e.illegal=Kn(...e.illegal))}function bf(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function yf(e,t){e.relevance===void 0&&(e.relevance=1)}const wf=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=ht(n.beforeMatch,Yi(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},kf=["of","and","for","in","not","or","if","then","parent","list","value"],vf="keyword";function ra(e,t,n=vf){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,ra(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(c=>c.toLowerCase())),a.forEach(function(c){const u=c.split("|");r[u[0]]=[i,jf(u[0],u[1])]})}}function jf(e,t){return t?Number(t):Sf(e)?0:1}function Sf(e){return kf.includes(e.toLowerCase())}const mo={},st=e=>{console.error(e)},go=(e,...t)=>{console.log(`WARN: ${e}`,...t)},gt=(e,t)=>{mo[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),mo[`${e}/${t}`]=!0)},_n=new Error;function sa(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let c=1;c<=t.length;c++)a[c+r]=s[c],i[c+r]=!0,r+=Qi(t[c-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function Af(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw st("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),_n;if(typeof e.beginScope!="object"||e.beginScope===null)throw st("beginScope must be object"),_n;sa(e,e.begin,{key:"beginScope"}),e.begin=gs(e.begin,{joinWith:""})}}function Nf(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw st("skip, excludeEnd, returnEnd not compatible with endScope: {}"),_n;if(typeof e.endScope!="object"||e.endScope===null)throw st("endScope must be object"),_n;sa(e,e.end,{key:"endScope"}),e.end=gs(e.end,{joinWith:""})}}function Ef(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function $f(e){Ef(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Af(e),Nf(e)}function Cf(e){function t(a,c){return new RegExp(Ut(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=Qi(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(u=>u[1]);this.matcherRe=t(gs(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(c);if(!u)return null;const l=u.findIndex((f,p)=>p>0&&f!==void 0),d=this.matchIndexes[l];return u.splice(0,l),Object.assign(u,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const u=new n;return this.rules.slice(c).forEach(([l,d])=>u.addRule(l,d)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let l=u.exec(c);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,l=d.exec(c)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function s(a){const c=new r;return a.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),a.terminatorEnd&&c.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&c.addRule(a.illegal,{type:"illegal"}),c}function i(a,c){const u=a;if(a.isCompiled)return u;[mf,bf,$f,wf].forEach(d=>d(a,c)),e.compilerExtensions.forEach(d=>d(a,c)),a.__beforeBegin=null,[gf,xf,yf].forEach(d=>d(a,c)),a.isCompiled=!0;let l=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),l=a.keywords.$pattern,delete a.keywords.$pattern),l=l||/\w+/,a.keywords&&(a.keywords=ra(a.keywords,e.case_insensitive)),u.keywordPatternRe=t(l,!0),c&&(a.begin||(a.begin=/\B|\b/),u.beginRe=t(u.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(u.endRe=t(u.end)),u.terminatorEnd=Ut(u.end)||"",a.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(a.end?"|":"")+c.terminatorEnd)),a.illegal&&(u.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Tf(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,u)}),a.starts&&i(a.starts,c),u.matcher=s(u),u}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Qe(e.classNameAliases||{}),i(e)}function oa(e){return e?e.endsWithParent||oa(e.starts):!1}function Tf(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Qe(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:oa(e)?Qe(e,{starts:e.starts?Qe(e.starts):null}):Object.isFrozen(e)?Qe(e):e}var If="11.12.0";class Of extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const rr=Xi,xo=Qe,bo=Symbol("nomatch"),_f=7,ia=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Wd};function u(S){return c.noHighlightRe.test(S)}function l(S){let k=S.className+" ";k+=S.parentNode?S.parentNode.className:"";const C=c.languageDetectRe.exec(k);if(C){const D=v(C[1]);return D||(go(i.replace("{}",C[1])),go("Falling back to no-highlight mode for this block.",S)),D?C[1]:"no-highlight"}return k.split(/\s+/).find(D=>u(D)||v(D))}function d(S,k,C){let D="",K="";typeof k=="object"?(D=S,C=k.ignoreIllegals,K=k.language):(gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),gt("10.7.0",`Please use highlight(code, options) instead.
|
|
125
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),K=S,D=k),C===void 0&&(C=!0);const Z={code:D,language:K};U("before:highlight",Z);const he=Z.result?Z.result:f(Z.language,Z.code,C);return he.code=Z.code,U("after:highlight",he),he}function f(S,k,C,D){const K=Object.create(null);function Z(T,O){return T.keywords[O]}function he(){if(!R.keywords){ne.addText(F);return}let T=0;R.keywordPatternRe.lastIndex=0;let O=R.keywordPatternRe.exec(F),G="";for(;O;){G+=F.substring(T,O.index);const ee=fe.case_insensitive?O[0].toLowerCase():O[0],xe=Z(R,ee);if(xe){const[He,xc]=xe;if(ne.addText(G),G="",K[ee]=(K[ee]||0)+1,K[ee]<=_f&&(pe+=xc),He.startsWith("_"))G+=O[0];else{const bc=fe.classNameAliases[He]||He;ae(O[0],bc)}}else G+=O[0];T=R.keywordPatternRe.lastIndex,O=R.keywordPatternRe.exec(F)}G+=F.substring(T),ne.addText(G)}function me(){if(F==="")return;let T=null;if(typeof R.subLanguage=="string"){if(!t[R.subLanguage]){ne.addText(F);return}T=f(R.subLanguage,F,!0,q[R.subLanguage]),q[R.subLanguage]=T._top}else T=h(F,R.subLanguage.length?R.subLanguage:null);R.relevance>0&&(pe+=T.relevance),ne.__addSublanguage(T._emitter,T.language)}function ce(){R.subLanguage!=null?me():he(),F=""}function ae(T,O){T!==""&&(ne.startScope(O),ne.addText(T),ne.endScope())}function Q(T,O){let G=1;const ee=O.length-1;for(;G<=ee;){if(!T._emit[G]){G++;continue}const xe=fe.classNameAliases[T[G]]||T[G],He=O[G];xe?ae(He,xe):(F=He,he(),F=""),G++}}function B(T,O){return T.scope&&typeof T.scope=="string"&&ne.openNode(fe.classNameAliases[T.scope]||T.scope),T.beginScope&&(T.beginScope._wrap?(ae(F,fe.classNameAliases[T.beginScope._wrap]||T.beginScope._wrap),F=""):T.beginScope._multi&&(Q(T.beginScope,O),F="")),R=Object.create(T,{parent:{value:R}}),R}function Y(T,O,G){let ee=Jd(T.endRe,G);if(ee){if(T["on:end"]){const xe=new fo(T);T["on:end"](O,xe),xe.isMatchIgnored&&(ee=!1)}if(ee){for(;T.endsParent&&T.parent;)T=T.parent;return T}}if(T.endsWithParent)return Y(T.parent,O,G)}function ie(T){return R.matcher.regexIndex===0?(F+=T[0],1):($e=!0,0)}function te(T){const O=T[0],G=T.rule,ee=new fo(G),xe=[G.__beforeBegin,G["on:begin"]];for(const He of xe)if(He&&(He(T,ee),ee.isMatchIgnored))return ie(O);return G.skip?F+=O:(G.excludeBegin&&(F+=O),ce(),!G.returnBegin&&!G.excludeBegin&&(F=O)),B(G,T),G.returnBegin?0:O.length}function ge(T){const O=T[0],G=k.substring(T.index),ee=Y(R,T,G);if(!ee)return bo;const xe=R;R.endScope&&R.endScope._wrap?(ce(),ae(O,R.endScope._wrap)):R.endScope&&R.endScope._multi?(ce(),Q(R.endScope,T)):xe.skip?F+=O:(xe.returnEnd||xe.excludeEnd||(F+=O),ce(),xe.excludeEnd&&(F=O));do R.scope&&ne.closeNode(),!R.skip&&!R.subLanguage&&(pe+=R.relevance),R=R.parent;while(R!==ee.parent);return ee.starts&&B(ee.starts,T),xe.returnEnd?0:O.length}function le(){const T=[];for(let O=R;O!==fe;O=O.parent)O.scope&&T.unshift(O.scope);T.forEach(O=>ne.openNode(O))}let de={};function Se(T,O){const G=O&&O[0];if(F+=T,G==null)return ce(),0;if(de.type==="begin"&&O.type==="end"&&de.index===O.index&&G===""){if(F+=k.slice(O.index,O.index+1),!s){const ee=new Error(`0 width match regex (${S})`);throw ee.languageName=S,ee.badRule=de.rule,ee}return 1}if(de=O,O.type==="begin")return te(O);if(O.type==="illegal"&&!C){const ee=new Error('Illegal lexeme "'+G+'" for mode "'+(R.scope||"<unnamed>")+'"');throw ee.mode=R,ee}else if(O.type==="end"){const ee=ge(O);if(ee!==bo)return ee}if(O.type==="illegal"&&G==="")return O.index===k.length||(F+=`
|
|
126
|
-
`),1;if(ye>1e5&&ye>O.index*3)throw new Error("potential infinite loop, way more iterations than matches");return F+=G,G.length}const fe=v(S);if(!fe)throw st(i.replace("{}",S)),new Error('Unknown language: "'+S+'"');const H=Cf(fe);let J="",R=D||H;const q={},ne=new c.__emitter(c);le();let F="",pe=0,be=0,ye=0,$e=!1;try{if(fe.__emitTokens)fe.__emitTokens(k,ne);else{for(R.matcher.considerAll();;){ye++,$e?$e=!1:R.matcher.considerAll(),R.matcher.lastIndex=be;const T=R.matcher.exec(k);if(!T)break;const O=k.substring(be,T.index),G=Se(O,T);be=T.index+G}Se(k.substring(be))}return ne.finalize(),J=ne.toHTML(),{language:S,value:J,relevance:pe,illegal:!1,_emitter:ne,_top:R}}catch(T){if(T.message&&T.message.includes("Illegal"))return{language:S,value:rr(k),illegal:!0,relevance:0,_illegalBy:{message:T.message,index:be,context:k.slice(be-100,be+100),mode:T.mode,resultSoFar:J},_emitter:ne};if(s)return{language:S,value:rr(k),illegal:!1,relevance:0,errorRaised:T,_emitter:ne,_top:R};throw T}}function p(S){const k={value:rr(S),illegal:!1,relevance:0,_top:a,_emitter:new c.__emitter(c)};return k._emitter.addText(S),k}function h(S,k){k=k||c.languages||Object.keys(t);const C=p(S),D=k.filter(v).filter($).map(ce=>f(ce,S,!1));D.unshift(C);const K=D.sort((ce,ae)=>{if(ce.relevance!==ae.relevance)return ae.relevance-ce.relevance;if(ce.language&&ae.language){if(v(ce.language).supersetOf===ae.language)return 1;if(v(ae.language).supersetOf===ce.language)return-1}return 0}),[Z,he]=K,me=Z;return me.secondBest=he,me}function m(S,k,C){const D=k&&n[k]||C;S.classList.add("hljs"),S.classList.add(`language-${D}`)}function b(S){let k=null;const C=l(S);if(u(C))return;if(U("before:highlightElement",{el:S,language:C}),S.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",S);return}if(S.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(S)),c.throwUnescapedHTML))throw new Of("One of your code blocks includes unescaped HTML.",S.innerHTML);k=S;const D=k.textContent,K=C?d(D,{language:C,ignoreIllegals:!0}):h(D);S.innerHTML=K.value,S.dataset.highlighted="yes",m(S,C,K.language),S.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(S.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),U("after:highlightElement",{el:S,result:K,text:D})}function x(S){c=xo(c,S)}const w=()=>{E(),gt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){E(),gt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let j=!1;function E(){function S(){E()}if(document.readyState==="loading"){j||window.addEventListener("DOMContentLoaded",S,!1),j=!0;return}document.querySelectorAll(c.cssSelector).forEach(b)}function L(S,k){let C=null;try{C=k(e)}catch(D){if(st("Language definition for '{}' could not be registered.".replace("{}",S)),s)st(D);else throw D;C=a}C.name||(C.name=S),t[S]=C,C.rawDefinition=k.bind(null,e),C.aliases&&y(C.aliases,{languageName:S})}function z(S){delete t[S];for(const k of Object.keys(n))n[k]===S&&delete n[k]}function A(){return Object.keys(t)}function v(S){return S=(S||"").toLowerCase(),t[S]||t[n[S]]}function y(S,{languageName:k}){typeof S=="string"&&(S=[S]),S.forEach(C=>{n[C.toLowerCase()]=k})}function $(S){const k=v(S);return k&&!k.disableAutodetect}function I(S){S["before:highlightBlock"]&&!S["before:highlightElement"]&&(S["before:highlightElement"]=k=>{S["before:highlightBlock"](Object.assign({block:k.el},k))}),S["after:highlightBlock"]&&!S["after:highlightElement"]&&(S["after:highlightElement"]=k=>{S["after:highlightBlock"](Object.assign({block:k.el},k))})}function P(S){I(S),r.push(S)}function M(S){const k=r.indexOf(S);k!==-1&&r.splice(k,1)}function U(S,k){const C=S;r.forEach(function(D){D[C]&&D[C](k)})}function X(S){return gt("10.7.0","highlightBlock will be removed entirely in v12.0"),gt("10.7.0","Please use highlightElement now."),b(S)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:E,highlightElement:b,highlightBlock:X,configure:x,initHighlighting:w,initHighlightingOnLoad:N,registerLanguage:L,unregisterLanguage:z,listLanguages:A,getLanguage:v,registerAliases:y,autoDetection:$,inherit:xo,addPlugin:P,removePlugin:M}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=If,e.regex={concat:ht,lookahead:Yi,either:Kn,optional:Gd,anyNumberOfTimes:Kd};for(const S in cn)typeof cn[S]=="object"&&Zi(cn[S]);return Object.assign(e,cn),e},St=ia({});St.newInstance=()=>ia({});var Mf=St;St.HighlightJS=St;St.default=St;const Pe=Ji(Mf),Rf="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Pf={scope:"number",match:Rf,relevance:0};function Lf(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,Pf,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Bf(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},c=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,b,i,a],w=[...x];return w.pop(),w.push(c),h.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}function Df(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(c);const u={match:/\\"/},l={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],w={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],j=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],E=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:x,built_in:[...N,...j,"set","shopt",...E,...L]},contains:[h,e.SHEBANG(),m,f,i,a,w,c,u,l,d,n]}}const yo="[A-Za-z$_][0-9A-Za-z$_]*",Ff=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zf=["true","false","null","undefined","NaN","Infinity"],aa=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ca=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],la=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],Uf=[].concat(la,aa,ca);function Wf(e){const t=e.regex,n=(C,{after:D})=>{const K="</"+C[0].slice(1);return C.input.indexOf(K,D)!==-1},r=yo,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,D)=>{const K=C[0].length+C.index,Z=C.input[K];if(Z==="<"||Z===","){D.ignoreMatch();return}Z===">"&&(n(C,{after:K})||D.ignoreMatch());let he;const me=C.input.substring(K);if(he=me.match(/^\s*=/)){D.ignoreMatch();return}if((he=me.match(/^\s+extends\s+/))&&he.index===0){D.ignoreMatch();return}}},c={$pattern:yo,keyword:Ff,literal:zf,built_in:Uf,"variable.language":Hf},u="[0-9](_?[0-9])*",l=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,b,x,{match:/\$\d+/},f];p.contains=j.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(j)});const E=[].concat(N,p.contains),L=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...aa,...ca]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[z],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(C){return t.concat("(?!",C.join("|"),")")}const M={match:t.concat(/\b/,P([...la,"super","import","await"].map(C=>`${C}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},U={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},z]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",k={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:v},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,b,x,N,{match:/\$\d+/},f,v,{scope:"attr",match:r+t.lookahead(":"),relevance:0},k,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[z,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},U,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[z]},M,I,A,X,{match:/\$[(.]/}]}}function Kf(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,d,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${r.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},x={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},w={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,b,f,e.HASH_COMMENT_MODE]}]};return l.contains=[f,b,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,x,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,w,f]}]}}Pe.registerLanguage("json",Lf);Pe.registerLanguage("yaml",Bf);Pe.registerLanguage("bash",Df);Pe.registerLanguage("javascript",Wf);Pe.registerLanguage("python",Kf);const ua=new Ki(Rd({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!Pe.getLanguage(t))return e;try{return Pe.highlight(e,{language:t}).value}catch{return e}}}));ua.use({extensions:[{name:"link",renderer(e){return`<a class="hover:underline hover:text-secondary-600" href="${e.href}" rel="noopener noreferrer" target="_blank">${e.text}</a>`}}]});function Gf(e){return ua.parse(e)}const Vf={"--tw-prose-body":"rgb(var(--color-text-secondary) / 1)","--tw-prose-headings":"rgb(var(--color-text-primary) / 1)","--tw-prose-lead":"rgb(var(--color-text-secondary) / 1)","--tw-prose-links":"rgb(var(--color-primary-600) / 1)","--tw-prose-bold":"rgb(var(--color-text-primary) / 1)","--tw-prose-counters":"rgb(var(--color-text-muted) / 1)","--tw-prose-bullets":"rgb(var(--color-text-muted) / 1)","--tw-prose-hr":"rgb(var(--color-border) / 1)","--tw-prose-quotes":"rgb(var(--color-text-secondary) / 1)","--tw-prose-quote-borders":"rgb(var(--color-border) / 1)","--tw-prose-captions":"rgb(var(--color-text-muted) / 1)","--tw-prose-kbd":"rgb(var(--color-text-primary) / 1)","--tw-prose-code":"rgb(var(--color-text-secondary) / 1)","--tw-prose-th-borders":"rgb(var(--color-border) / 1)","--tw-prose-td-borders":"rgb(var(--color-border) / 1)"},Be=({children:e,className:t=""})=>e?typeof e!="string"?o.jsx(o.Fragment,{children:e}):o.jsx("div",{className:`prose max-w-none prose-code:before:content-none prose-code:after:content-none ${t}`,style:Vf,dangerouslySetInnerHTML:{__html:Bo.sanitize(Gf(e))}}):null;function Jf({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})})}function Zf({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function Xf({className:e,...t}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"})})}function Yf({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}function Je(e){return e.startsWith("http://")||e.startsWith("https://")}function Pt({IconClass:e,term:t,visibleTerm:n=!0,text:r,href:s,vertical:i=!1,className:a=""}){const c=s&&(Je(s)||s.startsWith("mailto:"))?s:void 0,u=c?l=>o.jsx("a",{href:c,target:"_blank",rel:"noreferrer",...l}):l=>o.jsx("div",{...l});return o.jsxs("div",{className:`${!i&&"flex"} ${a}`,children:[o.jsx("dt",{children:o.jsxs(u,{className:"flex",children:[e&&o.jsx(e,{className:"w-5 h-5",title:`${r}`,alt:`${r}`}),n?o.jsx("span",{className:"pl-2 text-sm",children:t}):o.jsx("span",{className:"sr-only",children:t})]})}),o.jsxs("dd",{className:`${i&&"pt-2"} pl-2 text-sm`,children:[!n&&o.jsx(u,{children:r}),i&&o.jsx(u,{children:r})]})]})}function bs({name:e,href:t,title:n}){const r=t&&Je(t)?t:void 0;return o.jsx("a",{className:`text-xs whitespace-nowrap break-all mt-2 rounded-md bg-neutral-300 py-[2px] px-[4px] mr-1 -mt-1 ${r&&"hover:bg-cyan-500 hover:text-white"}`,href:r,target:"_blank",rel:"noreferrer",title:n,children:e})}function Qf({license:e,externalDocs:t,contact:n,tags:r,logo:s}){const i={licenseName:(e==null?void 0:e.name)??null,licenseUrl:(e==null?void 0:e.url)??null,externalDocsTitle:(t==null?void 0:t.description)??"External documentation",externalDocsUrl:(t==null?void 0:t.url)??null,externalDocsDescription:(t==null?void 0:t.description)??null,contactName:(n==null?void 0:n.name)??null,contactUrl:(n==null?void 0:n.url)??null,contactEmail:(n==null?void 0:n.email)??null,tags:r};return o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:"hidden @lg:block mb-3",children:s}),o.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[i.licenseName&&o.jsx(Pt,{IconClass:Xf,text:`${i.licenseName} ${Ms}`,term:Ms,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Pt,{IconClass:Dn,text:Rs,href:i.externalDocsUrl,term:Rs,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Pt,{IconClass:Jf,text:`${i.contactEmail}`,term:Ic,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Pt,{IconClass:Zf,text:`${i.contactName}`,term:Tc,visibleTerm:!i.contactName,href:i.contactUrl,className:"text-foreground-secondary hover:text-green-500"})]}),o.jsx("dl",{className:"mt-[10px]",children:i.tags&&o.jsx(Pt,{IconClass:Yf,term:Oc,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:i.tags&&o.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:i.tags.map((a,c)=>{const u=a,l=u.externalDocs;return o.jsx(bs,{href:l&&l.url,title:u.description||(l&&l.description?l.description:void 0),name:u.name},c)})})})})]})}const qf=[/^x-parser-/i,/^x-lib-/i];function ep(e){return qf.some(t=>t.test(e))}const wo=new Map;function tp(e){let t=wo.get(e);return t||(t=g.lazy(_i[e]),wo.set(e,t)),t}const np=e=>e.startsWith("x-"),ys=(e,t)=>e?e[t]:void 0;function rp({source:e,pathPrefix:t}){const{showExtensions:n}=ke();if(!n||!e)return null;const r=Object.keys(e).filter(s=>np(s)&&!ep(s)&&Object.prototype.hasOwnProperty.call(_i,s));return r.length===0?null:o.jsx(o.Fragment,{children:r.map(s=>{const i=tp(s);return o.jsx(g.Suspense,{fallback:null,children:o.jsx(i,{value:ys(e,s),path:`${t}.${s}`})},s)})})}const sp=g.lazy(qu),da=e=>os(ys(e,"x-logo"))!==null;function ws({source:e}){const t=ys(e,"x-logo");return os(t)?o.jsx(g.Suspense,{fallback:null,children:o.jsx(sp,{value:t,path:"info.x-logo"})}):null}function fa({title:e,description:t,license:n,contact:r,externalDocs:s,tags:i,extensionsSource:a,layout:c,showLogo:u=!0}){const l=u?o.jsx(ws,{source:a}):null,d=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(Be,{children:t})}),f=o.jsxs(o.Fragment,{children:[o.jsx(Qf,{logo:l,license:n,externalDocs:s,contact:r,tags:i}),a&&o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:o.jsx(rp,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{title:e,content:d,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:l,layout:c})})}const pa=({title:e,description:t,license:n,externalDocs:r,contact:s,tags:i,layout:a,showLogo:c,...u})=>o.jsx(fa,{title:e,description:t,license:n,externalDocs:r,contact:s,tags:i,extensionsSource:u,layout:a,showLogo:c}),op=1500,ip=320,ap=48,cp="#011627";function lp(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}async function up(e){try{return await navigator.clipboard.writeText(e),!0}catch{return lp(e)}}function Vn({code:e,className:t,language:n="json",collapsedMaxHeight:r=ip}){const[s,i]=g.useState("idle"),a=g.useRef(void 0),[c,u]=g.useState(!1),[l,d]=g.useState(!1),[f,p]=g.useState(0),h=g.useRef(null),m=g.useRef(null),b=g.useId();g.useEffect(()=>()=>clearTimeout(a.current),[]),g.useEffect(()=>{const A=m.current;if(!A)return;const v=()=>{p(A.scrollHeight),d(A.scrollHeight>r+ap)};v();const y=new ResizeObserver(v);return y.observe(A),()=>y.disconnect()},[e,n,r]);const x=()=>{up(e).then(A=>{i(A?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),op)})},N=Pe.getLanguage(n)?Pe.highlight(e,{language:n}).value:null,j=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",E=l&&!c,L=e.replace(/\n+$/,"").split(`
|
|
127
|
-
`).length,z=()=>{var A,v;c&&(((A=h.current)==null?void 0:A.getBoundingClientRect().top)??0)<0&&((v=h.current)==null||v.scrollIntoView({block:"nearest"})),u(y=>!y)};return o.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:x,"aria-label":j,title:j,className:"absolute top-2 right-2 z-10 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:s==="copied"?o.jsx(ii,{className:"w-4 h-4 text-green-600"}):o.jsx(oi,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:m,id:b,style:l?{maxHeight:c?f:r}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${l?"overflow-y-hidden":""}`,children:N!==null?o.jsx("code",{className:`hljs language-${n}`,dangerouslySetInnerHTML:{__html:Bo.sanitize(N)}}):o.jsx("code",{className:"hljs",children:e})}),l&&o.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b transition-opacity duration-300 ease-in-out ${E?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${cp})`}})]}),l&&o.jsxs("button",{type:"button",onClick:z,"aria-expanded":c,"aria-controls":b,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[c?"Show less":`Show all ${L} lines`,o.jsx(Et,{className:`w-3 h-3 transition-transform ${c?"rotate-180":""}`})]})]})}const dp=/^x-parser-/i;function _r(e,t=new Set){if(e!==null&&typeof e=="object"){if(t.has(e))return"[circular]";t.add(e);try{if(Array.isArray(e))return e.map(r=>_r(r,t));const n={};for(const[r,s]of Object.entries(e))dp.test(r)||(n[r]=_r(s,t));return n}finally{t.delete(e)}}return e}const ha=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(_r(e),null,2);return o.jsx(Vn,{code:t})},ko=new Set,ks=e=>e.replace(/^#\//,"").split("/").pop()??e,Mr=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},fp={objects:new Set,refs:new Set},We=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:Mr(e)};const r=e.$ref,s=ks(r);if(n.has(r))return{schema:e,refLabel:s,circular:!0};const i=Ue(t(r));if(!i)return{schema:e,refLabel:s};const{schema:a}=jt(i);n.add(r);try{const c=We(a,t,n);return{schema:c.schema,refLabel:c.circular?void 0:s,circular:c.circular}}finally{n.delete(r)}},at=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return V(n)?n:null},ma=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>V(r));return n.length>0?n:null},pp=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||V(e.additionalItems)?e.additionalItems:null,hp=e=>e.contains===void 0?null:typeof e.contains=="boolean"||V(e.contains)?e.contains:null,ga=e=>e.contains!==void 0,Mn=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
128
|
-
|
|
129
|
-
${t}`:t},mp=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Ye=(e,t,n,r)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Mn(typeof s.description=="string"?s.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(s.required=Array.from(new Set([...s.required??[],...t.required]))),t.properties){s.properties={...s.properties??{}};for(const[i,a]of Object.entries(t.properties)){if(!V(a))continue;const c=s.properties[i];V(c)?s.properties[i]=Ye(c,a):s.properties[i]=a}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((i,a)=>{const c=s.items[a];return V(i)&&V(c)?Ye(c,i):V(i)?i:c}):s.items=t.items;else{const i=at(t),a=at(s);i&&a?s.items=Ye(a,i):i&&(s.items=t.items)}if(t.patternProperties&&V(t.patternProperties)){const i={...V(s.patternProperties)?s.patternProperties:{}};for(const[a,c]of Object.entries(t.patternProperties)){if(!V(c)){i[a]=c;continue}const u=i[a];V(u)?i[a]=Ye(u,c):i[a]=c}s.patternProperties=i}if(t.propertyNames!==void 0)if(V(t.propertyNames)){const i=s.propertyNames;s.propertyNames=V(i)?Ye(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(V(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=V(i)?Ye(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))mp.has(i)||a===void 0||(s[i]=a);return s},vo=(e,t,n,r)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([l,d])=>V(d)?[l,ve(d,t,n,r)]:[l,d])));const i=at(s);i&&(s.items=ve(i,t,n,r));const a=Yt(s);a!==null&&V(a)&&(s.propertyNames=ve(a,t,n,r));const c=Ct(s);c!==null&&V(c)&&(s.additionalProperties=ve(c,t,n,r));const u=vs(s);return u.length>0&&(s.patternProperties=Object.fromEntries(u.map(([l,d])=>[l,ve(d,t,n,r)]))),s},ve=(e,t,n,r=new Set)=>{if(r.has(e))return e;r.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const i=[];let a={};for(const d of s){if(!V(d))continue;const{schema:f,circular:p}=We(d,t,n);if(p)continue;const h=ve(f,t,n,r);if(h.if!==void 0){const m={if:h.if};h.then!==void 0&&(m.then=h.then),h.else!==void 0&&(m.else=h.else),i.push(m)}i.push(...ya(h)),a=Ye(a,h,t,n)}if(e.if!==void 0){const d={if:e.if};e.then!==void 0&&(d.then=e.then),e.else!==void 0&&(d.else=e.else),i.push(d)}const c={...e};delete c.allOf;const u=Object.keys(c).length>0?Ye(a,c,t,n):a,l=vo(u,t,n,r);if(i.length===1){const d=i[0];l.if=d.if,d.then!==void 0&&(l.then=d.then),d.else!==void 0&&(l.else=d.else)}else i.length>1&&(l._allOfConditionals=i);return l}return vo(e,t,n,r)}finally{r.delete(e)}},Zt=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>V(r));return n.length>0?n:null},Xt=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>V(r));return n.length>0?n:null},xa=e=>e.not===void 0?null:typeof e.not=="boolean"||V(e.not)?e.not:null,Ne=e=>xa(e)!==null,ba=e=>{const{not:t,...n}=e;return n},gp=e=>{const{if:t,then:n,else:r,...s}=e;return s},Ce=e=>e.if!==void 0,sr=e=>e===void 0?null:typeof e=="boolean"||V(e)?e:null,ya=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>V(t)):[],Te=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Yt=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||V(e.propertyNames)?e.propertyNames:null,Ct=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||V(e.additionalProperties)?e.additionalProperties:null,vs=e=>{const t=e.patternProperties;return V(t)?Object.entries(t).flatMap(([n,r])=>V(r)?[[n,r]]:[]):[]},xp=(e,t)=>`${e}.[pattern:${t}]`,Qt=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Jn=e=>{const t=Yt(e);if(t!==null&&V(t))return!0;const n=Ct(e);return n!==null&&V(n)?!0:vs(e).length>0},wa=e=>!!(Zt(e)||Xt(e)||Qt(e)||Jn(e)||e.type==="array"||e.items||e.type!==void 0),Re=e=>!(Ne(e)||Ce(e)||Te(e)||Zt(e)||Xt(e)||Qt(e)||Jn(e)||e.items||ga(e)||e.type==="array"||e.type==="object");function bp(e){if(typeof Ct(e)=="boolean")return!0;const n=Yt(e);return!!(typeof n=="boolean"||n!==null&&V(n)&&Re(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function jo(e){return typeof e.multipleOf=="number"||typeof e.minimum=="number"||typeof e.exclusiveMinimum=="number"||typeof e.maximum=="number"||typeof e.exclusiveMaximum=="number"||typeof e.minLength=="number"||typeof e.maxLength=="number"||typeof e.minItems=="number"||typeof e.maxItems=="number"||typeof e.minProperties=="number"||typeof e.maxProperties=="number"||typeof e.pattern=="string"&&e.pattern.length>0||Array.isArray(e.enum)&&e.enum.length>0||e.const!==void 0||e.uniqueItems===!0||bp(e)}const ka=(e,t)=>jo(e)?!0:t?jo(t):!1,yp=(e,t)=>{if(Ne(e)||Ce(e)||Te(e)||Zt(e)||Xt(e)||Qt(e)||Jn(e))return!0;if(e.type==="array"||e.items){if(ga(e)||ma(e)!==null)return!0;const n=at(e);if(!n)return!1;if(n.$ref&&t){const{schema:r}=We(n,t,ko),s=ve(r,t,ko);return!Re(s)}return!Re(n)}return!1};function va(e){return JSON.stringify(e)}function So(e){return typeof e=="string"?e:JSON.stringify(e)}function Oe({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function ja({children:e,mono:t=!1,title:n}){return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",title:n,children:t?o.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function wp(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function kp(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function vp(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function jp(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function Ao(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function No(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function ln({name:e,lower:t,upper:n,suffix:r}){return!t&&!n?null:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Oe,{children:String(t.value)}),o.jsx(Oe,{children:t.op})]}),o.jsx(Oe,{children:e}),n&&o.jsxs(o.Fragment,{children:[o.jsx(Oe,{children:n.op}),o.jsx(Oe,{children:String(n.value)})]}),r&&o.jsx(Oe,{children:r})]})}function vn({value:e,displayValue:t}){const n=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(So(e))},r=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(So(e)))};return o.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs font-medium text-foreground hover:bg-neutral-200",title:"Click to copy",onClick:n,onKeyDown:r,children:t??va(e)})}function Sp({schema:e}){const t=Ct(e);return typeof t!="boolean"?null:o.jsx(Oe,{children:t?"additional properties allowed":"additional properties not allowed"})}function Ap({schema:e}){const t=Yt(e);return typeof t=="boolean"?o.jsx(ja,{children:t?"any property name":"no property names"}):t!==null&&V(t)&&Re(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Oe,{children:"property name pattern:"}),o.jsx(vn,{value:t.pattern,displayValue:t.pattern})]}):null}function Eo({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,r=wp(e),s=kp(e),i=vp(e),a=jp(e),c=Ao(e,"minItems"),u=No(e,"maxItems"),l=Ao(e,"minProperties"),d=No(e,"maxProperties");return o.jsxs(o.Fragment,{children:[typeof e.multipleOf=="number"&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Oe,{children:"multiple of :"}),o.jsx(ja,{children:String(e.multipleOf)})]}),(r||s)&&o.jsx(ln,{name:t,lower:r,upper:s}),(i||a)&&o.jsx(ln,{name:t,lower:i,upper:a,suffix:"chars"}),(c||u)&&o.jsx(ln,{name:t,lower:c,upper:u,suffix:"items"}),(l||d)&&o.jsx(ln,{name:t,lower:l,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Oe,{children:"regex pattern:"}),o.jsx(vn,{value:e.pattern,displayValue:e.pattern})]}),n&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(Oe,{children:"enum values:"}),n.map((f,p)=>o.jsx(vn,{value:f},`${p}-${va(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Oe,{children:"const value:"}),o.jsx(vn,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(Oe,{children:"unique"}),o.jsx(Sp,{schema:e}),o.jsx(Ap,{schema:e})]})}function Sa({schema:e,itemSchema:t,fieldName:n,className:r="flex flex-col gap-1"}){const s=t!=null&&Re(t),i=n??"value";return o.jsxs("div",{className:r,children:[o.jsx(Eo,{schema:e,rangeName:i}),s&&o.jsx(Eo,{schema:t,rangeName:"item"})]})}const Aa=(e,t)=>{const n=Zt(e);if(n)return{text:`one of (${n.length})`};const r=Xt(e);if(r)return{text:`any of (${r.length})`};if(Ne(e)&&!wa(ba(e)))return{text:"not"};if(e.type==="array"||e.items){const l=at(e);if(l){const d=l.type;if(d==="object"){const f=l.$ref?ks(l.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof l.format=="string"?l.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let i=s?`${s}`:"type: unknown";const a=Ct(e);!Qt(e)&&a!==null&&V(a)&&(s==="object"||i==="type: unknown")&&(i=s==="object"?"object (map)":"map");const c=typeof e.format=="string"?e.format:void 0,u=t&&(s==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:c,refHint:u}},Np=(e,t)=>{if(!t)return!1;const n=Aa(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Na({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:r,format:s,refHint:i}=Aa(e,t);return o.jsxs("span",{className:n,children:[s??r,i&&!r.includes(`(${i})`)&&o.jsxs("span",{className:"text-foreground-muted",children:[" (",i,")"]})]})}const $o="ml-6";function un({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return o.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),o.jsx(Na,{schema:e})]}),ka(e)&&o.jsx(Sa,{schema:e,className:`flex flex-col gap-1 mt-1 ${$o}`}),n&&n.split(`
|
|
130
|
-
|
|
131
|
-
`).map((r,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${$o} leading-relaxed`,children:r},s))]})}function or({children:e}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:"Should Not match:"}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function Ep({value:e}){const t=e?"any value":"false schema";return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:t})}function Ea({tabs:e,selected:t,onChange:n,ariaLabel:r}){const s=g.useRef([]),i=c=>(c+e.length)%e.length,a=(c,u)=>{var d;let l=u;c.key==="ArrowRight"&&(c.preventDefault(),l=i(u+1)),c.key==="ArrowLeft"&&(c.preventDefault(),l=i(u-1)),c.key==="Home"&&(c.preventDefault(),l=0),c.key==="End"&&(c.preventDefault(),l=e.length-1),l!==u&&(n(e[l].id),(d=s.current[l])==null||d.focus())};return o.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":r,children:e.map(({id:c,label:u},l)=>{const d=c===t;return o.jsx("button",{ref:f=>{s.current[l]=f},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>n(c),onKeyDown:f=>a(f,l),className:d?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:u},c)})})}function $p({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:r,onSelectCase:s,children:i}){if(t===0)return null;const a=(n==null?void 0:n.length)===t?n:Array.from({length:t},(l,d)=>`case ${d+1}`),c=e==="anyOf"?"Any of:":"One of:",u=e==="anyOf"?"Any of cases":"One of cases";return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:c}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),o.jsx(Ea,{tabs:a.map((l,d)=>({id:String(d),label:l})),selected:String(r),onChange:l=>s(Number(l)),ariaLabel:u}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const Cp="ml-0 border-dashed border-border";function rt({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:r}=ke();return n==="none"?o.jsx("div",{children:t}):n==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${Cp}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:zr(e,r)},children:t})}function Tp({depth:e,expanded:t,onToggle:n}){const{depthColors:r}=ke(),s=zr(e,r);return o.jsxs("button",{type:"button",onClick:n,"aria-expanded":t,"aria-label":t?"Hide details":void 0,className:"cursor-pointer mt-1 flex items-center gap-1.5 shrink-0 text-left hover:opacity-80",children:[o.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:s,color:s},children:t?"−":"+"}),!t&&o.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const Ip="ml-6";function Ae({id:e,path:t,depth:n,schema:r,refLabel:s,itemSchema:i,typeLabelOverride:a,required:c,description:u,expandable:l,expanded:d,onToggle:f,showBorder:p=!0}){const{depthColors:h}=ke(),m=zr(n,h),b=r&&Np(r,s),x=l?Ip:"";let w="",N=t;if(t.endsWith("[]")){const j=t.slice(0,-2),E=j.lastIndexOf(".");E>=0?(w=j.slice(0,E+1),N=`${j.slice(E+1)}[]`):N=t}else{const j=t.lastIndexOf("."),E=t.lastIndexOf("[]"),L=Math.max(j,E);L>=0&&(w=t.slice(0,L+(t[L]==="."?1:2)),N=t.slice(L+(t[L]==="."?1:2)))}return p=p&&!d,o.jsxs("div",{id:e,className:`py-2 ${p?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[o.jsxs("span",{className:"truncate min-w-0",children:[w&&o.jsx("span",{className:"text-foreground-muted",children:w}),o.jsx("span",{className:"font-semibold",style:{color:m},children:N})]}),c&&o.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(r==null?void 0:r.readOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(r==null?void 0:r.writeOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(r==null?void 0:r.deprecated)===!0&&o.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),r?o.jsxs("div",{className:"shrink-0 text-right",children:[o.jsx(Na,{schema:r,refLabel:s}),b&&o.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",s,")"]})]}):a&&o.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:a})]}),r&&ka(r,i)&&o.jsx(Sa,{schema:r,itemSchema:i,fieldName:N,className:`flex flex-col gap-1 mt-1 ${x}`}),u&&u.split(`
|
|
132
|
-
|
|
133
|
-
`).map((j,E)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${x} leading-relaxed`,children:j},E)),l&&o.jsx(Tp,{depth:n,expanded:d,onToggle:f})]})}function ir({label:e,children:t}){return o.jsxs("div",{children:[o.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:o.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),o.jsx("div",{children:t})]})}function Op({ifContent:e,thenContent:t,elseContent:n}){return o.jsxs("div",{className:"py-2 pt-5 px-1",children:[o.jsx("div",{className:"flex flex-col items-start",children:o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border-2 border-dashed border-border rounded-md bg-surface",children:"Conditions apply:"})}),o.jsx(rt,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(ir,{label:"If schema matches:",children:e}),t!=null&&o.jsx(ir,{label:"Then schema should follow:",children:t}),n!=null&&o.jsx(ir,{label:"Else schema should follow:",children:n})]})})]})}function dn({label:e,children:t}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:e}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const _p=e=>e==="none"?"depth":e;function Me({schema:e,path:t,depth:n,required:r,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:c="depth",defaultExpanded:u=!1,ancestors:l=fp,focusTokens:d=null,focusId:f=null}){var Q;const p=_p(c),h=d!=null,b=h&&d.length===0?f??void 0:void 0,[x,w]=g.useState(u||h),[N,j]=g.useState(u);N!==u&&(j(u),w(u||h)),g.useEffect(()=>{h&&w(!0)},[h]);const[E,L]=g.useState(0),z=(Q=d==null?void 0:d[0])==null?void 0:Q.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),A=z?Number(z[1]):-1;g.useEffect(()=>{A>=0&&L(A)},[A]);const v=Fn(),{schema:y,refLabel:$,circular:I}=g.useMemo(()=>{if(l.objects.has(e)||typeof e.$ref=="string"&&l.refs.has(e.$ref))return{schema:e,refLabel:Mr(e),circular:!0};const B=We(e,i,s);return B.circular?B:{...B,schema:ve(B.schema,i,s)}},[e,i,s,l,v]),P=g.useMemo(()=>({objects:new Set(l.objects).add(e),refs:typeof e.$ref=="string"?new Set(l.refs).add(e.$ref):l.refs}),[l,e]),M=ba(gp(y)),U=!wa(M)&&(Ne(y)||Ce(y)||Te(y)),X=()=>{const B=xa(y);if(B===null)return null;if(typeof B=="boolean")return o.jsx(or,{children:o.jsx(Ep,{value:B})});const Y=We(B,i,s);if(Y.circular)return o.jsx(or,{children:o.jsx(Ae,{path:t,depth:n+1,typeLabelOverride:`↩ ${B.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ie=ve(Y.schema,i,s),te=Re(ie);return o.jsx(or,{children:te?o.jsx(un,{schema:ie,showBorder:!1}):o.jsx(Me,{schema:B,path:t,depth:n+1,refStack:s,deref:i,ancestors:P,suppressRow:!0,branchLineVariant:p,defaultExpanded:u})})},S=(B,Y)=>{if(typeof B=="boolean")return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:B?"any value":"false schema"});const ie=We(B,i,s);if(ie.circular)return o.jsx(Ae,{path:Y,depth:n+1,typeLabelOverride:`↩ ${B.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const te=ve(ie.schema,i,s);return Re(te)?o.jsx(un,{schema:te,showBorder:!1}):o.jsx(Me,{schema:B,path:Y,depth:n+1,refStack:s,deref:i,ancestors:P,suppressRow:!0,branchLineVariant:"none",defaultExpanded:u})},k=B=>{const Y=sr(B.if);if(Y===null)return null;const ie=sr(B.then),te=sr(B.else);return o.jsx(Op,{ifContent:S(Y,t),thenContent:ie!==null?S(ie,t):void 0,elseContent:te!==null?S(te,t):void 0})},C=()=>{const B=ya(y);return B.length===0?null:o.jsx(o.Fragment,{children:B.map((Y,ie)=>o.jsx("div",{children:k(Y)},ie))})};if(I)return o.jsx(Ae,{id:b,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??$??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(U){const B=o.jsxs(o.Fragment,{children:[Ne(y)&&X(),Ce(y)&&k(y),Te(y)&&C()]});return a?B:o.jsxs(o.Fragment,{children:[o.jsx(Ae,{id:b,path:t,depth:n,schema:y,refLabel:$,required:r,description:y.description,expandable:!0,expanded:x,onToggle:()=>w(Y=>!Y)}),x&&o.jsx(rt,{depth:n,lineVariant:c,children:B})]})}const D=Zt(M),K=Xt(M),Z=D??K,he=D?"oneOf":"anyOf";if(Z){const B=Z.map((J,R)=>typeof J.title=="string"?J.title:`case ${R+1}`),Y=a?1:n+1,ie=Z[E],te=We(ie,i,s),ge=te.circular?te.schema:ve(te.schema,i,s),le=!te.circular&&Re(ge),de=d&&A===E?d.slice(1):null,Se=le?o.jsx(un,{schema:ge,showBorder:!1}):o.jsx(Me,{schema:ie,path:t,depth:Y-1,refStack:s,deref:i,ancestors:P,suppressRow:!0,branchLineVariant:"none",defaultExpanded:u,focusTokens:de,focusId:f},E),fe=o.jsx($p,{variant:he,caseCount:Z.length,caseLabels:B,selectedCase:E,onSelectCase:L,children:Se}),H=o.jsxs(o.Fragment,{children:[fe,Ne(y)&&X(),Ce(y)&&k(y),Te(y)&&C()]});return a?H:o.jsxs(o.Fragment,{children:[o.jsx(Ae,{id:b,path:t,depth:n,schema:y,refLabel:$,required:r,description:y.description,expandable:!0,expanded:x,onToggle:()=>w(J=>!J)}),x&&o.jsx(rt,{depth:n,lineVariant:c,children:H})]})}const me=(B,Y,ie)=>{const te=We(B,i,s);if(te.circular)return o.jsx(Ae,{path:Y,depth:ie,typeLabelOverride:`↩ ${B.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ge=ve(te.schema,i,s);return Re(ge)?o.jsx(un,{schema:ge,showBorder:!1}):o.jsx(Me,{schema:B,path:Y,depth:ie,refStack:s,deref:i,ancestors:P,branchLineVariant:p,defaultExpanded:u})},ce=B=>{const Y=M.properties??{},ie=new Set(M.required??[]),te=Yt(M),ge=Ct(M),le=vs(M);return o.jsxs(o.Fragment,{children:[Object.entries(Y).map(([de,Se])=>{if(!V(Se))return null;const fe=d&&d[0]==="properties"&&d[1]===de?d.slice(2):null;return o.jsx(Me,{schema:Se,path:`${t}.${de}`,depth:B,required:ie.has(de),refStack:s,deref:i,ancestors:P,branchLineVariant:p,defaultExpanded:u,focusTokens:fe,focusId:f},de)}),te!==null&&V(te)&&o.jsx(dn,{label:"Property names must adhere to:",children:me(te,`${t}.[propertyName]`,B)}),le.map(([de,Se])=>o.jsx(Me,{schema:Se,path:xp(t,de),depth:B,refStack:s,deref:i,ancestors:P,branchLineVariant:p,defaultExpanded:u},de)),ge!==null&&V(ge)&&o.jsx(dn,{label:"Additional properties must adhere to:",children:me(ge,`${t}.[additionalProperty]`,B)}),Ne(y)&&X(),Ce(y)&&k(y),Te(y)&&C()]})};if(Qt(M)||Jn(M))return a?ce(n+1):o.jsxs(o.Fragment,{children:[o.jsx(Ae,{id:b,path:t,depth:n,schema:y,refLabel:$,required:r,description:y.description,expandable:!0,expanded:x,onToggle:()=>w(B=>!B)}),x&&o.jsx(rt,{depth:n,lineVariant:c,children:ce(n+1)})]});if(M.type==="array"||M.items){const B=ma(M),Y=B!==null,ie=Y?pp(M):null,te=hp(M),ge=te!==null,le=Y?null:at(M),de=le!==null,Se=Y||de||ge||Ne(y)||Ce(y)||Te(y),fe=`${t}[]`,H=a?t:fe,J=de?We(le,i,s):null,R=(J==null?void 0:J.schema)??null,q=R?ve(R,i,s):null,ne=R!==null&&(P.objects.has(R)||typeof(le==null?void 0:le.$ref)=="string"&&P.refs.has(le.$ref)),F=R!==null?{objects:new Set(P.objects).add(R),refs:typeof(le==null?void 0:le.$ref)=="string"?new Set(P.refs).add(le.$ref):P.refs}:P,pe=!Y&&!ge&&q!==null&&Re(q),be=q!=null&&q.properties?Object.entries(q.properties).filter(([,O])=>V(O)):[],ye=new Set(q&&Array.isArray(q.required)?q.required:[]),$e=!Y&&d&&d[0]==="items"?d.slice(1):null,T=O=>o.jsxs(o.Fragment,{children:[Y?o.jsxs(o.Fragment,{children:[B.map((G,ee)=>o.jsx(Me,{schema:G,path:`${t}[${ee}]`,depth:O,refStack:s,deref:i,ancestors:P,branchLineVariant:p,defaultExpanded:u},ee)),ie!==null&&typeof ie!="boolean"&&o.jsx(dn,{label:"Additional items:",children:me(ie,`${t}[*]`,O)}),ie===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):de&&(ne?o.jsx(Ae,{path:H,depth:O,typeLabelOverride:`↩ ${le.$ref??Mr(R)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):be.length>0?be.map(([G,ee])=>{const xe=$e&&$e[0]==="properties"&&$e[1]===G?$e.slice(2):null;return o.jsx(Me,{schema:ee,path:`${H}.${G}`,depth:O,required:ye.has(G),refStack:s,deref:i,ancestors:F,branchLineVariant:p,defaultExpanded:u,focusTokens:xe,focusId:f},G)}):o.jsx(Me,{schema:le,path:H,depth:O,refStack:s,deref:i,ancestors:F,branchLineVariant:p,defaultExpanded:u,focusTokens:$e,focusId:f})),ge&&o.jsx(dn,{label:"Contains at least one:",children:typeof te=="boolean"?o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:te?"any item":"impossible constraint"}):me(te,`${t}[contains]`,O)}),Ne(y)&&X(),Ce(y)&&k(y),Te(y)&&C()]});return pe&&!Ne(y)&&!Ce(y)&&!Te(y)?o.jsx(Ae,{id:b,path:fe,depth:n,schema:y,itemSchema:q,refLabel:$,required:r,description:Mn(y.description,q.description),expandable:!1,expanded:!1,onToggle:()=>{}}):pe?o.jsxs(o.Fragment,{children:[o.jsx(Ae,{id:b,path:fe,depth:n,schema:y,itemSchema:q,refLabel:$,required:r,description:Mn(y.description,q.description),expandable:!0,expanded:x,onToggle:()=>w(O=>!O)}),x&&o.jsxs(rt,{depth:n,lineVariant:c,children:[Ne(y)&&X(),Ce(y)&&k(y),Te(y)&&C()]})]}):a?Se?T(n+1):null:o.jsxs(o.Fragment,{children:[o.jsx(Ae,{id:b,path:fe,depth:n,schema:y,itemSchema:q,refLabel:$,required:r,description:y.description,expandable:Y||de||ge||Ne(y)||Ce(y)||Te(y),expanded:x,onToggle:()=>w(O=>!O)}),x&&o.jsx(rt,{depth:n,lineVariant:c,children:T(n+1)})]})}if(Ne(y)||Ce(y)||Te(y)){const B=o.jsxs(o.Fragment,{children:[Ne(y)&&X(),Ce(y)&&k(y),Te(y)&&C()]});return a?B:o.jsxs(o.Fragment,{children:[o.jsx(Ae,{id:b,path:t,depth:n,schema:y,refLabel:$,required:r,description:y.description,expandable:!0,expanded:x,onToggle:()=>w(Y=>!Y)}),x&&o.jsx(rt,{depth:n,lineVariant:c,children:B})]})}return a?null:o.jsx(Ae,{id:b,path:t,depth:n,schema:y,refLabel:$,required:r,description:y.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function js({schema:e,rootName:t,className:n="",focusTokens:r=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=ke(),c=g.useMemo(()=>new Set,[]),u=Ue(e),l=g.useMemo(()=>u?ve(u,i,c):null,[u,i,c]);if(!u||!l)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const d=t??(u.$ref?ks(u.$ref):void 0)??"schema",f=!!t;if(!yp(l,i)&&!u.$ref){if(f)return l.type==="array"||l.items?o.jsx("div",{className:n,children:o.jsx(Me,{schema:u,path:d,depth:0,refStack:c,deref:i,defaultExpanded:a,focusTokens:r,focusId:s})}):null;const h=l.type==="array"||l.items?`${d}[]`:d,m=at(l),b=m?ve(m,i,c):null,x=b!==null&&Re(b);return o.jsx("div",{className:n,children:o.jsx(Ae,{path:h,depth:0,schema:l,itemSchema:x?b:void 0,description:l.type==="array"||l.items?Mn(l.description,m==null?void 0:m.description):l.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:n,children:o.jsx(Me,{schema:u,path:d,depth:f?-1:0,refStack:c,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:r,focusId:s})})}const Mp=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function fn(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function bt(e,t=()=>{},n=new Set,r=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return Mp(i)?r.has(s)?fn(i,"null")?{type:"null"}:{}:bt(i,t,new Set,new Set(r).add(s)):{}}if(n.has(e))return fn(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return bt({...i,...s[0]},t,n,r)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return bt({...i,...s[0]},t,n,r)}if(fn(e,"object")&&e.properties&&typeof e.properties=="object"){n.add(e);try{const s={};for(const[i,a]of Object.entries(e.properties)){const c=/id$/i.test(i)&&a.type==="string"&&!a.format&&!a.examples,u=a.type==="string"&&!a.format&&!a.examples&&!a.enum;s[i]=c?{...a,format:"uuid"}:u?{...a,examples:["string"]}:bt(a,t,n,r)}return{...e,properties:s}}finally{n.delete(e)}}if(fn(e,"array")&&e.items&&typeof e.items=="object"){n.add(e);try{return{...e,items:bt(e.items,t,n,r)}}finally{n.delete(e)}}return e}function Rp({schema:e,providedExample:t}){const n=t!==void 0,[r,s]=g.useState(n?t:null),{deref:i}=ke();if(g.useEffect(()=>{if(n){s(t);return}let c=!1;return Promise.resolve().then(()=>require("./index-Ccy_JZ0T.cjs")).then(({generate:u})=>u(bt(e,i),{seed:42,useExamplesValue:!0,optionalsProbability:1})).then(u=>{c||s(u)}).catch(()=>{}),()=>{c=!0}},[e,i,n,t]),r===null)return null;const a=JSON.stringify(r,null,2);return o.jsxs("div",{children:[o.jsx(Vn,{code:a}),!n&&o.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function ct({schema:e,label:t,rootName:n,description:r,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:c,example:u,defaultView:l="example"}){const d=vi(s),f=!c&&Hu(s,a),[p,h]=g.useState(f&&l==="example"?"example":"schema");return g.useEffect(()=>{!f&&p==="example"&&h("schema")},[f,p]),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),d&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:d})]}),r&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:r})]}),o.jsx(Ea,{tabs:[...f?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:m=>h(m),ariaLabel:"Schema view toggle"})]}),a&&o.jsxs("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5 mb-2",children:["Could not convert ",ji(s)??"the"," schema, showing raw definition. ",a]}),c?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[p==="schema"&&o.jsx(js,{schema:e,rootName:n??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(ha,{schema:i??e}),p==="example"&&f&&o.jsx(Rp,{schema:e,providedExample:u})]})]})}function Ss({message:e,expanded:t,onToggleExpanded:n,paddingX:r="px-4",focusSection:s=null}){var h;const[i,a]=g.useState("payload");g.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:c}=ke(),u=Fn(),l=g.useMemo(()=>e.payload?jt(e.payload,c):null,[e.payload,c,u]),d=g.useMemo(()=>e.headers?jt(e.headers,c):null,[e.headers,c,u]),f=(h=e.examples)==null?void 0:h[0],p=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsxs("div",{className:`${r} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&o.jsxs("div",{children:[e.payload&&e.headers&&o.jsx(ft,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:m=>a(m)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&l&&o.jsx(ct,{schema:l.schema,label:"Payload",description:l.description,schemaFormat:l.schemaFormat,originalSchema:l.originalSchema,conversionError:l.conversionError,pendingConversion:l.pendingConversion,example:f==null?void 0:f.payload}),(i==="headers"||!e.payload)&&d&&o.jsx(ct,{schema:d.schema,label:"Headers",description:d.description,schemaFormat:d.schemaFormat,originalSchema:d.originalSchema,conversionError:d.conversionError,pendingConversion:d.pendingConversion,example:f==null?void 0:f.headers})]})]}),e.tags&&e.tags.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,b)=>o.jsx(bs,{name:`#${m.name}`},b))})]})})}),p&&o.jsxs("button",{onClick:n,className:"w-full flex items-center justify-center gap-1.5 py-2 border-t border-border bg-neutral-50 hover:bg-neutral-100 transition-colors text-xs text-foreground-muted hover:text-foreground-secondary",children:[o.jsx("span",{children:t?"Show less":"Show more"}),o.jsx(Et,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function Pp({messageKey:e,message:t,first:n,isSelected:r,focusSection:s}){const[i,a]=g.useState(!1);return g.useEffect(()=>{r&&a(!0)},[r]),o.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${r?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[o.jsxs("tr",{className:"",children:[o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),o.jsx("span",{className:"w-fit text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:e})]})}),o.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:t.contentType??"—"})})]}),t.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:t.correlationId.description??t.correlationId.location,children:t.correlationId.location})})]})]})})]}),o.jsx("tr",{children:o.jsx("td",{colSpan:3,className:"p-0",children:o.jsx(Ss,{message:t,expanded:i,onToggleExpanded:()=>a(c=>!c),paddingX:"px-6",focusSection:r?s:null})})})]})}function $a({messages:e,selectedKey:t,focusSection:n,layout:r}){const s=Object.entries(e),i=s.length?o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),s.map(([a,c],u)=>o.jsx(Pp,{messageKey:a,message:c,first:u===0,isSelected:t===a,focusSection:n},a))]})})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No messages defined in this AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{content:i,stickySideContent:!1,layout:r})})}function Ca({serverNames:e=[],current:t,setCurrent:n}){return o.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(r=>o.jsx("button",{type:"button",onClick:()=>n(r),"aria-current":t===r?"page":void 0,className:nt(t===r?"border-l-4 border-neutral-300 text-foreground":"text-foreground-secondary hover:text-foreground","flex items-center px-3 py-2 text-sm font-medium cursor-pointer w-full text-left"),children:o.jsx("span",{className:"truncate",children:r})},r))})}function Ta(e){return o.jsx(Gr,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}function Lp(e){return o.jsx(Gr,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}function Ia({address:e,variables:t,children:n}){return o.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[o.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[o.jsx(Lp,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(qe,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),n]})}function Oa({className:e}){return o.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:o.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}function qt({trigger:e,children:t,defaultExpanded:n=!1,forceExpanded:r=!1,ariaLabelledBy:s,className:i=""}){const[a,c]=g.useState(n),u=g.useId();return g.useEffect(()=>{r&&c(!0)},[r]),o.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${i}`,children:[o.jsxs("button",{type:"button","aria-expanded":a,"aria-controls":u,"aria-labelledby":s,onClick:()=>c(l=>!l),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,a?o.jsx(Et,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Oa,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:u,className:`grid transition-all duration-200 ease-in-out ${a?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:t})})]})}const ar={userPassword:"User/Password",oauth2:"OAuth2",apiKey:"API key",bearer:"Bearer Token",openIdConnect:"OpenID",X509:"X.509 certificate",scramSha256:"SASL",scramSha512:"SASL",plain:"SASL",gssapi:"SASL"};function cr(e){var n,r;const t=(n=e.type)==null?void 0:n.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(r=e.scheme)==null?void 0:r.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function Bp(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function Dp(e){const t=(e??[]).filter(s=>ar[cr(s)]),n=new Map;for(const s of t){const i=ar[cr(s)];n.set(i,(n.get(i)??0)+1)}const r=new Set;return t.map((s,i)=>{const a=cr(s),c=ar[a],u=(n.get(c)??0)>1?Bp(s):void 0;let l=u?`${c} (${u})`:c;return r.has(l)&&(l=`${l} #${i+1}`),r.add(l),{id:`${a}-${i}`,name:l,kind:a,scheme:s}})}function As({securities:e}){var l;const t=g.useMemo(()=>Dp(e),[e]),n=t.length>1,[r,s]=g.useState(n?null:((l=t[0])==null?void 0:l.id)??null);g.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(d=>d&&t.some(f=>f.id===d)?d:null)},[t]);const i=t.find(d=>d.id===r),a=i==null?void 0:i.kind,c=i==null?void 0:i.scheme,u=c==null?void 0:c.description;return o.jsxs("div",{children:[n&&o.jsx(ft,{tabs:t,current:r,onChange:d=>s(f=>d&&f===d?null:d||null),placeholder:"Select an authorization method"}),o.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[a==="userPassword"&&o.jsxs(pn,{description:u,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),a&&["scramSha256","scramSha512","plain"].includes(a)&&o.jsxs(pn,{description:u,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),a==="gssapi"&&o.jsxs(pn,{description:u,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),a==="X509"&&o.jsxs(pn,{description:u,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),a==="bearer"&&o.jsx(Fp,{security:c}),a==="apiKey"&&o.jsx(zp,{security:c}),a==="openIdConnect"&&o.jsx(Hp,{security:c}),a==="oauth2"&&o.jsx(Up,{security:c})]})]})}const pn=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(Be,{children:e})}):o.jsx("span",{children:t}),Fp=({security:e})=>e!=null&&e.description?o.jsx(Be,{children:e.description}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide a bearer token"})," ","in the ",o.jsx("code",{children:"Authorization"})," header",e!=null&&e.bearerFormat?o.jsxs(o.Fragment,{children:[" (format: ",e.bearerFormat,")"]}):null," to connect to this server."]}),zp=({security:e})=>{if(e!=null&&e.description)return o.jsx(Be,{children:e.description});const t=e==null?void 0:e.in;return t==="header"||t==="query"||t==="cookie"?o.jsxs("span",{children:["You have to"," ",o.jsxs("strong",{className:"text-foreground-secondary",children:["provide your API key in the ",t," parameter",e!=null&&e.name?o.jsxs(o.Fragment,{children:[" named ",o.jsx("code",{children:e.name})]}):null]})," ","to connect to this server."]}):t==="password"?o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the password and leave the user name empty"})," ","to connect to this server."]}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the user name and leave the password empty"})," ","to connect to this server."]})},Hp=({security:e})=>{var n,r;const t=(n=e.requiredScopes)!=null&&n.length?e.requiredScopes:e.scopes;return o.jsxs(o.Fragment,{children:[e!=null&&e.description?o.jsx(Be,{children:e.description}):o.jsx("p",{children:"You can use OpenID to connect to this server."}),o.jsxs("p",{children:["The OpenID Connect URL is"," ",Je(e.openIdConnectUrl??"")?o.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}):e.openIdConnectUrl,"."]}),t&&t.length>0&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(r=e.requiredScopes)!=null&&r.length?"Required scopes":"Scopes"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("code",{children:cl(t)})})]})]})},Up=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(Be,{children:e.description}),t&&Object.entries(t).map(([n,r])=>{var u,l;let s="",i="";switch(n){case"clientCredentials":s=Rc,i=Pc;break;case"implicit":s=_c,i=Mc;break;case"password":s=Lc,i=Bc;break;case"authorizationCode":s=Dc,i=Fc;break}const a=(u=e.requiredScopes)!=null&&u.length?e.requiredScopes:r.availableScopes??r.scopes,c=(l=e.requiredScopes)!=null&&l.length?"Required scopes":"Available scopes";return o.jsxs("div",{children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:i})]}),o.jsx("div",{className:"mt-5 border-t border-border",children:o.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[r.authorizationUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:Je(r.authorizationUrl)?o.jsx("a",{href:r.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.authorizationUrl}):r.authorizationUrl})]}),r.tokenUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:Je(r.tokenUrl)?o.jsx("a",{href:r.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.tokenUrl}):r.tokenUrl})]}),r.refreshUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:Je(r.refreshUrl)?o.jsx("a",{href:r.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.refreshUrl}):r.refreshUrl})]}),a&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:c}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(a)?a:Object.keys(a)).map(d=>o.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:d},d))})})]})]})})]},n)})]})};function _a(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Ma({value:e}){if(e==null)return null;if(typeof e=="string"&&Je(e))return o.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 underline underline-offset-2 break-all hover:text-blue-800",children:e});if(typeof e=="boolean")return o.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return o.jsx("span",{className:"text-xs font-mono text-blue-600",children:e});if(typeof e=="object"){const t=e;return"type"in t&&Array.isArray(t.enum)?o.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,r)=>o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},r))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?o.jsx(Be,{className:"prose-sm",children:t.description}):o.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,r])=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:_a(n)}),o.jsx(Ma,{value:r})]},n))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Ra({bindings:e,expand:t=!1,protocol:n,focused:r}){const s=Uc[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},i=Object.entries(e??{}).filter(([a,c])=>a!=="bindingVersion"&&c!==void 0&&c!==null);return i.length===0?null:o.jsx(qt,{className:"mt-2",defaultExpanded:t,forceExpanded:r,trigger:o.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label}),children:o.jsx("div",{className:"divide-y divide-neutral-100",children:i.length===0?o.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):i.map(([a,c])=>o.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[o.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:_a(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Ma,{value:c})})]},a))})})}function Wp({host:e,protocol:t,description:n,tags:r,variables:s,security:i,bindings:a,serverKey:c,focusSection:u=null}){const l=s,d=g.useId();return o.jsxs("div",{children:[o.jsx(Ia,{address:e,variables:l,children:o.jsx("div",{className:"mt-2",children:r&&r.map((f,p)=>{const h=f,m=h.externalDocs;return o.jsx(bs,{href:m&&m.url,title:h.description||(m&&m.description?m.description:void 0),name:h.name},p)})})}),o.jsx(Be,{children:n}),i&&i.length>0&&o.jsxs("div",{id:c?`server-${c}-security`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Ta,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),o.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",i.length>1?"s":"",":"]}),o.jsx(qt,{className:"mt-4",ariaLabelledBy:d,forceExpanded:u==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:i.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(As,{securities:i})})})]}),(()=>{const f=a==null?void 0:a[t];return f&&Object.keys(f).some(h=>h!=="bindingVersion")?o.jsxs("div",{id:c?`server-${c}-bindings`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Jr,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),o.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),o.jsx(Ra,{bindings:f,protocol:t,focused:u===`binding:${t}`})]}):null})()]})}function Pa({servers:e,selectedServer:t,onSelectServer:n,focusSection:r=null,layout:s}){const i=Object.keys(e),[a,c]=g.useState(void 0),u=[t,a].find(f=>!!f&&i.includes(f))??i[0],l=f=>{c(f),n==null||n(f)},d=o.jsx(Wp,{...e[u],serverKey:u,focusSection:t||a?r:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{title:Uo,content:d,sideContent:o.jsx(Ca,{serverNames:i,current:u,setCurrent:l}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const La=g.forwardRef(function({isOpen:t,side:n,onClose:r,title:s,headerActions:i,children:a,width:c="w-[50rem]"},u){g.useEffect(()=>{if(!t)return;const N=j=>{j.key==="Escape"&&r()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[t,r]);const l=n==="right"?"right-0":"left-0",d=n==="right"?"translateX(100%)":"translateX(-100%)",{portalHost:f,rootElement:p,sidePanelContainment:h,sidePanelTopOffset:m=0}=ke(),b=h==="component";g.useEffect(()=>{if(!t||!f)return;const N=b?sl(f,p):Kr(f);if(N)return Jo(N)},[b,t,f,p]);const x=hr(p,b),w=(()=>{if(!b)return{position:"fixed",inset:0};if(!x)return{position:"fixed",inset:0};const N=Math.max(m,x.top),j=Math.max(0,x.left),E=Math.min(window.innerHeight,x.bottom),L=Math.min(window.innerWidth,x.right);return{position:"fixed",top:N,left:j,width:Math.max(0,L-j),height:Math.max(0,E-N)}})();return f?kt.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...w,pointerEvents:t?"auto":"none"},children:[o.jsx("div",{onClick:r,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),o.jsxs("div",{ref:u,className:`absolute top-0 ${l} h-full ${c} max-w-[100cqw] bg-background ${t?"shadow-xl":""} flex flex-col transition-transform duration-300 ease-in-out`,style:{transform:t?"translateX(0)":d},children:[s&&o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[o.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof s=="string"?o.jsx("span",{className:"truncate block",children:s}):s}),i,o.jsx("button",{onClick:r,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:o.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a})]})]}),f):null});function Ba({message:e,messageId:t,i:n}){const[r,s]=g.useState(!1);return o.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&o.jsx("span",{className:"text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 p-0.5 rounded shrink-0",children:t??e.name})]}),e.summary&&o.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:e.contentType}),e.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:e.correlationId.description??e.correlationId.location,children:e.correlationId.location}),e.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),o.jsx(Ss,{message:e,expanded:r,onToggleExpanded:()=>s(i=>!i)})]})}function Kp({requestMessages:e,reply:t,isSend:n,operationId:r}){const[s,i]=g.useState("request"),a=t.messages??[],c=t.channel,u=t.address,l=s==="request"?e:a,d=s==="request"?n?"accepts":"expects":o.jsxs(o.Fragment,{children:["replies to"," ",u?o.jsxs(o.Fragment,{children:["a channel in"," ",o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:u.location})]}):(c==null?void 0:c.address)&&o.jsx(qe,{address:c.address,parameters:c.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>o.jsx("button",{onClick:()=>i(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
|
|
134
|
-
${s===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),o.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:l.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:r})," ",d,l.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):o.jsxs("span",{children:[" "," with the following message:"]})]}),o.jsx("div",{className:"space-y-2",children:l.map((f,p)=>o.jsx(Ba,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const Gp="",Vp=`
|
|
135
|
-
`;var ze=class{constructor({indent:e,join:t}={}){this.code=[],this.indentLine=(n,r=0)=>`${this.indentationCharacter.repeat(r)}${n}`,this.push=(n,r=0)=>{this.code.push(this.indentLine(n,r))},this.blank=()=>{this.code.push("")},this.join=()=>this.code.join(this.lineJoin),this.indentationCharacter=e??Gp,this.lineJoin=t??Vp}},en=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},Jp=class extends en{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},Zp=class extends en{constructor(e,t,n=[]){const r=n.length>0?` Registered targetId/clientId pairs: ${n.join(", ")}.`:" No targets are registered — did you forget to import a client module?";super(`Unsupported target "${e}/${t}".${r}`),this.name="UnsupportedTargetError"}},Xp=class extends en{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},Yp=class extends en{constructor(e,t){super(`Operation "${e}" is not reachable over "${t}": no server it's associated with declares that protocol (or a secure variant of it), and its channel has no explicit "${t}" binding`),this.name="MissingBindingError"}},Co=class extends en{constructor(e){super(`Operation "${e}"'s message has no "examples" entry, and no "payload" schema to generate one from (or its schema has no recognizable type — composition keywords like oneOf/anyOf/allOf aren't resolved into an example).`),this.name="MissingExampleError"}};const To=10;function Qp(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function qp(e,t){if(!t.startsWith("#/"))throw new Error(`Unsupported $ref "${t}": only local refs (starting with "#/") are supported`);const n=t.slice(2).split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const s of n){if(typeof r!="object"||r===null)throw new Error(`Cannot resolve $ref "${t}": no value at "${s}"`);r=r[s]}return r}function Xe(e,t){let n=t;for(let r=0;Qp(n);r++){if(r>=To)throw new Error(`Exceeded max $ref depth (${To}) resolving "${n.$ref}" — possible cycle`);n=qp(e,n.$ref)}return n}const eh=10;function th(e){switch(e){case"date-time":return"2024-01-01T00:00:00Z";case"date":return"2024-01-01";case"time":return"00:00:00Z";case"email":return"user@example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"uri":case"url":return"https://example.com";case"hostname":return"example.com";case"ipv4":return"192.0.2.1";case"ipv6":return"::1";default:return"string"}}function nh(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function Rr(e,t,n=0){if(n>eh)return;const r=Xe(e,t);if(!r||typeof r!="object")return;const s=r;if(s.examples&&s.examples.length>0)return s.examples[0];if(s.default!==void 0)return s.default;if(s.const!==void 0)return s.const;if(s.enum&&s.enum.length>0)return s.enum[0];switch(nh(s.type)){case"object":{const i={};for(const[a,c]of Object.entries(s.properties??{})){const u=Rr(e,c,n+1);u!==void 0&&(i[a]=u)}return i}case"array":{if(s.items===void 0)return[];const i=Rr(e,s.items,n+1);return i!==void 0?[i]:[]}case"string":return th(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const rh=10;function sh(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function Dt(e,t,n=0){if(n>=rh||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>Dt(e,s,n+1));if(sh(t))return Dt(e,Xe(e,t),n+1);const r={};for(const[s,i]of Object.entries(t))r[s]=Dt(e,i,n+1);return r}function Da(e,t,n){return e!==void 0?{value:String(e),isPlaceholder:!1}:t&&t.length>0?{value:String(t[0]),isPlaceholder:!1}:{value:`<${n}>`,isPlaceholder:!0}}function hn(e,t){return e?Da(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function Io(e){const t={},n=[];for(const[r,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=Da(s.default,s.examples,r);t[r]=i.value,i.isPlaceholder&&n.push(r)}return{values:t,placeholders:n}}function Oo(e,t){return t!=null&&t.length?t.map(n=>Xe(e,n)).filter(n=>!!(n!=null&&n.type)):[]}const oh={"kafka-secure":"kafka",wss:"ws"};function ih(e){return oh[e]??e}function ah(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function ch(e){return e.slice(e.lastIndexOf("/")+1)}function lh(e,t){return t&&t.length>0?t.map(n=>{const r=Xe(e,n);if(r)return{name:ah(n)?ch(n.$ref):"",server:r}}).filter(n=>!!n):Object.entries(e.servers??{}).map(([n,r])=>{const s=Xe(e,r);return s?{name:n,server:s}:void 0}).filter(n=>!!n)}function Fa(e,t){var i;const n=(i=e.operations)==null?void 0:i[t],r=n&&Xe(e,n);if(!r)throw new Jp(t);const s=Xe(e,r.channel);if(!s)throw new Xp(t);return{operation:r,channel:s}}function za(e,t,n,r){var c;const s=lh(e,n.servers??t.servers),i=s.find(u=>ih(u.server.protocol)===r),a=(c=t.bindings)==null?void 0:c[r];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function uh(e,t,n){try{const{operation:r,channel:s}=Fa(e,t);return za(e,s,r,n).eligible}catch{return!1}}function dh(e,t,n){var I,P,M,U,X,S,k,C,D,K,Z,he,me,ce;const{operation:r,channel:s}=Fa(e,t),{servers:i,matchedServer:a,eligible:c}=za(e,s,r,n);if(!c)throw new Yp(t,n);const u=[];let l={},d={},f;if(n==="ws"){const ae=Io((P=(I=s.bindings)==null?void 0:I.ws)==null?void 0:P.query),Q=Io((U=(M=s.bindings)==null?void 0:M.ws)==null?void 0:U.headers);l=ae.values,d=Q.values,u.push(...ae.placeholders.map(B=>`query param "${B}"`)),u.push(...Q.placeholders.map(B=>`header "${B}"`))}else n==="kafka"&&(f=(S=(X=s.bindings)==null?void 0:X.kafka)==null?void 0:S.topic);const p=s.address??"";let h=p;for(const[ae,Q]of Object.entries(s.parameters??{})){const B=hn(Q,ae);h=h.replace(`{${ae}}`,B.value),B.isPlaceholder&&u.push(`channel parameter "${ae}"`)}n==="kafka"&&f&&(h=f);const m=(k=a??i[0])==null?void 0:k.server,b=m?`${m.protocol}://${m.host}${m.pathname??""}`:"",x=(m==null?void 0:m.host)??"",w=Oo(e,m==null?void 0:m.security),N=i.map(({name:ae,server:Q})=>({name:ae,host:Q.host,protocol:Q.protocol,pathname:Q.pathname,url:`${Q.protocol}://${Q.host}${Q.pathname??""}`,description:Q.description,security:Oo(e,Q.security)})),j=r.messages!==void 0?Xe(e,r.messages[0]):Xe(e,Object.values(s.messages??{})[0]),E=(C=j==null?void 0:j.examples)==null?void 0:C[0];let L,z;if(E)L=E.name,z=E.payload;else if((j==null?void 0:j.payload)!==void 0){if(z=Rr(e,j.payload),z===void 0)throw new Co(t);u.push("message payload (no explicit example — generated from its schema)")}else throw new Co(t);const A=(j==null?void 0:j.payload)!==void 0?Dt(e,j.payload):void 0,v=(j==null?void 0:j.headers)!==void 0?Dt(e,j.headers):void 0,y=r.action==="send"?"send":"receive";let $;if(n==="kafka"){const ae=(K=(D=j==null?void 0:j.bindings)==null?void 0:D.kafka)==null?void 0:K.key,Q=ae?hn(ae,"kafka message key"):void 0;Q!=null&&Q.isPlaceholder&&u.push("kafka message key");const B=hn((he=(Z=r.bindings)==null?void 0:Z.kafka)==null?void 0:he.clientId,"kafka clientId");B.isPlaceholder&&u.push("kafka clientId");let Y;y==="receive"&&(Y=hn((ce=(me=r.bindings)==null?void 0:me.kafka)==null?void 0:ce.groupId,"kafka consumer group id"),Y.isPlaceholder&&u.push("kafka consumer group id")),$={key:Q==null?void 0:Q.value,groupId:Y==null?void 0:Y.value,clientId:B.value}}return{operationId:t,action:y,protocol:n,serverUrl:b,serverHost:x,servers:N,channelAddress:h,channelTemplate:p,query:l,headers:d,operationSummary:r.summary,operationDescription:r.description,message:{name:L,payload:z,title:(j==null?void 0:j.title)??(j==null?void 0:j.name),summary:j==null?void 0:j.summary,description:j==null?void 0:j.description,contentType:j==null?void 0:j.contentType,payloadSchema:A,headersSchema:v},placeholders:u,info:e.info,security:w,...$?{kafka:$}:{}}}function fh(e){switch(e.type){case"apiKey":case"httpApiKey":return`API key${e.in?` (in ${e.in}${e.name?`: \`${e.name}\``:""})`:""}`;case"http":return e.scheme?`HTTP ${e.scheme}`:"HTTP authentication";case"oauth2":return"OAuth2";case"openIdConnect":return"OpenID Connect";case"userPassword":return"Username/password";case"X509":return"X.509 certificate";case"symmetricEncryption":return"Symmetric encryption";case"asymmetricEncryption":return"Asymmetric encryption";case"plain":return"SASL/PLAIN";case"scramSha256":return"SASL/SCRAM-SHA-256";case"scramSha512":return"SASL/SCRAM-SHA-512";case"gssapi":return"SASL/GSSAPI (Kerberos)";default:return e.type}}function ph(e,t){if(t.length!==0){e("**Authorization:**");for(const n of t)if(e(`- **${fh(n)}**`),n.description&&e(n.description,1),n.type==="openIdConnect"&&n.openIdConnectUrl&&e(`- OpenID Connect URL: \`${n.openIdConnectUrl}\``,1),n.type==="oauth2")for(const[r,s]of Object.entries(n.flows??{})){e(`- Flow \`${r}\`:`,1),s.authorizationUrl&&e(`- Authorization URL: \`${s.authorizationUrl}\``,2),s.tokenUrl&&e(`- Token URL: \`${s.tokenUrl}\``,2),s.refreshUrl&&e(`- Refresh URL: \`${s.refreshUrl}\``,2);const i=Object.keys(s.scopes??{});i.length>0&&e(`- Scopes: ${i.map(a=>`\`${a}\``).join(", ")}`,2)}}}function hh(e,t,n){e(`### ${n.name||n.host}`),t(),e(`**Host:** \`${n.host}${n.pathname??""}\``),e(`**Protocol:** ${n.protocol}`),n.description&&e(n.description),t(),n.security.length>0&&(ph(e,n.security),t())}function _o(e,t,n,r){e(`#### \`${n}\``),t(),e("```json");for(const s of JSON.stringify(r,null,2).split(`
|
|
136
|
-
`))e(s);e("```"),t()}function Ha(e,t){var l,d,f,p,h,m,b;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});r(`# ${((l=e.info)==null?void 0:l.title)??e.operationId}`),s();const a=(d=e.info)==null?void 0:d.license;if(r(`**Version:** ${((f=e.info)==null?void 0:f.version)??"unknown"}${a?" ":""}`),a&&r(`**License:** ${a.name??""}${a.url?` (${a.url})`:""}`),s(),(p=e.info)!=null&&p.description&&(r(e.info.description),s()),r(`You are an AI agent that needs to ${e.action==="send"?"send a message to":"receive messages from"} an asynchronous (${e.protocol}) API operation ("${e.operationId}"). Use only the details below — do not invent field names, URLs, topics, or values that aren't given here.`),s(),e.servers.length>0){r("## Servers"),s();for(const x of e.servers)hh(r,s,x)}r(`### ${e.action.toUpperCase()} \`${e.operationId}\``),s(),r(`**Channel:** \`${e.channelTemplate}\``);const c=Object.keys(e.query),u=Object.keys(e.headers);if(c.length>0&&r(`**Query parameters:** ${c.map(x=>`\`${x}=${e.query[x]}\``).join(", ")}`),u.length>0&&r(`**Headers:** ${u.map(x=>`\`${x}: ${e.headers[x]}\``).join(", ")}`),((h=e.kafka)==null?void 0:h.clientId)!==void 0&&r(`**Kafka client ID:** \`${e.kafka.clientId}\``),e.action==="receive"&&((m=e.kafka)==null?void 0:m.groupId)!==void 0&&r(`**Kafka consumer group ID:** \`${e.kafka.groupId}\``),((b=e.kafka)==null?void 0:b.key)!==void 0&&r(`**Kafka message key:** \`${e.kafka.key}\``),s(),e.operationSummary&&(r(e.operationSummary),s()),e.operationDescription&&(r(e.operationDescription),s()),r(`#### ${e.message.title??e.operationId}`),s(),e.message.summary&&(r(e.message.summary),s()),e.message.description&&(r(e.message.description),s()),e.message.contentType&&(r(`**Content-Type:** \`${e.message.contentType}\``),s()),e.message.payloadSchema!==void 0&&_o(r,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&_o(r,s,"headers",e.message.headersSchema),r("## Instructions"),s(),e.action==="send"?(r("1. Construct a JSON payload that conforms to the `payload` schema above."),r(`2. Send it to the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`)):(r(`1. Subscribe/listen on the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`),r("2. Expect incoming messages conforming to the `payload` schema above.")),e.placeholders.length>0){r("3. Some values above could not be resolved from the AsyncAPI document's `default`/`examples` and are placeholders — replace them with real values before acting:");for(const x of e.placeholders)r(`- ${x}`,1)}return i()}const mh={info:{key:"kafka",title:"Agent Prompt (Kafka)",description:"Self-contained Markdown prompt describing this operation — intro, broker, authorization, and an example payload — for an LLM agent to act on directly, instead of a runnable code snippet.",link:"https://www.asyncapi.com/",extname:".md",protocol:"kafka"},convert:(e,t)=>Ha(e,t)},gh={info:{key:"ws",title:"Agent Prompt (WebSocket)",description:"Self-contained Markdown prompt describing this operation — intro, server, authorization, and an example payload — for an LLM agent to act on directly, instead of a runnable code snippet.",link:"https://www.asyncapi.com/",extname:".md",protocol:"ws"},convert:(e,t)=>Ha(e,t)};function tn(e,t,n){const r=e.replace(/\/$/,""),s=t.startsWith("/")?t:`/${t}`,i=new URLSearchParams(n).toString();return i?`${r}${s}?${i}`:`${r}${s}`}const xh={info:{key:"tokio-tungstenite",title:"tokio-tungstenite",description:"Rust WebSocket client built on tokio-tungstenite, driven with async/await on the Tokio runtime.",link:"https://github.com/snapview/tokio-tungstenite",extname:".rs",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const u of e.placeholders)r(`// - ${u}`);s()}const a=tn(e.serverUrl,e.channelAddress,e.query),c=Object.entries(e.headers);if(r("use futures_util::{SinkExt, StreamExt};"),c.length>0?r("use tokio_tungstenite::{connect_async, tungstenite::client::IntoClientRequest, tungstenite::Message};"):r("use tokio_tungstenite::{connect_async, tungstenite::Message};"),s(),s(),r("#[tokio::main]"),r("async fn main() {"),r(`let url = ${JSON.stringify(a)};`,1),s(),c.length>0){r('let mut request = url.into_client_request().expect("Invalid URL");',1);for(const[u,l]of c)r("request",1),r(".headers_mut()",2),r(`.insert(${JSON.stringify(u)}, ${JSON.stringify(l)}.parse().expect("Invalid header value"));`,2);s(),r('let (ws_stream, _) = connect_async(request).await.expect("Failed to connect");',1)}else r('let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");',1);if(r(`let (${e.action==="send"?"mut write":"_write"}, mut read) = ws_stream.split();`,1),s(),e.action==="send"){const u=JSON.stringify(e.message.payload,null,2).split(`
|
|
137
|
-
`);u[u.length-1]+=");",r(`let payload = serde_json::json!(${u[0]}`,1);for(const l of u.slice(1))r(l,1);s(),r("write",1),r(".send(Message::Text(payload.to_string().into()))",2),r(".await",2),r('.expect("Failed to send message");',2),s(),r("if let Some(msg) = read.next().await {",1),r('println!("{}", msg.expect("Failed to read message"));',2),r("}",1)}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const u of JSON.stringify(e.message.payload,null,2).split(`
|
|
138
|
-
`))r(`// ${u}`,1);s(),r("while let Some(msg) = read.next().await {",1),r('println!("{}", msg.expect("Failed to read message"));',2),r("}",1)}return r("}"),i()}},bh={info:{key:"rdkafka",title:"rdkafka",description:"Kafka producer/consumer client using the rdkafka crate, a librdkafka binding driven with async/await on the Tokio runtime.",link:"https://github.com/fede1024/rust-rdkafka",extname:".rs",protocol:"kafka"},convert:(e,t)=>{var c,u,l;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const d of e.placeholders)r(`// - ${d}`);s()}const a=((c=e.kafka)==null?void 0:c.clientId)??"";if(e.action==="send"){r("use rdkafka::config::ClientConfig;"),r("use rdkafka::producer::{FutureProducer, FutureRecord};"),r("use std::time::Duration;"),s(),s(),r("#[tokio::main]"),r("async fn main() {"),r("let producer: FutureProducer = ClientConfig::new()",1),r(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),r(`.set("client.id", ${JSON.stringify(a)})`,2),r(".create()",2),r('.expect("Failed to create producer");',2),s();const d=JSON.stringify(e.message.payload,null,2).split(`
|
|
139
|
-
`);d[d.length-1]+=");",r(`let payload = serde_json::json!(${d[0]}`,1);for(const f of d.slice(1))r(f,1);s(),r(`let record = FutureRecord::to(${JSON.stringify(e.channelAddress)})`,1),r(".payload(&payload.to_string())",2),((u=e.kafka)==null?void 0:u.key)!==void 0?r(`.key(${JSON.stringify(e.kafka.key)});`,2):r('.key("");',2),s(),r("producer",1),r(".send(record, Duration::from_secs(0))",2),r(".await",2),r('.expect("Failed to send message");',2),r("}")}else{const d=((l=e.kafka)==null?void 0:l.groupId)??"";r("use rdkafka::config::ClientConfig;"),r("use rdkafka::consumer::{Consumer, StreamConsumer};"),r("use rdkafka::Message;"),r("use futures_util::StreamExt;"),s(),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
140
|
-
`))r(`// ${f}`);s(),r("#[tokio::main]"),r("async fn main() {"),r("let consumer: StreamConsumer = ClientConfig::new()",1),r(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),r(`.set("group.id", ${JSON.stringify(d)})`,2),r(`.set("client.id", ${JSON.stringify(a)})`,2),r('.set("auto.offset.reset", "earliest")',2),r(".create()",2),r('.expect("Failed to create consumer");',2),s(),r(`consumer.subscribe(&[${JSON.stringify(e.channelAddress)}]).expect("Failed to subscribe");`,1),s(),r("let mut stream = consumer.stream();",1),r("while let Some(message) = stream.next().await {",1),r('let message = message.expect("Failed to read message");',2),r("if let Some(payload) = message.payload_view::<str>().and_then(Result::ok) {",2),r('println!("{}", payload);',3),r("}",2),r("}",1),r("}")}return i()}};function Pr(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+1);if(e==null)return"None";if(typeof e=="boolean")return e?"True":"False";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
141
|
-
${e.map(a=>`${s}${Pr(a,t,n+1)}`).join(`,
|
|
142
|
-
`)},
|
|
143
|
-
${r}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
144
|
-
${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${Pr(c,t,n+1)}`).join(`,
|
|
145
|
-
`)},
|
|
146
|
-
${r}}`}const yh={info:{key:"websockets",title:"websockets",description:"Python WebSocket client using the `websockets` package's asyncio API.",link:"https://websockets.readthedocs.io/",extname:".py",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("# NOTE: some values could not be resolved from the AsyncAPI document's"),r("# default/examples and were filled with a placeholder — replace them"),r("# with real values before running this snippet:");for(const u of e.placeholders)r(`# - ${u}`);s()}r("import asyncio"),e.action==="send"&&r("import json"),s(),r("import websockets"),s(),s(),r("async def main() -> None:");const a=tn(e.serverUrl,e.channelAddress,e.query),c=Object.entries(e.headers);if(c.length>0){r("async with websockets.connect(",1),r(`${JSON.stringify(a)},`,2),r("additional_headers={",2);for(const[u,l]of c)r(`${JSON.stringify(u)}: ${JSON.stringify(l)},`,3);r("},",2),r(") as websocket:",1)}else r(`async with websockets.connect(${JSON.stringify(a)}) as websocket:`,1);if(s(),e.action==="send"){const u=Pr(e.message.payload,n.indent).split(`
|
|
147
|
-
`);u[u.length-1]+=")",r("await websocket.send(",2),r(`json.dumps(${u[0]}`,3);for(const l of u.slice(1))r(l,3);r(")",2),s(),r("message = await websocket.recv()",2),r("print(message)",2)}else{r(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,2);for(const u of JSON.stringify(e.message.payload,null,2).split(`
|
|
148
|
-
`))r(`# ${u}`,2);s(),r("async for message in websocket:",2),r("print(message)",3)}return s(),s(),r("asyncio.run(main())"),i()}};function Lr(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+1);if(e==null)return"None";if(typeof e=="boolean")return e?"True":"False";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
149
|
-
${e.map(a=>`${s}${Lr(a,t,n+1)}`).join(`,
|
|
150
|
-
`)},
|
|
151
|
-
${r}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
152
|
-
${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${Lr(c,t,n+1)}`).join(`,
|
|
153
|
-
`)},
|
|
154
|
-
${r}}`}const wh={info:{key:"confluent-kafka",title:"confluent-kafka",description:"Kafka producer/consumer client using the confluent-kafka package — a librdkafka-backed client for Python.",link:"https://github.com/confluentinc/confluent-kafka-python",extname:".py",protocol:"kafka"},convert:(e,t)=>{var c,u,l;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("# NOTE: some values could not be resolved from the AsyncAPI document's"),r("# default/examples and were filled with a placeholder — replace them"),r("# with real values before running this snippet:");for(const d of e.placeholders)r(`# - ${d}`);s()}r("import json"),s(),e.action==="send"?r("from confluent_kafka import Producer"):r("from confluent_kafka import Consumer"),s(),s();const a=((c=e.kafka)==null?void 0:c.clientId)??"";if(e.action==="send"){r("producer = Producer({",0),r(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),r(`"client.id": ${JSON.stringify(a)},`,1),r("})"),s();const d=Lr(e.message.payload,n.indent).split(`
|
|
155
|
-
`);d[d.length-1]+=")",r(`payload = json.dumps(${d[0]}`);for(const f of d.slice(1))r(f);s(),r("producer.produce(",0),r(`${JSON.stringify(e.channelAddress)},`,1),r("value=payload.encode('utf-8'),",1),((u=e.kafka)==null?void 0:u.key)!==void 0&&r(`key=${JSON.stringify(e.kafka.key)},`,1),r(")"),r("producer.flush()")}else{const d=((l=e.kafka)==null?void 0:l.groupId)??"";r("consumer = Consumer({",0),r(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),r(`"group.id": ${JSON.stringify(d)},`,1),r(`"client.id": ${JSON.stringify(a)},`,1),r('"auto.offset.reset": "earliest",',1),r("})"),s(),r(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
156
|
-
`))r(`# ${f}`);s(),r(`consumer.subscribe([${JSON.stringify(e.channelAddress)}])`),s(),r("try:"),r("while True:",1),r("msg = consumer.poll(1.0)",2),r("if msg is None:",2),r("continue",3),r("if msg.error():",2),r("print(msg.error())",3),r("continue",3),r("print(msg.value().decode('utf-8'))",2),r("finally:"),r("consumer.close()",1)}return i()}},kh={info:{key:"websocket",title:"WebSocket (browser)",description:"Browser-native WHATWG WebSocket API — no dependency to install, but it cannot set custom handshake headers, so only query-param bindings are supported.",link:"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket",extname:".js",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent}),a=Object.keys(e.headers);if(a.length>0&&(r(`// NOTE: this operation's "ws" binding declares handshake headers`),r(`// (${a.join(", ")}), but the browser-native WebSocket API cannot`),r("// set custom headers on the handshake request — they are omitted below."),r("// Move any required auth into the query string, or generate a Node.js"),r('// snippet instead (targetId: "javascript", clientId: "ws").'),s()),e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const c of e.placeholders)r(`// - ${c}`);s()}if(r(`const socket = new WebSocket('${tn(e.serverUrl,e.channelAddress,e.query)}');`),s(),e.action==="send"){r("socket.addEventListener('open', () => {");const c=JSON.stringify(e.message.payload,null,2).split(`
|
|
157
|
-
`);c[c.length-1]+="));",r(`socket.send(JSON.stringify(${c[0]}`,1);for(const u of c.slice(1))r(u,1);r("});"),s(),r("socket.addEventListener('message', (event) => {"),r("console.log(event.data);",1),r("});")}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
158
|
-
`))r(`// ${c}`);s(),r("socket.addEventListener('message', (event) => {"),r("console.log(event.data);",1),r("});")}return i()}},vh={info:{key:"kafkajs",title:"kafkajs",description:"Kafka producer/consumer client using the kafkajs package — a pure JavaScript Kafka client for Node.js (no native build step, unlike node-rdkafka).",link:"https://kafka.js.org/",extname:".js",protocol:"kafka"},convert:(e,t)=>{var u,l,d;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const f of e.placeholders)r(`// - ${f}`);s()}r("import { Kafka } from 'kafkajs';"),s();const a=e.serverHost.split(",").map(f=>f.trim()).filter(Boolean),c=((u=e.kafka)==null?void 0:u.clientId)??"";if(r("const kafka = new Kafka({"),r(`clientId: '${c}',`,1),r(`brokers: [${a.map(f=>`'${f}'`).join(", ")}],`,1),r("});"),s(),e.action==="send"){r("const producer = kafka.producer();"),s(),r("async function main() {"),r("await producer.connect();",1),r("await producer.send({",1),r(`topic: '${e.channelAddress}',`,2),r("messages: [",2),r("{",3),((l=e.kafka)==null?void 0:l.key)!==void 0&&r(`key: '${e.kafka.key}',`,4);const f=JSON.stringify(e.message.payload,null,2).split(`
|
|
159
|
-
`);f[f.length-1]+="),",r(`value: JSON.stringify(${f[0]}`,4);for(const p of f.slice(1))r(p,4);r("},",3),r("],",2),r("});",1),r("await producer.disconnect();",1),r("}"),s(),r("main();")}else{r(`const consumer = kafka.consumer({ groupId: '${((d=e.kafka)==null?void 0:d.groupId)??""}' });`),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
160
|
-
`))r(`// ${f}`);s(),r("async function main() {"),r("await consumer.connect();",1),r(`await consumer.subscribe({ topic: '${e.channelAddress}', fromBeginning: true });`,1),s(),r("await consumer.run({",1),r("eachMessage: async ({ message }) => {",2),r("console.log(message.value?.toString());",3),r("},",2),r("});",1),r("}"),s(),r("main();")}return i()}};function Br(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+1);if(e==null)return"nil";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]interface{}{}":`[]interface{}{
|
|
161
|
-
${e.map(a=>`${s}${Br(a,t,n+1)}`).join(`,
|
|
162
|
-
`)},
|
|
163
|
-
${r}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
|
|
164
|
-
${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${Br(c,t,n+1)}`).join(`,
|
|
165
|
-
`)},
|
|
166
|
-
${r}}`}const jh={info:{key:"gorilla",title:"gorilla/websocket",description:"Go WebSocket client using the gorilla/websocket package's Dialer API.",link:"https://github.com/gorilla/websocket",extname:".go",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const u of e.placeholders)r(`// - ${u}`);s()}const a=tn(e.serverUrl,e.channelAddress,e.query),c=Object.entries(e.headers);if(r("package main"),s(),r("import ("),e.action==="send"&&r('"encoding/json"',1),r('"log"',1),c.length>0&&r('"net/http"',1),s(),r('"github.com/gorilla/websocket"',1),r(")"),s(),r("func main() {"),r(`url := ${JSON.stringify(a)}`,1),s(),c.length>0){r("header := http.Header{}",1);for(const[u,l]of c)r(`header.Set(${JSON.stringify(u)}, ${JSON.stringify(l)})`,1);s(),r("conn, _, err := websocket.DefaultDialer.Dial(url, header)",1)}else r("conn, _, err := websocket.DefaultDialer.Dial(url, nil)",1);if(r("if err != nil {",1),r('log.Fatal("dial:", err)',2),r("}",1),r("defer conn.Close()",1),s(),e.action==="send"){const u=Br(e.message.payload,n.indent).split(`
|
|
167
|
-
`);r(`payload := ${u[0]}`,1);for(const l of u.slice(1))r(l,1);s(),r("data, err := json.Marshal(payload)",1),r("if err != nil {",1),r('log.Fatal("marshal:", err)',2),r("}",1),r("if err := conn.WriteMessage(websocket.TextMessage, data); err != nil {",1),r('log.Fatal("write:", err)',2),r("}",1),s(),r("_, message, err := conn.ReadMessage()",1),r("if err != nil {",1),r('log.Fatal("read:", err)',2),r("}",1),r("log.Println(string(message))",1)}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const u of JSON.stringify(e.message.payload,null,2).split(`
|
|
168
|
-
`))r(`// ${u}`,1);s(),r("for {",1),r("_, message, err := conn.ReadMessage()",2),r("if err != nil {",2),r('log.Println("read:", err)',3),r("return",3),r("}",2),r("log.Println(string(message))",2),r("}",1)}return r("}"),i()}};function Dr(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+1);if(e==null)return"nil";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]interface{}{}":`[]interface{}{
|
|
169
|
-
${e.map(a=>`${s}${Dr(a,t,n+1)}`).join(`,
|
|
170
|
-
`)},
|
|
171
|
-
${r}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
|
|
172
|
-
${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${Dr(c,t,n+1)}`).join(`,
|
|
173
|
-
`)},
|
|
174
|
-
${r}}`}const Sh={info:{key:"kafka-go",title:"kafka-go",description:"Kafka producer/consumer client using the segmentio/kafka-go package — a pure Go client (no cgo, unlike confluent-kafka-go).",link:"https://github.com/segmentio/kafka-go",extname:".go",protocol:"kafka"},convert:(e,t)=>{var c,u;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const l of e.placeholders)r(`// - ${l}`);s()}const a=e.serverHost.split(",").map(l=>l.trim()).filter(Boolean);if(r("package main"),s(),r("import ("),e.action==="send"?(r('"context"',1),r('"encoding/json"',1),r('"log"',1)):(r('"context"',1),r('"log"',1)),s(),r('"github.com/segmentio/kafka-go"',1),r(")"),s(),r("func main() {"),e.action==="send"){r("writer := &kafka.Writer{",1),r(`Addr: kafka.TCP(${a.map(d=>JSON.stringify(d)).join(", ")}),`,2),r(`Topic: ${JSON.stringify(e.channelAddress)},`,2),r("Balancer: &kafka.LeastBytes{},",2),r("}",1),r("defer writer.Close()",1),s();const l=Dr(e.message.payload,n.indent).split(`
|
|
175
|
-
`);r(`payload := ${l[0]}`,1);for(const d of l.slice(1))r(d,1);s(),r("data, err := json.Marshal(payload)",1),r("if err != nil {",1),r('log.Fatal("marshal:", err)',2),r("}",1),s(),r("message := kafka.Message{Value: data}",1),((c=e.kafka)==null?void 0:c.key)!==void 0&&r(`message.Key = []byte(${JSON.stringify(e.kafka.key)})`,1),s(),r("if err := writer.WriteMessages(context.Background(), message); err != nil {",1),r('log.Fatal("write:", err)',2),r("}",1)}else{const l=((u=e.kafka)==null?void 0:u.groupId)??"";r("reader := kafka.NewReader(kafka.ReaderConfig{",1),r(`Brokers: []string{${a.map(d=>JSON.stringify(d)).join(", ")}},`,2),r(`Topic: ${JSON.stringify(e.channelAddress)},`,2),r(`GroupID: ${JSON.stringify(l)},`,2),r("})",1),r("defer reader.Close()",1),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const d of JSON.stringify(e.message.payload,null,2).split(`
|
|
176
|
-
`))r(`// ${d}`,1);s(),r("for {",1),r("message, err := reader.ReadMessage(context.Background())",2),r("if err != nil {",2),r('log.Println("read:", err)',3),r("return",3),r("}",2),r("log.Println(string(message.Value))",2),r("}",1)}return r("}"),i()}},Ah={info:{key:"ws",title:"ws",description:"WebSocket client for Node.js — chosen over the browser-native WebSocket API because it supports custom handshake headers",link:"https://github.com/websockets/ws",extname:".js",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new ze({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const c of e.placeholders)r(`// - ${c}`);s()}r("import WebSocket from 'ws';"),s();const a=tn(e.serverUrl,e.channelAddress,e.query);if(Object.keys(e.headers).length>0){r(`const socket = new WebSocket('${a}', {`),r("headers: {",1);const c=Object.entries(e.headers);c.forEach(([u,l],d)=>{const f=d<c.length-1?",":"";r(`'${u}': '${l}'${f}`,2)}),r("},",1),r("});")}else r(`const socket = new WebSocket('${a}');`);if(s(),e.action==="send"){r("socket.on('open', () => {");const c=JSON.stringify(e.message.payload,null,2).split(`
|
|
177
|
-
`);c[c.length-1]+="));",r(`socket.send(JSON.stringify(${c[0]}`,1);for(const u of c.slice(1))r(u,1);r("});"),s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
178
|
-
`))r(`// ${c}`);s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}return i()}},At={};function nn(e){if(At[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);At[e.info.key]={...e,clientsById:{...e.clientsById}}}function De(e,t){const n=At[e];if(!n)throw new Error(`Cannot register client "${t.info.key}": target "${e}" is not registered. Call addTarget() first.`);if(n.clientsById[t.info.key])throw new Error(`Client "${t.info.key}" is already registered for target "${e}"`);n.clientsById[t.info.key]=t}function Nh(){return Object.values(At).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Eh(e,t){const n=[];for(const r of Nh()){const s=r.clients.filter(i=>uh(e,t,i.protocol));s.length>0&&n.push({...r,default:s[0].key,clients:s})}return n}nn({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});De("agent",gh);De("agent",mh);nn({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});De("javascript",Ah);De("javascript",kh);De("javascript",vh);nn({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});De("python",yh);De("python",wh);nn({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});De("rust",xh);De("rust",bh);nn({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});De("go",jh);De("go",Sh);var $h=class{constructor(e){this.document=e}convert(e,t,n,r={}){var a;const s=(a=At[t])==null?void 0:a.clientsById[n];if(!s){const c=Object.values(At).flatMap(u=>Object.keys(u.clientsById).map(l=>`${u.info.key}/${l}`));throw new Zp(t,n,c)}const i=dh(this.document,e,s.info.protocol);return s.convert(i,r)}};const Ch="javascript",Th="ws";function Ih(e,t){return Eh(e,t)}function Ua(e,t,n,r){try{return new $h(e).convert(t,n,r)}catch{return null}}function Oh(e,t,n){if(t){for(const r of n)for(const s of r.clients)if(Ua(e,t,r.key,s.key)!==null)return`${r.key}:${s.key}`}return`${Ch}:${Th}`}const _h={agent:"plaintext",c:"c",clojure:"clojure",crystal:"crystal",csharp:"csharp",go:"go",http:"http",java:"java",javascript:"javascript",json:"json",kotlin:"kotlin",node:"javascript",objc:"objectivec",ocaml:"ocaml",php:"php",powershell:"powershell",python:"python",r:"r",ruby:"ruby",rust:"rust",shell:"bash",swift:"swift"};function Wa(e){return _h[e]??"plaintext"}const Mh={c:()=>Promise.resolve().then(()=>require("./c-B4BAHWS4.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BA1RB3o9.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-IihVQN8U.cjs")),go:()=>Promise.resolve().then(()=>require("./go-By8nj0Vi.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-DFXAwvvK.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-B3HlgtFq.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-BMUCoWpx.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-CGL4kvvH.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-_vvcEGSJ.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-BAji1QIq.cjs"))};function Rn(e){return e==="plaintext"||!!Pe.getLanguage(e)}async function Ka(e){if(Rn(e))return;const t=Mh[e];if(!t)return;const n=await t();Pe.registerLanguage(e,n.default)}function Rh({operationId:e}){const{document:t,showCodeSamples:n}=Le(),r=g.useId(),s=g.useMemo(()=>e?Ih(t,e):[],[t,e]),i=g.useMemo(()=>Oh(t,e,s),[t,e,s]),[a,c]=g.useState(null),u=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[l,d]=u.split(":"),f=Wa(l),[,p]=g.useState(()=>Rn(f));g.useEffect(()=>{p(Rn(f));let m=!1;return Ka(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?Ua(t,e,l,d):null,[t,e,l,d]);return!n||!h?null:o.jsxs("div",{id:`operation-${e}-code-sample`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{htmlFor:r,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example"}),o.jsx("select",{id:r,value:u,onChange:m=>c({document:t,operationId:e,selection:m.target.value}),"aria-label":"Code sample language",className:"text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",children:s.map(m=>o.jsx("optgroup",{label:m.title,children:m.clients.map(b=>o.jsx("option",{value:`${m.key}:${b.key}`,children:b.title},b.key))},m.key))})]}),o.jsx(Vn,{code:h,language:f})]})}const Lt="reference";function Ga({name:e,context:t,enabled:n=!0,children:r}){const s=Oi(e),[i,a]=g.useState(Lt),[c,u]=g.useState(()=>new Set([Lt])),l=g.useId(),d=g.useMemo(()=>new Map(s.map(x=>[x.id,x])),[s]),f=n&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??Lt,m=[{id:Lt,name:"Reference"},...s.map(x=>({id:x.id,name:x.label}))],b=x=>{u(w=>w.has(x)?w:new Set([...w,x])),a(x)};return f?o.jsxs(o.Fragment,{children:[o.jsx(ft,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:l,tabs:m,current:h,onChange:b}),o.jsx(rl,{tabs:m,current:h,idPrefix:l,renderPanel:(x,w)=>{if(!w&&!c.has(x.id))return null;if(x.id===Lt)return r;const N=d.get(x.id);if(!N)return null;const j=N.Component;return o.jsx(Hn,{label:`${e}:${N.pluginName}`,children:o.jsx(j,{...t})})}})]}):o.jsx(o.Fragment,{children:r})}function Va({op:e,id:t,focusSection:n=null}){var b;const{document:r}=zo(),s=g.useId(),i=e.messages??[],a=e.tags??[],c=e.bindings,u=e.traits,l=e.reply,d=e.externalDocs,f=e.security,p=c??(Array.isArray(u)?(b=u.find(x=>x.bindings))==null?void 0:b.bindings:void 0),h=e.action===jn.SEND,m=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((x,w)=>o.jsx(Ba,{message:x,messageId:x.name,i:w},w))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(Ga,{name:"asyncapi.operation.tab",context:{document:r,operationId:t??""},enabled:!!t,children:o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(d==null?void 0:d.url)&&Je(d.url)&&o.jsxs("a",{href:d.url,target:"_blank",rel:"noreferrer",title:d.description||d.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Dn,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(Be,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(Rh,{operationId:t}),t&&o.jsx(Vt,{name:"asyncapi.operation.reference.supplementary",context:{document:r,operationId:t}}),f&&f.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsx(qt,{ariaLabelledBy:s,forceExpanded:n==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(As,{securities:f})})})]}),p&&Object.entries(p).map(([x,w])=>w?o.jsxs("div",{id:`operation-${t}-bindings-${x}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Ra,{protocol:x,bindings:w,focused:n===`binding:${x}`})]},x):null),l?o.jsx(Kp,{requestMessages:i,reply:l,isSend:h,operationId:t}):i.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[o.jsx("span",{className:"font-bold",children:t})," ",h?"accepts":"expects",i.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-bold text-foreground-mute",children:"one of"}),"the following messages:"]}):" the following message:"]}),m]}),a.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((x,w)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:x.name},w))})]})]})})})}const Ph=g.lazy(()=>import("@apiuikit/ws-try-it-plugin").then(({WsHeaderButton:e})=>({default:e})));function Ja({op:e,operationKey:t}){var s;const n=e.channel,r=((s=e.title)==null?void 0:s.trim())||void 0;return r?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:e.action}),o.jsx("span",{className:"min-w-0 flex-1 truncate",title:(n==null?void 0:n.address)??void 0,children:r})]}):n!=null&&n.address?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:e.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(qe,{address:n.address,parameters:n.parameters,truncate:!0,peek:!0})})]}):o.jsx(o.Fragment,{children:t})}function Za({operationKey:e}){const t=Le(),n=t.specType==="asyncapi"?t.document:null;return t.showTryIt!==!0||!n?null:o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Hn,{label:"built-in:asyncapi.operation.tryIt",children:o.jsx(Ph,{document:n,operationId:e})})})}function Xa({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,layout:s}){const i=d=>n==null?void 0:n(d);if(!Object.keys(e).length)return null;const a=t?e[t]:null,c=Object.keys(e).map(d=>{var N,j;const f=e[d],p=f.channel,h=p==null?void 0:p.address,m=p==null?void 0:p.parameters,b=((N=f.action)==null?void 0:N.toUpperCase())??"",x=((j=f.title)==null?void 0:j.trim())||void 0,w=t===d;return o.jsxs("tr",{id:`operation-${d}`,onClick:()=>i(d),role:"button",tabIndex:0,"aria-label":`${b||"Operation"} ${x??h??d}`,"aria-current":w?"true":void 0,onKeyDown:E=>{E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),i(d))},className:`cursor-pointer hover:bg-neutral-50 ${w?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:x?o.jsx("div",{className:"truncate text-sm font-medium text-foreground",title:h??void 0,children:x}):h&&o.jsx(qe,{address:h,parameters:m,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(Ze,{method:f.action,className:"w-24"})})]},d)}),u=a&&t?o.jsx(Ja,{op:a,operationKey:t}):t??"Operation",l=o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),o.jsx("tbody",{className:"bg-surface divide-y divide-border",children:c})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{title:zc,content:l,stickySideContent:!1,layout:s})}),o.jsx(La,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,headerActions:a&&t&&o.jsx(Za,{operationKey:t}),children:a&&o.jsx(Va,{op:a,id:t,focusSection:r},t)})]})}function Ya({schemaName:e,resolved:t,anchorId:n,selected:r=!1,focusTarget:s=null}){const i=t.schema,a=vi(t.schemaFormat),c=i.properties?Object.keys(i.properties).length:0;return o.jsxs("article",{id:n,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${r?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),t.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:t.description})]}),o.jsx("span",{className:"inline-flex rounded-full bg-neutral-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-foreground-secondary",children:i.type??"unknown"})]}),(i.format||a||c>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[i.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",i.format]}),a&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:t.schemaFormat,children:a}),c>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[c," properties"]})]}),t.conversionError&&o.jsxs("p",{className:"mt-4 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5",children:["Could not convert"," ",ji(t.schemaFormat)??"the"," schema — showing raw definition. ",t.conversionError]}),t.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),t.pendingConversion?null:t.conversionError&&typeof t.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(ha,{schema:t.originalSchema})}):o.jsx(js,{schema:i,rootName:e,className:"mt-4",focusTokens:r?(s==null?void 0:s.tokens)??null:null,focusId:r?(s==null?void 0:s.id)??null:null})]})}function Ns({schemas:e,selectedKey:t,focusTarget:n,layout:r}){const{deref:s}=ke(),i=Fn(),a=g.useMemo(()=>Object.entries(e).map(([u,l])=>[u,jt(l,s)]),[e,s,i]),c=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([u,l])=>o.jsx(Ya,{schemaName:u,resolved:l,anchorId:`schema-${u}`,selected:t===u,focusTarget:n},u))}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No schemas defined in this document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{content:c,stickySideContent:!1,layout:r})})}const Lh=e=>e==="operations"||e==="messages"||e==="schemas",Bh=(e,t)=>{switch(e){case"messages":return`message-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`operation-${t}`}};function Dh({asyncapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var S,k,C,D;const i=t.show??{},[a,c]=g.useState(!1),[u,l]=g.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&da(e.info),p=(n==null?void 0:n.some(K=>!!K.slots["asyncapi.document.topbar"]))??!1,h=d||f||p,m=[...i.operations!==!1?[{id:"operations",name:"Operations",icon:Bn}]:[],...i.messages!==!1?[{id:"messages",name:"Messages",icon:ni}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Vr}]:[]],{query:b,setQuery:x,results:w}=ju(e,{threshold:.3,limit:20}),{effectiveTab:N,focusTab:j,navActiveSection:E,selected:L,setSelectedKey:z,selectedNavItem:A,handleSearchSelect:v,handleNavItemSelect:y,handleNavServerSelect:$,handleContentTabChange:I,focusSection:P,schemaFocusTarget:M}=wi({tabs:m,defaultTab:"operations",isTabKey:Lh,sections:[{id:"operations",visible:i.operations!==!1},{id:"messages",visible:i.messages!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:b,initialLocation:r,onLocationChange:s,getTargetId:Bh}),U=e.servers?Object.keys(e.servers):[],X=N==="operations"?o.jsx(Xa,{operations:e.operations??{},selectedKey:L.operations,onSelectKey:K=>z("operations",K),focusSection:P}):N==="messages"?o.jsx($a,{messages:((S=e.components)==null?void 0:S.messages)??{},selectedKey:L.messages,focusSection:P}):N==="schemas"?o.jsx(Ns,{schemas:((k=e.components)==null?void 0:k.schemas)??{},selectedKey:L.schemas,focusTarget:M}):null;return o.jsx(Ln,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[h&&o.jsxs(Xo,{logo:f?o.jsx(ws,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Vt,{name:"asyncapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(si,{query:b,onQueryChange:x,results:w,onSelectResult:v,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(ci,{serialize:K=>rs(e,K),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(pa,{...e.info,showLogo:!1})}),i.servers!==!1&&U.length>0&&o.jsx("div",{id:`server-${L.servers??U[0]}`,children:o.jsx(Pa,{servers:e.servers,selectedServer:L.servers,onSelectServer:K=>z("servers",K),focusSection:P})}),o.jsx(Zo,{tabs:m,current:N,onChange:I}),N&&o.jsx("div",{id:`panel-${N}`,role:"tabpanel","aria-labelledby":`tab-${N}`,children:o.jsx(ut,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:X},`${N}-${L.operations}-${L.messages}-${L.schemas}`)}),i.sidebar!==!1&&o.jsx(jl,{operations:i.operations!==!1?e.operations:void 0,messages:i.messages!==!1?(C=e.components)==null?void 0:C.messages:void 0,schemas:i.schemas!==!1?(D=e.components)==null?void 0:D.schemas:void 0,servers:i.servers!==!1?e.servers:void 0,hasInfo:i.info!==!1,sidebarConfig:t.sidebar,activeTab:E,onTabChange:j,onItemSelect:y,onSelectServer:$,selectedItem:A})]})})}const Es=e=>o.jsx(ut,{resetKey:e.asyncapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(Fh,{...e})}),Fh=e=>{const t=e.asyncapi,n=g.useMemo(()=>Nt(t),[t]),r=e.kind;g.useEffect(()=>{r==="resolved"&&n!==t&&Ur(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??ot;return o.jsx(Dh,{asyncapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Zn({document:e,config:t=ot,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=Go("openapi",e,t,n);return o.jsx(dt.Provider,{value:i,children:o.jsxs("div",{ref:l,"data-theme":c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:u,className:"openapi-portal-root"}),s]})})}function zh(e){var r;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text:Ee([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,i)=>{const a=`server-${i}`;t.push({id:a,targetId:a,type:"server",tab:"servers",key:a,name:s.description??s.url??a,path:`servers[${i}]`,location:`Servers > ${s.url??a}`,subtitle:s.url,text:Ee([s.url,s.description,s.variables])})});const n=(s,{tab:i,type:a,idPrefix:c,docKey:u,sectionLabel:l})=>{for(const d of Object.keys(s)){const f=s[d];if(f)for(const p of $t){const h=f[p];if(!h)continue;const m=`${p} ${d}`,b=h.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${c}-${m}`,targetId:`${c}-${m}-detail`,type:a,tab:i,key:m,name:b,path:`${u}.${d}.${p}`,location:`${l} > ${p.toUpperCase()} ${d}`,subtitle:h.description,text:Ee([p,d,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas){const s=Zr(e.components.schemas,lt(e));for(const[i,a]of Object.entries(e.components.schemas))ui(t,a,i,i,s)}return t}function Hh(e,t={}){return bi(e,zh,t)}function Qa({info:e,tags:t,externalDocs:n,layout:r,showLogo:s}){const{title:i,description:a,license:c,contact:u}=e??{};return o.jsx(fa,{title:i,description:a,license:c,contact:u,externalDocs:n,tags:t,extensionsSource:e,layout:r,showLogo:s})}function Uh({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(Ia,{address:e,variables:n}),t&&o.jsx(Be,{children:t})]})}const lr=e=>`server-${e}`,ur=e=>Number(e.slice(7));function qa({servers:e,selectedServer:t,onSelectServer:n,layout:r}){const s=e.map((p,h)=>p.url||lr(h)),[i,a]=g.useState(void 0),c=p=>!!p&&ur(p)>=0&&ur(p)<e.length,u=c(t)?t:c(i)?i:lr(0),l=e[ur(u)],d=p=>{a(p),n==null||n(p)},f=l?o.jsx(Uh,{...l}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{title:Uo,content:f,sideContent:o.jsx(Ca,{serverNames:s,current:(l==null?void 0:l.url)||u,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?lr(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:r})})}function Wh({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"M12 11v5"}),o.jsx("path",{d:"M12 8h.01"})]})}function ec(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function Kh(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${ec(`$${n}`)}}`)}function Gh(e){return e.operationId??e.operationRef??null}const Vh=e=>e.trim().replace(/[.:;]+$/,""),dr=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function Jh({links:e,onFollowOperation:t,isOperationKnown:n}){return o.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var d;const i=Gh(s),a=Object.entries(s.parameters??{}),c=s.description?Vh(s.description):null,u=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),l=c??i??r;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(Wh,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),o.jsxs("span",{children:[u?o.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:l}):o.jsx("span",{className:"text-foreground-secondary",children:l}),a.length>0&&o.jsxs(o.Fragment,{children:[" using ",a.map(([f,p],h)=>o.jsxs(g.Fragment,{children:[h>0&&(h===a.length-1?" and ":", "),o.jsx(dr,{children:f})," from ",o.jsx(dr,{children:ec(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(dr,{children:s.server.url})]}):null,"."]})]},r)})})}function Zh(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>$t.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function Xh({callbacks:e,id:t,renderOperation:n,depth:r}){const s=Zh(e);return s.length===0?null:o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),o.jsx("div",{className:"space-y-2",children:s.map(({name:i,url:a,method:c,op:u,urlIndex:l})=>o.jsx(qt,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(Ze,{method:c,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:i}),o.jsx("code",{className:"font-mono text-foreground-muted truncate",children:Kh(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(n,{method:c,path:a,op:u,id:`${t}-${i}-${l}-${c}`,idPrefix:"callback",depth:r+1})})},`${i}-${l}-${c}`))})]})}const Yh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-cudhC1Tt.cjs")).then(({CodeSamples:e})=>({default:e})));function Qh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function tc({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?o.jsx(o.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):o.jsxs(o.Fragment,{children:[e," (",o.jsx("select",{"aria-label":`${e} media type`,value:n,onChange:s=>r(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>o.jsx("option",{value:s,children:s},s))}),")"]})}function nc(e){if(!e)return;if(e.example!==void 0)return e.example;const t=e.examples?Object.values(e.examples)[0]:void 0;return t&&"value"in t?t.value:void 0}function qh(e){return e.startsWith("2")?"bg-green-100 text-green-800":e.startsWith("4")||e.startsWith("5")?"bg-red-100 text-red-800":"bg-neutral-100 text-foreground-secondary"}function em({responses:e,onFollowOperation:t,isOperationKnown:n}){var z,A;const r=Object.keys(e),[s,i]=g.useState(r[0]),a=e[s],c=Object.keys((a==null?void 0:a.content)??{}),[u,l]=g.useState(c[0]),d=u?(z=a==null?void 0:a.content)==null?void 0:z[u]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[h,m]=g.useState("body"),b=c.length>0&&!!d,x=Object.keys(f).length>0,w=Object.keys(p).length>0,N=[...b?[{id:"body",name:"Body"}]:[],...x?[{id:"headers",name:"Headers"}]:[]],j=N.length>1,E=N.some(v=>v.id===h)?h:(A=N[0])==null?void 0:A.id,L=N.length>0;return g.useEffect(()=>{l(Object.keys((a==null?void 0:a.content)??{})[0]),m("body")},[s]),o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(v=>o.jsx("button",{role:"tab","aria-selected":s===v,onClick:()=>i(v),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${qh(v)} ${s===v?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:v},v))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),L?o.jsxs(o.Fragment,{children:[j&&o.jsx(ft,{tabs:N,current:E,onChange:v=>m(v)}),o.jsx("div",{className:j?"mt-4":void 0,children:E==="headers"?o.jsx(ct,{schema:nm(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(ct,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(tc,{prefix:"Body",mediaTypes:c,selected:u,onChange:l}),rootName:"Body",example:nc(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),w&&o.jsx(Jh,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function rc(e){const t={},n=[];for(const r of e){const s=r.schema??{};t[r.name]={...s,description:s.description??r.description},r.required&&n.push(r.name)}return{type:"object",properties:t,...n.length>0?{required:n}:{}}}const tm=e=>rc(e),nm=e=>rc(Object.entries(e).map(([t,n])=>({name:t,...n})));function rm({parameters:e}){var c;const t=Wc.filter(({location:u})=>e.some(l=>l.in===u)),[n,r]=g.useState(((c=t[0])==null?void 0:c.location)??null);if(t.length===0)return null;const s=t.some(u=>u.location===n)?n:t[0].location,i=t.find(u=>u.location===s),a=tm(e.filter(u=>u.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(ft,{tabs:t.map(({location:u,label:l})=>({id:u,name:l.replace(/ Parameters$/,"")})),current:s,onChange:r}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(ct,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function sm({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[c,u]=g.useState(s?"parameters":"body"),[l,d]=g.useState(i[0]),f=l?n[l]:void 0;if(!s&&!a)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[a?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[o.jsx("span",{className:"font-bold",children:e})," expects the following ",om(p),":"]}),s&&a&&o.jsx(ft,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:c,onChange:h=>u(h)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(c==="parameters"||!a)&&s&&o.jsx(rm,{parameters:t}),(c==="body"||!s)&&a&&f&&o.jsx(ct,{schema:f.schema??{},label:o.jsx(tc,{prefix:"Request Body",mediaTypes:i,selected:l,onChange:d}),rootName:"Body ",description:r,example:nc(f)})]})]})}function om(e){return e.length<=1?e[0]??"request":e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function im({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:i,id:a,depth:c,fillHeight:u=!1,onFollowOperation:l,isOperationKnown:d}){const f=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,h=!!i&&Object.keys(i).length>0&&c<am,m=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[b,x]=g.useState(m[0]??"request");if(m.length===0)return null;const w=m.includes(b)?b:m[0];return o.jsxs("div",{className:u?"flex-1 flex flex-col min-h-0":void 0,children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(N=>o.jsx("button",{role:"tab","aria-selected":w===N,onClick:()=>x(N),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${w===N?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:N},N))}),o.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${u?"flex-1 -mb-4":""}`,children:[w==="request"&&o.jsx(sm,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),w==="response"&&o.jsx(em,{responses:s,onFollowOperation:l,isOperationKnown:d}),w==="callbacks"&&i&&o.jsx(Xh,{callbacks:i,id:a,depth:c,renderOperation:$s})]})]})}const am=1;function $s({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:c,isOperationKnown:u,depth:l=0}){var j,E,L,z;const{document:d}=Ho(),f=(n.parameters??[]).filter(A=>A.in!=="query"&&A.in!=="path"),p=n.security??i??[],h=n.responses??{},m=((j=n.requestBody)==null?void 0:j.content)??{},b=n.operationId?Qh(n.operationId):`${e.toUpperCase()} ${t}`,x=new Map;for(const A of p)for(const[v,y]of Object.entries(A)){if(y.length===0)continue;const $=x.get(v)??[];x.set(v,Array.from(new Set([...$,...y])))}const w=Array.from(new Set(p.flatMap(A=>Object.keys(A)))).map(A=>{const v=a==null?void 0:a[A];if(!v)return null;const y=x.get(A);return y?{...v,requiredScopes:y}:v}).filter(A=>!!A),N=l===0;return o.jsx("div",{className:`flex flex-col gap-6 ${N?"min-h-full":""}`,id:`${s}-${r}-detail`,children:o.jsx(Ga,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:N,children:o.jsxs(o.Fragment,{children:[(n.deprecated||((E=n.externalDocs)==null?void 0:E.url))&&o.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((L=n.externalDocs)==null?void 0:L.url)&&Je(n.externalDocs.url)&&o.jsxs("a",{href:n.externalDocs.url,target:"_blank",rel:"noreferrer",title:n.externalDocs.description||n.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Dn,{className:"w-3.5 h-3.5"})]})]}),n.summary&&o.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&o.jsx(Be,{children:n.description}),o.jsx(g.Suspense,{fallback:null,children:o.jsx(Yh,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:p,id:r})}),o.jsx(Vt,{name:"openapi.operation.reference.supplementary",context:{document:d,method:e,path:t}}),p.length>0&&o.jsxs("div",{id:`${s}-${r}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),w.length>0&&o.jsx(qt,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Ta,{className:"h-4 w-4 text-foreground-muted"}),o.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:w.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(As,{securities:w})})})]}),o.jsx(im,{label:b,parameters:f,requestBodyContent:m,requestBodyDescription:(z=n.requestBody)==null?void 0:z.description,responses:h,callbacks:n.callbacks,id:r,depth:l,fillHeight:N,onFollowOperation:c,isOperationKnown:u})]})})})}const Mo=320;function cm({parameters:e}){const{portalHost:t}=ke(),[n,r]=g.useState(!1),[s,i]=g.useState({top:0,left:0,placement:"bottom"}),a=g.useRef(null),c=g.useRef(null),u=g.useId();return g.useEffect(()=>{if(!n)return;const l=a.current;if(!l)return;const d=()=>i(pr(l,{align:"end",width:Mo}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n]),g.useEffect(()=>{if(!n)return;const l=f=>{var p;f.key==="Escape"&&(f.stopPropagation(),r(!1),(p=a.current)==null||p.focus())},d=f=>{var h;const p=((h=f.composedPath)==null?void 0:h.call(f))??[];p.includes(c.current)||p.includes(a.current)||r(!1)};return document.addEventListener("keydown",l,!0),document.addEventListener("pointerdown",d,!0),()=>{document.removeEventListener("keydown",l,!0),document.removeEventListener("pointerdown",d,!0)}},[n]),e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:a,type:"button",onClick:()=>r(l=>!l),"aria-expanded":n,"aria-haspopup":"dialog","aria-controls":n?u:void 0,"aria-label":`${e.length} query ${e.length===1?"parameter":"parameters"}`,className:`shrink-0 inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 font-mono text-[11px] leading-4 transition-colors ${n?"border-neutral-300 bg-neutral-200/70 text-foreground-secondary":"border-border bg-neutral-100 text-foreground-muted hover:border-neutral-300 hover:text-foreground-secondary"}`,children:[o.jsxs("span",{"aria-hidden":!0,children:["?",e.length]}),o.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 10 10",className:`h-2 w-2 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M1.5 3.5L5 7l3.5-3.5"})})]}),n&&t&&kt.createPortal(o.jsxs("div",{ref:c,id:u,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:Mo},className:`fixed z-[60] max-h-80 overflow-y-auto rounded-lg border border-border bg-surface shadow-lg ${s.placement==="top"?"-translate-y-full":""}`,children:[o.jsx("p",{className:"sticky top-0 border-b border-border bg-surface px-3 py-2 text-[10px] font-medium uppercase tracking-wider text-foreground-muted",children:"Query parameters"}),o.jsx("ul",{className:"divide-y divide-border",children:e.map(l=>o.jsxs("li",{className:"px-3 py-2",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("code",{className:"font-mono text-xs font-semibold text-foreground",children:l.name}),l.type&&o.jsx("span",{className:"text-[10px] text-foreground-muted",children:l.type}),l.required&&o.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-medium uppercase tracking-wide text-red-600",children:"Required"})]}),l.description&&o.jsx("p",{className:"mt-1 text-xs leading-snug text-foreground-secondary",children:l.description}),l.default&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Default:"})," ",o.jsx("code",{children:l.default})]}),l.enum&&l.enum.length>0&&o.jsx("p",{className:"mt-1 text-[11px] text-foreground-muted",children:Yo(l.enum)}),l.examples&&l.examples.length>0&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Examples:"})," ",l.examples.join(", ")]})]},l.name))})]}),t)]})}function sc(e){var n;const t=e.schema;return{description:e.description,type:t==null?void 0:t.type,default:(t==null?void 0:t.default)!==void 0?String(t.default):void 0,enum:(n=t==null?void 0:t.enum)==null?void 0:n.map(String),examples:"example"in e&&e.example!==void 0?[String(e.example)]:void 0}}function oc(e){const t={};for(const n of e)t[n.name]=sc(n);return t}function lm(e){return e.filter(t=>t.in==="query").map(t=>({...sc(t),name:t.name,required:t.required}))}const um=g.lazy(()=>import("@apiuikit/openapi-try-it-plugin").then(({TryItHeaderButton:e})=>({default:e})));function ic({method:e,path:t,parameters:n}){return o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:e}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(qe,{address:t,parameters:oc(n),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(cm,{parameters:lm(n)})]})}function ac({method:e,path:t}){const n=Le(),r=n.specType==="openapi"?n.document:null;return n.showTryIt!==!0||!r?null:o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Hn,{label:"built-in:openapi.operation.tryIt",children:o.jsx(um,{document:r,method:e,path:t})})})}function Pn({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:c}){var z;const u=A=>s==null?void 0:s(A),l=g.useMemo(()=>vt(e),[e]),d=g.useMemo(()=>{var v,y,$;const A=new Map;for(const I of l){const P=(($=(y=(v=e[I.path])==null?void 0:v[I.method])==null?void 0:y.tags)==null?void 0:$[0])||"Other",M=A.get(P)??[];M.push(I),A.set(P,M)}return Array.from(A,([I,P])=>({label:I,items:P}))},[l,e]),[f,p]=g.useState(()=>new Set),h=f.size===0;g.useEffect(()=>{if(!r)return;const A=d.find(({items:v})=>v.some(({key:y})=>y===r));A&&p(v=>{if(!v.has(A.label))return v;const y=new Set(v);return y.delete(A.label),y})},[d,r]);const m=g.useMemo(()=>{var v,y;const A=new Map;for(const{key:$,method:I,path:P}of l){const M=(y=(v=e[P])==null?void 0:v[I])==null?void 0:y.operationId;M&&A.set(M,$)}return A},[l,e]);if(l.length===0)return null;const b=r?l.find(A=>A.key===r):null,x=b?(z=e[b.path])==null?void 0:z[b.method]:null,w=({key:A,method:v,path:y},$)=>{var M;const I=r===A,P=mr(e[y],(M=e[y])==null?void 0:M[v]);return o.jsxs("tr",{id:`${a}-${A}`,onClick:()=>u(A),role:"button",tabIndex:$?0:-1,"aria-hidden":!$,"aria-label":`${v.toUpperCase()} ${y}`,"aria-current":I?"true":void 0,onKeyDown:U=>{U.key!=="Enter"&&U.key!==" "||(U.preventDefault(),u(A))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${$?`cursor-pointer opacity-100 visible ${I?"bg-neutral-50":""}`:"pointer-events-none invisible opacity-0"}`,children:[o.jsx("td",{className:`px-6 max-w-0 w-full group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${$?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${$?"max-h-12":"max-h-0"}`,children:o.jsx(qe,{address:y,parameters:oc(P),truncate:!0,className:"text-xs"})})}),o.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${$?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${$?"max-h-12":"max-h-0"}`,children:o.jsx(Ze,{method:v,className:"w-20"})})})]},A)},N=d.map(({label:A,items:v},y)=>{const $=!f.has(A),I=`${a}-group-${y}-${A.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(g.Fragment,{children:[o.jsx("tbody",{className:"border-y border-border first:border-t-0",children:o.jsx("tr",{className:"bg-neutral-50/70",children:o.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:o.jsxs("button",{type:"button","aria-label":`${A} endpoints (${v.length})`,"aria-expanded":$,"aria-controls":I,onClick:()=>p(P=>{const M=new Set(P);return $?M.add(A):M.delete(A),M}),className:"group/header flex w-full items-center gap-3 px-6 py-3.5 text-left hover:bg-neutral-100/80 transition-colors",children:[o.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-surface text-foreground-muted shadow-sm transition-colors group-hover/header:border-neutral-300 group-hover/header:text-foreground-secondary",children:$?o.jsx(Et,{className:"h-2.5 w-2.5"}):o.jsx(Oa,{className:"h-2.5 w-2.5"})}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:A}),o.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:v.length})]})})})}),o.jsx("tbody",{id:I,"aria-hidden":!$,className:`bg-surface ${$?"divide-y divide-border":""}`,children:v.map(P=>w(P,$))})]},A)}),j=mr(b?e[b.path]:void 0,x),E=b?o.jsx(ic,{method:b.method,path:b.path,parameters:j}):r,L=o.jsxs("div",{children:[o.jsx("div",{className:"mb-3 flex justify-end",children:o.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground-secondary",children:[o.jsx("input",{type:"checkbox",checked:h,onChange:A=>p(A.target.checked?new Set:new Set(d.map(({label:v})=>v))),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),p(h?new Set(d.map(({label:v})=>v)):new Set))},className:"h-3.5 w-3.5 cursor-pointer rounded border-border"}),o.jsx("span",{children:"Expand all"})]})}),o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),N]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{content:L,stickySideContent:!1,layout:c})}),o.jsx(La,{isOpen:!!b,side:"right",onClose:()=>u(null),title:E,headerActions:b&&o.jsx(ac,{method:b.method,path:b.path}),children:b&&x&&o.jsx(ut,{resetKey:x,fallback:o.jsx("p",{role:"alert",children:"This operation could not be rendered. Select another operation to continue."}),children:o.jsx($s,{method:b.method,path:b.path,op:{...x,parameters:j},id:b.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:A=>m.has(A),onFollowOperation:A=>{const v=m.get(A);v&&u(v)}},b.key)},b.key)})]})}const dm=e=>e==="endpoints"||e==="webhooks"||e==="schemas",fm=(e,t)=>{switch(e){case"webhooks":return`webhook-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`endpoint-${t}`}};function pm({openapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var k,C,D,K;const i=t.show??{},[a,c]=g.useState(!1),[u,l]=g.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&da(e.info),p=(n==null?void 0:n.some(Z=>!!Z.slots["openapi.document.topbar"]))??!1,h=d||f||p,m=e.webhooks??{},b=Object.keys(m).length>0,x=[...i.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Bn}]:[],...b&&i.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Jr}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Vr}]:[]],{query:w,setQuery:N,results:j}=Hh(e,{threshold:.3,limit:20}),{effectiveTab:E,focusTab:L,navActiveSection:z,selected:A,setSelectedKey:v,selectedNavItem:y,handleSearchSelect:$,handleNavItemSelect:I,handleNavServerSelect:P,handleContentTabChange:M,schemaFocusTarget:U}=wi({tabs:x,defaultTab:"endpoints",isTabKey:dm,sections:[{id:"endpoints",visible:i.endpoints!==!1},{id:"webhooks",visible:b&&i.webhooks!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:w,initialLocation:r,onLocationChange:s,getTargetId:fm}),X=(e.servers??[]).map(Z=>Z.url),S=E==="endpoints"?o.jsx(Pn,{paths:e.paths??{},security:e.security,securitySchemes:(k=e.components)==null?void 0:k.securitySchemes,selectedKey:A.endpoints,onSelectKey:Z=>v("endpoints",Z)}):E==="webhooks"?o.jsx(Pn,{paths:m,security:e.security,securitySchemes:(C=e.components)==null?void 0:C.securitySchemes,selectedKey:A.webhooks,onSelectKey:Z=>v("webhooks",Z),columnLabel:"Webhook",idPrefix:"webhook"}):E==="schemas"?o.jsx(Ns,{schemas:((D=e.components)==null?void 0:D.schemas)??{},selectedKey:A.schemas,focusTarget:U}):null;return o.jsx(Zn,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[h&&o.jsxs(Xo,{logo:f?o.jsx(ws,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Vt,{name:"openapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(si,{query:w,onQueryChange:N,results:j,onSelectResult:$,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(ci,{serialize:Z=>ss(e,Z),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Qa,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),i.servers!==!1&&X.length>0&&o.jsx("div",{id:A.servers??"server-0",children:o.jsx(qa,{servers:e.servers,selectedServer:A.servers,onSelectServer:Z=>v("servers",Z)})}),o.jsx(Zo,{tabs:x,current:E,onChange:M}),E&&o.jsx("div",{id:`panel-${E}`,role:"tabpanel","aria-labelledby":`tab-${E}`,children:o.jsx(ut,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:S},`${E}-${A.endpoints}-${A.webhooks}-${A.schemas}`)}),i.sidebar!==!1&&o.jsx(Nl,{paths:i.endpoints!==!1?e.paths:void 0,webhooks:b&&i.webhooks!==!1?m:void 0,schemas:i.schemas!==!1?(K=e.components)==null?void 0:K.schemas:void 0,servers:i.servers!==!1?X:void 0,hasInfo:i.info!==!1,activeTab:z,onTabChange:L,onItemSelect:I,onSelectServer:P,selectedItem:y})]})})}const Cs=e=>o.jsx(ut,{resetKey:e.openapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(hm,{...e})}),hm=e=>{const t=e.openapi,n=g.useMemo(()=>Nt(t),[t]),r=e.kind;g.useEffect(()=>{r==="resolved"&&n!==t&&Ur(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??ot;return o.jsx(pm,{openapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function cc(e){return{...e,title:t=>e.title(t),summary:t=>e.summary(t),targets:t=>e.targets(t),toMarkdown:(t,n)=>e.toMarkdown(t,n)}}const wt=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
|
|
179
|
-
`)[0])==null?void 0:n.trim())||void 0},mm=e=>$t.some(t=>t===e),gm=cc({name:"OpenAPI",matches:e=>typeof e.openapi=="string"||typeof e.swagger=="string",sectionTitle:"Endpoints",title:e=>{var t;return((t=e.info)==null?void 0:t.title)??"API"},summary:e=>{var t;return wt((t=e.info)==null?void 0:t.description)},targets:e=>vt(e.paths??{}).map(({key:t,method:n,path:r})=>{var i,a;const s=(a=(i=e.paths)==null?void 0:i[r])==null?void 0:a[n];return{key:t,label:`${n.toUpperCase()} ${r}`,summary:wt(s==null?void 0:s.summary)??wt(s==null?void 0:s.description),target:{kind:"operation",document:e,method:n,path:r}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return ss(e);if(typeof t.path!="string"||!mm(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return Ci(e,t.method,t.path)}}),xm=cc({name:"AsyncAPI",matches:e=>typeof e.asyncapi=="string",sectionTitle:"Operations",title:e=>{var t;return((t=e.info)==null?void 0:t.title)??"API"},summary:e=>{var t;return wt((t=e.info)==null?void 0:t.description)},targets:e=>Object.entries(e.operations??{}).map(([t,n])=>({key:t,label:n!=null&&n.action?`${n.action.toUpperCase()} ${t}`:t,summary:wt(n==null?void 0:n.summary)??wt(n==null?void 0:n.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return rs(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return Ei(e,t.id)}}),Ro=[gm,xm];function Ts(e){const t=typeof e=="object"&&e!==null?e:{},n=Ro.find(r=>r.matches(t));if(!n)throw new Error(`[apiuikit] Unrecognized document: expected a top-level "openapi", "swagger", or "asyncapi" version key. Supported specs: ${Ro.map(r=>r.name).join(", ")}.`);return n}function lc(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function bm(e){return Ts(e).targets(e)}function ym(e,t){const n=Ts(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return n.toMarkdown(e,t)}function wm(e,t={}){const n=Ts(e),{baseUrl:r,url:s,optional:i}=t,a=(r==null?void 0:r.replace(/\/+$/,""))??"",u=s??(p=>`${a}/${lc(p.key)}.md`),l=[`# ${t.title??n.title(e)}`],d=t.summary??n.summary(e);d&&l.push("",`> ${d}`);const f=n.targets(e).map(p=>({entry:p,href:u(p)})).filter(p=>!!p.href);if(f.length){l.push("",`## ${n.sectionTitle}`,"");for(const{entry:p,href:h}of f)l.push(`- [${p.label}](${h})${p.summary?`: ${p.summary}`:""}`)}if(i!=null&&i.length){l.push("","## Optional","");for(const p of i)l.push(`- [${p.label}](${p.url})${p.description?`: ${p.description}`:""}`)}return l.push(""),l.join(`
|
|
180
|
-
`)}function uc(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=i=>{const a=s(i);return a!==void 0?a:n(i)?t:void 0}}const km=["application/vnd.apache.avro","application/vnd.apache.avro+json","application/vnd.apache.avro+yaml","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/vnd.apache.avro;version=1.8.2","application/vnd.apache.avro+json;version=1.8.2","application/vnd.apache.avro+yaml;version=1.8.2"];function vm(){return{validate:Sm,parse:Am,getMimeTypes:()=>km}}function jm(e){uc(e,vm(),Kt)}function Sm(e){return ns(e.data).map(t=>({message:t,path:e.path}))}function Am(e){var n,r;const t=ns(e.data);if(t.length>0)return{[$n]:t[0]};try{const s=$r(e.data),i=e.meta.message,a=(r=(n=i==null?void 0:i.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=$r(a)),s}catch(s){return{[$n]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function Nm(){try{const e=await Promise.resolve().then(()=>require("./index-jpFnjoiM.cjs")).then(n=>n.index),t=e.default??e;if(typeof t!="function")throw new Error("Unexpected export shape from '@asyncapi/parser/browser'.");return t}catch(e){throw console.error("[apiuikit] Failed to load '@asyncapi/parser/browser':",e),new Error("[apiuikit] The parsed entry requires '@asyncapi/parser'. Install it (`npm i @asyncapi/parser`), or use the `AsyncAPI` component with a pre-resolved document instead.")}}async function dc(e){try{const t=await Nm(),n=new t;jm(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-DQwQQY_N.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e,{validateOptions:{allowedSeverity:{error:!0}}});return{diagnostics:i,document:s?$m(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Em(e,t){const{diagnostics:n,document:r}=await dc(e);return{diagnostics:n,view:r?o.jsx(Es,{kind:"resolved",asyncapi:r,config:t}):null}}function $m(e){return e.json()}function Cm({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=g.useState(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{let f=!0;return dc(e).then(({document:p,diagnostics:h})=>{var m;f&&(l(p),(m=d.current)==null||m.call(d,h))}),()=>{f=!1}},[e]),u?o.jsx(Es,{kind:"resolved",asyncapi:u,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}async function Tm(){try{return await Promise.resolve().then(()=>require("./index-JfEtoyra.cjs"))}catch(e){throw console.error("[apiuikit] Failed to load '@scalar/openapi-parser':",e),new Error("[apiuikit] The parsed entry requires '@scalar/openapi-parser'. Install it (`npm i @scalar/openapi-parser`), or use the `OpenAPI` component with a pre-resolved document instead.")}}const Im=e=>Array.isArray(e)?e:typeof e!="string"||e===""?[]:e.startsWith("/")?e.slice(1).split("/").map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~")):[e],Po=(e,t)=>({message:e.message,path:Im(e.path),severity:t}),Lo=new Set(["must have required property '$ref'","must match exactly one schema in oneOf"]),Om=(e,t)=>e.length>=t.length&&t.every((n,r)=>e[r]===n);function _m(e){const t=new Set,n=e.filter(s=>{const i=JSON.stringify([s.severity,s.message,s.path]);return t.has(i)?!1:(t.add(i),!0)}),r=n.filter(s=>!Lo.has(s.message));return n.filter(s=>!Lo.has(s.message)||!r.some(i=>Om(i.path,s.path)))}async function fc(e){var n;const t=[];try{const{validate:r,dereference:s,normalize:i}=await Tm();let a=i(e);if(!a||typeof a!="object"||Array.isArray(a)||typeof a.openapi!="string"||!/^3\.(0|1)\.\d+$/.test(a.openapi))return t.push({message:"Expected an OpenAPI 3.0 or 3.1 document.",path:[],severity:0}),{status:"unrenderable",diagnostics:t,document:null};const c=a.info;c&&typeof c=="object"&&!Array.isArray(c)&&typeof c.version!="string"&&t.push({message:"info.version must be a string.",path:["info","version"],severity:0});try{const l=s(e);t.push(...(l.errors??[]).map(d=>Po(d,0))),l.schema&&!((n=l.errors)!=null&&n.length)&&(a=l.schema)}catch(l){t.push({message:l instanceof Error?l.message:"Reference resolution failed",path:[],severity:0})}try{const l=await r(e);t.push(...(l.errors??[]).map(d=>Po(d,l.valid?1:0)))}catch(l){t.push({message:l instanceof Error?l.message:"Validation failed",path:[],severity:0})}const u=_m(t);return{status:u.some(l=>l.severity===0)?"partial":"ready",diagnostics:u,document:a}}catch(r){return t.push({message:r instanceof Error?r.message:"Failed to parse document",path:[],severity:0}),{status:"unrenderable",diagnostics:t,document:null}}}async function Mm(e,t){const{diagnostics:n,document:r}=await fc(e);return{diagnostics:n,view:r?o.jsx(Cs,{openapi:r,config:t}):null}}function Rm({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=g.useState(null),d=g.useRef(r);d.current=r,g.useEffect(()=>{let p=!0;return fc(e).then(h=>{var m;p&&(l(h),(m=d.current)==null||m.call(d,h.diagnostics))}),()=>{p=!1}},[e]);const f=u==null?void 0:u.document;return f?o.jsx(Cs,{openapi:f,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}function pc({title:e,headerActions:t,children:n}){return o.jsxs("article",{className:"rounded-lg border border-border bg-background overflow-hidden",children:[o.jsxs("header",{className:"flex items-center justify-between gap-4 px-5 py-4 border-b border-border",children:[o.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:e}),t]}),o.jsx("div",{className:"px-5 py-4",children:n})]})}function Pm({operationKey:e,op:t,layout:n}){return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{stickySideContent:!1,layout:n,content:o.jsx(pc,{title:o.jsx(Ja,{op:t,operationKey:e}),headerActions:o.jsx(Za,{operationKey:e}),children:o.jsx(Va,{op:t,id:e})})})})}function Lm({messageKey:e,message:t,layout:n}){const[r,s]=g.useState(!0),i=t.correlationId,a=o.jsxs("article",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:[o.jsxs("header",{className:"flex flex-wrap items-start justify-between gap-3 px-6 py-4",children:[o.jsxs("div",{className:"flex flex-col gap-1.5 min-w-0",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),o.jsx("span",{className:"w-fit text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:e}),t.summary&&o.jsx("span",{className:"text-sm text-foreground-muted",children:t.summary})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:t.contentType}),t.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),i&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:i.description??i.location,children:i.location})]})]}),o.jsx(Ss,{message:t,expanded:r,onToggleExpanded:()=>s(c=>!c),paddingX:"px-6"})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{content:a,stickySideContent:!1,layout:n})})}function hc(e,t,n){return function({document:s,config:i,plugins:a,children:c}){const u=g.useContext(dt),l=g.useMemo(()=>s?Nt(s):null,[s]),d=!!u&&u.specType!==n;if(g.useEffect(()=>{d&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${u.specType} document provider, which cannot supply the document it needs. `+(l?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[u,d,l]),u&&!d)return o.jsx(o.Fragment,{children:c});if(!l){if(u)return o.jsx(o.Fragment,{children:c});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:l,config:i,plugins:a,children:c})}}function rn(e,t){g.useEffect(()=>{e&&console.warn(`[apiuikit] ${t}`)},[e,t])}function Bm({document:e,config:t,plugins:n,children:r}){const s=g.useMemo(()=>Nt(e),[e]);return o.jsx(Ln,{document:s,config:t,plugins:n,children:r})}const Tt=hc(Ln,"AsyncAPI","asyncapi");function It(){const e=ke();return e.specType==="asyncapi",e.document}function Dm({layout:e}){const t=It();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Pa,{servers:t.servers,layout:e})}function Fm({layout:e,...t}){return o.jsx(Tt,{...t,children:o.jsx(Dm,{layout:e})})}function zm({layout:e}){const t=It(),[n,r]=g.useState(null);return o.jsx(Xa,{operations:t.operations??{},selectedKey:n,onSelectKey:r,layout:e})}function Hm({layout:e,...t}){return o.jsx(Tt,{...t,children:o.jsx(zm,{layout:e})})}function Um({operationId:e,layout:t}){var s;const r=(s=It().operations)==null?void 0:s[e];return rn(!r,`AsyncAPIOperation: no operation "${e}" in this document.`),r?o.jsx(Pm,{operationKey:e,op:r,layout:t}):null}function Wm({operationId:e,layout:t="stacked",...n}){return o.jsx(Tt,{...n,children:o.jsx(Um,{operationId:e,layout:t})})}function Km({layout:e}){var n;const t=It();return o.jsx($a,{messages:((n=t.components)==null?void 0:n.messages)??{},layout:e})}function Gm({layout:e,...t}){return o.jsx(Tt,{...t,children:o.jsx(Km,{layout:e})})}function Vm({messageId:e,layout:t}){var s,i;const r=(i=(s=It().components)==null?void 0:s.messages)==null?void 0:i[e];return rn(!r,`AsyncAPIMessage: no message "${e}" in components.messages.`),r?o.jsx(Lm,{messageKey:e,message:r,layout:t}):null}function Jm({messageId:e,layout:t="stacked",...n}){return o.jsx(Tt,{...n,children:o.jsx(Vm,{messageId:e,layout:t})})}function Zm({layout:e}){const t=It();return t.info?o.jsx(pa,{...t.info,layout:e}):null}function Xm({layout:e,...t}){return o.jsx(Tt,{...t,children:o.jsx(Zm,{layout:e})})}const Ym=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function Qm({layout:e}){var r,s;const t=g.useContext(dt),n=((s=(r=t==null?void 0:t.document)==null?void 0:r.components)==null?void 0:s.schemas)??{};return o.jsx(Ns,{schemas:n,layout:e})}function mc({document:e,config:t,plugins:n,sectionName:r,children:s}){const i=g.useContext(dt),a=g.useMemo(()=>e?Nt(e):null,[e]);if(i)return o.jsx(o.Fragment,{children:s});if(!a)throw new Error(`The ${r} section needs a \`document\` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.`);return Ym(a)?o.jsx(Zn,{document:a,config:t,plugins:n,children:s}):o.jsx(Ln,{document:a,config:t,plugins:n,children:s})}function Is({layout:e,...t}){return o.jsx(mc,{...t,sectionName:"Schemas",children:o.jsx(Qm,{layout:e})})}function qm({name:e,layout:t}){var c,u,l;const n=g.useContext(dt),r=n==null?void 0:n.deref,s=(l=(u=(c=n==null?void 0:n.document)==null?void 0:c.components)==null?void 0:u.schemas)==null?void 0:l[e],i=Fn(),a=g.useMemo(()=>s&&r?jt(s,r):null,[s,r,i]);return rn(!s,`Schema: no schema "${e}" in components.schemas.`),a?o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{content:o.jsx(Ya,{schemaName:e,resolved:a}),stickySideContent:!1,layout:t})}):null}function eg({name:e,layout:t="stacked",...n}){return o.jsx(mc,{...n,sectionName:"Schema",children:o.jsx(qm,{name:e,layout:t})})}const tg=Is,ng=Is;function gc({method:e,path:t,pathItem:n,paths:r,security:s,securitySchemes:i,idPrefix:a="endpoint",onNavigate:c,layout:u}){const l=n[e],d=mr(n,l),f=g.useMemo(()=>{var m,b;const h=new Set;for(const x of vt(r)){const w=(b=(m=r[x.path])==null?void 0:m[x.method])==null?void 0:b.operationId;w&&h.add(w)}return h},[r]);if(!l)return null;const p=ri(e,t);return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_e,{stickySideContent:!1,layout:u,content:o.jsx(pc,{title:o.jsx(ic,{method:e,path:t,parameters:d}),headerActions:o.jsx(ac,{method:e,path:t}),children:o.jsx($s,{method:e,path:t,op:{...l,parameters:d},id:p,idPrefix:a,globalSecurity:s,securitySchemes:i,isOperationKnown:h=>!!c&&f.has(h),onFollowOperation:c})})})})}function rg(e,t){if("operationId"in t){for(const[s,i]of Object.entries(e)){if(!i)continue;const a=$t.find(c=>{var u;return((u=i[c])==null?void 0:u.operationId)===t.operationId});if(a)return{method:a,path:s,pathItem:i}}return null}const n=e[t.path],r=t.method.toLowerCase();return n!=null&&n[r]?{method:r,path:t.path,pathItem:n}:null}function sg(e){return"operationId"in e?`operationId "${e.operationId}"`:`${e.method.toUpperCase()} ${e.path}`}function og({document:e,config:t,plugins:n,children:r}){const s=g.useMemo(()=>Nt(e),[e]);return o.jsx(Zn,{document:s,config:t,plugins:n,children:r})}const Ot=hc(Zn,"OpenAPI","openapi");function _t(){const e=Le();return e.specType==="openapi",e.document}function ig({layout:e}){const t=_t();return!t.servers||t.servers.length===0?null:o.jsx(qa,{servers:t.servers,layout:e})}function ag({layout:e,...t}){return o.jsx(Ot,{...t,children:o.jsx(ig,{layout:e})})}function cg({layout:e}){var s;const t=_t(),[n,r]=g.useState(null);return o.jsx(Pn,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:n,onSelectKey:r,layout:e})}function lg({layout:e,...t}){return o.jsx(Ot,{...t,children:o.jsx(cg,{layout:e})})}function ug({layout:e}){var i;const t=_t(),[n,r]=g.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Pn,{paths:s,security:t.security,securitySchemes:(i=t.components)==null?void 0:i.securitySchemes,selectedKey:n,onSelectKey:r,columnLabel:"Webhook",idPrefix:"webhook",layout:e})}function dg({layout:e,...t}){return o.jsx(Ot,{...t,children:o.jsx(ug,{layout:e})})}function fg({selector:e,onNavigate:t,layout:n}){var a;const r=_t(),s=g.useMemo(()=>r.paths??{},[r.paths]),i=rg(s,e);return rn(!i,`OpenAPIEndpoint: no endpoint with ${sg(e)} in this document.`),i?o.jsx(gc,{...i,paths:s,security:r.security,securitySchemes:(a=r.components)==null?void 0:a.securitySchemes,onNavigate:t,layout:n}):null}function pg(e){const{document:t,config:n,plugins:r,layout:s="stacked",onNavigate:i}=e,a="operationId"in e?{operationId:e.operationId}:{method:e.method,path:e.path};return o.jsx(Ot,{document:t,config:n,plugins:r,children:o.jsx(fg,{selector:a,onNavigate:i,layout:s})})}function hg({name:e,method:t,onNavigate:n,layout:r}){var l;const s=_t(),i=g.useMemo(()=>s.webhooks??{},[s.webhooks]),a=i[e],c=t?t.toLowerCase():a&&$t.find(d=>a[d]),u=a&&c&&a[c];return rn(!u,`OpenAPIWebhook: no webhook "${e}"${t?` with method ${t.toUpperCase()}`:""} in this document.`),!u||!a||!c?null:o.jsx(gc,{method:c,path:e,pathItem:a,paths:i,security:s.security,securitySchemes:(l=s.components)==null?void 0:l.securitySchemes,idPrefix:"webhook",onNavigate:n,layout:r})}function mg({name:e,method:t,onNavigate:n,layout:r="stacked",...s}){return o.jsx(Ot,{...s,children:o.jsx(hg,{name:e,method:t,onNavigate:n,layout:r})})}function gg({layout:e}){const t=_t();return t.info?o.jsx(Qa,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function xg({layout:e,...t}){return o.jsx(Ot,{...t,children:o.jsx(gg,{layout:e})})}exports.AsyncAPI=Es;exports.AsyncAPIInfo=Xm;exports.AsyncAPIMessage=Jm;exports.AsyncAPIMessages=Gm;exports.AsyncAPIOperation=Wm;exports.AsyncAPIOperations=Hm;exports.AsyncAPIProvider=Bm;exports.AsyncAPIRenderer=Cm;exports.AsyncAPISchemas=tg;exports.AsyncAPIServers=Fm;exports.CodeBlock=Vn;exports.ErrorBoundary=ut;exports.OpenAPI=Cs;exports.OpenAPIEndpoint=pg;exports.OpenAPIEndpoints=lg;exports.OpenAPIInfo=xg;exports.OpenAPIProvider=og;exports.OpenAPIRenderer=Rm;exports.OpenAPISchemas=ng;exports.OpenAPIServers=ag;exports.OpenAPIWebhook=mg;exports.OpenAPIWebhooks=dg;exports.PluginSlot=Vt;exports.Schema=eg;exports.SchemaTabs=ct;exports.SchemaTree=js;exports.Schemas=Is;exports.X_LIB_CONVERSION_ERROR=$n;exports.asyncApiOperationToMarkdown=Ei;exports.asyncApiToMarkdown=rs;exports.commonjsGlobal=Dd;exports.defaultConfig=ot;exports.documentToLlmsTxt=wm;exports.documentToMarkdown=ym;exports.ensureHljsLanguage=Ka;exports.getAugmentedNamespace=Fd;exports.getDefaultExportFromCjs=Ji;exports.hljsLanguageForTarget=Wa;exports.isHljsLanguageReady=Rn;exports.isProtobufSchemaFormat=Gt;exports.listDocumentTargets=bm;exports.markdownForLlm=ai;exports.openApiEndpointToMarkdown=Ci;exports.openApiToMarkdown=ss;exports.parseAndRender=Em;exports.parseAndRender$1=Mm;exports.registerSchemaParserWithFallback=uc;exports.resolveLogo=os;exports.targetSlug=lc;exports.useAsyncAPIDocument=ke;exports.useAsyncAPIDocumentContext=zo;exports.useDocumentContext=Le;exports.useOpenAPIDocumentContext=Ho;exports.useOperationTabPlugins=Oi;exports.usePluginSlot=Ii;
|