apiuikit 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeSamples-CaQ-Plnx.cjs → CodeSamples-BByLudCp.cjs} +1 -1
- package/dist/{CodeSamples-DevA5LND.js → CodeSamples-k51RAGfk.js} +1 -1
- package/dist/{LogoExtension-D0VY8gpU.cjs → LogoExtension-BIVvHwTB.cjs} +1 -1
- package/dist/{LogoExtension-DMBdjLMS.js → LogoExtension-RAcEKP86.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/CodeSamples.d.ts +1 -1
- package/dist/components/ContentTab.d.ts +1 -1
- package/dist/components/Examples.d.ts +1 -1
- package/dist/components/MethodBadge.d.ts +2 -2
- package/dist/components/Navigation/AsyncAPINavigation.d.ts +3 -3
- package/dist/components/Navigation/OpenAPINavigation.d.ts +1 -1
- package/dist/components/Navigation/SpecNavigation.d.ts +1 -1
- package/dist/components/Navigation/index.d.ts +4 -4
- package/dist/components/Navigation/sharedSections.d.ts +1 -1
- package/dist/components/QueryParameters.d.ts +1 -1
- package/dist/components/Reply.d.ts +2 -2
- package/dist/components/SearchPanel.d.ts +1 -1
- package/dist/components/schema/SchemaCaseDetail.d.ts +1 -1
- package/dist/components/schema/SchemaConstraints.d.ts +1 -1
- package/dist/components/schema/SchemaFieldMeta.d.ts +1 -1
- package/dist/components/schema/SchemaNode.d.ts +3 -3
- package/dist/components/schema/SchemaTreeRow.d.ts +1 -1
- package/dist/components/schema/SchemaTypeLabel.d.ts +1 -1
- package/dist/components/schema/index.d.ts +10 -10
- package/dist/components/schema/schemaDisplayUtils.d.ts +1 -1
- package/dist/components/schema/schemaUtils.d.ts +1 -1
- package/dist/config/config.d.ts +2 -2
- package/dist/config/default.d.ts +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/containers/AsyncAPI/AsyncAPI.d.ts +5 -5
- package/dist/containers/AsyncAPI/AsyncAPIDocumentProvider.d.ts +3 -3
- package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +4 -4
- package/dist/containers/AsyncAPI/Layout.d.ts +5 -5
- package/dist/containers/Information/Information.d.ts +2 -2
- package/dist/containers/Information/InformationSection.d.ts +1 -1
- package/dist/containers/Information/OpenAPIInformation.d.ts +2 -2
- package/dist/containers/Messages/Message.d.ts +1 -1
- package/dist/containers/Messages/MessageCard.d.ts +2 -2
- package/dist/containers/Messages/MessageDetails.d.ts +1 -1
- package/dist/containers/Messages/Messages.d.ts +2 -2
- package/dist/containers/OpenAPI/Layout.d.ts +5 -5
- package/dist/containers/OpenAPI/OpenAPI.d.ts +5 -5
- package/dist/containers/OpenAPI/OpenAPIDocumentProvider.d.ts +3 -3
- package/dist/containers/OpenAPI/OpenAPIRenderer.d.ts +4 -4
- package/dist/containers/Operation/Operation.d.ts +1 -1
- package/dist/containers/Operation/OperationCard.d.ts +2 -2
- package/dist/containers/Operation/OperationHeader.d.ts +1 -1
- package/dist/containers/Operation/Operations.d.ts +2 -2
- package/dist/containers/Path/Endpoint.d.ts +2 -2
- package/dist/containers/Path/EndpointHeader.d.ts +1 -1
- package/dist/containers/Path/OperationCallbacks.d.ts +1 -1
- package/dist/containers/Path/PathOperation.d.ts +1 -1
- package/dist/containers/Path/Paths.d.ts +2 -2
- package/dist/containers/Path/ResponseLinks.d.ts +1 -1
- package/dist/containers/Schema/SchemaCard.d.ts +1 -1
- package/dist/containers/Schema/Schemas.d.ts +2 -2
- package/dist/containers/Server/OpenAPIServer.d.ts +1 -1
- package/dist/containers/Server/OpenAPIServers.d.ts +2 -2
- package/dist/containers/Server/Server.d.ts +1 -1
- package/dist/containers/Server/Servers.d.ts +2 -2
- package/dist/contants.d.ts +2 -2
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/useSpec.d.ts +6 -6
- package/dist/helpers/avro/avroSchemaParser.d.ts +1 -1
- package/dist/helpers/avro/avroToJsonSchema.d.ts +2 -2
- package/dist/helpers/avro/index.d.ts +3 -3
- package/dist/helpers/codeSamples.d.ts +1 -1
- package/dist/helpers/common.d.ts +2 -2
- package/dist/helpers/findItem.d.ts +1 -1
- package/dist/helpers/llmsTxt.d.ts +2 -2
- package/dist/helpers/openapiParameters.d.ts +3 -3
- package/dist/helpers/openapiParser.d.ts +2 -2
- package/dist/helpers/openapiSearchIndex.d.ts +2 -2
- package/dist/helpers/parser.d.ts +2 -2
- package/dist/helpers/protobuf/index.d.ts +2 -2
- package/dist/helpers/protobuf/lazyProtoToJsonSchema.d.ts +1 -1
- package/dist/helpers/protobuf/primitiveTypes.d.ts +1 -1
- package/dist/helpers/protobuf/protoToJsonSchema.d.ts +1 -1
- package/dist/helpers/protobuf/protobufSchemaParser.d.ts +1 -1
- package/dist/helpers/protobuf/protocGenValidate.d.ts +1 -1
- package/dist/helpers/protobuf/protovalidate.d.ts +1 -1
- package/dist/helpers/schemaFormat.d.ts +1 -1
- package/dist/helpers/searchIndex.d.ts +1 -1
- package/dist/helpers/specAdapters.d.ts +1 -1
- package/dist/helpers/toMarkdown.d.ts +3 -3
- package/dist/hooks/useDocumentProviderValue.d.ts +8 -8
- package/dist/hooks/useFuseSearch.d.ts +1 -1
- package/dist/hooks/useOpenAPISearch.d.ts +4 -4
- package/dist/hooks/useSpecLayoutController.d.ts +2 -2
- package/dist/hooks/useSpecSearch.d.ts +4 -4
- package/dist/icons/BookOpen.d.ts +1 -1
- package/dist/icons/Link.d.ts +1 -1
- package/dist/icons/ShieldCheck.d.ts +1 -1
- package/dist/icons/Variable.d.ts +1 -1
- package/dist/{index-vxDO_J_a.js → index-BV_l6D37.js} +7 -7
- package/dist/{index-BXI--_xO.js → index-BaJBvuAY.js} +1 -1
- package/dist/{index-Djr20zD8.cjs → index-Bm-tkvJB.cjs} +1 -1
- package/dist/{index-BjVWe_rQ.cjs → index-CGrSsmLt.cjs} +1 -1
- package/dist/{index-BVwqtADi.js → index-UNhqn70K.js} +1 -1
- package/dist/{index-DKItRZCR.cjs → index-hXzlfF2S.cjs} +5 -5
- package/dist/index.d.ts +32 -32
- package/dist/markdown.d.ts +5 -5
- package/dist/plugin.d.ts +7 -7
- package/dist/plugins/OperationPluginTabs.d.ts +1 -1
- package/dist/plugins/PluginSlot.d.ts +1 -1
- package/dist/plugins/registry.d.ts +1 -1
- package/dist/plugins/types.d.ts +2 -2
- package/dist/{protoToJsonSchema-Br2jKuIZ.js → protoToJsonSchema-BCchfI0U.js} +1 -1
- package/dist/{protoToJsonSchema-C2GoWuZu.cjs → protoToJsonSchema-DL-Dx35m.cjs} +1 -1
- package/dist/{protobufSchemaParser-Cbb8hQnz.cjs → protobufSchemaParser-BnzKesB3.cjs} +1 -1
- package/dist/{protobufSchemaParser-DzWDLqeW.js → protobufSchemaParser-DSSUEb8t.js} +2 -2
- package/dist/public/createSectionRoot.d.ts +3 -3
- package/dist/public/openapiSections.d.ts +5 -5
- package/dist/public/schemasSection.d.ts +5 -5
- package/dist/public/sections.d.ts +4 -4
- package/dist/types/asyncapi/AnySchemaObject.d.ts +6 -6
- package/dist/types/asyncapi/ApiKey.d.ts +2 -2
- package/dist/types/asyncapi/ApiKeyHttpSecurityScheme.d.ts +2 -2
- package/dist/types/asyncapi/AsymmetricEncryption.d.ts +1 -1
- package/dist/types/asyncapi/AsyncApi_3Dot_0Dot_0SchemaDot.d.ts +6 -6
- package/dist/types/asyncapi/BearerHttpSecurityScheme.d.ts +2 -2
- package/dist/types/asyncapi/BindingsMinusKafkaMinus_0Dot_5Dot_0MinusChannelTopicConfiguration.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusMqttMinus_0Dot_2Dot_0MinusServerLastWill.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSnsMinus_0Dot_1Dot_0MinusChannelOrdering.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSnsMinus_0Dot_1Dot_0MinusChannelPolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSnsMinus_0Dot_1Dot_0MinusChannelStatement.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSnsMinus_0Dot_1Dot_0MinusOperationConsumer.d.ts +5 -5
- package/dist/types/asyncapi/BindingsMinusSnsMinus_0Dot_1Dot_0MinusOperationDeliveryPolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSnsMinus_0Dot_1Dot_0MinusOperationRedrivePolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSolaceMinus_0Dot_4Dot_0MinusOperationDestinationsItemOneOf_0.d.ts +2 -2
- package/dist/types/asyncapi/BindingsMinusSolaceMinus_0Dot_4Dot_0MinusOperationDestinationsItemOneOf_0Queue.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSolaceMinus_0Dot_4Dot_0MinusOperationDestinationsItemOneOf_1.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusChannelPolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusChannelQueue.d.ts +4 -4
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusChannelRedrivePolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusChannelStatement.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusOperationPolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusOperationQueue.d.ts +4 -4
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusOperationRedrivePolicy.d.ts +1 -1
- package/dist/types/asyncapi/BindingsMinusSqsMinus_0Dot_2Dot_0MinusOperationStatement.d.ts +1 -1
- package/dist/types/asyncapi/Channel.d.ts +6 -6
- package/dist/types/asyncapi/ChannelBindingsObject.d.ts +10 -10
- package/dist/types/asyncapi/ChannelBindingsObjectAmqp.d.ts +1 -1
- package/dist/types/asyncapi/ChannelBindingsObjectAnypointmq.d.ts +2 -2
- package/dist/types/asyncapi/ChannelBindingsObjectGooglepubsub.d.ts +3 -3
- package/dist/types/asyncapi/ChannelBindingsObjectIbmmq.d.ts +1 -1
- package/dist/types/asyncapi/ChannelBindingsObjectJms.d.ts +2 -2
- package/dist/types/asyncapi/ChannelBindingsObjectKafka.d.ts +2 -2
- package/dist/types/asyncapi/ChannelBindingsObjectPulsar.d.ts +3 -3
- package/dist/types/asyncapi/ChannelBindingsObjectSns.d.ts +3 -3
- package/dist/types/asyncapi/ChannelBindingsObjectSqs.d.ts +2 -2
- package/dist/types/asyncapi/ChannelBindingsObjectWs.d.ts +4 -4
- package/dist/types/asyncapi/Components.d.ts +31 -31
- package/dist/types/asyncapi/CoreSchemaMetaMinusSchemaObject.d.ts +2 -2
- package/dist/types/asyncapi/Info.d.ts +5 -5
- package/dist/types/asyncapi/MessageBindingsObject.d.ts +8 -8
- package/dist/types/asyncapi/MessageBindingsObjectAmqp.d.ts +1 -1
- package/dist/types/asyncapi/MessageBindingsObjectAnypointmq.d.ts +3 -3
- package/dist/types/asyncapi/MessageBindingsObjectGooglepubsub.d.ts +2 -2
- package/dist/types/asyncapi/MessageBindingsObjectHttp.d.ts +2 -2
- package/dist/types/asyncapi/MessageBindingsObjectIbmmq.d.ts +1 -1
- package/dist/types/asyncapi/MessageBindingsObjectJms.d.ts +2 -2
- package/dist/types/asyncapi/MessageBindingsObjectKafka.d.ts +4 -4
- package/dist/types/asyncapi/MessageBindingsObjectMqtt.d.ts +4 -4
- package/dist/types/asyncapi/MessageObject.d.ts +7 -7
- package/dist/types/asyncapi/MessageTrait.d.ts +6 -6
- package/dist/types/asyncapi/Oauth2Flows.d.ts +2 -2
- package/dist/types/asyncapi/Oauth2FlowsFlows.d.ts +4 -4
- package/dist/types/asyncapi/OpenIdConnect.d.ts +1 -1
- package/dist/types/asyncapi/Operation.d.ts +20 -20
- package/dist/types/asyncapi/OperationBindingsObject.d.ts +8 -8
- package/dist/types/asyncapi/OperationBindingsObjectAmqp.d.ts +2 -2
- package/dist/types/asyncapi/OperationBindingsObjectHttp.d.ts +3 -3
- package/dist/types/asyncapi/OperationBindingsObjectKafka.d.ts +2 -2
- package/dist/types/asyncapi/OperationBindingsObjectMqtt.d.ts +4 -4
- package/dist/types/asyncapi/OperationBindingsObjectNats.d.ts +1 -1
- package/dist/types/asyncapi/OperationBindingsObjectSns.d.ts +4 -4
- package/dist/types/asyncapi/OperationBindingsObjectSolace.d.ts +3 -3
- package/dist/types/asyncapi/OperationBindingsObjectSqs.d.ts +2 -2
- package/dist/types/asyncapi/OperationReply.d.ts +2 -2
- package/dist/types/asyncapi/OperationTrait.d.ts +16 -16
- package/dist/types/asyncapi/SaslGssapiSecurityScheme.d.ts +1 -1
- package/dist/types/asyncapi/SaslPlainSecurityScheme.d.ts +1 -1
- package/dist/types/asyncapi/SaslScramSecurityScheme.d.ts +1 -1
- package/dist/types/asyncapi/SchemaObject.d.ts +5 -5
- package/dist/types/asyncapi/Server.d.ts +17 -17
- package/dist/types/asyncapi/ServerBindingsObject.d.ts +6 -6
- package/dist/types/asyncapi/ServerBindingsObjectIbmmq.d.ts +1 -1
- package/dist/types/asyncapi/ServerBindingsObjectJms.d.ts +2 -2
- package/dist/types/asyncapi/ServerBindingsObjectKafka.d.ts +1 -1
- package/dist/types/asyncapi/ServerBindingsObjectMqtt.d.ts +4 -4
- package/dist/types/asyncapi/ServerBindingsObjectPulsar.d.ts +1 -1
- package/dist/types/asyncapi/ServerBindingsObjectSolace.d.ts +1 -1
- package/dist/types/asyncapi/SymmetricEncryption.d.ts +1 -1
- package/dist/types/asyncapi/Tag.d.ts +2 -2
- package/dist/types/asyncapi/UserPassword.d.ts +1 -1
- package/dist/types/asyncapi/X509.d.ts +1 -1
- package/dist/types/openapi.d.ts +1 -1
- package/dist/types/schema.d.ts +4 -4
- package/dist/utils/theme.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";var Yu=Object.create;var ls=Object.defineProperty;var Xu=Object.getOwnPropertyDescriptor;var Zu=Object.getOwnPropertyNames;var Qu=Object.getPrototypeOf,qu=Object.prototype.hasOwnProperty;var ed=(e,t,n)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var td=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Zu(t))!qu.call(e,s)&&s!==n&&ls(e,s,{get:()=>t[s],enumerable:!(r=Xu(t,s))||r.enumerable});return e};var Si=(e,t,n)=>(n=e!=null?Yu(Qu(e)):{},td(t||!e||!e.__esModule?ls(n,"default",{value:e,enumerable:!0}):n,e));var ge=(e,t,n)=>ed(e,typeof t!="symbol"?t+"":t,n);const o=require("react/jsx-runtime"),x=require("react"),an=require("react-dom"),ao=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],co=(e,t)=>{const n=t.length>0?t:ao,r=(e%n.length+n.length)%n.length;return n[r]},Rt={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:ao},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},lo=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",nd=e=>typeof e=="object"&&e!==null;function rd(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function Ja(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let n=e;for(const r of t.slice(2).split("/")){if(!nd(n))return;const s=rd(r);if(s===void 0||(n=n[s],n===void 0))return}return n}function Bt(e){const t=new Map;return n=>{if(t.has(n))return t.get(n);const r=Ja(e,n);return t.set(n,r),r}}const us=e=>typeof e=="object"&&e!==null,sd=e=>e.replace(/^#\//,"").split("/").pop()??e,uo=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),lo(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>uo(r,t))),Ya=(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),lo(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Ya(s,t,n))}finally{t.delete(e)}},od=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Ai=e=>e.length?`#/${e.map(od).join("/")}`:"#";function fn(e){if(!Ya(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,Ai(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(lo(i)){const c=Ja(e,i.$ref),u=us(c)||Array.isArray(c);if(u&&!n.has(c)){const l=s(c,a);return us(l)&&l["x-parser-schema-id"]===void 0&&(l["x-parser-schema-id"]=sd(i.$ref)),l}if(c!==void 0&&!u)return c}if(us(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,Ai(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 Ft extends x.Component{constructor(){super(...arguments);ge(this,"state",{error:null});ge(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 zt=x.createContext(null),it=()=>{const e=x.useContext(zt);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Xa=()=>{const e=it();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Za=()=>{const e=it();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},De=it;var Er=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Er||{});const id="Contact",ad="Email",Ei="License",Ni="External Documentation",cd="Tags",ld="Implicit",ud=`The Implicit flow is a simplified OAuth flow previously recommended
|
|
2
2
|
for native apps and JavaScript apps where the access token is returned
|
|
3
|
-
immediately without an extra authorization code exchange step.`,dd="Client Credentials",fd="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",pd="Password",hd="The Password grant type is a legacy way to exchange a user's credentials for an access token.",md="Authorization Code",gd="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Qa="Connecting to a server",xd="",Nr=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],bd=[50,100,200,300,500,600,700],yd={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"}},wd=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],kd={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",[Er.SEND]:"bg-green-100 text-green-800",[Er.RECEIVE]:"bg-blue-100 text-blue-800"};function qa(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 ds(e,t,n){if(e)for(const r of bd){const s=e[r];s&&(n[`--color-${t}-${r}`]=qa(s))}}const vd=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],jd={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 Sd(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 Ad(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 Ed(e,t){const n={},r=t==="dark"?e.dark:e.light;if(t==="dark")for(const[s,i]of Object.entries(jd))n[`--color-neutral-${s}`]=i;if(r)for(const[s,i]of vd){const a=r[s];a&&(n[i]=qa(a))}return e.colors&&(ds(e.colors.primary,"primary",n),ds(e.colors.secondary,"secondary",n),ds(e.colors.neutral,"neutral",n)),n}const Nd=e=>e.endsWith(".tab"),Ti=new WeakMap;let Td=0;const Cd=e=>{const t=Ti.get(e);if(t)return t;const n=`plugin-${Td++}`;return Ti.set(e,n),n};function ec(e){const t=new Map;for(const n of e){const r=Cd(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),Nd(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}const Ci="(prefers-color-scheme: dark)",_i=()=>typeof window<"u"&&typeof window.matchMedia=="function",_d=()=>!1;function $d(e){const t=x.useCallback(r=>{if(!e||!_i())return()=>{};const s=window.matchMedia(Ci);return s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),n=()=>e&&_i()&&window.matchMedia(Ci).matches;return x.useSyncExternalStore(t,n,_d)}const Id=[];function tc(e,t,n=Rt,r=Id){var _,L,U,P,X,ie,E,S,M,W;const[s,i]=x.useState(null),[a,c]=x.useState(null),u=x.useMemo(()=>Bt(t),[t]),l=((_=n.expand)==null?void 0:_.schemas)===!0,d=(U=(L=n.theme)==null?void 0:L.depthColors)!=null&&U.length?n.theme.depthColors:ao,f=((P=n.show)==null?void 0:P.extensions)!==!1,p=((X=n.show)==null?void 0:X.codeSamples)!==!1,m=((ie=n.show)==null?void 0:ie.tryIt)===!0,g=n.topOffset,y=typeof g=="number"&&Number.isFinite(g)?Math.max(0,g):0,b=((E=n.sidePanel)==null?void 0:E.containment)??"viewport",j=(S=n.sidePanel)==null?void 0:S.topOffset,N=typeof j=="number"&&Number.isFinite(j)?Math.max(0,j):y,A=(M=n.markdown)==null?void 0:M.url,$=x.useMemo(()=>{if(typeof A=="function")return A;if(typeof A=="string")return()=>A},[A]),F=x.useMemo(()=>ec(r),[r]),G=$d(((W=n.theme)==null?void 0:W.mode)==="system"),T=x.useMemo(()=>Ad(n.theme,G),[n.theme,G]),v=x.useMemo(()=>Ed(Sd(Rt.theme,n.theme),T),[n.theme,T]);return{contextValue:x.useMemo(()=>({specType:e,document:t,deref:u,portalHost:s,rootElement:a,topOffset:y,sidePanelContainment:b,sidePanelTopOffset:N,defaultSchemaExpanded:l,depthColors:d,showExtensions:f,showCodeSamples:p,showTryIt:m,markdownUrl:$,plugins:r,pluginSlotRegistry:F,config:n,resolvedMode:T}),[e,t,u,s,a,y,b,N,l,d,f,p,m,$,r,F,n,T]),themeVars:v,resolvedMode:T,setPortalHost:i,setRootElement:c}}function Fr({document:e,config:t=Rt,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=tc("asyncapi",e,t,n);return o.jsx(zt.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 fo="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function nt({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:c="columns",topSpacing:u=!0,bottomSpacing:l=!0}){const d=c==="stacked",f=n!=null&&n!==!1,p=`${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 ${u?"mt-6":""} ${l?"mb-6":""} ${d?"":fo}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:d?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:p,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${d?"flex-col":f&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${d?"w-full":"@lg:w-prose"} min-w-0`,children:t}),d?f&&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 ${f?"":"hidden @lg:block"}`,"data-testid":"section-side-column",children:o.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function $t(...e){return e.filter(Boolean).join(" ")}function pn({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 br=(e,t)=>`${e?`${e}-`:""}tab-${t}`,yr=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function Ht({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:c}){var y;const u=x.useId(),l=x.useRef([]),d=t??(a?"":((y=e[0])==null?void 0:y.id)??""),f=e.some(b=>!!b.icon),p=t?e.findIndex(b=>b.id===t):-1,m=p>=0?p:0,g=(b,j)=>{var $;if(e.length===0)return;const N=F=>(F+e.length)%e.length;let A=j;if(b.key==="ArrowRight"&&(b.preventDefault(),A=N(j+1)),b.key==="ArrowLeft"&&(b.preventDefault(),A=N(j-1)),b.key==="Home"&&(b.preventDefault(),A=0),b.key==="End"&&(b.preventDefault(),A=e.length-1),A!==j){const F=e[A];n(F.id),($=l.current[A])==null||$.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:$t("@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:b=>n(b.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(b=>o.jsx("option",{value:b.id,children:b.name},b.id))]}),o.jsx(pn,{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:$t("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((b,j)=>{const N=b.id===t;return o.jsx("button",{ref:A=>{l.current[j]=A},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:A=>g(A,j),className:$t("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:b.name},b.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((b,j)=>{const N=b.id===t,A=b.icon;return o.jsx("button",{ref:$=>{l.current[j]=$},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:$=>g($,j),className:$t("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:[A?o.jsx(A,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:b.name})]})},b.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((b,j)=>{const N=b.id===t;return o.jsxs("button",{ref:A=>{l.current[j]=A},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:A=>g(A,j),className:$t(N?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",j===0?"rounded-l-lg":"",j===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:b.name}),o.jsx("span",{"aria-hidden":"true",className:$t(N?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},b.id)})})})]}):null}function Od({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:yr(n,s.id),role:"tabpanel","aria-labelledby":br(n,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:r(s,i)},s.id)})})}function nc(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function po(e){let t=e;for(;t&&t!==document.body;){if(nc(t))return t;t=t.parentElement}return document.documentElement}function Md(e,t){if(!e||!t||!t.contains(e))return null;let n=e;for(;n;){if(nc(n))return n;if(n===t)break;n=n.parentElement}return null}function rc(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 sc({tabs:e,current:t,onChange:n}){const{rootElement:r,topOffset:s=0}=it();if(!e.length)return null;const i=typeof document<"u"&&po(r)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full",children:o.jsx(Ht,{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(nt,{content:a,stickySideContent:!1,bottomSpacing:!1})})}function Rd(e,t){const[n,r]=x.useState("docked"),s=x.useRef(t);return s.current=t,x.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]),x.useEffect(()=>{t&&r(i=>i==="hidden"?"pinned":i)},[t]),n}const Ld=56,Pd=8;function oc({logo:e,children:t,forceVisible:n=!1}){const{rootElement:r,topOffset:s=0}=it(),i=Rd(r,n),a=s,c=a+Ld+Pd,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 ${fo}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function ic(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(x.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 Dd(e){return e.map(t=>`\`${t}\``).join(", ")}function Is(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 Bd(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 $i=360;function Fd(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 ${Nr[t++%Nr.length]}`,children:`{${n.value}}`},r))}function Et({address:e,parameters:t,className:n="text-xs",truncate:r=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=De(),[c,u]=x.useState(null),[l,d]=x.useState({top:0,left:0,placement:"top"}),[f,p]=x.useState(!1),[m,g]=x.useState(null),y=x.useRef(null),b=x.useId(),j=Bd(e);let N=0;x.useEffect(()=>{if(!r)return;const w=y.current;if(!w)return;const _=()=>p(w.scrollWidth>w.clientWidth);_();const L=new ResizeObserver(_);return L.observe(w),()=>L.disconnect()},[r,e]);const A=(w,_)=>{d(Is(_)),u(w)},$=()=>u(null),F=w=>g(Is(w,{align:"end",width:$i})),G=()=>g(null),T=j.map((w,_)=>{if(w.type==="text")return o.jsx("span",{children:w.value},_);const L=t==null?void 0:t[w.value],U=Nr[N++%Nr.length],P=c===_,X=!!L&&(L.description||L.type||L.default||L.enum&&L.enum.length>0||L.examples&&L.examples.length>0),ie=`channel-address-tooltip-${_}`,E=X&&P?ie:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:S=>X&&A(_,S.currentTarget),onMouseLeave:$,children:[o.jsx("span",{className:`font-semibold ${U} ${X?"cursor-help underline decoration-dotted":""}`,role:X?"button":void 0,tabIndex:X?0:void 0,"aria-expanded":X?P:void 0,"aria-describedby":E,onFocus:S=>X&&A(_,S.currentTarget),onBlur:$,onKeyDown:S=>{X&&((S.key==="Enter"||S.key===" ")&&(S.preventDefault(),A(_,S.currentTarget)),S.key==="Escape"&&(S.preventDefault(),$(),S.currentTarget.blur()))},children:`{${w.value}}`}),X&&P&&a&&an.createPortal(o.jsxs("div",{id:ie,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:[L.description&&o.jsx("div",{children:L.description}),L.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:L.type})}),L.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:L.default})]}),L.enum&&L.enum.length>0&&o.jsx("div",{className:"mt-1",children:ic(L.enum)}),L.examples&&L.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",L.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:y,className:"overflow-hidden whitespace-nowrap min-w-0",children:T}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!m,"aria-describedby":m?b: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:w=>F(w.currentTarget),onMouseLeave:G,onFocus:w=>F(w.currentTarget),onBlur:G,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),w.stopPropagation(),F(w.currentTarget)),w.key==="Escape"&&(w.preventDefault(),G(),w.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&m&&a&&an.createPortal(o.jsx("div",{id:b,role:"tooltip",style:{top:m.top,left:m.left,width:$i},className:`fixed z-[60] rounded-lg border border-border bg-surface px-3 py-2 shadow-lg pointer-events-none ${m.placement==="top"?"-translate-y-full":""}`,children:o.jsx("code",{className:"block break-all font-mono text-xs leading-relaxed text-foreground-secondary",children:Fd(j)})}),a)]}):o.jsx("code",{className:`${v}rounded text-foreground-secondary break-all ${n}`,children:T})}const zd={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function wt({method:e,size:t="sm",className:n=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${zd[t]} ${kd[e]} ${n}`,children:e}):null}function Os(e,t){const[n,r]=x.useState(null);return x.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 Ii=6,Hd=12,Ud=8,Wd=.7,Gd=240;function Kd(e,t){if(e===0)return 1/0;const n=Math.min(e*Wd,Gd)-Ud*2,r=t*Ii+Math.max(0,t-1)*Hd;return Math.max(1,Math.floor((n-r)/Ii))}function Vd(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 Jd=12,Yd=48,Xd=40;function Zd({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[i,a]=x.useState(!1),[c,u]=x.useState(!1),l=i||c,{rootElement:d,portalHost:f,topOffset:p=0}=De(),m=x.useRef(null),g=x.useRef(null),[y,b]=x.useState(null),[j,N]=x.useState(null),A=x.useMemo(()=>e.filter(J=>J.items.length>0),[e]),$=x.useMemo(()=>A.filter(J=>J.isTab===!1||J.id===t),[A,t]),F=x.useMemo(()=>A.filter(J=>J.showInPopover!==!1),[A]),[G,T]=x.useState(null),v=x.useRef(null),w=x.useRef(null),_=x.useCallback((J,H)=>{T({section:J,key:H}),v.current={section:J,key:H},w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{v.current=null},600)},[]);x.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),x.useEffect(()=>{const H=e.filter(V=>V.items.length>0).flatMap(V=>V.items.map(me=>({section:V.id,key:V.itemKey(me),id:V.targetId(me)}))).map(V=>({...V,el:document.getElementById(V.id)})).filter(V=>!!V.el);if(H.length===0)return;const B=new Map(H.map(V=>[V.el,V])),se=new Map,ue=new IntersectionObserver(V=>{for(const O of V)O.isIntersecting?se.set(O.target,O.boundingClientRect.top):se.delete(O.target);if(se.size===0)return;let me=null,Ce=-1/0;for(const[O,R]of se)R>Ce&&(me=O,Ce=R);const _e=me&&B.get(me);if(!_e)return;const Re=v.current;if(Re){if(_e.section!==Re.section||_e.key!==Re.key)return;v.current=null}T({section:_e.section,key:_e.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return H.forEach(V=>ue.observe(V.el)),()=>ue.disconnect()},[e]);const L=(G==null?void 0:G.section)??t,U=G??s,P=Os(d,!0),X=typeof window>"u"?0:window.innerWidth,ie=typeof window>"u"?0:window.innerHeight,E=!!P&&P.bottom>p&&P.top<ie,S=Math.max((P==null?void 0:P.top)??p,p),M=Math.min((P==null?void 0:P.bottom)??ie,ie),W=Math.max(0,M-S),Q=(S+M)/2,[ne,Ae]=x.useState(null);x.useLayoutEffect(()=>{if(!j||!d)return;const J=()=>{const B=j.getBoundingClientRect().left-d.getBoundingClientRect().left;Ae(se=>se===B?se:B)};J();const H=new ResizeObserver(J);return H.observe(j),H.observe(d),window.addEventListener("resize",J),()=>{H.disconnect(),window.removeEventListener("resize",J)}},[j,d]);const Ne=ne===null?null:((P==null?void 0:P.left)??0)+ne,ye=((P==null?void 0:P.left)??0)+Jd,q=Ne!==null?Ne-ye>=Xd+Yd:!!P&&P.width>=1024,le=!!P&&!q,K={opacity:E?1:0,pointerEvents:E?"auto":"none",transition:"opacity 0.2s ease"},ae={position:"fixed",top:Q,left:ye,transform:"translateY(-50%)",zIndex:45,...K},he={position:"sticky",bottom:0,height:0,zIndex:45,pointerEvents:"none"},de=Os(y,le),Te=le?{position:"fixed",bottom:de?ie-de.top+8:68,right:de?X-de.right:16,zIndex:46}:{position:"fixed",top:Q,left:ye,transform:"translateY(-50%)",maxHeight:`${Math.max(0,W-32)}px`,zIndex:46};x.useEffect(()=>{if(!i)return;const J=B=>{var se;B.key==="Escape"&&(a(!1),u(!1),(se=m.current)==null||se.focus())},H=B=>{var ue,V;const se=B.target;(ue=m.current)!=null&&ue.contains(se)||(V=g.current)!=null&&V.contains(se)||a(!1)};return document.addEventListener("keydown",J),document.addEventListener("mousedown",H),()=>{document.removeEventListener("keydown",J),document.removeEventListener("mousedown",H)}},[i]);const we=x.useCallback((J,H)=>{J.isTab!==!1&&n(J.id),H&&setTimeout(()=>{var B;(B=document.getElementById(H))==null||B.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),ke=x.useMemo(()=>F.map(J=>{const H=L===J.id,B=(U==null?void 0:U.section)===J.id,se=J.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{we(J),_(J.id,""),le&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${H?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(se,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${H?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${H?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:J.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 ${H?"border border-primary-200 bg-primary-100 text-primary-700":"bg-neutral-100 text-foreground-muted"}`,children:J.items.length})]}),J.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:J.items.map(ue=>{const V=J.itemKey(ue),me=B&&(U==null?void 0:U.key)===V;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{we(J,J.targetId(ue)),r(J.id,V),_(J.id,V),le&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${me?"bg-primary-50 font-medium text-primary-700":H?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:J.renderItem(ue,{isSelected:me,isSectionActive:H})})},V)})})]},J.id)}),[F,L,U,le,we,r,_]),Me=Kd(W,$.length),re=x.useMemo(()=>{const J=Vd($.map(H=>H.items.length),Me);return $.map((H,B)=>{const se=L===H.id,ue=H.items.length,V=J[B];let me=-1;if((U==null?void 0:U.section)===H.id){const Ce=H.items.findIndex(_e=>H.itemKey(_e)===U.key);Ce>=0&&(me=Math.min(V-1,Math.floor(Ce*V/ue)))}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 ${se?"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:V},(Ce,_e)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${_e===me?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},_e))})]},H.id)})},[$,L,U,Me]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:N,"aria-hidden":"true",className:`w-full ${fo}`,style:{height:0}}),!le&&o.jsx("button",{ref:m,onClick:()=>a(J=>!J),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:{...ae,visibility:E?"visible":"hidden"},children:re}),le&&o.jsx("div",{style:he,children:o.jsx("button",{ref:J=>{m.current=J,b(J)},onClick:()=>a(J=>!J),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:{...K,visibility:E?"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&&an.createPortal(o.jsx("div",{ref:g,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 ${le?"origin-bottom-right":""} ${l?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:{...Te,visibility:l?"visible":"hidden"},children:ke}),f)]})}function ac({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:i}){return o.jsx(Zd,{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 ho({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 Qd(e){return o.jsxs(ho,{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 mo({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 cc(e){return{id:"info",label:"Info",icon:Qd,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function lc(e){return{id:"schemas",label:"Schemas",icon:mo,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function uc({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 zr({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 dc({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 ar={};function qd({operations:e=ar,messages:t=ar,schemas:n=ar,servers:r=ar,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l,sidebarConfig:d}){const f=x.useMemo(()=>{const p=m=>{var y;return d!=null&&d.useChannelAddressAsIdentifier?((y=e[m])==null?void 0:y.channel)??null:null};return[cc(s),{id:"servers",label:"Servers",icon:uc,isTab:!1,items:Object.keys(r),itemKey:m=>m,targetId:m=>`server-${m}`,renderItem:m=>o.jsx("span",{className:"truncate",children:m})},{id:"operations",label:"Operations",icon:zr,items:Object.keys(e),itemKey:m=>m,targetId:m=>`operation-${m}`,renderItem:m=>{var y;const g=p(m);return g!=null&&g.address?o.jsx(Et,{address:g.address,parameters:g.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:(y=e[m])==null?void 0:y.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m})]})}},{id:"messages",label:"Messages",icon:dc,items:Object.keys(t),itemKey:m=>m,targetId:m=>`message-${m}`,renderItem:m=>o.jsx("span",{className:"truncate",children:m})},lc(n)]},[e,t,n,r,s,d]);return o.jsx(ac,{sections:f,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const hn=["get","put","post","delete","options","head","patch","trace"],fc=(e,t)=>`${e} ${t}`;function Ms(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 cn(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?hn.filter(r=>n[r]).map(r=>({key:fc(r,t),method:r,path:t})):[]})}function go({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 Oi={},ef={},tf=[];function nf({paths:e=Oi,webhooks:t=Oi,schemas:n=ef,servers:r=tf,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l}){const d=x.useMemo(()=>cn(e),[e]),f=x.useMemo(()=>cn(t),[t]),p=x.useMemo(()=>{const m=r.map((g,y)=>({key:`server-${y}`,url:g}));return[cc(s),{id:"servers",label:"Servers",icon:uc,isTab:!1,items:m,itemKey:g=>g.key,targetId:g=>g.key,renderItem:g=>o.jsx("span",{className:"truncate",children:g.url})},{id:"endpoints",label:"Endpoints",icon:zr,items:d,itemKey:g=>g.key,targetId:g=>`endpoint-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx(Et,{address:g.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:go,items:f,itemKey:g=>g.key,targetId:g=>`webhook-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:g.path})]})},lc(n)]},[d,f,n,r,s]);return o.jsx(ac,{sections:p,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const rf=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 pc({query:e,onQueryChange:t,results:n,onSelectResult:r,onOpenChange:s}){const i=x.useRef(null),a=x.useRef(null),[c,u]=x.useState(!1),[l,d]=x.useState(-1),f="asyncapi-search-results",p=v=>`asyncapi-search-result-${v}`,{portalHost:m,rootElement:g,topOffset:y=0}=De(),b=()=>{u(!1),d(-1)};x.useEffect(()=>(s==null||s(c),()=>s==null?void 0:s(!1)),[c,s]);const j=x.useRef(!1),N=x.useRef(!1);x.useEffect(()=>{if(!g)return;const v=()=>{j.current=!0},w=()=>{j.current=!1};return g.addEventListener("mouseenter",v),g.addEventListener("mouseleave",w),()=>{g.removeEventListener("mouseenter",v),g.removeEventListener("mouseleave",w)}},[g]),x.useEffect(()=>{if(!g)return;const v=w=>{N.current=g.contains(w.target)};return document.addEventListener("mousedown",v,!0),()=>document.removeEventListener("mousedown",v,!0)},[g]),x.useEffect(()=>{if(!g)return;const v=w=>{!(w.metaKey||w.ctrlKey)||w.key.toLowerCase()!=="k"||!(g.contains(document.activeElement)||j.current||N.current)||(w.preventDefault(),u(!0))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[g]),x.useEffect(()=>{if(!c)return;const v=requestAnimationFrame(()=>{var w;return(w=a.current)==null?void 0:w.focus()});return()=>cancelAnimationFrame(v)},[c]),x.useEffect(()=>{if(!(!c||!m))return rc(po(m))},[c,m]),x.useEffect(()=>{if(!c)return;const v=w=>{w.key==="Escape"&&b()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c]),x.useEffect(()=>{if(!c)return;const v=w=>{i.current&&!i.current.contains(w.target)&&b()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]),x.useEffect(()=>{l>=n.length&&d(n.length-1)},[l,n.length]),x.useEffect(()=>{var v;l<0||(v=document.getElementById(p(l)))==null||v.scrollIntoView({block:"nearest"})},[l]);const A=c&&e.trim().length>0,$=v=>{b(),r(v)},F=v=>{if(v.key==="Escape"){v.preventDefault(),b();return}if(A){if(v.key==="ArrowDown"){v.preventDefault(),d(w=>n.length===0?-1:Math.min(w+1,n.length-1));return}if(v.key==="ArrowUp"){v.preventDefault(),d(w=>n.length===0?-1:Math.max(w-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(),$(n[l]);return}}},G=A?`${n.length} result${n.length===1?"":"s"} found`:"",T=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(rf,{})}),c&&m&&an.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:y},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:F,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":A,"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:G}),A&&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,w)=>o.jsx("li",{children:o.jsxs("button",{id:p(w),type:"button",role:"option","aria-selected":l===w,onClick:()=>$(v),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===w?"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:T?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]})]}),m)]})}function hc({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 mc({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 Hr({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 sf=["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 gc(e){return`${["> ## Agent Instructions",...sf.map(n=>`> ${n}`)].join(`
|
|
3
|
+
immediately without an extra authorization code exchange step.`,dd="Client Credentials",fd="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",pd="Password",hd="The Password grant type is a legacy way to exchange a user's credentials for an access token.",md="Authorization Code",gd="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Qa="Connecting to a server",xd="",Nr=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],bd=[50,100,200,300,500,600,700],yd={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"}},wd=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],kd={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",[Er.SEND]:"bg-green-100 text-green-800",[Er.RECEIVE]:"bg-blue-100 text-blue-800"};function qa(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 ds(e,t,n){if(e)for(const r of bd){const s=e[r];s&&(n[`--color-${t}-${r}`]=qa(s))}}const vd=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],jd={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 Sd(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 Ad(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 Ed(e,t){const n={},r=t==="dark"?e.dark:e.light;if(t==="dark")for(const[s,i]of Object.entries(jd))n[`--color-neutral-${s}`]=i;if(r)for(const[s,i]of vd){const a=r[s];a&&(n[i]=qa(a))}return e.colors&&(ds(e.colors.primary,"primary",n),ds(e.colors.secondary,"secondary",n),ds(e.colors.neutral,"neutral",n)),n}const Nd=e=>e.endsWith(".tab"),Ti=new WeakMap;let Td=0;const Cd=e=>{const t=Ti.get(e);if(t)return t;const n=`plugin-${Td++}`;return Ti.set(e,n),n};function ec(e){const t=new Map;for(const n of e){const r=Cd(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),Nd(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}const Ci="(prefers-color-scheme: dark)",_i=()=>typeof window<"u"&&typeof window.matchMedia=="function",_d=()=>!1;function $d(e){const t=x.useCallback(r=>{if(!e||!_i())return()=>{};const s=window.matchMedia(Ci);return s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),n=()=>e&&_i()&&window.matchMedia(Ci).matches;return x.useSyncExternalStore(t,n,_d)}const Id=[];function tc(e,t,n=Rt,r=Id){var _,L,U,P,X,ie,E,S,M,W;const[s,i]=x.useState(null),[a,c]=x.useState(null),u=x.useMemo(()=>Bt(t),[t]),l=((_=n.expand)==null?void 0:_.schemas)===!0,d=(U=(L=n.theme)==null?void 0:L.depthColors)!=null&&U.length?n.theme.depthColors:ao,f=((P=n.show)==null?void 0:P.extensions)!==!1,p=((X=n.show)==null?void 0:X.codeSamples)!==!1,m=((ie=n.show)==null?void 0:ie.tryIt)===!0,g=n.topOffset,y=typeof g=="number"&&Number.isFinite(g)?Math.max(0,g):0,b=((E=n.sidePanel)==null?void 0:E.containment)??"viewport",j=(S=n.sidePanel)==null?void 0:S.topOffset,N=typeof j=="number"&&Number.isFinite(j)?Math.max(0,j):y,A=(M=n.markdown)==null?void 0:M.url,$=x.useMemo(()=>{if(typeof A=="function")return A;if(typeof A=="string")return()=>A},[A]),F=x.useMemo(()=>ec(r),[r]),G=$d(((W=n.theme)==null?void 0:W.mode)==="system"),T=x.useMemo(()=>Ad(n.theme,G),[n.theme,G]),v=x.useMemo(()=>Ed(Sd(Rt.theme,n.theme),T),[n.theme,T]);return{contextValue:x.useMemo(()=>({specType:e,document:t,deref:u,portalHost:s,rootElement:a,topOffset:y,sidePanelContainment:b,sidePanelTopOffset:N,defaultSchemaExpanded:l,depthColors:d,showExtensions:f,showCodeSamples:p,showTryIt:m,markdownUrl:$,plugins:r,pluginSlotRegistry:F,config:n,resolvedMode:T}),[e,t,u,s,a,y,b,N,l,d,f,p,m,$,r,F,n,T]),themeVars:v,resolvedMode:T,setPortalHost:i,setRootElement:c}}function Fr({document:e,config:t=Rt,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=tc("asyncapi",e,t,n);return o.jsx(zt.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 fo="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function nt({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:c="columns",topSpacing:u=!0,bottomSpacing:l=!0}){const d=c==="stacked",f=n!=null&&n!==!1,p=`${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 ${u?"mt-6":""} ${l?"mb-6":""} ${d?"":fo}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:d?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:p,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${d?"flex-col":f&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${d?"w-full":"@lg:w-prose"} min-w-0`,children:t}),d?f&&o.jsx("div",{className:`order-first mt-6 ${r?"@lg:sticky @lg:top-4":""}`,children:n}):o.jsx("div",{className:`@lg:pl-12 @lg:w-[400px] shrink-0 ${f?"":"hidden @lg:block"}`,"data-testid":"section-side-column",children:o.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function $t(...e){return e.filter(Boolean).join(" ")}function pn({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 br=(e,t)=>`${e?`${e}-`:""}tab-${t}`,yr=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function Ht({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:c}){var y;const u=x.useId(),l=x.useRef([]),d=t??(a?"":((y=e[0])==null?void 0:y.id)??""),f=e.some(b=>!!b.icon),p=t?e.findIndex(b=>b.id===t):-1,m=p>=0?p:0,g=(b,j)=>{var $;if(e.length===0)return;const N=F=>(F+e.length)%e.length;let A=j;if(b.key==="ArrowRight"&&(b.preventDefault(),A=N(j+1)),b.key==="ArrowLeft"&&(b.preventDefault(),A=N(j-1)),b.key==="Home"&&(b.preventDefault(),A=0),b.key==="End"&&(b.preventDefault(),A=e.length-1),A!==j){const F=e[A];n(F.id),($=l.current[A])==null||$.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:$t("@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:b=>n(b.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(b=>o.jsx("option",{value:b.id,children:b.name},b.id))]}),o.jsx(pn,{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:$t("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((b,j)=>{const N=b.id===t;return o.jsx("button",{ref:A=>{l.current[j]=A},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:A=>g(A,j),className:$t("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:b.name},b.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((b,j)=>{const N=b.id===t,A=b.icon;return o.jsx("button",{ref:$=>{l.current[j]=$},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:$=>g($,j),className:$t("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:[A?o.jsx(A,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:b.name})]})},b.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((b,j)=>{const N=b.id===t;return o.jsxs("button",{ref:A=>{l.current[j]=A},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:A=>g(A,j),className:$t(N?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",j===0?"rounded-l-lg":"",j===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:b.name}),o.jsx("span",{"aria-hidden":"true",className:$t(N?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},b.id)})})})]}):null}function Od({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:yr(n,s.id),role:"tabpanel","aria-labelledby":br(n,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:r(s,i)},s.id)})})}function nc(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function po(e){let t=e;for(;t&&t!==document.body;){if(nc(t))return t;t=t.parentElement}return document.documentElement}function Md(e,t){if(!e||!t||!t.contains(e))return null;let n=e;for(;n;){if(nc(n))return n;if(n===t)break;n=n.parentElement}return null}function rc(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 sc({tabs:e,current:t,onChange:n}){const{rootElement:r,topOffset:s=0}=it();if(!e.length)return null;const i=typeof document<"u"&&po(r)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full",children:o.jsx(Ht,{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(nt,{content:a,stickySideContent:!1,bottomSpacing:!1})})}function Rd(e,t){const[n,r]=x.useState("docked"),s=x.useRef(t);return s.current=t,x.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]),x.useEffect(()=>{t&&r(i=>i==="hidden"?"pinned":i)},[t]),n}const Ld=56,Pd=8;function oc({logo:e,children:t,forceVisible:n=!1}){const{rootElement:r,topOffset:s=0}=it(),i=Rd(r,n),a=s,c=a+Ld+Pd,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 ${fo}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function ic(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(x.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 Dd(e){return e.map(t=>`\`${t}\``).join(", ")}function Is(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 Bd(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 $i=360;function Fd(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 ${Nr[t++%Nr.length]}`,children:`{${n.value}}`},r))}function Et({address:e,parameters:t,className:n="text-xs",truncate:r=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=De(),[c,u]=x.useState(null),[l,d]=x.useState({top:0,left:0,placement:"top"}),[f,p]=x.useState(!1),[m,g]=x.useState(null),y=x.useRef(null),b=x.useId(),j=Bd(e);let N=0;x.useEffect(()=>{if(!r)return;const w=y.current;if(!w)return;const _=()=>p(w.scrollWidth>w.clientWidth);_();const L=new ResizeObserver(_);return L.observe(w),()=>L.disconnect()},[r,e]);const A=(w,_)=>{d(Is(_)),u(w)},$=()=>u(null),F=w=>g(Is(w,{align:"end",width:$i})),G=()=>g(null),T=j.map((w,_)=>{if(w.type==="text")return o.jsx("span",{children:w.value},_);const L=t==null?void 0:t[w.value],U=Nr[N++%Nr.length],P=c===_,X=!!L&&(L.description||L.type||L.default||L.enum&&L.enum.length>0||L.examples&&L.examples.length>0),ie=`channel-address-tooltip-${_}`,E=X&&P?ie:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:S=>X&&A(_,S.currentTarget),onMouseLeave:$,children:[o.jsx("span",{className:`font-semibold ${U} ${X?"cursor-help underline decoration-dotted":""}`,role:X?"button":void 0,tabIndex:X?0:void 0,"aria-expanded":X?P:void 0,"aria-describedby":E,onFocus:S=>X&&A(_,S.currentTarget),onBlur:$,onKeyDown:S=>{X&&((S.key==="Enter"||S.key===" ")&&(S.preventDefault(),A(_,S.currentTarget)),S.key==="Escape"&&(S.preventDefault(),$(),S.currentTarget.blur()))},children:`{${w.value}}`}),X&&P&&a&&an.createPortal(o.jsxs("div",{id:ie,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:[L.description&&o.jsx("div",{children:L.description}),L.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:L.type})}),L.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:L.default})]}),L.enum&&L.enum.length>0&&o.jsx("div",{className:"mt-1",children:ic(L.enum)}),L.examples&&L.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",L.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:y,className:"overflow-hidden whitespace-nowrap min-w-0",children:T}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!m,"aria-describedby":m?b: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:w=>F(w.currentTarget),onMouseLeave:G,onFocus:w=>F(w.currentTarget),onBlur:G,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),w.stopPropagation(),F(w.currentTarget)),w.key==="Escape"&&(w.preventDefault(),G(),w.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&m&&a&&an.createPortal(o.jsx("div",{id:b,role:"tooltip",style:{top:m.top,left:m.left,width:$i},className:`fixed z-[60] rounded-lg border border-border bg-surface px-3 py-2 shadow-lg pointer-events-none ${m.placement==="top"?"-translate-y-full":""}`,children:o.jsx("code",{className:"block break-all font-mono text-xs leading-relaxed text-foreground-secondary",children:Fd(j)})}),a)]}):o.jsx("code",{className:`${v}rounded text-foreground-secondary break-all ${n}`,children:T})}const zd={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function wt({method:e,size:t="sm",className:n=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${zd[t]} ${kd[e]} ${n}`,children:e}):null}function Os(e,t){const[n,r]=x.useState(null);return x.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 Ii=6,Hd=12,Ud=8,Wd=.7,Gd=240;function Kd(e,t){if(e===0)return 1/0;const n=Math.min(e*Wd,Gd)-Ud*2,r=t*Ii+Math.max(0,t-1)*Hd;return Math.max(1,Math.floor((n-r)/Ii))}function Vd(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 Jd=12,Yd=48,Xd=40;function Zd({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[i,a]=x.useState(!1),[c,u]=x.useState(!1),l=i||c,{rootElement:d,portalHost:f,topOffset:p=0}=De(),m=x.useRef(null),g=x.useRef(null),[y,b]=x.useState(null),[j,N]=x.useState(null),A=x.useMemo(()=>e.filter(J=>J.items.length>0),[e]),$=x.useMemo(()=>A.filter(J=>J.isTab===!1||J.id===t),[A,t]),F=x.useMemo(()=>A.filter(J=>J.showInPopover!==!1),[A]),[G,T]=x.useState(null),v=x.useRef(null),w=x.useRef(null),_=x.useCallback((J,H)=>{T({section:J,key:H}),v.current={section:J,key:H},w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{v.current=null},600)},[]);x.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),x.useEffect(()=>{const H=e.filter(V=>V.items.length>0).flatMap(V=>V.items.map(me=>({section:V.id,key:V.itemKey(me),id:V.targetId(me)}))).map(V=>({...V,el:document.getElementById(V.id)})).filter(V=>!!V.el);if(H.length===0)return;const B=new Map(H.map(V=>[V.el,V])),se=new Map,ue=new IntersectionObserver(V=>{for(const O of V)O.isIntersecting?se.set(O.target,O.boundingClientRect.top):se.delete(O.target);if(se.size===0)return;let me=null,Ce=-1/0;for(const[O,R]of se)R>Ce&&(me=O,Ce=R);const _e=me&&B.get(me);if(!_e)return;const Re=v.current;if(Re){if(_e.section!==Re.section||_e.key!==Re.key)return;v.current=null}T({section:_e.section,key:_e.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return H.forEach(V=>ue.observe(V.el)),()=>ue.disconnect()},[e]);const L=(G==null?void 0:G.section)??t,U=G??s,P=Os(d,!0),X=typeof window>"u"?0:window.innerWidth,ie=typeof window>"u"?0:window.innerHeight,E=!!P&&P.bottom>p&&P.top<ie,S=Math.max((P==null?void 0:P.top)??p,p),M=Math.min((P==null?void 0:P.bottom)??ie,ie),W=Math.max(0,M-S),Q=(S+M)/2,[ne,Ae]=x.useState(null);x.useLayoutEffect(()=>{if(!j||!d)return;const J=()=>{const B=j.getBoundingClientRect().left-d.getBoundingClientRect().left;Ae(se=>se===B?se:B)};J();const H=new ResizeObserver(J);return H.observe(j),H.observe(d),window.addEventListener("resize",J),()=>{H.disconnect(),window.removeEventListener("resize",J)}},[j,d]);const Ne=ne===null?null:((P==null?void 0:P.left)??0)+ne,ye=((P==null?void 0:P.left)??0)+Jd,q=Ne!==null?Ne-ye>=Xd+Yd:!!P&&P.width>=1024,le=!!P&&!q,K={opacity:E?1:0,pointerEvents:E?"auto":"none",transition:"opacity 0.2s ease"},ae={position:"fixed",top:Q,left:ye,transform:"translateY(-50%)",zIndex:45,...K},he={position:"sticky",bottom:0,height:0,zIndex:45,pointerEvents:"none"},de=Os(y,le),Te=le?{position:"fixed",bottom:de?ie-de.top+8:68,right:de?X-de.right:16,zIndex:46}:{position:"fixed",top:Q,left:ye,transform:"translateY(-50%)",maxHeight:`${Math.max(0,W-32)}px`,zIndex:46};x.useEffect(()=>{if(!i)return;const J=B=>{var se;B.key==="Escape"&&(a(!1),u(!1),(se=m.current)==null||se.focus())},H=B=>{var ue,V;const se=B.target;(ue=m.current)!=null&&ue.contains(se)||(V=g.current)!=null&&V.contains(se)||a(!1)};return document.addEventListener("keydown",J),document.addEventListener("mousedown",H),()=>{document.removeEventListener("keydown",J),document.removeEventListener("mousedown",H)}},[i]);const we=x.useCallback((J,H)=>{J.isTab!==!1&&n(J.id),H&&setTimeout(()=>{var B;(B=document.getElementById(H))==null||B.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),ke=x.useMemo(()=>F.map(J=>{const H=L===J.id,B=(U==null?void 0:U.section)===J.id,se=J.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{we(J),_(J.id,""),le&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${H?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(se,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${H?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${H?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:J.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 ${H?"border border-primary-200 bg-primary-100 text-primary-700":"bg-neutral-100 text-foreground-muted"}`,children:J.items.length})]}),J.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:J.items.map(ue=>{const V=J.itemKey(ue),me=B&&(U==null?void 0:U.key)===V;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{we(J,J.targetId(ue)),r(J.id,V),_(J.id,V),le&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${me?"bg-primary-50 font-medium text-primary-700":H?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:J.renderItem(ue,{isSelected:me,isSectionActive:H})})},V)})})]},J.id)}),[F,L,U,le,we,r,_]),Me=Kd(W,$.length),re=x.useMemo(()=>{const J=Vd($.map(H=>H.items.length),Me);return $.map((H,B)=>{const se=L===H.id,ue=H.items.length,V=J[B];let me=-1;if((U==null?void 0:U.section)===H.id){const Ce=H.items.findIndex(_e=>H.itemKey(_e)===U.key);Ce>=0&&(me=Math.min(V-1,Math.floor(Ce*V/ue)))}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 ${se?"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:V},(Ce,_e)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${_e===me?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},_e))})]},H.id)})},[$,L,U,Me]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:N,"aria-hidden":"true",className:`w-full ${fo}`,style:{height:0}}),!le&&o.jsx("button",{ref:m,onClick:()=>a(J=>!J),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:{...ae,visibility:E?"visible":"hidden"},children:re}),le&&o.jsx("div",{style:he,children:o.jsx("button",{ref:J=>{m.current=J,b(J)},onClick:()=>a(J=>!J),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:{...K,visibility:E?"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&&an.createPortal(o.jsx("div",{ref:g,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 ${le?"origin-bottom-right":""} ${l?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:{...Te,visibility:l?"visible":"hidden"},children:ke}),f)]})}function ac({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:i}){return o.jsx(Zd,{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 ho({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 Qd(e){return o.jsxs(ho,{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 mo({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 cc(e){return{id:"info",label:"Info",icon:Qd,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function lc(e){return{id:"schemas",label:"Schemas",icon:mo,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function uc({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 zr({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 dc({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 ar={};function qd({operations:e=ar,messages:t=ar,schemas:n=ar,servers:r=ar,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l,sidebarConfig:d}){const f=x.useMemo(()=>{const p=m=>{var y;return d!=null&&d.useChannelAddressAsIdentifier?((y=e[m])==null?void 0:y.channel)??null:null};return[cc(s),{id:"servers",label:"Servers",icon:uc,isTab:!1,items:Object.keys(r),itemKey:m=>m,targetId:m=>`server-${m}`,renderItem:m=>o.jsx("span",{className:"truncate",children:m})},{id:"operations",label:"Operations",icon:zr,items:Object.keys(e),itemKey:m=>m,targetId:m=>`operation-${m}`,renderItem:m=>{var y;const g=p(m);return g!=null&&g.address?o.jsx(Et,{address:g.address,parameters:g.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:(y=e[m])==null?void 0:y.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m})]})}},{id:"messages",label:"Messages",icon:dc,items:Object.keys(t),itemKey:m=>m,targetId:m=>`message-${m}`,renderItem:m=>o.jsx("span",{className:"truncate",children:m})},lc(n)]},[e,t,n,r,s,d]);return o.jsx(ac,{sections:f,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const hn=["get","put","post","delete","options","head","patch","trace"],fc=(e,t)=>`${e} ${t}`;function Ms(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 cn(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?hn.filter(r=>n[r]).map(r=>({key:fc(r,t),method:r,path:t})):[]})}function go({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 Oi={},ef={},tf=[];function nf({paths:e=Oi,webhooks:t=Oi,schemas:n=ef,servers:r=tf,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l}){const d=x.useMemo(()=>cn(e),[e]),f=x.useMemo(()=>cn(t),[t]),p=x.useMemo(()=>{const m=r.map((g,y)=>({key:`server-${y}`,url:g}));return[cc(s),{id:"servers",label:"Servers",icon:uc,isTab:!1,items:m,itemKey:g=>g.key,targetId:g=>g.key,renderItem:g=>o.jsx("span",{className:"truncate",children:g.url})},{id:"endpoints",label:"Endpoints",icon:zr,items:d,itemKey:g=>g.key,targetId:g=>`endpoint-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx(Et,{address:g.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:go,items:f,itemKey:g=>g.key,targetId:g=>`webhook-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:g.path})]})},lc(n)]},[d,f,n,r,s]);return o.jsx(ac,{sections:p,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const rf=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 pc({query:e,onQueryChange:t,results:n,onSelectResult:r,onOpenChange:s}){const i=x.useRef(null),a=x.useRef(null),[c,u]=x.useState(!1),[l,d]=x.useState(-1),f="asyncapi-search-results",p=v=>`asyncapi-search-result-${v}`,{portalHost:m,rootElement:g,topOffset:y=0}=De(),b=()=>{u(!1),d(-1)};x.useEffect(()=>(s==null||s(c),()=>s==null?void 0:s(!1)),[c,s]);const j=x.useRef(!1),N=x.useRef(!1);x.useEffect(()=>{if(!g)return;const v=()=>{j.current=!0},w=()=>{j.current=!1};return g.addEventListener("mouseenter",v),g.addEventListener("mouseleave",w),()=>{g.removeEventListener("mouseenter",v),g.removeEventListener("mouseleave",w)}},[g]),x.useEffect(()=>{if(!g)return;const v=w=>{N.current=g.contains(w.target)};return document.addEventListener("mousedown",v,!0),()=>document.removeEventListener("mousedown",v,!0)},[g]),x.useEffect(()=>{if(!g)return;const v=w=>{!(w.metaKey||w.ctrlKey)||w.key.toLowerCase()!=="k"||!(g.contains(document.activeElement)||j.current||N.current)||(w.preventDefault(),u(!0))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[g]),x.useEffect(()=>{if(!c)return;const v=requestAnimationFrame(()=>{var w;return(w=a.current)==null?void 0:w.focus()});return()=>cancelAnimationFrame(v)},[c]),x.useEffect(()=>{if(!(!c||!m))return rc(po(m))},[c,m]),x.useEffect(()=>{if(!c)return;const v=w=>{w.key==="Escape"&&b()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c]),x.useEffect(()=>{if(!c)return;const v=w=>{i.current&&!i.current.contains(w.target)&&b()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]),x.useEffect(()=>{l>=n.length&&d(n.length-1)},[l,n.length]),x.useEffect(()=>{var v;l<0||(v=document.getElementById(p(l)))==null||v.scrollIntoView({block:"nearest"})},[l]);const A=c&&e.trim().length>0,$=v=>{b(),r(v)},F=v=>{if(v.key==="Escape"){v.preventDefault(),b();return}if(A){if(v.key==="ArrowDown"){v.preventDefault(),d(w=>n.length===0?-1:Math.min(w+1,n.length-1));return}if(v.key==="ArrowUp"){v.preventDefault(),d(w=>n.length===0?-1:Math.max(w-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(),$(n[l]);return}}},G=A?`${n.length} result${n.length===1?"":"s"} found`:"",T=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(rf,{})}),c&&m&&an.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:y},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:F,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":A,"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:G}),A&&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,w)=>o.jsx("li",{children:o.jsxs("button",{id:p(w),type:"button",role:"option","aria-selected":l===w,onClick:()=>$(v),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===w?"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:T?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]})]}),m)]})}function hc({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 mc({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 Hr({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 sf=["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 gc(e){return`${["> ## Agent Instructions",...sf.map(n=>`> ${n}`)].join(`
|
|
4
4
|
`)}
|
|
5
5
|
|
|
6
|
-
${e.trimStart()}`}function xc({serialize:e,onOpenChange:t}){const[n,r]=x.useState(!1),[s,i]=x.useState(!1),a=x.useRef(null),c=x.useRef(void 0),{deref:u}=De(),l=()=>gc(e(u));x.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),x.useEffect(()=>(t==null||t(n),()=>t==null?void 0:t(!1)),[n,t]),x.useEffect(()=>{if(!n)return;const p=m=>{m.key==="Escape"&&r(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]),x.useEffect(()=>{if(!n)return;const p=m=>{a.current&&!a.current.contains(m.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(m){console.error("[MarkdownExportMenu] Copy for LLM failed:",m)}r(!1)},f=()=>{const p=l(),m=new Blob([p],{type:"text/markdown"}),g=URL.createObjectURL(m);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:g}),window.open(g,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(g),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(mc,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(hc,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(pn,{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(Hr,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const fs=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),bc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Mi=Array.from(bc),Ri="#/components/schemas/",of=e=>e.replace(/~1/g,"/").replace(/~0/g,"~"),af=e=>{if(!e.startsWith(Ri))return;const t=e.slice(Ri.length).split("/")[0];return t?of(t):void 0},xo=(e,t)=>{const n=new Map,r=new Map;for(const[s,i]of Object.entries(e??{}))if(fs(i)){n.has(i)||n.set(i,s);for(const a of Mi){const c=i[a];typeof c=="object"&&c!==null&&!r.has(c)&&r.set(c,{name:s,schema:i,key:a})}}return s=>{if(!fs(s))return;const i=n.get(s);if(i!==void 0)return i;for(const a of Mi){let c=s[a];if(fs(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}}},gt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),wr=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>wr(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,wr(r,t)]).join(" "):gt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,wr(r,t)]).join(" ")):"",Ve=e=>wr(e).trim().replace(/\s+/g," "),cf=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Li=e=>e===null||typeof e!="object",lf=e=>{if(!gt(e))return e;const t={};for(const[n,r]of Object.entries(e))bc.has(n)||(Li(r)||Array.isArray(r)&&r.every(Li))&&(t[n]=r);return t},yc=(e,t,n,r,s)=>{const i=`schema-${n}`,a=(u,l,d,f)=>{const p=`components.schemas.${n}${l.length?`.${l.join(".")}`:""}`,m=`Schemas > ${r}${d.length?` > ${d.join(" > ")}`:""}`,g=gt(u)?u.description:void 0,y=l.length?`${r}.${l.join(".")}`:r;e.push({id:`schema-${n}-${l.join("-")||"root"}`,targetId:f?cf(n,f):i,type:"schema",tab:"schemas",key:n,name:y,path:p,location:m,subtitle:g,text:Ve([lf(u)]),schemaFocusTokens:f&&f.length>0?f:void 0})},c=(u,l=[],d=[],f=[],p=new Set)=>{if(a(u,l,d,f),!gt(u)||p.has(u)||(p.add(u),l.length>0&&(s==null?void 0:s(u))!==void 0))return;if(gt(u.properties))for(const[g,y]of Object.entries(u.properties))c(y,[...l,"properties",g],[...d,g],f?[...f,"properties",g]:null,p);const m=u.items;gt(m)?c(m,[...l,"items"],[...d,"items"],f?[...f,"items"]:null,p):Array.isArray(m)&&m.forEach((g,y)=>{c(g,[...l,`items[${y}]`],[...d,`items[${y}]`],null,p)});for(const g of["allOf","oneOf","anyOf"]){const y=u[g];Array.isArray(y)&&y.forEach((b,j)=>{c(b,[...l,`${g}[${j}]`],[...d,`${g}[${j}]`],f&&g!=="allOf"?[...f,`${g}[${j}]`]:null,p)})}gt(u.additionalProperties)&&c(u.additionalProperties,[...l,"additionalProperties"],[...d,"additionalProperties"],null,p)};c(t)};function uf(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:Ve([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:Ve([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:Ve(l)});const d=a.bindings,f=gt(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:Ve(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:Ve([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:Ve(u)});const l=i.bindings;if(gt(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:Ve(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:Ve([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:Ve(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:Ve(i.headers)})}if((r=e.components)!=null&&r.schemas){const s=xo(e.components.schemas,Bt(e));for(const[i,a]of Object.entries(e.components.schemas))yc(t,a,i,i,s)}return t}function Nt(e){return Array.isArray?Array.isArray(e):kc(e)==="[object Array]"}function df(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 Rs(e){return e==null?"":df(e)}function Pe(e){return typeof e=="string"}function kr(e){return typeof e=="number"}function ff(e){return e===!0||e===!1||pf(e)&&kc(e)=="[object Boolean]"}function wc(e){return typeof e=="object"}function pf(e){return wc(e)&&e!==null}function qe(e){return e!=null}function cr(e){return!e.trim().length}function kc(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const hf="Incorrect 'index' type",Ls="Invalid doc index: must be a non-negative integer within the bounds of the docs array",mf=e=>`Invalid value for key ${e}`,gf=e=>`Pattern length exceeds max of ${e}.`,xf=e=>`Missing ${e} property in key`,bf=e=>`Property 'weight' in key '${e}' must be a positive integer`,yf="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.",Pi=Object.prototype.hasOwnProperty;var wf=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=vc(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 vc(e){let t=null,n=null,r=null,s=1,i=null;if(Pe(e)||Nt(e))r=e,t=Di(e),n=vr(e);else{if(!Pi.call(e,"name"))throw new Error(xf("name"));const a=e.name;if(r=a,Pi.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(bf(vr(a)));t=Di(a),n=vr(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function Di(e){return Nt(e)?e:e.split(".")}function vr(e){return Nt(e)?e.join("."):e}function kf(e,t){const n=[];let r=!1;const s=(i,a,c,u)=>{if(qe(i))if(!a[c])n.push(u!==void 0?{v:i,i:u}:i);else{const l=i[a[c]];if(!qe(l))return;if(c===a.length-1&&(Pe(l)||kr(l)||ff(l)||typeof l=="bigint"))n.push(u!==void 0?{v:Rs(l),i:u}:Rs(l));else if(Nt(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,Pe(t)?t.split("."):t,0),r?n:n[0]}const vf={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},jf={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},Sf={location:0,threshold:.6,distance:100},Af={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:kf,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ee=Object.freeze({...jf,...vf,...Sf,...Af});function Ef(e){return e>=9&&e<=13||e===32||e===160}function Nf(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++)Ef(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 bo=class{constructor({getFn:e=ee.getFn,fieldNormWeight:t=ee.fieldNormWeight}={}){this.norm=Nf(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(Pe(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(Ls);if(Pe(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(Ls);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!qe(e)||cr(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(qe(a)){if(Nt(a)){const c=[];for(let u=0,l=a.length;u<l;u+=1){const d=a[u];if(qe(d)){if(Pe(d)){if(!cr(d)){const f={v:d,i:u,n:this.norm.get(d)};c.push(f)}}else if(qe(d.v)){const f=Pe(d.v)?d.v:Rs(d.v);if(!cr(f)){const p={v:f,i:d.i,n:this.norm.get(f)};c.push(p)}}}}n.$[r]=c}else if(Pe(a)&&!cr(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 jc(e,t,{getFn:n=ee.getFn,fieldNormWeight:r=ee.fieldNormWeight}={}){const s=new bo({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(vc)),s.setSources(t),s.create(),s}function Tf(e,{getFn:t=ee.getFn,fieldNormWeight:n=ee.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new bo({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function Cf(e=[],t=ee.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 _f(e,t,n,{location:r=ee.location,distance:s=ee.distance,threshold:i=ee.threshold,findAllMatches:a=ee.findAllMatches,minMatchCharLength:c=ee.minMatchCharLength,includeMatches:u=ee.includeMatches,ignoreLocation:l=ee.ignoreLocation}={}){if(t.length>32)throw new Error(gf(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let m=i,g=p;const y=(w,_)=>{const L=w/d;if(l)return L;const U=Math.abs(p-_);return s?L+U/s:U?1:L},b=c>1||u,j=b?Array(f):[];let N;for(;(N=e.indexOf(t,g))>-1;){const w=y(0,N);if(m=Math.min(w,m),g=N+d,b){let _=0;for(;_<d;)j[N+_]=1,_+=1}}g=-1;let A=[],$=1,F=0,G=d+f;const T=1<<d-1;for(let w=0;w<d;w+=1){let _=0,L=G;for(;_<L;)y(w,p+L)<=m?_=L:G=L,L=Math.floor((G-_)/2+_);G=L;let U=Math.max(1,p-L+1);const P=a?f:Math.min(p+L,f)+d,X=Array(P+2);X[P+1]=(1<<w)-1;for(let ie=P;ie>=U;ie-=1){const E=ie-1,S=n[e[E]];if(X[ie]=(X[ie+1]<<1|1)&S,w&&(X[ie]|=(A[ie+1]|A[ie])<<1|1|A[ie+1]),X[ie]&T&&($=y(w,E),$<=m)){if(m=$,g=E,F=w,g<=p)break;U=Math.max(1,2*p-g)}}if(y(w+1,p)>m)break;A=X}if(b&&g>=0){const w=Math.min(f-1,g+d-1+F);for(let _=g;_<=w;_+=1)n[e[_]]&&(j[_]=1)}const v={isMatch:g>=0,score:Math.max(.001,$)};if(b){const w=Cf(j,c);w.length?u&&(v.indices=w):v.isMatch=!1}return v}function $f(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 yo(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 Sc={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},If=new RegExp("["+Object.keys(Sc).join("")+"]","g"),On=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(If,t=>Sc[t]):e=>e;var wo=class{constructor(e,{location:t=ee.location,threshold:n=ee.threshold,distance:r=ee.distance,includeMatches:s=ee.includeMatches,findAllMatches:i=ee.findAllMatches,minMatchCharLength:a=ee.minMatchCharLength,isCaseSensitive:c=ee.isCaseSensitive,ignoreDiacritics:u=ee.ignoreDiacritics,ignoreLocation:l=ee.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?On(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,m)=>{this.chunks.push({pattern:p,alphabet:$f(p),startIndex:m})},f=this.pattern.length;if(f>32){let p=0;const m=f%32,g=f-m;for(;p<g;)d(this.pattern.substr(p,32),p),p+=32;if(m){const y=f-32;d(this.pattern.substr(y),y)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?On(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const g={isMatch:!0,score:0};return r&&(g.indices=[[0,e.length-1]]),g}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:g,alphabet:y,startIndex:b})=>{const{isMatch:j,score:N,indices:A}=_f(e,g,y,{location:s+b,distance:i,threshold:a,findAllMatches:c,minMatchCharLength:u,includeMatches:r,ignoreLocation:l});j&&(p=!0),f+=N,j&&A&&d.push(...A)});const m={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(m.indices=yo(d)),m}};const Of=new Set(["fuzzy","include"]);function Mf(e){return e.startsWith("inverse")}const Ps=[{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 wo(e,{location:t.location??ee.location,threshold:t.threshold??ee.threshold,distance:t.distance??ee.distance,includeMatches:t.includeMatches??ee.includeMatches,findAllMatches:t.findAllMatches??ee.findAllMatches,minMatchCharLength:t.minMatchCharLength??ee.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??ee.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??ee.ignoreDiacritics,ignoreLocation:t.ignoreLocation??ee.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Bi=Ps.length,Rf="\0",Lf="|";function Pf(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 Fi(e,t){const n=e.match(t);return n?n[1]:null}function Df(e,t={}){return e.replace(/\\\|/g,Rf).split(Lf).map(n=>{const r=Pf(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<Bi;){const d=Ps[l],f=Fi(c,d.multiRegex);f&&(s.push(d.create(f,t)),u=!0)}if(!u)for(l=-1;++l<Bi;){const d=Ps[l],f=Fi(c,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Bf=class{constructor(e,{isCaseSensitive:t=ee.isCaseSensitive,ignoreDiacritics:n=ee.ignoreDiacritics,includeMatches:r=ee.includeMatches,minMatchCharLength:s=ee.minMatchCharLength,ignoreLocation:i=ee.ignoreLocation,findAllMatches:a=ee.findAllMatches,location:c=ee.location,threshold:u=ee.threshold,distance:l=ee.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?On(e):e,this.pattern=e,this.query=Df(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?On(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,m=f.length;p<m;p+=1){const g=f[p],{isMatch:y,indices:b,score:j}=g.search(e);if(y)i+=1,c+=j,Mf(g.type)&&(u=!0),n&&(Of.has(g.type)?a.push(...b):a.push(b));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=yo(a)),p}}return{isMatch:!1,score:1}}};const Ds=[];function ko(...e){Ds.push(...e)}function Tr(e,t){for(let n=0,r=Ds.length;n<r;n+=1){const s=Ds[n];if(s.condition(e,t))return new s(e,t)}return new wo(e,t)}const Cr={AND:"$and",OR:"$or"},Bs={PATH:"$path",PATTERN:"$val"},Fs=e=>!!(e[Cr.AND]||e[Cr.OR]),Ff=e=>!!e[Bs.PATH],zf=e=>!Nt(e)&&wc(e)&&!Fs(e),zi=e=>({[Cr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ac(e,t,{auto:n=!0}={}){const r=s=>{if(Pe(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=Tr(s,t)),u}const i=Object.keys(s),a=Ff(s);if(!a&&i.length>1&&!Fs(s))return r(zi(s));if(zf(s)){const u=a?s[Bs.PATH]:i[0],l=a?s[Bs.PATTERN]:s[u];if(!Pe(l))throw new Error(mf(u));const d={keyId:vr(u),pattern:l};return n&&(d.searcher=Tr(l,t)),d}const c={children:[],operator:i[0]};return i.forEach(u=>{const l=s[u];Nt(l)&&l.forEach(d=>{c.children.push(r(d))})}),c};return Fs(e)||(e=zi(e)),r(e)}function zs(e,{ignoreFieldNorm:t=ee.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 Hf(e,{ignoreFieldNorm:t=ee.ignoreFieldNorm}){e.forEach(n=>{n.score=zs(n.matches,{ignoreFieldNorm:t})})}var Uf=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 Wf(e){const t=[];return e.matches.forEach(n=>{if(!qe(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 Gf(e,t,{includeMatches:n=ee.includeMatches,includeScore:r=ee.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=Wf(s)),r&&(a.score=s.score),a})}const Kf=/[\p{L}\p{M}\p{N}_]+/gu,Hi=new WeakSet;function Vf(e){Hi.has(e)||(Hi.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 Jf(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||Vf(e),t=>t.match(e)||[]):t=>t.match(Kf)||[]}function Hs({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Jf(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=On(s)),r(s)}}}var Yf=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Hs({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 wo(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=yo(t)),this.combineAll&&(this.useMask?u.matchedMask=i:u.matchedTerms=a,u.termCount=this.numTerms),u}};function ps(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 Ec(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){ps(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)ps(e,l.v,s,r);else ps(e,u.v,s,r)}}function Xf(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)Ec(r,s,t,n);return r}function Zf(e,t,n,r){Ec(e,t,n,r)}function Qf(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 Ui(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((c,u)=>c-u);for(const c of n)Qf(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={...ee,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new wf(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=Tr(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 bo))throw new Error(hf);if(this._myIndex=t||jc(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Hs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Xf(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!qe(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Hs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Zf(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&&Ui(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(Ls);this._invertedIndex&&Ui(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(Pe(e)&&!e.trim()){let p=this._docs.map((m,g)=>({item:m,refIndex:g}));return kr(n)&&n>-1&&(p=p.slice(0,n)),p}const u=i&&kr(n)&&n>0&&Pe(e),l=a,d=(p,m)=>l(p,m)||p.idx-m.idx;let f;if(u){const p=new Uf(n,d);Pe(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:c}),f=p.extractSorted()}else f=Pe(e)?Pe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Hf(f,{ignoreFieldNorm:c}),i&&f.sort(Pe(e)?d:l),kr(n)&&n>-1&&(f=f.slice(0,n));return Gf(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(!qe(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 m={item:c,idx:u,matches:p};t?(m.score=zs(m.matches,{ignoreFieldNorm:n}),t.insert(m)):a.push(m)}}}),a}_searchLogical(e){const t=Ac(e,this.options),n=this._normalizedKeys(),r=(c,u,l)=>{if(!("children"in c)){const{keyId:m,searcher:g}=c;let y;return m===null?(y=[],n.forEach((b,j)=>{y.push(...this._findMatches({key:b,value:u[j],searcher:g}))})):y=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:g}),y&&y.length?[{idx:l,item:u,matches:y}]:[]}const{children:d,operator:f}=c,p=[];for(let m=0,g=d.length;m<g;m+=1){const y=d[m],b=r(y,u,l);if(b.length)p.push(...b);else if(f===Cr.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:c,i:u})=>{if(qe(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(!qe(u))return;const d=[];let f=!1,p=!1;if(a.forEach((m,g)=>{const y=this._findMatches({key:m,value:u[g],searcher:r});y.length?(d.push(...y),y[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const m={idx:l,item:u,matches:d};t?(m.score=zs(m.matches,{ignoreFieldNorm:n}),t.insert(m)):c.push(m)}}),c}_findMatches({key:e,value:t,searcher:n}){if(!qe(t))return[];const r=[];if(Nt(t))t.forEach(({v:s,i,n:a})=>{if(!qe(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=jc;Tt.parseIndex=Tf;Tt.config=ee;Tt.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(yf);return Tr(e,{...ee,...n}).searchIn(t)};Tt.parseQuery=Ac;ko(Bf);ko(Yf);Tt.use=function(...e){e.forEach(t=>ko(t))};var qf=Tt;function Nc(e,t,n={}){const[r,s]=x.useState(""),[i,a]=x.useState(""),c=n.debounceMs??150;x.useEffect(()=>{const f=setTimeout(()=>a(r),c);return()=>clearTimeout(f)},[r,c]);const u=x.useMemo(()=>t(e),[e,t]),l=x.useMemo(()=>new qf(u,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[u,n.threshold]),d=x.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 ep(e,t={}){return Nc(e,uf,t)}const Us="search-match",Tc=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function tp(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 np(e,t){if(!Tc())return;const n=tp(e,t);if(!n.length){CSS.highlights.delete(Us);return}CSS.highlights.set(Us,new Highlight(...n))}function hs(){Tc()&&CSS.highlights.delete(Us)}function Wi(e,t){const n=x.useRef(null);x.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&&np(d,s),l<6&&setTimeout(()=>u(l+1),100)};return setTimeout(()=>c(0),50),()=>{a=!0}},[e,...t])}function Cc({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s,initialLocation:i,onLocationChange:a,getTargetId:c}){var E;const u=((E=e[0])==null?void 0:E.id)??t,l=i&&(i.tab==="servers"||n(i.tab))?i.tab:null,[d,f]=x.useState(()=>l&&l!=="servers"?l:u),[p,m]=x.useState(()=>l),g=S=>{f(S),m(S)},[y,b]=x.useState(()=>{const S={};return l&&(i!=null&&i.key)&&(S[l]=i.key),S}),j=e.some(S=>S.id===d)?d:u,N={};for(const S of r)N[S.id]=S.visible?y[S.id]??null:null;const A=(S,M)=>b(W=>({...W,[S]:M})),[$,F]=x.useState(null),[G,T]=x.useState(null),[v,w]=x.useState(null),_=S=>{n(S.tab)?g(S.tab):S.tab==="servers"&&m("servers");const M={};for(const W of r)M[W.id]=W.id===S.tab?S.key:null;b(M),F(S.focusSection??null),T(S.tab==="schemas"&&S.schemaFocusTokens?{tokens:S.schemaFocusTokens,id:S.targetId}:null),S.tab==="schemas"&&hs(),w({targetId:S.targetId,query:s,highlight:S.tab!=="schemas"})},L=(S,M)=>{g(S),b(W=>{const Q={...W};for(const ne of r)ne.id!=="servers"&&(Q[ne.id]=ne.id===S?M:null);return Q})},U=S=>{m("servers");const M={};for(const W of r)M[W.id]=W.id==="servers"?S:null;b(M)},P=S=>{n(S)&&g(S)},X=x.useMemo(()=>{for(const S of r){const M=N[S.id];if(M)return{tab:S.id,key:M}}return null},[...r.map(S=>N[S.id])]);Wi(v,[j,$,G,...r.map(S=>N[S.id])]);const[ie]=x.useState(()=>l&&(i!=null&&i.key)&&c?{targetId:c(l,i.key),query:"",highlight:!1}:null);return Wi(ie,[j]),x.useEffect(()=>{a==null||a(X?{tab:X.tab,key:X.key}:{tab:j,key:null})},[j,X]),x.useEffect(()=>{s.trim()||(w(null),hs())},[s]),x.useEffect(()=>hs,[]),{effectiveTab:j,focusTab:g,navActiveSection:p??j,selected:N,setSelectedKey:A,selectedNavItem:X,handleSearchSelect:_,handleNavItemSelect:L,handleNavServerSelect:U,handleContentTabChange:P,focusSection:$,schemaFocusTarget:G}}const oe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ht=e=>oe(e)?e:null,Gi="^[\0-ÿ]*$",rp=Math.pow(-2,31),sp=Math.pow(2,31)-1,op=Math.pow(-2,63),ip=Math.pow(2,63)-1,ap={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"},vo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Mn(e){const t=vo(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ws(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=Mn(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Ki(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function cp(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 lp(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 Gs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Ks(e,t,n){const{type:r,jsonSchema:s}=cp(e,n);lp(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 jo(e,t,n){t!==void 0&&(e[t]=n)}function Rn(e,t){let n={};if(Array.isArray(e))return dp(n,e,t);const r=vo(e),s=typeof e=="string"?e:r.type;switch(n.type=ap[s],s){case"int":{n.minimum=rp,n.maximum=sp;break}case"long":{n.minimum=op,n.maximum=ip;break}case"bytes":{n.pattern=Gi;break}case"fixed":{n.pattern=Gi,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=Rn(r.values,t);break}case"array":{n.items=Rn(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=up(r,t,n);jo(t,Mn(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Mn(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=Gs(r)?{...i}:i);break}}return Ws(r,n,t),Ks(s,r,n),n}function up(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=Gs(s)?{...i}:i;Ki(s,n,s.default!==void 0),Gs(s)&&(Ws(s,a,t),Ks(s.type,s,a)),r.set(s.name,a)}else{const a=Rn(s.type,t);Ki(s,n,s.default!==void 0),Ws(s,a,t),Ks(s.type,s,a),r.set(s.name,a),jo(t,Mn(s.type),a)}}return r}function dp(e,t,n){const r=[];let s=null;for(const i of t){const a=Rn(i,n);(typeof i=="string"?i:vo(i).type)==="null"?s=a:(r.push(a),jo(n,Mn(i),a))}return s&&r.push(s),e.oneOf=r,e}function Vs(e){return Rn(e,{})}const Vi=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),fp=new Set(["record","enum","array","map","fixed"]),Ji=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function So(e){const t=[];return en(e,"schema",t,new Set),t}function en(e,t,n,r){if(typeof e=="string"){!Vi.has(e)&&!Ji.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)=>en(i,`${t}[${a}]`,n,r));return}if(!oe(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)||oe(s)?en(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Vi.has(s)&&!fp.has(s)&&!Ji.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(!oe(i)||typeof i.name!="string"){n.push(`${c}: field must have a string "name"`);return}en(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"`):en(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):en(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let _r=null,ms=null;const Js=new Set;function pp(){return ms||(ms=Promise.resolve().then(()=>require("./protoToJsonSchema-C2GoWuZu.cjs")).then(e=>{_r=e.protoToJsonSchema,Js.forEach(t=>t())})),ms}function hp(){return _r||pp(),_r}function mp(e){return Js.add(e),()=>Js.delete(e)}function Yi(){return _r!==null}function Ur(){return x.useSyncExternalStore(mp,Yi,Yi)}const gp="x-parser-original-payload",$r="x-lib-conversion-error",xp=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,bp=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Dn(e){return typeof e=="string"&&xp.test(e)}function Bn(e){return typeof e=="string"&&bp.test(e)}function _c(e){return oe(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function $c(e){var t,n;if(typeof e!="string")return null;if(Dn(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Bn(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 Ic(e){return Dn(e)?"Avro":Bn(e)?"Protobuf":null}function yp(e,t){return t?!1:!e||Dn(e)||Bn(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const wp=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],kp=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function vp(e){return typeof e=="string"||Array.isArray(e)?!0:oe(e)?typeof e.type=="string"&&kp.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!wp.some(t=>t in e):!1}function ln(e,t){let n=e;if(t&&oe(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=jp(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=_c(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function jp(e){var a;if(!_c(e))return{schema:ht(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[gp],s=(a=ht(n))==null?void 0:a[$r];if(typeof s=="string")return{schema:ht(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:ht(n)??{},schemaFormat:t,originalSchema:r};if(Dn(t)&&vp(n)){const c=So(n);if(c.length>0)return{schema:ht(n)??{},schemaFormat:t,originalSchema:n,conversionError:c[0]};try{return{schema:Vs(n),schemaFormat:t,originalSchema:n}}catch(u){return{schema:ht(n)??{},schemaFormat:t,originalSchema:n,conversionError:u instanceof Error?u.message:"Failed to convert Avro schema"}}}if(Bn(t)&&typeof n=="string"){const c=hp();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=ht(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const Se=(e,t)=>`${"#".repeat(e)} ${t}`,D=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),Qt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Sp={objects:new Set,refs:new Set},Wr=(e,t)=>({schemas:e??{},nameOf:xo(e,t),referenced:new Set}),Ap=e=>`#/components/schemas/${e.replace(/~/g,"~0").replace(/\//g,"~1")}`;function jr(e,t,n,r=Sp,s=!0){if(e===null||typeof e!="object")return e;if(n&&!s){const c=Qt(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:Ap(l)};const d=c!==void 0?af(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)||Qt(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const c=Qt(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:Qt(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(c=>jr(c,t,n,i,!1));if(Qt(e)&&typeof e.$ref=="string"){const c=t==null?void 0:t(e.$ref);return Qt(c)||Array.isArray(c)?jr(c,t,n,i,s):{$ref:e.$ref}}const a={};for(const[c,u]of Object.entries(e))a[c]=jr(u,t,n,i,!1);return a}function Ir(e,t,n,r){if(!t)return"";const s=jr(t,n,r);return`${Se(4,`\`${D(e)}\``)}
|
|
6
|
+
${e.trimStart()}`}function xc({serialize:e,onOpenChange:t}){const[n,r]=x.useState(!1),[s,i]=x.useState(!1),a=x.useRef(null),c=x.useRef(void 0),{deref:u}=De(),l=()=>gc(e(u));x.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),x.useEffect(()=>(t==null||t(n),()=>t==null?void 0:t(!1)),[n,t]),x.useEffect(()=>{if(!n)return;const p=m=>{m.key==="Escape"&&r(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]),x.useEffect(()=>{if(!n)return;const p=m=>{a.current&&!a.current.contains(m.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(m){console.error("[MarkdownExportMenu] Copy for LLM failed:",m)}r(!1)},f=()=>{const p=l(),m=new Blob([p],{type:"text/markdown"}),g=URL.createObjectURL(m);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:g}),window.open(g,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(g),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(mc,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(hc,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(pn,{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(Hr,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const fs=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),bc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Mi=Array.from(bc),Ri="#/components/schemas/",of=e=>e.replace(/~1/g,"/").replace(/~0/g,"~"),af=e=>{if(!e.startsWith(Ri))return;const t=e.slice(Ri.length).split("/")[0];return t?of(t):void 0},xo=(e,t)=>{const n=new Map,r=new Map;for(const[s,i]of Object.entries(e??{}))if(fs(i)){n.has(i)||n.set(i,s);for(const a of Mi){const c=i[a];typeof c=="object"&&c!==null&&!r.has(c)&&r.set(c,{name:s,schema:i,key:a})}}return s=>{if(!fs(s))return;const i=n.get(s);if(i!==void 0)return i;for(const a of Mi){let c=s[a];if(fs(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}}},gt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),wr=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>wr(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,wr(r,t)]).join(" "):gt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,wr(r,t)]).join(" ")):"",Ve=e=>wr(e).trim().replace(/\s+/g," "),cf=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Li=e=>e===null||typeof e!="object",lf=e=>{if(!gt(e))return e;const t={};for(const[n,r]of Object.entries(e))bc.has(n)||(Li(r)||Array.isArray(r)&&r.every(Li))&&(t[n]=r);return t},yc=(e,t,n,r,s)=>{const i=`schema-${n}`,a=(u,l,d,f)=>{const p=`components.schemas.${n}${l.length?`.${l.join(".")}`:""}`,m=`Schemas > ${r}${d.length?` > ${d.join(" > ")}`:""}`,g=gt(u)?u.description:void 0,y=l.length?`${r}.${l.join(".")}`:r;e.push({id:`schema-${n}-${l.join("-")||"root"}`,targetId:f?cf(n,f):i,type:"schema",tab:"schemas",key:n,name:y,path:p,location:m,subtitle:g,text:Ve([lf(u)]),schemaFocusTokens:f&&f.length>0?f:void 0})},c=(u,l=[],d=[],f=[],p=new Set)=>{if(a(u,l,d,f),!gt(u)||p.has(u)||(p.add(u),l.length>0&&(s==null?void 0:s(u))!==void 0))return;if(gt(u.properties))for(const[g,y]of Object.entries(u.properties))c(y,[...l,"properties",g],[...d,g],f?[...f,"properties",g]:null,p);const m=u.items;gt(m)?c(m,[...l,"items"],[...d,"items"],f?[...f,"items"]:null,p):Array.isArray(m)&&m.forEach((g,y)=>{c(g,[...l,`items[${y}]`],[...d,`items[${y}]`],null,p)});for(const g of["allOf","oneOf","anyOf"]){const y=u[g];Array.isArray(y)&&y.forEach((b,j)=>{c(b,[...l,`${g}[${j}]`],[...d,`${g}[${j}]`],f&&g!=="allOf"?[...f,`${g}[${j}]`]:null,p)})}gt(u.additionalProperties)&&c(u.additionalProperties,[...l,"additionalProperties"],[...d,"additionalProperties"],null,p)};c(t)};function uf(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:Ve([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:Ve([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:Ve(l)});const d=a.bindings,f=gt(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:Ve(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:Ve([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:Ve(u)});const l=i.bindings;if(gt(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:Ve(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:Ve([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:Ve(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:Ve(i.headers)})}if((r=e.components)!=null&&r.schemas){const s=xo(e.components.schemas,Bt(e));for(const[i,a]of Object.entries(e.components.schemas))yc(t,a,i,i,s)}return t}function Nt(e){return Array.isArray?Array.isArray(e):kc(e)==="[object Array]"}function df(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 Rs(e){return e==null?"":df(e)}function Pe(e){return typeof e=="string"}function kr(e){return typeof e=="number"}function ff(e){return e===!0||e===!1||pf(e)&&kc(e)=="[object Boolean]"}function wc(e){return typeof e=="object"}function pf(e){return wc(e)&&e!==null}function qe(e){return e!=null}function cr(e){return!e.trim().length}function kc(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const hf="Incorrect 'index' type",Ls="Invalid doc index: must be a non-negative integer within the bounds of the docs array",mf=e=>`Invalid value for key ${e}`,gf=e=>`Pattern length exceeds max of ${e}.`,xf=e=>`Missing ${e} property in key`,bf=e=>`Property 'weight' in key '${e}' must be a positive integer`,yf="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.",Pi=Object.prototype.hasOwnProperty;var wf=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=vc(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 vc(e){let t=null,n=null,r=null,s=1,i=null;if(Pe(e)||Nt(e))r=e,t=Di(e),n=vr(e);else{if(!Pi.call(e,"name"))throw new Error(xf("name"));const a=e.name;if(r=a,Pi.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(bf(vr(a)));t=Di(a),n=vr(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function Di(e){return Nt(e)?e:e.split(".")}function vr(e){return Nt(e)?e.join("."):e}function kf(e,t){const n=[];let r=!1;const s=(i,a,c,u)=>{if(qe(i))if(!a[c])n.push(u!==void 0?{v:i,i:u}:i);else{const l=i[a[c]];if(!qe(l))return;if(c===a.length-1&&(Pe(l)||kr(l)||ff(l)||typeof l=="bigint"))n.push(u!==void 0?{v:Rs(l),i:u}:Rs(l));else if(Nt(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,Pe(t)?t.split("."):t,0),r?n:n[0]}const vf={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},jf={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},Sf={location:0,threshold:.6,distance:100},Af={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:kf,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ee=Object.freeze({...jf,...vf,...Sf,...Af});function Ef(e){return e>=9&&e<=13||e===32||e===160}function Nf(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++)Ef(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 bo=class{constructor({getFn:e=ee.getFn,fieldNormWeight:t=ee.fieldNormWeight}={}){this.norm=Nf(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(Pe(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(Ls);if(Pe(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(Ls);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!qe(e)||cr(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(qe(a)){if(Nt(a)){const c=[];for(let u=0,l=a.length;u<l;u+=1){const d=a[u];if(qe(d)){if(Pe(d)){if(!cr(d)){const f={v:d,i:u,n:this.norm.get(d)};c.push(f)}}else if(qe(d.v)){const f=Pe(d.v)?d.v:Rs(d.v);if(!cr(f)){const p={v:f,i:d.i,n:this.norm.get(f)};c.push(p)}}}}n.$[r]=c}else if(Pe(a)&&!cr(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 jc(e,t,{getFn:n=ee.getFn,fieldNormWeight:r=ee.fieldNormWeight}={}){const s=new bo({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(vc)),s.setSources(t),s.create(),s}function Tf(e,{getFn:t=ee.getFn,fieldNormWeight:n=ee.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new bo({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function Cf(e=[],t=ee.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 _f(e,t,n,{location:r=ee.location,distance:s=ee.distance,threshold:i=ee.threshold,findAllMatches:a=ee.findAllMatches,minMatchCharLength:c=ee.minMatchCharLength,includeMatches:u=ee.includeMatches,ignoreLocation:l=ee.ignoreLocation}={}){if(t.length>32)throw new Error(gf(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let m=i,g=p;const y=(w,_)=>{const L=w/d;if(l)return L;const U=Math.abs(p-_);return s?L+U/s:U?1:L},b=c>1||u,j=b?Array(f):[];let N;for(;(N=e.indexOf(t,g))>-1;){const w=y(0,N);if(m=Math.min(w,m),g=N+d,b){let _=0;for(;_<d;)j[N+_]=1,_+=1}}g=-1;let A=[],$=1,F=0,G=d+f;const T=1<<d-1;for(let w=0;w<d;w+=1){let _=0,L=G;for(;_<L;)y(w,p+L)<=m?_=L:G=L,L=Math.floor((G-_)/2+_);G=L;let U=Math.max(1,p-L+1);const P=a?f:Math.min(p+L,f)+d,X=Array(P+2);X[P+1]=(1<<w)-1;for(let ie=P;ie>=U;ie-=1){const E=ie-1,S=n[e[E]];if(X[ie]=(X[ie+1]<<1|1)&S,w&&(X[ie]|=(A[ie+1]|A[ie])<<1|1|A[ie+1]),X[ie]&T&&($=y(w,E),$<=m)){if(m=$,g=E,F=w,g<=p)break;U=Math.max(1,2*p-g)}}if(y(w+1,p)>m)break;A=X}if(b&&g>=0){const w=Math.min(f-1,g+d-1+F);for(let _=g;_<=w;_+=1)n[e[_]]&&(j[_]=1)}const v={isMatch:g>=0,score:Math.max(.001,$)};if(b){const w=Cf(j,c);w.length?u&&(v.indices=w):v.isMatch=!1}return v}function $f(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 yo(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 Sc={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},If=new RegExp("["+Object.keys(Sc).join("")+"]","g"),On=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(If,t=>Sc[t]):e=>e;var wo=class{constructor(e,{location:t=ee.location,threshold:n=ee.threshold,distance:r=ee.distance,includeMatches:s=ee.includeMatches,findAllMatches:i=ee.findAllMatches,minMatchCharLength:a=ee.minMatchCharLength,isCaseSensitive:c=ee.isCaseSensitive,ignoreDiacritics:u=ee.ignoreDiacritics,ignoreLocation:l=ee.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?On(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,m)=>{this.chunks.push({pattern:p,alphabet:$f(p),startIndex:m})},f=this.pattern.length;if(f>32){let p=0;const m=f%32,g=f-m;for(;p<g;)d(this.pattern.substr(p,32),p),p+=32;if(m){const y=f-32;d(this.pattern.substr(y),y)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?On(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const g={isMatch:!0,score:0};return r&&(g.indices=[[0,e.length-1]]),g}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:g,alphabet:y,startIndex:b})=>{const{isMatch:j,score:N,indices:A}=_f(e,g,y,{location:s+b,distance:i,threshold:a,findAllMatches:c,minMatchCharLength:u,includeMatches:r,ignoreLocation:l});j&&(p=!0),f+=N,j&&A&&d.push(...A)});const m={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(m.indices=yo(d)),m}};const Of=new Set(["fuzzy","include"]);function Mf(e){return e.startsWith("inverse")}const Ps=[{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 wo(e,{location:t.location??ee.location,threshold:t.threshold??ee.threshold,distance:t.distance??ee.distance,includeMatches:t.includeMatches??ee.includeMatches,findAllMatches:t.findAllMatches??ee.findAllMatches,minMatchCharLength:t.minMatchCharLength??ee.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??ee.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??ee.ignoreDiacritics,ignoreLocation:t.ignoreLocation??ee.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Bi=Ps.length,Rf="\0",Lf="|";function Pf(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 Fi(e,t){const n=e.match(t);return n?n[1]:null}function Df(e,t={}){return e.replace(/\\\|/g,Rf).split(Lf).map(n=>{const r=Pf(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<Bi;){const d=Ps[l],f=Fi(c,d.multiRegex);f&&(s.push(d.create(f,t)),u=!0)}if(!u)for(l=-1;++l<Bi;){const d=Ps[l],f=Fi(c,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Bf=class{constructor(e,{isCaseSensitive:t=ee.isCaseSensitive,ignoreDiacritics:n=ee.ignoreDiacritics,includeMatches:r=ee.includeMatches,minMatchCharLength:s=ee.minMatchCharLength,ignoreLocation:i=ee.ignoreLocation,findAllMatches:a=ee.findAllMatches,location:c=ee.location,threshold:u=ee.threshold,distance:l=ee.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?On(e):e,this.pattern=e,this.query=Df(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?On(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,m=f.length;p<m;p+=1){const g=f[p],{isMatch:y,indices:b,score:j}=g.search(e);if(y)i+=1,c+=j,Mf(g.type)&&(u=!0),n&&(Of.has(g.type)?a.push(...b):a.push(b));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=yo(a)),p}}return{isMatch:!1,score:1}}};const Ds=[];function ko(...e){Ds.push(...e)}function Tr(e,t){for(let n=0,r=Ds.length;n<r;n+=1){const s=Ds[n];if(s.condition(e,t))return new s(e,t)}return new wo(e,t)}const Cr={AND:"$and",OR:"$or"},Bs={PATH:"$path",PATTERN:"$val"},Fs=e=>!!(e[Cr.AND]||e[Cr.OR]),Ff=e=>!!e[Bs.PATH],zf=e=>!Nt(e)&&wc(e)&&!Fs(e),zi=e=>({[Cr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ac(e,t,{auto:n=!0}={}){const r=s=>{if(Pe(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=Tr(s,t)),u}const i=Object.keys(s),a=Ff(s);if(!a&&i.length>1&&!Fs(s))return r(zi(s));if(zf(s)){const u=a?s[Bs.PATH]:i[0],l=a?s[Bs.PATTERN]:s[u];if(!Pe(l))throw new Error(mf(u));const d={keyId:vr(u),pattern:l};return n&&(d.searcher=Tr(l,t)),d}const c={children:[],operator:i[0]};return i.forEach(u=>{const l=s[u];Nt(l)&&l.forEach(d=>{c.children.push(r(d))})}),c};return Fs(e)||(e=zi(e)),r(e)}function zs(e,{ignoreFieldNorm:t=ee.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 Hf(e,{ignoreFieldNorm:t=ee.ignoreFieldNorm}){e.forEach(n=>{n.score=zs(n.matches,{ignoreFieldNorm:t})})}var Uf=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 Wf(e){const t=[];return e.matches.forEach(n=>{if(!qe(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 Gf(e,t,{includeMatches:n=ee.includeMatches,includeScore:r=ee.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=Wf(s)),r&&(a.score=s.score),a})}const Kf=/[\p{L}\p{M}\p{N}_]+/gu,Hi=new WeakSet;function Vf(e){Hi.has(e)||(Hi.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 Jf(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||Vf(e),t=>t.match(e)||[]):t=>t.match(Kf)||[]}function Hs({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Jf(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=On(s)),r(s)}}}var Yf=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Hs({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 wo(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=yo(t)),this.combineAll&&(this.useMask?u.matchedMask=i:u.matchedTerms=a,u.termCount=this.numTerms),u}};function ps(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 Ec(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){ps(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)ps(e,l.v,s,r);else ps(e,u.v,s,r)}}function Xf(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)Ec(r,s,t,n);return r}function Zf(e,t,n,r){Ec(e,t,n,r)}function Qf(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 Ui(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((c,u)=>c-u);for(const c of n)Qf(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={...ee,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new wf(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=Tr(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 bo))throw new Error(hf);if(this._myIndex=t||jc(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Hs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Xf(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!qe(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Hs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Zf(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&&Ui(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(Ls);this._invertedIndex&&Ui(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(Pe(e)&&!e.trim()){let p=this._docs.map((m,g)=>({item:m,refIndex:g}));return kr(n)&&n>-1&&(p=p.slice(0,n)),p}const u=i&&kr(n)&&n>0&&Pe(e),l=a,d=(p,m)=>l(p,m)||p.idx-m.idx;let f;if(u){const p=new Uf(n,d);Pe(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:c}),f=p.extractSorted()}else f=Pe(e)?Pe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Hf(f,{ignoreFieldNorm:c}),i&&f.sort(Pe(e)?d:l),kr(n)&&n>-1&&(f=f.slice(0,n));return Gf(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(!qe(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 m={item:c,idx:u,matches:p};t?(m.score=zs(m.matches,{ignoreFieldNorm:n}),t.insert(m)):a.push(m)}}}),a}_searchLogical(e){const t=Ac(e,this.options),n=this._normalizedKeys(),r=(c,u,l)=>{if(!("children"in c)){const{keyId:m,searcher:g}=c;let y;return m===null?(y=[],n.forEach((b,j)=>{y.push(...this._findMatches({key:b,value:u[j],searcher:g}))})):y=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:g}),y&&y.length?[{idx:l,item:u,matches:y}]:[]}const{children:d,operator:f}=c,p=[];for(let m=0,g=d.length;m<g;m+=1){const y=d[m],b=r(y,u,l);if(b.length)p.push(...b);else if(f===Cr.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:c,i:u})=>{if(qe(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(!qe(u))return;const d=[];let f=!1,p=!1;if(a.forEach((m,g)=>{const y=this._findMatches({key:m,value:u[g],searcher:r});y.length?(d.push(...y),y[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const m={idx:l,item:u,matches:d};t?(m.score=zs(m.matches,{ignoreFieldNorm:n}),t.insert(m)):c.push(m)}}),c}_findMatches({key:e,value:t,searcher:n}){if(!qe(t))return[];const r=[];if(Nt(t))t.forEach(({v:s,i,n:a})=>{if(!qe(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=jc;Tt.parseIndex=Tf;Tt.config=ee;Tt.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(yf);return Tr(e,{...ee,...n}).searchIn(t)};Tt.parseQuery=Ac;ko(Bf);ko(Yf);Tt.use=function(...e){e.forEach(t=>ko(t))};var qf=Tt;function Nc(e,t,n={}){const[r,s]=x.useState(""),[i,a]=x.useState(""),c=n.debounceMs??150;x.useEffect(()=>{const f=setTimeout(()=>a(r),c);return()=>clearTimeout(f)},[r,c]);const u=x.useMemo(()=>t(e),[e,t]),l=x.useMemo(()=>new qf(u,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[u,n.threshold]),d=x.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 ep(e,t={}){return Nc(e,uf,t)}const Us="search-match",Tc=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function tp(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 np(e,t){if(!Tc())return;const n=tp(e,t);if(!n.length){CSS.highlights.delete(Us);return}CSS.highlights.set(Us,new Highlight(...n))}function hs(){Tc()&&CSS.highlights.delete(Us)}function Wi(e,t){const n=x.useRef(null);x.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&&np(d,s),l<6&&setTimeout(()=>u(l+1),100)};return setTimeout(()=>c(0),50),()=>{a=!0}},[e,...t])}function Cc({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s,initialLocation:i,onLocationChange:a,getTargetId:c}){var E;const u=((E=e[0])==null?void 0:E.id)??t,l=i&&(i.tab==="servers"||n(i.tab))?i.tab:null,[d,f]=x.useState(()=>l&&l!=="servers"?l:u),[p,m]=x.useState(()=>l),g=S=>{f(S),m(S)},[y,b]=x.useState(()=>{const S={};return l&&(i!=null&&i.key)&&(S[l]=i.key),S}),j=e.some(S=>S.id===d)?d:u,N={};for(const S of r)N[S.id]=S.visible?y[S.id]??null:null;const A=(S,M)=>b(W=>({...W,[S]:M})),[$,F]=x.useState(null),[G,T]=x.useState(null),[v,w]=x.useState(null),_=S=>{n(S.tab)?g(S.tab):S.tab==="servers"&&m("servers");const M={};for(const W of r)M[W.id]=W.id===S.tab?S.key:null;b(M),F(S.focusSection??null),T(S.tab==="schemas"&&S.schemaFocusTokens?{tokens:S.schemaFocusTokens,id:S.targetId}:null),S.tab==="schemas"&&hs(),w({targetId:S.targetId,query:s,highlight:S.tab!=="schemas"})},L=(S,M)=>{g(S),b(W=>{const Q={...W};for(const ne of r)ne.id!=="servers"&&(Q[ne.id]=ne.id===S?M:null);return Q})},U=S=>{m("servers");const M={};for(const W of r)M[W.id]=W.id==="servers"?S:null;b(M)},P=S=>{n(S)&&g(S)},X=x.useMemo(()=>{for(const S of r){const M=N[S.id];if(M)return{tab:S.id,key:M}}return null},[...r.map(S=>N[S.id])]);Wi(v,[j,$,G,...r.map(S=>N[S.id])]);const[ie]=x.useState(()=>l&&(i!=null&&i.key)&&c?{targetId:c(l,i.key),query:"",highlight:!1}:null);return Wi(ie,[j]),x.useEffect(()=>{a==null||a(X?{tab:X.tab,key:X.key}:{tab:j,key:null})},[j,X]),x.useEffect(()=>{s.trim()||(w(null),hs())},[s]),x.useEffect(()=>hs,[]),{effectiveTab:j,focusTab:g,navActiveSection:p??j,selected:N,setSelectedKey:A,selectedNavItem:X,handleSearchSelect:_,handleNavItemSelect:L,handleNavServerSelect:U,handleContentTabChange:P,focusSection:$,schemaFocusTarget:G}}const oe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ht=e=>oe(e)?e:null,Gi="^[\0-ÿ]*$",rp=Math.pow(-2,31),sp=Math.pow(2,31)-1,op=Math.pow(-2,63),ip=Math.pow(2,63)-1,ap={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"},vo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Mn(e){const t=vo(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ws(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=Mn(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Ki(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function cp(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 lp(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 Gs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Ks(e,t,n){const{type:r,jsonSchema:s}=cp(e,n);lp(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 jo(e,t,n){t!==void 0&&(e[t]=n)}function Rn(e,t){let n={};if(Array.isArray(e))return dp(n,e,t);const r=vo(e),s=typeof e=="string"?e:r.type;switch(n.type=ap[s],s){case"int":{n.minimum=rp,n.maximum=sp;break}case"long":{n.minimum=op,n.maximum=ip;break}case"bytes":{n.pattern=Gi;break}case"fixed":{n.pattern=Gi,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=Rn(r.values,t);break}case"array":{n.items=Rn(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=up(r,t,n);jo(t,Mn(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Mn(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=Gs(r)?{...i}:i);break}}return Ws(r,n,t),Ks(s,r,n),n}function up(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=Gs(s)?{...i}:i;Ki(s,n,s.default!==void 0),Gs(s)&&(Ws(s,a,t),Ks(s.type,s,a)),r.set(s.name,a)}else{const a=Rn(s.type,t);Ki(s,n,s.default!==void 0),Ws(s,a,t),Ks(s.type,s,a),r.set(s.name,a),jo(t,Mn(s.type),a)}}return r}function dp(e,t,n){const r=[];let s=null;for(const i of t){const a=Rn(i,n);(typeof i=="string"?i:vo(i).type)==="null"?s=a:(r.push(a),jo(n,Mn(i),a))}return s&&r.push(s),e.oneOf=r,e}function Vs(e){return Rn(e,{})}const Vi=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),fp=new Set(["record","enum","array","map","fixed"]),Ji=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function So(e){const t=[];return en(e,"schema",t,new Set),t}function en(e,t,n,r){if(typeof e=="string"){!Vi.has(e)&&!Ji.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)=>en(i,`${t}[${a}]`,n,r));return}if(!oe(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)||oe(s)?en(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Vi.has(s)&&!fp.has(s)&&!Ji.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(!oe(i)||typeof i.name!="string"){n.push(`${c}: field must have a string "name"`);return}en(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"`):en(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):en(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let _r=null,ms=null;const Js=new Set;function pp(){return ms||(ms=Promise.resolve().then(()=>require("./protoToJsonSchema-DL-Dx35m.cjs")).then(e=>{_r=e.protoToJsonSchema,Js.forEach(t=>t())})),ms}function hp(){return _r||pp(),_r}function mp(e){return Js.add(e),()=>Js.delete(e)}function Yi(){return _r!==null}function Ur(){return x.useSyncExternalStore(mp,Yi,Yi)}const gp="x-parser-original-payload",$r="x-lib-conversion-error",xp=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,bp=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Dn(e){return typeof e=="string"&&xp.test(e)}function Bn(e){return typeof e=="string"&&bp.test(e)}function _c(e){return oe(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function $c(e){var t,n;if(typeof e!="string")return null;if(Dn(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Bn(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 Ic(e){return Dn(e)?"Avro":Bn(e)?"Protobuf":null}function yp(e,t){return t?!1:!e||Dn(e)||Bn(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const wp=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],kp=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function vp(e){return typeof e=="string"||Array.isArray(e)?!0:oe(e)?typeof e.type=="string"&&kp.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!wp.some(t=>t in e):!1}function ln(e,t){let n=e;if(t&&oe(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=jp(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=_c(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function jp(e){var a;if(!_c(e))return{schema:ht(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[gp],s=(a=ht(n))==null?void 0:a[$r];if(typeof s=="string")return{schema:ht(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:ht(n)??{},schemaFormat:t,originalSchema:r};if(Dn(t)&&vp(n)){const c=So(n);if(c.length>0)return{schema:ht(n)??{},schemaFormat:t,originalSchema:n,conversionError:c[0]};try{return{schema:Vs(n),schemaFormat:t,originalSchema:n}}catch(u){return{schema:ht(n)??{},schemaFormat:t,originalSchema:n,conversionError:u instanceof Error?u.message:"Failed to convert Avro schema"}}}if(Bn(t)&&typeof n=="string"){const c=hp();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=ht(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const Se=(e,t)=>`${"#".repeat(e)} ${t}`,D=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),Qt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Sp={objects:new Set,refs:new Set},Wr=(e,t)=>({schemas:e??{},nameOf:xo(e,t),referenced:new Set}),Ap=e=>`#/components/schemas/${e.replace(/~/g,"~0").replace(/\//g,"~1")}`;function jr(e,t,n,r=Sp,s=!0){if(e===null||typeof e!="object")return e;if(n&&!s){const c=Qt(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:Ap(l)};const d=c!==void 0?af(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)||Qt(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const c=Qt(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:Qt(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(c=>jr(c,t,n,i,!1));if(Qt(e)&&typeof e.$ref=="string"){const c=t==null?void 0:t(e.$ref);return Qt(c)||Array.isArray(c)?jr(c,t,n,i,s):{$ref:e.$ref}}const a={};for(const[c,u]of Object.entries(e))a[c]=jr(u,t,n,i,!1);return a}function Ir(e,t,n,r){if(!t)return"";const s=jr(t,n,r);return`${Se(4,`\`${D(e)}\``)}
|
|
7
7
|
|
|
8
8
|
\`\`\`json
|
|
9
9
|
${JSON.stringify(s,null,2)}
|
|
@@ -65,7 +65,7 @@ _(could not convert schema: ${D(a)})_`;const u=i&&!s.description?{...s,descripti
|
|
|
65
65
|
`)}function Dc(e,t,n,r=Bt(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(Se(1,D(a.title))),i.push(`**Version:** ${D(a.version)}`),a.description&&i.push(D(a.description)),(d=e.servers)!=null&&d.length){const m=[Se(2,"Servers")];for(const g of e.servers)m.push(`- \`${D(g.url)}\`${g.description?` — ${D(g.description)}`:""}`);i.push(m.join(`
|
|
66
66
|
`))}const c=Wr((f=e.components)==null?void 0:f.schemas,r);return i.push(Pc(t,n,s,r,c,(p=e.components)==null?void 0:p.securitySchemes,e.security)),i.push(Oc(c,r)),i.filter(Boolean).join(`
|
|
67
67
|
|
|
68
|
-
`)}function Gr({label:e,children:t}){return o.jsx(Ft,{fallback:null,onError:n=>console.error(`[apiuikit] plugin error in slot "${e}":`,n),children:o.jsx(x.Suspense,{fallback:null,children:t})})}function Bc(){const{plugins:e,pluginSlotRegistry:t}=it();return x.useMemo(()=>t??ec(e??[]),[t,e])}function Fc(e){return Bc().get(e)??[]}function Fn({name:e,context:t}){const n=Fc(e);return n.length===0?null:o.jsx(o.Fragment,{children:n.map(({id:r,pluginName:s,Component:i})=>o.jsx(Gr,{label:`${e}:${s} (${r})`,children:o.jsx(i,{...t})},r))})}function zc(e){return Bc().get(e)??[]}const Cp=/^(https?:|data:image\/)/i;function No(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"||!Cp.test(n)?null:{url:n,altText:typeof r=="string"&&r?r:void 0,backgroundColor:typeof s=="string"?s:void 0}}const Hc={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},_p=()=>Promise.resolve().then(()=>require("./LogoExtension-
|
|
68
|
+
`)}function Gr({label:e,children:t}){return o.jsx(Ft,{fallback:null,onError:n=>console.error(`[apiuikit] plugin error in slot "${e}":`,n),children:o.jsx(x.Suspense,{fallback:null,children:t})})}function Bc(){const{plugins:e,pluginSlotRegistry:t}=it();return x.useMemo(()=>t??ec(e??[]),[t,e])}function Fc(e){return Bc().get(e)??[]}function Fn({name:e,context:t}){const n=Fc(e);return n.length===0?null:o.jsx(o.Fragment,{children:n.map(({id:r,pluginName:s,Component:i})=>o.jsx(Gr,{label:`${e}:${s} (${r})`,children:o.jsx(i,{...t})},r))})}function zc(e){return Bc().get(e)??[]}const Cp=/^(https?:|data:image\/)/i;function No(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"||!Cp.test(n)?null:{url:n,altText:typeof r=="string"&&r?r:void 0,backgroundColor:typeof s=="string"?s:void 0}}const Hc={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},_p=()=>Promise.resolve().then(()=>require("./LogoExtension-BIVvHwTB.cjs"));function To(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ut=To();function Uc(e){Ut=e}var $n={exec:()=>null};function pe(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(ze.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var ze={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")},$p=/^(?:[ \t]*(?:\n|$))+/,Ip=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Op=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Co=/(?:[*+-]|\d{1,9}[.)])/,Wc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gc=pe(Wc).replace(/bull/g,Co).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(),Rp=pe(Wc).replace(/bull/g,Co).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(),_o=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Lp=/^[^\n]+/,$o=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Pp=pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$o).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Dp=pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Co).getRegex(),Kr="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",Io=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bp=pe("^ {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",Io).replace("tag",Kr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kc=pe(_o).replace("hr",zn).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",Kr).getRegex(),Fp=pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kc).getRegex(),Oo={blockquote:Fp,code:Ip,def:Pp,fences:Op,heading:Mp,hr:zn,html:Bp,lheading:Gc,list:Dp,newline:$p,paragraph:Kc,table:$n,text:Lp},Xi=pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",zn).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",Kr).getRegex(),zp={...Oo,lheading:Rp,table:Xi,paragraph:pe(_o).replace("hr",zn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xi).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",Kr).getRegex()},Hp={...Oo,html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Io).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:$n,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pe(_o).replace("hr",zn).replace("heading",` *#{1,6} *[^
|
|
69
69
|
]`).replace("lheading",Gc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Up=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wp=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vc=/^( {2,}|\\)\n(?!\s*$)/,Gp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vr=/[\p{P}\p{S}]/u,Mo=/[\s\p{P}\p{S}]/u,Jc=/[^\s\p{P}\p{S}]/u,Kp=pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Mo).getRegex(),Yc=/(?!~)[\p{P}\p{S}]/u,Vp=/(?!~)[\s\p{P}\p{S}]/u,Jp=/(?:[^\s\p{P}\p{S}]|~)/u,Yp=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Xc=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Xp=pe(Xc,"u").replace(/punct/g,Vr).getRegex(),Zp=pe(Xc,"u").replace(/punct/g,Yc).getRegex(),Zc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Qp=pe(Zc,"gu").replace(/notPunctSpace/g,Jc).replace(/punctSpace/g,Mo).replace(/punct/g,Vr).getRegex(),qp=pe(Zc,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,Vp).replace(/punct/g,Yc).getRegex(),eh=pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jc).replace(/punctSpace/g,Mo).replace(/punct/g,Vr).getRegex(),th=pe(/\\(punct)/,"gu").replace(/punct/g,Vr).getRegex(),nh=pe(/^<(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(),rh=pe(Io).replace("(?:-->|$)","-->").getRegex(),sh=pe("^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",rh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Or=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oh=pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Or).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qc=pe(/^!?\[(label)\]\[(ref)\]/).replace("label",Or).replace("ref",$o).getRegex(),qc=pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",$o).getRegex(),ih=pe("reflink|nolink(?!\\()","g").replace("reflink",Qc).replace("nolink",qc).getRegex(),Ro={_backpedal:$n,anyPunctuation:th,autolink:nh,blockSkip:Yp,br:Vc,code:Wp,del:$n,emStrongLDelim:Xp,emStrongRDelimAst:Qp,emStrongRDelimUnd:eh,escape:Up,link:oh,nolink:qc,punctuation:Kp,reflink:Qc,reflinkSearch:ih,tag:sh,text:Gp,url:$n},ah={...Ro,link:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",Or).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Or).getRegex()},Ys={...Ro,emStrongRDelimAst:qp,emStrongLDelim:Zp,url:pe(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ch={...Ys,br:pe(Vc).replace("{2,}","*").getRegex(),text:pe(Ys.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},lr={normal:Oo,gfm:zp,pedantic:Hp},jn={normal:Ro,gfm:Ys,breaks:ch,pedantic:ah},lh={"&":"&","<":"<",">":">",'"':""","'":"'"},Zi=e=>lh[e];function dt(e,t){if(t){if(ze.escapeTest.test(e))return e.replace(ze.escapeReplace,Zi)}else if(ze.escapeTestNoEncode.test(e))return e.replace(ze.escapeReplaceNoEncode,Zi);return e}function Qi(e){try{e=encodeURI(e).replace(ze.percentDecode,"%")}catch{return null}return e}function qi(e,t){var i;const n=e.replace(ze.findPipe,(a,c,u)=>{let l=!1,d=c;for(;--d>=0&&u[d]==="\\";)l=!l;return l?"|":" |"}),r=n.split(ze.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(ze.slashPipe,"|");return r}function Sn(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 uh(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 ea(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 dh(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
|
|
70
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
71
|
`)}var Mr=class{constructor(e){ge(this,"options");ge(this,"rules");ge(this,"lexer");this.options=e||Ut}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:Sn(n,`
|
|
@@ -177,6 +177,6 @@ ${r}}`}const Bx={info:{key:"kafka-go",title:"kafka-go",description:"Kafka produc
|
|
|
177
177
|
`);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(`
|
|
178
178
|
`))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()}},Fx={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 ft({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=Jn(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(`
|
|
179
179
|
`);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(`
|
|
180
|
-
`))r(`// ${c}`);s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}return i()}},dn={};function Yn(e){if(dn[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);dn[e.info.key]={...e,clientsById:{...e.clientsById}}}function ct(e,t){const n=dn[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 zx(){return Object.values(dn).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Hx(e,t){const n=[];for(const r of zx()){const s=r.clients.filter(i=>Ax(e,t,i.protocol));s.length>0&&n.push({...r,default:s[0].key,clients:s})}return n}Yn({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});ct("agent",$x);ct("agent",_x);Yn({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});ct("javascript",Fx);ct("javascript",Lx);ct("javascript",Px);Yn({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});ct("python",Mx);ct("python",Rx);Yn({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});ct("rust",Ix);ct("rust",Ox);Yn({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});ct("go",Dx);ct("go",Bx);var Ux=class{constructor(e){this.document=e}convert(e,t,n,r={}){var a;const s=(a=dn[t])==null?void 0:a.clientsById[n];if(!s){const c=Object.values(dn).flatMap(u=>Object.keys(u.clientsById).map(l=>`${u.info.key}/${l}`));throw new ux(t,n,c)}const i=Ex(this.document,e,s.info.protocol);return s.convert(i,r)}};const Wx="javascript",Gx="ws";function Kx(e,t){return Hx(e,t)}function ou(e,t,n,r){try{return new Ux(e).convert(t,n,r)}catch{return null}}function Vx(e,t,n){if(t){for(const r of n)for(const s of r.clients)if(ou(e,t,r.key,s.key)!==null)return`${r.key}:${s.key}`}return`${Wx}:${Gx}`}const Jx={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 iu(e){return Jx[e]??"plaintext"}const Yx={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 Dr(e){return e==="plaintext"||!!ot.getLanguage(e)}async function au(e){if(Dr(e))return;const t=Yx[e];if(!t)return;const n=await t();ot.registerLanguage(e,n.default)}function Xx({operationId:e}){const{document:t,showCodeSamples:n}=it(),r=x.useId(),s=x.useMemo(()=>e?Kx(t,e):[],[t,e]),i=x.useMemo(()=>Vx(t,e,s),[t,e,s]),[a,c]=x.useState(null),u=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[l,d]=u.split(":"),f=iu(l),[,p]=x.useState(()=>Dr(f));x.useEffect(()=>{p(Dr(f));let g=!1;return au(f).then(()=>{g||p(!0)}),()=>{g=!0}},[f]);const m=x.useMemo(()=>e?ou(t,e,l,d):null,[t,e,l,d]);return!n||!m?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:g=>c({document:t,operationId:e,selection:g.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(g=>o.jsx("optgroup",{label:g.title,children:g.clients.map(y=>o.jsx("option",{value:`${g.key}:${y.key}`,children:y.title},y.key))},g.key))})]}),o.jsx(Xr,{code:m,language:f})]})}const Cn="reference";function cu({name:e,context:t,enabled:n=!0,children:r}){const s=zc(e),[i,a]=x.useState(Cn),[c,u]=x.useState(()=>new Set([Cn])),l=x.useId(),d=x.useMemo(()=>new Map(s.map(b=>[b.id,b])),[s]),f=n&&s.length>0,p=f?d.get(i):void 0,m=(p==null?void 0:p.id)??Cn,g=[{id:Cn,name:"Reference"},...s.map(b=>({id:b.id,name:b.label}))],y=b=>{u(j=>j.has(b)?j:new Set([...j,b])),a(b)};return f?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:l,tabs:g,current:m,onChange:y}),o.jsx(Od,{tabs:g,current:m,idPrefix:l,renderPanel:(b,j)=>{if(!j&&!c.has(b.id))return null;if(b.id===Cn)return r;const N=d.get(b.id);if(!N)return null;const A=N.Component;return o.jsx(Gr,{label:`${e}:${N.pluginName}`,children:o.jsx(A,{...t})})}})]}):o.jsx(o.Fragment,{children:r})}function lu({op:e,id:t,focusSection:n=null}){var y;const{document:r}=Xa(),s=x.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)?(y=u.find(b=>b.bindings))==null?void 0:y.bindings:void 0),m=e.action===Er.SEND,g=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,j)=>o.jsx(eu,{message:b,messageId:b.name,i:j},j))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(cu,{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)&&yt(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(Hr,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(at,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(Xx,{operationId:t}),t&&o.jsx(Fn,{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(Kn,{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(Vo,{securities:f})})})]}),p&&Object.entries(p).map(([b,j])=>j?o.jsxs("div",{id:`operation-${t}-bindings-${b}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Zl,{protocol:b,bindings:j,focused:n===`binding:${b}`})]},b):null),l?o.jsx(ix,{requestMessages:i,reply:l,isSend:m,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})," ",m?"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:"]}),g]}),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((b,j)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:b.name},j))})]})]})})})}const Zx=x.lazy(()=>import("@apiuikit/ws-try-it-plugin").then(({WsHeaderButton:e})=>({default:e})));function uu({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(wt,{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(wt,{method:e.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Et,{address:n.address,parameters:n.parameters,truncate:!0,peek:!0})})]}):o.jsx(o.Fragment,{children:t})}function du({operationKey:e}){const t=it(),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(Gr,{label:"built-in:asyncapi.operation.tryIt",children:o.jsx(Zx,{document:n,operationId:e})})})}function fu({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,A;const f=e[d],p=f.channel,m=p==null?void 0:p.address,g=p==null?void 0:p.parameters,y=((N=f.action)==null?void 0:N.toUpperCase())??"",b=((A=f.title)==null?void 0:A.trim())||void 0,j=t===d;return o.jsxs("tr",{id:`operation-${d}`,onClick:()=>i(d),role:"button",tabIndex:0,"aria-label":`${y||"Operation"} ${b??m??d}`,"aria-current":j?"true":void 0,onKeyDown:$=>{$.key!=="Enter"&&$.key!==" "||($.preventDefault(),i(d))},className:`cursor-pointer hover:bg-neutral-50 ${j?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:b?o.jsx("div",{className:"truncate text-sm font-medium text-foreground",title:m??void 0,children:b}):m&&o.jsx(Et,{address:m,parameters:g,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(wt,{method:f.action,className:"w-24"})})]},d)}),u=a&&t?o.jsx(uu,{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(nt,{title:xd,content:l,stickySideContent:!1,layout:s})}),o.jsx(ql,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,headerActions:a&&t&&o.jsx(du,{operationKey:t}),children:a&&o.jsx(lu,{op:a,id:t,focusSection:r},t)})]})}function pu({schemaName:e,resolved:t,anchorId:n,selected:r=!1,focusTarget:s=null}){const i=t.schema,a=$c(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"," ",Ic(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(_l,{schema:t.originalSchema})}):o.jsx(Go,{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 Jo({schemas:e,selectedKey:t,focusTarget:n,layout:r}){const{deref:s}=De(),i=Ur(),a=x.useMemo(()=>Object.entries(e).map(([u,l])=>[u,ln(l,s)]),[e,s,i]),c=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([u,l])=>o.jsx(pu,{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(nt,{content:c,stickySideContent:!1,layout:r})})}const Qx=e=>e==="operations"||e==="messages"||e==="schemas",qx=(e,t)=>{switch(e){case"messages":return`message-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`operation-${t}`}};function e0({asyncapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var E,S,M,W;const i=t.show??{},[a,c]=x.useState(!1),[u,l]=x.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&Nl(e.info),p=(n==null?void 0:n.some(Q=>!!Q.slots["asyncapi.document.topbar"]))??!1,m=d||f||p,g=[...i.operations!==!1?[{id:"operations",name:"Operations",icon:zr}]:[],...i.messages!==!1?[{id:"messages",name:"Messages",icon:dc}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:mo}]:[]],{query:y,setQuery:b,results:j}=ep(e,{threshold:.3,limit:20}),{effectiveTab:N,focusTab:A,navActiveSection:$,selected:F,setSelectedKey:G,selectedNavItem:T,handleSearchSelect:v,handleNavItemSelect:w,handleNavServerSelect:_,handleContentTabChange:L,focusSection:U,schemaFocusTarget:P}=Cc({tabs:g,defaultTab:"operations",isTabKey:Qx,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:y,initialLocation:r,onLocationChange:s,getTargetId:qx}),X=e.servers?Object.keys(e.servers):[],ie=N==="operations"?o.jsx(fu,{operations:e.operations??{},selectedKey:F.operations,onSelectKey:Q=>G("operations",Q),focusSection:U}):N==="messages"?o.jsx(Wl,{messages:((E=e.components)==null?void 0:E.messages)??{},selectedKey:F.messages,focusSection:U}):N==="schemas"?o.jsx(Jo,{schemas:((S=e.components)==null?void 0:S.schemas)??{},selectedKey:F.schemas,focusTarget:P}):null;return o.jsx(Fr,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[m&&o.jsxs(oc,{logo:f?o.jsx(Ho,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Fn,{name:"asyncapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(pc,{query:y,onQueryChange:b,results:j,onSelectResult:v,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(xc,{serialize:Q=>Ao(e,Q),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Cl,{...e.info,showLogo:!1})}),i.servers!==!1&&X.length>0&&o.jsx("div",{id:`server-${F.servers??X[0]}`,children:o.jsx(Ql,{servers:e.servers,selectedServer:F.servers,onSelectServer:Q=>G("servers",Q),focusSection:U})}),o.jsx(sc,{tabs:g,current:N,onChange:L}),N&&o.jsx("div",{id:`panel-${N}`,role:"tabpanel","aria-labelledby":`tab-${N}`,children:o.jsx(Ft,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:ie},`${N}-${F.operations}-${F.messages}-${F.schemas}`)}),i.sidebar!==!1&&o.jsx(qd,{operations:i.operations!==!1?e.operations:void 0,messages:i.messages!==!1?(M=e.components)==null?void 0:M.messages:void 0,schemas:i.schemas!==!1?(W=e.components)==null?void 0:W.schemas:void 0,servers:i.servers!==!1?e.servers:void 0,hasInfo:i.info!==!1,sidebarConfig:t.sidebar,activeTab:$,onTabChange:A,onItemSelect:w,onSelectServer:_,selectedItem:T})]})})}const Yo=e=>o.jsx(Ft,{resetKey:e.asyncapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(t0,{...e})}),t0=e=>{const t=e.asyncapi,n=x.useMemo(()=>fn(t),[t]),r=e.kind;x.useEffect(()=>{r==="resolved"&&n!==t&&uo(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??Rt;return o.jsx(e0,{asyncapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Qr({document:e,config:t=Rt,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=tc("openapi",e,t,n);return o.jsx(zt.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 n0(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:Ve([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:Ve([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 hn){const m=f[p];if(!m)continue;const g=`${p} ${d}`,y=m.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${c}-${g}`,targetId:`${c}-${g}-detail`,type:a,tab:i,key:g,name:y,path:`${u}.${d}.${p}`,location:`${l} > ${p.toUpperCase()} ${d}`,subtitle:m.description,text:Ve([p,d,m.summary,m.description,m.operationId,m.tags,m.parameters,m.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=xo(e.components.schemas,Bt(e));for(const[i,a]of Object.entries(e.components.schemas))yc(t,a,i,i,s)}return t}function r0(e,t={}){return Nc(e,n0,t)}function hu({info:e,tags:t,externalDocs:n,layout:r,showLogo:s}){const{title:i,description:a,license:c,contact:u}=e??{};return o.jsx(Tl,{title:i,description:a,license:c,contact:u,externalDocs:n,tags:t,extensionsSource:e,layout:r,showLogo:s})}function s0({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(Vl,{address:e,variables:n}),t&&o.jsx(at,{children:t})]})}const Ts=e=>`server-${e}`,Cs=e=>Number(e.slice(7));function mu({servers:e,selectedServer:t,onSelectServer:n,layout:r}){const s=e.map((p,m)=>p.url||Ts(m)),[i,a]=x.useState(void 0),c=p=>!!p&&Cs(p)>=0&&Cs(p)<e.length,u=c(t)?t:c(i)?i:Ts(0),l=e[Cs(u)],d=p=>{a(p),n==null||n(p)},f=l?o.jsx(s0,{...l}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{title:Qa,content:f,sideContent:o.jsx(Gl,{serverNames:s,current:(l==null?void 0:l.url)||u,setCurrent:p=>{const m=s.indexOf(p);d(m>=0?Ts(m):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:r})})}function o0({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 gu(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function i0(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${gu(`$${n}`)}}`)}function a0(e){return e.operationId??e.operationRef??null}const c0=e=>e.trim().replace(/[.:;]+$/,""),_s=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function l0({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=a0(s),a=Object.entries(s.parameters??{}),c=s.description?c0(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(o0,{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],m)=>o.jsxs(x.Fragment,{children:[m>0&&(m===a.length-1?" and ":", "),o.jsx(_s,{children:f})," from ",o.jsx(_s,{children:gu(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(_s,{children:s.server.url})]}):null,"."]})]},r)})})}function u0(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>hn.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function d0({callbacks:e,id:t,renderOperation:n,depth:r}){const s=u0(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(Kn,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(wt,{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:i0(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 f0=x.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-CaQ-Plnx.cjs")).then(({CodeSamples:e})=>({default:e})));function p0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function xu({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 bu(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 h0(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 m0({responses:e,onFollowOperation:t,isOperationKnown:n}){var G,T;const r=Object.keys(e),[s,i]=x.useState(r[0]),a=e[s],c=Object.keys((a==null?void 0:a.content)??{}),[u,l]=x.useState(c[0]),d=u?(G=a==null?void 0:a.content)==null?void 0:G[u]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[m,g]=x.useState("body"),y=c.length>0&&!!d,b=Object.keys(f).length>0,j=Object.keys(p).length>0,N=[...y?[{id:"body",name:"Body"}]:[],...b?[{id:"headers",name:"Headers"}]:[]],A=N.length>1,$=N.some(v=>v.id===m)?m:(T=N[0])==null?void 0:T.id,F=N.length>0;return x.useEffect(()=>{l(Object.keys((a==null?void 0:a.content)??{})[0]),g("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 ${h0(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}),F?o.jsxs(o.Fragment,{children:[A&&o.jsx(Ht,{tabs:N,current:$,onChange:v=>g(v)}),o.jsx("div",{className:A?"mt-4":void 0,children:$==="headers"?o.jsx(Dt,{schema:x0(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(Dt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(xu,{prefix:"Body",mediaTypes:c,selected:u,onChange:l}),rootName:"Body",example:bu(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&o.jsx(l0,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function yu(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 g0=e=>yu(e),x0=e=>yu(Object.entries(e).map(([t,n])=>({name:t,...n})));function b0({parameters:e}){var c;const t=wd.filter(({location:u})=>e.some(l=>l.in===u)),[n,r]=x.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=g0(e.filter(u=>u.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(Ht,{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(Dt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function y0({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[c,u]=x.useState(s?"parameters":"body"),[l,d]=x.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(m=>m.in==="header")?"headers":null,t.some(m=>m.in==="cookie")?"cookie":null].filter(m=>!!m);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 ",w0(p),":"]}),s&&a&&o.jsx(Ht,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:c,onChange:m=>u(m)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(c==="parameters"||!a)&&s&&o.jsx(b0,{parameters:t}),(c==="body"||!s)&&a&&f&&o.jsx(Dt,{schema:f.schema??{},label:o.jsx(xu,{prefix:"Request Body",mediaTypes:i,selected:l,onChange:d}),rootName:"Body ",description:r,example:bu(f)})]})]})}function w0(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 k0({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,m=!!i&&Object.keys(i).length>0&&c<v0,g=[...f?["request"]:[],...p?["response"]:[],...m?["callbacks"]:[]],[y,b]=x.useState(g[0]??"request");if(g.length===0)return null;const j=g.includes(y)?y:g[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:g.map(N=>o.jsx("button",{role:"tab","aria-selected":j===N,onClick:()=>b(N),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===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:[j==="request"&&o.jsx(y0,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&o.jsx(m0,{responses:s,onFollowOperation:l,isOperationKnown:d}),j==="callbacks"&&i&&o.jsx(d0,{callbacks:i,id:a,depth:c,renderOperation:Xo})]})]})}const v0=1;function Xo({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:c,isOperationKnown:u,depth:l=0}){var A,$,F,G;const{document:d}=Za(),f=(n.parameters??[]).filter(T=>T.in!=="query"&&T.in!=="path"),p=n.security??i??[],m=n.responses??{},g=((A=n.requestBody)==null?void 0:A.content)??{},y=n.operationId?p0(n.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const T of p)for(const[v,w]of Object.entries(T)){if(w.length===0)continue;const _=b.get(v)??[];b.set(v,Array.from(new Set([..._,...w])))}const j=Array.from(new Set(p.flatMap(T=>Object.keys(T)))).map(T=>{const v=a==null?void 0:a[T];if(!v)return null;const w=b.get(T);return w?{...v,requiredScopes:w}:v}).filter(T=>!!T),N=l===0;return o.jsx("div",{className:`flex flex-col gap-6 ${N?"min-h-full":""}`,id:`${s}-${r}-detail`,children:o.jsx(cu,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:N,children:o.jsxs(o.Fragment,{children:[(n.deprecated||(($=n.externalDocs)==null?void 0:$.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"}),((F=n.externalDocs)==null?void 0:F.url)&&yt(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(Hr,{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(at,{children:n.description}),o.jsx(x.Suspense,{fallback:null,children:o.jsx(f0,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:p,id:r})}),o.jsx(Fn,{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"}),j.length>0&&o.jsx(Kn,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Kl,{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:j.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Vo,{securities:j})})})]}),o.jsx(k0,{label:y,parameters:f,requestBodyContent:g,requestBodyDescription:(G=n.requestBody)==null?void 0:G.description,responses:m,callbacks:n.callbacks,id:r,depth:l,fillHeight:N,onFollowOperation:c,isOperationKnown:u})]})})})}const Wa=320;function j0({parameters:e}){const{portalHost:t}=De(),[n,r]=x.useState(!1),[s,i]=x.useState({top:0,left:0,placement:"bottom"}),a=x.useRef(null),c=x.useRef(null),u=x.useId();return x.useEffect(()=>{if(!n)return;const l=a.current;if(!l)return;const d=()=>i(Is(l,{align:"end",width:Wa}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n]),x.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 m;const p=((m=f.composedPath)==null?void 0:m.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&&an.createPortal(o.jsxs("div",{ref:c,id:u,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:Wa},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:ic(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 wu(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 ku(e){const t={};for(const n of e)t[n.name]=wu(n);return t}function S0(e){return e.filter(t=>t.in==="query").map(t=>({...wu(t),name:t.name,required:t.required}))}const A0=x.lazy(()=>import("@apiuikit/openapi-try-it-plugin").then(({TryItHeaderButton:e})=>({default:e})));function vu({method:e,path:t,parameters:n}){return o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(wt,{method:e}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Et,{address:t,parameters:ku(n),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(j0,{parameters:S0(n)})]})}function ju({method:e,path:t}){const n=it(),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(Gr,{label:"built-in:openapi.operation.tryIt",children:o.jsx(A0,{document:r,method:e,path:t})})})}function Br({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:c}){var G;const u=T=>s==null?void 0:s(T),l=x.useMemo(()=>cn(e),[e]),d=x.useMemo(()=>{var v,w,_;const T=new Map;for(const L of l){const U=((_=(w=(v=e[L.path])==null?void 0:v[L.method])==null?void 0:w.tags)==null?void 0:_[0])||"Other",P=T.get(U)??[];P.push(L),T.set(U,P)}return Array.from(T,([L,U])=>({label:L,items:U}))},[l,e]),[f,p]=x.useState(()=>new Set),m=f.size===0;x.useEffect(()=>{if(!r)return;const T=d.find(({items:v})=>v.some(({key:w})=>w===r));T&&p(v=>{if(!v.has(T.label))return v;const w=new Set(v);return w.delete(T.label),w})},[d,r]);const g=x.useMemo(()=>{var v,w;const T=new Map;for(const{key:_,method:L,path:U}of l){const P=(w=(v=e[U])==null?void 0:v[L])==null?void 0:w.operationId;P&&T.set(P,_)}return T},[l,e]);if(l.length===0)return null;const y=r?l.find(T=>T.key===r):null,b=y?(G=e[y.path])==null?void 0:G[y.method]:null,j=({key:T,method:v,path:w},_)=>{var P;const L=r===T,U=Ms(e[w],(P=e[w])==null?void 0:P[v]);return o.jsxs("tr",{id:`${a}-${T}`,onClick:()=>u(T),role:"button",tabIndex:_?0:-1,"aria-hidden":!_,"aria-label":`${v.toUpperCase()} ${w}`,"aria-current":L?"true":void 0,onKeyDown:X=>{X.key!=="Enter"&&X.key!==" "||(X.preventDefault(),u(T))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${_?`cursor-pointer opacity-100 visible ${L?"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(Et,{address:w,parameters:ku(U),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(wt,{method:v,className:"w-20"})})})]},T)},N=d.map(({label:T,items:v},w)=>{const _=!f.has(T),L=`${a}-group-${w}-${T.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(x.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":`${T} endpoints (${v.length})`,"aria-expanded":_,"aria-controls":L,onClick:()=>p(U=>{const P=new Set(U);return _?P.add(T):P.delete(T),P}),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(pn,{className:"h-2.5 w-2.5"}):o.jsx(Jl,{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:T}),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:L,"aria-hidden":!_,className:`bg-surface ${_?"divide-y divide-border":""}`,children:v.map(U=>j(U,_))})]},T)}),A=Ms(y?e[y.path]:void 0,b),$=y?o.jsx(vu,{method:y.method,path:y.path,parameters:A}):r,F=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:m,onChange:T=>p(T.target.checked?new Set:new Set(d.map(({label:v})=>v))),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),p(m?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(nt,{content:F,stickySideContent:!1,layout:c})}),o.jsx(ql,{isOpen:!!y,side:"right",onClose:()=>u(null),title:$,headerActions:y&&o.jsx(ju,{method:y.method,path:y.path}),children:y&&b&&o.jsx(Ft,{resetKey:b,fallback:o.jsx("p",{role:"alert",children:"This operation could not be rendered. Select another operation to continue."}),children:o.jsx(Xo,{method:y.method,path:y.path,op:{...b,parameters:A},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:T=>g.has(T),onFollowOperation:T=>{const v=g.get(T);v&&u(v)}},y.key)},y.key)})]})}const E0=e=>e==="endpoints"||e==="webhooks"||e==="schemas",N0=(e,t)=>{switch(e){case"webhooks":return`webhook-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`endpoint-${t}`}};function T0({openapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var S,M,W,Q;const i=t.show??{},[a,c]=x.useState(!1),[u,l]=x.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&Nl(e.info),p=(n==null?void 0:n.some(ne=>!!ne.slots["openapi.document.topbar"]))??!1,m=d||f||p,g=e.webhooks??{},y=Object.keys(g).length>0,b=[...i.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:zr}]:[],...y&&i.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:go}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:mo}]:[]],{query:j,setQuery:N,results:A}=r0(e,{threshold:.3,limit:20}),{effectiveTab:$,focusTab:F,navActiveSection:G,selected:T,setSelectedKey:v,selectedNavItem:w,handleSearchSelect:_,handleNavItemSelect:L,handleNavServerSelect:U,handleContentTabChange:P,schemaFocusTarget:X}=Cc({tabs:b,defaultTab:"endpoints",isTabKey:E0,sections:[{id:"endpoints",visible:i.endpoints!==!1},{id:"webhooks",visible:y&&i.webhooks!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:j,initialLocation:r,onLocationChange:s,getTargetId:N0}),ie=(e.servers??[]).map(ne=>ne.url),E=$==="endpoints"?o.jsx(Br,{paths:e.paths??{},security:e.security,securitySchemes:(S=e.components)==null?void 0:S.securitySchemes,selectedKey:T.endpoints,onSelectKey:ne=>v("endpoints",ne)}):$==="webhooks"?o.jsx(Br,{paths:g,security:e.security,securitySchemes:(M=e.components)==null?void 0:M.securitySchemes,selectedKey:T.webhooks,onSelectKey:ne=>v("webhooks",ne),columnLabel:"Webhook",idPrefix:"webhook"}):$==="schemas"?o.jsx(Jo,{schemas:((W=e.components)==null?void 0:W.schemas)??{},selectedKey:T.schemas,focusTarget:X}):null;return o.jsx(Qr,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[m&&o.jsxs(oc,{logo:f?o.jsx(Ho,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Fn,{name:"openapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(pc,{query:j,onQueryChange:N,results:A,onSelectResult:_,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(xc,{serialize:ne=>Eo(e,ne),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(hu,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),i.servers!==!1&&ie.length>0&&o.jsx("div",{id:T.servers??"server-0",children:o.jsx(mu,{servers:e.servers,selectedServer:T.servers,onSelectServer:ne=>v("servers",ne)})}),o.jsx(sc,{tabs:b,current:$,onChange:P}),$&&o.jsx("div",{id:`panel-${$}`,role:"tabpanel","aria-labelledby":`tab-${$}`,children:o.jsx(Ft,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:E},`${$}-${T.endpoints}-${T.webhooks}-${T.schemas}`)}),i.sidebar!==!1&&o.jsx(nf,{paths:i.endpoints!==!1?e.paths:void 0,webhooks:y&&i.webhooks!==!1?g:void 0,schemas:i.schemas!==!1?(Q=e.components)==null?void 0:Q.schemas:void 0,servers:i.servers!==!1?ie:void 0,hasInfo:i.info!==!1,activeTab:G,onTabChange:F,onItemSelect:L,onSelectServer:U,selectedItem:w})]})})}const Zo=e=>o.jsx(Ft,{resetKey:e.openapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(C0,{...e})}),C0=e=>{const t=e.openapi,n=x.useMemo(()=>fn(t),[t]),r=e.kind;x.useEffect(()=>{r==="resolved"&&n!==t&&uo(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??Rt;return o.jsx(T0,{openapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Su(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 on=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
|
|
180
|
+
`))r(`// ${c}`);s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}return i()}},dn={};function Yn(e){if(dn[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);dn[e.info.key]={...e,clientsById:{...e.clientsById}}}function ct(e,t){const n=dn[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 zx(){return Object.values(dn).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Hx(e,t){const n=[];for(const r of zx()){const s=r.clients.filter(i=>Ax(e,t,i.protocol));s.length>0&&n.push({...r,default:s[0].key,clients:s})}return n}Yn({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});ct("agent",$x);ct("agent",_x);Yn({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});ct("javascript",Fx);ct("javascript",Lx);ct("javascript",Px);Yn({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});ct("python",Mx);ct("python",Rx);Yn({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});ct("rust",Ix);ct("rust",Ox);Yn({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});ct("go",Dx);ct("go",Bx);var Ux=class{constructor(e){this.document=e}convert(e,t,n,r={}){var a;const s=(a=dn[t])==null?void 0:a.clientsById[n];if(!s){const c=Object.values(dn).flatMap(u=>Object.keys(u.clientsById).map(l=>`${u.info.key}/${l}`));throw new ux(t,n,c)}const i=Ex(this.document,e,s.info.protocol);return s.convert(i,r)}};const Wx="javascript",Gx="ws";function Kx(e,t){return Hx(e,t)}function ou(e,t,n,r){try{return new Ux(e).convert(t,n,r)}catch{return null}}function Vx(e,t,n){if(t){for(const r of n)for(const s of r.clients)if(ou(e,t,r.key,s.key)!==null)return`${r.key}:${s.key}`}return`${Wx}:${Gx}`}const Jx={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 iu(e){return Jx[e]??"plaintext"}const Yx={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 Dr(e){return e==="plaintext"||!!ot.getLanguage(e)}async function au(e){if(Dr(e))return;const t=Yx[e];if(!t)return;const n=await t();ot.registerLanguage(e,n.default)}function Xx({operationId:e}){const{document:t,showCodeSamples:n}=it(),r=x.useId(),s=x.useMemo(()=>e?Kx(t,e):[],[t,e]),i=x.useMemo(()=>Vx(t,e,s),[t,e,s]),[a,c]=x.useState(null),u=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[l,d]=u.split(":"),f=iu(l),[,p]=x.useState(()=>Dr(f));x.useEffect(()=>{p(Dr(f));let g=!1;return au(f).then(()=>{g||p(!0)}),()=>{g=!0}},[f]);const m=x.useMemo(()=>e?ou(t,e,l,d):null,[t,e,l,d]);return!n||!m?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:g=>c({document:t,operationId:e,selection:g.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(g=>o.jsx("optgroup",{label:g.title,children:g.clients.map(y=>o.jsx("option",{value:`${g.key}:${y.key}`,children:y.title},y.key))},g.key))})]}),o.jsx(Xr,{code:m,language:f})]})}const Cn="reference";function cu({name:e,context:t,enabled:n=!0,children:r}){const s=zc(e),[i,a]=x.useState(Cn),[c,u]=x.useState(()=>new Set([Cn])),l=x.useId(),d=x.useMemo(()=>new Map(s.map(b=>[b.id,b])),[s]),f=n&&s.length>0,p=f?d.get(i):void 0,m=(p==null?void 0:p.id)??Cn,g=[{id:Cn,name:"Reference"},...s.map(b=>({id:b.id,name:b.label}))],y=b=>{u(j=>j.has(b)?j:new Set([...j,b])),a(b)};return f?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:l,tabs:g,current:m,onChange:y}),o.jsx(Od,{tabs:g,current:m,idPrefix:l,renderPanel:(b,j)=>{if(!j&&!c.has(b.id))return null;if(b.id===Cn)return r;const N=d.get(b.id);if(!N)return null;const A=N.Component;return o.jsx(Gr,{label:`${e}:${N.pluginName}`,children:o.jsx(A,{...t})})}})]}):o.jsx(o.Fragment,{children:r})}function lu({op:e,id:t,focusSection:n=null}){var y;const{document:r}=Xa(),s=x.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)?(y=u.find(b=>b.bindings))==null?void 0:y.bindings:void 0),m=e.action===Er.SEND,g=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,j)=>o.jsx(eu,{message:b,messageId:b.name,i:j},j))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(cu,{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)&&yt(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(Hr,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(at,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(Xx,{operationId:t}),t&&o.jsx(Fn,{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(Kn,{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(Vo,{securities:f})})})]}),p&&Object.entries(p).map(([b,j])=>j?o.jsxs("div",{id:`operation-${t}-bindings-${b}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Zl,{protocol:b,bindings:j,focused:n===`binding:${b}`})]},b):null),l?o.jsx(ix,{requestMessages:i,reply:l,isSend:m,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})," ",m?"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:"]}),g]}),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((b,j)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:b.name},j))})]})]})})})}const Zx=x.lazy(()=>import("@apiuikit/ws-try-it-plugin").then(({WsHeaderButton:e})=>({default:e})));function uu({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(wt,{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(wt,{method:e.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Et,{address:n.address,parameters:n.parameters,truncate:!0,peek:!0})})]}):o.jsx(o.Fragment,{children:t})}function du({operationKey:e}){const t=it(),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(Gr,{label:"built-in:asyncapi.operation.tryIt",children:o.jsx(Zx,{document:n,operationId:e})})})}function fu({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,A;const f=e[d],p=f.channel,m=p==null?void 0:p.address,g=p==null?void 0:p.parameters,y=((N=f.action)==null?void 0:N.toUpperCase())??"",b=((A=f.title)==null?void 0:A.trim())||void 0,j=t===d;return o.jsxs("tr",{id:`operation-${d}`,onClick:()=>i(d),role:"button",tabIndex:0,"aria-label":`${y||"Operation"} ${b??m??d}`,"aria-current":j?"true":void 0,onKeyDown:$=>{$.key!=="Enter"&&$.key!==" "||($.preventDefault(),i(d))},className:`cursor-pointer hover:bg-neutral-50 ${j?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:b?o.jsx("div",{className:"truncate text-sm font-medium text-foreground",title:m??void 0,children:b}):m&&o.jsx(Et,{address:m,parameters:g,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(wt,{method:f.action,className:"w-24"})})]},d)}),u=a&&t?o.jsx(uu,{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(nt,{title:xd,content:l,stickySideContent:!1,layout:s})}),o.jsx(ql,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,headerActions:a&&t&&o.jsx(du,{operationKey:t}),children:a&&o.jsx(lu,{op:a,id:t,focusSection:r},t)})]})}function pu({schemaName:e,resolved:t,anchorId:n,selected:r=!1,focusTarget:s=null}){const i=t.schema,a=$c(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"," ",Ic(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(_l,{schema:t.originalSchema})}):o.jsx(Go,{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 Jo({schemas:e,selectedKey:t,focusTarget:n,layout:r}){const{deref:s}=De(),i=Ur(),a=x.useMemo(()=>Object.entries(e).map(([u,l])=>[u,ln(l,s)]),[e,s,i]),c=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([u,l])=>o.jsx(pu,{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(nt,{content:c,stickySideContent:!1,layout:r})})}const Qx=e=>e==="operations"||e==="messages"||e==="schemas",qx=(e,t)=>{switch(e){case"messages":return`message-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`operation-${t}`}};function e0({asyncapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var E,S,M,W;const i=t.show??{},[a,c]=x.useState(!1),[u,l]=x.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&Nl(e.info),p=(n==null?void 0:n.some(Q=>!!Q.slots["asyncapi.document.topbar"]))??!1,m=d||f||p,g=[...i.operations!==!1?[{id:"operations",name:"Operations",icon:zr}]:[],...i.messages!==!1?[{id:"messages",name:"Messages",icon:dc}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:mo}]:[]],{query:y,setQuery:b,results:j}=ep(e,{threshold:.3,limit:20}),{effectiveTab:N,focusTab:A,navActiveSection:$,selected:F,setSelectedKey:G,selectedNavItem:T,handleSearchSelect:v,handleNavItemSelect:w,handleNavServerSelect:_,handleContentTabChange:L,focusSection:U,schemaFocusTarget:P}=Cc({tabs:g,defaultTab:"operations",isTabKey:Qx,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:y,initialLocation:r,onLocationChange:s,getTargetId:qx}),X=e.servers?Object.keys(e.servers):[],ie=N==="operations"?o.jsx(fu,{operations:e.operations??{},selectedKey:F.operations,onSelectKey:Q=>G("operations",Q),focusSection:U}):N==="messages"?o.jsx(Wl,{messages:((E=e.components)==null?void 0:E.messages)??{},selectedKey:F.messages,focusSection:U}):N==="schemas"?o.jsx(Jo,{schemas:((S=e.components)==null?void 0:S.schemas)??{},selectedKey:F.schemas,focusTarget:P}):null;return o.jsx(Fr,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[m&&o.jsxs(oc,{logo:f?o.jsx(Ho,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Fn,{name:"asyncapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(pc,{query:y,onQueryChange:b,results:j,onSelectResult:v,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(xc,{serialize:Q=>Ao(e,Q),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Cl,{...e.info,showLogo:!1})}),i.servers!==!1&&X.length>0&&o.jsx("div",{id:`server-${F.servers??X[0]}`,children:o.jsx(Ql,{servers:e.servers,selectedServer:F.servers,onSelectServer:Q=>G("servers",Q),focusSection:U})}),o.jsx(sc,{tabs:g,current:N,onChange:L}),N&&o.jsx("div",{id:`panel-${N}`,role:"tabpanel","aria-labelledby":`tab-${N}`,children:o.jsx(Ft,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:ie},`${N}-${F.operations}-${F.messages}-${F.schemas}`)}),i.sidebar!==!1&&o.jsx(qd,{operations:i.operations!==!1?e.operations:void 0,messages:i.messages!==!1?(M=e.components)==null?void 0:M.messages:void 0,schemas:i.schemas!==!1?(W=e.components)==null?void 0:W.schemas:void 0,servers:i.servers!==!1?e.servers:void 0,hasInfo:i.info!==!1,sidebarConfig:t.sidebar,activeTab:$,onTabChange:A,onItemSelect:w,onSelectServer:_,selectedItem:T})]})})}const Yo=e=>o.jsx(Ft,{resetKey:e.asyncapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(t0,{...e})}),t0=e=>{const t=e.asyncapi,n=x.useMemo(()=>fn(t),[t]),r=e.kind;x.useEffect(()=>{r==="resolved"&&n!==t&&uo(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??Rt;return o.jsx(e0,{asyncapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Qr({document:e,config:t=Rt,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=tc("openapi",e,t,n);return o.jsx(zt.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 n0(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:Ve([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:Ve([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 hn){const m=f[p];if(!m)continue;const g=`${p} ${d}`,y=m.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${c}-${g}`,targetId:`${c}-${g}-detail`,type:a,tab:i,key:g,name:y,path:`${u}.${d}.${p}`,location:`${l} > ${p.toUpperCase()} ${d}`,subtitle:m.description,text:Ve([p,d,m.summary,m.description,m.operationId,m.tags,m.parameters,m.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=xo(e.components.schemas,Bt(e));for(const[i,a]of Object.entries(e.components.schemas))yc(t,a,i,i,s)}return t}function r0(e,t={}){return Nc(e,n0,t)}function hu({info:e,tags:t,externalDocs:n,layout:r,showLogo:s}){const{title:i,description:a,license:c,contact:u}=e??{};return o.jsx(Tl,{title:i,description:a,license:c,contact:u,externalDocs:n,tags:t,extensionsSource:e,layout:r,showLogo:s})}function s0({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(Vl,{address:e,variables:n}),t&&o.jsx(at,{children:t})]})}const Ts=e=>`server-${e}`,Cs=e=>Number(e.slice(7));function mu({servers:e,selectedServer:t,onSelectServer:n,layout:r}){const s=e.map((p,m)=>p.url||Ts(m)),[i,a]=x.useState(void 0),c=p=>!!p&&Cs(p)>=0&&Cs(p)<e.length,u=c(t)?t:c(i)?i:Ts(0),l=e[Cs(u)],d=p=>{a(p),n==null||n(p)},f=l?o.jsx(s0,{...l}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{title:Qa,content:f,sideContent:o.jsx(Gl,{serverNames:s,current:(l==null?void 0:l.url)||u,setCurrent:p=>{const m=s.indexOf(p);d(m>=0?Ts(m):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:r})})}function o0({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 gu(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function i0(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${gu(`$${n}`)}}`)}function a0(e){return e.operationId??e.operationRef??null}const c0=e=>e.trim().replace(/[.:;]+$/,""),_s=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function l0({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=a0(s),a=Object.entries(s.parameters??{}),c=s.description?c0(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(o0,{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],m)=>o.jsxs(x.Fragment,{children:[m>0&&(m===a.length-1?" and ":", "),o.jsx(_s,{children:f})," from ",o.jsx(_s,{children:gu(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(_s,{children:s.server.url})]}):null,"."]})]},r)})})}function u0(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>hn.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function d0({callbacks:e,id:t,renderOperation:n,depth:r}){const s=u0(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(Kn,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(wt,{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:i0(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 f0=x.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-BByLudCp.cjs")).then(({CodeSamples:e})=>({default:e})));function p0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function xu({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 bu(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 h0(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 m0({responses:e,onFollowOperation:t,isOperationKnown:n}){var G,T;const r=Object.keys(e),[s,i]=x.useState(r[0]),a=e[s],c=Object.keys((a==null?void 0:a.content)??{}),[u,l]=x.useState(c[0]),d=u?(G=a==null?void 0:a.content)==null?void 0:G[u]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[m,g]=x.useState("body"),y=c.length>0&&!!d,b=Object.keys(f).length>0,j=Object.keys(p).length>0,N=[...y?[{id:"body",name:"Body"}]:[],...b?[{id:"headers",name:"Headers"}]:[]],A=N.length>1,$=N.some(v=>v.id===m)?m:(T=N[0])==null?void 0:T.id,F=N.length>0;return x.useEffect(()=>{l(Object.keys((a==null?void 0:a.content)??{})[0]),g("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 ${h0(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}),F?o.jsxs(o.Fragment,{children:[A&&o.jsx(Ht,{tabs:N,current:$,onChange:v=>g(v)}),o.jsx("div",{className:A?"mt-4":void 0,children:$==="headers"?o.jsx(Dt,{schema:x0(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(Dt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(xu,{prefix:"Body",mediaTypes:c,selected:u,onChange:l}),rootName:"Body",example:bu(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&o.jsx(l0,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function yu(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 g0=e=>yu(e),x0=e=>yu(Object.entries(e).map(([t,n])=>({name:t,...n})));function b0({parameters:e}){var c;const t=wd.filter(({location:u})=>e.some(l=>l.in===u)),[n,r]=x.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=g0(e.filter(u=>u.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(Ht,{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(Dt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function y0({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[c,u]=x.useState(s?"parameters":"body"),[l,d]=x.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(m=>m.in==="header")?"headers":null,t.some(m=>m.in==="cookie")?"cookie":null].filter(m=>!!m);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 ",w0(p),":"]}),s&&a&&o.jsx(Ht,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:c,onChange:m=>u(m)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(c==="parameters"||!a)&&s&&o.jsx(b0,{parameters:t}),(c==="body"||!s)&&a&&f&&o.jsx(Dt,{schema:f.schema??{},label:o.jsx(xu,{prefix:"Request Body",mediaTypes:i,selected:l,onChange:d}),rootName:"Body ",description:r,example:bu(f)})]})]})}function w0(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 k0({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,m=!!i&&Object.keys(i).length>0&&c<v0,g=[...f?["request"]:[],...p?["response"]:[],...m?["callbacks"]:[]],[y,b]=x.useState(g[0]??"request");if(g.length===0)return null;const j=g.includes(y)?y:g[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:g.map(N=>o.jsx("button",{role:"tab","aria-selected":j===N,onClick:()=>b(N),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===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:[j==="request"&&o.jsx(y0,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&o.jsx(m0,{responses:s,onFollowOperation:l,isOperationKnown:d}),j==="callbacks"&&i&&o.jsx(d0,{callbacks:i,id:a,depth:c,renderOperation:Xo})]})]})}const v0=1;function Xo({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:c,isOperationKnown:u,depth:l=0}){var A,$,F,G;const{document:d}=Za(),f=(n.parameters??[]).filter(T=>T.in!=="query"&&T.in!=="path"),p=n.security??i??[],m=n.responses??{},g=((A=n.requestBody)==null?void 0:A.content)??{},y=n.operationId?p0(n.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const T of p)for(const[v,w]of Object.entries(T)){if(w.length===0)continue;const _=b.get(v)??[];b.set(v,Array.from(new Set([..._,...w])))}const j=Array.from(new Set(p.flatMap(T=>Object.keys(T)))).map(T=>{const v=a==null?void 0:a[T];if(!v)return null;const w=b.get(T);return w?{...v,requiredScopes:w}:v}).filter(T=>!!T),N=l===0;return o.jsx("div",{className:`flex flex-col gap-6 ${N?"min-h-full":""}`,id:`${s}-${r}-detail`,children:o.jsx(cu,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:N,children:o.jsxs(o.Fragment,{children:[(n.deprecated||(($=n.externalDocs)==null?void 0:$.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"}),((F=n.externalDocs)==null?void 0:F.url)&&yt(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(Hr,{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(at,{children:n.description}),o.jsx(x.Suspense,{fallback:null,children:o.jsx(f0,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:p,id:r})}),o.jsx(Fn,{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"}),j.length>0&&o.jsx(Kn,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Kl,{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:j.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Vo,{securities:j})})})]}),o.jsx(k0,{label:y,parameters:f,requestBodyContent:g,requestBodyDescription:(G=n.requestBody)==null?void 0:G.description,responses:m,callbacks:n.callbacks,id:r,depth:l,fillHeight:N,onFollowOperation:c,isOperationKnown:u})]})})})}const Wa=320;function j0({parameters:e}){const{portalHost:t}=De(),[n,r]=x.useState(!1),[s,i]=x.useState({top:0,left:0,placement:"bottom"}),a=x.useRef(null),c=x.useRef(null),u=x.useId();return x.useEffect(()=>{if(!n)return;const l=a.current;if(!l)return;const d=()=>i(Is(l,{align:"end",width:Wa}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n]),x.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 m;const p=((m=f.composedPath)==null?void 0:m.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&&an.createPortal(o.jsxs("div",{ref:c,id:u,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:Wa},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:ic(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 wu(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 ku(e){const t={};for(const n of e)t[n.name]=wu(n);return t}function S0(e){return e.filter(t=>t.in==="query").map(t=>({...wu(t),name:t.name,required:t.required}))}const A0=x.lazy(()=>import("@apiuikit/openapi-try-it-plugin").then(({TryItHeaderButton:e})=>({default:e})));function vu({method:e,path:t,parameters:n}){return o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(wt,{method:e}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Et,{address:t,parameters:ku(n),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(j0,{parameters:S0(n)})]})}function ju({method:e,path:t}){const n=it(),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(Gr,{label:"built-in:openapi.operation.tryIt",children:o.jsx(A0,{document:r,method:e,path:t})})})}function Br({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:c}){var G;const u=T=>s==null?void 0:s(T),l=x.useMemo(()=>cn(e),[e]),d=x.useMemo(()=>{var v,w,_;const T=new Map;for(const L of l){const U=((_=(w=(v=e[L.path])==null?void 0:v[L.method])==null?void 0:w.tags)==null?void 0:_[0])||"Other",P=T.get(U)??[];P.push(L),T.set(U,P)}return Array.from(T,([L,U])=>({label:L,items:U}))},[l,e]),[f,p]=x.useState(()=>new Set),m=f.size===0;x.useEffect(()=>{if(!r)return;const T=d.find(({items:v})=>v.some(({key:w})=>w===r));T&&p(v=>{if(!v.has(T.label))return v;const w=new Set(v);return w.delete(T.label),w})},[d,r]);const g=x.useMemo(()=>{var v,w;const T=new Map;for(const{key:_,method:L,path:U}of l){const P=(w=(v=e[U])==null?void 0:v[L])==null?void 0:w.operationId;P&&T.set(P,_)}return T},[l,e]);if(l.length===0)return null;const y=r?l.find(T=>T.key===r):null,b=y?(G=e[y.path])==null?void 0:G[y.method]:null,j=({key:T,method:v,path:w},_)=>{var P;const L=r===T,U=Ms(e[w],(P=e[w])==null?void 0:P[v]);return o.jsxs("tr",{id:`${a}-${T}`,onClick:()=>u(T),role:"button",tabIndex:_?0:-1,"aria-hidden":!_,"aria-label":`${v.toUpperCase()} ${w}`,"aria-current":L?"true":void 0,onKeyDown:X=>{X.key!=="Enter"&&X.key!==" "||(X.preventDefault(),u(T))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${_?`cursor-pointer opacity-100 visible ${L?"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(Et,{address:w,parameters:ku(U),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(wt,{method:v,className:"w-20"})})})]},T)},N=d.map(({label:T,items:v},w)=>{const _=!f.has(T),L=`${a}-group-${w}-${T.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(x.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":`${T} endpoints (${v.length})`,"aria-expanded":_,"aria-controls":L,onClick:()=>p(U=>{const P=new Set(U);return _?P.add(T):P.delete(T),P}),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(pn,{className:"h-2.5 w-2.5"}):o.jsx(Jl,{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:T}),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:L,"aria-hidden":!_,className:`bg-surface ${_?"divide-y divide-border":""}`,children:v.map(U=>j(U,_))})]},T)}),A=Ms(y?e[y.path]:void 0,b),$=y?o.jsx(vu,{method:y.method,path:y.path,parameters:A}):r,F=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:m,onChange:T=>p(T.target.checked?new Set:new Set(d.map(({label:v})=>v))),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),p(m?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(nt,{content:F,stickySideContent:!1,layout:c})}),o.jsx(ql,{isOpen:!!y,side:"right",onClose:()=>u(null),title:$,headerActions:y&&o.jsx(ju,{method:y.method,path:y.path}),children:y&&b&&o.jsx(Ft,{resetKey:b,fallback:o.jsx("p",{role:"alert",children:"This operation could not be rendered. Select another operation to continue."}),children:o.jsx(Xo,{method:y.method,path:y.path,op:{...b,parameters:A},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:T=>g.has(T),onFollowOperation:T=>{const v=g.get(T);v&&u(v)}},y.key)},y.key)})]})}const E0=e=>e==="endpoints"||e==="webhooks"||e==="schemas",N0=(e,t)=>{switch(e){case"webhooks":return`webhook-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`endpoint-${t}`}};function T0({openapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var S,M,W,Q;const i=t.show??{},[a,c]=x.useState(!1),[u,l]=x.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&Nl(e.info),p=(n==null?void 0:n.some(ne=>!!ne.slots["openapi.document.topbar"]))??!1,m=d||f||p,g=e.webhooks??{},y=Object.keys(g).length>0,b=[...i.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:zr}]:[],...y&&i.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:go}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:mo}]:[]],{query:j,setQuery:N,results:A}=r0(e,{threshold:.3,limit:20}),{effectiveTab:$,focusTab:F,navActiveSection:G,selected:T,setSelectedKey:v,selectedNavItem:w,handleSearchSelect:_,handleNavItemSelect:L,handleNavServerSelect:U,handleContentTabChange:P,schemaFocusTarget:X}=Cc({tabs:b,defaultTab:"endpoints",isTabKey:E0,sections:[{id:"endpoints",visible:i.endpoints!==!1},{id:"webhooks",visible:y&&i.webhooks!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:j,initialLocation:r,onLocationChange:s,getTargetId:N0}),ie=(e.servers??[]).map(ne=>ne.url),E=$==="endpoints"?o.jsx(Br,{paths:e.paths??{},security:e.security,securitySchemes:(S=e.components)==null?void 0:S.securitySchemes,selectedKey:T.endpoints,onSelectKey:ne=>v("endpoints",ne)}):$==="webhooks"?o.jsx(Br,{paths:g,security:e.security,securitySchemes:(M=e.components)==null?void 0:M.securitySchemes,selectedKey:T.webhooks,onSelectKey:ne=>v("webhooks",ne),columnLabel:"Webhook",idPrefix:"webhook"}):$==="schemas"?o.jsx(Jo,{schemas:((W=e.components)==null?void 0:W.schemas)??{},selectedKey:T.schemas,focusTarget:X}):null;return o.jsx(Qr,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[m&&o.jsxs(oc,{logo:f?o.jsx(Ho,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Fn,{name:"openapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(pc,{query:j,onQueryChange:N,results:A,onSelectResult:_,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(xc,{serialize:ne=>Eo(e,ne),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(hu,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),i.servers!==!1&&ie.length>0&&o.jsx("div",{id:T.servers??"server-0",children:o.jsx(mu,{servers:e.servers,selectedServer:T.servers,onSelectServer:ne=>v("servers",ne)})}),o.jsx(sc,{tabs:b,current:$,onChange:P}),$&&o.jsx("div",{id:`panel-${$}`,role:"tabpanel","aria-labelledby":`tab-${$}`,children:o.jsx(Ft,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:E},`${$}-${T.endpoints}-${T.webhooks}-${T.schemas}`)}),i.sidebar!==!1&&o.jsx(nf,{paths:i.endpoints!==!1?e.paths:void 0,webhooks:y&&i.webhooks!==!1?g:void 0,schemas:i.schemas!==!1?(Q=e.components)==null?void 0:Q.schemas:void 0,servers:i.servers!==!1?ie:void 0,hasInfo:i.info!==!1,activeTab:G,onTabChange:F,onItemSelect:L,onSelectServer:U,selectedItem:w})]})})}const Zo=e=>o.jsx(Ft,{resetKey:e.openapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(C0,{...e})}),C0=e=>{const t=e.openapi,n=x.useMemo(()=>fn(t),[t]),r=e.kind;x.useEffect(()=>{r==="resolved"&&n!==t&&uo(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??Rt;return o.jsx(T0,{openapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Su(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 on=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
|
|
181
181
|
`)[0])==null?void 0:n.trim())||void 0},_0=e=>hn.some(t=>t===e),$0=Su({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 on((t=e.info)==null?void 0:t.description)},targets:e=>cn(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:on(s==null?void 0:s.summary)??on(s==null?void 0:s.description),target:{kind:"operation",document:e,method:n,path:r}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Eo(e);if(typeof t.path!="string"||!_0(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return Dc(e,t.method,t.path)}}),I0=Su({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 on((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:on(n==null?void 0:n.summary)??on(n==null?void 0:n.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Ao(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return Lc(e,t.id)}}),Ga=[$0,I0];function Qo(e){const t=typeof e=="object"&&e!==null?e:{},n=Ga.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: ${Ga.map(r=>r.name).join(", ")}.`);return n}function Au(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function O0(e){return Qo(e).targets(e)}function M0(e,t){const n=Qo(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return n.toMarkdown(e,t)}function R0(e,t={}){const n=Qo(e),{baseUrl:r,url:s,optional:i}=t,a=(r==null?void 0:r.replace(/\/+$/,""))??"",u=s??(p=>`${a}/${Au(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:m}of f)l.push(`- [${p.label}](${m})${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(`
|
|
182
|
-
`)}function Eu(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 L0=["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 P0(){return{validate:B0,parse:F0,getMimeTypes:()=>L0}}function D0(e){Eu(e,P0(),Dn)}function B0(e){return So(e.data).map(t=>({message:t,path:e.path}))}function F0(e){var n,r;const t=So(e.data);if(t.length>0)return{[$r]:t[0]};try{const s=Vs(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=Vs(a)),s}catch(s){return{[$r]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function z0(){try{const e=await Promise.resolve().then(()=>require("./index-BjVWe_rQ.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 Nu(e){try{const t=await z0(),n=new t;D0(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-Cbb8hQnz.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e,{validateOptions:{allowedSeverity:{error:!0}}});return{diagnostics:i,document:s?U0(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function H0(e,t){const{diagnostics:n,document:r}=await Nu(e);return{diagnostics:n,view:r?o.jsx(Yo,{kind:"resolved",asyncapi:r,config:t}):null}}function U0(e){return e.json()}function W0({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=x.useState(null),d=x.useRef(r);return d.current=r,x.useEffect(()=>{let f=!0;return Nu(e).then(({document:p,diagnostics:m})=>{var g;f&&(l(p),(g=d.current)==null||g.call(d,m))}),()=>{f=!1}},[e]),u?o.jsx(Yo,{kind:"resolved",asyncapi:u,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}async function G0(){try{return await Promise.resolve().then(()=>require("./index-Djr20zD8.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 K0=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],Ka=(e,t)=>({message:e.message,path:K0(e.path),severity:t}),Va=new Set(["must have required property '$ref'","must match exactly one schema in oneOf"]),V0=(e,t)=>e.length>=t.length&&t.every((n,r)=>e[r]===n);function J0(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=>!Va.has(s.message));return n.filter(s=>!Va.has(s.message)||!r.some(i=>V0(i.path,s.path)))}async function Tu(e){var n;const t=[];try{const{validate:r,dereference:s,normalize:i}=await G0();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=>Ka(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=>Ka(d,l.valid?1:0)))}catch(l){t.push({message:l instanceof Error?l.message:"Validation failed",path:[],severity:0})}const u=J0(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 Y0(e,t){const{diagnostics:n,document:r}=await Tu(e);return{diagnostics:n,view:r?o.jsx(Zo,{openapi:r,config:t}):null}}function X0({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=x.useState(null),d=x.useRef(r);d.current=r,x.useEffect(()=>{let p=!0;return Tu(e).then(m=>{var g;p&&(l(m),(g=d.current)==null||g.call(d,m.diagnostics))}),()=>{p=!1}},[e]);const f=u==null?void 0:u.document;return f?o.jsx(Zo,{openapi:f,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}function Cu({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 Z0({operationKey:e,op:t,layout:n}){return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{stickySideContent:!1,layout:n,topSpacing:!1,bottomSpacing:!1,content:o.jsx(Cu,{title:o.jsx(uu,{op:t,operationKey:e}),headerActions:o.jsx(du,{operationKey:e}),children:o.jsx(lu,{op:t,id:e})})})})}function Q0({messageKey:e,message:t,layout:n}){const[r,s]=x.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(Ko,{message:t,expanded:r,onToggleExpanded:()=>s(c=>!c),paddingX:"px-6"})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:a,stickySideContent:!1,layout:n,topSpacing:!1,bottomSpacing:!1})})}const pt="apiuikit-root--transparent";function _u(e,t,n){return function({document:s,config:i,plugins:a,className:c,children:u}){const l=x.useContext(zt),d=x.useMemo(()=>s?fn(s):null,[s]),f=!!l&&l.specType!==n;if(x.useEffect(()=>{f&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${l.specType} document provider, which cannot supply the document it needs. `+(d?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[l,f,d]),l&&!f)return o.jsx(o.Fragment,{children:u});if(!d){if(l)return o.jsx(o.Fragment,{children:u});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:d,config:i,plugins:a,className:c,children:u})}}function Xn(e,t){x.useEffect(()=>{e&&console.warn(`[apiuikit] ${t}`)},[e,t])}function q0({document:e,config:t,plugins:n,children:r}){const s=x.useMemo(()=>fn(e),[e]);return o.jsx(Fr,{document:s,config:t,plugins:n,children:r})}const gn=_u(Fr,"AsyncAPI","asyncapi");function xn(){const e=De();return e.specType==="asyncapi",e.document}function eb({layout:e}){const t=xn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Ql,{servers:t.servers,layout:e})}function tb({layout:e,...t}){return o.jsx(gn,{...t,children:o.jsx(eb,{layout:e})})}function nb({layout:e}){const t=xn(),[n,r]=x.useState(null);return o.jsx(fu,{operations:t.operations??{},selectedKey:n,onSelectKey:r,layout:e})}function rb({layout:e,...t}){return o.jsx(gn,{...t,className:pt,children:o.jsx(nb,{layout:e})})}function sb({operationId:e,layout:t}){var s;const r=(s=xn().operations)==null?void 0:s[e];return Xn(!r,`AsyncAPIOperation: no operation "${e}" in this document.`),r?o.jsx(Z0,{operationKey:e,op:r,layout:t}):null}function ob({operationId:e,layout:t="stacked",...n}){return o.jsx(gn,{...n,className:pt,children:o.jsx(sb,{operationId:e,layout:t})})}function ib({layout:e}){var n;const t=xn();return o.jsx(Wl,{messages:((n=t.components)==null?void 0:n.messages)??{},layout:e})}function ab({layout:e,...t}){return o.jsx(gn,{...t,className:pt,children:o.jsx(ib,{layout:e})})}function cb({messageId:e,layout:t}){var s,i;const r=(i=(s=xn().components)==null?void 0:s.messages)==null?void 0:i[e];return Xn(!r,`AsyncAPIMessage: no message "${e}" in components.messages.`),r?o.jsx(Q0,{messageKey:e,message:r,layout:t}):null}function lb({messageId:e,layout:t="stacked",...n}){return o.jsx(gn,{...n,className:pt,children:o.jsx(cb,{messageId:e,layout:t})})}function ub({layout:e}){const t=xn();return t.info?o.jsx(Cl,{...t.info,layout:e}):null}function db({layout:e,...t}){return o.jsx(gn,{...t,children:o.jsx(ub,{layout:e})})}const fb=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function pb({layout:e}){var r,s;const t=x.useContext(zt),n=((s=(r=t==null?void 0:t.document)==null?void 0:r.components)==null?void 0:s.schemas)??{};return o.jsx(Jo,{schemas:n,layout:e})}function $u({document:e,config:t,plugins:n,sectionName:r,className:s,children:i}){const a=x.useContext(zt),c=x.useMemo(()=>e?fn(e):null,[e]);if(a)return o.jsx(o.Fragment,{children:i});if(!c)throw new Error(`The ${r} section needs a \`document\` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.`);return fb(c)?o.jsx(Qr,{document:c,config:t,plugins:n,className:s,children:i}):o.jsx(Fr,{document:c,config:t,plugins:n,className:s,children:i})}function qo({layout:e,...t}){return o.jsx($u,{...t,sectionName:"Schemas",className:pt,children:o.jsx(pb,{layout:e})})}function hb({name:e,layout:t}){var c,u,l;const n=x.useContext(zt),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=Ur(),a=x.useMemo(()=>s&&r?ln(s,r):null,[s,r,i]);return Xn(!s,`Schema: no schema "${e}" in components.schemas.`),a?o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:o.jsx(pu,{schemaName:e,resolved:a}),stickySideContent:!1,layout:t,topSpacing:!1,bottomSpacing:!1})}):null}function mb({name:e,layout:t="stacked",...n}){return o.jsx($u,{...n,sectionName:"Schema",className:pt,children:o.jsx(hb,{name:e,layout:t})})}const gb=qo,xb=qo;function Iu({method:e,path:t,pathItem:n,paths:r,security:s,securitySchemes:i,idPrefix:a="endpoint",onNavigate:c,layout:u}){const l=n[e],d=Ms(n,l),f=x.useMemo(()=>{var g,y;const m=new Set;for(const b of cn(r)){const j=(y=(g=r[b.path])==null?void 0:g[b.method])==null?void 0:y.operationId;j&&m.add(j)}return m},[r]);if(!l)return null;const p=fc(e,t);return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{stickySideContent:!1,layout:u,topSpacing:!1,bottomSpacing:!1,content:o.jsx(Cu,{title:o.jsx(vu,{method:e,path:t,parameters:d}),headerActions:o.jsx(ju,{method:e,path:t}),children:o.jsx(Xo,{method:e,path:t,op:{...l,parameters:d},id:p,idPrefix:a,globalSecurity:s,securitySchemes:i,isOperationKnown:m=>!!c&&f.has(m),onFollowOperation:c})})})})}function bb(e,t){if("operationId"in t){for(const[s,i]of Object.entries(e)){if(!i)continue;const a=hn.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 yb(e){return"operationId"in e?`operationId "${e.operationId}"`:`${e.method.toUpperCase()} ${e.path}`}function wb({document:e,config:t,plugins:n,children:r}){const s=x.useMemo(()=>fn(e),[e]);return o.jsx(Qr,{document:s,config:t,plugins:n,children:r})}const bn=_u(Qr,"OpenAPI","openapi");function yn(){const e=it();return e.specType==="openapi",e.document}function kb({layout:e}){const t=yn();return!t.servers||t.servers.length===0?null:o.jsx(mu,{servers:t.servers,layout:e})}function vb({layout:e,...t}){return o.jsx(bn,{...t,children:o.jsx(kb,{layout:e})})}function jb({layout:e}){var s;const t=yn(),[n,r]=x.useState(null);return o.jsx(Br,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:n,onSelectKey:r,layout:e})}function Sb({layout:e,...t}){return o.jsx(bn,{...t,className:pt,children:o.jsx(jb,{layout:e})})}function Ab({layout:e}){var i;const t=yn(),[n,r]=x.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Br,{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 Eb({layout:e,...t}){return o.jsx(bn,{...t,className:pt,children:o.jsx(Ab,{layout:e})})}function Nb({selector:e,onNavigate:t,layout:n}){var a;const r=yn(),s=x.useMemo(()=>r.paths??{},[r.paths]),i=bb(s,e);return Xn(!i,`OpenAPIEndpoint: no endpoint with ${yb(e)} in this document.`),i?o.jsx(Iu,{...i,paths:s,security:r.security,securitySchemes:(a=r.components)==null?void 0:a.securitySchemes,onNavigate:t,layout:n}):null}function Tb(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(bn,{document:t,config:n,plugins:r,className:pt,children:o.jsx(Nb,{selector:a,onNavigate:i,layout:s})})}function Cb({name:e,method:t,onNavigate:n,layout:r}){var l;const s=yn(),i=x.useMemo(()=>s.webhooks??{},[s.webhooks]),a=i[e],c=t?t.toLowerCase():a&&hn.find(d=>a[d]),u=a&&c&&a[c];return Xn(!u,`OpenAPIWebhook: no webhook "${e}"${t?` with method ${t.toUpperCase()}`:""} in this document.`),!u||!a||!c?null:o.jsx(Iu,{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 _b({name:e,method:t,onNavigate:n,layout:r="stacked",...s}){return o.jsx(bn,{...s,className:pt,children:o.jsx(Cb,{name:e,method:t,onNavigate:n,layout:r})})}function $b({layout:e}){const t=yn();return t.info?o.jsx(hu,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function Ib({layout:e,...t}){return o.jsx(bn,{...t,children:o.jsx($b,{layout:e})})}exports.AsyncAPI=Yo;exports.AsyncAPIInfo=db;exports.AsyncAPIMessage=lb;exports.AsyncAPIMessages=ab;exports.AsyncAPIOperation=ob;exports.AsyncAPIOperations=rb;exports.AsyncAPIProvider=q0;exports.AsyncAPIRenderer=W0;exports.AsyncAPISchemas=gb;exports.AsyncAPIServers=tb;exports.CodeBlock=Xr;exports.ErrorBoundary=Ft;exports.OpenAPI=Zo;exports.OpenAPIEndpoint=Tb;exports.OpenAPIEndpoints=Sb;exports.OpenAPIInfo=Ib;exports.OpenAPIProvider=wb;exports.OpenAPIRenderer=X0;exports.OpenAPISchemas=xb;exports.OpenAPIServers=vb;exports.OpenAPIWebhook=_b;exports.OpenAPIWebhooks=Eb;exports.PluginSlot=Fn;exports.Schema=mb;exports.SchemaTabs=Dt;exports.SchemaTree=Go;exports.Schemas=qo;exports.X_LIB_CONVERSION_ERROR=$r;exports.asyncApiOperationToMarkdown=Lc;exports.asyncApiToMarkdown=Ao;exports.commonjsGlobal=gh;exports.defaultConfig=Rt;exports.documentToLlmsTxt=R0;exports.documentToMarkdown=M0;exports.ensureHljsLanguage=au;exports.getAugmentedNamespace=xh;exports.getDefaultExportFromCjs=rl;exports.hljsLanguageForTarget=iu;exports.isHljsLanguageReady=Dr;exports.isProtobufSchemaFormat=Bn;exports.listDocumentTargets=O0;exports.markdownForLlm=gc;exports.openApiEndpointToMarkdown=Dc;exports.openApiToMarkdown=Eo;exports.parseAndRender=H0;exports.parseAndRender$1=Y0;exports.registerSchemaParserWithFallback=Eu;exports.resolveLogo=No;exports.targetSlug=Au;exports.useAsyncAPIDocument=De;exports.useAsyncAPIDocumentContext=Xa;exports.useDocumentContext=it;exports.useOpenAPIDocumentContext=Za;exports.useOperationTabPlugins=zc;exports.usePluginSlot=Fc;
|
|
182
|
+
`)}function Eu(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 L0=["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 P0(){return{validate:B0,parse:F0,getMimeTypes:()=>L0}}function D0(e){Eu(e,P0(),Dn)}function B0(e){return So(e.data).map(t=>({message:t,path:e.path}))}function F0(e){var n,r;const t=So(e.data);if(t.length>0)return{[$r]:t[0]};try{const s=Vs(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=Vs(a)),s}catch(s){return{[$r]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function z0(){try{const e=await Promise.resolve().then(()=>require("./index-CGrSsmLt.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 Nu(e){try{const t=await z0(),n=new t;D0(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-BnzKesB3.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e,{validateOptions:{allowedSeverity:{error:!0}}});return{diagnostics:i,document:s?U0(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function H0(e,t){const{diagnostics:n,document:r}=await Nu(e);return{diagnostics:n,view:r?o.jsx(Yo,{kind:"resolved",asyncapi:r,config:t}):null}}function U0(e){return e.json()}function W0({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=x.useState(null),d=x.useRef(r);return d.current=r,x.useEffect(()=>{let f=!0;return Nu(e).then(({document:p,diagnostics:m})=>{var g;f&&(l(p),(g=d.current)==null||g.call(d,m))}),()=>{f=!1}},[e]),u?o.jsx(Yo,{kind:"resolved",asyncapi:u,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}async function G0(){try{return await Promise.resolve().then(()=>require("./index-Bm-tkvJB.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 K0=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],Ka=(e,t)=>({message:e.message,path:K0(e.path),severity:t}),Va=new Set(["must have required property '$ref'","must match exactly one schema in oneOf"]),V0=(e,t)=>e.length>=t.length&&t.every((n,r)=>e[r]===n);function J0(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=>!Va.has(s.message));return n.filter(s=>!Va.has(s.message)||!r.some(i=>V0(i.path,s.path)))}async function Tu(e){var n;const t=[];try{const{validate:r,dereference:s,normalize:i}=await G0();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=>Ka(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=>Ka(d,l.valid?1:0)))}catch(l){t.push({message:l instanceof Error?l.message:"Validation failed",path:[],severity:0})}const u=J0(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 Y0(e,t){const{diagnostics:n,document:r}=await Tu(e);return{diagnostics:n,view:r?o.jsx(Zo,{openapi:r,config:t}):null}}function X0({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=x.useState(null),d=x.useRef(r);d.current=r,x.useEffect(()=>{let p=!0;return Tu(e).then(m=>{var g;p&&(l(m),(g=d.current)==null||g.call(d,m.diagnostics))}),()=>{p=!1}},[e]);const f=u==null?void 0:u.document;return f?o.jsx(Zo,{openapi:f,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}function Cu({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 Z0({operationKey:e,op:t,layout:n}){return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{stickySideContent:!1,layout:n,topSpacing:!1,bottomSpacing:!1,content:o.jsx(Cu,{title:o.jsx(uu,{op:t,operationKey:e}),headerActions:o.jsx(du,{operationKey:e}),children:o.jsx(lu,{op:t,id:e})})})})}function Q0({messageKey:e,message:t,layout:n}){const[r,s]=x.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(Ko,{message:t,expanded:r,onToggleExpanded:()=>s(c=>!c),paddingX:"px-6"})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:a,stickySideContent:!1,layout:n,topSpacing:!1,bottomSpacing:!1})})}const pt="apiuikit-root--transparent";function _u(e,t,n){return function({document:s,config:i,plugins:a,className:c,children:u}){const l=x.useContext(zt),d=x.useMemo(()=>s?fn(s):null,[s]),f=!!l&&l.specType!==n;if(x.useEffect(()=>{f&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${l.specType} document provider, which cannot supply the document it needs. `+(d?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[l,f,d]),l&&!f)return o.jsx(o.Fragment,{children:u});if(!d){if(l)return o.jsx(o.Fragment,{children:u});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:d,config:i,plugins:a,className:c,children:u})}}function Xn(e,t){x.useEffect(()=>{e&&console.warn(`[apiuikit] ${t}`)},[e,t])}function q0({document:e,config:t,plugins:n,children:r}){const s=x.useMemo(()=>fn(e),[e]);return o.jsx(Fr,{document:s,config:t,plugins:n,children:r})}const gn=_u(Fr,"AsyncAPI","asyncapi");function xn(){const e=De();return e.specType==="asyncapi",e.document}function eb({layout:e}){const t=xn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Ql,{servers:t.servers,layout:e})}function tb({layout:e,...t}){return o.jsx(gn,{...t,children:o.jsx(eb,{layout:e})})}function nb({layout:e}){const t=xn(),[n,r]=x.useState(null);return o.jsx(fu,{operations:t.operations??{},selectedKey:n,onSelectKey:r,layout:e})}function rb({layout:e,...t}){return o.jsx(gn,{...t,className:pt,children:o.jsx(nb,{layout:e})})}function sb({operationId:e,layout:t}){var s;const r=(s=xn().operations)==null?void 0:s[e];return Xn(!r,`AsyncAPIOperation: no operation "${e}" in this document.`),r?o.jsx(Z0,{operationKey:e,op:r,layout:t}):null}function ob({operationId:e,layout:t="stacked",...n}){return o.jsx(gn,{...n,className:pt,children:o.jsx(sb,{operationId:e,layout:t})})}function ib({layout:e}){var n;const t=xn();return o.jsx(Wl,{messages:((n=t.components)==null?void 0:n.messages)??{},layout:e})}function ab({layout:e,...t}){return o.jsx(gn,{...t,className:pt,children:o.jsx(ib,{layout:e})})}function cb({messageId:e,layout:t}){var s,i;const r=(i=(s=xn().components)==null?void 0:s.messages)==null?void 0:i[e];return Xn(!r,`AsyncAPIMessage: no message "${e}" in components.messages.`),r?o.jsx(Q0,{messageKey:e,message:r,layout:t}):null}function lb({messageId:e,layout:t="stacked",...n}){return o.jsx(gn,{...n,className:pt,children:o.jsx(cb,{messageId:e,layout:t})})}function ub({layout:e}){const t=xn();return t.info?o.jsx(Cl,{...t.info,layout:e}):null}function db({layout:e,...t}){return o.jsx(gn,{...t,children:o.jsx(ub,{layout:e})})}const fb=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function pb({layout:e}){var r,s;const t=x.useContext(zt),n=((s=(r=t==null?void 0:t.document)==null?void 0:r.components)==null?void 0:s.schemas)??{};return o.jsx(Jo,{schemas:n,layout:e})}function $u({document:e,config:t,plugins:n,sectionName:r,className:s,children:i}){const a=x.useContext(zt),c=x.useMemo(()=>e?fn(e):null,[e]);if(a)return o.jsx(o.Fragment,{children:i});if(!c)throw new Error(`The ${r} section needs a \`document\` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.`);return fb(c)?o.jsx(Qr,{document:c,config:t,plugins:n,className:s,children:i}):o.jsx(Fr,{document:c,config:t,plugins:n,className:s,children:i})}function qo({layout:e,...t}){return o.jsx($u,{...t,sectionName:"Schemas",className:pt,children:o.jsx(pb,{layout:e})})}function hb({name:e,layout:t}){var c,u,l;const n=x.useContext(zt),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=Ur(),a=x.useMemo(()=>s&&r?ln(s,r):null,[s,r,i]);return Xn(!s,`Schema: no schema "${e}" in components.schemas.`),a?o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:o.jsx(pu,{schemaName:e,resolved:a}),stickySideContent:!1,layout:t,topSpacing:!1,bottomSpacing:!1})}):null}function mb({name:e,layout:t="stacked",...n}){return o.jsx($u,{...n,sectionName:"Schema",className:pt,children:o.jsx(hb,{name:e,layout:t})})}const gb=qo,xb=qo;function Iu({method:e,path:t,pathItem:n,paths:r,security:s,securitySchemes:i,idPrefix:a="endpoint",onNavigate:c,layout:u}){const l=n[e],d=Ms(n,l),f=x.useMemo(()=>{var g,y;const m=new Set;for(const b of cn(r)){const j=(y=(g=r[b.path])==null?void 0:g[b.method])==null?void 0:y.operationId;j&&m.add(j)}return m},[r]);if(!l)return null;const p=fc(e,t);return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{stickySideContent:!1,layout:u,topSpacing:!1,bottomSpacing:!1,content:o.jsx(Cu,{title:o.jsx(vu,{method:e,path:t,parameters:d}),headerActions:o.jsx(ju,{method:e,path:t}),children:o.jsx(Xo,{method:e,path:t,op:{...l,parameters:d},id:p,idPrefix:a,globalSecurity:s,securitySchemes:i,isOperationKnown:m=>!!c&&f.has(m),onFollowOperation:c})})})})}function bb(e,t){if("operationId"in t){for(const[s,i]of Object.entries(e)){if(!i)continue;const a=hn.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 yb(e){return"operationId"in e?`operationId "${e.operationId}"`:`${e.method.toUpperCase()} ${e.path}`}function wb({document:e,config:t,plugins:n,children:r}){const s=x.useMemo(()=>fn(e),[e]);return o.jsx(Qr,{document:s,config:t,plugins:n,children:r})}const bn=_u(Qr,"OpenAPI","openapi");function yn(){const e=it();return e.specType==="openapi",e.document}function kb({layout:e}){const t=yn();return!t.servers||t.servers.length===0?null:o.jsx(mu,{servers:t.servers,layout:e})}function vb({layout:e,...t}){return o.jsx(bn,{...t,children:o.jsx(kb,{layout:e})})}function jb({layout:e}){var s;const t=yn(),[n,r]=x.useState(null);return o.jsx(Br,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:n,onSelectKey:r,layout:e})}function Sb({layout:e,...t}){return o.jsx(bn,{...t,className:pt,children:o.jsx(jb,{layout:e})})}function Ab({layout:e}){var i;const t=yn(),[n,r]=x.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Br,{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 Eb({layout:e,...t}){return o.jsx(bn,{...t,className:pt,children:o.jsx(Ab,{layout:e})})}function Nb({selector:e,onNavigate:t,layout:n}){var a;const r=yn(),s=x.useMemo(()=>r.paths??{},[r.paths]),i=bb(s,e);return Xn(!i,`OpenAPIEndpoint: no endpoint with ${yb(e)} in this document.`),i?o.jsx(Iu,{...i,paths:s,security:r.security,securitySchemes:(a=r.components)==null?void 0:a.securitySchemes,onNavigate:t,layout:n}):null}function Tb(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(bn,{document:t,config:n,plugins:r,className:pt,children:o.jsx(Nb,{selector:a,onNavigate:i,layout:s})})}function Cb({name:e,method:t,onNavigate:n,layout:r}){var l;const s=yn(),i=x.useMemo(()=>s.webhooks??{},[s.webhooks]),a=i[e],c=t?t.toLowerCase():a&&hn.find(d=>a[d]),u=a&&c&&a[c];return Xn(!u,`OpenAPIWebhook: no webhook "${e}"${t?` with method ${t.toUpperCase()}`:""} in this document.`),!u||!a||!c?null:o.jsx(Iu,{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 _b({name:e,method:t,onNavigate:n,layout:r="stacked",...s}){return o.jsx(bn,{...s,className:pt,children:o.jsx(Cb,{name:e,method:t,onNavigate:n,layout:r})})}function $b({layout:e}){const t=yn();return t.info?o.jsx(hu,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function Ib({layout:e,...t}){return o.jsx(bn,{...t,children:o.jsx($b,{layout:e})})}exports.AsyncAPI=Yo;exports.AsyncAPIInfo=db;exports.AsyncAPIMessage=lb;exports.AsyncAPIMessages=ab;exports.AsyncAPIOperation=ob;exports.AsyncAPIOperations=rb;exports.AsyncAPIProvider=q0;exports.AsyncAPIRenderer=W0;exports.AsyncAPISchemas=gb;exports.AsyncAPIServers=tb;exports.CodeBlock=Xr;exports.ErrorBoundary=Ft;exports.OpenAPI=Zo;exports.OpenAPIEndpoint=Tb;exports.OpenAPIEndpoints=Sb;exports.OpenAPIInfo=Ib;exports.OpenAPIProvider=wb;exports.OpenAPIRenderer=X0;exports.OpenAPISchemas=xb;exports.OpenAPIServers=vb;exports.OpenAPIWebhook=_b;exports.OpenAPIWebhooks=Eb;exports.PluginSlot=Fn;exports.Schema=mb;exports.SchemaTabs=Dt;exports.SchemaTree=Go;exports.Schemas=qo;exports.X_LIB_CONVERSION_ERROR=$r;exports.asyncApiOperationToMarkdown=Lc;exports.asyncApiToMarkdown=Ao;exports.commonjsGlobal=gh;exports.defaultConfig=Rt;exports.documentToLlmsTxt=R0;exports.documentToMarkdown=M0;exports.ensureHljsLanguage=au;exports.getAugmentedNamespace=xh;exports.getDefaultExportFromCjs=rl;exports.hljsLanguageForTarget=iu;exports.isHljsLanguageReady=Dr;exports.isProtobufSchemaFormat=Bn;exports.listDocumentTargets=O0;exports.markdownForLlm=gc;exports.openApiEndpointToMarkdown=Dc;exports.openApiToMarkdown=Eo;exports.parseAndRender=H0;exports.parseAndRender$1=Y0;exports.registerSchemaParserWithFallback=Eu;exports.resolveLogo=No;exports.targetSlug=Au;exports.useAsyncAPIDocument=De;exports.useAsyncAPIDocumentContext=Xa;exports.useDocumentContext=it;exports.useOpenAPIDocumentContext=Za;exports.useOperationTabPlugins=zc;exports.usePluginSlot=Fc;
|