apiuikit 1.0.0 → 1.0.1

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.
@@ -0,0 +1,177 @@
1
+ "use strict";var Vp=Object.defineProperty;var Kp=(e,t,n)=>t in e?Vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ee=(e,t,n)=>Kp(e,typeof t!="symbol"?t+"":t,n);const c=require("react/jsx-runtime"),T=require("react"),Tr=require("react-dom"),Xi=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Qi=(e,t)=>{const n=t.length>0?t:Xi,r=(e%n.length+n.length)%n.length;return n[r]},zn={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:"#f8fafc",surface:"#ffffff",border:"#e2e8f0",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#64748b"},dark:{background:"#0d1117",surface:"#161b22",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681"},depthColors:Xi},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0}},Gi=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",ds=e=>typeof e=="object"&&e!==null,Jp=e=>e.replace(/^#\//,"").split("/").pop()??e,ea=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Gi(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>ea(r,t))),ku=(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),Gi(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>ku(s,t,n))}finally{t.delete(e)}},Yp=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let r=e;for(const s of n){if(!ds(r)&&!Array.isArray(r))return;const o=s.replace(/~1/g,"/").replace(/~0/g,"~");if(r=r[o],r==null)return}return r},Zp=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Tl=e=>e.length?`#/${e.map(Zp).join("/")}`:"#";function Ar(e){if(!ku(e))return e;const t=new Map,n=new Set,r=new Map,s=(o,i)=>{if(Array.isArray(o)){if(n.has(o))return{$ref:r.get(o)};const a=t.get(o);if(a!==void 0)return a;const l=[];r.set(o,Tl(i)),t.set(o,l),n.add(o);try{o.forEach((u,f)=>l.push(s(u,[...i,String(f)])))}finally{n.delete(o)}return l}if(Gi(o)){const a=Yp(e,o.$ref),l=ds(a)||Array.isArray(a);if(l&&!n.has(a)){const u=s(a,i);return ds(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=Jp(o.$ref)),u}if(a!==void 0&&!l)return a}if(ds(o)){if(n.has(o))return{$ref:r.get(o)};const a=t.get(o);if(a!==void 0)return a;const l={};r.set(o,Tl(i)),t.set(o,l),n.add(o);try{for(const[u,f]of Object.entries(o))l[u]=s(f,[...i,u])}finally{n.delete(o)}return l}return o};return s(e,[])}const Vs=T.createContext(null),ta=()=>{const e=T.useContext(Vs);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Ve=ta;var ks=(e=>(e.SEND="send",e.RECEIVE="receive",e))(ks||{});const Xp="Contact",Qp="Email",Al="License",Ol="External Documentation",Gp="Tags",eh="Implicit",th=`The Implicit flow is a simplified OAuth flow previously recommended
2
+ for native apps and JavaScript apps where the access token is returned
3
+ immediately without an extra authorization code exchange step.`,nh="Client Credentials",rh="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",sh="Password",oh="The Password grant type is a legacy way to exchange a user's credentials for an access token.",ih="Authorization Code",ah="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Tu="Connecting to a server",lh="",Nl=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],ch=[50,100,200,300,500,600,700],uh={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"}},fh=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],dh={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",[ks.SEND]:"bg-green-100 text-green-800",[ks.RECEIVE]:"bg-blue-100 text-blue-800"};function Au(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 Ro(e,t,n){if(e)for(const r of ch){const s=e[r];s&&(n[`--color-${t}-${r}`]=Au(s))}}const ph=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],hh={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 mh(e){const t={},n=e.light?"light":e.dark?"dark":null,r=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[s,o]of Object.entries(hh))t[`--color-neutral-${s}`]=o;if(r)for(const[s,o]of ph){const i=r[s];i&&(t[o]=Au(i))}return e.colors&&(Ro(e.colors.primary,"primary",t),Ro(e.colors.secondary,"secondary",t),Ro(e.colors.neutral,"neutral",t)),t}const gh=e=>typeof e=="object"&&e!==null;function Ou(e,t,n=zn){var g,v,j,y,b;const r=T.useMemo(()=>new Map,[]),[s,o]=T.useState(null),[i,a]=T.useState(null);T.useEffect(()=>{r.clear()},[t,r]);const l=T.useCallback(S=>{if(r.has(S))return r.get(S);const k=S.replace(/^#\//,"").split("/");let w=t;for(const E of k){if(!gh(w)){w=void 0;break}const C=E.replace(/~1/g,"/").replace(/~0/g,"~");if(w=w[C],w==null)break}return w!==void 0&&r.set(S,w),w},[t,r]),u=((g=n.expand)==null?void 0:g.schemas)===!0,f=(j=(v=n.theme)==null?void 0:v.depthColors)!=null&&j.length?n.theme.depthColors:Xi,d=((y=n.show)==null?void 0:y.extensions)!==!1,p=((b=n.show)==null?void 0:b.codeSamples)!==!1,h=T.useMemo(()=>({specType:e,document:t,deref:l,portalHost:s,rootElement:i,defaultSchemaExpanded:u,depthColors:f,showExtensions:d,showCodeSamples:p}),[e,t,l,s,i,u,f,d,p]),m=n.theme?mh(n.theme):{};return{contextValue:h,themeVars:m,setPortalHost:o,setRootElement:a}}function na({document:e,config:t=zn,className:n="",children:r}){const{contextValue:s,themeVars:o,setPortalHost:i,setRootElement:a}=Ou("asyncapi",e,t);return c.jsx(Vs.Provider,{value:s,children:c.jsxs("div",{ref:a,style:o,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[c.jsx("div",{ref:i,className:"asyncapi-portal-root"}),r]})})}function Gt({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:o=!1,mobileLeadContent:i}){return c.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[i&&c.jsx("div",{className:"@lg:hidden mb-3",children:i}),e&&c.jsx("h1",{className:`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`,children:e}),c.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&o?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[c.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),c.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:c.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Cn(...e){return e.filter(Boolean).join(" ")}function Wn({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",placeholder:o}){var h;const i=T.useId(),a=T.useRef([]),l=t??(o?"":((h=e[0])==null?void 0:h.id)??""),u=e.some(m=>!!m.icon),f=t?e.findIndex(m=>m.id===t):-1,d=f>=0?f:0,p=(m,g)=>{var y;if(e.length===0)return;const v=b=>(b+e.length)%e.length;let j=g;if(m.key==="ArrowRight"&&(m.preventDefault(),j=v(g+1)),m.key==="ArrowLeft"&&(m.preventDefault(),j=v(g-1)),m.key==="Home"&&(m.preventDefault(),j=0),m.key==="End"&&(m.preventDefault(),j=e.length-1),j!==g){const b=e[j];n(b.id),(y=a.current[j])==null||y.focus()}};return e.length?c.jsxs("div",{children:[c.jsxs("div",{className:"@sm:hidden",children:[c.jsx("label",{htmlFor:i,className:"sr-only",children:s}),c.jsxs("select",{id:i,name:"tabs",value:l,onChange:m=>n(m.target.value),className:Cn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",u?"mt-0":"mt-4"),children:[o&&c.jsx("option",{value:"",children:o}),e.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]})]}),c.jsx("div",{className:Cn("hidden @sm:block",u?"":"mt-6"),children:u?c.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":r,children:c.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((m,g)=>{const v=m.id===t,j=m.icon;return c.jsx("button",{ref:y=>{a.current[g]=y},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:g===d?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:y=>p(y,g),className:Cn("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",v?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:c.jsxs("span",{className:"inline-flex items-center gap-2",children:[j?c.jsx(j,{className:"h-4 w-4 shrink-0"}):null,c.jsx("span",{children:m.name})]})},m.id)})})}):c.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((m,g)=>{const v=m.id===t;return c.jsxs("button",{ref:j=>{a.current[g]=j},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:g===d?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:j=>p(j,g),className:Cn(v?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",g===0?"rounded-l-lg":"",g===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:[c.jsx("span",{children:m.name}),c.jsx("span",{"aria-hidden":"true",className:Cn(v?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},m.id)})})})]}):null}function Nu({tabs:e,current:t,onChange:n}){if(!e.length)return null;const r=c.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:c.jsx(Wn,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return c.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:c.jsx(Gt,{content:r,stickySideContent:!1})})}function yh(e){if(e.length===0)return c.jsx("span",{children:"No allowed values."});if(e.length===1)return c.jsxs("span",{children:["Allowed value is ",c.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((r,s)=>c.jsxs(T.Fragment,{children:[c.jsx("code",{children:r}),", "," "]},s)),n=c.jsx("code",{children:e[e.length-1]},"last");return c.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function xh(e){return e.map(t=>`\`${t}\``).join(", ")}function bh(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}function Xt({address:e,parameters:t,className:n="text-xs",truncate:r=!1,padded:s=!0}){const{portalHost:o}=Ve(),[i,a]=T.useState(null),[l,u]=T.useState({top:0,left:0,placement:"top"}),[f,d]=T.useState(!1),p=T.useRef(null),h=bh(e);let m=0;const g=40;T.useEffect(()=>{if(!r)return;const S=p.current;if(!S)return;const k=()=>d(S.scrollWidth>S.clientWidth);k();const w=new ResizeObserver(k);return w.observe(S),()=>w.disconnect()},[r,e]);const v=(S,k)=>{const w=k.getBoundingClientRect(),E=w.top<g?"bottom":"top";u({top:E==="top"?w.top-8:w.bottom+8,left:w.left+w.width/2,placement:E}),a(S)},j=()=>a(null),y=h.map((S,k)=>{if(S.type==="text")return c.jsx("span",{children:S.value},k);const w=t==null?void 0:t[S.value],E=Nl[m++%Nl.length],C=i===k,O=!!w&&(w.description||w.type||w.default||w.enum&&w.enum.length>0||w.examples&&w.examples.length>0),A=`channel-address-tooltip-${k}`,P=O&&C?A:void 0;return c.jsxs("span",{className:"inline-block",onMouseEnter:R=>O&&v(k,R.currentTarget),onMouseLeave:j,children:[c.jsx("span",{className:`font-semibold ${E} ${O?"cursor-help underline decoration-dotted":""}`,role:O?"button":void 0,tabIndex:O?0:void 0,"aria-expanded":O?C:void 0,"aria-describedby":P,onFocus:R=>O&&v(k,R.currentTarget),onBlur:j,onKeyDown:R=>{O&&((R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(k,R.currentTarget)),R.key==="Escape"&&(R.preventDefault(),j(),R.currentTarget.blur()))},children:`{${S.value}}`}),O&&C&&o&&Tr.createPortal(c.jsxs("div",{id:A,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:[w.description&&c.jsx("div",{children:w.description}),w.type&&c.jsx("div",{className:"mt-1",children:c.jsx("code",{children:w.type})}),w.default&&c.jsxs("div",{className:"mt-1",children:[c.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",c.jsx("code",{children:w.default})]}),w.enum&&w.enum.length>0&&c.jsx("div",{className:"mt-1",children:yh(w.enum)}),w.examples&&w.examples.length>0&&c.jsxs("div",{className:"mt-1",children:[c.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",w.examples.join(", ")]})]}),o)]},k)}),b=s?"px-2 py-1 ":"";return r?c.jsxs("code",{className:`${b}rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[c.jsx("span",{ref:p,className:"overflow-hidden whitespace-nowrap min-w-0",children:y}),f&&c.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):c.jsx("code",{className:`${b}rounded text-foreground-secondary break-all ${n}`,children:y})}const vh={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Qt({method:e,size:t="sm",className:n=""}){return e?c.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${vh[t]} ${dh[e]} ${n}`,children:e}):null}function Ks(e,t){const[n,r]=T.useState(null);return T.useLayoutEffect(()=>{if(!e||!t){r(null);return}let s=null;const o=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,r(e.getBoundingClientRect())}))};r(e.getBoundingClientRect());const i=new ResizeObserver(o);return i.observe(e),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{s!==null&&cancelAnimationFrame(s),i.disconnect(),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[e,t]),n}const Cl=6,wh=12,Sh=8,jh=.7;function Eh(e,t){if(e===0)return 1/0;const n=e*jh-Sh*2,r=t*Cl+Math.max(0,t-1)*wh;return Math.max(1,Math.floor((n-r)/Cl))}function kh(e,t){const n=e.reduce((s,o)=>s+o,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 _l=20;function Th({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[o,i]=T.useState(!1),[a,l]=T.useState(!1),u=o||a,{rootElement:f,portalHost:d}=Ve(),p=T.useRef(null),h=T.useRef(null),m=T.useMemo(()=>e.filter(D=>D.items.length>0),[e]),g=T.useMemo(()=>m.filter(D=>D.isTab===!1||D.id===t),[m,t]),v=T.useMemo(()=>m.filter(D=>D.showInPopover!==!1),[m]),[j,y]=T.useState(null),b=T.useRef(null),S=T.useRef(null),k=T.useCallback((D,L)=>{y({section:D,key:L}),b.current={section:D,key:L},S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{b.current=null},600)},[]);T.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),T.useEffect(()=>{const L=e.filter(I=>I.items.length>0).flatMap(I=>I.items.map(Q=>({section:I.id,key:I.itemKey(Q),id:I.targetId(Q)}))).map(I=>({...I,el:document.getElementById(I.id)})).filter(I=>!!I.el);if(L.length===0)return;const re=new Map(L.map(I=>[I.el,I])),te=new Map,me=new IntersectionObserver(I=>{for(const fe of I)fe.isIntersecting?te.set(fe.target,fe.boundingClientRect.top):te.delete(fe.target);if(te.size===0)return;let Q=null,ae=-1/0;for(const[fe,pe]of te)pe>ae&&(Q=fe,ae=pe);const se=Q&&re.get(Q);if(!se)return;const ue=b.current;if(ue){if(se.section!==ue.section||se.key!==ue.key)return;b.current=null}y({section:se.section,key:se.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return L.forEach(I=>me.observe(I.el)),()=>me.disconnect()},[e]);const w=(j==null?void 0:j.section)??t,E=j??s,C=Ks(f,!0),O=typeof window>"u"?0:window.innerWidth,A=typeof window>"u"?0:window.innerHeight,P=!!C&&C.bottom>0&&C.top<A,R=!!C&&C.width<1024,U={opacity:P?1:0,pointerEvents:P?"auto":"none",transition:"opacity 0.2s ease"},J={position:"fixed",top:"50%",left:((C==null?void 0:C.left)??0)+_l,transform:"translateY(-50%)",zIndex:51,...U},Z=Math.min((C==null?void 0:C.right)??0,O)-60,_={position:"fixed",bottom:16,left:Z,zIndex:51,...U},M=R?{position:"fixed",bottom:68,right:O-(Z+44),zIndex:52}:{position:"fixed",top:"50%",left:((C==null?void 0:C.left)??0)+_l,transform:"translateY(-50%)",zIndex:52};T.useEffect(()=>{if(!o)return;const D=re=>{re.key==="Escape"&&i(!1)},L=re=>{var me,I;const te=re.target;(me=p.current)!=null&&me.contains(te)||(I=h.current)!=null&&I.contains(te)||i(!1)};return document.addEventListener("keydown",D),document.addEventListener("mousedown",L),()=>{document.removeEventListener("keydown",D),document.removeEventListener("mousedown",L)}},[o]);const K=T.useCallback((D,L)=>{D.isTab!==!1&&n(D.id),L&&setTimeout(()=>{var re;(re=document.getElementById(L))==null||re.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),Y=T.useMemo(()=>v.map(D=>{const L=w===D.id,re=(E==null?void 0:E.section)===D.id,te=D.icon;return c.jsxs("div",{className:"pb-1",children:[c.jsxs("button",{onClick:()=>{K(D),k(D.id,""),R&&i(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${L?"bg-primary-50":"hover:bg-neutral-50"}`,children:[c.jsx(te,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${L?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),c.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${L?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:D.label}),c.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 ${L?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:D.items.length})]}),D.items.length>0&&c.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:D.items.map(me=>{const I=D.itemKey(me),Q=re&&(E==null?void 0:E.key)===I;return c.jsx("li",{children:c.jsx("button",{onClick:()=>{K(D,D.targetId(me)),r(D.id,I),k(D.id,I),R&&i(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${Q?"bg-primary-50 font-medium text-primary-500":L?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:D.renderItem(me,{isSelected:Q,isSectionActive:L})})},I)})})]},D.id)}),[v,w,E,R,K,r,k]),$=Eh(A,g.length),B=T.useMemo(()=>{const D=kh(g.map(L=>L.items.length),$);return g.map((L,re)=>{const te=w===L.id,me=L.items.length,I=D[re];let Q=-1;if((E==null?void 0:E.section)===L.id){const ae=L.items.findIndex(se=>L.itemKey(se)===E.key);ae>=0&&(Q=Math.min(I-1,Math.floor(ae*I/me)))}return c.jsxs("div",{className:"flex flex-col items-start gap-1",children:[c.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${te?"w-6 bg-foreground-secondary":"w-4 bg-neutral-300 group-hover:bg-neutral-400"}`}),c.jsx("div",{className:"flex flex-col items-start gap-1",children:Array.from({length:I},(ae,se)=>c.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${se===Q?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},se))})]},L.id)})},[g,w,E,$]);return c.jsxs(c.Fragment,{children:[!R&&c.jsx("button",{ref:p,onClick:()=>i(D=>!D),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),title:u?"Close navigation":"Open navigation","aria-label":u?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2",style:J,children:B}),R&&c.jsx("button",{ref:p,onClick:()=>i(D=>!D),title:o?"Close navigation":"Open navigation","aria-label":o?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:_,children:c.jsxs("span",{className:"flex flex-col items-start gap-1",children:[c.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),c.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),c.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})}),d&&Tr.createPortal(c.jsx("div",{ref:h,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!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 ${R?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:M,children:Y}),d)]})}function Cu({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:o}){return c.jsx(Th,{sections:e,activeSection:t,onTabChange:i=>n(i),onItemSelect:(i,a)=>{i!=="info"&&(i==="servers"?s==null||s(a):r==null||r(i,a))},selectedItem:o?{section:o.tab,key:o.key}:null})}function ra({className:e,children:t,...n}){return c.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 Ah(e){return c.jsxs(ra,{stroke:"url(#icon-book-open-gradient)",...e,children:[c.jsxs("linearGradient",{id:"icon-book-open-gradient",x2:"1",y2:"1",children:[c.jsx("stop",{offset:"0%",className:"primary-gradient-color-stop"}),c.jsx("stop",{offset:"100%",className:"secondary-gradient-color-stop"})]}),c.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 sa({className:e}){return c.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[c.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"}),c.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 _u(e){return{id:"info",label:"Info",icon:Ah,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>c.jsx("span",{className:"truncate",children:"Overview"})}}function Ru(e){return{id:"schemas",label:"Schemas",icon:sa,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>c.jsx("span",{className:"truncate",children:t})}}function Iu({className:e}){return c.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:c.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 Js({className:e}){return c.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:c.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 Pu({className:e}){return c.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[c.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"}),c.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 Gr={};function Oh({operations:e=Gr,messages:t=Gr,schemas:n=Gr,servers:r=Gr,hasInfo:s=!0,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u,sidebarConfig:f}){const d=T.useMemo(()=>{const p=h=>{var g;return f!=null&&f.useChannelAddressAsIdentifier?((g=e[h])==null?void 0:g.channel)??null:null};return[_u(s),{id:"servers",label:"Servers",icon:Iu,isTab:!1,items:Object.keys(r),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>c.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:Js,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var g;const m=p(h);return m!=null&&m.address?c.jsx(Xt,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):c.jsxs(c.Fragment,{children:[c.jsx(Qt,{method:(g=e[h])==null?void 0:g.action,size:"xs",className:"shrink-0"}),c.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:Pu,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>c.jsx("span",{className:"truncate",children:h})},Ru(n)]},[e,t,n,r,s,f]);return c.jsx(Cu,{sections:d,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u})}const oa=["get","put","post","delete","options","head","patch","trace"],Nh=(e,t)=>`${e} ${t}`;function Rl(e,t){const n=new Map;for(const r of(e==null?void 0:e.parameters)??[])n.set(`${r.in}:${r.name}`,r);for(const r of(t==null?void 0:t.parameters)??[])n.set(`${r.in}:${r.name}`,r);return Array.from(n.values())}function Ts(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?oa.filter(r=>n[r]).map(r=>({key:Nh(r,t),method:r,path:t})):[]})}function ia({className:e}){return c.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),c.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"}),c.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 Il={},Ch={},_h=[];function Rh({paths:e=Il,webhooks:t=Il,schemas:n=Ch,servers:r=_h,hasInfo:s=!0,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u}){const f=T.useMemo(()=>Ts(e),[e]),d=T.useMemo(()=>Ts(t),[t]),p=T.useMemo(()=>{const h=r.map((m,g)=>({key:`server-${g}`,url:m}));return[_u(s),{id:"servers",label:"Servers",icon:Iu,isTab:!1,items:h,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>c.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:Js,items:f,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>c.jsxs(c.Fragment,{children:[c.jsx(Qt,{method:m.method,size:"xs",className:"shrink-0"}),c.jsx(Xt,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:ia,items:d,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>c.jsxs(c.Fragment,{children:[c.jsx(Qt,{method:m.method,size:"xs",className:"shrink-0"}),c.jsx("span",{className:"truncate",children:m.path})]})},Ru(n)]},[f,d,n,r,s]);return c.jsx(Cu,{sections:p,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u})}const Ih=e=>c.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:[c.jsx("circle",{cx:"7",cy:"7",r:"5"}),c.jsx("path",{d:"M14 14l-3.5-3.5"})]});function $u(e,t){const[n,r]=T.useState("docked"),s=T.useRef(t);return s.current=t,T.useEffect(()=>{if(!e)return;let o=null,i=null;const a=()=>{i=null;const u=e.getBoundingClientRect().top,f=o===null?0:u-o;o=u,u>=0?r("docked"):s.current||f>0?r("pinned"):f<0?r("hidden"):r(d=>d==="docked"?"hidden":d)},l=()=>{i===null&&(i=requestAnimationFrame(a))};return a(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{i!==null&&cancelAnimationFrame(i),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e]),T.useEffect(()=>{t&&r(o=>o==="hidden"?"pinned":o)},[t]),n}function Ph(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Mu(e){let t=e;for(;t&&t!==document.body;){if(Ph(t))return t;t=t.parentElement}return document.documentElement}function Lu(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}}const Pl=12;function Du({query:e,onQueryChange:t,results:n,onSelectResult:r}){const s=T.useRef(null),o=T.useRef(null),[i,a]=T.useState(!1),[l,u]=T.useState(-1),f="asyncapi-search-results",{portalHost:d,rootElement:p}=Ve(),h=$u(p,i),m=h!=="docked",g=Ks(p,m),v={left:m?((g==null?void 0:g.left)??0)+Pl:Pl,transform:`translateY(${h==="hidden"?"-150%":"0px"})`,zIndex:40,...m?{position:"fixed",top:10,pointerEvents:h==="hidden"?"none":void 0}:{}},j=()=>{a(!1),u(-1)},y=T.useRef(!1),b=T.useRef(!1);T.useEffect(()=>{if(!p)return;const A=()=>{y.current=!0},P=()=>{y.current=!1};return p.addEventListener("mouseenter",A),p.addEventListener("mouseleave",P),()=>{p.removeEventListener("mouseenter",A),p.removeEventListener("mouseleave",P)}},[p]),T.useEffect(()=>{if(!p)return;const A=P=>{b.current=p.contains(P.target)};return document.addEventListener("mousedown",A,!0),()=>document.removeEventListener("mousedown",A,!0)},[p]),T.useEffect(()=>{if(!p)return;const A=P=>{!(P.metaKey||P.ctrlKey)||P.key.toLowerCase()!=="k"||!(p.contains(document.activeElement)||y.current||b.current)||(P.preventDefault(),a(!0))};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[p]),T.useEffect(()=>{if(!i)return;const A=requestAnimationFrame(()=>{var P;return(P=o.current)==null?void 0:P.focus()});return()=>cancelAnimationFrame(A)},[i]),T.useEffect(()=>{if(!(!i||!d))return Lu(Mu(d))},[i,d]),T.useEffect(()=>{if(!i)return;const A=P=>{P.key==="Escape"&&j()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[i]),T.useEffect(()=>{if(!i)return;const A=P=>{s.current&&!s.current.contains(P.target)&&j()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[i]),T.useEffect(()=>{l>=n.length&&u(n.length-1)},[l,n.length]);const S=i&&e.trim().length>0,k=A=>{j(),r(A)},w=A=>{if(A.key==="Escape"){A.preventDefault(),j();return}if(S){if(A.key==="ArrowDown"){A.preventDefault(),u(P=>n.length===0?-1:Math.min(P+1,n.length-1));return}if(A.key==="ArrowUp"){A.preventDefault(),u(P=>n.length===0?-1:P<=0?n.length-1:P-1);return}if(A.key==="Home"){A.preventDefault(),n.length>0&&u(0);return}if(A.key==="End"){A.preventDefault(),n.length>0&&u(n.length-1);return}if(A.key==="Enter"&&l>=0&&n[l]){A.preventDefault(),k(n[l]);return}}},E=A=>`asyncapi-search-result-${A}`,C=S?`${n.length} result${n.length===1?"":"s"} found`:"",O=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>a(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",style:v,children:c.jsx(Ih,{})}),i&&d&&Tr.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",children:[c.jsx("div",{className:"absolute inset-0 bg-black/30"}),c.jsxs("div",{ref:s,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[c.jsx("div",{className:"p-4",children:c.jsx("input",{ref:o,id:"asyncapi-search",type:"search",value:e,onChange:A=>t(A.target.value),onKeyDown:w,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":l>=0?E(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"})}),c.jsx("div",{"aria-live":"polite",className:"sr-only",children:C}),S&&c.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?c.jsx("ul",{className:"divide-y divide-border",children:n.map((A,P)=>c.jsx("li",{children:c.jsxs("button",{id:E(P),type:"button",role:"option","aria-selected":l===P,onClick:()=>k(A),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===P?"bg-neutral-100":""),children:[c.jsx("div",{className:"text-sm font-semibold text-foreground",children:A.name}),c.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[c.jsx("span",{children:A.location}),A.subtitle&&c.jsxs("span",{children:["• ",A.subtitle]})]})]})},A.id))}):c.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),c.jsxs("div",{className:"flex items-center justify-center gap-1 px-4 py-1.5 text-xs text-foreground-muted",children:["Press",c.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:O?"⌘ Cmd":"Ctrl"}),c.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]}),d)]})}function aa({className:e}){return c.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:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function la({className:e}){return c.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:c.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 Ys({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.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"})})}function Or({className:e}){return c.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:c.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}function Bu({serialize:e,leftOffset:t}){const[n,r]=T.useState(!1),[s,o]=T.useState(!1),i=T.useRef(null),a=T.useRef(void 0),{portalHost:l,rootElement:u,deref:f}=Ve(),d=()=>e(f),p=$u(u,n),h=p!=="docked",m=Ks(u,h),g={left:h?((m==null?void 0:m.left)??0)+t:t,transform:`translateY(${p==="hidden"?"-150%":"0px"})`,zIndex:40,...h?{position:"fixed",top:10,pointerEvents:p==="hidden"?"none":void 0}:{}};T.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),T.useEffect(()=>{if(!n)return;const y=b=>{b.key==="Escape"&&r(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),T.useEffect(()=>{if(!n)return;const y=b=>{i.current&&!i.current.contains(b.target)&&r(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const v=async()=>{const y=d();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:y.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(y),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),o(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>o(!1),2e3)}catch(b){console.error("[MarkdownExportMenu] Copy for LLM failed:",b)}r(!1)},j=()=>{const y=d(),b=new Blob([y],{type:"text/markdown"}),S=URL.createObjectURL(b);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:y.length,blobUrl:S}),window.open(S,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(S),3e4),r(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>r(y=>!y),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",style:g,children:[s?c.jsx(la,{className:"w-4 h-4 shrink-0 text-green-600"}):c.jsx(aa,{className:"w-4 h-4 shrink-0"}),c.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),c.jsx(Or,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&l&&Tr.createPortal(c.jsxs("div",{ref:i,role:"menu",style:{position:h?"fixed":"absolute",top:54,left:g.left,zIndex:41},className:"w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:v,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),c.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:j,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:[c.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),c.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),c.jsx(Ys,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]}),l)]})}const Dt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ps=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>ps(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,ps(r,t)]).join(" "):Dt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,ps(r,t)]).join(" ")):"",st=e=>ps(e).trim().replace(/\s+/g," "),$h=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Mh=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Lh=e=>{if(!Dt(e))return e;const t={};for(const[n,r]of Object.entries(e))Mh.has(n)||(t[n]=r);return t},Fu=(e,t,n,r)=>{const s=`schema-${n}`,o=(a,l,u,f)=>{const d=`components.schemas.${n}${l.length?`.${l.join(".")}`:""}`,p=`Schemas > ${r}${u.length?` > ${u.join(" > ")}`:""}`,h=Dt(a)?a.description:void 0,m=l.length?`${r}.${l.join(".")}`:r;e.push({id:`schema-${n}-${l.join("-")||"root"}`,targetId:f?$h(n,f):s,type:"schema",tab:"schemas",key:n,name:m,path:d,location:p,subtitle:h,text:st([Lh(a)]),schemaFocusTokens:f&&f.length>0?f:void 0})},i=(a,l=[],u=[],f=[],d=new Set)=>{if(o(a,l,u,f),!Dt(a)||d.has(a))return;if(d.add(a),Dt(a.properties))for(const[h,m]of Object.entries(a.properties))i(m,[...l,"properties",h],[...u,h],f?[...f,"properties",h]:null,d);const p=a.items;Dt(p)?i(p,[...l,"items"],[...u,"items"],f?[...f,"items"]:null,d):Array.isArray(p)&&p.forEach((h,m)=>{i(h,[...l,`items[${m}]`],[...u,`items[${m}]`],null,d)});for(const h of["allOf","oneOf","anyOf"]){const m=a[h];Array.isArray(m)&&m.forEach((g,v)=>{i(g,[...l,`${h}[${v}]`],[...u,`${h}[${v}]`],f&&h!=="allOf"?[...f,`${h}[${v}]`]:null,d)})}Dt(a.additionalProperties)&&i(a.additionalProperties,[...l,"additionalProperties"],[...u,"additionalProperties"],null,d)};i(t)};function Dh(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",o=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:o,text:st([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,o]of Object.entries(e.servers)){const i=o,a=i.description??s,l=[i.protocol,i.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:l,text:st([s,a,l,i.description,i.protocol,i.host,i.variables,i.security,i.bindings])});const u=i.security;Array.isArray(u)&&u.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:st(u)});const f=i.bindings,d=Dt(f)&&i.protocol?f[i.protocol]:void 0;d!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${i.protocol} configuration`,path:`servers.${s}.bindings.${i.protocol}`,location:`Servers > ${s} > ${i.protocol} configuration`,focusSection:`binding:${i.protocol}`,text:st(d)})}if(e.operations)for(const[s,o]of Object.entries(e.operations)){const i=o.title??s,a=o.summary??o.description??o.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:i,path:`operations.${s}`,location:`Operations > ${i}`,subtitle:a,text:st([s,i,a,o.action,o.channel,o.messages,o.reply,o.traits,o.bindings,o.security,o.tags])});const l=o.security;Array.isArray(l)&&l.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${i} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${i} > Authorization`,focusSection:"security",text:st(l)});const u=o.bindings;if(Dt(u))for(const[f,d]of Object.entries(u))d!=null&&t.push({id:`operation-${s}-bindings-${f}`,targetId:`operation-${s}-bindings-${f}`,type:"operation",tab:"operations",key:s,name:`${i} > ${f} configuration`,path:`operations.${s}.bindings.${f}`,location:`Operations > ${i} > ${f} configuration`,focusSection:`binding:${f}`,text:st(d)})}if((n=e.components)!=null&&n.messages)for(const[s,o]of Object.entries(e.components.messages)){const i=o.title??o.name??s,a=o.summary??o.description??o.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:i,path:`components.messages.${s}`,location:`Messages > ${i}`,subtitle:a,text:st([s,i,a,o.contentType,o.payload,o.headers,o.correlationId,o.tags,o.externalDocs,o.bindings])}),o.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${i} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${i} > Payload`,focusSection:"payload",text:st(o.payload)}),o.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${i} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${i} > Headers`,focusSection:"headers",text:st(o.headers)})}if((r=e.components)!=null&&r.schemas)for(const[s,o]of Object.entries(e.components.schemas))Fu(t,o,s,s);return t}function en(e){return Array.isArray?Array.isArray(e):Hu(e)==="[object Array]"}function Bh(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 mi(e){return e==null?"":Bh(e)}function Ye(e){return typeof e=="string"}function hs(e){return typeof e=="number"}function Fh(e){return e===!0||e===!1||Uh(e)&&Hu(e)=="[object Boolean]"}function Uu(e){return typeof e=="object"}function Uh(e){return Uu(e)&&e!==null}function ct(e){return e!=null}function es(e){return!e.trim().length}function Hu(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Hh="Incorrect 'index' type",gi="Invalid doc index: must be a non-negative integer within the bounds of the docs array",qh=e=>`Invalid value for key ${e}`,zh=e=>`Pattern length exceeds max of ${e}.`,Wh=e=>`Missing ${e} property in key`,Vh=e=>`Property 'weight' in key '${e}' must be a positive integer`,Kh="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.",$l=Object.prototype.hasOwnProperty;var Jh=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=qu(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 qu(e){let t=null,n=null,r=null,s=1,o=null;if(Ye(e)||en(e))r=e,t=Ml(e),n=ms(e);else{if(!$l.call(e,"name"))throw new Error(Wh("name"));const i=e.name;if(r=i,$l.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(Vh(ms(i)));t=Ml(i),n=ms(i),o=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:o}}function Ml(e){return en(e)?e:e.split(".")}function ms(e){return en(e)?e.join("."):e}function Yh(e,t){const n=[];let r=!1;const s=(o,i,a,l)=>{if(ct(o))if(!i[a])n.push(l!==void 0?{v:o,i:l}:o);else{const u=o[i[a]];if(!ct(u))return;if(a===i.length-1&&(Ye(u)||hs(u)||Fh(u)||typeof u=="bigint"))n.push(l!==void 0?{v:mi(u),i:l}:mi(u));else if(en(u)){r=!0;for(let f=0,d=u.length;f<d;f+=1)s(u[f],i,a+1,f)}else i.length&&s(u,i,a+1,l)}};return s(e,Ye(t)?t.split("."):t,0),r?n:n[0]}const Zh={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Xh={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},Qh={location:0,threshold:.6,distance:100},Gh={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Yh,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ie=Object.freeze({...Xh,...Zh,...Qh,...Gh});function em(e){return e>=9&&e<=13||e===32||e===160}function tm(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let o=0,i=!1;for(let l=0;l<s.length;l++)em(s.charCodeAt(l))?i=!1:i||(o++,i=!0);if(o===0&&(o=1),n.has(o))return n.get(o);const a=Math.round(r/Math.pow(o,.5*e))/r;return n.set(o,a),a},clear(){n.clear()}}}var ca=class{constructor({getFn:e=ie.getFn,fieldNormWeight:t=ie.fieldNormWeight}={}){this.norm=tm(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(Ye(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(gi);if(Ye(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(gi);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,o=n.length;for(;s<o;){const i=s+o>>>1;n[i]<r.i?s=i+1:o=i}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ct(e)||es(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 o=this.keys[r],i=o.getFn?o.getFn(e):this.getFn(e,o.path);if(ct(i)){if(en(i)){const a=[];for(let l=0,u=i.length;l<u;l+=1){const f=i[l];if(ct(f)){if(Ye(f)){if(!es(f)){const d={v:f,i:l,n:this.norm.get(f)};a.push(d)}}else if(ct(f.v)){const d=Ye(f.v)?f.v:mi(f.v);if(!es(d)){const p={v:d,i:f.i,n:this.norm.get(d)};a.push(p)}}}}n.$[r]=a}else if(Ye(i)&&!es(i)){const a={v:i,n:this.norm.get(i)};n.$[r]=a}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function zu(e,t,{getFn:n=ie.getFn,fieldNormWeight:r=ie.fieldNormWeight}={}){const s=new ca({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(qu)),s.setSources(t),s.create(),s}function nm(e,{getFn:t=ie.getFn,fieldNormWeight:n=ie.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new ca({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function rm(e=[],t=ie.minMatchCharLength){const n=[];let r=-1,s=-1,o=0;for(let i=e.length;o<i;o+=1){const a=e[o];a&&r===-1?r=o:!a&&r!==-1&&(s=o-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function sm(e,t,n,{location:r=ie.location,distance:s=ie.distance,threshold:o=ie.threshold,findAllMatches:i=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,includeMatches:l=ie.includeMatches,ignoreLocation:u=ie.ignoreLocation}={}){if(t.length>32)throw new Error(zh(32));const f=t.length,d=e.length,p=Math.max(0,Math.min(r,d));let h=o,m=p;const g=(O,A)=>{const P=O/f;if(u)return P;const R=Math.abs(p-A);return s?P+R/s:R?1:P},v=a>1||l,j=v?Array(d):[];let y;for(;(y=e.indexOf(t,m))>-1;){const O=g(0,y);if(h=Math.min(O,h),m=y+f,v){let A=0;for(;A<f;)j[y+A]=1,A+=1}}m=-1;let b=[],S=1,k=0,w=f+d;const E=1<<f-1;for(let O=0;O<f;O+=1){let A=0,P=w;for(;A<P;)g(O,p+P)<=h?A=P:w=P,P=Math.floor((w-A)/2+A);w=P;let R=Math.max(1,p-P+1);const U=i?d:Math.min(p+P,d)+f,J=Array(U+2);J[U+1]=(1<<O)-1;for(let Z=U;Z>=R;Z-=1){const _=Z-1,M=n[e[_]];if(J[Z]=(J[Z+1]<<1|1)&M,O&&(J[Z]|=(b[Z+1]|b[Z])<<1|1|b[Z+1]),J[Z]&E&&(S=g(O,_),S<=h)){if(h=S,m=_,k=O,m<=p)break;R=Math.max(1,2*p-m)}}if(g(O+1,p)>h)break;b=J}if(v&&m>=0){const O=Math.min(d-1,m+f-1+k);for(let A=m;A<=O;A+=1)n[e[A]]&&(j[A]=1)}const C={isMatch:m>=0,score:Math.max(.001,S)};if(v){const O=rm(j,a);O.length?l&&(C.indices=O):C.isMatch=!1}return C}function om(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 ua(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],o=e[n];o[0]<=s[1]+1?s[1]=Math.max(s[1],o[1]):t.push(o)}return t}const Wu={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},im=new RegExp("["+Object.keys(Wu).join("")+"]","g"),yr=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(im,t=>Wu[t]):e=>e;var fa=class{constructor(e,{location:t=ie.location,threshold:n=ie.threshold,distance:r=ie.distance,includeMatches:s=ie.includeMatches,findAllMatches:o=ie.findAllMatches,minMatchCharLength:i=ie.minMatchCharLength,isCaseSensitive:a=ie.isCaseSensitive,ignoreDiacritics:l=ie.ignoreDiacritics,ignoreLocation:u=ie.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:i,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:u},e=a?e:e.toLowerCase(),e=l?yr(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const f=(p,h)=>{this.chunks.push({pattern:p,alphabet:om(p),startIndex:h})},d=this.pattern.length;if(d>32){let p=0;const h=d%32,m=d-h;for(;p<m;)f(this.pattern.substr(p,32),p),p+=32;if(h){const g=d-32;f(this.pattern.substr(g),g)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?yr(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:l,ignoreLocation:u}=this.options,f=[];let d=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:g,startIndex:v})=>{const{isMatch:j,score:y,indices:b}=sm(e,m,g,{location:s+v,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:l,includeMatches:r,ignoreLocation:u});j&&(p=!0),d+=y,j&&b&&f.push(...b)});const h={isMatch:p,score:p?d/this.chunks.length:1};return p&&r&&(h.indices=ua(f)),h}};const am=new Set(["fuzzy","include"]);function lm(e){return e.startsWith("inverse")}const yi=[{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=[],o=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+o,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?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 fa(e,{location:t.location??ie.location,threshold:t.threshold??ie.threshold,distance:t.distance??ie.distance,includeMatches:t.includeMatches??ie.includeMatches,findAllMatches:t.findAllMatches??ie.findAllMatches,minMatchCharLength:t.minMatchCharLength??ie.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??ie.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??ie.ignoreDiacritics,ignoreLocation:t.ignoreLocation??ie.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Ll=yi.length,cm="\0",um="|";function fm(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 o=s+1;if(o>=n||e[o]===" "){s++;break}if(e[o]==="$"&&(o+1>=n||e[o+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 Dl(e,t){const n=e.match(t);return n?n[1]:null}function dm(e,t={}){return e.replace(/\\\|/g,cm).split(um).map(n=>{const r=fm(n.replace(/\u0000/g,"|").trim()).filter(o=>o&&!!o.trim()),s=[];for(let o=0,i=r.length;o<i;o+=1){const a=r[o];let l=!1,u=-1;for(;!l&&++u<Ll;){const f=yi[u],d=Dl(a,f.multiRegex);d&&(s.push(f.create(d,t)),l=!0)}if(!l)for(u=-1;++u<Ll;){const f=yi[u],d=Dl(a,f.singleRegex);if(d){s.push(f.create(d,t));break}}}return s})}var pm=class{constructor(e,{isCaseSensitive:t=ie.isCaseSensitive,ignoreDiacritics:n=ie.ignoreDiacritics,includeMatches:r=ie.includeMatches,minMatchCharLength:s=ie.minMatchCharLength,ignoreLocation:o=ie.ignoreLocation,findAllMatches:i=ie.findAllMatches,location:a=ie.location,threshold:l=ie.threshold,distance:u=ie.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:i,ignoreLocation:o,location:a,threshold:l,distance:u},e=t?e:e.toLowerCase(),e=n?yr(e):e,this.pattern=e,this.query=dm(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?yr(e):e;let o=0;const i=[];let a=0,l=!1;for(let u=0,f=t.length;u<f;u+=1){const d=t[u];i.length=0,o=0,l=!1;for(let p=0,h=d.length;p<h;p+=1){const m=d[p],{isMatch:g,indices:v,score:j}=m.search(e);if(g)o+=1,a+=j,lm(m.type)&&(l=!0),n&&(am.has(m.type)?i.push(...v):i.push(v));else{a=0,o=0,i.length=0,l=!1;break}}if(o){const p={isMatch:!0,score:a/o};return l&&(p.hasInverse=!0),n&&(p.indices=ua(i)),p}}return{isMatch:!1,score:1}}};const xi=[];function da(...e){xi.push(...e)}function As(e,t){for(let n=0,r=xi.length;n<r;n+=1){const s=xi[n];if(s.condition(e,t))return new s(e,t)}return new fa(e,t)}const Os={AND:"$and",OR:"$or"},bi={PATH:"$path",PATTERN:"$val"},vi=e=>!!(e[Os.AND]||e[Os.OR]),hm=e=>!!e[bi.PATH],mm=e=>!en(e)&&Uu(e)&&!vi(e),Bl=e=>({[Os.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Vu(e,t,{auto:n=!0}={}){const r=s=>{if(Ye(s)){const l={keyId:null,pattern:s};return n&&(l.searcher=As(s,t)),l}const o=Object.keys(s),i=hm(s);if(!i&&o.length>1&&!vi(s))return r(Bl(s));if(mm(s)){const l=i?s[bi.PATH]:o[0],u=i?s[bi.PATTERN]:s[l];if(!Ye(u))throw new Error(qh(l));const f={keyId:ms(l),pattern:u};return n&&(f.searcher=As(u,t)),f}const a={children:[],operator:o[0]};return o.forEach(l=>{const u=s[l];en(u)&&u.forEach(f=>{a.children.push(r(f))})}),a};return vi(e)||(e=Bl(e)),r(e)}function wi(e,{ignoreFieldNorm:t=ie.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:o})=>{const i=r?r.weight:null;n*=Math.pow(o===0&&i?Number.EPSILON:o,(i||1)*(t?1:s))}),n}function gm(e,{ignoreFieldNorm:t=ie.ignoreFieldNorm}){e.forEach(n=>{n.score=wi(n.matches,{ignoreFieldNorm:t})})}var ym=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,o=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),o<n&&this.comparator(t[o],t[r])>0&&(r=o),r!==e){const i=t[e];t[e]=t[r],t[r]=i}}while(r!==e)}};function xm(e){const t=[];return e.matches.forEach(n=>{if(!ct(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 bm(e,t,{includeMatches:n=ie.includeMatches,includeScore:r=ie.includeScore}={}){return e.map(s=>{const{idx:o}=s,i={item:t[o],refIndex:o};return n&&(i.matches=xm(s)),r&&(i.score=s.score),i})}const vm=/[\p{L}\p{M}\p{N}_]+/gu,Fl=new WeakSet;function wm(e){Fl.has(e)||(Fl.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 Sm(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||wm(e),t=>t.match(e)||[]):t=>t.match(vm)||[]}function Si({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Sm(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=yr(s)),r(s)}}}var jm=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Si({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 o of n){this.termSearchers.push(new fa(o,{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 i=r.get(o)||0,a=Math.log(1+(s-i+.5)/(i+.5));this.idfWeights.push(a)}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,o=0;const i=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const f=this.termSearchers[u].searchIn(e),d=this.idfWeights[u];r+=d,f.isMatch&&(s++,n+=d*(1-f.score),f.indices&&t.push(...f.indices),this.combineAll&&(this.useMask?o|=1<<u:i.add(u)))}if(s===0)return{isMatch:!1,score:1};const a=r>0?1-n/r:0,l={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&t.length&&(l.indices=ua(t)),this.combineAll&&(this.useMask?l.matchedMask=o:l.matchedTerms=i,l.termCount=this.numTerms),l}};function Io(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 o=new Set(s);let i=e.docTermFieldHits.get(n);i||(i=new Map,e.docTermFieldHits.set(n,i));for(const a of o)i.set(a,(i.get(a)||0)+1),e.df.set(a,(e.df.get(a)||0)+1)}function Ku(e,t,n,r){const{i:s,v:o,$:i}=t;if(o!==void 0){Io(e,o,s,r);return}if(i)for(let a=0;a<n;a++){const l=i[a];if(l)if(Array.isArray(l))for(const u of l)Io(e,u.v,s,r);else Io(e,l.v,s,r)}}function Em(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)Ku(r,s,t,n);return r}function km(e,t,n,r){Ku(e,t,n,r)}function Tm(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,o]of r){const i=(e.df.get(s)||0)-o;i<=0?e.df.delete(s):e.df.set(s,i)}e.docTermFieldHits.delete(t)}}function Ul(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((a,l)=>a-l);for(const a of n)Tm(e,a);const r=a=>{let l=0,u=n.length;for(;l<u;){const f=l+u>>>1;n[f]<a?l=f+1:u=f}return a-l},s=n[0],o=new Map;for(const[a,l]of e.docFieldCount)o.set(a>s?r(a):a,l);e.docFieldCount=o;const i=new Map;for(const[a,l]of e.docTermFieldHits)i.set(a>s?r(a):a,l);e.docTermFieldHits=i}var tn=class{constructor(e,t,n){this.options={...ie,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Jh(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=As(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 ca))throw new Error(Hh);if(this._myIndex=t||zu(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Si({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Em(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!ct(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Si({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});km(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&&Ul(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,o)=>!r.has(o)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(gi);this._invertedIndex&&Ul(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:o,sortFn:i,ignoreFieldNorm:a}=this.options;if(Ye(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return hs(n)&&n>-1&&(p=p.slice(0,n)),p}const l=o&&hs(n)&&n>0&&Ye(e),u=i,f=(p,h)=>u(p,h)||p.idx-h.idx;let d;if(l){const p=new ym(n,f);Ye(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:a}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:a}),d=p.extractSorted()}else d=Ye(e)?Ye(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),gm(d,{ignoreFieldNorm:a}),o&&d.sort(Ye(e)?f:u),hs(n)&&n>-1&&(d=d.slice(0,n));return bm(d,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:o}=this._myIndex,i=t?null:[];return o.forEach(({v:a,i:l,n:u})=>{if(!ct(a))return;const f=r.searchIn(a);if(f.isMatch){const d={score:f.score,value:a,norm:u,indices:f.indices};s&&(d.matchedMask=f.matchedMask,d.matchedTerms=f.matchedTerms,d.termCount=f.termCount);const p=[d];if(!s||this._coversAllTokens(p)){const h={item:a,idx:l,matches:p};t?(h.score=wi(h.matches,{ignoreFieldNorm:n}),t.insert(h)):i.push(h)}}}),i}_searchLogical(e){const t=Vu(e,this.options),n=this._normalizedKeys(),r=(a,l,u)=>{if(!("children"in a)){const{keyId:h,searcher:m}=a;let g;return h===null?(g=[],n.forEach((v,j)=>{g.push(...this._findMatches({key:v,value:l[j],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(l,h),searcher:m}),g&&g.length?[{idx:u,item:l,matches:g}]:[]}const{children:f,operator:d}=a,p=[];for(let h=0,m=f.length;h<m;h+=1){const g=f[h],v=r(g,l,u);if(v.length)p.push(...v);else if(d===Os.AND)return[]}return p},s=this._myIndex.records,o=new Map,i=[];return s.forEach(({$:a,i:l})=>{if(ct(a)){const u=r(t,a,l);u.length&&(o.has(l)||(o.set(l,{idx:l,item:a,matches:[]}),i.push(o.get(l))),u.forEach(({matches:f})=>{o.get(l).matches.push(...f)}))}}),i}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:o}=this._myIndex,i=this._normalizedKeys(),a=t?null:[];return o.forEach(({$:l,i:u})=>{if(!ct(l))return;const f=[];let d=!1,p=!1;if(i.forEach((h,m)=>{const g=this._findMatches({key:h,value:l[m],searcher:r});g.length?(f.push(...g),g[0].hasInverse&&(p=!0)):d=!0}),!(p&&d)&&f.length&&(!s||this._coversAllTokens(f))){const h={idx:u,item:l,matches:f};t?(h.score=wi(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}),a}_findMatches({key:e,value:t,searcher:n}){if(!ct(t))return[];const r=[];if(en(t))t.forEach(({v:s,i:o,n:i})=>{if(!ct(s))return;const a=n.searchIn(s);if(a.isMatch){const l={score:a.score,key:e,value:s,idx:o,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),r.push(l)}});else{const{v:s,n:o}=t,i=n.searchIn(s);if(i.isMatch){const a={score:i.score,key:e,value:s,norm:o,indices:i.indices,hasInverse:i.hasInverse};i.termCount!==void 0&&(a.matchedMask=i.matchedMask,a.matchedTerms=i.matchedTerms,a.termCount=i.termCount),r.push(a)}}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 o of s)n.add(o)}return n.size===t}};tn.version="7.5.0";tn.createIndex=zu;tn.parseIndex=nm;tn.config=ie;tn.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(Kh);return As(e,{...ie,...n}).searchIn(t)};tn.parseQuery=Vu;da(pm);da(jm);tn.use=function(...e){e.forEach(t=>da(t))};var Am=tn;function Ju(e,t,n={}){const[r,s]=T.useState(""),[o,i]=T.useState(""),a=n.debounceMs??150;T.useEffect(()=>{const d=setTimeout(()=>i(r),a);return()=>clearTimeout(d)},[r,a]);const l=T.useMemo(()=>t(e),[e,t]),u=T.useMemo(()=>new Am(l,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[l,n.threshold]),f=T.useMemo(()=>o.trim()?u.search(o.trim(),{limit:n.limit??20}).map(d=>d.item):[],[u,o,n.limit]);return{query:r,setQuery:s,results:f,searchIndex:l}}function Om(e,t={}){return Ju(e,Dh,t)}const ji="search-match",Yu=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Nm(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=s.nextNode();o;o=s.nextNode()){const i=(o.textContent??"").toLowerCase();let a=0;for(let l=i.indexOf(n);l!==-1;l=i.indexOf(n,a)){const u=document.createRange();u.setStart(o,l),u.setEnd(o,l+n.length),r.push(u),a=l+n.length}}return r}function Cm(e,t){if(!Yu())return;const n=Nm(e,t);if(!n.length){CSS.highlights.delete(ji);return}CSS.highlights.set(ji,new Highlight(...n))}function Po(){Yu()&&CSS.highlights.delete(ji)}function _m(e,t){const n=T.useRef(null);T.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:o}=e;let i=!1;const a=u=>{if(i)return;const f=document.getElementById(r);if(!f){u<40&&setTimeout(()=>a(u+1),50);return}if(n.current!==r){try{f.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}o&&l(0)},l=u=>{if(i)return;const f=document.getElementById(r);f&&Cm(f,s),u<6&&setTimeout(()=>l(u+1),100)};return setTimeout(()=>a(0),50),()=>{i=!0}},[e,...t])}function Zu({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s}){var P;const o=((P=e[0])==null?void 0:P.id)??t,[i,a]=T.useState(o),[l,u]=T.useState(null),f=R=>{a(R),u(R)},[d,p]=T.useState({}),h=e.some(R=>R.id===i)?i:o,m={};for(const R of r)m[R.id]=R.visible?d[R.id]??null:null;const g=(R,U)=>p(J=>({...J,[R]:U})),[v,j]=T.useState(null),[y,b]=T.useState(null),[S,k]=T.useState(null),w=R=>{n(R.tab)?f(R.tab):R.tab==="servers"&&u("servers");const U={};for(const J of r)U[J.id]=J.id===R.tab?R.key:null;p(U),j(R.focusSection??null),b(R.tab==="schemas"&&R.schemaFocusTokens?{tokens:R.schemaFocusTokens,id:R.targetId}:null),R.tab==="schemas"&&Po(),k({targetId:R.targetId,query:s,highlight:R.tab!=="schemas"})},E=(R,U)=>{f(R),p(J=>{const Z={...J};for(const _ of r)_.id!=="servers"&&(Z[_.id]=_.id===R?U:null);return Z})},C=R=>{u("servers");const U={};for(const J of r)U[J.id]=J.id==="servers"?R:null;p(U)},O=R=>{n(R)&&f(R)},A=(()=>{for(const R of r){const U=m[R.id];if(U)return{tab:R.id,key:U}}return null})();return _m(S,[h,v,y,...r.map(R=>m[R.id])]),T.useEffect(()=>{s.trim()||(k(null),Po())},[s]),T.useEffect(()=>Po,[]),{effectiveTab:h,focusTab:f,navActiveSection:l??h,selected:m,setSelectedKey:g,selectedNavItem:A,handleSearchSelect:w,handleNavItemSelect:E,handleNavServerSelect:C,handleContentTabChange:O,focusSection:v,schemaFocusTarget:y}}const ce=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$t=e=>ce(e)?e:null,Hl="^[\0-ÿ]*$",Rm=Math.pow(-2,31),Im=Math.pow(2,31)-1,Pm=Math.pow(-2,63),$m=Math.pow(2,63)-1,Mm={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"},pa=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function xr(e){const t=pa(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ei(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=xr(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function ql(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function Lm(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 Dm(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 ki(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Ti(e,t,n){const{type:r,jsonSchema:s}=Lm(e,n);Dm(r,t.example,s);function o(...i){i.forEach(a=>{let l=!0;a==="minLength"||a==="maxLength"?l=t[a]>-1:a==="multipleOf"&&(l=t[a]>0),t[a]!==void 0&&l&&(s[a]=t[a])})}switch(r){case"int":case"long":case"float":case"double":o("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),o("pattern","minLength","maxLength");break;case"array":o("minItems","maxItems","uniqueItems");break}}function ha(e,t,n){t!==void 0&&(e[t]=n)}function br(e,t){let n={};if(Array.isArray(e))return Fm(n,e,t);const r=pa(e),s=typeof e=="string"?e:r.type;switch(n.type=Mm[s],s){case"int":{n.minimum=Rm,n.maximum=Im;break}case"long":{n.minimum=Pm,n.maximum=$m;break}case"bytes":{n.pattern=Hl;break}case"fixed":{n.pattern=Hl,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=br(r.values,t);break}case"array":{n.items=br(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const o=Bm(r,t,n);ha(t,xr(e),n),n.properties=Object.fromEntries(o.entries());break}default:{const o=t[xr(e)]??(typeof s=="string"?t[s]:void 0);o&&(n=ki(r)?{...o}:o);break}}return Ei(r,n,t),Ti(s,r,n),n}function Bm(e,t,n){const r=new Map;for(const s of e.fields??[]){const o=typeof s.type=="string"?t[s.type]:void 0;if(o){const i=ki(s)?{...o}:o;ql(s,n,s.default!==void 0),ki(s)&&(Ei(s,i,t),Ti(s.type,s,i)),r.set(s.name,i)}else{const i=br(s.type,t);ql(s,n,s.default!==void 0),Ei(s,i,t),Ti(s.type,s,i),r.set(s.name,i),ha(t,xr(s.type),i)}}return r}function Fm(e,t,n){const r=[];let s=null;for(const o of t){const i=br(o,n);(typeof o=="string"?o:pa(o).type)==="null"?s=i:(r.push(i),ha(n,xr(o),i))}return s&&r.push(s),e.oneOf=r,e}function Ai(e){return br(e,{})}const zl=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),Um=new Set(["record","enum","array","map","fixed"]),Wl=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function ma(e){const t=[];return _n(e,"schema",t,new Set),t}function _n(e,t,n,r){if(typeof e=="string"){!zl.has(e)&&!Wl.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((o,i)=>_n(o,`${t}[${i}]`,n,r));return}if(!ce(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)||ce(s)?_n(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!zl.has(s)&&!Um.has(s)&&!Wl.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((o,i)=>{const a=`${t}.fields[${i}]`;if(!ce(o)||typeof o.name!="string"){n.push(`${a}: field must have a string "name"`);return}_n(o.type,`${a}.type`,n,r)});break}case"enum":{const o=e.symbols;(!Array.isArray(o)||o.some(i=>typeof i!="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"`):_n(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):_n(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let Ns=null,$o=null;const Oi=new Set;function Hm(){return $o||($o=Promise.resolve().then(()=>require("./protoToJsonSchema-ScIUJOSl.cjs")).then(e=>{Ns=e.protoToJsonSchema,Oi.forEach(t=>t())})),$o}function qm(){return Ns||Hm(),Ns}function zm(e){return Oi.add(e),()=>Oi.delete(e)}function Vl(){return Ns!==null}function ga(){return T.useSyncExternalStore(zm,Vl,Vl)}const Wm="x-parser-original-payload",Cs="x-lib-conversion-error",Vm=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,Km=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Nr(e){return typeof e=="string"&&Vm.test(e)}function Cr(e){return typeof e=="string"&&Km.test(e)}function Xu(e){return ce(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function Qu(e){var t,n;if(typeof e!="string")return null;if(Nr(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Cr(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 Gu(e){return Nr(e)?"Avro":Cr(e)?"Protobuf":null}function Jm(e,t){return t?!1:!e||Nr(e)||Cr(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Ym=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Zm=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Xm(e){return typeof e=="string"||Array.isArray(e)?!0:ce(e)?typeof e.type=="string"&&Zm.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Ym.some(t=>t in e):!1}function vr(e,t){let n=e;if(t&&ce(n)&&typeof n.$ref=="string"){const i=t(n.$ref);i!==void 0&&(n=i)}const r=Qm(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const o=Xu(n)?n.description:void 0;return typeof o=="string"?{...r,description:o}:r}function Qm(e){var i;if(!Xu(e))return{schema:$t(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[Wm],s=(i=$t(n))==null?void 0:i[Cs];if(typeof s=="string")return{schema:$t(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:$t(n)??{},schemaFormat:t,originalSchema:r};if(Nr(t)&&Xm(n)){const a=ma(n);if(a.length>0)return{schema:$t(n)??{},schemaFormat:t,originalSchema:n,conversionError:a[0]};try{return{schema:Ai(n),schemaFormat:t,originalSchema:n}}catch(l){return{schema:$t(n)??{},schemaFormat:t,originalSchema:n,conversionError:l instanceof Error?l.message:"Failed to convert Avro schema"}}}if(Cr(t)&&typeof n=="string"){const a=qm();if(!a)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:a(n),schemaFormat:t,originalSchema:n}}catch(l){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:l instanceof Error?l.message:"Failed to convert Protobuf schema"}}}const o=$t(n);return o?{schema:o,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const De=(e,t)=>`${"#".repeat(e)} ${t}`,ne=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),rr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Gm={objects:new Set,refs:new Set};function gs(e,t,n=Gm){if(e===null||typeof e!="object")return e;if(n.objects.has(e)||rr(e)&&typeof e.$ref=="string"&&n.refs.has(e.$ref)){const o=rr(e)?e["x-parser-schema-id"]:void 0;return typeof o=="string"?{$ref:`#/components/schemas/${o} (circular)`}:"[circular reference]"}const r={objects:new Set(n.objects).add(e),refs:rr(e)&&typeof e.$ref=="string"?new Set(n.refs).add(e.$ref):n.refs};if(Array.isArray(e))return e.map(o=>gs(o,t,r));if(rr(e)&&typeof e.$ref=="string"){const o=t==null?void 0:t(e.$ref);return rr(o)||Array.isArray(o)?gs(o,t,r):{$ref:e.$ref}}const s={};for(const[o,i]of Object.entries(e))s[o]=gs(i,t,r);return s}function _s(e,t,n){if(!t)return"";const r=gs(t,n);return`${De(4,`\`${ne(e)}\``)}
4
+
5
+ \`\`\`json
6
+ ${JSON.stringify(r,null,2)}
7
+ \`\`\``}function fr(e,t,n){if(!t||typeof t=="boolean")return"";const{schema:r,description:s,conversionError:o,pendingConversion:i}=vr(t,n);if(i)return`${De(4,`\`${ne(e)}\``)}
8
+
9
+ _(schema conversion still in progress)_`;if(o)return`${De(4,`\`${ne(e)}\``)}
10
+
11
+ _(could not convert schema: ${ne(o)})_`;const a=s&&!r.description?{...r,description:s}:r;return _s(e,a,n)}function ef(e){const t=[],{info:n}=e;t.push(De(1,ne(n.title)));const r=[`**Version:** ${ne(n.version)}`];if(n.license&&r.push(`**License:** ${ne(n.license.name)}${n.license.url?` (${ne(n.license.url)})`:""}`),n.contact){const s=[n.contact.name,n.contact.email].filter(Boolean).map(ne).join(" ");s&&r.push(`**Contact:** ${s}`)}if(t.push(r.join(`
12
+ `)),n.description&&t.push(ne(n.description)),e.servers&&Object.keys(e.servers).length){const s=[De(2,"Servers")];for(const[o,i]of Object.entries(e.servers)){s.push(De(3,ne(o)));const a=[`**Host:** \`${ne(i.host)}${i.pathname?ne(i.pathname):""}\``];a.push(`**Protocol:** ${ne(i.protocol)}${i.protocolVersion?` ${ne(i.protocolVersion)}`:""}`),i.description&&a.push(ne(i.description)),s.push(a.join(`
13
+ `))}t.push(s.join(`
14
+
15
+ `))}return t}function eg(e,t){var o,i,a;const n=ef(e);if(e.operations&&Object.keys(e.operations).length){const l=[De(2,"Operations")];for(const[u,f]of Object.entries(e.operations)){const d=f.channel;l.push(De(3,`${ne((o=f.action)==null?void 0:o.toUpperCase())} \`${ne(u)}\``));const p=[];d!=null&&d.address&&p.push(`**Channel:** \`${ne(d.address)}\``),f.summary&&p.push(ne(f.summary)),f.description&&p.push(ne(f.description));const h=f.messages??[];h.length&&p.push(`**Messages:** ${h.map(m=>`\`${ne(m.name??m.title??"message")}\``).join(", ")}`),l.push(p.join(`
16
+
17
+ `))}n.push(l.join(`
18
+
19
+ `))}const r=(i=e.components)==null?void 0:i.messages;if(r&&Object.keys(r).length){const l=[De(2,"Messages")];for(const[u,f]of Object.entries(r)){l.push(De(3,ne(f.title??f.name??u)));const d=[];f.summary&&d.push(ne(f.summary)),f.description&&d.push(ne(f.description)),f.contentType&&d.push(`**Content-Type:** \`${ne(f.contentType)}\``),l.push(d.join(`
20
+
21
+ `)),f.payload&&l.push(fr("payload",f.payload,t)),f.headers&&l.push(fr("headers",f.headers,t))}n.push(l.join(`
22
+
23
+ `))}const s=(a=e.components)==null?void 0:a.schemas;if(s&&Object.keys(s).length){const l=[De(2,"Schemas")];for(const[u,f]of Object.entries(s))l.push(fr(u,f,t));n.push(l.join(`
24
+
25
+ `))}return n.filter(Boolean).join(`
26
+
27
+ `)}function tg(e,t,n){var a;const r=t.channel,s=[De(3,`${ne((a=t.action)==null?void 0:a.toUpperCase())} \`${ne(e)}\``)],o=[];r!=null&&r.address&&o.push(`**Channel:** \`${ne(r.address)}\``),t.summary&&o.push(ne(t.summary)),t.description&&o.push(ne(t.description)),s.push(o.join(`
28
+
29
+ `));const i=t.messages??[];for(const l of i){const u=[De(4,ne(l.title??l.name??"Message"))],f=[];l.summary&&f.push(ne(l.summary)),l.description&&f.push(ne(l.description)),l.contentType&&f.push(`**Content-Type:** \`${ne(l.contentType)}\``),f.length&&u.push(f.join(`
30
+
31
+ `)),s.push(u.join(`
32
+
33
+ `)),l.payload&&s.push(fr("payload",l.payload,n)),l.headers&&s.push(fr("headers",l.headers,n))}return s.filter(Boolean).join(`
34
+
35
+ `)}function ng(e,t,n){var o;const r=(o=e.operations)==null?void 0:o[t];if(!r)return"";const s=ef(e);return s.push(tg(t,r,n)),s.filter(Boolean).join(`
36
+
37
+ `)}function tf(e,t,n,r){var l;const s=[De(3,`${e.toUpperCase()} \`${ne(t)}\``)],o=[];n.summary&&o.push(ne(n.summary)),n.description&&o.push(ne(n.description)),n.deprecated&&o.push("**Deprecated**");for(const u of["path","query","header","cookie"]){const f=(n.parameters??[]).filter(d=>d.in===u);if(f.length){o.push(`**${u[0].toUpperCase()}${u.slice(1)} Parameters:**`);for(const d of f){const p=d.schema;o.push(`- \`${ne(d.name)}\`${d.required?" (required)":""}${p!=null&&p.type?` — ${ne(p.type)}`:""}${d.description?`: ${ne(d.description)}`:""}`)}}}s.push(o.join(`
38
+
39
+ `));const i=((l=n.requestBody)==null?void 0:l.content)??{};for(const[u,f]of Object.entries(i))s.push([`**Request Body** (\`${ne(u)}\`)`,_s("body",f.schema,r)].join(`
40
+
41
+ `));const a=n.responses??{};for(const[u,f]of Object.entries(a)){const d=[De(4,`${u}${f.description?`: ${ne(f.description)}`:""}`)];for(const[p,h]of Object.entries(f.content??{}))d.push([`**Body** (\`${ne(p)}\`)`,_s("body",h.schema,r)].join(`
42
+
43
+ `));s.push(d.join(`
44
+
45
+ `))}return s.join(`
46
+
47
+ `)}function rg(e,t){var i,a,l,u;const n=[],{info:r}=e;if(n.push(De(1,ne(r.title))),n.push(`**Version:** ${ne(r.version)}`),r.description&&n.push(ne(r.description)),(i=e.servers)!=null&&i.length){const f=[De(2,"Servers")];for(const d of e.servers)f.push(`- \`${ne(d.url)}\`${d.description?` — ${ne(d.description)}`:""}`);n.push(f.join(`
48
+ `))}const s=e.paths?Ts(e.paths):[];if(s.length){const f=[De(2,"Endpoints")];for(const{method:d,path:p}of s){const h=(l=(a=e.paths)==null?void 0:a[p])==null?void 0:l[d];h&&f.push(tf(d,p,h,t))}n.push(f.join(`
49
+
50
+ `))}const o=(u=e.components)==null?void 0:u.schemas;if(o&&Object.keys(o).length){const f=[De(2,"Schemas")];for(const[d,p]of Object.entries(o))f.push(_s(d,p,t));n.push(f.join(`
51
+
52
+ `))}return n.filter(Boolean).join(`
53
+
54
+ `)}function sg(e,t,n,r){var a,l,u;const s=(l=(a=e.paths)==null?void 0:a[n])==null?void 0:l[t];if(!s)return"";const o=[],{info:i}=e;if(o.push(De(1,ne(i.title))),o.push(`**Version:** ${ne(i.version)}`),i.description&&o.push(ne(i.description)),(u=e.servers)!=null&&u.length){const f=[De(2,"Servers")];for(const d of e.servers)f.push(`- \`${ne(d.url)}\`${d.description?` — ${ne(d.description)}`:""}`);o.push(f.join(`
55
+ `))}return o.push(tf(t,n,s,r)),o.filter(Boolean).join(`
56
+
57
+ `)}const nf={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},og=()=>Promise.resolve().then(()=>require("./LogoExtension-BOYrY_RE.cjs"));var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ig(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */var Mo,Kl;function Jl(){if(Kl)return Mo;Kl=1;function e(F,H){(H==null||H>F.length)&&(H=F.length);for(var G=0,le=Array(H);G<H;G++)le[G]=F[G];return le}function t(F){if(Array.isArray(F))return F}function n(F,H){var G=F==null?null:typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(G!=null){var le,xe,Ae,Je,Jn=[],ot=!0,Yn=!1;try{if(Ae=(G=G.call(F)).next,H!==0)for(;!(ot=(le=Ae.call(G)).done)&&(Jn.push(le.value),Jn.length!==H);ot=!0);}catch(uo){Yn=!0,xe=uo}finally{try{if(!ot&&G.return!=null&&(Je=G.return(),Object(Je)!==Je))return}finally{if(Yn)throw xe}}return Jn}}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
58
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(F,H){return t(F)||n(F,H)||o(F,H)||r()}function o(F,H){if(F){if(typeof F=="string")return e(F,H);var G={}.toString.call(F).slice(8,-1);return G==="Object"&&F.constructor&&(G=F.constructor.name),G==="Map"||G==="Set"?Array.from(F):G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G)?e(F,H):void 0}}const i=Object.entries,a=Object.setPrototypeOf,l=Object.isFrozen,u=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor;let d=Object.freeze,p=Object.seal,h=Object.create,m=typeof Reflect<"u"&&Reflect,g=m.apply,v=m.construct;d||(d=function(H){return H}),p||(p=function(H){return H}),g||(g=function(H,G){for(var le=arguments.length,xe=new Array(le>2?le-2:0),Ae=2;Ae<le;Ae++)xe[Ae-2]=arguments[Ae];return H.apply(G,xe)}),v||(v=function(H){for(var G=arguments.length,le=new Array(G>1?G-1:0),xe=1;xe<G;xe++)le[xe-1]=arguments[xe];return new H(...le)});const j=B(Array.prototype.forEach),y=B(Array.prototype.lastIndexOf),b=B(Array.prototype.pop),S=B(Array.prototype.push),k=B(Array.prototype.splice),w=Array.isArray,E=B(String.prototype.toLowerCase),C=B(String.prototype.toString),O=B(String.prototype.match),A=B(String.prototype.replace),P=B(String.prototype.indexOf),R=B(String.prototype.trim),U=B(Number.prototype.toString),J=B(Boolean.prototype.toString),Z=typeof BigInt>"u"?null:B(BigInt.prototype.toString),_=typeof Symbol>"u"?null:B(Symbol.prototype.toString),M=B(Object.prototype.hasOwnProperty),K=B(Object.prototype.toString),Y=B(RegExp.prototype.test),$=D(TypeError);function B(F){return function(H){H instanceof RegExp&&(H.lastIndex=0);for(var G=arguments.length,le=new Array(G>1?G-1:0),xe=1;xe<G;xe++)le[xe-1]=arguments[xe];return g(F,H,le)}}function D(F){return function(){for(var H=arguments.length,G=new Array(H),le=0;le<H;le++)G[le]=arguments[le];return v(F,G)}}function L(F,H){let G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E;if(a&&a(F,null),!w(H))return F;let le=H.length;for(;le--;){let xe=H[le];if(typeof xe=="string"){const Ae=G(xe);Ae!==xe&&(l(H)||(H[le]=Ae),xe=Ae)}F[xe]=!0}return F}function re(F){for(let H=0;H<F.length;H++)M(F,H)||(F[H]=null);return F}function te(F){const H=h(null);for(const le of i(F)){var G=s(le,2);const xe=G[0],Ae=G[1];M(F,xe)&&(w(Ae)?H[xe]=re(Ae):Ae&&typeof Ae=="object"&&Ae.constructor===Object?H[xe]=te(Ae):H[xe]=Ae)}return H}function me(F){switch(typeof F){case"string":return F;case"number":return U(F);case"boolean":return J(F);case"bigint":return Z?Z(F):"0";case"symbol":return _?_(F):"Symbol()";case"undefined":return K(F);case"function":case"object":{if(F===null)return K(F);const H=F,G=I(H,"toString");if(typeof G=="function"){const le=G(H);return typeof le=="string"?le:K(le)}return K(F)}default:return K(F)}}function I(F,H){for(;F!==null;){const le=f(F,H);if(le){if(le.get)return B(le.get);if(typeof le.value=="function")return B(le.value)}F=u(F)}function G(){return null}return G}function Q(F){try{return Y(F,""),!0}catch{return!1}}const ae=d(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),se=d(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ue=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fe=d(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),pe=d(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ne=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Se=d(["#text"]),Xe=d(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ke=d(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ee=d(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ce=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$e=p(/{{[\w\W]*|^[\w\W]*}}/g),we=p(/<%[\w\W]*|^[\w\W]*%>/g),It=p(/\${[\w\W]*/g),ft=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),rn=p(/^aria-[\-\w]+$/),dt=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=p(/^(?:\w+script|data):/i),V=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oe=p(/^html$/i),ye=p(/^[a-z][.\w]*(-[.\w]+)+$/i),Me=p(/<[/\w!]/g),ht=p(/<[/\w]/g),lo=p(/<\/no(script|embed|frames)/i),co=p(/\/>/i),St={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},pp=function(){return typeof window>"u"?null:window},hp=function(H,G){if(typeof H!="object"||typeof H.createPolicy!="function")return null;let le=null;const xe="data-tt-policy-suffix";G&&G.hasAttribute(xe)&&(le=G.getAttribute(xe));const Ae="dompurify"+(le?"#"+le:"");try{return H.createPolicy(Ae,{createHTML(Je){return Je},createScriptURL(Je){return Je}})}catch{return console.warn("TrustedTypes policy "+Ae+" could not be created."),null}},Ka=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ut=function(H,G,le,xe){return M(H,G)&&w(H[G])?L(xe.base?te(xe.base):{},H[G],xe.transform):le};function Ja(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pp();const H=z=>Ja(z);if(H.version="3.4.11",H.removed=[],!F||!F.document||F.document.nodeType!==St.document||!F.Element)return H.isSupported=!1,H;let G=F.document;const le=G,xe=le.currentScript;F.DocumentFragment;const Ae=F.HTMLTemplateElement,Je=F.Node,Jn=F.Element,ot=F.NodeFilter,Yn=F.NamedNodeMap;Yn===void 0&&(F.NamedNodeMap||F.MozNamedAttrMap),F.HTMLFormElement;const uo=F.DOMParser,zr=F.trustedTypes,sn=Jn.prototype,gp=I(sn,"cloneNode"),Ya=I(sn,"remove"),yp=I(sn,"nextSibling"),Zn=I(sn,"childNodes"),Xn=I(sn,"parentNode"),Za=I(sn,"shadowRoot"),fo=I(sn,"attributes"),it=Je&&Je.prototype?I(Je.prototype,"nodeType"):null,Ht=Je&&Je.prototype?I(Je.prototype,"nodeName"):null;if(typeof Ae=="function"){const z=G.createElement("template");z.content&&z.content.ownerDocument&&(G=z.content.ownerDocument)}let tt,on="",po,Xa=!1,Qn=0;const Qa=function(){if(Qn>0)throw $('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},wn=function(x){Qa(),Qn++;try{return tt.createHTML(x)}finally{Qn--}},xp=function(x){Qa(),Qn++;try{return tt.createScriptURL(x)}finally{Qn--}},bp=function(){return Xa||(po=hp(zr,xe),Xa=!0),po},Wr=G,ho=Wr.implementation,Ga=Wr.createNodeIterator,vp=Wr.createDocumentFragment,wp=Wr.getElementsByTagName,Sp=le.importNode;let Le=Ka();H.isSupported=typeof i=="function"&&typeof Xn=="function"&&ho&&ho.createHTMLDocument!==void 0;const jp=$e,Ep=we,kp=It,Tp=ft,Ap=rn,Op=W,el=V,Np=ye;let tl=dt,_e=null;const nl=L({},[...ae,...se,...ue,...pe,...Se]);let Re=null;const rl=L({},[...Xe,...Ke,...ee,...Ce]);let Ie=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gn=null,sl=null;const qt=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ol=!0,mo=!0,il=!1,al=!0,zt=!1,er=!0,an=!1,go=!1,yo=null,xo=null,bo=!1,Sn=!1,Vr=!1,Kr=!1,ll=!0,cl=!1;const ul="user-content-";let vo=!0,wo=!1,jn={},jt=null;const So=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let fl=null;const dl=L({},["audio","video","img","source","image","track"]);let jo=null;const pl=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jr="http://www.w3.org/1998/Math/MathML",Yr="http://www.w3.org/2000/svg",Et="http://www.w3.org/1999/xhtml";let En=Et,Eo=!1,ko=null;const Cp=L({},[Jr,Yr,Et],C),hl=d(["mi","mo","mn","ms","mtext"]);let To=L({},hl);const ml=d(["annotation-xml"]);let Ao=L({},ml);const _p=L({},["title","style","font","a","script"]);let tr=null;const Rp=["application/xhtml+xml","text/html"],Ip="text/html";let Pe=null,kn=null;const Pp=G.createElement("form"),gl=function(x){return x instanceof RegExp||x instanceof Function},Oo=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===x)return;(!x||typeof x!="object")&&(x={}),x=te(x),tr=Rp.indexOf(x.PARSER_MEDIA_TYPE)===-1?Ip:x.PARSER_MEDIA_TYPE,Pe=tr==="application/xhtml+xml"?C:E,_e=Ut(x,"ALLOWED_TAGS",nl,{transform:Pe}),Re=Ut(x,"ALLOWED_ATTR",rl,{transform:Pe}),ko=Ut(x,"ALLOWED_NAMESPACES",Cp,{transform:C}),jo=Ut(x,"ADD_URI_SAFE_ATTR",pl,{transform:Pe,base:pl}),fl=Ut(x,"ADD_DATA_URI_TAGS",dl,{transform:Pe,base:dl}),jt=Ut(x,"FORBID_CONTENTS",So,{transform:Pe}),Gn=Ut(x,"FORBID_TAGS",te({}),{transform:Pe}),sl=Ut(x,"FORBID_ATTR",te({}),{transform:Pe}),jn=M(x,"USE_PROFILES")?x.USE_PROFILES&&typeof x.USE_PROFILES=="object"?te(x.USE_PROFILES):x.USE_PROFILES:!1,ol=x.ALLOW_ARIA_ATTR!==!1,mo=x.ALLOW_DATA_ATTR!==!1,il=x.ALLOW_UNKNOWN_PROTOCOLS||!1,al=x.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zt=x.SAFE_FOR_TEMPLATES||!1,er=x.SAFE_FOR_XML!==!1,an=x.WHOLE_DOCUMENT||!1,Sn=x.RETURN_DOM||!1,Vr=x.RETURN_DOM_FRAGMENT||!1,Kr=x.RETURN_TRUSTED_TYPE||!1,bo=x.FORCE_BODY||!1,ll=x.SANITIZE_DOM!==!1,cl=x.SANITIZE_NAMED_PROPS||!1,vo=x.KEEP_CONTENT!==!1,wo=x.IN_PLACE||!1,tl=Q(x.ALLOWED_URI_REGEXP)?x.ALLOWED_URI_REGEXP:dt,En=typeof x.NAMESPACE=="string"?x.NAMESPACE:Et,To=M(x,"MATHML_TEXT_INTEGRATION_POINTS")&&x.MATHML_TEXT_INTEGRATION_POINTS&&typeof x.MATHML_TEXT_INTEGRATION_POINTS=="object"?te(x.MATHML_TEXT_INTEGRATION_POINTS):L({},hl),Ao=M(x,"HTML_INTEGRATION_POINTS")&&x.HTML_INTEGRATION_POINTS&&typeof x.HTML_INTEGRATION_POINTS=="object"?te(x.HTML_INTEGRATION_POINTS):L({},ml);const N=M(x,"CUSTOM_ELEMENT_HANDLING")&&x.CUSTOM_ELEMENT_HANDLING&&typeof x.CUSTOM_ELEMENT_HANDLING=="object"?te(x.CUSTOM_ELEMENT_HANDLING):h(null);if(Ie=h(null),M(N,"tagNameCheck")&&gl(N.tagNameCheck)&&(Ie.tagNameCheck=N.tagNameCheck),M(N,"attributeNameCheck")&&gl(N.attributeNameCheck)&&(Ie.attributeNameCheck=N.attributeNameCheck),M(N,"allowCustomizedBuiltInElements")&&typeof N.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=N.allowCustomizedBuiltInElements),p(Ie),zt&&(mo=!1),Vr&&(Sn=!0),jn&&(_e=L({},Se),Re=h(null),jn.html===!0&&(L(_e,ae),L(Re,Xe)),jn.svg===!0&&(L(_e,se),L(Re,Ke),L(Re,Ce)),jn.svgFilters===!0&&(L(_e,ue),L(Re,Ke),L(Re,Ce)),jn.mathMl===!0&&(L(_e,pe),L(Re,ee),L(Re,Ce))),qt.tagCheck=null,qt.attributeCheck=null,M(x,"ADD_TAGS")&&(typeof x.ADD_TAGS=="function"?qt.tagCheck=x.ADD_TAGS:w(x.ADD_TAGS)&&(_e===nl&&(_e=te(_e)),L(_e,x.ADD_TAGS,Pe))),M(x,"ADD_ATTR")&&(typeof x.ADD_ATTR=="function"?qt.attributeCheck=x.ADD_ATTR:w(x.ADD_ATTR)&&(Re===rl&&(Re=te(Re)),L(Re,x.ADD_ATTR,Pe))),M(x,"ADD_URI_SAFE_ATTR")&&w(x.ADD_URI_SAFE_ATTR)&&L(jo,x.ADD_URI_SAFE_ATTR,Pe),M(x,"FORBID_CONTENTS")&&w(x.FORBID_CONTENTS)&&(jt===So&&(jt=te(jt)),L(jt,x.FORBID_CONTENTS,Pe)),M(x,"ADD_FORBID_CONTENTS")&&w(x.ADD_FORBID_CONTENTS)&&(jt===So&&(jt=te(jt)),L(jt,x.ADD_FORBID_CONTENTS,Pe)),vo&&(_e["#text"]=!0),an&&L(_e,["html","head","body"]),_e.table&&(L(_e,["tbody"]),delete Gn.tbody),x.TRUSTED_TYPES_POLICY){if(typeof x.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof x.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const q=tt;tt=x.TRUSTED_TYPES_POLICY;try{on=wn("")}catch(X){throw tt=q,X}}else x.TRUSTED_TYPES_POLICY===null?(tt=void 0,on=""):(tt===void 0&&(tt=bp()),tt&&typeof on=="string"&&(on=wn("")));d&&d(x),kn=x},yl=L({},[...se,...ue,...fe]),xl=L({},[...pe,...Ne]),$p=function(x,N,q){return N.namespaceURI===Et?x==="svg":N.namespaceURI===Jr?x==="svg"&&(q==="annotation-xml"||To[q]):!!yl[x]},Mp=function(x,N,q){return N.namespaceURI===Et?x==="math":N.namespaceURI===Yr?x==="math"&&Ao[q]:!!xl[x]},Lp=function(x,N,q){return N.namespaceURI===Yr&&!Ao[q]||N.namespaceURI===Jr&&!To[q]?!1:!xl[x]&&(_p[x]||!yl[x])},Dp=function(x){let N=Xn(x);(!N||!N.tagName)&&(N={namespaceURI:En,tagName:"template"});const q=E(x.tagName),X=E(N.tagName);return ko[x.namespaceURI]?x.namespaceURI===Yr?$p(q,N,X):x.namespaceURI===Jr?Mp(q,N,X):x.namespaceURI===Et?Lp(q,N,X):!!(tr==="application/xhtml+xml"&&ko[x.namespaceURI]):!1},Wt=function(x){S(H.removed,{element:x});try{Xn(x).removeChild(x)}catch{if(Ya(x),!Xn(x))throw $("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},bl=function(x){const N=Zn(x);if(N){const X=[];j(N,de=>{S(X,de)}),j(X,de=>{try{Ya(de)}catch{}})}const q=fo(x);if(q)for(let X=q.length-1;X>=0;--X){const de=q[X],be=de&&de.name;if(typeof be=="string")try{x.removeAttribute(be)}catch{}}},ln=function(x,N){try{S(H.removed,{attribute:N.getAttributeNode(x),from:N})}catch{S(H.removed,{attribute:null,from:N})}if(N.removeAttribute(x),x==="is")if(Sn||Vr)try{Wt(N)}catch{}else try{N.setAttribute(x,"")}catch{}},Bp=function(x){const N=fo(x);if(N)for(let q=N.length-1;q>=0;--q){const X=N[q],de=X&&X.name;if(!(typeof de!="string"||Re[Pe(de)]))try{x.removeAttribute(de)}catch{}}},Fp=function(x){const N=[x];for(;N.length>0;){const q=N.pop();(it?it(q):q.nodeType)===St.element&&Bp(q);const de=Zn(q);if(de)for(let be=de.length-1;be>=0;--be)N.push(de[be])}},vl=function(x){let N=null,q=null;if(bo)x="<remove></remove>"+x;else{const be=O(x,/^[\r\n\t ]+/);q=be&&be[0]}tr==="application/xhtml+xml"&&En===Et&&(x='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+x+"</body></html>");const X=tt?wn(x):x;if(En===Et)try{N=new uo().parseFromString(X,tr)}catch{}if(!N||!N.documentElement){N=ho.createDocument(En,"template",null);try{N.documentElement.innerHTML=Eo?on:X}catch{}}const de=N.body||N.documentElement;return x&&q&&de.insertBefore(G.createTextNode(q),de.childNodes[0]||null),En===Et?wp.call(N,an?"html":"body")[0]:an?N.documentElement:de},wl=function(x){return Ga.call(x.ownerDocument||x,x,ot.SHOW_ELEMENT|ot.SHOW_COMMENT|ot.SHOW_TEXT|ot.SHOW_PROCESSING_INSTRUCTION|ot.SHOW_CDATA_SECTION,null)},Zr=function(x){return x=A(x,jp," "),x=A(x,Ep," "),x=A(x,kp," "),x},No=function(x){var N;x.normalize();const q=Ga.call(x.ownerDocument||x,x,ot.SHOW_TEXT|ot.SHOW_COMMENT|ot.SHOW_CDATA_SECTION|ot.SHOW_PROCESSING_INSTRUCTION,null);let X=q.nextNode();for(;X;)X.data=Zr(X.data),X=q.nextNode();const de=(N=x.querySelectorAll)===null||N===void 0?void 0:N.call(x,"template");de&&j(de,be=>{Tn(be.content)&&No(be.content)})},Xr=function(x){const N=Ht?Ht(x):null;return typeof N!="string"||Pe(N)!=="form"?!1:typeof x.nodeName!="string"||typeof x.textContent!="string"||typeof x.removeChild!="function"||x.attributes!==fo(x)||typeof x.removeAttribute!="function"||typeof x.setAttribute!="function"||typeof x.namespaceURI!="string"||typeof x.insertBefore!="function"||typeof x.hasChildNodes!="function"||x.nodeType!==it(x)||x.childNodes!==Zn(x)},Tn=function(x){if(!it||typeof x!="object"||x===null)return!1;try{return it(x)===St.documentFragment}catch{return!1}},nr=function(x){if(!it||typeof x!="object"||x===null)return!1;try{return typeof it(x)=="number"}catch{return!1}};function Pt(z,x,N){z.length!==0&&j(z,q=>{q.call(H,x,N,kn)})}const Up=function(x,N){return!!(er&&x.hasChildNodes()&&!nr(x.firstElementChild)&&Y(Me,x.textContent)&&Y(Me,x.innerHTML)||er&&x.namespaceURI===Et&&N==="style"&&nr(x.firstElementChild)||x.nodeType===St.processingInstruction||er&&x.nodeType===St.comment&&Y(ht,x.data))},Hp=function(x,N){if(!Gn[N]&&El(N)&&(Ie.tagNameCheck instanceof RegExp&&Y(Ie.tagNameCheck,N)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(N)))return!1;if(vo&&!jt[N]){const q=Xn(x),X=Zn(x);if(X&&q){const de=X.length;for(let be=de-1;be>=0;--be){const He=wo?X[be]:gp(X[be],!0);q.insertBefore(He,yp(x))}}}return Wt(x),!0},Sl=function(x){if(Pt(Le.beforeSanitizeElements,x,null),Xr(x))return Wt(x),!0;const N=Pe(Ht?Ht(x):x.nodeName);if(Pt(Le.uponSanitizeElement,x,{tagName:N,allowedTags:_e}),Up(x,N))return Wt(x),!0;if(Gn[N]||!(qt.tagCheck instanceof Function&&qt.tagCheck(N))&&!_e[N])return Hp(x,N);if((it?it(x):x.nodeType)===St.element&&!Dp(x)||(N==="noscript"||N==="noembed"||N==="noframes")&&Y(lo,x.innerHTML))return Wt(x),!0;if(zt&&x.nodeType===St.text){const X=Zr(x.textContent);x.textContent!==X&&(S(H.removed,{element:x.cloneNode()}),x.textContent=X)}return Pt(Le.afterSanitizeElements,x,null),!1},jl=function(x,N,q){if(sl[N]||ll&&(N==="id"||N==="name")&&(q in G||q in Pp))return!1;const X=Re[N]||qt.attributeCheck instanceof Function&&qt.attributeCheck(N,x);if(!(mo&&Y(Tp,N))){if(!(ol&&Y(Ap,N))){if(X){if(!jo[N]){if(!Y(tl,A(q,el,""))){if(!((N==="src"||N==="xlink:href"||N==="href")&&x!=="script"&&P(q,"data:")===0&&fl[x])){if(!(il&&!Y(Op,A(q,el,"")))){if(q)return!1}}}}}else if(!(El(x)&&(Ie.tagNameCheck instanceof RegExp&&Y(Ie.tagNameCheck,x)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(x))&&(Ie.attributeNameCheck instanceof RegExp&&Y(Ie.attributeNameCheck,N)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(N,x))||N==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&Y(Ie.tagNameCheck,q)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(q))))return!1}}return!0},qp=L({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),El=function(x){return!qp[E(x)]&&Y(Np,x)},zp=function(x,N,q,X){if(tt&&typeof zr=="object"&&typeof zr.getAttributeType=="function"&&!q)switch(zr.getAttributeType(x,N)){case"TrustedHTML":return wn(X);case"TrustedScriptURL":return xp(X)}return X},Wp=function(x,N,q,X){try{q?x.setAttributeNS(q,N,X):x.setAttribute(N,X),Xr(x)?Wt(x):b(H.removed)}catch{ln(N,x)}},kl=function(x){Pt(Le.beforeSanitizeAttributes,x,null);const N=x.attributes;if(!N||Xr(x))return;const q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let X=N.length;const de=Pe(x.nodeName);for(;X--;){const be=N[X],He=be.name,Be=be.namespaceURI,pt=be.value,mt=Pe(He),_o=pt;let Qe=He==="value"?_o:R(_o);if(q.attrName=mt,q.attrValue=Qe,q.keepAttr=!0,q.forceKeepAttr=void 0,Pt(Le.uponSanitizeAttribute,x,q),Qe=q.attrValue,cl&&(mt==="id"||mt==="name")&&P(Qe,ul)!==0&&(ln(He,x),Qe=ul+Qe),er&&Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qe)){ln(He,x);continue}if(mt==="attributename"&&O(Qe,"href")){ln(He,x);continue}if(!q.forceKeepAttr){if(!q.keepAttr){ln(He,x);continue}if(!al&&Y(co,Qe)){ln(He,x);continue}if(zt&&(Qe=Zr(Qe)),!jl(de,mt,Qe)){ln(He,x);continue}Qe=zp(de,mt,Be,Qe),Qe!==_o&&Wp(x,He,Be,Qe)}}Pt(Le.afterSanitizeAttributes,x,null)},Qr=function(x){let N=null;const q=wl(x);for(Pt(Le.beforeSanitizeShadowDOM,x,null);N=q.nextNode();)if(Pt(Le.uponSanitizeShadowNode,N,null),Sl(N),kl(N),Tn(N.content)&&Qr(N.content),(it?it(N):N.nodeType)===St.element){const de=Za(N);Tn(de)&&(Co(de),Qr(de))}Pt(Le.afterSanitizeShadowDOM,x,null)},Co=function(x){const N=[{node:x,shadow:null}];for(;N.length>0;){const q=N.pop();if(q.shadow){Qr(q.shadow);continue}const X=q.node,be=(it?it(X):X.nodeType)===St.element,He=Zn(X);if(He)for(let Be=He.length-1;Be>=0;--Be)N.push({node:He[Be],shadow:null});if(be){const Be=Ht?Ht(X):null;if(typeof Be=="string"&&Pe(Be)==="template"){const pt=X.content;Tn(pt)&&N.push({node:pt,shadow:null})}}if(be){const Be=Za(X);Tn(Be)&&N.push({node:null,shadow:Be},{node:Be,shadow:null})}}};return H.sanitize=function(z){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=null,q=null,X=null,de=null;if(Eo=!z,Eo&&(z="<!-->"),typeof z!="string"&&!nr(z)&&(z=me(z),typeof z!="string"))throw $("dirty is not a string, aborting");if(!H.isSupported)return z;go?(_e=yo,Re=xo):Oo(x),(Le.uponSanitizeElement.length>0||Le.uponSanitizeAttribute.length>0)&&(_e=te(_e)),Le.uponSanitizeAttribute.length>0&&(Re=te(Re)),H.removed=[];const be=wo&&typeof z!="string"&&nr(z);if(be){const pt=Ht?Ht(z):z.nodeName;if(typeof pt=="string"){const mt=Pe(pt);if(!_e[mt]||Gn[mt])throw $("root node is forbidden and cannot be sanitized in-place")}if(Xr(z))throw $("root node is clobbered and cannot be sanitized in-place");try{Co(z)}catch(mt){throw bl(z),mt}}else if(nr(z))N=vl("<!---->"),q=N.ownerDocument.importNode(z,!0),q.nodeType===St.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?N=q:N.appendChild(q),Co(q);else{if(!Sn&&!zt&&!an&&z.indexOf("<")===-1)return tt&&Kr?wn(z):z;if(N=vl(z),!N)return Sn?null:Kr?on:""}N&&bo&&Wt(N.firstChild);const He=wl(be?z:N);try{for(;X=He.nextNode();)Sl(X),kl(X),Tn(X.content)&&Qr(X.content)}catch(pt){throw be&&bl(z),pt}if(be)return j(H.removed,pt=>{pt.element&&Fp(pt.element)}),zt&&No(z),z;if(Sn){if(zt&&No(N),Vr)for(de=vp.call(N.ownerDocument);N.firstChild;)de.appendChild(N.firstChild);else de=N;return(Re.shadowroot||Re.shadowrootmode)&&(de=Sp.call(le,de,!0)),de}let Be=an?N.outerHTML:N.innerHTML;return an&&_e["!doctype"]&&N.ownerDocument&&N.ownerDocument.doctype&&N.ownerDocument.doctype.name&&Y(oe,N.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+N.ownerDocument.doctype.name+`>
59
+ `+Be),zt&&(Be=Zr(Be)),tt&&Kr?wn(Be):Be},H.setConfig=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Oo(z),go=!0,yo=_e,xo=Re},H.clearConfig=function(){kn=null,go=!1,yo=null,xo=null,tt=po,on=""},H.isValidAttribute=function(z,x,N){kn||Oo({});const q=Pe(z),X=Pe(x);return jl(q,X,N)},H.addHook=function(z,x){typeof x=="function"&&M(Le,z)&&S(Le[z],x)},H.removeHook=function(z,x){if(M(Le,z)){if(x!==void 0){const N=y(Le[z],x);return N===-1?void 0:k(Le[z],N,1)[0]}return b(Le[z])}},H.removeHooks=function(z){M(Le,z)&&(Le[z]=[])},H.removeAllHooks=function(){Le=Ka()},H}var mp=Ja();return Mo=mp,Mo}var ag=self.DOMPurify||(self.DOMPurify=Jl().default||Jl());const rf=Zs(ag);function ya(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xn=ya();function sf(e){xn=e}var dr={exec:()=>null};function je(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(et.caret,"$1"),n=n.replace(s,i),r},getRegex:()=>new RegExp(n,t)};return r}var et={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")},lg=/^(?:[ \t]*(?:\n|$))+/,cg=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ug=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_r=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fg=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xa=/(?:[*+-]|\d{1,9}[.)])/,of=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,af=je(of).replace(/bull/g,xa).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(),dg=je(of).replace(/bull/g,xa).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(),ba=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pg=/^[^\n]+/,va=/(?!\s*\])(?:\\.|[^\[\]\\])+/,hg=je(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",va).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mg=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xa).getRegex(),Xs="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",wa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gg=je("^ {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",wa).replace("tag",Xs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lf=je(ba).replace("hr",_r).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",Xs).getRegex(),yg=je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lf).getRegex(),Sa={blockquote:yg,code:cg,def:hg,fences:ug,heading:fg,hr:_r,html:gg,lheading:af,list:mg,newline:lg,paragraph:lf,table:dr,text:pg},Yl=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_r).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",Xs).getRegex(),xg={...Sa,lheading:dg,table:Yl,paragraph:je(ba).replace("hr",_r).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yl).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",Xs).getRegex()},bg={...Sa,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wa).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:dr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(ba).replace("hr",_r).replace("heading",` *#{1,6} *[^
60
+ ]`).replace("lheading",af).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vg=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wg=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cf=/^( {2,}|\\)\n(?!\s*$)/,Sg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qs=/[\p{P}\p{S}]/u,ja=/[\s\p{P}\p{S}]/u,uf=/[^\s\p{P}\p{S}]/u,jg=je(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ja).getRegex(),ff=/(?!~)[\p{P}\p{S}]/u,Eg=/(?!~)[\s\p{P}\p{S}]/u,kg=/(?:[^\s\p{P}\p{S}]|~)/u,Tg=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,df=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ag=je(df,"u").replace(/punct/g,Qs).getRegex(),Og=je(df,"u").replace(/punct/g,ff).getRegex(),pf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ng=je(pf,"gu").replace(/notPunctSpace/g,uf).replace(/punctSpace/g,ja).replace(/punct/g,Qs).getRegex(),Cg=je(pf,"gu").replace(/notPunctSpace/g,kg).replace(/punctSpace/g,Eg).replace(/punct/g,ff).getRegex(),_g=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,uf).replace(/punctSpace/g,ja).replace(/punct/g,Qs).getRegex(),Rg=je(/\\(punct)/,"gu").replace(/punct/g,Qs).getRegex(),Ig=je(/^<(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(),Pg=je(wa).replace("(?:-->|$)","-->").getRegex(),$g=je("^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",Pg).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Rs=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Mg=je(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Rs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hf=je(/^!?\[(label)\]\[(ref)\]/).replace("label",Rs).replace("ref",va).getRegex(),mf=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",va).getRegex(),Lg=je("reflink|nolink(?!\\()","g").replace("reflink",hf).replace("nolink",mf).getRegex(),Ea={_backpedal:dr,anyPunctuation:Rg,autolink:Ig,blockSkip:Tg,br:cf,code:wg,del:dr,emStrongLDelim:Ag,emStrongRDelimAst:Ng,emStrongRDelimUnd:_g,escape:vg,link:Mg,nolink:mf,punctuation:jg,reflink:hf,reflinkSearch:Lg,tag:$g,text:Sg,url:dr},Dg={...Ea,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",Rs).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rs).getRegex()},Ni={...Ea,emStrongRDelimAst:Cg,emStrongLDelim:Og,url:je(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Bg={...Ni,br:je(cf).replace("{2,}","*").getRegex(),text:je(Ni.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ts={normal:Sa,gfm:xg,pedantic:bg},sr={normal:Ea,gfm:Ni,breaks:Bg,pedantic:Dg},Fg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zl=e=>Fg[e];function Tt(e,t){if(t){if(et.escapeTest.test(e))return e.replace(et.escapeReplace,Zl)}else if(et.escapeTestNoEncode.test(e))return e.replace(et.escapeReplaceNoEncode,Zl);return e}function Xl(e){try{e=encodeURI(e).replace(et.percentDecode,"%")}catch{return null}return e}function Ql(e,t){var o;const n=e.replace(et.findPipe,(i,a,l)=>{let u=!1,f=a;for(;--f>=0&&l[f]==="\\";)u=!u;return u?"|":" |"}),r=n.split(et.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.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(et.slashPipe,"|");return r}function or(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 Ug(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 Gl(e,t,n,r,s){const o=t.href,i=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function Hg(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
61
+ `).map(o=>{const i=o.match(n.other.beginningSpace);if(i===null)return o;const[a]=i;return a.length>=s.length?o.slice(s.length):o}).join(`
62
+ `)}var Is=class{constructor(e){Ee(this,"options");Ee(this,"rules");Ee(this,"lexer");this.options=e||xn}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:or(n,`
63
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Hg(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=or(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:or(t[0],`
64
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=or(t[0],`
65
+ `).split(`
66
+ `),r="",s="";const o=[];for(;n.length>0;){let i=!1;const a=[];let l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),i=!0;else if(!i)a.push(n[l]);else break;n=n.slice(l);const u=a.join(`
67
+ `),f=u.replace(this.rules.other.blockquoteSetextReplace,`
68
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
69
+ ${u}`:u,s=s?`${s}
70
+ ${f}`:f;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=d,n.length===0)break;const p=o.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const h=p,m=h.raw+`
71
+ `+n.join(`
72
+ `),g=this.blockquote(m);o[o.length-1]=g,r=r.substring(0,r.length-h.raw.length)+g.raw,s=s.substring(0,s.length-h.text.length)+g.text;break}else if((p==null?void 0:p.type)==="list"){const h=p,m=h.raw+`
73
+ `+n.join(`
74
+ `),g=this.list(m);o[o.length-1]=g,r=r.substring(0,r.length-p.raw.length)+g.raw,s=s.substring(0,s.length-h.raw.length)+g.raw,n=m.substring(o.at(-1).raw.length).split(`
75
+ `);continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let i=!1;for(;e;){let l=!1,u="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let d=t[2].split(`
76
+ `,1)[0].replace(this.rules.other.listReplaceTabs,j=>" ".repeat(3*j.length)),p=e.split(`
77
+ `,1)[0],h=!d.trim(),m=0;if(this.options.pedantic?(m=2,f=d.trimStart()):h?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=d.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(p)&&(u+=p+`
78
+ `,e=e.substring(p.length+1),l=!0),!l){const j=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),b=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m);for(;e;){const w=e.split(`
79
+ `,1)[0];let E;if(p=w,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),E=p):E=p.replace(this.rules.other.tabCharGlobal," "),b.test(p)||S.test(p)||k.test(p)||j.test(p)||y.test(p))break;if(E.search(this.rules.other.nonSpaceChar)>=m||!p.trim())f+=`
80
+ `+E.slice(m);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(d)||S.test(d)||y.test(d))break;f+=`
81
+ `+p}!h&&!p.trim()&&(h=!0),u+=w+`
82
+ `,e=e.substring(w.length+1),d=E.slice(m)}}s.loose||(i?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0));let g=null,v;this.options.gfm&&(g=this.rules.other.listIsTask.exec(f),g&&(v=g[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!g,checked:v,loose:!1,text:f,tokens:[]}),s.raw+=u}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const u=s.items[l].tokens.filter(d=>d.type==="space"),f=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=f}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var i;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Ql(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=t[3])!=null&&i.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
83
+ `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<n.length;a++)o.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(Ql(a,o.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[u]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
84
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=or(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Ug(t[2],"()");if(o===-2)return;if(o>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Gl(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Gl(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let i,a,l=o,u=0;const f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(r=f.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&o%3&&!((o+a)%3)){u+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+u);const d=[...r[0]][0].length,p=e.slice(0,o+r.index+d+a);if(Math.min(o,a)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Bt=class Ci{constructor(t){Ee(this,"tokens");Ee(this,"options");Ee(this,"state");Ee(this,"tokenizer");Ee(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||xn,this.options.tokenizer=this.options.tokenizer||new Is,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:et,block:ts.normal,inline:sr.normal};this.options.pedantic?(n.block=ts.pedantic,n.inline=sr.pedantic):this.options.gfm&&(n.block=ts.gfm,this.options.breaks?n.inline=sr.breaks:n.inline=sr.gfm),this.tokenizer.rules=n}static get rules(){return{block:ts,inline:sr}}static lex(t,n){return new Ci(n).lex(t)}static lexInline(t,n){return new Ci(n).inlineTokens(t)}lex(t){t=t.replace(et.carriageReturn,`
85
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,o,i;for(this.options.pedantic&&(t=t.replace(et.tabCharGlobal," ").replace(et.spaceLine,""));t;){let a;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(u=>(a=u.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);const u=n.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
86
+ `:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
87
+ `+a.raw,u.text+=`
88
+ `+a.text,this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
89
+ `+a.raw,u.text+=`
90
+ `+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let l=t;if((i=this.options.extensions)!=null&&i.startBlock){let u=1/0;const f=t.slice(1);let d;this.options.extensions.startBlock.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=t.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){const u=n.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
91
+ `+a.raw,u.text+=`
92
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a),r=l.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
93
+ `+a.raw,u.text+=`
94
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var a,l,u;let r=t,s=null;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)f.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,i="";for(;t;){o||(i=""),o=!1;let f;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(p=>(f=p.call({lexer:this},t,n))?(t=t.substring(f.raw.length),n.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);const p=n.at(-1);f.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(f=this.tokenizer.emStrong(t,r,i)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.del(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),n.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),n.push(f);continue}let d=t;if((u=this.options.extensions)!=null&&u.startInline){let p=1/0;const h=t.slice(1);let m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(d=t.substring(0,p+1))}if(f=this.tokenizer.inlineText(d)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(i=f.raw.slice(-1)),o=!0;const p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Ps=class{constructor(e){Ee(this,"options");Ee(this,"parser");this.options=e||xn}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(et.notSpaceStart))==null?void 0:o[0],s=e.replace(et.endingNewline,"")+`
95
+ `;return r?'<pre><code class="language-'+Tt(r)+'">'+(n?s:Tt(s,!0))+`</code></pre>
96
+ `:"<pre><code>"+(n?s:Tt(s,!0))+`</code></pre>
97
+ `}blockquote({tokens:e}){return`<blockquote>
98
+ ${this.parser.parse(e)}</blockquote>
99
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
100
+ `}hr(e){return`<hr>
101
+ `}list(e){const t=e.ordered,n=e.start;let r="";for(let i=0;i<e.items.length;i++){const a=e.items[i];r+=this.listitem(a)}const s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
102
+ `+r+"</"+s+`>
103
+ `}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Tt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
104
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
105
+ `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];n="";for(let i=0;i<o.length;i++)n+=this.tablecell(o[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
106
+ <thead>
107
+ `+t+`</thead>
108
+ `+r+`</table>
109
+ `}tablerow({text:e}){return`<tr>
110
+ ${e}</tr>
111
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
112
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Tt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=Xl(e);if(s===null)return r;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+Tt(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=Xl(e);if(s===null)return Tt(n);e=s;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${Tt(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Tt(e.text)}},ka=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ft=class _i{constructor(t){Ee(this,"options");Ee(this,"renderer");Ee(this,"textRenderer");this.options=t||xn,this.options.renderer=this.options.renderer||new Ps,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ka}static parse(t,n){return new _i(n).parse(t)}static parseInline(t,n){return new _i(n).parseInline(t)}parse(t,n=!0){var s,o;let r="";for(let i=0;i<t.length;i++){const a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=a,f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=f||"";continue}}const l=a;switch(l.type){case"space":{r+=this.renderer.space(l);continue}case"hr":{r+=this.renderer.hr(l);continue}case"heading":{r+=this.renderer.heading(l);continue}case"code":{r+=this.renderer.code(l);continue}case"table":{r+=this.renderer.table(l);continue}case"blockquote":{r+=this.renderer.blockquote(l);continue}case"list":{r+=this.renderer.list(l);continue}case"html":{r+=this.renderer.html(l);continue}case"paragraph":{r+=this.renderer.paragraph(l);continue}case"text":{let u=l,f=this.renderer.text(u);for(;i+1<t.length&&t[i+1].type==="text";)u=t[++i],f+=`
113
+ `+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):r+=f;continue}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(t,n=this.renderer){var s,o;let r="";for(let i=0;i<t.length;i++){const a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},hi,ys=(hi=class{constructor(e){Ee(this,"options");Ee(this,"block");this.options=e||xn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Bt.lex:Bt.lexInline}provideParser(){return this.block?Ft.parse:Ft.parseInline}},Ee(hi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),hi),gf=class{constructor(...e){Ee(this,"defaults",ya());Ee(this,"options",this.setOptions);Ee(this,"parse",this.parseMarkdown(!0));Ee(this,"parseInline",this.parseMarkdown(!1));Ee(this,"Parser",Ft);Ee(this,"Renderer",Ps);Ee(this,"TextRenderer",ka);Ee(this,"Lexer",Bt);Ee(this,"Tokenizer",Is);Ee(this,"Hooks",ys);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const i=o;for(const a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(const a of i.rows)for(const l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{const i=o;n=n.concat(this.walkTokens(i.items,t));break}default:{const i=o;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const l=i[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...i){let a=s.renderer.apply(this,i);return a===!1&&(a=o.apply(this,i)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new Ps(this.defaults);for(const o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const i=o,a=n.renderer[i],l=s[i];s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=l.apply(s,u)),f||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Is(this.defaults);for(const o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const i=o,a=n.tokenizer[i],l=s[i];s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=l.apply(s,u)),f}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new ys;for(const o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const i=o,a=n.hooks[i],l=s[i];ys.passThroughHooks.has(o)?s[i]=u=>{if(this.defaults.async)return Promise.resolve(a.call(s,u)).then(d=>l.call(s,d));const f=a.call(s,u);return l.call(s,f)}:s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=l.apply(s,u)),f}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(o.call(this,i)),s&&(a=a.concat(s.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Bt.lex(e,t??this.defaults)}parser(e,t){return Ft.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const a=o.hooks?o.hooks.provideLexer():e?Bt.lex:Bt.lexInline,l=o.hooks?o.hooks.provideParser():e?Ft.parse:Ft.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(u=>a(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>l(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let u=a(n,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let f=l(u,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(u){return i(u)}}}onError(e,t){return n=>{if(n.message+=`
114
+ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+Tt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},mn=new gf;function ke(e,t){return mn.parse(e,t)}ke.options=ke.setOptions=function(e){return mn.setOptions(e),ke.defaults=mn.defaults,sf(ke.defaults),ke};ke.getDefaults=ya;ke.defaults=xn;ke.use=function(...e){return mn.use(...e),ke.defaults=mn.defaults,sf(ke.defaults),ke};ke.walkTokens=function(e,t){return mn.walkTokens(e,t)};ke.parseInline=mn.parseInline;ke.Parser=Ft;ke.parser=Ft.parse;ke.Renderer=Ps;ke.TextRenderer=ka;ke.Lexer=Bt;ke.lexer=Bt.lex;ke.Tokenizer=Is;ke.Hooks=ys;ke.parse=ke;ke.options;ke.setOptions;ke.use;ke.walkTokens;ke.parseInline;Ft.parse;Bt.lex;function qg(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const n=ec(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(tc(t));const r=e.highlight(t.text,n,t.lang||"");if(r instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");tc(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=ec(n),o=s?e.langPrefix+rc(s):e.emptyLangClass,i=o?` class="${o}"`:"";return t=t.replace(/\n$/,""),`<pre><code${i}>${r?t:rc(t,!0)}
115
+ </code></pre>`}}}}function ec(e){return(e||"").match(/\S*/)[0]}function tc(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const yf=/[&<>"']/,zg=new RegExp(yf.source,"g"),xf=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Wg=new RegExp(xf.source,"g"),Vg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nc=e=>Vg[e];function rc(e,t){if(t){if(yf.test(e))return e.replace(zg,nc)}else if(xf.test(e))return e.replace(Wg,nc);return e}function bf(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&bf(n)}),e}class sc{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function vf(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Yt(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const Kg="</span>",oc=e=>!!e.scope,Jg=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class Yg{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=vf(t)}openNode(t){if(!oc(t))return;const n=Jg(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){oc(t)&&(this.buffer+=Kg)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const ic=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Ta{constructor(){this.rootNode=ic(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=ic({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Ta._collapse(n)}))}}class Zg extends Ta{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Yg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Sr(e){return e?typeof e=="string"?e:e.source:null}function wf(e){return bn("(?=",e,")")}function Xg(e){return bn("(?:",e,")*")}function Qg(e){return bn("(?:",e,")?")}function bn(...e){return e.map(n=>Sr(n)).join("")}function Gg(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Aa(...e){return"("+(Gg(e).capture?"":"?:")+e.map(r=>Sr(r)).join("|")+")"}function Sf(e){return new RegExp(e.toString()+"|").exec("").length-1}function ey(e,t){const n=e&&e.exec(t);return n&&n.index===0}const ty=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Oa(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let o=Sr(r),i="";for(;o.length>0;){const a=ty.exec(o);if(!a){i+=o;break}i+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+s):(i+=a[0],a[0]==="("&&n++)}return i}).map(r=>`(${r})`).join(t)}const ny=/\b\B/,jf="[a-zA-Z]\\w*",Na="[a-zA-Z_]\\w*",Ef="\\b\\d+(\\.\\d+)?",kf="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Tf="\\b(0b[01]+)",ry="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",sy=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=bn(t,/.*\b/,e.binary,/\b.*/)),Yt({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},jr={begin:"\\\\[\\s\\S]",relevance:0},oy={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[jr]},iy={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[jr]},ay={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Gs=function(e,t,n={}){const r=Yt({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=Aa("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:bn(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ly=Gs("//","$"),cy=Gs("/\\*","\\*/"),uy=Gs("#","$"),fy={scope:"number",begin:Ef,relevance:0},dy={scope:"number",begin:kf,relevance:0},py={scope:"number",begin:Tf,relevance:0},hy={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[jr,{begin:/\[/,end:/\]/,relevance:0,contains:[jr]}]},my={scope:"title",begin:jf,relevance:0},gy={scope:"title",begin:Na,relevance:0},yy={begin:"\\.\\s*"+Na,relevance:0},xy=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var ns=Object.freeze({__proto__:null,APOS_STRING_MODE:oy,BACKSLASH_ESCAPE:jr,BINARY_NUMBER_MODE:py,BINARY_NUMBER_RE:Tf,COMMENT:Gs,C_BLOCK_COMMENT_MODE:cy,C_LINE_COMMENT_MODE:ly,C_NUMBER_MODE:dy,C_NUMBER_RE:kf,END_SAME_AS_BEGIN:xy,HASH_COMMENT_MODE:uy,IDENT_RE:jf,MATCH_NOTHING_RE:ny,METHOD_GUARD:yy,NUMBER_MODE:fy,NUMBER_RE:Ef,PHRASAL_WORDS_MODE:ay,QUOTE_STRING_MODE:iy,REGEXP_MODE:hy,RE_STARTERS_RE:ry,SHEBANG:sy,TITLE_MODE:my,UNDERSCORE_IDENT_RE:Na,UNDERSCORE_TITLE_MODE:gy});function by(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function vy(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function wy(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=by,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Sy(e,t){Array.isArray(e.illegal)&&(e.illegal=Aa(...e.illegal))}function jy(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Ey(e,t){e.relevance===void 0&&(e.relevance=1)}const ky=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=bn(n.beforeMatch,wf(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Ty=["of","and","for","in","not","or","if","then","parent","list","value"],Ay="keyword";function Af(e,t,n=Ay){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(o){Object.assign(r,Af(e[o],t,o))}),r;function s(o,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){const l=a.split("|");r[l[0]]=[o,Oy(l[0],l[1])]})}}function Oy(e,t){return t?Number(t):Ny(e)?0:1}function Ny(e){return Ty.includes(e.toLowerCase())}const ac={},pn=e=>{console.error(e)},lc=(e,...t)=>{console.log(`WARN: ${e}`,...t)},An=(e,t)=>{ac[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ac[`${e}/${t}`]=!0)},$s=new Error;function Of(e,t,{key:n}){let r=0;const s=e[n],o={},i={};for(let a=1;a<=t.length;a++)i[a+r]=s[a],o[a+r]=!0,r+=Sf(t[a-1]);e[n]=i,e[n]._emit=o,e[n]._multi=!0}function Cy(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw pn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$s;if(typeof e.beginScope!="object"||e.beginScope===null)throw pn("beginScope must be object"),$s;Of(e,e.begin,{key:"beginScope"}),e.begin=Oa(e.begin,{joinWith:""})}}function _y(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw pn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$s;if(typeof e.endScope!="object"||e.endScope===null)throw pn("endScope must be object"),$s;Of(e,e.end,{key:"endScope"}),e.end=Oa(e.end,{joinWith:""})}}function Ry(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Iy(e){Ry(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Cy(e),_y(e)}function Py(e){function t(i,a){return new RegExp(Sr(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=Sf(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=t(Oa(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const u=l.findIndex((d,p)=>p>0&&d!==void 0),f=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([u,f])=>l.addRule(u,f)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,u=f.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(i){const a=new r;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function o(i,a){const l=i;if(i.isCompiled)return l;[vy,jy,Iy,ky].forEach(f=>f(i,a)),e.compilerExtensions.forEach(f=>f(i,a)),i.__beforeBegin=null,[wy,Sy,Ey].forEach(f=>f(i,a)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=Af(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=Sr(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(f){return $y(f==="self"?i:f)})),i.contains.forEach(function(f){o(f,l)}),i.starts&&o(i.starts,a),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Yt(e.classNameAliases||{}),o(e)}function Nf(e){return e?e.endsWithParent||Nf(e.starts):!1}function $y(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Yt(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Nf(e)?Yt(e,{starts:e.starts?Yt(e.starts):null}):Object.isFrozen(e)?Yt(e):e}var My="11.11.1";class Ly extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Lo=vf,cc=Yt,uc=Symbol("nomatch"),Dy=7,Cf=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Zg};function l(_){return a.noHighlightRe.test(_)}function u(_){let M=_.className+" ";M+=_.parentNode?_.parentNode.className:"";const K=a.languageDetectRe.exec(M);if(K){const Y=C(K[1]);return Y||(lc(o.replace("{}",K[1])),lc("Falling back to no-highlight mode for this block.",_)),Y?K[1]:"no-highlight"}return M.split(/\s+/).find(Y=>l(Y)||C(Y))}function f(_,M,K){let Y="",$="";typeof M=="object"?(Y=_,K=M.ignoreIllegals,$=M.language):(An("10.7.0","highlight(lang, code, ...args) has been deprecated."),An("10.7.0",`Please use highlight(code, options) instead.
116
+ https://github.com/highlightjs/highlight.js/issues/2277`),$=_,Y=M),K===void 0&&(K=!0);const B={code:Y,language:$};J("before:highlight",B);const D=B.result?B.result:d(B.language,B.code,K);return D.code=B.code,J("after:highlight",D),D}function d(_,M,K,Y){const $=Object.create(null);function B(W,V){return W.keywords[V]}function D(){if(!ee.keywords){$e.addText(we);return}let W=0;ee.keywordPatternRe.lastIndex=0;let V=ee.keywordPatternRe.exec(we),oe="";for(;V;){oe+=we.substring(W,V.index);const ye=Se.case_insensitive?V[0].toLowerCase():V[0],Me=B(ee,ye);if(Me){const[ht,lo]=Me;if($e.addText(oe),oe="",$[ye]=($[ye]||0)+1,$[ye]<=Dy&&(It+=lo),ht.startsWith("_"))oe+=V[0];else{const co=Se.classNameAliases[ht]||ht;te(V[0],co)}}else oe+=V[0];W=ee.keywordPatternRe.lastIndex,V=ee.keywordPatternRe.exec(we)}oe+=we.substring(W),$e.addText(oe)}function L(){if(we==="")return;let W=null;if(typeof ee.subLanguage=="string"){if(!t[ee.subLanguage]){$e.addText(we);return}W=d(ee.subLanguage,we,!0,Ce[ee.subLanguage]),Ce[ee.subLanguage]=W._top}else W=h(we,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(It+=W.relevance),$e.__addSublanguage(W._emitter,W.language)}function re(){ee.subLanguage!=null?L():D(),we=""}function te(W,V){W!==""&&($e.startScope(V),$e.addText(W),$e.endScope())}function me(W,V){let oe=1;const ye=V.length-1;for(;oe<=ye;){if(!W._emit[oe]){oe++;continue}const Me=Se.classNameAliases[W[oe]]||W[oe],ht=V[oe];Me?te(ht,Me):(we=ht,D(),we=""),oe++}}function I(W,V){return W.scope&&typeof W.scope=="string"&&$e.openNode(Se.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(te(we,Se.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),we=""):W.beginScope._multi&&(me(W.beginScope,V),we="")),ee=Object.create(W,{parent:{value:ee}}),ee}function Q(W,V,oe){let ye=ey(W.endRe,oe);if(ye){if(W["on:end"]){const Me=new sc(W);W["on:end"](V,Me),Me.isMatchIgnored&&(ye=!1)}if(ye){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return Q(W.parent,V,oe)}function ae(W){return ee.matcher.regexIndex===0?(we+=W[0],1):(dt=!0,0)}function se(W){const V=W[0],oe=W.rule,ye=new sc(oe),Me=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Me)if(ht&&(ht(W,ye),ye.isMatchIgnored))return ae(V);return oe.skip?we+=V:(oe.excludeBegin&&(we+=V),re(),!oe.returnBegin&&!oe.excludeBegin&&(we=V)),I(oe,W),oe.returnBegin?0:V.length}function ue(W){const V=W[0],oe=M.substring(W.index),ye=Q(ee,W,oe);if(!ye)return uc;const Me=ee;ee.endScope&&ee.endScope._wrap?(re(),te(V,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(re(),me(ee.endScope,W)):Me.skip?we+=V:(Me.returnEnd||Me.excludeEnd||(we+=V),re(),Me.excludeEnd&&(we=V));do ee.scope&&$e.closeNode(),!ee.skip&&!ee.subLanguage&&(It+=ee.relevance),ee=ee.parent;while(ee!==ye.parent);return ye.starts&&I(ye.starts,W),Me.returnEnd?0:V.length}function fe(){const W=[];for(let V=ee;V!==Se;V=V.parent)V.scope&&W.unshift(V.scope);W.forEach(V=>$e.openNode(V))}let pe={};function Ne(W,V){const oe=V&&V[0];if(we+=W,oe==null)return re(),0;if(pe.type==="begin"&&V.type==="end"&&pe.index===V.index&&oe===""){if(we+=M.slice(V.index,V.index+1),!s){const ye=new Error(`0 width match regex (${_})`);throw ye.languageName=_,ye.badRule=pe.rule,ye}return 1}if(pe=V,V.type==="begin")return se(V);if(V.type==="illegal"&&!K){const ye=new Error('Illegal lexeme "'+oe+'" for mode "'+(ee.scope||"<unnamed>")+'"');throw ye.mode=ee,ye}else if(V.type==="end"){const ye=ue(V);if(ye!==uc)return ye}if(V.type==="illegal"&&oe==="")return we+=`
117
+ `,1;if(rn>1e5&&rn>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=oe,oe.length}const Se=C(_);if(!Se)throw pn(o.replace("{}",_)),new Error('Unknown language: "'+_+'"');const Xe=Py(Se);let Ke="",ee=Y||Xe;const Ce={},$e=new a.__emitter(a);fe();let we="",It=0,ft=0,rn=0,dt=!1;try{if(Se.__emitTokens)Se.__emitTokens(M,$e);else{for(ee.matcher.considerAll();;){rn++,dt?dt=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=ft;const W=ee.matcher.exec(M);if(!W)break;const V=M.substring(ft,W.index),oe=Ne(V,W);ft=W.index+oe}Ne(M.substring(ft))}return $e.finalize(),Ke=$e.toHTML(),{language:_,value:Ke,relevance:It,illegal:!1,_emitter:$e,_top:ee}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:_,value:Lo(M),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:ft,context:M.slice(ft-100,ft+100),mode:W.mode,resultSoFar:Ke},_emitter:$e};if(s)return{language:_,value:Lo(M),illegal:!1,relevance:0,errorRaised:W,_emitter:$e,_top:ee};throw W}}function p(_){const M={value:Lo(_),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return M._emitter.addText(_),M}function h(_,M){M=M||a.languages||Object.keys(t);const K=p(_),Y=M.filter(C).filter(A).map(re=>d(re,_,!1));Y.unshift(K);const $=Y.sort((re,te)=>{if(re.relevance!==te.relevance)return te.relevance-re.relevance;if(re.language&&te.language){if(C(re.language).supersetOf===te.language)return 1;if(C(te.language).supersetOf===re.language)return-1}return 0}),[B,D]=$,L=B;return L.secondBest=D,L}function m(_,M,K){const Y=M&&n[M]||K;_.classList.add("hljs"),_.classList.add(`language-${Y}`)}function g(_){let M=null;const K=u(_);if(l(K))return;if(J("before:highlightElement",{el:_,language:K}),_.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_);return}if(_.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_)),a.throwUnescapedHTML))throw new Ly("One of your code blocks includes unescaped HTML.",_.innerHTML);M=_;const Y=M.textContent,$=K?f(Y,{language:K,ignoreIllegals:!0}):h(Y);_.innerHTML=$.value,_.dataset.highlighted="yes",m(_,K,$.language),_.result={language:$.language,re:$.relevance,relevance:$.relevance},$.secondBest&&(_.secondBest={language:$.secondBest.language,relevance:$.secondBest.relevance}),J("after:highlightElement",{el:_,result:$,text:Y})}function v(_){a=cc(a,_)}const j=()=>{S(),An("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){S(),An("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function S(){function _(){S()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",_,!1),b=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function k(_,M){let K=null;try{K=M(e)}catch(Y){if(pn("Language definition for '{}' could not be registered.".replace("{}",_)),s)pn(Y);else throw Y;K=i}K.name||(K.name=_),t[_]=K,K.rawDefinition=M.bind(null,e),K.aliases&&O(K.aliases,{languageName:_})}function w(_){delete t[_];for(const M of Object.keys(n))n[M]===_&&delete n[M]}function E(){return Object.keys(t)}function C(_){return _=(_||"").toLowerCase(),t[_]||t[n[_]]}function O(_,{languageName:M}){typeof _=="string"&&(_=[_]),_.forEach(K=>{n[K.toLowerCase()]=M})}function A(_){const M=C(_);return M&&!M.disableAutodetect}function P(_){_["before:highlightBlock"]&&!_["before:highlightElement"]&&(_["before:highlightElement"]=M=>{_["before:highlightBlock"](Object.assign({block:M.el},M))}),_["after:highlightBlock"]&&!_["after:highlightElement"]&&(_["after:highlightElement"]=M=>{_["after:highlightBlock"](Object.assign({block:M.el},M))})}function R(_){P(_),r.push(_)}function U(_){const M=r.indexOf(_);M!==-1&&r.splice(M,1)}function J(_,M){const K=_;r.forEach(function(Y){Y[K]&&Y[K](M)})}function Z(_){return An("10.7.0","highlightBlock will be removed entirely in v12.0"),An("10.7.0","Please use highlightElement now."),g(_)}Object.assign(e,{highlight:f,highlightAuto:h,highlightAll:S,highlightElement:g,highlightBlock:Z,configure:v,initHighlighting:j,initHighlightingOnLoad:y,registerLanguage:k,unregisterLanguage:w,listLanguages:E,getLanguage:C,registerAliases:O,autoDetection:A,inherit:cc,addPlugin:R,removePlugin:U}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=My,e.regex={concat:bn,lookahead:wf,either:Aa,optional:Qg,anyNumberOfTimes:Xg};for(const _ in ns)typeof ns[_]=="object"&&bf(ns[_]);return Object.assign(e,ns),e},Fn=Cf({});Fn.newInstance=()=>Cf({});var By=Fn;Fn.HighlightJS=Fn;Fn.default=Fn;const vt=Zs(By);function Fy(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Uy(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},i={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},a=e.inherit(i,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,o,i],j=[...v];return j.pop(),j.push(a),h.contains=j,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function Hy(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(a);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],j={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:v,built_in:[...y,...b,"set","shopt",...S,...k]},contains:[h,e.SHEBANG(),m,d,o,i,j,a,l,u,f,n]}}const fc="[A-Za-z$_][0-9A-Za-z$_]*",qy=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zy=["true","false","null","undefined","NaN","Infinity"],_f=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Rf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],If=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wy=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Vy=[].concat(If,_f,Rf);function Ky(e){const t=e.regex,n=(K,{after:Y})=>{const $="</"+K[0].slice(1);return K.input.indexOf($,Y)!==-1},r=fc,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,Y)=>{const $=K[0].length+K.index,B=K.input[$];if(B==="<"||B===","){Y.ignoreMatch();return}B===">"&&(n(K,{after:$})||Y.ignoreMatch());let D;const L=K.input.substring($);if(D=L.match(/^\s*=/)){Y.ignoreMatch();return}if((D=L.match(/^\s+extends\s+/))&&D.index===0){Y.ignoreMatch();return}}},a={$pattern:fc,keyword:qy,literal:zy,built_in:Vy,"variable.language":Wy},l="[0-9](_?[0-9])*",u=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,g,v,{match:/\$\d+/},d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(b)});const S=[].concat(y,p.contains),k=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._f,...Rf]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(K){return t.concat("(?!",K.join("|"),")")}const U={match:t.concat(/\b/,R([...If,"super","import"].map(K=>`${K}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},_="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(_)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,g,v,y,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:_,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},U,P,E,Z,{match:/\$[(.]/}]}}function Jy(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},j={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,d,e.HASH_COMMENT_MODE]}]};return u.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[j]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,j,d]}]}}vt.registerLanguage("json",Fy);vt.registerLanguage("yaml",Uy);vt.registerLanguage("bash",Hy);vt.registerLanguage("javascript",Ky);vt.registerLanguage("python",Jy);const Pf=new gf(qg({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!vt.getLanguage(t))return e;try{return vt.highlight(e,{language:t}).value}catch{return e}}}));Pf.use({extensions:[{name:"link",renderer(e){return`<a class="hover:underline hover:text-secondary-600" href="${e.href}" rel="noopener noreferrer" target="_blank">${e.text}</a>`}}]});function Yy(e){return Pf.parse(e)}const wt=({children:e,className:t=""})=>e?typeof e!="string"?c.jsx(c.Fragment,{children:e}):c.jsx("div",{className:`prose max-w-none text-foreground-muted prose-headings:text-foreground prose-strong:text-foreground prose-a:text-primary-600 prose-code:text-foreground-secondary prose-code:before:content-none prose-code:after:content-none prose-blockquote:text-foreground-muted prose-blockquote:border-border ${t}`,dangerouslySetInnerHTML:{__html:rf.sanitize(Yy(e))}}):null;function Zy({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})})}function Xy({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function Qy({className:e,...t}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"})})}function Gy({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}function ir({IconClass:e,term:t,visibleTerm:n=!0,text:r,href:s,vertical:o=!1,className:i=""}){const a=s?l=>c.jsx("a",{href:s,target:"_blank",...l}):l=>c.jsx("div",{...l});return c.jsxs("div",{className:`${!o&&"flex"} ${i}`,children:[c.jsx("dt",{children:c.jsxs(a,{className:"flex",children:[e&&c.jsx(e,{className:"w-5 h-5",title:`${r}`,alt:`${r}`}),n?c.jsx("span",{className:"pl-2 text-sm",children:t}):c.jsx("span",{className:"sr-only",children:t})]})}),c.jsxs("dd",{className:`${o&&"pt-2"} pl-2 text-sm`,children:[!n&&c.jsx(a,{children:r}),o&&c.jsx(a,{children:r})]})]})}function Ca({name:e,href:t,title:n}){return c.jsx("a",{className:`text-xs whitespace-nowrap break-all mt-2 rounded-md bg-neutral-300 py-[2px] px-[4px] mr-1 -mt-1 ${t&&"hover:bg-cyan-500 hover:text-white"}`,href:t,target:"_blank",title:n,children:e})}function e0({license:e,externalDocs:t,contact:n,tags:r,logo:s}){const o={licenseName:(e==null?void 0:e.name)??null,licenseUrl:(e==null?void 0:e.url)??null,externalDocsTitle:(t==null?void 0:t.description)??"External documentation",externalDocsUrl:(t==null?void 0:t.url)??null,externalDocsDescription:(t==null?void 0:t.description)??null,contactName:(n==null?void 0:n.name)??null,contactUrl:(n==null?void 0:n.url)??null,contactEmail:(n==null?void 0:n.email)??null,tags:r};return c.jsxs(c.Fragment,{children:[s&&c.jsx("div",{className:"hidden @lg:block mb-3",children:s}),c.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[o.licenseName&&c.jsx(ir,{IconClass:Qy,text:`${o.licenseName} ${Al}`,term:Al,visibleTerm:!o.licenseName,href:o.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),o.externalDocsUrl&&c.jsx(ir,{IconClass:Ys,text:Ol,href:o.externalDocsUrl,term:Ol,visibleTerm:!o.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),o.contactEmail&&c.jsx(ir,{IconClass:Zy,text:`${o.contactEmail}`,term:Qp,visibleTerm:!o.contactEmail,href:`mailto:${o.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),o.contactUrl&&c.jsx(ir,{IconClass:Xy,text:`${o.contactName}`,term:Xp,visibleTerm:!o.contactName,href:o.contactUrl,className:"text-foreground-secondary hover:text-green-500"})]}),c.jsx("dl",{className:"mt-[10px]",children:o.tags&&c.jsx(ir,{IconClass:Gy,term:Gp,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:o.tags&&c.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:o.tags.map((i,a)=>{const l=i,u=l.externalDocs;return c.jsx(Ca,{href:u&&u.url,title:l.description||(u&&u.description?u.description:void 0),name:l.name},a)})})})})]})}const t0=[/^x-parser-/i,/^x-lib-/i];function n0(e){return t0.some(t=>t.test(e))}const dc=new Map;function r0(e){let t=dc.get(e);return t||(t=T.lazy(nf[e]),dc.set(e,t)),t}const s0=e=>e.startsWith("x-"),$f=(e,t)=>e?e[t]:void 0;function o0({source:e,pathPrefix:t}){const{showExtensions:n}=Ve();if(!n||!e)return null;const r=Object.keys(e).filter(s=>s0(s)&&!n0(s)&&Object.prototype.hasOwnProperty.call(nf,s));return r.length===0?null:c.jsx(c.Fragment,{children:r.map(s=>{const o=r0(s);return c.jsx(T.Suspense,{fallback:null,children:c.jsx(o,{value:$f(e,s),path:`${t}.${s}`})},s)})})}const i0=T.lazy(og);function Mf({title:e,description:t,license:n,contact:r,externalDocs:s,tags:o,extensionsSource:i}){const a=$f(i,"x-logo"),l=a!==void 0&&c.jsx(T.Suspense,{fallback:null,children:c.jsx(i0,{value:a,path:"info.x-logo"})}),u=c.jsx("div",{className:"mt-4 w-full",children:c.jsx(wt,{children:t})}),f=c.jsxs(c.Fragment,{children:[c.jsx(e0,{logo:l,license:n,externalDocs:s,contact:r,tags:o}),i&&c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:c.jsx(o0,{source:i,pathPrefix:"info"})})]});return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:e,content:u,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:l})})}const Lf=e=>{const{title:t,description:n,license:r,externalDocs:s,contact:o,tags:i}=e;return c.jsx(Mf,{title:t,description:n,license:r,externalDocs:s,contact:o,tags:i,extensionsSource:e})},a0=1500,l0=320,c0=48,u0="#011627";function f0(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}async function d0(e){try{return await navigator.clipboard.writeText(e),!0}catch{return f0(e)}}function _a({code:e,className:t,language:n="json",collapsedMaxHeight:r=l0}){const[s,o]=T.useState("idle"),i=T.useRef(void 0),[a,l]=T.useState(!1),[u,f]=T.useState(!1),[d,p]=T.useState(0),h=T.useRef(null),m=T.useRef(null),g=T.useId();T.useEffect(()=>()=>clearTimeout(i.current),[]),T.useEffect(()=>{const E=m.current;if(!E)return;const C=()=>{p(E.scrollHeight),f(E.scrollHeight>r+c0)};C();const O=new ResizeObserver(C);return O.observe(E),()=>O.disconnect()},[e,n,r]);const v=()=>{d0(e).then(E=>{o(E?"copied":"error"),clearTimeout(i.current),i.current=setTimeout(()=>o("idle"),a0)})},y=vt.getLanguage(n)?vt.highlight(e,{language:n}).value:null,b=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",S=u&&!a,k=e.replace(/\n+$/,"").split(`
118
+ `).length,w=()=>{var E,C;a&&(((E=h.current)==null?void 0:E.getBoundingClientRect().top)??0)<0&&((C=h.current)==null||C.scrollIntoView({block:"nearest"})),l(O=>!O)};return c.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[c.jsx("button",{type:"button",onClick:v,"aria-label":b,title:b,className:"absolute top-2 right-2 z-10 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:s==="copied"?c.jsx(la,{className:"w-4 h-4 text-green-600"}):c.jsx(aa,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),c.jsxs("div",{className:"relative",children:[c.jsx("pre",{ref:m,id:g,style:u?{maxHeight:a?d:r}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${u?"overflow-y-hidden":""}`,children:y!==null?c.jsx("code",{className:`hljs language-${n}`,dangerouslySetInnerHTML:{__html:rf.sanitize(y)}}):c.jsx("code",{className:"hljs",children:e})}),u&&c.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b transition-opacity duration-300 ease-in-out ${S?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${u0})`}})]}),u&&c.jsxs("button",{type:"button",onClick:w,"aria-expanded":a,"aria-controls":g,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[a?"Show less":`Show all ${k} lines`,c.jsx(Or,{className:`w-3 h-3 transition-transform ${a?"rotate-180":""}`})]})]})}const p0=/^x-parser-/i;function Ri(e,t=new Set){if(e!==null&&typeof e=="object"){if(t.has(e))return"[circular]";t.add(e);try{if(Array.isArray(e))return e.map(r=>Ri(r,t));const n={};for(const[r,s]of Object.entries(e))p0.test(r)||(n[r]=Ri(s,t));return n}finally{t.delete(e)}}return e}const Df=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Ri(e),null,2);return c.jsx(_a,{code:t})},pc=new Set,Ra=e=>e.replace(/^#\//,"").split("/").pop()??e,Ii=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},h0={objects:new Set,refs:new Set},Lt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:Ii(e)};const r=e.$ref,s=Ra(r);if(n.has(r))return{schema:e,refLabel:s,circular:!0};const o=$t(t(r));if(!o)return{schema:e,refLabel:s};const{schema:i}=vr(o);n.add(r);try{const a=Lt(i,t,n);return{schema:a.schema,refLabel:a.circular?void 0:s,circular:a.circular}}finally{n.delete(r)}},gn=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return ce(n)?n:null},Bf=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>ce(r));return n.length>0?n:null},m0=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ce(e.additionalItems)?e.additionalItems:null,g0=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ce(e.contains)?e.contains:null,Ff=e=>e.contains!==void 0,Ms=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
119
+
120
+ ${t}`:t},y0=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Jt=(e,t,n,r)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Ms(typeof s.description=="string"?s.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(s.required=Array.from(new Set([...s.required??[],...t.required]))),t.properties){s.properties={...s.properties??{}};for(const[o,i]of Object.entries(t.properties)){if(!ce(i))continue;const a=s.properties[o];ce(a)?s.properties[o]=Jt(a,i):s.properties[o]=i}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((o,i)=>{const a=s.items[i];return ce(o)&&ce(a)?Jt(a,o):ce(o)?o:a}):s.items=t.items;else{const o=gn(t),i=gn(s);o&&i?s.items=Jt(i,o):o&&(s.items=t.items)}if(t.patternProperties&&ce(t.patternProperties)){const o={...ce(s.patternProperties)?s.patternProperties:{}};for(const[i,a]of Object.entries(t.patternProperties)){if(!ce(a)){o[i]=a;continue}const l=o[i];ce(l)?o[i]=Jt(l,a):o[i]=a}s.patternProperties=o}if(t.propertyNames!==void 0)if(ce(t.propertyNames)){const o=s.propertyNames;s.propertyNames=ce(o)?Jt(o,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ce(t.additionalProperties)){const o=s.additionalProperties;s.additionalProperties=ce(o)?Jt(o,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[o,i]of Object.entries(t))y0.has(o)||i===void 0||(s[o]=i);return s},hc=(e,t,n,r)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,f])=>ce(f)?[u,Ge(f,t,n,r)]:[u,f])));const o=gn(s);o&&(s.items=Ge(o,t,n,r));const i=Pr(s);i!==null&&ce(i)&&(s.propertyNames=Ge(i,t,n,r));const a=Vn(s);a!==null&&ce(a)&&(s.additionalProperties=Ge(a,t,n,r));const l=Ia(s);return l.length>0&&(s.patternProperties=Object.fromEntries(l.map(([u,f])=>[u,Ge(f,t,n,r)]))),s},Ge=(e,t,n,r=new Set)=>{if(r.has(e))return e;r.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const o=[];let i={};for(const f of s){if(!ce(f))continue;const{schema:d,circular:p}=Lt(f,t,n);if(p)continue;const h=Ge(d,t,n,r);if(h.if!==void 0){const m={if:h.if};h.then!==void 0&&(m.then=h.then),h.else!==void 0&&(m.else=h.else),o.push(m)}o.push(...qf(h)),i=Jt(i,h,t,n)}if(e.if!==void 0){const f={if:e.if};e.then!==void 0&&(f.then=e.then),e.else!==void 0&&(f.else=e.else),o.push(f)}const a={...e};delete a.allOf;const l=Object.keys(a).length>0?Jt(i,a,t,n):i,u=hc(l,t,n,r);if(o.length===1){const f=o[0];u.if=f.if,f.then!==void 0&&(u.then=f.then),f.else!==void 0&&(u.else=f.else)}else o.length>1&&(u._allOfConditionals=o);return u}return hc(e,t,n,r)}finally{r.delete(e)}},Rr=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>ce(r));return n.length>0?n:null},Ir=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>ce(r));return n.length>0?n:null},Uf=e=>e.not===void 0?null:typeof e.not=="boolean"||ce(e.not)?e.not:null,rt=e=>Uf(e)!==null,Hf=e=>{const{not:t,...n}=e;return n},x0=e=>{const{if:t,then:n,else:r,...s}=e;return s},at=e=>e.if!==void 0,Do=e=>e===void 0?null:typeof e=="boolean"||ce(e)?e:null,qf=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ce(t)):[],lt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Pr=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ce(e.propertyNames)?e.propertyNames:null,Vn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ce(e.additionalProperties)?e.additionalProperties:null,Ia=e=>{const t=e.patternProperties;return ce(t)?Object.entries(t).flatMap(([n,r])=>ce(r)?[[n,r]]:[]):[]},b0=(e,t)=>`${e}.[pattern:${t}]`,$r=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,eo=e=>{const t=Pr(e);if(t!==null&&ce(t))return!0;const n=Vn(e);return n!==null&&ce(n)?!0:Ia(e).length>0},zf=e=>!!(Rr(e)||Ir(e)||$r(e)||eo(e)||e.type==="array"||e.items||e.type!==void 0),yt=e=>!(rt(e)||at(e)||lt(e)||Rr(e)||Ir(e)||$r(e)||eo(e)||e.items||Ff(e)||e.type==="array"||e.type==="object");function v0(e){if(typeof Vn(e)=="boolean")return!0;const n=Pr(e);return!!(typeof n=="boolean"||n!==null&&ce(n)&&yt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function mc(e){return typeof e.multipleOf=="number"||typeof e.minimum=="number"||typeof e.exclusiveMinimum=="number"||typeof e.maximum=="number"||typeof e.exclusiveMaximum=="number"||typeof e.minLength=="number"||typeof e.maxLength=="number"||typeof e.minItems=="number"||typeof e.maxItems=="number"||typeof e.minProperties=="number"||typeof e.maxProperties=="number"||typeof e.pattern=="string"&&e.pattern.length>0||Array.isArray(e.enum)&&e.enum.length>0||e.const!==void 0||e.uniqueItems===!0||v0(e)}const Wf=(e,t)=>mc(e)?!0:t?mc(t):!1,w0=(e,t)=>{if(rt(e)||at(e)||lt(e)||Rr(e)||Ir(e)||$r(e)||eo(e))return!0;if(e.type==="array"||e.items){if(Ff(e)||Bf(e)!==null)return!0;const n=gn(e);if(!n)return!1;if(n.$ref&&t){const{schema:r}=Lt(n,t,pc),s=Ge(r,t,pc);return!yt(s)}return!yt(n)}return!1};function Vf(e){return JSON.stringify(e)}function gc(e){return typeof e=="string"?e:JSON.stringify(e)}function ut({children:e}){return c.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function Kf({children:e,mono:t=!1,title:n}){return c.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",title:n,children:t?c.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function S0(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function j0(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function E0(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function k0(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function yc(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function xc(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function rs({name:e,lower:t,upper:n,suffix:r}){return!t&&!n?null:c.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(ut,{children:String(t.value)}),c.jsx(ut,{children:t.op})]}),c.jsx(ut,{children:e}),n&&c.jsxs(c.Fragment,{children:[c.jsx(ut,{children:n.op}),c.jsx(ut,{children:String(n.value)})]}),r&&c.jsx(ut,{children:r})]})}function xs({value:e,displayValue:t}){const n=()=>{var o;(o=window.getSelection())!=null&&o.toString()||navigator.clipboard.writeText(gc(e))},r=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(gc(e)))};return c.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs font-medium text-foreground hover:bg-neutral-200",title:"Click to copy",onClick:n,onKeyDown:r,children:t??Vf(e)})}function T0({schema:e}){const t=Vn(e);return typeof t!="boolean"?null:c.jsx(ut,{children:t?"additional properties allowed":"additional properties not allowed"})}function A0({schema:e}){const t=Pr(e);return typeof t=="boolean"?c.jsx(Kf,{children:t?"any property name":"no property names"}):t!==null&&ce(t)&&yt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"property name pattern:"}),c.jsx(xs,{value:t.pattern,displayValue:t.pattern})]}):null}function bc({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,r=S0(e),s=j0(e),o=E0(e),i=k0(e),a=yc(e,"minItems"),l=xc(e,"maxItems"),u=yc(e,"minProperties"),f=xc(e,"maxProperties");return c.jsxs(c.Fragment,{children:[typeof e.multipleOf=="number"&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"multiple of :"}),c.jsx(Kf,{children:String(e.multipleOf)})]}),(r||s)&&c.jsx(rs,{name:t,lower:r,upper:s}),(o||i)&&c.jsx(rs,{name:t,lower:o,upper:i,suffix:"chars"}),(a||l)&&c.jsx(rs,{name:t,lower:a,upper:l,suffix:"items"}),(u||f)&&c.jsx(rs,{name:t,lower:u,upper:f,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"regex pattern:"}),c.jsx(xs,{value:e.pattern,displayValue:e.pattern})]}),n&&c.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[c.jsx(ut,{children:"enum values:"}),n.map((d,p)=>c.jsx(xs,{value:d},`${p}-${Vf(d)}`))]}),e.const!==void 0&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"const value:"}),c.jsx(xs,{value:e.const})]}),e.uniqueItems===!0&&c.jsx(ut,{children:"unique"}),c.jsx(T0,{schema:e}),c.jsx(A0,{schema:e})]})}function Jf({schema:e,itemSchema:t,fieldName:n,className:r="flex flex-col gap-1"}){const s=t!=null&&yt(t),o=n??"value";return c.jsxs("div",{className:r,children:[c.jsx(bc,{schema:e,rangeName:o}),s&&c.jsx(bc,{schema:t,rangeName:"item"})]})}const Yf=(e,t)=>{const n=Rr(e);if(n)return{text:`one of (${n.length})`};const r=Ir(e);if(r)return{text:`any of (${r.length})`};if(rt(e)&&!zf(Hf(e)))return{text:"not"};if(e.type==="array"||e.items){const u=gn(e);if(u){const f=u.type;if(f==="object"){const d=u.$ref?Ra(u.$ref):t;return d?{text:"Array of objects",refHint:d}:{text:"Array of objects"}}if(typeof f=="string"){const d=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${f}`,format:d}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let o=s?`${s}`:"type: unknown";const i=Vn(e);!$r(e)&&i!==null&&ce(i)&&(s==="object"||o==="type: unknown")&&(o=s==="object"?"object (map)":"map");const a=typeof e.format=="string"?e.format:void 0,l=t&&(s==="object"||o.startsWith("object"))?t:void 0;return{text:o,format:a,refHint:l}},O0=(e,t)=>{if(!t)return!1;const n=Yf(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Zf({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:r,format:s,refHint:o}=Yf(e,t);return c.jsxs("span",{className:n,children:[s??r,o&&!r.includes(`(${o})`)&&c.jsxs("span",{className:"text-foreground-muted",children:[" (",o,")"]})]})}const vc="ml-6";function ss({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return c.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[c.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),c.jsx(Zf,{schema:e})]}),Wf(e)&&c.jsx(Jf,{schema:e,className:`flex flex-col gap-1 mt-1 ${vc}`}),n&&n.split(`
121
+
122
+ `).map((r,s)=>c.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${vc} leading-relaxed`,children:r},s))]})}function Bo({children:e}){return c.jsxs("div",{className:"py-2",children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:"Should Not match:"}),c.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function N0({value:e}){const t=e?"any value":"false schema";return c.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:t})}function Xf({tabs:e,selected:t,onChange:n,ariaLabel:r}){const s=T.useRef([]),o=a=>(a+e.length)%e.length,i=(a,l)=>{var f;let u=l;a.key==="ArrowRight"&&(a.preventDefault(),u=o(l+1)),a.key==="ArrowLeft"&&(a.preventDefault(),u=o(l-1)),a.key==="Home"&&(a.preventDefault(),u=0),a.key==="End"&&(a.preventDefault(),u=e.length-1),u!==l&&(n(e[u].id),(f=s.current[u])==null||f.focus())};return c.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":r,children:e.map(({id:a,label:l},u)=>{const f=a===t;return c.jsx("button",{ref:d=>{s.current[u]=d},type:"button",role:"tab","aria-selected":f,tabIndex:0,onClick:()=>n(a),onKeyDown:d=>i(d,u),className:f?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:l},a)})})}function C0({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:r,onSelectCase:s,children:o}){if(t===0)return null;const i=(n==null?void 0:n.length)===t?n:Array.from({length:t},(u,f)=>`case ${f+1}`),a=e==="anyOf"?"Any of:":"One of:",l=e==="anyOf"?"Any of cases":"One of cases";return c.jsxs("div",{className:"py-2",children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:a}),c.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),c.jsx(Xf,{tabs:i.map((u,f)=>({id:String(f),label:u})),selected:String(r),onChange:u=>s(Number(u)),ariaLabel:l}),c.jsx("div",{role:"tabpanel",className:"mt-2",children:o})]})}const _0="ml-0 border-dashed border-border";function cn({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:r}=Ve();return n==="none"?c.jsx("div",{children:t}):n==="muted"?c.jsx("div",{className:`pl-3 border-l-2 ${_0}`,children:t}):c.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Qi(e,r)},children:t})}function R0({depth:e,expanded:t,onToggle:n}){const{depthColors:r}=Ve(),s=Qi(e,r);return c.jsxs("button",{type:"button",onClick:n,"aria-expanded":t,"aria-label":t?"Hide details":void 0,className:"cursor-pointer mt-1 flex items-center gap-1.5 shrink-0 text-left hover:opacity-80",children:[c.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:s,color:s},children:t?"−":"+"}),!t&&c.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const I0="ml-6";function nt({id:e,path:t,depth:n,schema:r,refLabel:s,itemSchema:o,typeLabelOverride:i,required:a,description:l,expandable:u,expanded:f,onToggle:d,showBorder:p=!0}){const{depthColors:h}=Ve(),m=Qi(n,h),g=r&&O0(r,s),v=u?I0:"";let j="",y=t;if(t.endsWith("[]")){const b=t.slice(0,-2),S=b.lastIndexOf(".");S>=0?(j=b.slice(0,S+1),y=`${b.slice(S+1)}[]`):y=t}else{const b=t.lastIndexOf("."),S=t.lastIndexOf("[]"),k=Math.max(b,S);k>=0&&(j=t.slice(0,k+(t[k]==="."?1:2)),y=t.slice(k+(t[k]==="."?1:2)))}return p=p&&!f,c.jsxs("div",{id:e,className:`py-2 ${p?"border-b border-border last:border-b-0":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[c.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[c.jsxs("span",{className:"truncate min-w-0",children:[j&&c.jsx("span",{className:"text-foreground-muted",children:j}),c.jsx("span",{className:"font-semibold",style:{color:m},children:y})]}),a&&c.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(r==null?void 0:r.readOnly)===!0&&c.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(r==null?void 0:r.writeOnly)===!0&&c.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(r==null?void 0:r.deprecated)===!0&&c.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),r?c.jsxs("div",{className:"shrink-0 text-right",children:[c.jsx(Zf,{schema:r,refLabel:s}),g&&c.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",s,")"]})]}):i&&c.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:i})]}),r&&Wf(r,o)&&c.jsx(Jf,{schema:r,itemSchema:o,fieldName:y,className:`flex flex-col gap-1 mt-1 ${v}`}),l&&l.split(`
123
+
124
+ `).map((b,S)=>c.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${v} leading-relaxed`,children:b},S)),u&&c.jsx(R0,{depth:n,expanded:f,onToggle:d})]})}function Fo({label:e,children:t}){return c.jsxs("div",{children:[c.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:c.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),c.jsx("div",{children:t})]})}function P0({ifContent:e,thenContent:t,elseContent:n}){return c.jsxs("div",{className:"py-2 pt-5 px-1",children:[c.jsx("div",{className:"flex flex-col items-start",children:c.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border-2 border-dashed border-border rounded-md bg-surface",children:"Conditions apply:"})}),c.jsx(cn,{depth:0,lineVariant:"muted",children:c.jsxs("div",{className:"divide-y divide-border",children:[c.jsx(Fo,{label:"If schema matches:",children:e}),t!=null&&c.jsx(Fo,{label:"Then schema should follow:",children:t}),n!=null&&c.jsx(Fo,{label:"Else schema should follow:",children:n})]})})]})}function os({label:e,children:t}){return c.jsxs("div",{className:"py-2",children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:e}),c.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const $0=e=>e==="none"?"depth":e;function gt({schema:e,path:t,depth:n,required:r,refStack:s,deref:o,suppressRow:i=!1,branchLineVariant:a="depth",defaultExpanded:l=!1,ancestors:u=h0,focusTokens:f=null,focusId:d=null}){var me;const p=$0(a),h=f!=null,g=h&&f.length===0?d??void 0:void 0,[v,j]=T.useState(l||h),[y,b]=T.useState(l);y!==l&&(b(l),j(l||h)),T.useEffect(()=>{h&&j(!0)},[h]);const[S,k]=T.useState(0),w=(me=f==null?void 0:f[0])==null?void 0:me.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),E=w?Number(w[1]):-1;T.useEffect(()=>{E>=0&&k(E)},[E]);const C=ga(),{schema:O,refLabel:A,circular:P}=T.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:Ii(e),circular:!0};const I=Lt(e,o,s);return I.circular?I:{...I,schema:Ge(I.schema,o,s)}},[e,o,s,u,C]),R=T.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),U=Hf(x0(O)),J=!zf(U)&&(rt(O)||at(O)||lt(O)),Z=()=>{const I=Uf(O);if(I===null)return null;if(typeof I=="boolean")return c.jsx(Bo,{children:c.jsx(N0,{value:I})});const Q=Lt(I,o,s);if(Q.circular)return c.jsx(Bo,{children:c.jsx(nt,{path:t,depth:n+1,typeLabelOverride:`↩ ${I.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ae=Ge(Q.schema,o,s),se=yt(ae);return c.jsx(Bo,{children:se?c.jsx(ss,{schema:ae,showBorder:!1}):c.jsx(gt,{schema:I,path:t,depth:n+1,refStack:s,deref:o,ancestors:R,suppressRow:!0,branchLineVariant:p,defaultExpanded:l})})},_=(I,Q)=>{if(typeof I=="boolean")return c.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:I?"any value":"false schema"});const ae=Lt(I,o,s);if(ae.circular)return c.jsx(nt,{path:Q,depth:n+1,typeLabelOverride:`↩ ${I.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const se=Ge(ae.schema,o,s);return yt(se)?c.jsx(ss,{schema:se,showBorder:!1}):c.jsx(gt,{schema:I,path:Q,depth:n+1,refStack:s,deref:o,ancestors:R,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l})},M=I=>{const Q=Do(I.if);if(Q===null)return null;const ae=Do(I.then),se=Do(I.else);return c.jsx(P0,{ifContent:_(Q,t),thenContent:ae!==null?_(ae,t):void 0,elseContent:se!==null?_(se,t):void 0})},K=()=>{const I=qf(O);return I.length===0?null:c.jsx(c.Fragment,{children:I.map((Q,ae)=>c.jsx("div",{children:M(Q)},ae))})};if(P)return c.jsx(nt,{id:g,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??A??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(J){const I=c.jsxs(c.Fragment,{children:[rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return i?I:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:A,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(Q=>!Q)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:I})]})}const Y=Rr(U),$=Ir(U),B=Y??$,D=Y?"oneOf":"anyOf";if(B){const I=B.map((Ke,ee)=>typeof Ke.title=="string"?Ke.title:`case ${ee+1}`),Q=i?1:n+1,ae=B[S],se=Lt(ae,o,s),ue=se.circular?se.schema:Ge(se.schema,o,s),fe=!se.circular&&yt(ue),pe=f&&E===S?f.slice(1):null,Ne=fe?c.jsx(ss,{schema:ue,showBorder:!1}):c.jsx(gt,{schema:ae,path:t,depth:Q-1,refStack:s,deref:o,ancestors:R,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l,focusTokens:pe,focusId:d},S),Se=c.jsx(C0,{variant:D,caseCount:B.length,caseLabels:I,selectedCase:S,onSelectCase:k,children:Ne}),Xe=c.jsxs(c.Fragment,{children:[Se,rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return i?Xe:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:A,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(Ke=>!Ke)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:Xe})]})}const L=(I,Q,ae)=>{const se=Lt(I,o,s);if(se.circular)return c.jsx(nt,{path:Q,depth:ae,typeLabelOverride:`↩ ${I.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ue=Ge(se.schema,o,s);return yt(ue)?c.jsx(ss,{schema:ue,showBorder:!1}):c.jsx(gt,{schema:I,path:Q,depth:ae,refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:l})},re=I=>{const Q=U.properties??{},ae=new Set(U.required??[]),se=Pr(U),ue=Vn(U),fe=Ia(U);return c.jsxs(c.Fragment,{children:[Object.entries(Q).map(([pe,Ne])=>{if(!ce(Ne))return null;const Se=f&&f[0]==="properties"&&f[1]===pe?f.slice(2):null;return c.jsx(gt,{schema:Ne,path:`${t}.${pe}`,depth:I,required:ae.has(pe),refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:l,focusTokens:Se,focusId:d},pe)}),se!==null&&ce(se)&&c.jsx(os,{label:"Property names must adhere to:",children:L(se,`${t}.[propertyName]`,I)}),fe.map(([pe,Ne])=>c.jsx(gt,{schema:Ne,path:b0(t,pe),depth:I,refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:l},pe)),ue!==null&&ce(ue)&&c.jsx(os,{label:"Additional properties must adhere to:",children:L(ue,`${t}.[additionalProperty]`,I)}),rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]})};if($r(U)||eo(U))return i?re(n+1):c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:A,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(I=>!I)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:re(n+1)})]});if(U.type==="array"||U.items){const I=Bf(U),Q=I!==null,ae=Q?m0(U):null,se=g0(U),ue=se!==null,fe=Q?null:gn(U),pe=fe!==null,Ne=Q||pe||ue||rt(O)||at(O)||lt(O),Se=`${t}[]`,Xe=i?t:Se,Ke=pe?Lt(fe,o,s):null,ee=(Ke==null?void 0:Ke.schema)??null,Ce=ee?Ge(ee,o,s):null,$e=ee!==null&&(R.objects.has(ee)||typeof(fe==null?void 0:fe.$ref)=="string"&&R.refs.has(fe.$ref)),we=ee!==null?{objects:new Set(R.objects).add(ee),refs:typeof(fe==null?void 0:fe.$ref)=="string"?new Set(R.refs).add(fe.$ref):R.refs}:R,It=!Q&&!ue&&Ce!==null&&yt(Ce),ft=Ce!=null&&Ce.properties?Object.entries(Ce.properties).filter(([,V])=>ce(V)):[],rn=new Set(Ce&&Array.isArray(Ce.required)?Ce.required:[]),dt=!Q&&f&&f[0]==="items"?f.slice(1):null,W=V=>c.jsxs(c.Fragment,{children:[Q?c.jsxs(c.Fragment,{children:[I.map((oe,ye)=>c.jsx(gt,{schema:oe,path:`${t}[${ye}]`,depth:V,refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:l},ye)),ae!==null&&typeof ae!="boolean"&&c.jsx(os,{label:"Additional items:",children:L(ae,`${t}[*]`,V)}),ae===!1&&c.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):pe&&($e?c.jsx(nt,{path:Xe,depth:V,typeLabelOverride:`↩ ${fe.$ref??Ii(ee)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):ft.length>0?ft.map(([oe,ye])=>{const Me=dt&&dt[0]==="properties"&&dt[1]===oe?dt.slice(2):null;return c.jsx(gt,{schema:ye,path:`${Xe}.${oe}`,depth:V,required:rn.has(oe),refStack:s,deref:o,ancestors:we,branchLineVariant:p,defaultExpanded:l,focusTokens:Me,focusId:d},oe)}):c.jsx(gt,{schema:fe,path:Xe,depth:V,refStack:s,deref:o,ancestors:we,branchLineVariant:p,defaultExpanded:l,focusTokens:dt,focusId:d})),ue&&c.jsx(os,{label:"Contains at least one:",children:typeof se=="boolean"?c.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:se?"any item":"impossible constraint"}):L(se,`${t}[contains]`,V)}),rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return It&&!rt(O)&&!at(O)&&!lt(O)?c.jsx(nt,{id:g,path:Se,depth:n,schema:O,itemSchema:Ce,refLabel:A,required:r,description:Ms(O.description,Ce.description),expandable:!1,expanded:!1,onToggle:()=>{}}):It?c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:Se,depth:n,schema:O,itemSchema:Ce,refLabel:A,required:r,description:Ms(O.description,Ce.description),expandable:!0,expanded:v,onToggle:()=>j(V=>!V)}),v&&c.jsxs(cn,{depth:n,lineVariant:a,children:[rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]})]}):i?Ne?W(n+1):null:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:Se,depth:n,schema:O,itemSchema:Ce,refLabel:A,required:r,description:O.description,expandable:Q||pe||ue||rt(O)||at(O)||lt(O),expanded:v,onToggle:()=>j(V=>!V)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:W(n+1)})]})}if(rt(O)||at(O)||lt(O)){const I=c.jsxs(c.Fragment,{children:[rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return i?I:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:A,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(Q=>!Q)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:I})]})}return i?null:c.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:A,required:r,description:O.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Pa({schema:e,rootName:t,className:n="",focusTokens:r=null,focusId:s=null}){const{deref:o,defaultSchemaExpanded:i=!1}=Ve(),a=T.useMemo(()=>new Set,[]),l=$t(e),u=T.useMemo(()=>l?Ge(l,o,a):null,[l,o,a]);if(!l||!u)return c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const f=t??(l.$ref?Ra(l.$ref):void 0)??"schema",d=!!t;if(!w0(u,o)&&!l.$ref){if(d)return u.type==="array"||u.items?c.jsx("div",{className:n,children:c.jsx(gt,{schema:l,path:f,depth:0,refStack:a,deref:o,defaultExpanded:i,focusTokens:r,focusId:s})}):null;const h=u.type==="array"||u.items?`${f}[]`:f,m=gn(u),g=m?Ge(m,o,a):null,v=g!==null&&yt(g);return c.jsx("div",{className:n,children:c.jsx(nt,{path:h,depth:0,schema:u,itemSchema:v?g:void 0,description:u.type==="array"||u.items?Ms(u.description,m==null?void 0:m.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return c.jsx("div",{className:n,children:c.jsx(gt,{schema:l,path:f,depth:d?-1:0,refStack:a,deref:o,suppressRow:d,defaultExpanded:i,focusTokens:r,focusId:s})})}function M0(e){let t=e|0;return()=>{t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function Qf(e){let t=M0(e),n={next(){return t()},int(r,s){return r+Math.floor(n.next()*(s-r+1))},bool(r=.5){return n.next()<r},pick(r){return r[n.int(0,r.length-1)]},shuffle(r){let s=[...r];for(let o=s.length-1;o>0;o--){let i=n.int(0,o);[s[o],s[i]]=[s[i],s[o]]}return s},fork(){let r=Math.floor(n.next()*4294967296);return Qf(r)}};return n}function L0(e){return null}function D0(e){return e.random.bool()}function Gf(e,t,n=!1){let r=-1e3,s=1e3,o=!1,i=!1;if(e.minimum!==void 0&&(r=e.minimum),e.maximum!==void 0&&(s=e.maximum),e.exclusiveMinimum!==void 0&&(r=e.exclusiveMinimum,o=!0),e.exclusiveMaximum!==void 0&&(s=e.exclusiveMaximum,i=!0),e.multipleOf!==void 0)return B0(e.multipleOf,r,s,o,i,t);if(n){let u=o?Math.floor(r)+1:Math.ceil(r),f=i?Math.ceil(s)-1:Math.floor(s);return t.random.int(u,f)}let a=o?r+Number.EPSILON:r,l=i?s-Number.EPSILON:s;return a+t.random.next()*(l-a)}function B0(e,t,n,r,s,o){let i=Math.ceil(t/e),a=Math.floor(n/e);return r&&i*e===t&&i++,s&&a*e===n&&a--,i>a?i*e:o.random.int(i,a)*e}function F0(e,t){if(e.autoIncrement){let n=e.initialOffset??1,r=U0(t.path),s=t.autoIncrementCounters??new Map,o=(s.get(r)??n-1)+1;return s.set(r,o),t.autoIncrementCounters&&t.autoIncrementCounters.set(r,o),o}return Gf(e,t,!0)}function U0(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function wc(e,t){let n=ed(e,0);return cr(n.node,t)}function cr(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return H0(e,t);case"sequence":return e.nodes.map(n=>cr(n,t)).join("");case"alternation":return cr(t.pick(e.branches),t);case"quantifier":{let n=t.int(e.min,Math.min(e.max,e.min+5));return Array.from({length:n},()=>cr(e.node,t)).join("")}case"group":return cr(e.node,t)}}function H0(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),r=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(s=>!n.has(s));return r.length>0?t.pick(r):"a"}function ed(e,t){let n=[],r=[];for(;t<e.length;){let s=e[t];if(s===")")break;if(s==="|"){n.push(Sc(r)),r=[],t++;continue}if(s==="("){let a=t+1;if(e[a]==="?")if(e[a+1]===":")a+=2;else if(e[a+1]==="="||e[a+1]==="!"){let d=1,p=a;for(;p<e.length&&d>0;)p++,e[p]==="("&&d++,e[p]===")"&&d--;t=p+1;continue}else{for(a+=2;a<e.length&&e[a]!==">";)a++;a++}let l=ed(e,a),u={type:"group",node:l.node};t=l.pos+1;let f=ar(e,t,u);r.push(f.node),t=f.pos;continue}if(s==="["){let a=z0(e,t),l=ar(e,a.pos,a.node);r.push(l.node),t=l.pos;continue}if(s==="."){let a={type:"dot"};t++;let l=ar(e,t,a);r.push(l.node),t=l.pos;continue}if(s==="^"||s==="$"){r.push({type:"anchor"}),t++;continue}if(s==="\\"){t++;let a=q0(e,t);t=a.pos;let l=ar(e,t,a.node);r.push(l.node),t=l.pos;continue}let o={type:"literal",value:s};t++;let i=ar(e,t,o);r.push(i.node),t=i.pos}return n.push(Sc(r)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function Sc(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function q0(e,t){let n=e[t];switch(t++,n){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:t};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:t};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:t};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:t};case"s":return{node:{type:"charClass",chars:[...`
125
+ `],negated:!1},pos:t};case"S":return{node:{type:"charClass",chars:[...`
126
+ `],negated:!0},pos:t};case"b":case"B":return{node:{type:"anchor"},pos:t};default:return{node:{type:"literal",value:n},pos:t}}}function z0(e,t){t++;let n=!1;e[t]==="^"&&(n=!0,t++);let r=[];for(;t<e.length&&e[t]!=="]";){if(e[t]==="\\"&&t+1<e.length){t++;let s=e[t];switch(s){case"d":r.push(..."0123456789");break;case"w":r.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":r.push(...`
127
+ `);break;default:r.push(s)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let s=e.charCodeAt(t),o=e.charCodeAt(t+2);for(let i=s;i<=o;i++)r.push(String.fromCharCode(i));t+=3;continue}r.push(e[t]),t++}return t++,{node:{type:"charClass",chars:r,negated:n},pos:t}}function ar(e,t,n){if(t>=e.length)return{node:n,pos:t};let r=e[t],s,o;switch(r){case"*":s=0,o=5,t++;break;case"+":s=1,o=5,t++;break;case"?":s=0,o=1,t++;break;case"{":{let i=W0(e,t);if(i)s=i.min,o=i.max,t=i.pos;else return{node:n,pos:t};break}default:return{node:n,pos:t}}return t<e.length&&(e[t]==="?"||e[t]==="+")&&t++,{node:{type:"quantifier",node:n,min:s,max:o},pos:t}}function W0(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let r=parseInt(n[1],10),s;return n[2]===void 0?s=r:n[2]===""?s=r+5:s=parseInt(n[2],10),{min:r,max:s,pos:t+n[0].length}}function xt(e){return e<10?`0${e}`:`${e}`}function V0(e,t){return new Date(e,t,0).getDate()}var td="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function K0(e){return!(e==="^"||e==="$"||e==="^$")}function J0(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return Y0(t);let i=t.formatRegistry.get(e.format);if(i){let a=i(t.random),l=t.minLength??e.minLength,u=t.maxLength??e.maxLength;return l!==void 0&&a.length<l?Uo(a,l,t):u!==void 0&&a.length>u?a.slice(0,u):a}}if(e.pattern){let i=t.minLength??e.minLength,a=t.maxLength??e.maxLength;for(let f=0;f<50;f++){let d=wc(e.pattern,t.random);if(!(i!==void 0&&d.length<i)&&!(a!==void 0&&d.length>a))return d}let l=wc(e.pattern,t.random),u=K0(e.pattern);return i!==void 0&&l.length<i&&u?Uo(l,i,t):a!==void 0&&l.length>a?l.slice(0,a):l}let n=e.minLength??0,r=e.maxLength??Math.max(n+10,10),s=t.random.int(n,r),o="";for(let i=0;i<s;i++)o+=t.random.pick([...td]);return t.maxLength!==void 0&&o.length>t.maxLength&&(o=o.slice(0,t.maxLength)),t.minLength!==void 0&&o.length<t.minLength&&(o=Uo(o,t.minLength,t)),o}function Uo(e,t,n){for(;e.length<t;)e+=n.random.pick([...td]);return e}function Y0(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,r=t.getTime(),s=n.getTime(),o=r+e.random.next()*(s-r),i=new Date(o),a=i.getFullYear(),l=xt(i.getMonth()+1),u=xt(i.getDate());return`${a}-${l}-${u}T01:01:01.0Z`}function jc(e,t){if(e.const!==void 0)return structuredClone(e.const);if(e.enum!==void 0&&e.enum.length>0){let n=e.enum;if(e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0){let s=e.exclusiveMinimum??e.minimum??-1/0,o=e.exclusiveMaximum??e.maximum??1/0,i=e.exclusiveMinimum!==void 0,a=e.exclusiveMaximum!==void 0;n=n.filter(l=>{if(typeof l!="number")return!0;let u=i?l>s:l>=s,f=a?l<o:l<=o;if(!u||!f)return!1;if(e.multipleOf!==void 0){let d=e.multipleOf,p=d.toString().includes(".")?d.toString().split(".")[1].length:0,h=Math.pow(10,p),m=Math.round(l*h),g=Math.round(d*h);if(m%g!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let s=e.minLength??0,o=e.maxLength??1/0;n=n.filter(i=>typeof i!="string"?!0:i.length>=s&&i.length<=o)}if(e.minItems!==void 0||e.maxItems!==void 0){let s=e.minItems??0,o=e.maxItems??1/0;n=n.filter(i=>Array.isArray(i)?i.length>=s&&i.length<=o:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let s=e.minProperties??0,o=e.maxProperties??1/0;n=n.filter(i=>typeof i!="object"||i===null||Array.isArray(i)?!0:Object.keys(i).length>=s&&Object.keys(i).length<=o)}if(n.length===0){let s=[];throw e.minLength!==void 0&&s.push(`minLength: ${e.minLength}`),e.maxLength!==void 0&&s.push(`maxLength: ${e.maxLength}`),e.minItems!==void 0&&s.push(`minItems: ${e.minItems}`),e.maxItems!==void 0&&s.push(`maxItems: ${e.maxItems}`),e.minProperties!==void 0&&s.push(`minProperties: ${e.minProperties}`),e.maxProperties!==void 0&&s.push(`maxProperties: ${e.maxProperties}`),e.minimum!==void 0&&s.push(`minimum: ${e.minimum}`),e.maximum!==void 0&&s.push(`maximum: ${e.maximum}`),e.exclusiveMinimum!==void 0&&s.push(`exclusiveMinimum: ${e.exclusiveMinimum}`),e.exclusiveMaximum!==void 0&&s.push(`exclusiveMaximum: ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&s.push(`multipleOf: ${e.multipleOf}`),Error(`enum values conflict with constraints [${s.join(", ")}] at ${t.path}`)}let r=t.random.pick(n);return typeof r=="object"&&r!==null?structuredClone(r):r}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Ct(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}rd(t,n)}return t}function nd(e,t){if(typeof e=="boolean"||typeof t=="boolean")return{};if(typeof e!="object"||e===null)return typeof t=="object"&&t!==null?t:{};if(typeof t!="object"||t===null)return e;let n={...e};return rd(n,t),n}function rd(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=Z0(e.type,t.type)),t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.max(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.min(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=e.exclusiveMinimum!==void 0?Math.max(e.exclusiveMinimum,t.exclusiveMinimum):t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=e.exclusiveMaximum!==void 0?Math.min(e.exclusiveMaximum,t.exclusiveMaximum):t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.max(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.min(e.maxLength,t.maxLength):t.maxLength),t.pattern!==void 0&&(e.pattern=t.pattern),t.format!==void 0&&(e.format=t.format),t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.max(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.min(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.items!==void 0&&(e.items=t.items),t.prefixItems!==void 0)if(e.prefixItems===void 0)e.prefixItems=t.prefixItems;else{let n=[],r=Math.max(e.prefixItems.length,t.prefixItems.length);for(let s=0;s<r;s++){let o=e.prefixItems[s],i=t.prefixItems[s];o!==void 0&&i!==void 0?n.push(nd(o,i)):o!==void 0?n.push(o):i!==void 0&&n.push(i)}e.prefixItems=n}if(t.contains!==void 0&&(e.containsAll!==void 0?e.containsAll=[...e.containsAll,t.contains]:e.contains!==void 0?(e.containsAll=[e.contains,t.contains],delete e.contains):e.contains=t.contains),t.properties&&(e.properties=X0(e.properties??{},t.properties)),t.required&&(e.required=[...new Set([...e.required??[],...t.required])]),t.additionalProperties!==void 0&&(e.additionalProperties=t.additionalProperties),t.patternProperties&&(e.patternProperties={...e.patternProperties??{},...t.patternProperties}),t.minProperties!==void 0&&(e.minProperties=e.minProperties!==void 0?Math.max(e.minProperties,t.minProperties):t.minProperties),t.maxProperties!==void 0&&(e.maxProperties=e.maxProperties!==void 0?Math.min(e.maxProperties,t.maxProperties):t.maxProperties),t.const!==void 0&&(e.const=t.const),t.enum!==void 0)if(e.enum!==void 0){let n=new Set(t.enum.map(r=>JSON.stringify(r)));e.enum=e.enum.filter(r=>n.has(JSON.stringify(r)))}else e.enum=t.enum;t.$ref&&(e.$ref=t.$ref),t.$defs&&(e.$defs={...e.$defs??{},...t.$defs}),t.allOf&&(e.allOf=[...e.allOf??[],...t.allOf]),t.anyOf&&(e.anyOf=t.anyOf),t.oneOf&&(e.oneOf=t.oneOf)}function Z0(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],s=n.filter(o=>r.includes(o));return s.length===0?n[0]:s.length===1?s[0]:s}function X0(e,t){let n={...e};for(let[r,s]of Object.entries(t)){let o=e[r];o===void 0?n[r]=s:typeof o=="object"&&typeof s=="object"?n[r]=nd(o,s):n[r]=s}return n}var to=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function sd(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>to.has(t))}function Ec(e,t){if(typeof t!="object"||t===null)return!1;let n=t;return n.const!==void 0?e===n.const:n.enum!==void 0?n.enum.some(r=>r===e):!1}function Q0(e){return typeof e=="boolean"?!e:typeof e!="object"||e===null?!1:e.not===!0||typeof e.not=="object"&&e.not!==null&&Object.keys(e.not).length===0}function G0(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[r,s]of Object.entries(e))to.has(r)||(sd(s)?(t[r]=s,n=!0):(t[r]={const:s},n=!0));if(n)return t}return{}}function ex(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function tx(e,t){var y;let n=G0(e),r=ex(e,n);if(t.depth>=t.maxDepth){if(r.length===0)return{};let b={};for(let S of r){let k=n[S];if(k&&typeof k=="object"&&k!==null){let w=k;w.const!==void 0?b[S]=w.const:w.default!==void 0?b[S]=w.default:w.enum!==void 0&&w.enum.length>0?b[S]=w.enum[0]:b[S]=ox(w.type)}else b[S]=null}return b}if(e.additionalProperties===!1){let b=Object.keys(n).length>0,S=e.patternProperties&&Object.keys(e.patternProperties).length>0,k=new Set(Object.keys(n)),w=[...new Set(r)].filter(E=>!k.has(E));if((e.minProperties??0)>0&&!b&&!S)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(w.length>0&&!S&&!b)throw Error(`missing properties for ${w.join(", ")} in ${t.path}: additionalProperties is false but required properties not defined in properties`)}let s=t.path==="/"?"/properties":`${t.path}/properties`,o={...t,depth:t.depth+1,path:s},i={},a=new Set,l=new Set(r),u=t.alwaysFakeOptionals??!1,f=t.fillProperties??!0,d=t.fixedProbabilities??!1,p=t.optionalsProbability??.5,h=Object.keys(n).filter(b=>!l.has(b)),m;if(d&&!u&&h.length>0){let b=Math.round(h.length*p);m=new Set(h.slice(0,b))}let g=b=>u?!0:m?m.has(b):t.random.bool(p);if(Object.keys(n).length>0)for(let[b,S]of Object.entries(n)){if(Q0(S))continue;a.add(b);let k=Vt(o,b),w=l.has(b),E=typeof S=="object"&&S!==null&&S.type==="object",C=S;if(e.patternProperties&&typeof S=="object"&&S!==null){let O=[];for(let[A,P]of Object.entries(e.patternProperties))try{new RegExp(A).test(b)&&O.push(P)}catch{}O.length>0&&(C=Ct([S,...O]))}if(w){let O=await ve(C,k);O!==void 0&&(i[b]=O)}else if(g(b)){let O=await ve(C,k);O!==void 0&&(i[b]=O)}else if(E&&!f){let O=S.required??[];if(O.length>0){let A={};for(let P of O){let R=(S.properties??{})[P]??{},U=Vt(k,P),J=await ve(R,U);J!==void 0&&(A[P]=J)}i[b]=A}}}for(let b of l)if(!(i[b]!==void 0||a.has(b))){if(e.patternProperties){let S=[];for(let[k,w]of Object.entries(e.patternProperties))new RegExp(k).test(b)&&S.push(w);if(S.length>0){let k=S.length===1?S[0]:Ct(S),w=Vt(o,b),E=await ve(k,w);E!==void 0&&(i[b]=E),a.add(b)}}if(!a.has(b)){let S=e.additionalProperties??!0;if(S!==!1){let k=Vt(o,b),w=await ve(S===!0?{}:S,k);w!==void 0&&(i[b]=w),a.add(b)}}}if(e.dependencies){for(let[b,S]of Object.entries(e.dependencies))if(!(typeof S!="object"||S===null||Array.isArray(S))&&i[b]!==void 0&&!a.has(b+"_dep")){a.add(b+"_dep");let k=S.oneOf??S.anyOf??S.allOf??[S],w=null;for(let E of k){if(typeof E!="object"||E===null)continue;let{properties:C,not:O}=E;if(C&&C[b]){let A=C[b],P=i[b];if(Ec(P,A)){w=E;break}}if(O!=null&&O.properties){let A=O.properties[b];if(A){let P=i[b];if(!Ec(P,A)){w=E;break}}}}if(!w&&k.length>0&&typeof k[0]=="object"&&(w=k[0]),w!=null&&w.not){let E=w.not;if(E.required&&Array.isArray(E.required))for(let C of E.required)delete i[C]}if(w!=null&&w.required)for(let E of w.required){if(E===b||i[E]!==void 0)continue;let C=((y=w.properties)==null?void 0:y[E])??{type:"object"},O=Vt(o,E),A=await ve(C,O);A!==void 0&&(i[E]=A)}if(w&&w.properties)for(let[E,C]of Object.entries(w.properties)){if(E===b)continue;let O=Vt(o,E),A=await ve(C,O);A!==void 0&&(i[E]=A)}}}let v=e.minProperties??0,j=e.maxProperties;if(Object.keys(i).length<v){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let b=Object.entries(e.patternProperties),S=0,k=1e3;for(;Object.keys(i).length<v&&S<k;){S++;let[w,E]=t.random.pick(b),C=sx(w,t);if(C&&!i[C]){let O=Vt(o,C),A=await ve(E,O);A!==void 0&&(i[C]=A),a.add(C)}}}if(Object.keys(i).length<v){let b=e.additionalProperties,S=b===void 0||b===!0?{type:"string"}:b;if(S!==!1){let k=0,w=1e3;for(;Object.keys(i).length<v&&k<w;){k++;let E=`prop${t.random.int(0,99999)}`;if(!i[E]){let C=Vt(o,E),O=await ve(S,C);O!==void 0&&(i[E]=O),a.add(E)}}}}if(Object.keys(i).length<v){let b=Object.keys(n).join(", ");throw Error(`properties '${b}' were not found while additionalProperties is false in ${t.path}`)}}if(j!==void 0&&Object.keys(i).length>j){let b=Object.keys(i).filter(S=>!l.has(S));for(t.random.shuffle(b);Object.keys(i).length>j&&b.length>0;){let S=b.pop();delete i[S]}}return t.pruneProperties&&t.pruneProperties.length>0&&Pi(i,t.pruneProperties),rx(i,n),i}function Vt(e,t){let n=nx(t),r=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:r}}function nx(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function rx(e,t){for(let[n,r]of Object.entries(t)){if(typeof r!="object"||r===null)continue;let s=r;if(s.template===void 0)continue;let o=s.template;if(typeof o!="string")continue;let i=o.replace(/#\{(\w+)\}/g,(a,l)=>{let u=e[l];return u!==void 0?String(u):""});e[n]=i}}function sx(e,t){let n=e.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(n){let l=n[1],u=n[2];if(u===".*"||u!=null&&u.includes("?:")){let f=t.random.int(0,10),d="";for(let p=0;p<f;p++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return l+d}return l}let r=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(r){let l=r[2],u=t.random.int(1,10),f="";for(let d=0;d<u;d++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return f+l}let s=e.match(/^\^([a-zA-Z]+)\$$/);if(s)return s[1];let o=t.random.int(3,10),i="abcdefghijklmnopqrstuvwxyz",a="";for(let l=0;l<o;l++)a+=t.random.pick(i.split(""));try{if(new RegExp(e).test(a))return a}catch{}return null}function Pi(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let r of e)Pi(r,t);return}let n=e;for(let r of Object.keys(n))t.includes(r)?delete n[r]:Pi(n[r],t)}function ox(e){switch(Array.isArray(e)?e[0]:e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}async function ix(e,t){var j;if(t.depth>=t.maxDepth){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}if(t.refDepthReached){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let y=((j=e.prefixItems)==null?void 0:j.length)??0;if((e.minItems??0)>y)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${y})`)}let n=t.path==="/"?"/items":`${t.path}/items`,r={...t,depth:t.depth+1,path:n},s=[],o=t.refDepthMax,i=t.minItems??e.minItems??0,a=t.maxItems??e.maxItems??Math.max(i,t.maxDefaultItems);e.maxItems!==void 0&&a>e.maxItems&&(a=e.maxItems),e.minItems!==void 0&&i<e.minItems&&(i=e.minItems),a<i&&(e.maxItems!==void 0?i=a:a=i),t.alwaysFakeOptionals&&(a=Math.max(i,a));let l=e.uniqueItems?new Set:null,u=async(y,b)=>{let S=await ve(y,b);if(S===void 0)return"omitted";if(l){let k=JSON.stringify(S);if(l.has(k)){for(let w=0;w<50;w++){if(S=await ve(y,Kt(r,s.length)),S===void 0)continue;let E=JSON.stringify(S);if(!l.has(E))return l.add(E),s.push(S),"added"}return"failed"}l.add(k)}return s.push(S),"added"};if(e.prefixItems)for(let y=0;y<e.prefixItems.length&&s.length<a;y++){let b=Kt(r,y);if(await u(e.prefixItems[y],b)==="failed")break}let f;if(o!==void 0&&t.refDepth>=o-1){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}let d=t.alwaysFakeOptionals??!1,p=t.fixedProbabilities??!1,h=t.optionalsProbability??.5;if(d)f=a;else if(p){let y=a-Math.max(i,s.length),b=Math.round(y*h);f=Math.max(i,s.length)+b}else f=t.random.int(Math.max(i,s.length),a);e.items;let m=e.prefixItems!==void 0,g=e.additionalItems!==void 0,v;if(m?g?v=e.additionalItems:e.items!==void 0&&(v=e.items):v=e.items,v!==!1&&v!==void 0){let y=v??{},b=0,S=Math.max(f*20,50);for(;s.length<f;){let k=await u(y,Kt(r,s.length));if(k==="added"){b=0;continue}if(b++,k==="failed"||b>=S)break}}if(e.contains){let y=e.minContains??1,b=e.maxContains??Math.max(y,1),S=t.random.int(y,b);for(let k=0;k<S;k++){let w=await ve(e.contains,Kt(r,s.length));if(w!==void 0){if(l){let E=JSON.stringify(w);if(l.has(E)){let C=!1;for(let O=0;O<50;O++){if(w=await ve(e.contains,Kt(r,s.length)),w===void 0)continue;let A=JSON.stringify(w);if(!l.has(A)){l.add(A),C=!0;break}}if(!C)continue}else l.add(E)}if(s.length<a){let E=t.random.int(0,s.length);s.splice(E,0,w)}else if(s.length>0){let E=t.random.int(0,s.length-1);s[E]=w}}}for(;s.length>a;)s.pop()}if(e.containsAll){let y=new Set;for(let b of e.containsAll){let S=await ve(b,Kt(r,s.length));if(S!==void 0){if(l){let k=JSON.stringify(S);if(l.has(k)){let w=!1;for(let E=0;E<50;E++){if(S=await ve(b,Kt(r,s.length)),S===void 0)continue;let C=JSON.stringify(S);if(!l.has(C)){l.add(C),w=!0;break}}if(!w)continue}else l.add(k)}if(s.length<a){let k=t.random.int(0,s.length);s.splice(k,0,S);let w=new Set;for(let E of y)w.add(E>=k?E+1:E);y.clear();for(let E of w)y.add(E);y.add(k)}else if(s.length>0){let k=Array.from({length:s.length},(w,E)=>E).filter(w=>!y.has(w));if(k.length>0){let w=k[t.random.int(0,k.length-1)];s[w]=S,y.add(w)}else s.push(S),y.add(s.length-1)}}}for(;s.length>a;)s.pop()}return e.uniqueItems&&s.length>0?ax(s,e,r,i,a,l):s}async function ax(e,t,n,r,s,o){let i=t.items??{},a=0,l=100;for(;e.length<r&&a<l;){a++;let u=await ve(i,Kt(n,e.length));if(u===void 0)continue;let f=JSON.stringify(u);o.has(f)||(o.add(f),e.push(u))}for(;e.length>s;)e.pop();return e}function Kt(e,t){let n=e.outputPath==="/"?`/${t}`:`${e.outputPath}/${t}`;return{...e,path:`${e.path}/${t}`,outputPath:n}}function kc(e,t){if(!t||t==="")return e;if(typeof e!="object"||e===null)throw Error(`Cannot resolve fragment "${t}" in non-object schema`);if(t.startsWith("/"))return lx(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function lx(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),r=e;for(let s of n){let o=s.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof r!="object"||r===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${o}"`);if(Array.isArray(r)){let i=parseInt(o,10);if(isNaN(i)||i<0||i>=r.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${o}"`);r=r[i]}else{if(!(o in r))throw Error(`Cannot resolve JSON pointer "${t}": property "${o}" not found`);r=r[o]}}return r}function cx(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,r=n.$id,{$id:s,...o}=n;t.set(r,o)}if(e.$defs)for(let[n,r]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,r);return t}async function Ls(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let r=t.refDepth+1;if(t.refDepthMax!==void 0&&r>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}};if(t.refStack.has(n)){if(t.refDepthMax!==void 0){if(t.refDepth>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}}}else if(t.depth>=t.maxDepth)return{schema:{type:"null"},ctx:t}}let s,o;if(n.startsWith("#/")){if(s=t.refRegistry.get(n),s===void 0&&n.length>2){let d=t.refRegistry.get("#");if(d!==void 0&&typeof d=="object")try{s=kc(d,n.slice(1))}catch{}}s===void 0&&t.refResolver&&(s=await t.refResolver(n),s!==void 0&&t.refRegistry.set(n,s))}else if(n==="#")s=t.refRegistry.get("#")??{};else if(s=t.refRegistry.get(n),s===void 0&&t.refResolver){o=await t.refResolver(n);let d=n.indexOf("#");if(d!==-1){let p=n.slice(d+1);p?s=kc(o,p):s=o}else s=o;if(o&&typeof o=="object"&&o!==null){let p=o;if(p.$defs)for(let[h,m]of Object.entries(p.$defs))t.refRegistry.set(`#/$defs/${h}`,m)}}if(s===void 0)throw Error(`Unresolved $ref: ${n}`);let i=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:a,...l}=e,u=Object.fromEntries(Object.entries(l).filter(([d])=>!i.has(d)));Object.keys(u).length>0&&typeof s=="object"&&s!==null&&(s={...s,...u});let f={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:s,ctx:f}}function ux(e,t){typeof e!="boolean"&&(t.set("#",e),$i(e,"#",t))}function $i(e,t,n){if(e.$id){let{$id:r,...s}=e;n.set(r,s)}if(e.$defs)for(let[r,s]of Object.entries(e.$defs)){let o=`${t}/$defs/${r}`;n.set(o,s),typeof s=="object"&&s!==null&&$i(s,o,n)}if(e.properties)for(let[r,s]of Object.entries(e.properties))typeof s=="object"&&s!==null&&$i(s,`${t}/properties/${r}`,n)}async function fx(e,t){return e.$ref?(await Ls(e,t)).schema:e}async function dx(e,t){let n=[];for(let r of e)if(typeof r=="object"&&r!==null&&"$ref"in r){let s=await fx(r,t);n.push(s)}else typeof r=="object"&&r!==null&&n.push(r);return n}async function px(e,t){let{allOf:n,anyOf:r,oneOf:s,not:o,if:i,then:a,else:l,...u}=e;if(n){let f=await dx(n,t),d=Ct([u,...f]);return ve(d,t)}if(s){let f=t.random.shuffle([...s]),d=u.required??[];for(let b of f){let S=typeof b=="object"&&b!==null?b:{};S.$ref&&(S=(await Ls(S,t)).schema);let k=S.required??[],w=[...new Set([...d,...k])],E={...u,required:w},C=Ct([E,S]),O={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await ve(C,O)}catch{}}let p=s[0],h=typeof p=="object"&&p!==null?p:{};h.$ref&&(h=(await Ls(h,t)).schema);let m=h.required??[],g=[...new Set([...d,...m])],v={...u,required:g},j=Ct([v,h]),y={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return ve(j,y)}if(r){let f=t.random.shuffle([...r]);for(let h of f){let m=Ct([u,h]);try{return await ve(m,t)}catch{}}let d=r[0],p=Ct([u,d]);return ve(p,t)}return i!==void 0?hx(u,i,a,l,t):o?mx(u,o,t):ve(u,t)}async function hx(e,t,n,r,s){if(n!==void 0){let o=Ct([e,t,n]);try{return await ve(o,s)}catch{}}if(r!==void 0){let o=Ct([e,r]);try{return await ve(o,s)}catch{}}return ve(e,s)}async function mx(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return ve(e,n)}if(t.type&&!t.enum&&!t.const){let r=Array.isArray(t.type)?t.type:[t.type],s=["string","number","integer","boolean","null","object","array"].filter(o=>!r.includes(o));if(s.length>0){let o=n.random.pick(s),i=Ct([e,{type:o}]);return ve(i,n)}}if(t.const!==void 0||t.enum!==void 0){let r=t.enum??[t.const],s=new Set(r.map(o=>JSON.stringify(o)));for(let o=0;o<20;o++){let i=await ve(e,n);if(!s.has(JSON.stringify(i)))return i}}return ve(e,n)}class gx{constructor(){Ee(this,"extensions",new Map)}define(t,n){this.extensions.set(t,{callback:n,context:{}})}has(t){return this.extensions.has(t)}reset(t){if(t){let n=this.extensions.get(t);n&&(n.context={},this.extensions.delete(t))}else this.extensions.clear()}keys(){return this.extensions.keys()}generate(t,n){let r=Object.keys(t);for(let s=r.length-1;s>=0;s--){let o=r[s],i=o.startsWith("x-")?o.slice(2):o,a=this.extensions.get(i);if(a){let l=t[o],u=a.callback.call(a.context,l,t,n);if(u!==void 0)return u}}}getContext(t){var n;return(n=this.extensions.get(t))==null?void 0:n.context}}var yx=new gx;function xx(e,t){return yx.generate(e,t)}var bx=["string","number","integer","boolean","null","object","array"];function Tc(e,t,n){if(e.faker!==void 0&&e.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${t.path}`);if(e.faker!==void 0)try{let r=vx(e.faker,t),s=Oc(r,n??e.type,t.path);return typeof s=="string"&&e.format?Ac(s,e.format,t):s}catch{}if(e.chance!==void 0)try{let r=wx(e.chance,t),s=Oc(r,n??e.type,t.path);return typeof s=="string"&&e.format?Ac(s,e.format,t):s}catch{}}function Ac(e,t,n){if(t==="date"){let r=typeof e=="string"?new Date(e):e;if(r instanceof Date&&!isNaN(r.getTime())){let s=r.getFullYear(),o=xt(r.getMonth()+1),i=xt(r.getDate());return`${s}-${o}-${i}`}if(typeof e=="string"){let s=Date.parse(e);if(!isNaN(s)){let o=new Date(s),i=o.getFullYear(),a=xt(o.getMonth()+1),l=xt(o.getDate());return`${i}-${a}-${l}`}}}if(t==="date-time"){let r=typeof e=="string"?new Date(e):e;if(r instanceof Date&&!isNaN(r.getTime()))return r.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function Oc(e,t,n){if(t===void 0)return e;let r=Array.isArray(t)?t[0]:t;switch(r){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let s=Number(e);return r==="integer"?Math.floor(s):s;case"boolean":return!!e;case"null":return null;default:return e}}function vx(e,t){var i;if(!((i=t.extensions)!=null&&i.faker)){let a=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${a} in ${t.path}`)}let n,r;if(typeof e=="object"&&e!==null){let a=e,l=Object.keys(a);if(l.length>0)n=l[0],r=a[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let s=n.split("."),o=t.extensions.faker;for(let a of s)try{o=o[a]}catch{throw Error(`failed to resolve .${a} (${n})`)}if(typeof o=="function")return r?o(...r):o();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function wx(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let r=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${r} in ${t.path}`)}if(typeof e=="string"){let r=t.extensions.chance[e];if(typeof r=="function")return r.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let r=e,s=Object.keys(r)[0],o=r[s],i=t.extensions.chance[s];if(typeof i=="function")return o?i.call(t.extensions.chance,o):i.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function Sx(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function ze(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function ve(e,t){if(e===!0)return ve({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let o=e,i=null;for(let[a,l]of Object.entries(t.propAliases))a in o&&!(l in o)&&(i||(i={...o}),i[l]=i[a],delete i[a]);i&&(e=i)}let n;if(Array.isArray(e.type)){let o=e.type;n=t.random.pick(o);let i={...t,resolvedType:n},a=Tc(e,i,n);if(a!==void 0)return typeof a=="string"&&i.maxLength!==void 0&&a.length>i.maxLength?ze(a.slice(0,i.maxLength),e,i):ze(a,e,i)}else{let o=Tc(e,t,n);if(o!==void 0)return typeof o=="string"&&t.maxLength!==void 0&&o.length>t.maxLength?ze(o.slice(0,t.maxLength),e,t):ze(o,e,t)}let r=xx(e,t);if(r!==void 0)return ze(r,e,t);if(e.$ref){let o=await Ls(e,t);return ve(o.schema,Sx(o.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return px(e,t);if(e.const!==void 0)return ze(jc(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return ze(e.default,e,t);if(e.enum!==void 0)return ze(jc(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return ze(t.random.pick(e.examples),e,t);if(e.example!==void 0)return ze(e.example,e,t)}let s=jx(e,t);if(s===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let o=t.defaultInvalidTypeProduct;return typeof o=="string"?kx(o):o}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(s){case"null":return ze(L0(),e,t);case"boolean":return ze(D0(t),e,t);case"number":return ze(Gf(e,t),e,t);case"integer":return ze(F0(e,t),e,t);case"string":return ze(J0(e,t),e,t);case"object":return ze(await tx(e,t),e,t);case"array":return ze(await ix(e,t),e,t);default:throw Error(`Unknown type: ${s} at ${t.path}`)}}function jx(e,t){return t.resolvedType!==void 0?t.resolvedType:typeof e.type=="string"?["string","number","integer","boolean","null","object","array"].includes(e.type)?e.type:null:Array.isArray(e.type)?t.random.pick(e.type):e.properties||e.required||e.additionalProperties!==void 0||e.patternProperties||e.minProperties!==void 0||e.maxProperties!==void 0||Ex(e)?"object":e.items||e.prefixItems||e.contains||e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"number":e.minLength!==void 0||e.maxLength!==void 0||e.pattern||e.format||e.faker!==void 0||e.chance!==void 0?"string":t.random.pick(bx)}function Ex(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(to.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function kx(e,t){switch(e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function Tx(e){let t=od(e),n=id(e);return`${t}T${n}`}function od(e){let t=e.int(2e3,2030),n=e.int(1,12),r=V0(t,n),s=e.int(1,r);return`${t}-${xt(n)}-${xt(s)}`}function id(e){let t=e.int(0,23),n=e.int(0,59),r=e.int(0,59);return`${xt(t)}:${xt(n)}:${xt(r)}Z`}var Ax=["alice","bob","charlie","dave","eve","frank","grace","heidi"],Ox=["example.com","test.org","demo.net","sample.io"];function Nc(e){let t=e.pick(Ax),n=e.int(1,999),r=e.pick(Ox);return`${t}${n}@${r}`}var Nx=["https"],Cx=["example.com","test.org","demo.net"],_x=["api","v1","users","items","data","resource"];function is(e){let t=e.pick(Nx),n=e.pick(Cx),r=e.int(1,3),s=[];for(let o=0;o<r;o++)s.push(e.pick(_x));return`${t}://${n}/${s.join("/")}`}var Rx=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],Ix=["com","org","net","io","dev"];function Cc(e){let t=e.int(1,3),n=[];for(let r=0;r<t;r++)n.push(e.pick(Rx));return n.push(e.pick(Ix)),n.join(".")}function Px(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function $x(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function Mx(e){let t=n=>{let r="";for(let s=0;s<n;s++)r+=e.int(0,15).toString(16);return r};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var Lx=["foo","bar","baz","items","0","1","2","name","value"];function _c(e){let t=e.int(1,4),n=[];for(let r=0;r<t;r++)n.push(e.pick(Lx));return"/"+n.join("/")}function Dx(e){let t=["P"],n=e.bool(),r=e.bool();return n&&(e.bool()&&t.push(`${e.int(0,100)}Y`),e.bool()&&t.push(`${e.int(0,12)}M`),e.bool()&&t.push(`${e.int(0,30)}D`)),r&&(t.push("T"),e.bool()&&t.push(`${e.int(0,23)}H`),e.bool()&&t.push(`${e.int(0,59)}M`),e.bool()&&t.push(`${e.int(0,59)}S`)),(t.length===1||t.length===2&&t[1]==="T")&&t.push("0D"),t.join("")}var Bx=new Map([["date-time",Tx],["date",od],["time",id],["duration",Dx],["email",Nc],["idn-email",Nc],["uri",is],["uri-reference",is],["iri",is],["iri-reference",is],["hostname",Cc],["idn-hostname",Cc],["ipv4",Px],["ipv6",$x],["uuid",Mx],["json-pointer",_c],["relative-json-pointer",e=>`${e.int(0,5)}${_c(e)}`]]);function ad(e){let t=new Map(Bx);if(e)for(let[n,r]of Object.entries(e))t.set(n,r);return t}function Fx(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),r=[t];for(let s of n){if(s==="")continue;let o=[];for(let i of r)if(i!=null)if(s==="*")Array.isArray(i)&&o.push(...i);else if(/^\d+$/.test(s)){let a=parseInt(s,10);Array.isArray(i)&&a<i.length&&o.push(i[a])}else s===""?Mi(i,o):typeof i=="object"&&i!==null&&s in i&&o.push(i[s]);r=o}return r}function Mi(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),Mi(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),Mi(n,t)}}function Ux(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[r,s]of Object.entries(e))to.has(r)||(sd(s)?(t[r]=s,n=!0):(t[r]={const:s},n=!0));if(n)return t}return{}}async function Li(e,t,n,r){if(!n.resolveJsonPath)return e;let s=r??e;if(t===!0||t===!1||t.$ref)return e;let o=t;if(o.allOf||o.anyOf||o.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let i={...e},a=Ux(o);for(let[l,u]of Object.entries(a))if(l in i){let f=i[l];if(typeof u=="object"&&u!==null&&"jsonPath"in u&&typeof u.jsonPath=="string"){let d=Fx(u.jsonPath,s);d.length>0&&(i[l]=n.random.pick(d))}else{let d=await Li(f,u,n,s);i[l]=d}}return i}if(Array.isArray(e)&&o.items){let i=[];for(let a of e){let l=await Li(a,o.items,n,s);i.push(l)}return i}return e}var Hx=ad(),Rc=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function ld(e,t){if((t==null?void 0:t.validateSchemaVersion)===!0&&!(t!=null&&t.propAliases)&&typeof e=="object"&&e!==null&&"$schema"in e){let d=e.$schema;if(typeof d=="string"&&!Rc.has(d))throw Error(`Unsupported JSON Schema version: ${d}. Supported versions: ${[...Rc].join(", ")}`)}let n=zx(t),r=Qf((t==null?void 0:t.seed)??1),s=n.propAliases?qx(e,n.propAliases):e,o=cx(s);ux(s,o);let i=n.formats?ad(n.formats):new Map(Hx),a=n.refDepthMin??n.refDepth,l=n.refDepthMax??n.refDepth;if(a!==void 0&&l!==void 0&&a>l)throw Error(`refDepthMin (${a}) cannot be greater than refDepthMax (${l})`);let u={random:r,maxDepth:n.maxDepth??(l?l+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:o,refStack:new Set,formatRegistry:i,refResolver:n.refResolver,minItems:n.minItems,maxItems:n.maxItems,minLength:n.minLength,maxLength:n.maxLength,useDefaultValue:n.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:n.alwaysFakeOptionals,fixedProbabilities:n.fixedProbabilities,fillProperties:n.fillProperties,extensions:n.extensions,resolveJsonPath:n.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:a,refDepthMax:l,useExamplesValue:n.useExamplesValue,pruneProperties:n.pruneProperties,failOnInvalidTypes:n.failOnInvalidTypes,defaultInvalidTypeProduct:n.defaultInvalidTypeProduct,minDateTime:n.minDateTime,maxDateTime:n.maxDateTime,propAliases:n.propAliases,outputTransform:n.outputTransform},f=await ve(s,u);return n.resolveJsonPath?Li(f,e,u,f):f}function qx(e,t){if(typeof e!="object"||e===null)return e;let n=e,r=null;for(let[s,o]of Object.entries(t))s in n&&!(o in n)&&(r||(r={...n}),r[o]=r[s],delete r[s]);return r??e}function zx(e){if(!e)return{};let t=e,n={...e};return t.requiredOnly===!0&&n.optionalsProbability===void 0&&(n={...n,optionalsProbability:0,alwaysFakeOptionals:!1}),t.ignoreProperties&&t.ignoreProperties.length>0&&(n={...n,outputTransform:Wx(n.outputTransform,Vx(t.ignoreProperties))}),n}function Wx(e,t){return e?t?async(n,r,s)=>{let o=await e(n,r,s);return t(o,r,s)}:e:t}function Vx(e){return(t,n,r)=>{if(r==="/")return t;let s=Kx(r.slice(r.lastIndexOf("/")+1));return e.some(o=>typeof o=="string"?o===s:o instanceof RegExp?o.test(s):o(n))?void 0:t}}function Kx(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}const Jx=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function as(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function Rn(e,t=()=>{},n=new Set,r=new Set){if(typeof e.$ref=="string"){const s=e.$ref,o=t(s);return Jx(o)?r.has(s)?as(o,"null")?{type:"null"}:{}:Rn(o,t,new Set,new Set(r).add(s)):{}}if(n.has(e))return as(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...o}=e;return Rn({...o,...s[0]},t,n,r)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...o}=e;return Rn({...o,...s[0]},t,n,r)}if(as(e,"object")&&e.properties&&typeof e.properties=="object"){n.add(e);try{const s={};for(const[o,i]of Object.entries(e.properties)){const a=/id$/i.test(o)&&i.type==="string"&&!i.format&&!i.examples,l=i.type==="string"&&!i.format&&!i.examples&&!i.enum;s[o]=a?{...i,format:"uuid"}:l?{...i,examples:["string"]}:Rn(i,t,n,r)}return{...e,properties:s}}finally{n.delete(e)}}if(as(e,"array")&&e.items&&typeof e.items=="object"){n.add(e);try{return{...e,items:Rn(e.items,t,n,r)}}finally{n.delete(e)}}return e}function Yx({schema:e,providedExample:t}){const n=t!==void 0,[r,s]=T.useState(n?t:null),{deref:o}=Ve();if(T.useEffect(()=>{if(n){s(t);return}let a=!1;try{ld(Rn(e,o),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(l=>{a||s(l)}).catch(()=>{})}catch{}return()=>{a=!0}},[e,o,n,t]),r===null)return null;const i=JSON.stringify(r,null,2);return c.jsxs("div",{children:[c.jsx(_a,{code:i}),!n&&c.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function yn({schema:e,label:t,rootName:n,description:r,schemaFormat:s,originalSchema:o,conversionError:i,pendingConversion:a,example:l,defaultView:u="example"}){const f=Qu(s),d=!a&&Jm(s,i),[p,h]=T.useState(d&&u==="example"?"example":"schema");return T.useEffect(()=>{!d&&p==="example"&&h("schema")},[d,p]),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),f&&c.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:f})]}),r&&c.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:r})]}),c.jsx(Xf,{tabs:[...d?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:m=>h(m),ariaLabel:"Schema view toggle"})]}),i&&c.jsxs("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5 mb-2",children:["Could not convert ",Gu(s)??"the"," schema, showing raw definition. ",i]}),a?c.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):c.jsxs(c.Fragment,{children:[p==="schema"&&c.jsx(Pa,{schema:e,rootName:n??(typeof t=="string"?t:void 0)}),p==="json"&&c.jsx(Df,{schema:o??e}),p==="example"&&d&&c.jsx(Yx,{schema:e,providedExample:l})]})]})}function cd({message:e,expanded:t,onToggleExpanded:n,paddingX:r="px-4",focusSection:s=null}){var h;const[o,i]=T.useState("payload");T.useEffect(()=>{(s==="headers"||s==="payload")&&i(s)},[s]);const{deref:a}=Ve(),l=ga(),u=T.useMemo(()=>e.payload?vr(e.payload,a):null,[e.payload,a,l]),f=T.useMemo(()=>e.headers?vr(e.headers,a):null,[e.headers,a,l]),d=(h=e.examples)==null?void 0:h[0],p=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:c.jsx("div",{className:"overflow-hidden",children:c.jsxs("div",{className:`${r} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&c.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&c.jsxs("div",{children:[e.payload&&e.headers&&c.jsx(Wn,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:o,onChange:m=>i(m)}),c.jsxs("div",{className:"mt-4",children:[(o==="payload"||!e.headers)&&u&&c.jsx(yn,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion,example:d==null?void 0:d.payload}),(o==="headers"||!e.payload)&&f&&c.jsx(yn,{schema:f.schema,label:"Headers",description:f.description,schemaFormat:f.schemaFormat,originalSchema:f.originalSchema,conversionError:f.conversionError,pendingConversion:f.pendingConversion,example:d==null?void 0:d.headers})]})]}),e.tags&&e.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,g)=>c.jsx(Ca,{name:`#${m.name}`},g))})]})})}),p&&c.jsxs("button",{onClick:n,className:"w-full flex items-center justify-center gap-1.5 py-2 border-t border-border bg-neutral-50 hover:bg-neutral-100 transition-colors text-xs text-foreground-muted hover:text-foreground-secondary",children:[c.jsx("span",{children:t?"Show less":"Show more"}),c.jsx(Or,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function Zx({messageKey:e,message:t,first:n,isSelected:r,focusSection:s}){const[o,i]=T.useState(!1);return T.useEffect(()=>{r&&i(!0)},[r]),c.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${r?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[c.jsxs("tr",{className:"",children:[c.jsx("td",{className:"px-6 py-4",children:c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),c.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})]})}),c.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),c.jsx("td",{className:"px-6 py-4",children:c.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx("div",{}),c.jsx("div",{children:t.contentType&&c.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&&c.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx("div",{}),c.jsx("div",{children:t.correlationId&&c.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:t.correlationId.description??t.correlationId.location,children:t.correlationId.location})})]})]})})]}),c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"p-0",children:c.jsx(cd,{message:t,expanded:o,onToggleExpanded:()=>i(a=>!a),paddingX:"px-6",focusSection:r?s:null})})})]})}function ud({messages:e,selectedKey:t,focusSection:n}){const r=Object.entries(e),s=r.length?c.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{className:"bg-neutral-100",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),r.map(([o,i],a)=>c.jsx(Zx,{messageKey:o,message:i,first:a===0,isSelected:t===o,focusSection:n},o))]})}):c.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No messages defined in this AsyncAPI document."});return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{content:s,stickySideContent:!1})})}function fd({serverNames:e=[],current:t,setCurrent:n}){return c.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(r=>c.jsx("button",{type:"button",onClick:()=>n(r),"aria-current":t===r?"page":void 0,className:Cn(t===r?"border-l-4 border-neutral-300 text-foreground":"text-foreground-secondary hover:text-foreground","flex items-center px-3 py-2 text-sm font-medium cursor-pointer w-full text-left"),children:c.jsx("span",{className:"truncate",children:r})},r))})}function dd(e){return c.jsx(ra,{...e,children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}function Xx(e){return c.jsx(ra,{...e,children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}function pd({address:e,variables:t,children:n}){return c.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[c.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[c.jsx(Xx,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&c.jsx(Xt,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),n]})}function hd({className:e}){return c.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:c.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}function Mr({trigger:e,children:t,defaultExpanded:n=!1,forceExpanded:r=!1,ariaLabelledBy:s,className:o=""}){const[i,a]=T.useState(n),l=T.useId();return T.useEffect(()=>{r&&a(!0)},[r]),c.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${o}`,children:[c.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":l,"aria-labelledby":s,onClick:()=>a(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,i?c.jsx(Or,{className:"w-4 h-4 text-foreground-muted shrink-0"}):c.jsx(hd,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),c.jsx("div",{id:l,className:`grid transition-all duration-200 ease-in-out ${i?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:c.jsx("div",{className:"overflow-hidden",children:t})})]})}const Qx=[{id:"userPassword",name:"User/Password"},{id:"oauth2",name:"OAuth2"},{id:"apiKey",name:"API key"},{id:"bearer",name:"Bearer Token"},{id:"openIdConnect",name:"OpenID"},{id:"X509",name:"X.509 certificate"},{id:"scramSha256",name:"SASL"},{id:"scramSha512",name:"SASL"},{id:"plain",name:"SASL"},{id:"gssapi",name:"SASL"}];function Ic(e){var n,r;const t=(n=e.type)==null?void 0:n.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(r=e.scheme)==null?void 0:r.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function $a({securities:e}){var a,l;const t=T.useMemo(()=>Qx.filter(u=>e==null?void 0:e.some(f=>Ic(f).toLowerCase()===u.id.toLowerCase())),[e]),n=t.length>1,[r,s]=T.useState(n?null:((a=t[0])==null?void 0:a.id)??null);T.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(u=>u&&t.some(f=>f.id===u)?u:null)},[t]);function o(u){return e.find(f=>Ic(f).toLowerCase()===u.toLowerCase())}const i=r?(l=o(r))==null?void 0:l.description:void 0;return c.jsxs("div",{children:[n&&c.jsx(Wn,{tabs:t,current:r,onChange:u=>s(f=>u&&f===u?null:u||null),placeholder:"Select an authorization method"}),c.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[r==="userPassword"&&c.jsxs(ls,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),r&&["scramSha256","scramSha512","plain"].includes(r)&&c.jsxs(ls,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),r==="gssapi"&&c.jsxs(ls,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),r==="X509"&&c.jsxs(ls,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),r==="bearer"&&c.jsx(Gx,{security:o("bearer")}),r==="apiKey"&&c.jsx(eb,{security:o("apiKey")}),r==="openIdConnect"&&c.jsx(tb,{security:o("openIdConnect")}),r==="oauth2"&&c.jsx(nb,{security:o("oauth2")})]})]})}const ls=({description:e,children:t})=>e?c.jsx(c.Fragment,{children:c.jsx(wt,{children:e})}):c.jsx("span",{children:t}),Gx=({security:e})=>e!=null&&e.description?c.jsx(wt,{children:e.description}):c.jsxs("span",{children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide a bearer token"})," ","in the ",c.jsx("code",{children:"Authorization"})," header",e!=null&&e.bearerFormat?c.jsxs(c.Fragment,{children:[" (format: ",e.bearerFormat,")"]}):null," to connect to this server."]}),eb=({security:e})=>{if(e!=null&&e.description)return c.jsx(wt,{children:e.description});const t=e==null?void 0:e.in;return t==="header"||t==="query"||t==="cookie"?c.jsxs("span",{children:["You have to"," ",c.jsxs("strong",{className:"text-foreground-secondary",children:["provide your API key in the ",t," parameter",e!=null&&e.name?c.jsxs(c.Fragment,{children:[" named ",c.jsx("code",{children:e.name})]}):null]})," ","to connect to this server."]}):t==="password"?c.jsxs("span",{children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the password and leave the user name empty"})," ","to connect to this server."]}):c.jsxs("span",{children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the user name and leave the password empty"})," ","to connect to this server."]})},tb=({security:e})=>{var n,r;const t=(n=e.requiredScopes)!=null&&n.length?e.requiredScopes:e.scopes;return c.jsxs(c.Fragment,{children:[e!=null&&e.description?c.jsx(wt,{children:e.description}):c.jsx("p",{children:"You can use OpenID to connect to this server."}),c.jsxs("p",{children:["The OpenID Connect URL is"," ",c.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),t&&t.length>0&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(r=e.requiredScopes)!=null&&r.length?"Required scopes":"Scopes"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("code",{children:xh(t)})})]})]})},nb=({security:e})=>{const t=e==null?void 0:e.flows;return c.jsxs(c.Fragment,{children:[(e==null?void 0:e.description)&&c.jsx(wt,{children:e.description}),t&&Object.entries(t).map(([n,r])=>{var l,u;let s="",o="";switch(n){case"clientCredentials":s=nh,o=rh;break;case"implicit":s=eh,o=th;break;case"password":s=sh,o=oh;break;case"authorizationCode":s=ih,o=ah;break}const i=(l=e.requiredScopes)!=null&&l.length?e.requiredScopes:r.availableScopes??r.scopes,a=(u=e.requiredScopes)!=null&&u.length?"Required scopes":"Available scopes";return c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),c.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:o})]}),c.jsx("div",{className:"mt-5 border-t border-border",children:c.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[r.authorizationUrl&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("a",{href:r.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.authorizationUrl})})]}),r.tokenUrl&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("a",{href:r.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.tokenUrl})})]}),r.refreshUrl&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("a",{href:r.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.refreshUrl})})]}),i&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:a}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(i)?i:Object.keys(i)).map(f=>c.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:f},f))})})]})]})})]},n)})]})};function rb(e){return e.startsWith("http://")||e.startsWith("https://")}function md(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function gd({value:e}){if(e==null)return null;if(typeof e=="string"&&rb(e))return c.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 underline underline-offset-2 break-all hover:text-blue-800",children:e});if(typeof e=="boolean")return c.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return c.jsx("span",{className:"text-xs font-mono text-blue-600",children:e});if(typeof e=="object"){const t=e;return"type"in t&&Array.isArray(t.enum)?c.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,r)=>c.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},r))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?c.jsx(wt,{className:"prose-sm",children:t.description}):c.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,r])=>c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:md(n)}),c.jsx(gd,{value:r})]},n))})}return c.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function yd({bindings:e,expand:t=!1,protocol:n,focused:r}){const s=uh[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},o=Object.entries(e??{}).filter(([i,a])=>i!=="bindingVersion"&&a!==void 0&&a!==null);return o.length===0?null:c.jsx(Mr,{className:"mt-2",defaultExpanded:t,forceExpanded:r,trigger:c.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label}),children:c.jsx("div",{className:"divide-y divide-neutral-100",children:o.length===0?c.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):o.map(([i,a])=>c.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[c.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:md(i)}),c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx(gd,{value:a})})]},i))})})}function sb({host:e,protocol:t,description:n,tags:r,variables:s,security:o,bindings:i,serverKey:a,focusSection:l=null}){const u=s,f=T.useId();return c.jsxs("div",{children:[c.jsx(pd,{address:e,variables:u,children:c.jsx("div",{className:"mt-2",children:r&&r.map((d,p)=>{const h=d,m=h.externalDocs;return c.jsx(Ca,{href:m&&m.url,title:h.description||(m&&m.description?m.description:void 0),name:h.name},p)})})}),c.jsx(wt,{children:n}),o&&o.length>0&&c.jsxs("div",{id:a?`server-${a}-security`:void 0,children:[c.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[c.jsx(dd,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),c.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",o.length>1?"s":"",":"]}),c.jsx(Mr,{className:"mt-4",ariaLabelledBy:f,forceExpanded:l==="security",trigger:c.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:o.length}),children:c.jsx("div",{className:"px-4 py-2 border-t border-border",children:c.jsx($a,{securities:o})})})]}),(()=>{const d=i==null?void 0:i[t];return d&&Object.keys(d).some(h=>h!=="bindingVersion")?c.jsxs("div",{id:a?`server-${a}-bindings`:void 0,children:[c.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[c.jsx(ia,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),c.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),c.jsx(yd,{bindings:d,protocol:t,focused:l===`binding:${t}`})]}):null})()]})}function xd({servers:e,selectedServer:t,onSelectServer:n,focusSection:r=null}){const s=Object.keys(e),[o,i]=T.useState(void 0),a=[t,o].find(f=>!!f&&s.includes(f))??s[0],l=f=>{i(f),n==null||n(f)},u=c.jsx(sb,{...e[a],serverKey:a,focusSection:t||o?r:null});return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:Tu,content:u,sideContent:c.jsx(fd,{serverNames:s,current:a,setCurrent:l}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}const bd=T.forwardRef(function({isOpen:t,side:n,onClose:r,title:s,headerActions:o,children:i,width:a="w-[50rem]"},l){T.useEffect(()=>{const g=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);const u=n==="right"?"translate-x-full":"-translate-x-full",f=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:p}=Ve();T.useEffect(()=>{if(!(!t||!d))return Lu(Mu(d))},[t,d]);const h=Ks(p,!0),m=h?{position:"fixed",top:0,left:h.left,width:h.width,height:"100vh"}:{position:"fixed",inset:0};return d?Tr.createPortal(c.jsxs("div",{className:"z-50 overflow-hidden",style:{...m,pointerEvents:t?"auto":"none"},children:[c.jsx("div",{onClick:r,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),c.jsxs("div",{ref:l,className:`absolute top-0 ${f} h-full ${a} max-w-[100cqw] bg-background shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":u}`,children:[s&&c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[c.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof s=="string"?c.jsx("span",{className:"truncate block",children:s}):s}),o,c.jsx("button",{onClick:r,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:c.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:i})]})]}),d):null});function vd({getMarkdown:e,label:t}){const[n,r]=T.useState(!1),s=T.useRef(void 0);T.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const o=async()=>{try{await navigator.clipboard.writeText(e()),r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),2e3)}catch(i){console.error("[CopyMarkdownButton] copy failed:",i)}};return c.jsx("button",{type:"button",onClick:o,title:t,"aria-label":t,className:"ml-2 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors",children:n?c.jsx(la,{className:"w-4 h-4 text-green-600"}):c.jsx(aa,{className:"w-4 h-4"})})}function wd({message:e,messageId:t,i:n}){const[r,s]=T.useState(!1);return c.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[c.jsxs("div",{className:"px-4 py-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&c.jsx("span",{className:"text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 p-0.5 rounded shrink-0",children:t??e.name})]}),e.summary&&c.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&c.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:e.contentType}),e.correlationId&&c.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:e.correlationId.description??e.correlationId.location,children:e.correlationId.location}),e.deprecated&&c.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),c.jsx(cd,{message:e,expanded:r,onToggleExpanded:()=>s(o=>!o)})]})}function ob({requestMessages:e,reply:t,isSend:n,operationId:r}){const[s,o]=T.useState("request"),i=t.messages??[],a=t.channel,l=t.address,u=s==="request"?e:i,f=s==="request"?n?"accepts":"expects":c.jsxs(c.Fragment,{children:["replies to"," ",l?c.jsxs(c.Fragment,{children:["a channel in"," ",c.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:l.location})]}):(a==null?void 0:a.address)&&c.jsx(Xt,{address:a.address,parameters:a.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return c.jsxs("div",{children:[c.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(d=>c.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
128
+ ${s===d?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:d},d))}),c.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[c.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:r})," ",f,u.length>1?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):c.jsxs("span",{children:[" "," with the following message:"]})]}),c.jsx("div",{className:"space-y-2",children:u.map((d,p)=>c.jsx(wd,{message:d,messageId:d.name,i:p},p))})]}):c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function ib({op:e,id:t,focusSection:n=null}){var m;const r=T.useId(),s=e.messages??[],o=e.tags??[],i=e.bindings,a=e.traits,l=e.reply,u=e.externalDocs,f=e.security,d=i??(Array.isArray(a)?(m=a.find(g=>g.bindings))==null?void 0:m.bindings:void 0),p=e.action===ks.SEND,h=c.jsx("div",{className:"space-y-2",children:s.map((g,v)=>c.jsx(wd,{message:g,messageId:g.name,i:v},v))});return c.jsxs("div",{className:"space-y-6",id:`operation-${t}-detail`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.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]}),(u==null?void 0:u.url)&&c.jsxs("a",{href:u.url,target:"_blank",rel:"noreferrer",title:u.description||u.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",c.jsx(Ys,{className:"w-3.5 h-3.5"})]})]}),e.description&&c.jsx("div",{children:c.jsx(wt,{children:e.description})}),e.summary&&c.jsx("div",{children:c.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),f&&f.length>0&&c.jsxs("div",{id:`operation-${t}-security`,children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),c.jsx(Mr,{ariaLabelledBy:r,forceExpanded:n==="security",trigger:c.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:c.jsx("div",{className:"px-4 py-2 border-t border-border",children:c.jsx($a,{securities:f})})})]}),d&&Object.entries(d).map(([g,v])=>v?c.jsxs("div",{id:`operation-${t}-bindings-${g}`,children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),c.jsx(yd,{protocol:g,bindings:v,focused:n===`binding:${g}`})]},g):null),l?c.jsx(ob,{requestMessages:s,reply:l,isSend:p,operationId:t}):s.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[c.jsx("span",{className:"font-bold",children:t})," ",p?"accepts":"expects",s.length>1?c.jsxs(c.Fragment,{children:[c.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:"]}),h]}),o.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map((g,v)=>c.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:g.name},v))})]})]})}function Sd({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,showCopyMarkdown:s}){const o=m=>n==null?void 0:n(m),{document:i,deref:a}=Ve(),l=i;if(!Object.keys(e).length)return null;const u=t?e[t]:null,f=Object.keys(e).map(m=>{var k;const g=e[m],v=g.channel,j=v==null?void 0:v.address,y=v==null?void 0:v.parameters,b=((k=g.action)==null?void 0:k.toUpperCase())??"",S=t===m;return c.jsxs("tr",{id:`operation-${m}`,onClick:()=>o(m),role:"button",tabIndex:0,"aria-label":`${b||"Operation"} ${j??m}`,"aria-current":S?"true":void 0,onKeyDown:w=>{w.key!=="Enter"&&w.key!==" "||(w.preventDefault(),o(m))},className:`group cursor-pointer ${S?"bg-neutral-50":""}`,children:[c.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:j&&c.jsx(Xt,{address:j,parameters:y,truncate:!0})}),c.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:c.jsx(Qt,{method:g.action,className:"w-24"})}),c.jsx("td",{className:"group-hover:bg-neutral-50"})]},m)}),d=u?u.channel:null,p=u&&(d!=null&&d.address)?c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(Qt,{method:u.action}),c.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:c.jsx(Xt,{address:d.address,parameters:d.parameters})})]}):t??"Operation",h=c.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{className:"bg-neutral-100 w-full",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),c.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"}),c.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),c.jsx("tbody",{className:"bg-surface divide-y divide-border",children:f})]})});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:lh,content:h,stickySideContent:!1})}),c.jsx(bd,{isOpen:!!u,side:"right",onClose:()=>o(null),title:p,headerActions:u&&t&&s?c.jsx(vd,{getMarkdown:()=>ng(l,t,a),label:"Copy operation for LLM"}):void 0,children:u&&c.jsx(ib,{op:u,id:t,focusSection:r})})]})}function no({schemas:e,selectedKey:t,focusTarget:n}){const{deref:r}=Ve(),s=ga(),o=T.useMemo(()=>Object.entries(e).map(([a,l])=>[a,vr(l,r)]),[e,r,s]),i=o.length?c.jsx("div",{className:"grid gap-6 w-full",children:o.map(([a,l])=>{const u=l.schema,f=Qu(l.schemaFormat),d=u.properties?Object.keys(u.properties).length:0;return c.jsxs("article",{id:`schema-${a}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===a?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-foreground",children:a}),l.description&&c.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:l.description})]}),c.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:u.type??"unknown"})]}),(u.format||f||d>0)&&c.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[u.format&&c.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",u.format]}),f&&c.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:l.schemaFormat,children:f}),d>0&&c.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[d," properties"]})]}),l.conversionError&&c.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"," ",Gu(l.schemaFormat)??"the"," schema — showing raw definition. ",l.conversionError]}),l.pendingConversion&&c.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),l.pendingConversion?null:l.conversionError&&typeof l.originalSchema=="string"?c.jsx("div",{className:"mt-4",children:c.jsx(Df,{schema:l.originalSchema})}):c.jsx(Pa,{schema:u,rootName:a,className:"mt-4",focusTokens:a===t?(n==null?void 0:n.tokens)??null:null,focusId:a===t?(n==null?void 0:n.id)??null:null})]},a)})}):c.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 AsyncAPI document."});return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{content:i,stickySideContent:!1})})}const ab=e=>e==="operations"||e==="messages"||e==="schemas";function lb({asyncapi:e,config:t}){var k,w,E,C;const n=t.show??{},r=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Js}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Pu}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:sa}]:[]],{query:s,setQuery:o,results:i}=Om(e,{threshold:.3,limit:20}),{effectiveTab:a,focusTab:l,navActiveSection:u,selected:f,setSelectedKey:d,selectedNavItem:p,handleSearchSelect:h,handleNavItemSelect:m,handleNavServerSelect:g,handleContentTabChange:v,focusSection:j,schemaFocusTarget:y}=Zu({tabs:r,defaultTab:"operations",isTabKey:ab,sections:[{id:"operations",visible:n.operations!==!1},{id:"messages",visible:n.messages!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:s}),b=e.servers?Object.keys(e.servers):[],S=a==="operations"?c.jsx(Sd,{operations:e.operations??{},selectedKey:f.operations,onSelectKey:O=>d("operations",O),focusSection:j,showCopyMarkdown:n.copyMarkdown!==!1}):a==="messages"?c.jsx(ud,{messages:((k=e.components)==null?void 0:k.messages)??{},selectedKey:f.messages,focusSection:j}):a==="schemas"?c.jsx(no,{schemas:((w=e.components)==null?void 0:w.schemas)??{},selectedKey:f.schemas,focusTarget:y}):null;return c.jsx(na,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:c.jsxs("div",{className:"px-4",children:[n.search!==!1&&c.jsx(Du,{query:s,onQueryChange:o,results:i,onSelectResult:h}),n.copyMarkdown!==!1&&c.jsx(Bu,{serialize:O=>eg(e,O),leftOffset:n.search!==!1?60:12}),n.info!==!1&&c.jsx("div",{id:"info-panel",children:c.jsx(Lf,{...e.info})}),n.servers!==!1&&b.length>0&&c.jsx("div",{id:`server-${f.servers??b[0]}`,children:c.jsx(xd,{servers:e.servers,selectedServer:f.servers,onSelectServer:O=>d("servers",O),focusSection:j})}),n.sidebar!==!1&&c.jsx(Oh,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(E=e.components)==null?void 0:E.messages:void 0,schemas:n.schemas!==!1?(C=e.components)==null?void 0:C.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:u,onTabChange:l,onItemSelect:m,onSelectServer:g,selectedItem:p}),c.jsx(Nu,{tabs:r,current:a,onChange:v}),a&&c.jsx("div",{id:`panel-${a}`,role:"tabpanel","aria-labelledby":`tab-${a}`,children:S})]})})}const Ma=e=>{const t=e.asyncapi,n=T.useMemo(()=>Ar(t),[t]),r=e.kind;T.useEffect(()=>{r==="resolved"&&n!==t&&ea(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??zn;return c.jsx(lb,{asyncapi:n,config:s})};function La({document:e,config:t=zn,className:n="",children:r}){const{contextValue:s,themeVars:o,setPortalHost:i,setRootElement:a}=Ou("openapi",e,t);return c.jsx(Vs.Provider,{value:s,children:c.jsxs("div",{ref:a,style:o,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[c.jsx("div",{ref:i,className:"openapi-portal-root"}),r]})})}function cb(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:st([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,o)=>{const i=`server-${o}`;t.push({id:i,targetId:i,type:"server",tab:"servers",key:i,name:s.description??s.url??i,path:`servers[${o}]`,location:`Servers > ${s.url??i}`,subtitle:s.url,text:st([s.url,s.description,s.variables])})});const n=(s,{tab:o,type:i,idPrefix:a,docKey:l,sectionLabel:u})=>{for(const f of Object.keys(s)){const d=s[f];if(d)for(const p of oa){const h=d[p];if(!h)continue;const m=`${p} ${f}`,g=h.summary??`${p.toUpperCase()} ${f}`;t.push({id:`${a}-${m}`,targetId:`${a}-${m}-detail`,type:i,tab:o,key:m,name:g,path:`${l}.${f}.${p}`,location:`${u} > ${p.toUpperCase()} ${f}`,subtitle:h.description,text:st([p,f,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas)for(const[s,o]of Object.entries(e.components.schemas))Fu(t,o,s,s);return t}function ub(e,t={}){return Ju(e,cb,t)}function jd({info:e,tags:t,externalDocs:n}){const{title:r,description:s,license:o,contact:i}=e;return c.jsx(Mf,{title:r,description:s,license:o,contact:i,externalDocs:n,tags:t,extensionsSource:e})}function fb({url:e,description:t,variables:n}){return c.jsxs("div",{children:[c.jsx(pd,{address:e,variables:n}),t&&c.jsx(wt,{children:t})]})}const Ho=e=>`server-${e}`,qo=e=>Number(e.slice(7));function Ed({servers:e,selectedServer:t,onSelectServer:n}){const r=e.map((d,p)=>d.url||Ho(p)),[s,o]=T.useState(void 0),i=d=>!!d&&qo(d)>=0&&qo(d)<e.length,a=i(t)?t:i(s)?s:Ho(0),l=e[qo(a)],u=d=>{o(d),n==null||n(d)},f=l?c.jsx(fb,{...l}):null;return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:Tu,content:f,sideContent:c.jsx(fd,{serverNames:r,current:(l==null?void 0:l.url)||a,setCurrent:d=>{const p=r.indexOf(d);u(p>=0?Ho(p):d)}}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function kd(e,t=new Set){if(t.has(e))return e;if(e.type==="object"&&e.properties&&typeof e.properties=="object"){t.add(e);try{const n={};for(const[r,s]of Object.entries(e.properties)){const o=/id$/i.test(r)&&s.type==="string"&&!s.format&&!s.examples,i=s.type==="string"&&!s.format&&!s.examples&&!s.enum;n[r]=o?{...s,format:"uuid"}:i?{...s,examples:["string"]}:kd(s,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}async function db(e){try{return await ld(kd(e),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const Pc="",$c=`
129
+ `;var he=class{constructor({indent:e,join:t}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=Pc,this.lineJoin=$c,this.indentLine=(n,r=0)=>`${this.indentationCharacter.repeat(r)}${n}`,this.unshift=(n,r)=>{const s=this.indentLine(n,r);this.code.unshift(s)},this.push=(n,r)=>{const s=this.indentLine(n,r);this.code.push(s)},this.pushToLast=n=>{this.code||this.push(n);const r=`${this.code[this.code.length-1]}${n}`;this.code[this.code.length-1]=r},this.blank=()=>{this.code.push("")},this.join=()=>{const n=this.code.join(this.lineJoin);return this.postProcessors.reduce((r,s)=>s(r),n)},this.addPostProcessor=n=>{this.postProcessors=[...this.postProcessors,n]},this.indentationCharacter=e||Pc,this.lineJoin=t??$c}},pb=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},hb=function(e){var t=typeof e;return e!==null&&(t==="object"||t==="function")},Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.default=e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t));const mb=pb,gb=hb,yb=Da.default;var xb=(e,t,n)=>{const r=[];return(function s(o,i,a){i=i||{},i.indent=i.indent||" ",a=a||"";let l;i.inlineCharacterLimit===void 0?l={newLine:`
130
+ `,newLineOrSpace:`
131
+ `,pad:a,indent:a+i.indent}:l={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const u=f=>{if(i.inlineCharacterLimit===void 0)return f;const d=f.replace(new RegExp(l.newLine,"g"),"").replace(new RegExp(l.newLineOrSpace,"g")," ").replace(new RegExp(l.pad+"|"+l.indent,"g"),"");return d.length<=i.inlineCharacterLimit?d:f.replace(new RegExp(l.newLine+"|"+l.newLineOrSpace,"g"),`
132
+ `).replace(new RegExp(l.pad,"g"),a).replace(new RegExp(l.indent,"g"),a+i.indent)};if(r.indexOf(o)!==-1)return'"[Circular]"';if(o==null||typeof o=="number"||typeof o=="boolean"||typeof o=="function"||typeof o=="symbol"||mb(o))return String(o);if(o instanceof Date)return`new Date('${o.toISOString()}')`;if(Array.isArray(o)){if(o.length===0)return"[]";r.push(o);const f="["+l.newLine+o.map((d,p)=>{const h=o.length-1===p?l.newLine:","+l.newLineOrSpace;let m=s(d,i,a+i.indent);return i.transform&&(m=i.transform(o,p,m)),l.indent+m+h}).join("")+l.pad+"]";return r.pop(),u(f)}if(gb(o)){let f=Object.keys(o).concat(yb(o));if(i.filter&&(f=f.filter(p=>i.filter(o,p))),f.length===0)return"{}";r.push(o);const d="{"+l.newLine+f.map((p,h)=>{const m=f.length-1===h?l.newLine:","+l.newLineOrSpace,g=typeof p=="symbol",v=!g&&/^[a-z$_][a-z$_0-9]*$/i.test(p),j=g||v?p:s(p,i);let y=s(o[p],i,a+i.indent);return i.transform&&(y=i.transform(o,p,y)),l.indent+String(j)+": "+y+m}).join("")+l.pad+"}";return r.pop(),u(d)}return o=String(o).replace(/[\r\n]/g,f=>f===`
133
+ `?"\\n":"\\r"),i.singleQuotes===!1?(o=o.replace(/"/g,'\\"'),`"${o}"`):(o=o.replace(/\\?'/g,"\\'"),`'${o}'`)})(e,t,n)};const Ot=Zs(xb),Ze=(e,t)=>Object.keys(e).find(n=>n.toLowerCase()===t.toLowerCase()),Rt=(e,t)=>{const n=Ze(e,t);if(n)return e[n]},Ds=(e,t)=>!!Ze(e,t),bb=e=>["application/json","application/x-json","text/json","text/x-json","+json"].some(t=>e.indexOf(t)>-1),vb={info:{key:"agent",title:"Agent",default:"prompt"},clientsById:{prompt:{info:{key:"prompt",title:"Agent Prompt",link:"https://github.com/readmeio/httpsnippet",description:"A copy-and-pastable prompt, for any AI agent, describing how to make the request.",extname:".txt"},convert:({method:e,fullUrl:t,allHeaders:n,postData:r},s)=>{const o={indent:" ",join:`
134
+ `,...s},{blank:i,push:a,join:l}=new he(o);a("Write code that makes the HTTP request described below. Use my preferred programming language and HTTP client library — if I haven't told you what those are, ask me before writing any code."),i(),a(`Method: ${e}`),a(`URL: ${t}`);const u=Object.keys(n);return u.length&&(i(),a("Headers:"),u.forEach(f=>{a(`${f}: ${n[f]}`,1)})),r.text&&(i(),a(`Body (${r.mimeType}):`),a(r.text)),i(),a("The request the code makes must match the method, URL, headers, and body exactly as described above."),o.markdownURL&&(i(),a(`Check ${o.markdownURL} for more info.`)),l()}}}};function Er(e,t={}){const{delimiter:n='"',escapeChar:r="\\",escapeNewlines:s=!0}=t;return[...e.toString()].map(o=>o==="\b"?`${r}b`:o===" "?`${r}t`:o===`
135
+ `?s?`${r}n`:o:o==="\f"?`${r}f`:o==="\r"?s?`${r}r`:o:o===r?r+r:o===n?r+n:o<" "||o>"~"?JSON.stringify(o).slice(1,-1):o).join("")}const Un=e=>Er(e,{delimiter:"'"}),Ue=e=>Er(e,{delimiter:'"'}),wb={info:{key:"c",title:"C",default:"libcurl",cli:"c"},clientsById:{libcurl:{info:{key:"libcurl",title:"Libcurl",link:"http://curl.haxx.se/libcurl",description:"Simple REST and HTTP API Client for C",extname:".c"},convert:({method:e,fullUrl:t,headersObj:n,allHeaders:r,postData:s})=>{const{push:o,blank:i,join:a}=new he;o("CURL *hnd = curl_easy_init();"),i(),o(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`),o("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"),o(`curl_easy_setopt(hnd, CURLOPT_URL, "${t}");`);const l=Object.keys(n);return l.length&&(i(),o("struct curl_slist *headers = NULL;"),l.forEach(u=>{o(`headers = curl_slist_append(headers, "${u}: ${Ue(n[u])}");`)}),o("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")),r.cookie&&(i(),o(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${r.cookie}");`)),s.text&&(i(),o(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(s.text)});`)),i(),o("CURLcode ret = curl_easy_perform(hnd);"),a()}}}};var Mc=class{constructor(e){this.name="",this.toString=()=>`:${this.name}`,this.name=e}},Sb=class{constructor(e){this.path="",this.toString=()=>`(clojure.java.io/file "${this.path}")`,this.path=e}};const Td=e=>e===void 0?null:e===null?"null":e.constructor.name.toLowerCase(),Ad=e=>e===void 0?!0:Td(e)==="object"?Object.keys(e).length===0:!1,Lc=e=>(Object.keys(e).filter(t=>Ad(e[t])).forEach(t=>{delete e[t]}),e),bs=(e,t)=>{const n=" ".repeat(e);return t.replace(/\n/g,`
136
+ ${n}`)},Di=e=>{switch(Td(e)){case"string":return`"${e.replace(/"/g,'\\"')}"`;case"file":return e.toString();case"keyword":return e.toString();case"null":return"nil";case"regexp":return`#"${e.source}"`;case"object":{const t=Object.keys(e).reduce((n,r)=>`${n}:${r} ${bs(r.length+2,Di(e[r]))}
137
+ `,"").trim();return`{${bs(1,t)}}`}case"array":{const t=e.reduce((n,r)=>`${n} ${Di(r)}`,"").trim();return`[${bs(1,t)}]`}default:return e.toString()}},jb={info:{key:"clojure",title:"Clojure",default:"clj_http"},clientsById:{clj_http:{info:{key:"clj_http",title:"clj-http",link:"https://github.com/dakrone/clj-http",description:"An idiomatic clojure http client wrapping the apache client.",extname:".clj"},convert:({queryObj:e,method:t,postData:n,url:r,allHeaders:s},o)=>{const{push:i,join:a}=new he({indent:o==null?void 0:o.indent}),l=["get","post","put","delete","patch","head","options"];if(t=t.toLowerCase(),!l.includes(t))return i("Method not supported"),a();const u={headers:s,"query-params":e};switch(n.mimeType){case"application/json":{u["content-type"]=new Mc("json"),u["form-params"]=n.jsonObj;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"application/x-www-form-urlencoded":{u["form-params"]=n.paramsObj;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"text/plain":{u.body=n.text;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"multipart/form-data":if(n.params){u.multipart=n.params.map(d=>d.fileName&&!d.value?{name:d.name,content:new Sb(d.fileName)}:{name:d.name,content:d.value});const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break}switch(Rt(u.headers,"accept")){case"application/json":{u.accept=new Mc("json");const f=Ze(u.headers,"accept");f&&delete u.headers[f]}break}if(i(`(require '[clj-http.client :as client])
138
+ `),Ad(Lc(u)))i(`(client/${t} "${r}")`);else{const f=11+t.length+r.length,d=bs(f,Di(Lc(u)));i(`(client/${t} "${r}" ${d})`)}return a()}}}},Eb={info:{key:"crystal",title:"Crystal",default:"native"},clientsById:{native:{info:{key:"native",title:"http::client",link:"https://crystal-lang.org/api/master/HTTP/Client.html",description:"Crystal HTTP client",extname:".cr"},convert:({method:e,fullUrl:t,postData:n,allHeaders:r},s={})=>{const{insecureSkipVerify:o=!1}=s,{push:i,blank:a,join:l}=new he;i('require "http/client"'),a(),i(`url = "${t}"`);const u=Object.keys(r);u.length&&(i("headers = HTTP::Headers{"),u.forEach(g=>{i(` "${g}" => "${Ue(r[g])}"`)}),i("}")),n.text&&i(`reqBody = ${JSON.stringify(n.text)}`),a();const f=e.toUpperCase(),d=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS"],p=u.length?", headers: headers":"",h=n.text?", body: reqBody":"",m=o?", tls: OpenSSL::SSL::Context::Client.insecure":"";return d.includes(f)?i(`response = HTTP::Client.${f.toLowerCase()} url${p}${h}${m}`):i(`response = HTTP::Client.exec "${f}", url${p}${h}${m}`),i("puts response.body"),l()}}}},kb=e=>{let t=Rt(e,"accept-encoding");if(!t)return[];const n={gzip:"DecompressionMethods.GZip",deflate:"DecompressionMethods.Deflate"},r=[];return typeof t=="string"&&(t=[t]),t.forEach(s=>{s.split(",").forEach(o=>{const i=/\s*([^;\s]+)/.exec(o);if(i){const a=n[i[1]];a&&r.push(a)}})}),r},Tb={info:{key:"httpclient",title:"HttpClient",link:"https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",description:".NET Standard HTTP Client",extname:".cs"},convert:({allHeaders:e,postData:t,method:n,fullUrl:r},s)=>{var p,h;const{push:o,join:i}=new he({indent:{indent:" ",...s}.indent});o("using System.Net.Http.Headers;");let a="";const l=!!e.cookie,u=kb(e);(l||u.length)&&(a="clientHandler",o("var clientHandler = new HttpClientHandler"),o("{"),l&&o("UseCookies = false,",1),u.length&&o(`AutomaticDecompression = ${u.join(" | ")},`,1),o("};")),o(`var client = new HttpClient(${a});`),o("var request = new HttpRequestMessage"),o("{");const f=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"];n=n.toUpperCase(),n&&f.includes(n)?n=`HttpMethod.${n[0]}${n.substring(1).toLowerCase()}`:n=`new HttpMethod("${n}")`,o(`Method = ${n},`,1),o(`RequestUri = new Uri("${r}"),`,1);const d=Object.keys(e).filter(m=>{switch(m.toLowerCase()){case"content-type":case"content-length":case"accept-encoding":return!1;default:return!0}});if(d.length&&(o("Headers =",1),o("{",1),d.forEach(m=>{o(`{ "${m}", "${Ue(e[m])}" },`,2)}),o("},",1)),t.text){const m=t.mimeType;switch(m){case"application/x-www-form-urlencoded":o("Content = new FormUrlEncodedContent(new Dictionary<string, string>",1),o("{",1),(p=t.params)==null||p.forEach(g=>{o(`{ "${g.name}", "${g.value}" },`,2)}),o("}),",1);break;case"multipart/form-data":o("Content = new MultipartFormDataContent",1),o("{",1),(h=t.params)==null||h.forEach(g=>{o(`new StringContent(${JSON.stringify(g.value||"")})`,2),o("{",2),o("Headers =",3),o("{",3),g.contentType&&o(`ContentType = new MediaTypeHeaderValue("${g.contentType}"),`,4),o('ContentDisposition = new ContentDispositionHeaderValue("form-data")',4),o("{",4),o(`Name = "${g.name}",`,5),g.fileName&&o(`FileName = "${g.fileName}",`,5),o("}",4),o("}",3),o("},",2)}),o("},",1);break;default:o(`Content = new StringContent(${JSON.stringify(t.text||"")})`,1),o("{",1),o("Headers =",2),o("{",2),o(`ContentType = new MediaTypeHeaderValue("${m}")`,3),o("}",2),o("}",1);break}}return o("};"),o("using (var response = await client.SendAsync(request))"),o("{"),o("response.EnsureSuccessStatusCode();",1),o("var body = await response.Content.ReadAsStringAsync();",1),o("Console.WriteLine(body);",1),o("}"),i()}};function Ab(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()}const Ob={info:{key:"csharp",title:"C#",default:"restsharp",cli:"dotnet"},clientsById:{httpclient:Tb,restsharp:{info:{key:"restsharp",title:"RestSharp",link:"http://restsharp.org/",description:"Simple REST and HTTP API Client for .NET",extname:".cs",installation:()=>"dotnet add package RestSharp"},convert:({method:e,fullUrl:t,headersObj:n,cookies:r,postData:s,uriObj:o})=>{const{push:i,join:a}=new he;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase()))return"Method not supported";i(`using RestSharp;
139
+
140
+ `),i(`var options = new RestClientOptions("${t}");`),i("var client = new RestClient(options);"),i('var request = new RestRequest("");');const l=s.mimeType&&s.mimeType==="multipart/form-data";switch(l&&i("request.AlwaysMultipartFormData = true;"),Object.keys(n).forEach(u=>{if(s.mimeType&&u.toLowerCase()==="content-type"&&s.text){l&&s.boundary&&i(`request.FormBoundary = "${s.boundary}";`);return}i(`request.AddHeader("${u}", "${Ue(n[u])}");`)}),r.forEach(({name:u,value:f})=>{i(`request.AddCookie("${u}", "${Ue(f)}", "${o.pathname}", "${o.host}");`)}),s.mimeType){case"multipart/form-data":if(!s.params)break;s.params.forEach(u=>{u.fileName?i(`request.AddFile("${u.name}", "${u.fileName}");`):i(`request.AddParameter("${u.name}", "${u.value}");`)});break;case"application/x-www-form-urlencoded":if(!s.params)break;s.params.forEach(u=>{i(`request.AddParameter("${u.name}", "${u.value}");`)});break;case"application/json":if(!s.text)break;i(`request.AddJsonBody(${JSON.stringify(s.text)}, false);`);break;default:if(!s.text)break;i(`request.AddStringBody("${s.text}", "${s.mimeType}");`)}return i(`var response = await client.${Ab(e)}Async(request);
141
+ `),i(`Console.WriteLine("{0}", response.Content);
142
+ `),a()}}}},Nb={info:{key:"go",title:"Go",default:"native",cli:"go"},clientsById:{native:{info:{key:"native",title:"NewRequest",link:"http://golang.org/pkg/net/http/#NewRequest",description:"Golang HTTP client request",extname:".go"},convert:({postData:e,method:t,allHeaders:n,fullUrl:r},s={})=>{const{blank:o,push:i,join:a}=new he({indent:" "}),{showBoilerplate:l=!0,checkErrors:u=!1,printBody:f=!0,timeout:d=-1,insecureSkipVerify:p=!1}=s,h=u?"err":"_",m=l?1:0,g=()=>{u&&(i("if err != nil {",m),i("panic(err)",m+1),i("}",m))};l&&(i("package main"),o(),i("import ("),i('"fmt"',m),d>0&&i('"time"',m),p&&i('"crypto/tls"',m),e.text&&i('"strings"',m),i('"net/http"',m),f&&i('"io"',m),i(")"),o(),i("func main() {"),o()),p&&(i("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()",m),i("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}",m));const v=d>0,j=v||p,y=j?"client":"http.DefaultClient";return j&&(i("client := http.Client{",m),v&&i(`Timeout: time.Duration(${d} * time.Second),`,m+1),p&&i("Transport: insecureTransport,",m+1),i("}",m),o()),i(`url := "${r}"`,m),o(),e.text?(i(`payload := strings.NewReader(${JSON.stringify(e.text)})`,m),o(),i(`req, ${h} := http.NewRequest("${t}", url, payload)`,m),o()):(i(`req, ${h} := http.NewRequest("${t}", url, nil)`,m),o()),g(),Object.keys(n).length&&(Object.keys(n).forEach(b=>{i(`req.Header.Add("${b}", "${Ue(n[b])}")`,m)}),o()),i(`res, ${h} := ${y}.Do(req)`,m),g(),f&&(o(),i("defer res.Body.Close()",m),i(`body, ${h} := io.ReadAll(res.Body)`,m),g()),o(),f&&i("fmt.Println(string(body))",m),l&&(o(),i("}")),a()}}}},Dc=`\r
143
+ `,Cb={info:{key:"http",title:"HTTP",default:"http1.1"},clientsById:{"http1.1":{info:{key:"http1.1",title:"HTTP/1.1",link:"https://tools.ietf.org/html/rfc7230",description:"HTTP/1.1 request string in accordance with RFC 7230",extname:null},convert:({method:e,fullUrl:t,uriObj:n,httpVersion:r,allHeaders:s,postData:o},i)=>{const a={absoluteURI:!1,autoContentLength:!0,autoHost:!0,...i},{blank:l,push:u,join:f}=new he({indent:"",join:Dc});u(`${e} ${a.absoluteURI?t:n.path} ${r}`);const d=Object.keys(s);d.forEach(m=>{const g=m.toLowerCase().replace(/(^|-)(\w)/g,v=>v.toUpperCase());u(`${g}: ${s[m]}`)}),a.autoHost&&!d.includes("host")&&u(`Host: ${n.host}`),a.autoContentLength&&o.text&&!d.includes("content-length")&&u(`Content-Length: ${Buffer.byteLength(o.text,"ascii").toString()}`),l();const p=f(),h=o.text||"";return`${p}${Dc}${h}`}}}},_b={info:{key:"java",title:"Java",default:"unirest"},clientsById:{asynchttp:{info:{key:"asynchttp",title:"AsyncHttp",link:"https://github.com/AsyncHttpClient/async-http-client",description:"Asynchronous Http and WebSocket Client library for Java",extname:".java"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const{blank:o,push:i,join:a}=new he({indent:{indent:" ",...s}.indent});return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"),i(`client.prepare("${e.toUpperCase()}", "${r}")`),Object.keys(t).forEach(l=>{i(`.setHeader("${l}", "${Ue(t[l])}")`,1)}),n.text&&i(`.setBody(${JSON.stringify(n.text)})`,1),i(".execute()",1),i(".toCompletableFuture()",1),i(".thenAccept(System.out::println)",1),i(".join();",1),o(),i("client.close();"),a()}},nethttp:{info:{key:"nethttp",title:"java.net.http",link:"https://openjdk.java.net/groups/net/httpclient/intro.html",description:"Java Standardized HTTP Client API",extname:".java"},convert:({allHeaders:e,fullUrl:t,method:n,postData:r},s)=>{const{push:o,join:i}=new he({indent:{indent:" ",...s}.indent});return o("HttpRequest request = HttpRequest.newBuilder()"),o(`.uri(URI.create("${t}"))`,2),Object.keys(e).forEach(a=>{o(`.header("${a}", "${Ue(e[a])}")`,2)}),r.text?o(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(r.text)}))`,2):o(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`,2),o(".build();",2),o("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"),o("System.out.println(response.body());"),i()}},okhttp:{info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".java"},convert:({postData:e,method:t,fullUrl:n,allHeaders:r},s)=>{const{push:o,blank:i,join:a}=new he({indent:{indent:" ",...s}.indent}),l=["GET","POST","PUT","DELETE","PATCH","HEAD"],u=["POST","PUT","DELETE","PATCH"];return o("OkHttpClient client = new OkHttpClient();"),i(),e.text&&(e.boundary?o(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`):o(`MediaType mediaType = MediaType.parse("${e.mimeType}");`),o(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)),o("Request request = new Request.Builder()"),o(`.url("${n}")`,1),l.includes(t.toUpperCase())?u.includes(t.toUpperCase())?e.text?o(`.${t.toLowerCase()}(body)`,1):o(`.${t.toLowerCase()}(null)`,1):o(`.${t.toLowerCase()}()`,1):e.text?o(`.method("${t.toUpperCase()}", body)`,1):o(`.method("${t.toUpperCase()}", null)`,1),Object.keys(r).forEach(f=>{o(`.addHeader("${f}", "${Ue(r[f])}")`,1)}),o(".build();",1),i(),o("Response response = client.newCall(request).execute();"),a()}},unirest:{info:{key:"unirest",title:"Unirest",link:"http://unirest.io/java.html",description:"Lightweight HTTP Request Client Library",extname:".java"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const{join:o,push:i}=new he({indent:{indent:" ",...s}.indent});return["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase())?i(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${r}")`):i(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${r}")`),Object.keys(t).forEach(a=>{i(`.header("${a}", "${Ue(t[a])}")`,1)}),n.text&&i(`.body(${JSON.stringify(n.text)})`,1),i(".asString();",1),o()}}}},Rb={info:{key:"javascript",title:"JavaScript",default:"fetch"},clientsById:{xhr:{info:{key:"xhr",title:"XMLHttpRequest",link:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",description:"W3C Standard API that provides scripted client functionality",extname:".js"},convert:({postData:e,allHeaders:t,method:n,fullUrl:r},s)=>{var u;const o={indent:" ",cors:!0,...s},{blank:i,push:a,join:l}=new he({indent:o.indent});switch(e.mimeType){case"application/json":a(`const data = JSON.stringify(${Ot(e.jsonObj,{indent:o.indent})});`),i();break;case"multipart/form-data":if(!e.params)break;if(a("const data = new FormData();"),e.params.forEach(f=>{a(`data.append('${f.name}', '${f.value||f.fileName||""}');`)}),Ds(t,"content-type")&&(u=Rt(t,"content-type"))!=null&&u.includes("boundary")){const f=Ze(t,"content-type");f&&delete t[f]}i();break;default:a(`const data = ${e.text?`'${e.text}'`:"null"};`),i()}return a("const xhr = new XMLHttpRequest();"),o.cors&&a("xhr.withCredentials = true;"),i(),a("xhr.addEventListener('readystatechange', function () {"),a("if (this.readyState === this.DONE) {",1),a("console.log(this.responseText);",2),a("}",1),a("});"),i(),a(`xhr.open('${n}', '${r}');`),Object.keys(t).forEach(f=>{a(`xhr.setRequestHeader('${f}', '${Un(t[f])}');`)}),i(),a("xhr.send(data);"),l()}},axios:{info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:()=>"npm install axios --save"},convert:({allHeaders:e,method:t,url:n,queryObj:r,postData:s},o)=>{const{blank:i,push:a,join:l,addPostProcessor:u}=new he({indent:{indent:" ",...o}.indent});a("import axios from 'axios';"),i();const f={method:t,url:n};switch(Object.keys(r).length&&(f.params=r),Object.keys(e).length&&(f.headers=e),s.mimeType){case"application/x-www-form-urlencoded":s.params&&(a("const encodedParams = new URLSearchParams();"),s.params.forEach(d=>{a(`encodedParams.set('${d.name}', '${d.value}');`)}),i(),f.data="encodedParams,",u(d=>d.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":s.jsonObj&&(f.data=s.jsonObj);break;case"multipart/form-data":if(!s.params)break;a("const form = new FormData();"),s.params.forEach(d=>{a(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),i(),f.data="[form]";break;default:s.text&&(f.data=s.text)}return a(`const options = ${Ot(f,{indent:" ",inlineCharacterLimit:80}).replace('"[form]"',"form")};`),i(),a("try {"),a("const { data } = await axios.request(options);",1),a("console.log(data);",1),a("} catch (error) {"),a("console.error(error);",1),a("}"),l()}},fetch:{info:{key:"fetch",title:"fetch",link:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const o={indent:" ",credentials:null,...s},{blank:i,join:a,push:l}=new he({indent:o.indent}),u={method:e};switch(Object.keys(t).length&&(u.headers=t),o.credentials!==null&&(u.credentials=o.credentials),n.mimeType){case"application/x-www-form-urlencoded":u.body=n.paramsObj?n.paramsObj:n.text;break;case"application/json":n.jsonObj&&(u.body=n.jsonObj);break;case"multipart/form-data":{if(!n.params)break;const f=Ze(t,"content-type");f&&delete t[f],l("const form = new FormData();"),n.params.forEach(d=>{l(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),i();break}default:n.text&&(u.body=n.text)}return u.headers&&!Object.keys(u.headers).length&&delete u.headers,l(`const options = ${Ot(u,{indent:o.indent,inlineCharacterLimit:80,transform:(f,d,p)=>{if(d==="body"){if(n.mimeType==="application/x-www-form-urlencoded")return`new URLSearchParams(${p})`;if(n.mimeType==="application/json")return`JSON.stringify(${p})`}return p}})};`),i(),n.params&&n.mimeType==="multipart/form-data"&&(l("options.body = form;"),i()),l(`fetch('${r}', options)`),l(".then(res => res.json())",1),l(".then(res => console.log(res))",1),l(".catch(err => console.error(err));",1),a()}},jquery:{info:{key:"jquery",title:"jQuery",link:"http://api.jquery.com/jquery.ajax/",description:"Perform an asynchronous HTTP (Ajax) requests with jQuery",extname:".js"},convert:({fullUrl:e,method:t,allHeaders:n,postData:r},s)=>{var f;const o={indent:" ",...s},{blank:i,push:a,join:l}=new he({indent:o.indent}),u={async:!0,crossDomain:!0,url:e,method:t,headers:n};switch(r.mimeType){case"application/x-www-form-urlencoded":u.data=r.paramsObj?r.paramsObj:r.text;break;case"application/json":u.processData=!1,u.data=r.text;break;case"multipart/form-data":if(!r.params)break;if(a("const form = new FormData();"),r.params.forEach(d=>{a(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),u.processData=!1,u.contentType=!1,u.mimeType="multipart/form-data",u.data="[form]",Ds(n,"content-type")&&(f=Rt(n,"content-type"))!=null&&f.includes("boundary")){const d=Ze(n,"content-type");d&&delete u.headers[d]}i();break;default:r.text&&(u.data=r.text)}return a(`const settings = ${Ot(u,{indent:o.indent}).replace("'[form]'","form")};`),i(),a("$.ajax(settings).done(res => {"),a("console.log(res);",1),a("});"),l()}}}},Ib={info:{key:"json",title:"JSON",default:"native"},clientsById:{native:{info:{key:"native",title:"Native JSON",link:"https://www.json.org/json-en.html",description:"A JSON represetation of any HAR payload.",extname:".json"},convert:({postData:e},t)=>{const n={indent:" ",...t};let r="";switch(e.mimeType){case"application/x-www-form-urlencoded":r=e.paramsObj?e.paramsObj:e.text;break;case"application/json":e.jsonObj&&(r=e.jsonObj);break;case"multipart/form-data":{if(!e.params)break;const s={};e.params.forEach(o=>{s[o.name]=o.value}),r=s;break}default:e.text&&(r=e.text)}return typeof r>"u"||r===""?"No JSON body":JSON.stringify(r,null,n.indent)}}}},Pb={info:{key:"kotlin",title:"Kotlin",default:"okhttp"},clientsById:{okhttp:{info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".kt"},convert:({postData:e,fullUrl:t,method:n,allHeaders:r},s)=>{const{blank:o,join:i,push:a}=new he({indent:{indent:" ",...s}.indent}),l=["GET","POST","PUT","DELETE","PATCH","HEAD"],u=["POST","PUT","DELETE","PATCH"];return a("val client = OkHttpClient()"),o(),e.text&&(e.boundary?a(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`):a(`val mediaType = MediaType.parse("${e.mimeType}")`),a(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)),a("val request = Request.Builder()"),a(`.url("${t}")`,1),l.includes(n.toUpperCase())?u.includes(n.toUpperCase())?e.text?a(`.${n.toLowerCase()}(body)`,1):a(`.${n.toLowerCase()}(null)`,1):a(`.${n.toLowerCase()}()`,1):e.text?a(`.method("${n.toUpperCase()}", body)`,1):a(`.method("${n.toUpperCase()}", null)`,1),Object.keys(r).forEach(f=>{a(`.addHeader("${f}", "${Ue(r[f])}")`,1)}),a(".build()",1),o(),a("val response = client.newCall(request).execute()"),i()}}}},$b={info:{key:"node",title:"Node.js",default:"fetch",cli:"node %s"},clientsById:{native:{info:{key:"native",title:"HTTP",link:"http://nodejs.org/api/http.html#http_http_request_options_callback",description:"Node.js native HTTP interface",extname:".cjs"},convert:({uriObj:e,method:t,allHeaders:n,postData:r},s={})=>{var d;const{indent:o=" "}=s,{blank:i,join:a,push:l,unshift:u}=new he({indent:o}),f={method:t,hostname:e.hostname,port:e.port,path:e.path,headers:n};switch(l(`const http = require('${(d=e.protocol)==null?void 0:d.replace(":","")}');`),i(),l(`const options = ${Ot(f,{indent:o})};`),i(),l("const req = http.request(options, function (res) {"),l("const chunks = [];",1),i(),l("res.on('data', function (chunk) {",1),l("chunks.push(chunk);",2),l("});",1),i(),l("res.on('end', function () {",1),l("const body = Buffer.concat(chunks);",2),l("console.log(body.toString());",2),l("});",1),l("});"),i(),r.mimeType){case"application/x-www-form-urlencoded":r.paramsObj&&(u("const qs = require('querystring');"),l(`req.write(qs.stringify(${Ot(r.paramsObj,{indent:" ",inlineCharacterLimit:80})}));`));break;case"application/json":r.jsonObj&&l(`req.write(JSON.stringify(${Ot(r.jsonObj,{indent:" ",inlineCharacterLimit:80})}));`);break;default:r.text&&l(`req.write(${Ot(r.text,{indent:o})});`)}return l("req.end();"),a()}},axios:{info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:()=>"npm install axios --save"},convert:({method:e,fullUrl:t,allHeaders:n,postData:r},s)=>{const{blank:o,join:i,push:a,addPostProcessor:l}=new he({indent:{indent:" ",...s}.indent});a("import axios from 'axios';"),o();const u={method:e,url:t};switch(Object.keys(n).length&&(u.headers=n),r.mimeType){case"application/x-www-form-urlencoded":r.params&&(a("const encodedParams = new URLSearchParams();"),r.params.forEach(f=>{a(`encodedParams.set('${f.name}', '${f.value}');`)}),o(),u.data="encodedParams,",l(f=>f.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":r.jsonObj&&(u.data=r.jsonObj);break;default:r.text&&(u.data=r.text)}return a(`const options = ${Ot(u,{indent:" ",inlineCharacterLimit:80})};`),o(),a("axios"),a(".request(options)",1),a(".then(res => console.log(res.data))",1),a(".catch(err => console.error(err));",1),i()}},fetch:{info:{key:"fetch",title:"fetch",link:"https://nodejs.org/docs/latest/api/globals.html#fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:e,fullUrl:t,postData:n,headersObj:r,cookies:s},o)=>{var m;const i={indent:" ",...o};let a=!1;const{blank:l,push:u,join:f,unshift:d}=new he({indent:i.indent}),p=t,h={method:e};switch(Object.keys(r).length&&(h.headers=r),n.mimeType){case"application/x-www-form-urlencoded":u("const encodedParams = new URLSearchParams();"),(m=n.params)==null||m.forEach(g=>{u(`encodedParams.set('${g.name}', '${g.value}');`)}),h.body="encodedParams",l();break;case"application/json":n.jsonObj&&(h.body=n.jsonObj);break;case"multipart/form-data":{if(!n.params)break;const g=Ze(r,"content-type");g&&delete r[g],u("const formData = new FormData();"),n.params.forEach(v=>{if(!v.fileName&&!v.contentType){u(`formData.append('${v.name}', '${v.value}');`);return}v.fileName&&(a=!0,u(`formData.append('${v.name}', await new Response(fs.createReadStream('${v.fileName}')).blob());`))}),h.body="formData",l();break}default:n.text&&(h.body=n.text)}if(s.length){const g=s.map(({name:v,value:j})=>`${encodeURIComponent(v)}=${encodeURIComponent(j)}`).join("; ");h.headers||(h.headers={}),h.headers.cookie=g}return u(`const url = '${p}';`),h.headers&&!Object.keys(h.headers).length&&delete h.headers,u(`const options = ${Ot(h,{indent:" ",inlineCharacterLimit:80,transform:(g,v,j)=>v==="body"&&n.mimeType==="application/json"?`JSON.stringify(${j})`:j})};`),l(),a&&d(`import fs from 'fs';
144
+ `),u("fetch(url, options)"),u(".then(res => res.json())",1),u(".then(json => console.log(json))",1),u(".catch(err => console.error(err));",1),f().replace(/'encodedParams'/,"encodedParams").replace(/'formData'/,"formData")}}}},zo=(e,t,n,r)=>{const s=`${e} *${t} = `;return`${s}${Bi(n,r?s.length:void 0)};`},Bi=(e,t)=>{const n=t===void 0?", ":`,
145
+ ${" ".repeat(t)}`;switch(Object.prototype.toString.call(e)){case"[object Number]":return`@${e}`;case"[object Array]":return`@[ ${e.map(r=>Bi(r)).join(n)} ]`;case"[object Object]":{const r=[];return Object.keys(e).forEach(s=>{r.push(`@"${s}": ${Bi(e[s])}`)}),`@{ ${r.join(n)} }`}case"[object Boolean]":return e?"@YES":"@NO";default:return e==null?"":`@"${e.toString().replace(/"/g,'\\"')}"`}},Mb={info:{key:"objc",title:"Objective-C",default:"nsurlsession"},clientsById:{nsurlsession:{info:{key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",description:"Foundation's NSURLSession request",extname:".m"},convert:({allHeaders:e,postData:t,method:n,fullUrl:r},s)=>{var f;const o={indent:" ",pretty:!0,timeout:10,...s},{push:i,join:a,blank:l}=new he({indent:o.indent}),u={hasHeaders:!1,hasBody:!1};if(i("#import <Foundation/Foundation.h>"),Object.keys(e).length&&(u.hasHeaders=!0,l(),i(zo("NSDictionary","headers",e,o.pretty))),t.text||t.jsonObj||t.params)switch(u.hasBody=!0,t.mimeType){case"application/x-www-form-urlencoded":if((f=t.params)!=null&&f.length){l();const[d,...p]=t.params;i(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${d.name}=${d.value}" dataUsingEncoding:NSUTF8StringEncoding]];`),p.forEach(({name:h,value:m})=>{i(`[postData appendData:[@"&${h}=${m}" dataUsingEncoding:NSUTF8StringEncoding]];`)})}else u.hasBody=!1;break;case"application/json":t.jsonObj&&(i(zo("NSDictionary","parameters",t.jsonObj,o.pretty)),l(),i("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));break;case"multipart/form-data":i(zo("NSArray","parameters",t.params||[],o.pretty)),i(`NSString *boundary = @"${t.boundary}";`),l(),i("NSError *error;"),i("NSMutableString *body = [NSMutableString string];"),i("for (NSDictionary *param in parameters) {"),i('[body appendFormat:@"--%@\\r\\n", boundary];',1),i('if (param[@"fileName"]) {',1),i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',2),i('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];',2),i('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',2),i("if (error) {",2),i('NSLog(@"%@", error);',3),i("}",2),i("} else {",1),i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];',2),i('[body appendFormat:@"%@", param[@"value"]];',2),i("}",1),i("}"),i('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'),i("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");break;default:l(),i(`NSData *postData = [[NSData alloc] initWithData:[@"${t.text}" dataUsingEncoding:NSUTF8StringEncoding]];`)}return l(),i(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${r}"]`),i(" cachePolicy:NSURLRequestUseProtocolCachePolicy"),i(` timeoutInterval:${o.timeout.toFixed(1)}];`),i(`[request setHTTPMethod:@"${n}"];`),u.hasHeaders&&i("[request setAllHTTPHeaderFields:headers];"),u.hasBody&&i("[request setHTTPBody:postData];"),l(),i("NSURLSession *session = [NSURLSession sharedSession];"),i("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"),i(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"),i(" if (error) {",1),i(' NSLog(@"%@", error);',2),i(" } else {",1),i(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",2),i(' NSLog(@"%@", httpResponse);',2),i(" }",1),i(" }];"),i("[dataTask resume];"),a()}}}},Lb={info:{key:"ocaml",title:"OCaml",default:"cohttp"},clientsById:{cohttp:{info:{key:"cohttp",title:"CoHTTP",link:"https://github.com/mirage/ocaml-cohttp",description:"Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",extname:".ml",installation:()=>"opam install cohttp-lwt-unix cohttp-async"},convert:({fullUrl:e,allHeaders:t,postData:n,method:r},s)=>{const o={indent:" ",...s},i=["get","post","head","delete","patch","put","options"],{push:a,blank:l,join:u}=new he({indent:o.indent});a("open Cohttp_lwt_unix"),a("open Cohttp"),a("open Lwt"),l(),a(`let uri = Uri.of_string "${e}" in`);const f=Object.keys(t);return f.length===1?a(`let headers = Header.add (Header.init ()) "${f[0]}" "${Ue(t[f[0]])}" in`):f.length>1&&(a("let headers = Header.add_list (Header.init ()) ["),f.forEach(d=>{a(`("${d}", "${Ue(t[d])}");`,1)}),a("] in")),n.text&&a(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(n.text)} in`),l(),a(`Client.call ${f.length?"~headers ":""}${n.text?"~body ":""}${i.includes(r.toLowerCase())?`\`${r.toUpperCase()}`:`(Code.method_of_string "${r}")`} uri`),a(">>= fun (res, body_stream) ->"),a("(* Do stuff with the result *)",1),u()}}}},Te=(e,t,n)=>{switch(n=n||"",t=t||"",Object.prototype.toString.call(e)){case"[object Boolean]":return e;case"[object Null]":return"null";case"[object Undefined]":return"null";case"[object String]":return`'${Er(e,{delimiter:"'",escapeNewlines:!1})}'`;case"[object Number]":return e.toString();case"[object Array]":{const r=e.map(s=>Te(s,`${t}${t}`,t)).join(`,
146
+ ${t}`);return`[
147
+ ${t}${r}
148
+ ${n}]`}case"[object Object]":{const r=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.push(`${Te(s,t)} => ${Te(e[s],`${t}${t}`,t)}`);return`[
149
+ ${t}${r.join(`,
150
+ ${t}`)}
151
+ ${n}]`}default:return"null"}},Bc=["ACL","BASELINE_CONTROL","CHECKIN","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LABEL","LOCK","MERGE","MKACTIVITY","MKCOL","MKWORKSPACE","MOVE","OPTIONS","POST","PROPFIND","PROPPATCH","PUT","REPORT","TRACE","UNCHECKOUT","UNLOCK","UPDATE","VERSION_CONTROL"],Db={info:{key:"php",title:"PHP",default:"curl",cli:"php %s"},clientsById:{curl:{info:{key:"curl",title:"cURL",link:"http://php.net/manual/en/book.curl.php",description:"PHP with ext-curl",extname:".php"},convert:({uriObj:e,postData:t,fullUrl:n,method:r,httpVersion:s,cookies:o,headersObj:i},a={})=>{const{closingTag:l=!1,indent:u=" ",maxRedirects:f=10,namedErrors:d=!1,noTags:p=!1,shortTags:h=!1,timeout:m=30}=a,{push:g,blank:v,join:j}=new he({indent:u});p||(g(h?"<?":"<?php"),v()),g("$curl = curl_init();"),v();const y=[{escape:!0,name:"CURLOPT_PORT",value:e.port},{escape:!0,name:"CURLOPT_URL",value:n},{escape:!1,name:"CURLOPT_RETURNTRANSFER",value:"true"},{escape:!0,name:"CURLOPT_ENCODING",value:""},{escape:!1,name:"CURLOPT_MAXREDIRS",value:f},{escape:!1,name:"CURLOPT_TIMEOUT",value:m},{escape:!1,name:"CURLOPT_HTTP_VERSION",value:s==="HTTP/1.0"?"CURL_HTTP_VERSION_1_0":"CURL_HTTP_VERSION_1_1"},{escape:!0,name:"CURLOPT_CUSTOMREQUEST",value:r},{escape:!t.jsonObj,name:"CURLOPT_POSTFIELDS",value:t?t.jsonObj?`json_encode(${Te(t.jsonObj,u.repeat(2),u)})`:t.text:void 0}];g("curl_setopt_array($curl, [");const b=new he({indent:u,join:`
152
+ ${u}`});y.forEach(({value:w,name:E,escape:C})=>{w!=null&&b.push(`${E} => ${C?JSON.stringify(w):w},`)});const S=o.map(w=>`${encodeURIComponent(w.name)}=${encodeURIComponent(w.value)}`);S.length&&b.push(`CURLOPT_COOKIE => "${S.join("; ")}",`);const k=Object.keys(i).sort().map(w=>`"${w}: ${Ue(i[w])}"`);return k.length&&(b.push("CURLOPT_HTTPHEADER => ["),b.push(k.join(`,
153
+ ${u}${u}`),1),b.push("],")),g(b.join(),1),g("]);"),v(),g("$response = curl_exec($curl);"),g("$err = curl_error($curl);"),v(),g("curl_close($curl);"),v(),g("if ($err) {"),g(d?'echo array_flip(get_defined_constants(true)["curl"])[$err];':'echo "cURL Error #:" . $err;',1),g("} else {"),g("echo $response;",1),g("}"),!p&&l&&(v(),g("?>")),j()}},guzzle:{info:{key:"guzzle",title:"Guzzle",link:"http://docs.guzzlephp.org/en/stable/",description:"PHP with Guzzle",extname:".php",installation:()=>"composer require guzzlehttp/guzzle"},convert:({postData:e,fullUrl:t,method:n,cookies:r,headersObj:s},o)=>{var g;const i={closingTag:!1,indent:" ",noTags:!1,shortTags:!1,...o},{push:a,blank:l,join:u}=new he({indent:i.indent}),{code:f,push:d,join:p}=new he({indent:i.indent});switch(i.noTags||a(i.shortTags?"<?":"<?php"),a("require_once('vendor/autoload.php');"),l(),e.mimeType){case"application/x-www-form-urlencoded":d(`'form_params' => ${Te(e.paramsObj,i.indent+i.indent,i.indent)},`,1);break;case"multipart/form-data":{const v=[];if(e.params&&e.params.forEach(j=>{if(j.fileName){const y={name:j.name,filename:j.fileName,contents:j.value};j.contentType&&(y.headers={"Content-Type":j.contentType}),v.push(y)}else j.value&&v.push({name:j.name,contents:j.value})}),v.length&&(d(`'multipart' => ${Te(v,i.indent+i.indent,i.indent)}`,1),Ds(s,"content-type")&&(g=Rt(s,"content-type"))!=null&&g.indexOf("boundary"))){const j=Ze(s,"content-type");j&&delete s[j]}break}default:e.text&&d(`'body' => ${Te(e.text)},`,1)}const h=Object.keys(s).sort().map(v=>`${i.indent}${i.indent}'${v}' => '${Un(s[v])}',`),m=r.map(v=>`${encodeURIComponent(v.name)}=${encodeURIComponent(v.value)}`).join("; ");return m.length&&h.push(`${i.indent}${i.indent}'cookie' => '${Un(m)}',`),h.length&&(d("'headers' => [",1),d(h.join(`
154
+ `)),d("],",1)),a("$client = new \\GuzzleHttp\\Client();"),l(),f.length?(a(`$response = $client->request('${n}', '${t}', [`),a(p()),a("]);")):a(`$response = $client->request('${n}', '${t}');`),l(),a("echo $response->getBody();"),!i.noTags&&i.closingTag&&(l(),a("?>")),u()}},http1:{info:{key:"http1",title:"HTTP v1",link:"http://php.net/manual/en/book.http.php",description:"PHP with pecl/http v1",extname:".php"},convert:({method:e,url:t,postData:n,queryObj:r,headersObj:s,cookiesObj:o},i={})=>{const{closingTag:a=!1,indent:l=" ",noTags:u=!1,shortTags:f=!1}=i,{push:d,blank:p,join:h}=new he({indent:l});switch(u||(d(f?"<?":"<?php"),p()),Bc.includes(e.toUpperCase())||d(`HttpRequest::methodRegister('${e}');`),d("$request = new HttpRequest();"),d(`$request->setUrl(${Te(t)});`),Bc.includes(e.toUpperCase())?d(`$request->setMethod(HTTP_METH_${e.toUpperCase()});`):d(`$request->setMethod(HttpRequest::HTTP_METH_${e.toUpperCase()});`),p(),Object.keys(r).length&&(d(`$request->setQueryData(${Te(r,l)});`),p()),Object.keys(s).length&&(d(`$request->setHeaders(${Te(s,l)});`),p()),Object.keys(o).length&&(d(`$request->setCookies(${Te(o,l)});`),p()),n.mimeType){case"application/x-www-form-urlencoded":d(`$request->setContentType(${Te(n.mimeType)});`),d(`$request->setPostFields(${Te(n.paramsObj,l)});`),p();break;case"application/json":d(`$request->setContentType(${Te(n.mimeType)});`),d(`$request->setBody(json_encode(${Te(n.jsonObj,l)}));`),p();break;default:n.text&&(d(`$request->setBody(${Te(n.text)});`),p())}return d("try {"),d("$response = $request->send();",1),p(),d("echo $response->getBody();",1),d("} catch (HttpException $ex) {"),d("echo $ex;",1),d("}"),!u&&a&&(p(),d("?>")),h()}},http2:{info:{key:"http2",title:"HTTP v2",link:"http://devel-m6w6.rhcloud.com/mdref/http",description:"PHP with pecl/http v2",extname:".php"},convert:({postData:e,headersObj:t,method:n,queryObj:r,cookiesObj:s,url:o},i={})=>{var g;const{closingTag:a=!1,indent:l=" ",noTags:u=!1,shortTags:f=!1}=i,{push:d,blank:p,join:h}=new he({indent:l});let m=!1;switch(u||(d(f?"<?":"<?php"),p()),d("$client = new http\\Client;"),d("$request = new http\\Client\\Request;"),p(),e.mimeType){case"application/x-www-form-urlencoded":d("$body = new http\\Message\\Body;"),d(`$body->append(new http\\QueryString(${Te(e.paramsObj,l)}));`),p(),m=!0;break;case"multipart/form-data":{if(!e.params)break;const v=[],j={};e.params.forEach(({name:S,fileName:k,value:w,contentType:E})=>{if(k){v.push({name:S,type:E,file:k,data:w});return}w&&(j[S]=w)});const y=Object.keys(j).length?Te(j,l):"null",b=v.length?Te(v,l):"null";if(d("$body = new http\\Message\\Body;"),d(`$body->addForm(${y}, ${b});`),Ds(t,"content-type")&&(g=Rt(t,"content-type"))!=null&&g.indexOf("boundary")){const S=Ze(t,"content-type");S&&delete t[S]}p(),m=!0;break}case"application/json":d("$body = new http\\Message\\Body;"),d(`$body->append(json_encode(${Te(e.jsonObj,l)}));`),m=!0;break;default:e.text&&(d("$body = new http\\Message\\Body;"),d(`$body->append(${Te(e.text)});`),p(),m=!0)}return d(`$request->setRequestUrl(${Te(o)});`),d(`$request->setRequestMethod(${Te(n)});`),m&&(d("$request->setBody($body);"),p()),Object.keys(r).length&&(d(`$request->setQuery(new http\\QueryString(${Te(r,l)}));`),p()),Object.keys(t).length&&(d(`$request->setHeaders(${Te(t,l)});`),p()),Object.keys(s).length&&(p(),d(`$client->setCookies(${Te(s,l)});`),p()),d("$client->enqueue($request)->send();"),d("$response = $client->getResponse();"),p(),d("echo $response->getBody();"),!u&&a&&(p(),d("?>")),h()}}}},Od=e=>({method:n,headersObj:r,cookies:s,uriObj:o,fullUrl:i,postData:a,allHeaders:l})=>{const{push:u,join:f}=new he;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(n.toUpperCase()))return"Method not supported";const d=[],p=Object.keys(r);return p.length&&(u("$headers=@{}"),p.forEach(h=>{h!=="connection"&&u(`$headers.Add("${h}", "${Er(r[h],{escapeChar:"`"})}")`)}),d.push("-Headers $headers")),s.length&&(u("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"),s.forEach(h=>{u("$cookie = New-Object System.Net.Cookie"),u(`$cookie.Name = '${h.name}'`),u(`$cookie.Value = '${h.value}'`),u(`$cookie.Domain = '${o.host}'`),u("$session.Cookies.Add($cookie)")}),d.push("-WebSession $session")),a.text&&(d.push(`-ContentType '${Er(Rt(l,"content-type"),{delimiter:"'",escapeChar:"`"})}'`),d.push(`-Body '${a.text}'`)),u(`$response = ${e} -Uri '${i}' -Method ${n} ${d.join(" ")}`.trim()),f()},Bb={info:{key:"restmethod",title:"Invoke-RestMethod",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",description:"Powershell Invoke-RestMethod client",extname:".ps1"},convert:Od("Invoke-RestMethod")},Fb={info:{key:"powershell",title:"Powershell",default:"webrequest"},clientsById:{webrequest:{info:{key:"webrequest",title:"Invoke-WebRequest",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",description:"Powershell Invoke-WebRequest client",extname:".ps1"},convert:Od("Invoke-WebRequest")},restmethod:Bb}};function Fc(e,t,n,r,s){const o=r.repeat(s),i=r.repeat(s-1),a=n?`,
155
+ ${o}`:", ",l=e==="object"?"{":"[",u=e==="object"?"}":"]";return n?`${l}
156
+ ${o}${t.join(a)}
157
+ ${i}${u}`:e==="object"&&t.length>0?`${l} ${t.join(a)} ${u}`:`${l}${t.join(a)}${u}`}const Pn=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let r=!1;return Fc("array",e.map(s=>(Object.prototype.toString.call(s)==="[object Object]"&&(r=Object.keys(s).length>1),Pn(s,t,n))),r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${Pn(e[s],t,n)}`);return Fc("object",r,t.pretty&&r.length>1,t.indent,n)}case"[object Null]":return"None";case"[object Boolean]":return e?"True":"False";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},Ub=["HEAD","GET","POST","PUT","PATCH","DELETE","OPTIONS"],Hb={info:{key:"python",title:"Python",default:"requests",cli:"python3 %s"},clientsById:{requests:{info:{key:"requests",title:"Requests",link:"http://docs.python-requests.org/en/latest/api/#requests.request",description:"Requests HTTP library",extname:".py",installation:()=>"python -m pip install requests"},convert:({fullUrl:e,postData:t,allHeaders:n,method:r},s)=>{const o={indent:" ",pretty:!0,...s},{push:i,blank:a,join:l,addPostProcessor:u}=new he({indent:o.indent});i("import requests"),a(),i(`url = "${e}"`),a();const f=n;let d={};const p={};let h=!1,m=!1,g=!1;switch(t.mimeType){case"application/json":t.jsonObj&&(i(`payload = ${Pn(t.jsonObj,o)}`),g=!0,m=!0);break;case"multipart/form-data":if(!t.params)break;if(d={},t.params.forEach(y=>{y.fileName?(y.contentType?p[y.name]=`('${y.fileName}', open('${y.fileName}', 'rb'), '${y.contentType}')`:p[y.name]=`('${y.fileName}', open('${y.fileName}', 'rb'))`,h=!0):(d[y.name]=y.value,m=!0)}),h){i(`files = ${Pn(p,o)}`),m&&i(`payload = ${Pn(d,o)}`);const y=Ze(f,"content-type");y&&delete f[y]}else{const y=JSON.stringify(t.text);y&&(i(`payload = ${y}`),m=!0)}u(y=>y.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g,'("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g,'("$1", open("$2", "rb"), "$3")'));break;default:{if(t.mimeType==="application/x-www-form-urlencoded"&&t.paramsObj){i(`payload = ${Pn(t.paramsObj,o)}`),m=!0;break}const y=JSON.stringify(t.text);y&&(i(`payload = ${y}`),m=!0)}}const v=Object.keys(f).length;if(v===0&&(m||h))a();else if(v===1)Object.keys(f).forEach(y=>{i(`headers = {"${y}": "${Ue(f[y])}"}`),a()});else if(v>1){let y=1;i("headers = {"),Object.keys(f).forEach(b=>{i(y!==v?`"${b}": "${Ue(f[b])}",`:`"${b}": "${Ue(f[b])}"`,1),y+=1}),i("}"),a()}let j=Ub.includes(r)?`response = requests.${r.toLowerCase()}(url`:`response = requests.request("${r}", url`;return m&&(g?j+=", json=payload":j+=", data=payload"),h&&(j+=", files=files"),v>0&&(j+=", headers=headers"),j+=")",i(j),a(),i("print(response.text)"),l()}}}},qb={info:{key:"r",title:"R",default:"httr"},clientsById:{httr:{info:{key:"httr",title:"httr",link:"https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",description:"httr: Tools for Working with URLs and HTTP",extname:".r"},convert:({url:e,queryObj:t,queryString:n,postData:r,allHeaders:s,method:o})=>{const{push:i,blank:a,join:l}=new he;i("library(httr)"),a(),i(`url <- "${e}"`),a();const u=t;delete t.key;const f=Object.keys(u).length;n.length===1?(i(`queryString <- list(${Object.keys(u)} = "${Object.values(u).toString()}")`),a()):n.length>1&&(i("queryString <- list("),Object.keys(u).forEach((k,w)=>{w!==f-1?i(` ${k} = "${u[k].toString()}",`):i(` ${k} = "${u[k].toString()}"`)}),i(")"),a());const d=JSON.stringify(r.text);if(d&&(i(`payload <- ${d}`),a()),r.text||r.jsonObj||r.params)switch(r.mimeType){case"application/x-www-form-urlencoded":i('encode <- "form"'),a();break;case"application/json":i('encode <- "json"'),a();break;case"multipart/form-data":i('encode <- "multipart"'),a();break;default:i('encode <- "raw"'),a();break}const p=Rt(s,"cookie"),h=Rt(s,"accept"),m=p?`set_cookies(\`${String(p).replace(/;/g,'", `').replace(/` /g,"`").replace(/[=]/g,'` = "')}")`:void 0,g=h?`accept("${Ue(h)}")`:void 0,v=`content_type("${Ue(r.mimeType)}")`,j=Object.entries(s).filter(([k])=>!["cookie","accept","content-type"].includes(k.toLowerCase())).map(([k,w])=>`'${k}' = '${Un(w)}'`).join(", "),y=j?`add_headers(${j})`:void 0;let b=`response <- VERB("${o}", url`;d&&(b+=", body = payload"),n.length&&(b+=", query = queryString");const S=[y,v,g,m].filter(k=>!!k).join(", ");return S&&(b+=`, ${S}`),(r.text||r.jsonObj||r.params)&&(b+=", encode = encode"),b+=")",i(b),a(),i('content(response, "text")'),l()}}}},zb={info:{key:"ruby",title:"Ruby",default:"native"},clientsById:{native:{info:{key:"native",title:"net::http",link:"http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",description:"Ruby HTTP client",extname:".rb"},convert:({uriObj:e,method:t,fullUrl:n,postData:r,allHeaders:s})=>{const{push:o,blank:i,join:a}=new he;o("require 'uri'"),o("require 'net/http'"),i();const l=t.toUpperCase(),u=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"],f=l.charAt(0)+l.substring(1).toLowerCase();u.includes(l)||(o(`class Net::HTTP::${f} < Net::HTTPRequest`),o(` METHOD = '${l.toUpperCase()}'`),o(` REQUEST_HAS_BODY = '${r.text?"true":"false"}'`),o(" RESPONSE_HAS_BODY = true"),o("end"),i()),o(`url = URI("${n}")`),i(),o("http = Net::HTTP.new(url.host, url.port)"),e.protocol==="https:"&&o("http.use_ssl = true"),i(),o(`request = Net::HTTP::${f}.new(url)`);const d=Object.keys(s);return d.length&&d.forEach(p=>{o(`request["${p}"] = '${Un(s[p])}'`)}),r.text&&o(`request.body = ${JSON.stringify(r.text)}`),i(),o("response = http.request(request)"),o("puts response.read_body"),a()}},faraday:{info:{key:"faraday",title:"faraday",link:"https://github.com/lostisland/faraday",description:"Faraday HTTP client",extname:".rb"},convert:({uriObj:e,queryObj:t,method:n,postData:r,allHeaders:s})=>{const{push:o,blank:i,join:a}=new he,l=n.toUpperCase();if(!["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"].includes(l))return o(`# Faraday cannot currently run ${l} requests. Please use another client.`),a();o("require 'faraday'"),i(),r.mimeType==="application/x-www-form-urlencoded"&&r.params&&(o("data = {"),r.params.forEach(f=>{o(` :${f.name} => ${JSON.stringify(f.value)},`)}),o("}"),i()),o("conn = Faraday.new("),o(` url: '${e.protocol}//${e.host}',`),(s["content-type"]||s["Content-Type"])&&o(` headers: {'Content-Type' => '${s["content-type"]||s["Content-Type"]}'}`),o(")"),i(),o(`response = conn.${l.toLowerCase()}('${e.pathname}') do |req|`);const u=Object.keys(s);switch(u.length&&u.forEach(f=>{f.toLowerCase()!=="content-type"&&o(` req.headers['${f}'] = '${Un(s[f])}'`)}),Object.keys(t).forEach(f=>{const d=t[f];Array.isArray(d)?o(` req.params['${f}'] = ${JSON.stringify(d)}`):o(` req.params['${f}'] = '${d}'`)}),r.mimeType){case"application/x-www-form-urlencoded":r.params&&o(" req.body = URI.encode_www_form(data)");break;case"application/json":r.jsonObj&&o(` req.body = ${JSON.stringify(r.text)}`);break;default:r.text&&o(` req.body = ${JSON.stringify(r.text)}`)}return o("end"),i(),o("puts response.status"),o("puts response.body"),a()}}}};function Uc(e,t,n,r,s){const o=r.repeat(s),i=r.repeat(s-1),a=n?`,
158
+ ${o}`:", ",l=e==="object"?"json!({":"(",u=e==="object"?"})":")";return n?`${l}
159
+ ${o}${t.join(a)}
160
+ ${i}${u}`:`${l}${t.join(a)}${u}`}const $n=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{if(e.length===0)return"json!([])";let r=!1;return Uc("array",e.map(s=>(Object.prototype.toString.call(s)==="[object Object]"&&(r=Object.keys(s).length>1),$n(s,t,n))),r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${$n(e[s],t,n)}`);return Uc("object",r,t.pretty&&r.length>1,t.indent,n)}case"[object Null]":return"json!(null)";case"[object Boolean]":return e?"true":"false";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},Wb={info:{key:"reqwest",title:"reqwest",link:"https://docs.rs/reqwest/latest/reqwest/",description:"reqwest HTTP library",extname:".rs"},convert:({queryObj:e,url:t,postData:n,allHeaders:r,method:s},o)=>{const i={indent:" ",pretty:!0,...o};let a=0;const{push:l,blank:u,join:f,pushToLast:d,unshift:p}=new he({indent:i.indent});l("use reqwest;",a),u(),l("#[tokio::main]",a),l("pub async fn main() {",a),a+=1,l(`let url = "${t}";`,a),u();let h=!1;if(Object.keys(e).length){h=!0,l("let querystring = [",a),a+=1;for(const[w,E]of Object.entries(e))if(Array.isArray(E))for(const C of E)l(`("${w}", "${decodeURIComponent(C)}"),`,a);else l(`("${w}", "${decodeURIComponent(String(E))}"),`,a);a-=1,l("];",a),u()}let m={};const g={};let v=!1,j=!1,y=!1,b=!1,S=!1;switch(n.mimeType){case"application/json":n.jsonObj&&l(`let payload = ${$n(n.jsonObj,i,a)};`,a),b=!0;break;case"multipart/form-data":if(S=!0,!n.params){l("let form = reqwest::multipart::Form::new()",a),l('.text("", "");',a+1);break}if(m={},n.params.forEach(w=>{w.fileName?(g[w.name]=w.fileName,v=!0):m[w.name]=w.value}),v){for(const w of Vb)l(w,a);u()}l("let form = reqwest::multipart::Form::new()",a);for(const[w,E]of Object.entries(g))l(`.part("${w}", file_to_part("${E}").await)`,a+1);for(const[w,E]of Object.entries(m))l(`.text("${w}", "${E}")`,a+1);d(";");break;default:if(n.mimeType==="application/x-www-form-urlencoded"&&n.paramsObj){l(`let payload = ${$n(n.paramsObj,i,a)};`,a),j=!0;break}if(n.text){l(`let payload = ${$n(n.text,i,a)};`,a),y=!0;break}}(j||b)&&p("use serde_json::json;"),(j||b||y||S)&&u();const k=Object.entries(r).filter(([w])=>!(w.toLowerCase()==="content-type"&&S));switch(l("let client = reqwest::Client::new();",a),s){case"POST":l("let response = client.post(url)",a);break;case"GET":l("let response = client.get(url)",a);break;default:l(`let response = client.request(reqwest::Method::from_str("${s}").unwrap(), url)`,a),p("use std::str::FromStr;");break}h&&l(".query(&querystring)",a+1),S&&l(".multipart(form)",a+1);for(const[w,E]of k)l(`.header("${w}", ${$n(E,i)})`,a+1);return b&&l(".json(&payload)",a+1),j&&l(".form(&payload)",a+1),y&&l(".body(payload)",a+1),l(".send()",a+1),l(".await;",a+1),u(),l("let results = response.unwrap()",a),l(".json::<serde_json::Value>()",a+1),l(".await",a+1),l(".unwrap();",a+1),u(),l('println!("{}", results);',a),l(`}
161
+ `),f()}},Vb=["async fn file_to_part(file_name: &'static str) -> reqwest::multipart::Part {"," let bytes = tokio::fs::read(file_name).await.unwrap();"," reqwest::multipart::Part::bytes(bytes)"," .file_name(file_name)",' .mime_str("text/plain").unwrap()',"}"],Kb={info:{key:"rust",title:"Rust",default:"reqwest",cli:"rust"},clientsById:{reqwest:Wb}},We=(e="")=>/^[a-z0-9-_/.@%^=:]+$/i.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`,Jb=e=>e.replace(/\r/g,"\\r").replace(/\n/g,"\\n"),Yb={"http1.0":"0","url ":"",cookie:"b",data:"d",form:"F",globoff:"g",header:"H",insecure:"k",request:"X"},Zb=e=>t=>{if(e){const n=Yb[t];return n?`-${n}`:""}return`--${t}`},Xb={info:{key:"shell",title:"Shell",default:"curl",cli:"%s"},clientsById:{curl:{info:{key:"curl",title:"cURL",link:"http://curl.haxx.se/",description:"cURL is a command line tool and library for transferring data with URL syntax",extname:".sh"},convert:({fullUrl:e,method:t,httpVersion:n,headersObj:r,allHeaders:s,postData:o},i={})=>{var j;const{binary:a=!1,globOff:l=!1,indent:u=" ",insecureSkipVerify:f=!1,short:d=!1}=i,p=" ",{push:h,join:m}=new he({...typeof u=="string"?{indent:u}:{},join:u!==!1?` \\
162
+ ${u}`:" "}),g=Zb(d);let v=We(e);if(h(`curl ${g("request")} ${t}`),l&&(v=unescape(v),h(g("globoff"))),h(`${g("url ")}${v}`),f&&h(g("insecure")),n==="HTTP/1.0"&&h(g("http1.0")),Rt(s,"accept-encoding")&&h("--compressed"),o.mimeType==="multipart/form-data"){const y=Ze(r,"content-type");if(y){const b=r[y];if(y&&b){const S=String(b).replace(/; boundary.+?(?=(;|$))/,"");r[y]=S,s[y]=S}}}switch(Object.keys(r).sort().forEach(y=>{const b=`${y}: ${r[y]}`;h(`${g("header")} ${We(b)}`)}),s.cookie&&h(`${g("cookie")} ${We(s.cookie)}`),o.mimeType){case"multipart/form-data":(j=o.params)==null||j.forEach(y=>{let b="";y.fileName?b=`${y.name}='@${y.fileName}'`:b=We(`${y.name}=${y.value}`),h(`${g("form")} ${b}`)});break;case"application/x-www-form-urlencoded":o.params?o.params.forEach(y=>{const b=encodeURIComponent(y.name),S=b!==y.name?b:y.name;h(`${a?"--data-binary":"--data-urlencode"} ${We(`${S}=${y.value}`)}`)}):h(`${a?"--data-binary":g("data")} ${We(o.text)}`);break;default:{if(!o.text)break;let y=!1;if(bb(o.mimeType)&&o.text.length>20)try{const b=JSON.parse(o.text);y=!0,o.text.indexOf("'")>0?h(`${a?"--data-binary":g("data")} @- <<EOF
163
+ ${JSON.stringify(b,null,p)}
164
+ EOF`):h(`${a?"--data-binary":g("data")} '
165
+ ${JSON.stringify(b,null,p)}
166
+ '`)}catch{}y||h(`${a?"--data-binary":g("data")} ${We(o.text)}`)}}return m()}},httpie:{info:{key:"httpie",title:"HTTPie",link:"http://httpie.org/",description:"a CLI, cURL-like tool for humans",extname:".sh",installation:()=>"brew install httpie"},convert:({allHeaders:e,postData:t,queryObj:n,fullUrl:r,method:s,url:o},i)=>{var m;const a={body:!1,cert:!1,headers:!1,indent:" ",pretty:!1,print:!1,queryParams:!1,short:!1,style:!1,timeout:!1,verbose:!1,verify:!1,...i},{push:l,join:u,unshift:f}=new he({indent:a.indent,join:a.indent!==!1?` \\
167
+ ${a.indent}`:" "});let d=!1;const p=[];a.headers&&p.push(a.short?"-h":"--headers"),a.body&&p.push(a.short?"-b":"--body"),a.verbose&&p.push(a.short?"-v":"--verbose"),a.print&&p.push(`${a.short?"-p":"--print"}=${a.print}`),a.verify&&p.push(`--verify=${a.verify}`),a.cert&&p.push(`--cert=${a.cert}`),a.pretty&&p.push(`--pretty=${a.pretty}`),a.style&&p.push(`--style=${a.style}`),a.timeout&&p.push(`--timeout=${a.timeout}`),a.queryParams&&Object.keys(n).forEach(g=>{const v=n[g];Array.isArray(v)?v.forEach(j=>{l(`${g}==${We(j)}`)}):l(`${g}==${We(v)}`)}),Object.keys(e).sort().forEach(g=>{l(`${g}:${We(e[g])}`)}),t.mimeType==="application/x-www-form-urlencoded"?(m=t.params)!=null&&m.length&&(p.push(a.short?"-f":"--form"),t.params.forEach(g=>{l(`${g.name}=${We(g.value)}`)})):d=!0;const h=p.length?`${p.join(" ")} `:"";return o=We(a.queryParams?o:r),f(`http ${h}${s} ${o}`),d&&t.text&&f(`echo ${We(t.text)} | `),u()}},wget:{info:{key:"wget",title:"Wget",link:"https://www.gnu.org/software/wget/",description:"a free software package for retrieving files using HTTP, HTTPS",extname:".sh"},convert:({method:e,postData:t,allHeaders:n,fullUrl:r},s)=>{const o={indent:" ",short:!1,verbose:!1,...s},{push:i,join:a}=new he({...typeof o.indent=="string"?{indent:o.indent}:{},join:o.indent!==!1?` \\
168
+ ${o.indent}`:" "});return o.verbose?i(`wget ${o.short?"-v":"--verbose"}`):i(`wget ${o.short?"-q":"--quiet"}`),i(`--method ${We(e)}`),Object.keys(n).forEach(l=>{const u=`${l}: ${n[l]}`;i(`--header ${We(u)}`)}),t.text&&i(`--body-data ${Jb(We(t.text))}`),i(o.short?"-O":"--output-document"),i(`- ${We(r)}`),a()}}}},Hc=(e,t)=>t.repeat(e),qc=(e,t,n,r)=>{const s=Hc(r,n),o=Hc(r-1,n),i=t?`,
169
+ ${s}`:", ";return t?`[
170
+ ${s}${e.join(i)}
171
+ ${o}]`:`[${e.join(i)}]`},zc=(e,t,n)=>`let ${e} = ${Bs(t,n)}`,Bs=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let r=!1;const s=e.map(o=>(Object.prototype.toString.call(o)==="[object Object]"&&(r=Object.keys(o).length>1),Bs(o,t,n)));return qc(s,r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${Bs(e[s],t,n)}`);return qc(r,t.pretty&&r.length>1,t.indent,n)}case"[object Boolean]":return e.toString();default:return e==null?"nil":`"${e.toString().replace(/"/g,'\\"')}"`}},Mn={agent:vb,c:wb,clojure:jb,crystal:Eb,csharp:Ob,go:Nb,http:Cb,java:_b,javascript:Rb,json:Ib,kotlin:Pb,node:$b,objc:Mb,ocaml:Lb,php:Db,powershell:Fb,python:Hb,r:qb,ruby:zb,rust:Kb,shell:Xb,swift:{info:{key:"swift",title:"Swift",default:"urlsession"},clientsById:{urlsession:{info:{key:"urlsession",title:"URLSession",link:"https://developer.apple.com/documentation/foundation/urlsession",description:"Foundation's URLSession request",extname:".swift"},convert:({allHeaders:e,postData:t,uriObj:n,queryObj:r,method:s},o)=>{var p;const i={indent:" ",pretty:!0,timeout:10,...o},{push:a,blank:l,join:u}=new he({indent:i.indent});a("import Foundation"),l();const f=t.text||t.jsonObj||t.params;if(f)switch(t.mimeType){case"application/x-www-form-urlencoded":if((p=t.params)!=null&&p.length){const h=t.params.map(m=>`"${m.name}": "${m.value}"`);i.pretty?(a("let parameters = ["),h.forEach(m=>{a(`${m},`,1)}),a("]")):a(`let parameters = [${h.join(", ")}]`),a('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'),a("let postData = Data(joinedParameters.utf8)"),l()}break;case"application/json":t.jsonObj&&(a(`${zc("parameters",t.jsonObj,i)} as [String : Any?]`),l(),a("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"),l());break;case"multipart/form-data":a(zc("parameters",t.params,i)),l(),a(`let boundary = "${t.boundary}"`),l(),a('var body = ""'),a("for param in parameters {"),a('let paramName = param["name"]!',1),a('body += "--\\(boundary)\\r\\n"',1),a('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""',1),a('if let filename = param["fileName"] {',1),a('let contentType = param["contentType"]!',2),a("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)",2),a('body += "; filename=\\"\\(filename)\\"\\r\\n"',2),a('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"',2),a("body += fileContent",2),a('} else if let paramValue = param["value"] {',1),a('body += "\\r\\n\\r\\n\\(paramValue)"',2),a("}",1),a("}"),l(),a("let postData = Data(body.utf8)"),l();break;default:a(`let postData = Data("${t.text}".utf8)`),l()}a(`let url = URL(string: "${n.href}")!`);const d=r?Object.entries(r):[];return d.length<1?a("var request = URLRequest(url: url)"):(a("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"),a("let queryItems: [URLQueryItem] = ["),d.forEach(h=>{const m=h[0],g=h[1];switch(Object.prototype.toString.call(g)){case"[object String]":a(`URLQueryItem(name: "${m}", value: "${g}"),`,1);break;case"[object Array]":g.forEach(v=>{a(`URLQueryItem(name: "${m}", value: "${v}"),`,1)});break}}),a("]"),a("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"),l(),a("var request = URLRequest(url: components.url!)")),a(`request.httpMethod = "${s}"`),a(`request.timeoutInterval = ${i.timeout}`),Object.keys(e).length&&a(`request.allHTTPHeaderFields = ${Bs(e,i)}`),f&&a("request.httpBody = postData"),l(),a("let (data, _) = try await URLSession.shared.data(for: request)"),a("print(String(decoding: data, as: UTF8.self))"),u()}}}}},Wc=(e,t)=>{const n=e[t.name];return n===void 0?(e[t.name]=t.value,e):Array.isArray(n)?(n.push(t.value),e):(e[t.name]=[n,t.value],e)};var Fs={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Qb=Fs.exports;(function(e,t){(function(n){var r=t&&!t.nodeType&&t,s=e&&!e.nodeType&&e,o=typeof wr=="object"&&wr;(o.global===o||o.window===o||o.self===o)&&(n=o);var i,a=2147483647,l=36,u=1,f=26,d=38,p=700,h=72,m=128,g="-",v=/^xn--/,j=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=l-u,k=Math.floor,w=String.fromCharCode,E;function C($){throw new RangeError(b[$])}function O($,B){for(var D=$.length,L=[];D--;)L[D]=B($[D]);return L}function A($,B){var D=$.split("@"),L="";D.length>1&&(L=D[0]+"@",$=D[1]),$=$.replace(y,".");var re=$.split("."),te=O(re,B).join(".");return L+te}function P($){for(var B=[],D=0,L=$.length,re,te;D<L;)re=$.charCodeAt(D++),re>=55296&&re<=56319&&D<L?(te=$.charCodeAt(D++),(te&64512)==56320?B.push(((re&1023)<<10)+(te&1023)+65536):(B.push(re),D--)):B.push(re);return B}function R($){return O($,function(B){var D="";return B>65535&&(B-=65536,D+=w(B>>>10&1023|55296),B=56320|B&1023),D+=w(B),D}).join("")}function U($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:l}function J($,B){return $+22+75*($<26)-((B!=0)<<5)}function Z($,B,D){var L=0;for($=D?k($/p):$>>1,$+=k($/B);$>S*f>>1;L+=l)$=k($/S);return k(L+(S+1)*$/($+d))}function _($){var B=[],D=$.length,L,re=0,te=m,me=h,I,Q,ae,se,ue,fe,pe,Ne,Se;for(I=$.lastIndexOf(g),I<0&&(I=0),Q=0;Q<I;++Q)$.charCodeAt(Q)>=128&&C("not-basic"),B.push($.charCodeAt(Q));for(ae=I>0?I+1:0;ae<D;){for(se=re,ue=1,fe=l;ae>=D&&C("invalid-input"),pe=U($.charCodeAt(ae++)),(pe>=l||pe>k((a-re)/ue))&&C("overflow"),re+=pe*ue,Ne=fe<=me?u:fe>=me+f?f:fe-me,!(pe<Ne);fe+=l)Se=l-Ne,ue>k(a/Se)&&C("overflow"),ue*=Se;L=B.length+1,me=Z(re-se,L,se==0),k(re/L)>a-te&&C("overflow"),te+=k(re/L),re%=L,B.splice(re++,0,te)}return R(B)}function M($){var B,D,L,re,te,me,I,Q,ae,se,ue,fe=[],pe,Ne,Se,Xe;for($=P($),pe=$.length,B=m,D=0,te=h,me=0;me<pe;++me)ue=$[me],ue<128&&fe.push(w(ue));for(L=re=fe.length,re&&fe.push(g);L<pe;){for(I=a,me=0;me<pe;++me)ue=$[me],ue>=B&&ue<I&&(I=ue);for(Ne=L+1,I-B>k((a-D)/Ne)&&C("overflow"),D+=(I-B)*Ne,B=I,me=0;me<pe;++me)if(ue=$[me],ue<B&&++D>a&&C("overflow"),ue==B){for(Q=D,ae=l;se=ae<=te?u:ae>=te+f?f:ae-te,!(Q<se);ae+=l)Xe=Q-se,Se=l-se,fe.push(w(J(se+Xe%Se,0))),Q=k(Xe/Se);fe.push(w(J(Q,0))),te=Z(D,Ne,L==re),D=0,++L}++D,++B}return fe.join("")}function K($){return A($,function(B){return v.test(B)?_(B.slice(4).toLowerCase()):B})}function Y($){return A($,function(B){return j.test(B)?"xn--"+M(B):B})}if(i={version:"1.4.1",ucs2:{decode:P,encode:R},decode:_,encode:M,toASCII:Y,toUnicode:K},r&&s)if(e.exports==r)s.exports=i;else for(E in i)i.hasOwnProperty(E)&&(r[E]=i[E]);else n.punycode=i})(Qb)})(Fs,Fs.exports);var Gb=Fs.exports,Kn=TypeError;const e1={},t1=Object.freeze(Object.defineProperty({__proto__:null,default:e1},Symbol.toStringTag,{value:"Module"})),Nd=ig(t1);var Ba=typeof Map=="function"&&Map.prototype,Wo=Object.getOwnPropertyDescriptor&&Ba?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Us=Ba&&Wo&&typeof Wo.get=="function"?Wo.get:null,Vc=Ba&&Map.prototype.forEach,Fa=typeof Set=="function"&&Set.prototype,Vo=Object.getOwnPropertyDescriptor&&Fa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hs=Fa&&Vo&&typeof Vo.get=="function"?Vo.get:null,Kc=Fa&&Set.prototype.forEach,n1=typeof WeakMap=="function"&&WeakMap.prototype,pr=n1?WeakMap.prototype.has:null,r1=typeof WeakSet=="function"&&WeakSet.prototype,hr=r1?WeakSet.prototype.has:null,s1=typeof WeakRef=="function"&&WeakRef.prototype,Jc=s1?WeakRef.prototype.deref:null,o1=Boolean.prototype.valueOf,i1=Object.prototype.toString,a1=Function.prototype.toString,l1=String.prototype.match,Ua=String.prototype.slice,Zt=String.prototype.replace,c1=String.prototype.toUpperCase,Yc=String.prototype.toLowerCase,Cd=RegExp.prototype.test,Zc=Array.prototype.concat,Nt=Array.prototype.join,u1=Array.prototype.slice,Xc=Math.floor,Fi=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ko=Object.getOwnPropertySymbols,Ui=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",mr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Hn||!0)?Symbol.toStringTag:null,_d=Object.prototype.propertyIsEnumerable,Qc=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Gc(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Cd.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Xc(-e):Xc(e);if(r!==e){var s=String(r),o=Ua.call(t,s.length+1);return Zt.call(s,n,"$&_")+"."+Zt.call(Zt.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zt.call(t,n,"$&_")}var Hi=Nd,eu=Hi.custom,tu=Pd(eu)?eu:null,Rd={__proto__:null,double:'"',single:"'"},f1={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ro=function e(t,n,r,s){var o=n||{};if(Mt(o,"quoteStyle")&&!Mt(Rd,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Mt(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=Mt(o,"customInspect")?o.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Mt(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Mt(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Md(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?Gc(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return a?Gc(t,u):u}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof t=="object")return qi(t)?"[Array]":"[Object]";var d=N1(o,r);if(typeof s>"u")s=[];else if($d(s,t)>=0)return"[Circular]";function p(U,J,Z){if(J&&(s=u1.call(s),s.push(J)),Z){var _={depth:o.depth};return Mt(o,"quoteStyle")&&(_.quoteStyle=o.quoteStyle),e(U,_,r+1,s)}return e(U,o,r+1,s)}if(typeof t=="function"&&!nu(t)){var h=v1(t),m=cs(t,p);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+Nt.call(m,", ")+" }":"")}if(Pd(t)){var g=Hn?Zt.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ui.call(t);return typeof t=="object"&&!Hn?lr(g):g}if(T1(t)){for(var v="<"+Yc.call(String(t.nodeName)),j=t.attributes||[],y=0;y<j.length;y++)v+=" "+j[y].name+"="+Id(d1(j[y].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+Yc.call(String(t.nodeName))+">",v}if(qi(t)){if(t.length===0)return"[]";var b=cs(t,p);return d&&!O1(b)?"["+zi(b,d)+"]":"[ "+Nt.call(b,", ")+" ]"}if(h1(t)){var S=cs(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!_d.call(t,"cause")?"{ ["+String(t)+"] "+Nt.call(Zc.call("[cause]: "+p(t.cause),S),", ")+" }":S.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Nt.call(S,", ")+" }"}if(typeof t=="object"&&i){if(tu&&typeof t[tu]=="function"&&Hi)return Hi(t,{depth:f-r});if(i!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(w1(t)){var k=[];return Vc&&Vc.call(t,function(U,J){k.push(p(J,t,!0)+" => "+p(U,t))}),ru("Map",Us.call(t),k,d)}if(E1(t)){var w=[];return Kc&&Kc.call(t,function(U){w.push(p(U,t))}),ru("Set",Hs.call(t),w,d)}if(S1(t))return Jo("WeakMap");if(k1(t))return Jo("WeakSet");if(j1(t))return Jo("WeakRef");if(g1(t))return lr(p(Number(t)));if(x1(t))return lr(p(Fi.call(t)));if(y1(t))return lr(o1.call(t));if(m1(t))return lr(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof wr<"u"&&t===wr)return"{ [object globalThis] }";if(!p1(t)&&!nu(t)){var E=cs(t,p),C=Qc?Qc(t)===Object.prototype:t instanceof Object||t.constructor===Object,O=t instanceof Object?"":"null prototype",A=!C&&mr&&Object(t)===t&&mr in t?Ua.call(nn(t),8,-1):O?"Object":"",P=C||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",R=P+(A||O?"["+Nt.call(Zc.call([],A||[],O||[]),": ")+"] ":"");return E.length===0?R+"{}":d?R+"{"+zi(E,d)+"}":R+"{ "+Nt.call(E,", ")+" }"}return String(t)};function Id(e,t,n){var r=n.quoteStyle||t,s=Rd[r];return s+e+s}function d1(e){return Zt.call(String(e),/"/g,"&quot;")}function vn(e){return!mr||!(typeof e=="object"&&(mr in e||typeof e[mr]<"u"))}function qi(e){return nn(e)==="[object Array]"&&vn(e)}function p1(e){return nn(e)==="[object Date]"&&vn(e)}function nu(e){return nn(e)==="[object RegExp]"&&vn(e)}function h1(e){return nn(e)==="[object Error]"&&vn(e)}function m1(e){return nn(e)==="[object String]"&&vn(e)}function g1(e){return nn(e)==="[object Number]"&&vn(e)}function y1(e){return nn(e)==="[object Boolean]"&&vn(e)}function Pd(e){if(Hn)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Ui)return!1;try{return Ui.call(e),!0}catch{}return!1}function x1(e){if(!e||typeof e!="object"||!Fi)return!1;try{return Fi.call(e),!0}catch{}return!1}var b1=Object.prototype.hasOwnProperty||function(e){return e in this};function Mt(e,t){return b1.call(e,t)}function nn(e){return i1.call(e)}function v1(e){if(e.name)return e.name;var t=l1.call(a1.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function $d(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function w1(e){if(!Us||!e||typeof e!="object")return!1;try{Us.call(e);try{Hs.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function S1(e){if(!pr||!e||typeof e!="object")return!1;try{pr.call(e,pr);try{hr.call(e,hr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function j1(e){if(!Jc||!e||typeof e!="object")return!1;try{return Jc.call(e),!0}catch{}return!1}function E1(e){if(!Hs||!e||typeof e!="object")return!1;try{Hs.call(e);try{Us.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function k1(e){if(!hr||!e||typeof e!="object")return!1;try{hr.call(e,hr);try{pr.call(e,pr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function T1(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Md(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Md(Ua.call(e,0,t.maxStringLength),t)+r}var s=f1[t.quoteStyle||"single"];s.lastIndex=0;var o=Zt.call(Zt.call(e,s,"\\$1"),/[\x00-\x1f]/g,A1);return Id(o,"single",t)}function A1(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+c1.call(t.toString(16))}function lr(e){return"Object("+e+")"}function Jo(e){return e+" { ? }"}function ru(e,t,n,r){var s=r?zi(n,r):Nt.call(n,", ");return e+" ("+t+") {"+s+"}"}function O1(e){for(var t=0;t<e.length;t++)if($d(e[t],`
172
+ `)>=0)return!1;return!0}function N1(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Nt.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Nt.call(Array(t+1),n)}}function zi(e,t){if(e.length===0)return"";var n=`
173
+ `+t.prev+t.base;return n+Nt.call(e,","+n)+`
174
+ `+t.prev}function cs(e,t){var n=qi(e),r=[];if(n){r.length=e.length;for(var s=0;s<e.length;s++)r[s]=Mt(e,s)?t(e[s],e):""}var o=typeof Ko=="function"?Ko(e):[],i;if(Hn){i={};for(var a=0;a<o.length;a++)i["$"+o[a]]=o[a]}for(var l in e)Mt(e,l)&&(n&&String(Number(l))===l&&l<e.length||Hn&&i["$"+l]instanceof Symbol||(Cd.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if(typeof Ko=="function")for(var u=0;u<o.length;u++)_d.call(e,o[u])&&r.push("["+t(o[u])+"]: "+t(e[o[u]],e));return r}var C1=ro,_1=Kn,so=function(e,t,n){for(var r=e,s;(s=r.next)!=null;r=s)if(s.key===t)return r.next=s.next,n||(s.next=e.next,e.next=s),s},R1=function(e,t){if(e){var n=so(e,t);return n&&n.value}},I1=function(e,t,n){var r=so(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},P1=function(e,t){return e?!!so(e,t):!1},$1=function(e,t){if(e)return so(e,t,!0)},M1=function(){var t,n={assert:function(r){if(!n.has(r))throw new _1("Side channel does not contain "+C1(r))},delete:function(r){var s=$1(t,r);return s&&t&&!t.next&&(t=void 0),!!s},get:function(r){return R1(t,r)},has:function(r){return P1(t,r)},set:function(r,s){t||(t={next:void 0}),I1(t,r,s)}};return n},Ld=Object,L1=Error,D1=EvalError,B1=RangeError,F1=ReferenceError,U1=SyntaxError,H1=URIError,q1=Math.abs,z1=Math.floor,W1=Math.max,V1=Math.min,K1=Math.pow,J1=Math.round,Y1=Number.isNaN||function(t){return t!==t},Z1=Y1,X1=function(t){return Z1(t)||t===0?t:t<0?-1:1},Q1=Object.getOwnPropertyDescriptor,vs=Q1;if(vs)try{vs([],"length")}catch{vs=null}var Dd=vs,ws=Object.defineProperty||!1;if(ws)try{ws({},"a",{value:1})}catch{ws=!1}var Bd=ws,Yo,su;function G1(){return su||(su=1,Yo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var s=42;t[n]=s;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==s||a.enumerable!==!0)return!1}return!0}),Yo}var Zo,ou;function ev(){if(ou)return Zo;ou=1;var e=typeof Symbol<"u"&&Symbol,t=G1();return Zo=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Zo}var Xo,iu;function Fd(){return iu||(iu=1,Xo=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xo}var Qo,au;function Ud(){if(au)return Qo;au=1;var e=Ld;return Qo=e.getPrototypeOf||null,Qo}var Go,lu;function tv(){if(lu)return Go;lu=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",s=function(l,u){for(var f=[],d=0;d<l.length;d+=1)f[d]=l[d];for(var p=0;p<u.length;p+=1)f[p+l.length]=u[p];return f},o=function(l,u){for(var f=[],d=u,p=0;d<l.length;d+=1,p+=1)f[p]=l[d];return f},i=function(a,l){for(var u="",f=0;f<a.length;f+=1)u+=a[f],f+1<a.length&&(u+=l);return u};return Go=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var f=o(arguments,1),d,p=function(){if(this instanceof d){var j=u.apply(this,s(f,arguments));return Object(j)===j?j:this}return u.apply(l,s(f,arguments))},h=n(0,u.length-f.length),m=[],g=0;g<h;g++)m[g]="$"+g;if(d=Function("binder","return function ("+i(m,",")+"){ return binder.apply(this,arguments); }")(p),u.prototype){var v=function(){};v.prototype=u.prototype,d.prototype=new v,v.prototype=null}return d},Go}var ei,cu;function oo(){if(cu)return ei;cu=1;var e=tv();return ei=Function.prototype.bind||e,ei}var ti,uu;function Ha(){return uu||(uu=1,ti=Function.prototype.call),ti}var ni,fu;function Hd(){return fu||(fu=1,ni=Function.prototype.apply),ni}var nv=typeof Reflect<"u"&&Reflect&&Reflect.apply,rv=oo(),sv=Hd(),ov=Ha(),iv=nv,av=iv||rv.call(ov,sv),lv=oo(),cv=Kn,uv=Ha(),fv=av,qd=function(t){if(t.length<1||typeof t[0]!="function")throw new cv("a function is required");return fv(lv,uv,t)},ri,du;function dv(){if(du)return ri;du=1;var e=qd,t=Dd,n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var r=!!n&&t&&t(Object.prototype,"__proto__"),s=Object,o=s.getPrototypeOf;return ri=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(a){return o(a==null?a:s(a))}:!1,ri}var si,pu;function pv(){if(pu)return si;pu=1;var e=Fd(),t=Ud(),n=dv();return si=e?function(s){return e(s)}:t?function(s){if(!s||typeof s!="object"&&typeof s!="function")throw new TypeError("getProto: not an object");return t(s)}:n?function(s){return n(s)}:null,si}var oi,hu;function hv(){if(hu)return oi;hu=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=oo();return oi=n.call(e,t),oi}var ge,mv=Ld,gv=L1,yv=D1,xv=B1,bv=F1,qn=U1,Dn=Kn,vv=H1,wv=q1,Sv=z1,jv=W1,Ev=V1,kv=K1,Tv=J1,Av=X1,zd=Function,ii=function(e){try{return zd('"use strict"; return ('+e+").constructor;")()}catch{}},kr=Dd,Ov=Bd,ai=function(){throw new Dn},Nv=kr?(function(){try{return arguments.callee,ai}catch{try{return kr(arguments,"callee").get}catch{return ai}}})():ai,On=ev()(),qe=pv(),Cv=Ud(),_v=Fd(),Wd=Hd(),Lr=Ha(),In={},Rv=typeof Uint8Array>"u"||!qe?ge:qe(Uint8Array),hn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ge:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ge:ArrayBuffer,"%ArrayIteratorPrototype%":On&&qe?qe([][Symbol.iterator]()):ge,"%AsyncFromSyncIteratorPrototype%":ge,"%AsyncFunction%":In,"%AsyncGenerator%":In,"%AsyncGeneratorFunction%":In,"%AsyncIteratorPrototype%":In,"%Atomics%":typeof Atomics>"u"?ge:Atomics,"%BigInt%":typeof BigInt>"u"?ge:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ge:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ge:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ge:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gv,"%eval%":eval,"%EvalError%":yv,"%Float16Array%":typeof Float16Array>"u"?ge:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ge:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ge:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ge:FinalizationRegistry,"%Function%":zd,"%GeneratorFunction%":In,"%Int8Array%":typeof Int8Array>"u"?ge:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ge:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ge:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":On&&qe?qe(qe([][Symbol.iterator]())):ge,"%JSON%":typeof JSON=="object"?JSON:ge,"%Map%":typeof Map>"u"?ge:Map,"%MapIteratorPrototype%":typeof Map>"u"||!On||!qe?ge:qe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":mv,"%Object.getOwnPropertyDescriptor%":kr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ge:Promise,"%Proxy%":typeof Proxy>"u"?ge:Proxy,"%RangeError%":xv,"%ReferenceError%":bv,"%Reflect%":typeof Reflect>"u"?ge:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ge:Set,"%SetIteratorPrototype%":typeof Set>"u"||!On||!qe?ge:qe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ge:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":On&&qe?qe(""[Symbol.iterator]()):ge,"%Symbol%":On?Symbol:ge,"%SyntaxError%":qn,"%ThrowTypeError%":Nv,"%TypedArray%":Rv,"%TypeError%":Dn,"%Uint8Array%":typeof Uint8Array>"u"?ge:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ge:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ge:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ge:Uint32Array,"%URIError%":vv,"%WeakMap%":typeof WeakMap>"u"?ge:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ge:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ge:WeakSet,"%Function.prototype.call%":Lr,"%Function.prototype.apply%":Wd,"%Object.defineProperty%":Ov,"%Object.getPrototypeOf%":Cv,"%Math.abs%":wv,"%Math.floor%":Sv,"%Math.max%":jv,"%Math.min%":Ev,"%Math.pow%":kv,"%Math.round%":Tv,"%Math.sign%":Av,"%Reflect.getPrototypeOf%":_v};if(qe)try{null.error}catch(e){var Iv=qe(qe(e));hn["%Error.prototype%"]=Iv}var Pv=function e(t){var n;if(t==="%AsyncFunction%")n=ii("async function () {}");else if(t==="%GeneratorFunction%")n=ii("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ii("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&qe&&(n=qe(s.prototype))}return hn[t]=n,n},mu={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Dr=oo(),qs=hv(),$v=Dr.call(Lr,Array.prototype.concat),Mv=Dr.call(Wd,Array.prototype.splice),gu=Dr.call(Lr,String.prototype.replace),zs=Dr.call(Lr,String.prototype.slice),Lv=Dr.call(Lr,RegExp.prototype.exec),Dv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bv=/\\(\\)?/g,Fv=function(t){var n=zs(t,0,1),r=zs(t,-1);if(n==="%"&&r!=="%")throw new qn("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new qn("invalid intrinsic syntax, expected opening `%`");var s=[];return gu(t,Dv,function(o,i,a,l){s[s.length]=a?gu(l,Bv,"$1"):i||o}),s},Uv=function(t,n){var r=t,s;if(qs(mu,r)&&(s=mu[r],r="%"+s[0]+"%"),qs(hn,r)){var o=hn[r];if(o===In&&(o=Pv(r)),typeof o>"u"&&!n)throw new Dn("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:o}}throw new qn("intrinsic "+t+" does not exist!")},qa=function(t,n){if(typeof t!="string"||t.length===0)throw new Dn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Dn('"allowMissing" argument must be a boolean');if(Lv(/^%?[^%]*%?$/,t)===null)throw new qn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Fv(t),s=r.length>0?r[0]:"",o=Uv("%"+s+"%",n),i=o.name,a=o.value,l=!1,u=o.alias;u&&(s=u[0],Mv(r,$v([0,1],u)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],h=zs(p,0,1),m=zs(p,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new qn("property names with quotes must have matching quotes");if((p==="constructor"||!d)&&(l=!0),s+="."+p,i="%"+s+"%",qs(hn,i))a=hn[i];else if(a!=null){if(!(p in a)){if(!n)throw new Dn("base intrinsic for "+t+" exists, but the property is not available.");return}if(kr&&f+1>=r.length){var g=kr(a,p);d=!!g,d&&"get"in g&&!("originalValue"in g.get)?a=g.get:a=a[p]}else d=qs(a,p),a=a[p];d&&!l&&(hn[i]=a)}}return a},Vd=qa,Kd=qd,Hv=Kd([Vd("%String.prototype.indexOf%")]),Jd=function(t,n){var r=Vd(t,!!n);return typeof r=="function"&&Hv(t,".prototype.")>-1?Kd([r]):r},qv=qa,Br=Jd,zv=ro,Wv=Kn,yu=qv("%Map%",!0),Vv=Br("Map.prototype.get",!0),Kv=Br("Map.prototype.set",!0),Jv=Br("Map.prototype.has",!0),Yv=Br("Map.prototype.delete",!0),Zv=Br("Map.prototype.size",!0),Yd=!!yu&&function(){var t,n={assert:function(r){if(!n.has(r))throw new Wv("Side channel does not contain "+zv(r))},delete:function(r){if(t){var s=Yv(t,r);return Zv(t)===0&&(t=void 0),s}return!1},get:function(r){if(t)return Vv(t,r)},has:function(r){return t?Jv(t,r):!1},set:function(r,s){t||(t=new yu),Kv(t,r,s)}};return n},Xv=qa,io=Jd,Qv=ro,us=Yd,Gv=Kn,Nn=Xv("%WeakMap%",!0),ew=io("WeakMap.prototype.get",!0),tw=io("WeakMap.prototype.set",!0),nw=io("WeakMap.prototype.has",!0),rw=io("WeakMap.prototype.delete",!0),sw=Nn?function(){var t,n,r={assert:function(s){if(!r.has(s))throw new Gv("Side channel does not contain "+Qv(s))},delete:function(s){if(Nn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return rw(t,s)}else if(us&&n)return n.delete(s);return!1},get:function(s){return Nn&&s&&(typeof s=="object"||typeof s=="function")&&t?ew(t,s):n&&n.get(s)},has:function(s){return Nn&&s&&(typeof s=="object"||typeof s=="function")&&t?nw(t,s):!!n&&n.has(s)},set:function(s,o){Nn&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Nn),tw(t,s,o)):us&&(n||(n=us()),n.set(s,o))}};return r}:us,ow=Kn,iw=ro,aw=M1,lw=Yd,cw=sw,uw=cw||lw||aw,Zd=function(){var t,n={assert:function(r){if(!n.has(r)){var s=r&&Object(r)===r?"the given object key":iw(r);throw new ow("Side channel does not contain "+s)}},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,s){t||(t=uw()),t.set(r,s)}};return n},fw=String.prototype.replace,dw=/%20/g,li={RFC1738:"RFC1738",RFC3986:"RFC3986"},za={default:li.RFC3986,formatters:{RFC1738:function(e){return fw.call(e,dw,"+")},RFC3986:function(e){return String(e)}},RFC1738:li.RFC1738,RFC3986:li.RFC3986},pw=za,Xd=Zd,xu=Bd,ci=Object.prototype.hasOwnProperty,un=Array.isArray,ao=Xd(),fn=function(t,n){return ao.set(t,n),t},dn=function(t){return ao.has(t)},ur=function(t){return ao.get(t)},Wi=function(t,n){ao.set(t,n)},kt=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),hw=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(un(r)){for(var s=[],o=0;o<r.length;++o)typeof r[o]<"u"&&(s[s.length]=r[o]);n.obj[n.prop]=s}}},Ln=function(t,n){for(var r=n&&n.plainObjects?{__proto__:null}:{},s=0;s<t.length;++s)typeof t[s]<"u"&&(r[s]=t[s]);return r},Vi=function(t,n,r){n==="__proto__"&&xu?xu(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r},mw=function e(t,n,r){if(!n)return t;if(typeof n!="object"&&typeof n!="function"){if(un(t)){var s=t.length;if(r&&typeof r.arrayLimit=="number"&&s>=r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(t.concat(n),r),s)}t[s]=n}else if(t&&typeof t=="object")if(dn(t)){var o=ur(t)+1;t[o]=n,Wi(t,o)}else{if(r&&r.strictMerge)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!ci.call(Object.prototype,n))&&(t[n]=!0)}else return[t,n];return t}if(!t||typeof t!="object"){if(dn(n)){for(var i=Object.keys(n),a=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},l=0;l<i.length;l++){var u=parseInt(i[l],10);a[u+1]=n[i[l]]}return fn(a,ur(n)+1)}var f=[t].concat(n);if(r&&typeof r.arrayLimit=="number"&&f.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(f,r),f.length-1)}return f}var d=t;if(un(t)&&!un(n)&&(d=Ln(t,r)),un(t)&&un(n)){if(n.forEach(function(p,h){if(ci.call(t,h)){var m=t[h];m&&typeof m=="object"&&p&&typeof p=="object"?t[h]=e(m,p,r):t[t.length]=p}else t[h]=p}),r&&typeof r.arrayLimit=="number"&&t.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(t,r),t.length-1)}return t}return Object.keys(n).reduce(function(p,h){var m=n[h];if(ci.call(p,h)?Vi(p,h,e(p[h],m,r)):Vi(p,h,m),dn(n)&&!dn(p)&&fn(p,ur(n)),dn(p)){var g=parseInt(h,10);String(g)===h&&g>=0&&g>ur(p)&&Wi(p,g)}return p},d)},gw=function(t,n){return Object.keys(n).reduce(function(r,s){return Vi(r,s,n[s]),r},t)},yw=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},fs=1024,xw=function(t,n,r,s,o){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(m){return"%26%23"+parseInt(m.slice(2),16)+"%3B"});for(var a="",l=0;l<i.length;l+=fs){var u=i.length>=fs?i.slice(l,l+fs):i;if(l+fs<i.length){var f=u.charCodeAt(u.length-1);f>=55296&&f<=56319&&(u=u.slice(0,-1),l-=1)}for(var d=[],p=0;p<u.length;++p){var h=u.charCodeAt(p);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===pw.RFC1738&&(h===40||h===41)){d[d.length]=u.charAt(p);continue}if(h<128){d[d.length]=kt[h];continue}if(h<2048){d[d.length]=kt[192|h>>6]+kt[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=kt[224|h>>12]+kt[128|h>>6&63]+kt[128|h&63];continue}p+=1,h=65536+((h&1023)<<10|u.charCodeAt(p)&1023),d[d.length]=kt[240|h>>18]+kt[128|h>>12&63]+kt[128|h>>6&63]+kt[128|h&63]}a+=d.join("")}return a},bw=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=Xd(),s=0;s<n.length;++s)for(var o=n[s],i=o.obj[o.prop],a=Object.keys(i),l=0;l<a.length;++l){var u=a[l],f=i[u];typeof f=="object"&&f!==null&&!r.has(f)&&(n[n.length]={obj:i,prop:u},r.set(f,!0))}return hw(n),t},vw=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},ww=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Sw=function(t,n,r,s,o){if(dn(t)){if(o)throw new RangeError("Array limit exceeded. Only "+r+" element"+(r===1?"":"s")+" allowed in an array.");var i=ur(t)+1;return t[i]=n,Wi(t,i),t}var a=[].concat(t,n);if(a.length>r){if(o)throw new RangeError("Array limit exceeded. Only "+r+" element"+(r===1?"":"s")+" allowed in an array.");return fn(Ln(a,{plainObjects:s}),a.length-1)}return a},jw=function(t,n){if(un(t)){for(var r=[],s=0;s<t.length;s+=1)r[r.length]=n(t[s]);return r}return n(t)},Qd={arrayToObject:Ln,assign:gw,combine:Sw,compact:bw,decode:yw,encode:xw,isBuffer:ww,isOverflow:dn,isRegExp:vw,markOverflow:fn,maybeMap:jw,merge:mw},Gd=Zd,Ss=Qd,gr=za,Ew=Object.prototype.hasOwnProperty,ep={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},At=Array.isArray,kw=Array.prototype.push,tp=function(e,t){kw.apply(e,At(t)?t:[t])},Tw=Date.prototype.toISOString,bu=gr.default,Fe={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ss.encode,encodeValuesOnly:!1,filter:void 0,format:bu,formatter:gr.formatters[bu],indices:!1,serializeDate:function(t){return Tw.call(t)},skipNulls:!1,strictNullHandling:!1},Aw=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},ui={},Ow=function e(t,n,r,s,o,i,a,l,u,f,d,p,h,m,g,v,j,y){for(var b=t,S=y,k=0,w=!1;(S=S.get(ui))!==void 0&&!w;){var E=S.get(t);if(k+=1,typeof E<"u"){if(E===k)throw new RangeError("Cyclic object value");w=!0}typeof S.get(ui)>"u"&&(k=0)}if(typeof f=="function"?b=f(n,b):b instanceof Date?b=h(b):r==="comma"&&At(b)&&(b=Ss.maybeMap(b,function($){return $ instanceof Date?h($):$})),b===null){if(i)return g(u&&!v?u(n,Fe.encoder,j,"key",m):n);b=""}if(Aw(b)||Ss.isBuffer(b)){if(u){var C=v?n:u(n,Fe.encoder,j,"key",m);return[g(C)+"="+g(u(b,Fe.encoder,j,"value",m))]}return[g(n)+"="+g(String(b))]}var O=[];if(typeof b>"u")return O;var A;if(r==="comma"&&At(b))v&&u&&(b=Ss.maybeMap(b,function($){return $==null?$:u($)})),A=[{value:b.length>0?b.join(",")||null:void 0}];else if(At(f))A=f;else{var P=Object.keys(b);A=d?P.sort(d):P}var R=l?String(n).replace(/\./g,"%2E"):String(n),U=s&&At(b)&&b.length===1?R+"[]":R;if(o&&At(b)&&b.length===0)return U+"[]";for(var J=0;J<A.length;++J){var Z=A[J],_=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:b[Z];if(!(a&&_===null)){var M=p&&l?String(Z).replace(/\./g,"%2E"):String(Z),K=At(b)?typeof r=="function"?r(U,M):U:U+(p?"."+M:"["+M+"]");y.set(t,k);var Y=Gd();Y.set(ui,y),tp(O,e(_,K,r,s,o,i,a,l,r==="comma"&&v&&At(b)?null:u,f,d,p,h,m,g,v,j,Y))}}return O},Nw=function(t){if(!t)return Fe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||Fe.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=gr.default;if(typeof t.format<"u"){if(!Ew.call(gr.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var s=gr.formatters[r],o=Fe.filter;(typeof t.filter=="function"||At(t.filter))&&(o=t.filter);var i;if(t.arrayFormat in ep?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=Fe.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Fe.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Fe.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Fe.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Fe.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Fe.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Fe.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Fe.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Fe.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Fe.encodeValuesOnly,filter:o,format:r,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Fe.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Fe.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Fe.strictNullHandling}},Cw=function(e,t){var n=e,r=Nw(t),s,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):At(r.filter)&&(o=r.filter,s=o);var i=[];if(typeof n!="object"||n===null)return"";var a=ep[r.arrayFormat],l=a==="comma"&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);for(var u=Gd(),f=0;f<s.length;++f){var d=s[f];if(!(typeof d>"u"||d===null)){var p=n[d];r.skipNulls&&p===null||tp(i,Ow(p,d,a,l,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}}var h=i.join(r.delimiter),m=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B"+r.delimiter:m+="utf8=%E2%9C%93"+r.delimiter),h.length>0?m+h:""},_t=Qd,js=Object.prototype.hasOwnProperty,fi=Array.isArray,Oe={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},_w=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},np=function(e,t,n,r){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1){if(r&&t.throwOnLimitExceeded)for(var s=0,o=e.indexOf(",");o>-1;){if(s+=1,s>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");o=e.indexOf(",",o+1)}return e.split(",")}if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},Rw="utf8=%26%2310003%3B",Iw="utf8=%E2%9C%93",Pw=function(t,n){var r={__proto__:null},s=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;s=s.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=n.parameterLimit===1/0?void 0:n.parameterLimit,i=s.split(n.delimiter,n.throwOnLimitExceeded&&typeof o<"u"?o+1:o);if(n.throwOnLimitExceeded&&typeof o<"u"&&i.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var a=-1,l,u=n.charset;if(n.charsetSentinel)for(l=0;l<i.length;++l)i[l].indexOf("utf8=")===0&&(i[l]===Iw?u="utf-8":i[l]===Rw&&(u="iso-8859-1"),a=l,l=i.length);for(l=0;l<i.length;++l)if(l!==a){var f=i[l],d=f.indexOf("]="),p=d===-1?f.indexOf("="):d+1,h,m;if(p===-1?(h=n.decoder(f,Oe.decoder,u,"key"),m=n.strictNullHandling?null:""):(h=n.decoder(f.slice(0,p),Oe.decoder,u,"key"),h!==null&&(m=_t.maybeMap(np(f.slice(p+1),n,fi(r[h])?r[h].length:0,f.indexOf("[]=")===-1),function(v){return n.decoder(v,Oe.decoder,u,"value")}))),m&&n.interpretNumericEntities&&u==="iso-8859-1"&&(m=_w(String(m))),f.indexOf("[]=")>-1&&(m=fi(m)?[m]:m),n.comma&&fi(m)&&m.length>n.arrayLimit&&(m=_t.combine([],m,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded)),h!==null){var g=js.call(r,h);g&&(n.duplicates==="combine"||f.indexOf("[]=")>-1)?r[h]=_t.combine(r[h],m,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded):(!g||n.duplicates==="last")&&(r[h]=m)}}return r},$w=function(e,t,n,r){var s=0;if(e.length>0&&e[e.length-1]==="[]"){var o=e.slice(0,-1).join("");s=Array.isArray(t)&&t[o]?t[o].length:0}for(var i=r?t:np(t,n,s),a=e.length-1;a>=0;--a){var l,u=e[a];if(u==="[]"&&n.parseArrays)_t.isOverflow(i)?l=i:l=n.allowEmptyArrays&&(i===""||n.strictNullHandling&&i===null)?[]:_t.combine([],i,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded);else{l=n.plainObjects?{__proto__:null}:{};var f=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=n.decodeDotInKeys?f.replace(/%2E/g,"."):f,p=parseInt(d,10),h=!isNaN(p)&&u!==d&&String(p)===d&&p>=0&&n.parseArrays;if(!n.parseArrays&&d==="")l={0:i};else if(h&&p<n.arrayLimit)l=[],l[p]=i;else{if(h&&n.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(n.arrayLimit===1?"":"s")+" allowed in an array.");h?(l[p]=i,_t.markOverflow(l,p)):d!=="__proto__"&&(l[d]=i)}}i=l}return i},Mw=function(t,n){var r=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(n.depth<=0)return!n.plainObjects&&js.call(Object.prototype,r)&&!n.allowPrototypes?void 0:[r];var s=[],o=r.indexOf("["),i=o>=0?r.slice(0,o):r;if(i){if(!n.plainObjects&&js.call(Object.prototype,i)&&!n.allowPrototypes)return;s[s.length]=i}for(var a=r.length,l=o,u=0;l>=0&&u<n.depth;){for(var f=1,d=l+1,p=-1;d<a&&p<0;){var h=r.charCodeAt(d);h===91?f+=1:h===93&&(f-=1,f===0&&(p=d)),d+=1}if(p<0)return s[s.length]="["+r.slice(l)+"]",s;var m=r.slice(l,p+1),g=m.slice(1,-1);if(!n.plainObjects&&js.call(Object.prototype,g)&&!n.allowPrototypes)return;s[s.length]=m,u+=1,l=r.indexOf("[",p+1)}if(l>=0){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s[s.length]="["+r.slice(l)+"]"}return s},Lw=function(t,n,r,s){if(t){var o=Mw(t,r);if(o)return $w(o,n,r,s)}},Dw=function(t){if(!t)return Oe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var n=typeof t.charset>"u"?Oe.charset:t.charset,r=typeof t.duplicates>"u"?Oe.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var s=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Oe.allowDots:!!t.allowDots;return{allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Oe.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Oe.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Oe.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Oe.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Oe.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Oe.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Oe.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Oe.decoder,delimiter:typeof t.delimiter=="string"||_t.isRegExp(t.delimiter)?t.delimiter:Oe.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Oe.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Oe.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Oe.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Oe.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Oe.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:Oe.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Oe.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},Bw=function(e,t){var n=Dw(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?{__proto__:null}:{};for(var r=typeof e=="string"?Pw(e,n):e,s=n.plainObjects?{__proto__:null}:{},o=Object.keys(r),i=0;i<o.length;++i){var a=o[i],l=Lw(a,r[a],n,typeof e=="string");s=_t.merge(s,l,n)}return n.allowSparse===!0?s:_t.compact(s)},Fw=Cw,Uw=Bw,Hw=za,Es={formats:Hw,parse:Uw,stringify:Fw},qw=Gb;function bt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var zw=/^([a-z0-9.+-]+:)/i,Ww=/:[0-9]*$/,Vw=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Kw=["<",">",'"',"`"," ","\r",`
175
+ `," "],Jw=["{","}","|","\\","^","`"].concat(Kw),Ki=["'"].concat(Jw),vu=["%","/","?",";","#"].concat(Ki),wu=["/","?","#"],Yw=255,Su=/^[+a-z0-9A-Z_-]{0,63}$/,Zw=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Xw={javascript:!0,"javascript:":!0},Ji={javascript:!0,"javascript:":!0},Bn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Yi=Es;function Wa(e,t,n){if(e&&typeof e=="object"&&e instanceof bt)return e;var r=new bt;return r.parse(e,t,n),r}bt.prototype.parse=function(e,t,n){if(typeof e!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),s=r!==-1&&r<e.indexOf("#")?"?":"#",o=e.split(s),i=/\\/g;o[0]=o[0].replace(i,"/"),e=o.join(s);var a=e;if(a=a.trim(),!n&&e.split("#").length===1){var l=Vw.exec(a);if(l)return this.path=a,this.href=a,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=Yi.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var u=zw.exec(a);if(u){u=u[0];var f=u.toLowerCase();this.protocol=f,a=a.substr(u.length)}if(n||u||a.match(/^\/\/[^@/]+@[^@/]+/)){var d=a.substr(0,2)==="//";d&&!(u&&Ji[u])&&(a=a.substr(2),this.slashes=!0)}if(!Ji[u]&&(d||u&&!Bn[u])){for(var p=-1,h=0;h<wu.length;h++){var m=a.indexOf(wu[h]);m!==-1&&(p===-1||m<p)&&(p=m)}var g,v;p===-1?v=a.lastIndexOf("@"):v=a.lastIndexOf("@",p),v!==-1&&(g=a.slice(0,v),a=a.slice(v+1),this.auth=decodeURIComponent(g)),p=-1;for(var h=0;h<vu.length;h++){var m=a.indexOf(vu[h]);m!==-1&&(p===-1||m<p)&&(p=m)}p===-1&&(p=a.length),this.host=a.slice(0,p),a=a.slice(p),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var y=this.hostname.split(/\./),h=0,b=y.length;h<b;h++){var S=y[h];if(S&&!S.match(Su)){for(var k="",w=0,E=S.length;w<E;w++)S.charCodeAt(w)>127?k+="x":k+=S[w];if(!k.match(Su)){var C=y.slice(0,h),O=y.slice(h+1),A=S.match(Zw);A&&(C.push(A[1]),O.unshift(A[2])),O.length&&(a="/"+O.join(".")+a),this.hostname=C.join(".");break}}}this.hostname.length>Yw?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=qw.toASCII(this.hostname));var P=this.port?":"+this.port:"",R=this.hostname||"";this.host=R+P,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Xw[f])for(var h=0,b=Ki.length;h<b;h++){var U=Ki[h];if(a.indexOf(U)!==-1){var J=encodeURIComponent(U);J===U&&(J=escape(U)),a=a.split(U).join(J)}}var Z=a.indexOf("#");Z!==-1&&(this.hash=a.substr(Z),a=a.slice(0,Z));var _=a.indexOf("?");if(_!==-1?(this.search=a.substr(_),this.query=a.substr(_+1),t&&(this.query=Yi.parse(this.query)),a=a.slice(0,_)):t&&(this.search="",this.query={}),a&&(this.pathname=a),Bn[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var P=this.pathname||"",M=this.search||"";this.path=P+M}return this.href=this.format(),this};function Qw(e){return typeof e=="string"&&(e=Wa(e)),e instanceof bt?e.format():bt.prototype.format.call(e)}bt.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",s=!1,o="";this.host?s=e+this.host:this.hostname&&(s=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=Yi.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var i=this.search||o&&"?"+o||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||Bn[t])&&s!==!1?(s="//"+(s||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):s||(s=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),n=n.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),i=i.replace("#","%23"),t+s+n+i+r};bt.prototype.resolve=function(e){return this.resolveObject(Wa(e,!1,!0)).format()};bt.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new bt;t.parse(e,!1,!0),e=t}for(var n=new bt,r=Object.keys(this),s=0;s<r.length;s++){var o=r[s];n[o]=this[o]}if(n.hash=e.hash,e.href==="")return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var i=Object.keys(e),a=0;a<i.length;a++){var l=i[a];l!=="protocol"&&(n[l]=e[l])}return Bn[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!Bn[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var d=u[f];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,!e.host&&!Ji[e.protocol]){for(var b=(e.pathname||"").split("/");b.length&&!(e.host=b.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),b[0]!==""&&b.unshift(""),b.length<2&&b.unshift(""),n.pathname=b.join("/")}else n.pathname=e.pathname;if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",h=n.search||"";n.path=p+h}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&n.pathname.charAt(0)==="/",g=e.host||e.pathname&&e.pathname.charAt(0)==="/",v=g||m||n.host&&e.pathname,j=v,y=n.pathname&&n.pathname.split("/")||[],b=e.pathname&&e.pathname.split("/")||[],S=n.protocol&&!Bn[n.protocol];if(S&&(n.hostname="",n.port=null,n.host&&(y[0]===""?y[0]=n.host:y.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(b[0]===""?b[0]=e.host:b.unshift(e.host)),e.host=null),v=v&&(b[0]===""||y[0]==="")),g)n.host=e.host||e.host===""?e.host:n.host,n.hostname=e.hostname||e.hostname===""?e.hostname:n.hostname,n.search=e.search,n.query=e.query,y=b;else if(b.length)y||(y=[]),y.pop(),y=y.concat(b),n.search=e.search,n.query=e.query;else if(e.search!=null){if(S){n.host=y.shift(),n.hostname=n.host;var k=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;k&&(n.auth=k.shift(),n.hostname=k.shift(),n.host=n.hostname)}return n.search=e.search,n.query=e.query,(n.pathname!==null||n.search!==null)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!y.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var w=y.slice(-1)[0],E=(n.host||e.host||y.length>1)&&(w==="."||w==="..")||w==="",C=0,O=y.length;O>=0;O--)w=y[O],w==="."?y.splice(O,1):w===".."?(y.splice(O,1),C++):C&&(y.splice(O,1),C--);if(!v&&!j)for(;C--;C)y.unshift("..");v&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),E&&y.join("/").substr(-1)!=="/"&&y.push("");var A=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(S){n.hostname=A?"":y.length?y.shift():"",n.host=n.hostname;var k=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;k&&(n.auth=k.shift(),n.hostname=k.shift(),n.host=n.hostname)}return v=v||n.host&&y.length,v&&!A&&y.unshift(""),y.length>0?n.pathname=y.join("/"):(n.pathname=null,n.path=null),(n.pathname!==null||n.search!==null)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n};bt.prototype.parseHost=function(){var e=this.host,t=Ww.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Gw=Wa,ju=Qw;const eS=()=>Object.keys(Mn).map(e=>({...Mn[e].info,clients:Object.keys(Mn[e].clientsById).map(t=>Mn[e].clientsById[t].info)})),tS=e=>typeof e=="object"&&"log"in e&&typeof e.log=="object"&&"entries"in e.log&&Array.isArray(e.log.entries);var nS=class{constructor(e,t={}){this.initCalled=!1,this.entries=[],this.requests=[],this.options={},this.options={harIsAlreadyEncoded:!1,...t},this.requests=[],tS(e)?this.entries=e.log.entries:this.entries=[{request:e}]}init(){return this.initCalled=!0,this.requests=this.entries.map(({request:e})=>{var n;const t={bodySize:0,headersSize:0,headers:[],cookies:[],httpVersion:"HTTP/1.1",queryString:[],postData:{mimeType:((n=e.postData)==null?void 0:n.mimeType)||"application/octet-stream"},...e};return t.postData&&!t.postData.mimeType&&(t.postData.mimeType="application/octet-stream"),this.prepare(t,this.options)}),this}prepare(e,t){var f,d,p;const n={...e,fullUrl:"",uriObj:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{}};if(n!=null&&n.queryString.length&&(n.queryObj=n.queryString.reduce(Wc,{})),n!=null&&n.headers.length){const h=/^HTTP\/2/;n.headersObj=n.headers.reduce((m,{name:g,value:v})=>{const j=h.exec(n.httpVersion)?g.toLocaleLowerCase():g;return{...m,[j]:v}},{})}n!=null&&n.cookies.length&&(n.cookiesObj=n.cookies.reduceRight((h,{name:m,value:g})=>({...h,[m]:g}),{}));const r=(f=n.cookies)==null?void 0:f.map(({name:h,value:m})=>t.harIsAlreadyEncoded?`${h}=${m}`:`${encodeURIComponent(h)}=${encodeURIComponent(m)}`);switch(r!=null&&r.length&&(n.allHeaders.cookie=r.join("; ")),n.postData.mimeType){case"multipart/mixed":case"multipart/related":case"multipart/form-data":case"multipart/alternative":if(n.postData.text="",n.postData.mimeType="multipart/form-data",(d=n.postData)!=null&&d.params){const h="---011000010111000001101001",m=`${h}--`,g=`\r
176
+ `;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const v=S=>S.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),j=S=>S.replace(/\r?\n|\r/g,`\r
177
+ `),y=[`--${h}`];(p=n.postData)==null||p.params.forEach((S,k)=>{const w=S.name,E=S.value||"",C=S.fileName||null,O=S.contentType||"application/octet-stream";C?(y.push(`Content-Disposition: form-data; name="${v(j(w))}"; filename="${C}"`),y.push(`Content-Type: ${O}`)):y.push(`Content-Disposition: form-data; name="${escape(j(w))}"`),y.push(""),y.push(j(E)),k!==n.postData.params.length-1&&y.push(`--${h}`)}),y.push(`--${m}`),n.postData.boundary=h,n.postData.text=y.join(g);const b=Ze(n.headersObj,"content-type")||"content-type";n.headersObj[b]=`multipart/form-data; boundary=${h}`}break;case"application/x-www-form-urlencoded":n.postData.params?(n.postData.paramsObj=n.postData.params.reduce(Wc,{}),n.postData.text=Es.stringify(n.postData.paramsObj)):n.postData.text="";break;case"text/json":case"text/x-json":case"application/json":case"application/x-json":if(n.postData.mimeType="application/json",n.postData.text)try{n.postData.jsonObj=JSON.parse(n.postData.text)}catch{n.postData.mimeType="text/plain"}break}const s={...n.allHeaders,...n.headersObj},o=Gw(n.url,!0,!0);n.queryObj={...n.queryObj,...o.query};let i;t.harIsAlreadyEncoded?i=Es.stringify(n.queryObj,{encode:!1,indices:!1}):i=Es.stringify(n.queryObj,{indices:!1});const a={...o,query:n.queryObj,search:i,path:i?`${o.pathname}?${i}`:o.pathname},l=ju({...o,query:null,search:null}),u=ju({...o,...a});return{...n,allHeaders:s,fullUrl:u,url:l,uriObj:a}}convert(e,t,n){this.initCalled||this.init(),!n&&t&&(n={clientId:t});const r=Mn[e];if(!r)return[!1];const{convert:s}=r.clientsById[t||r.info.default];return this.requests.map(o=>s(o,n))}installation(e,t,n){this.initCalled||this.init(),!n&&t&&(n={clientId:t});const r=Mn[e];if(!r)return[!1];const{info:s}=r.clientsById[t||r.info.default];return this.requests.map(o=>s!=null&&s.installation?s.installation(o,n):!1)}};const rS="shell",sS="curl";function oS(){return eS()}function iS(e){var r;const t=e==null?void 0:e[0];if(!t)return"http://localhost";let n=t.url;for(const[s,o]of Object.entries(t.variables??{})){const i=o.default??((r=o.enum)==null?void 0:r[0])??`{${s}}`;n=n.replace(new RegExp(`\\{${s}\\}`,"g"),String(i))}return n}function aS(e){if(e.example!==void 0||e.examples&&Object.keys(e.examples).length>0)return!0;const t=e.schema;return!!((t==null?void 0:t.example)!==void 0||t!=null&&t.enum&&t.enum.length>0)}function rp(e){if(e.example!==void 0)return String(e.example);if(e.examples){for(const n of Object.values(e.examples))if(n&&typeof n=="object"&&"value"in n&&n.value!==void 0)return String(n.value)}const t=e.schema;return(t==null?void 0:t.example)!==void 0?String(t.example):t!=null&&t.enum&&t.enum.length>0?String(t.enum[0]):`{${e.name}}`}function lS(e,t,n){const r=t.replace(/\{([^}]+)\}/g,(s,o)=>{const i=n.find(l=>l.in==="path"&&l.name===o);if(!i)return s;const a=rp(i);return a===`{${o}}`?a:encodeURIComponent(a)});return`${e.replace(/\/$/,"")}${r}`}function cS(e,t){var s;const n=e[0];if(!n||!t)return[];const r=[];for(const o of Object.keys(n)){const i=t[o];if(i)if(i.type==="apiKey"){const a=i.in==="query"||i.in==="cookie"?i.in:"header";r.push({location:a,name:i.name,value:"YOUR_API_KEY"})}else if(i.type==="http"){const a=((s=i.scheme)==null?void 0:s.toLowerCase())==="basic";r.push({location:"header",name:"Authorization",value:a?"Basic BASE64_ENCODED_CREDENTIALS":"Bearer YOUR_ACCESS_TOKEN"})}else(i.type==="oauth2"||i.type==="openIdConnect")&&r.push({location:"header",name:"Authorization",value:"Bearer YOUR_ACCESS_TOKEN"})}return r}function uS(e){const t=e==null?void 0:e.content;if(!t)return null;const n="application/json"in t?"application/json":Object.keys(t)[0];if(!n)return null;const r=t[n];let s=r.example;if(s===void 0&&r.examples){for(const o of Object.values(r.examples))if(o&&typeof o=="object"&&"value"in o&&o.value!==void 0){s=o.value;break}}return{contentType:n,schema:r.schema,authorExample:s}}function fS(e){const t=iS(e.servers),n=lS(t,e.path,e.parameters),r=cS(e.security,e.securitySchemes),s=[],o=[],i=[];for(const l of r)(l.location==="header"?s:l.location==="query"?o:i).push({name:l.name,value:l.value});for(const l of e.parameters)l.in==="query"&&(l.required||aS(l))&&o.push({name:l.name,value:rp(l)});const a={method:e.method.toUpperCase(),url:n,httpVersion:"HTTP/1.1",headers:s,queryString:o,cookies:i};return e.media&&e.resolvedBodyValue!==void 0&&(s.push({name:"Content-Type",value:e.media.contentType}),a.postData={mimeType:e.media.contentType,text:JSON.stringify(e.resolvedBodyValue,null,2)}),a}function dS(e,t,n){try{const r=new nS(e),[s]=r.convert(t,n);return typeof s=="string"?s:""}catch{return""}}const pS={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 hS(e){return pS[e]??"plaintext"}const mS={c:()=>Promise.resolve().then(()=>require("./c-C_Sx7N-F.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BcGgviMR.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-yuAGIuP4.cjs")),go:()=>Promise.resolve().then(()=>require("./go-BpetKc7b.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-BIk0G-rH.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-kGuORR5a.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-DF4zG2hq.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-nPcbuC2a.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-DKnYCg2f.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-CAnH__EC.cjs"))};function Zi(e){return e==="plaintext"||!!vt.getLanguage(e)}async function gS(e){if(Zi(e))return;const t=mS[e];if(!t)return;const n=await t();vt.registerLanguage(e,n.default)}const yS=`${rS}:${sS}`;function xS({method:e,path:t,parameters:n,requestBody:r,security:s,id:o}){var w;const{document:i,showCodeSamples:a}=ta(),l=i,u=T.useId(),f=T.useMemo(()=>oS(),[]),[d,p]=T.useState(yS),[h,m]=d.split(":"),g=hS(h),v=T.useMemo(()=>uS(r),[r]),[j,y]=T.useState(void 0);T.useEffect(()=>{if(y(void 0),!v||v.authorExample!==void 0||!v.schema)return;let E=!1;return db(v.schema).then(C=>{E||y(C)}),()=>{E=!0}},[v]);const[,b]=T.useState(()=>Zi(g));T.useEffect(()=>{b(Zi(g));let E=!1;return gS(g).then(()=>{E||b(!0)}),()=>{E=!0}},[g]);const S=T.useMemo(()=>{var E;return fS({method:e,path:t,servers:l.servers,parameters:n,security:s,securitySchemes:(E=l.components)==null?void 0:E.securitySchemes,media:v,resolvedBodyValue:(v==null?void 0:v.authorExample)??j})},[e,t,l.servers,n,s,(w=l.components)==null?void 0:w.securitySchemes,v,j]),k=T.useMemo(()=>dS(S,h,m),[S,h,m]);return a?c.jsxs("div",{id:`endpoint-${o}-code-samples`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("label",{htmlFor:u,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example Request"}),c.jsx("select",{id:u,value:d,onChange:E=>p(E.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:f.map(E=>c.jsx("optgroup",{label:E.title,children:E.clients.map(C=>c.jsx("option",{value:`${E.key}:${C.key}`,children:C.title},C.key))},E.key))})]}),c.jsx(_a,{code:k,language:g})]}):null}function bS({className:e}){return c.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:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.jsx("path",{d:"M12 11v5"}),c.jsx("path",{d:"M12 8h.01"})]})}function sp(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function vS(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${sp(`$${n}`)}}`)}function wS(e){return e.operationId??e.operationRef??null}const SS=e=>e.trim().replace(/[.:;]+$/,""),di=({children:e})=>c.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function jS({links:e,onFollowOperation:t,isOperationKnown:n}){return c.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var f;const o=wS(s),i=Object.entries(s.parameters??{}),a=s.description?SS(s.description):null,l=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),u=a??o??r;return c.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[c.jsx(bS,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),c.jsxs("span",{children:[l?c.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):c.jsx("span",{className:"text-foreground-secondary",children:u}),i.length>0&&c.jsxs(c.Fragment,{children:[" using ",i.map(([d,p],h)=>c.jsxs(T.Fragment,{children:[h>0&&(h===i.length-1?" and ":", "),c.jsx(di,{children:d})," from ",c.jsx(di,{children:sp(p)})]},d))]}),(f=s.server)!=null&&f.url?c.jsxs(c.Fragment,{children:[" via ",c.jsx(di,{children:s.server.url})]}):null,"."]})]},r)})})}function ES(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],o)=>oa.filter(i=>s==null?void 0:s[i]).map(i=>({name:t,url:r,method:i,op:s[i],urlIndex:o}))))}function kS({callbacks:e,id:t,renderOperation:n,depth:r}){const s=ES(e);return s.length===0?null:c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),c.jsx("div",{className:"space-y-2",children:s.map(({name:o,url:i,method:a,op:l,urlIndex:u})=>c.jsx(Mr,{trigger:c.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[c.jsx(Qt,{method:a,size:"xs",className:"shrink-0"}),c.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:o}),c.jsx("code",{className:"font-mono text-foreground-muted truncate",children:vS(i)})]}),children:c.jsx("div",{className:"px-4 py-3 border-t border-border",children:c.jsx(n,{method:a,path:i,op:l,id:`${t}-${o}-${u}-${a}`,idPrefix:"callback",depth:r+1})})},`${o}-${u}-${a}`))})]})}function TS(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function op({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?c.jsx(c.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):c.jsxs(c.Fragment,{children:[e," (",c.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=>c.jsx("option",{value:s,children:s},s))}),")"]})}function ip(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 AS(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 OS({responses:e,onFollowOperation:t,isOperationKnown:n}){var w,E;const r=Object.keys(e),[s,o]=T.useState(r[0]),i=e[s],a=Object.keys((i==null?void 0:i.content)??{}),[l,u]=T.useState(a[0]),f=l?(w=i==null?void 0:i.content)==null?void 0:w[l]:void 0,d=(i==null?void 0:i.headers)??{},p=(i==null?void 0:i.links)??{},[h,m]=T.useState("body"),g=a.length>0&&!!f,v=Object.keys(d).length>0,j=Object.keys(p).length>0,y=[...g?[{id:"body",name:"Body"}]:[],...v?[{id:"headers",name:"Headers"}]:[]],b=y.length>1,S=y.some(C=>C.id===h)?h:(E=y[0])==null?void 0:E.id,k=y.length>0;return T.useEffect(()=>{u(Object.keys((i==null?void 0:i.content)??{})[0]),m("body")},[s]),c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(C=>c.jsx("button",{role:"tab","aria-selected":s===C,onClick:()=>o(C),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${AS(C)} ${s===C?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:C},C))}),(i==null?void 0:i.description)&&c.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:i.description}),k?c.jsxs(c.Fragment,{children:[b&&c.jsx(Wn,{tabs:y,current:S,onChange:C=>m(C)}),c.jsx("div",{className:b?"mt-4":void 0,children:S==="headers"?c.jsx(yn,{schema:CS(d),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):c.jsx(yn,{schema:(f==null?void 0:f.schema)??{},label:c.jsx(op,{prefix:"Body",mediaTypes:a,selected:l,onChange:u}),rootName:"Body",example:ip(f)},"body")})]}):c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&c.jsx(jS,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function ap(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 NS=e=>ap(e),CS=e=>ap(Object.entries(e).map(([t,n])=>({name:t,...n})));function _S({parameters:e}){var a;const t=fh.filter(({location:l})=>e.some(u=>u.in===l)),[n,r]=T.useState(((a=t[0])==null?void 0:a.location)??null);if(t.length===0)return null;const s=t.some(l=>l.location===n)?n:t[0].location,o=t.find(l=>l.location===s),i=NS(e.filter(l=>l.in===s));return c.jsxs("div",{children:[t.length>1&&c.jsx(Wn,{tabs:t.map(({location:l,label:u})=>({id:l,name:u.replace(/ Parameters$/,"")})),current:s,onChange:r}),c.jsx("div",{className:t.length>1?"mt-4":void 0,children:c.jsx(yn,{schema:i,label:o.label,rootName:o.label,defaultView:"schema"})})]})}function RS({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,o=Object.keys(n),i=o.length>0,[a,l]=T.useState(s?"parameters":"body"),[u,f]=T.useState(o[0]),d=u?n[u]:void 0;if(!s&&!i)return c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[i?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[c.jsx("span",{className:"font-bold",children:e})," expects the following ",IS(p),":"]}),s&&i&&c.jsx(Wn,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:a,onChange:h=>l(h)}),c.jsxs("div",{className:s&&i?"mt-4":void 0,children:[(a==="parameters"||!i)&&s&&c.jsx(_S,{parameters:t}),(a==="body"||!s)&&i&&d&&c.jsx(yn,{schema:d.schema??{},label:c.jsx(op,{prefix:"Request Body",mediaTypes:o,selected:u,onChange:f}),rootName:"Body ",description:r,example:ip(d)})]})]})}function IS(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 PS({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:o,id:i,depth:a,fillHeight:l=!1,onFollowOperation:u,isOperationKnown:f}){const d=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,h=!!o&&Object.keys(o).length>0&&a<$S,m=[...d?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[g,v]=T.useState(m[0]??"request");if(m.length===0)return null;const j=m.includes(g)?g:m[0];return c.jsxs("div",{className:l?"flex-1 flex flex-col min-h-0":void 0,children:[c.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(y=>c.jsx("button",{role:"tab","aria-selected":j===y,onClick:()=>v(y),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===y?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:y},y))}),c.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${l?"flex-1 -mb-4":""}`,children:[j==="request"&&c.jsx(RS,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&c.jsx(OS,{responses:s,onFollowOperation:u,isOperationKnown:f}),j==="callbacks"&&o&&c.jsx(kS,{callbacks:o,id:i,depth:a,renderOperation:lp})]})]})}const $S=1;function lp({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:o,securitySchemes:i,onFollowOperation:a,isOperationKnown:l,depth:u=0}){var y,b,S;const f=(n.parameters??[]).filter(k=>k.in!=="query"&&k.in!=="path"),d=n.security??o??[],p=n.responses??{},h=((y=n.requestBody)==null?void 0:y.content)??{},m=n.operationId?TS(n.operationId):`${e.toUpperCase()} ${t}`,g=new Map;for(const k of d)for(const[w,E]of Object.entries(k)){if(E.length===0)continue;const C=g.get(w)??[];g.set(w,Array.from(new Set([...C,...E])))}const v=Array.from(new Set(d.flatMap(k=>Object.keys(k)))).map(k=>{const w=i==null?void 0:i[k];if(!w)return null;const E=g.get(k);return E?{...w,requiredScopes:E}:w}).filter(k=>!!k),j=u===0;return c.jsxs("div",{className:`flex flex-col gap-6 ${j?"min-h-full":""}`,id:`${s}-${r}-detail`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&c.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"}),((b=n.externalDocs)==null?void 0:b.url)&&c.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",c.jsx(Ys,{className:"w-3.5 h-3.5"})]})]}),n.summary&&c.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&c.jsx(wt,{children:n.description}),c.jsx(xS,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:d,id:r}),d.length>0&&c.jsxs("div",{id:`${s}-${r}-security`,children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),v.length>0&&c.jsx(Mr,{className:"mt-3",trigger:c.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[c.jsx(dd,{className:"h-4 w-4 text-foreground-muted"}),c.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:v.length})]}),children:c.jsx("div",{className:"px-4 py-2 border-t border-border",children:c.jsx($a,{securities:v})})})]}),c.jsx(PS,{label:m,parameters:f,requestBodyContent:h,requestBodyDescription:(S=n.requestBody)==null?void 0:S.description,responses:p,callbacks:n.callbacks,id:r,depth:u,fillHeight:j,onFollowOperation:a,isOperationKnown:l})]})}function MS(e,t){const n=t.filter(r=>r.in==="query");return n.length===0?e:`${e}?${n.map(r=>`${r.name}={${r.name}}`).join("&")}`}function Eu(e){var n;const t={};for(const r of e){const s=r.schema;t[r.name]={description:r.description,type:s==null?void 0:s.type,default:(s==null?void 0:s.default)!==void 0?String(s.default):void 0,enum:(n=s==null?void 0:s.enum)==null?void 0:n.map(String),examples:"example"in r&&r.example!==void 0?[String(r.example)]:void 0}}return t}function Ws({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,showCopyMarkdown:o,columnLabel:i="Path",idPrefix:a="endpoint"}){var O;const l=A=>s==null?void 0:s(A),{document:u,deref:f}=Ve(),d=u,p=T.useMemo(()=>Ts(e),[e]),h=T.useMemo(()=>{var P,R,U;const A=new Map;for(const J of p){const Z=((U=(R=(P=e[J.path])==null?void 0:P[J.method])==null?void 0:R.tags)==null?void 0:U[0])||"Other",_=A.get(Z)??[];_.push(J),A.set(Z,_)}return Array.from(A,([J,Z])=>({label:J,items:Z}))},[p,e]),[m,g]=T.useState(()=>new Set),v=m.size===0;T.useEffect(()=>{if(!r)return;const A=h.find(({items:P})=>P.some(({key:R})=>R===r));A&&g(P=>{if(!P.has(A.label))return P;const R=new Set(P);return R.delete(A.label),R})},[h,r]);const j=T.useMemo(()=>{var P,R;const A=new Map;for(const{key:U,method:J,path:Z}of p){const _=(R=(P=e[Z])==null?void 0:P[J])==null?void 0:R.operationId;_&&A.set(_,U)}return A},[p,e]);if(p.length===0)return null;const y=r?p.find(A=>A.key===r):null,b=y?(O=e[y.path])==null?void 0:O[y.method]:null,S=({key:A,method:P,path:R},U)=>{var _;const J=r===A,Z=Rl(e[R],(_=e[R])==null?void 0:_[P]);return c.jsxs("tr",{id:`${a}-${A}`,onClick:()=>l(A),role:"button",tabIndex:U?0:-1,"aria-hidden":!U,"aria-label":`${P.toUpperCase()} ${R}`,"aria-current":J?"true":void 0,onKeyDown:M=>{M.key!=="Enter"&&M.key!==" "||(M.preventDefault(),l(A))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${U?`cursor-pointer opacity-100 visible ${J?"bg-neutral-50":""}`:"pointer-events-none invisible opacity-0"}`,children:[c.jsx("td",{className:`px-6 max-w-0 w-full group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${U?"py-2":"py-0"}`,children:c.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${U?"max-h-12":"max-h-0"}`,children:c.jsx(Xt,{address:R,parameters:Eu(Z),truncate:!0,className:"text-xs"})})}),c.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${U?"py-2":"py-0"}`,children:c.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${U?"max-h-12":"max-h-0"}`,children:c.jsx(Qt,{method:P,className:"w-20"})})})]},A)},k=h.map(({label:A,items:P},R)=>{const U=!m.has(A),J=`${a}-group-${R}-${A.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return c.jsxs(T.Fragment,{children:[c.jsx("tbody",{className:"border-y border-border first:border-t-0",children:c.jsx("tr",{className:"bg-neutral-50/70",children:c.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:c.jsxs("button",{type:"button","aria-label":`${A} endpoints (${P.length})`,"aria-expanded":U,"aria-controls":J,onClick:()=>g(Z=>{const _=new Set(Z);return U?_.add(A):_.delete(A),_}),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:[c.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:U?c.jsx(Or,{className:"h-2.5 w-2.5"}):c.jsx(hd,{className:"h-2.5 w-2.5"})}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:A}),c.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:P.length})]})})})}),c.jsx("tbody",{id:J,"aria-hidden":!U,className:`bg-surface ${U?"divide-y divide-border":""}`,children:P.map(Z=>S(Z,U))})]},A)}),w=Rl(y?e[y.path]:void 0,b),E=y?c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(Qt,{method:y.method}),c.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:c.jsx(Xt,{address:MS(y.path,w),parameters:Eu(w),className:"text-xs"})})]}):r,C=c.jsxs("div",{children:[c.jsx("div",{className:"mb-3 flex justify-end",children:c.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground-secondary",children:[c.jsx("input",{type:"checkbox",checked:v,onChange:A=>g(A.target.checked?new Set:new Set(h.map(({label:P})=>P))),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),g(v?new Set(h.map(({label:P})=>P)):new Set))},className:"h-3.5 w-3.5 cursor-pointer rounded border-border"}),c.jsx("span",{children:"Expand all"})]})}),c.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{className:"bg-neutral-100 w-full",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),c.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),k]})})]});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{content:C,stickySideContent:!1})}),c.jsx(bd,{isOpen:!!y,side:"right",onClose:()=>l(null),title:E,headerActions:y&&b&&o?c.jsx(vd,{getMarkdown:()=>sg(d,y.method,y.path,f),label:"Copy endpoint for LLM"}):void 0,children:y&&b&&c.jsx(lp,{method:y.method,path:y.path,op:{...b,parameters:w},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:A=>j.has(A),onFollowOperation:A=>{const P=j.get(A);P&&l(P)}})})]})}const LS=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function DS({openapi:e,config:t}){var w,E,C,O;const n=t.show??{},r=e.webhooks??{},s=Object.keys(r).length>0,o=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Js}]:[],...s&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:ia}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:sa}]:[]],{query:i,setQuery:a,results:l}=ub(e,{threshold:.3,limit:20}),{effectiveTab:u,focusTab:f,navActiveSection:d,selected:p,setSelectedKey:h,selectedNavItem:m,handleSearchSelect:g,handleNavItemSelect:v,handleNavServerSelect:j,handleContentTabChange:y,schemaFocusTarget:b}=Zu({tabs:o,defaultTab:"endpoints",isTabKey:LS,sections:[{id:"endpoints",visible:n.endpoints!==!1},{id:"webhooks",visible:s&&n.webhooks!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:i}),S=(e.servers??[]).map(A=>A.url),k=u==="endpoints"?c.jsx(Ws,{paths:e.paths??{},security:e.security,securitySchemes:(w=e.components)==null?void 0:w.securitySchemes,selectedKey:p.endpoints,onSelectKey:A=>h("endpoints",A),showCopyMarkdown:n.copyMarkdown!==!1}):u==="webhooks"?c.jsx(Ws,{paths:r,security:e.security,securitySchemes:(E=e.components)==null?void 0:E.securitySchemes,selectedKey:p.webhooks,onSelectKey:A=>h("webhooks",A),columnLabel:"Webhook",idPrefix:"webhook",showCopyMarkdown:n.copyMarkdown!==!1}):u==="schemas"?c.jsx(no,{schemas:((C=e.components)==null?void 0:C.schemas)??{},selectedKey:p.schemas,focusTarget:b}):null;return c.jsx(La,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:c.jsxs("div",{className:"px-4",children:[n.search!==!1&&c.jsx(Du,{query:i,onQueryChange:a,results:l,onSelectResult:g}),n.copyMarkdown!==!1&&c.jsx(Bu,{serialize:A=>rg(e,A),leftOffset:n.search!==!1?60:12}),n.info!==!1&&c.jsx("div",{id:"info-panel",children:c.jsx(jd,{info:e.info,tags:e.tags,externalDocs:e.externalDocs})}),n.servers!==!1&&S.length>0&&c.jsx("div",{id:p.servers??"server-0",children:c.jsx(Ed,{servers:e.servers,selectedServer:p.servers,onSelectServer:A=>h("servers",A)})}),n.sidebar!==!1&&c.jsx(Rh,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:s&&n.webhooks!==!1?r:void 0,schemas:n.schemas!==!1?(O=e.components)==null?void 0:O.schemas:void 0,servers:n.servers!==!1?S:void 0,hasInfo:n.info!==!1,activeTab:d,onTabChange:f,onItemSelect:v,onSelectServer:j,selectedItem:m}),c.jsx(Nu,{tabs:o,current:u,onChange:y}),u&&c.jsx("div",{id:`panel-${u}`,role:"tabpanel","aria-labelledby":`tab-${u}`,children:k})]})})}const Va=e=>{const t=e.openapi,n=T.useMemo(()=>Ar(t),[t]),r=e.kind;T.useEffect(()=>{r==="resolved"&&n!==t&&ea(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??zn;return c.jsx(DS,{openapi:n,config:s})};function cp(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=o=>{const i=s(o);return i!==void 0?i:n(o)?t:void 0}}const BS=["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 FS(){return{validate:HS,parse:qS,getMimeTypes:()=>BS}}function US(e){cp(e,FS(),Nr)}function HS(e){return ma(e.data).map(t=>({message:t,path:e.path}))}function qS(e){var n,r;const t=ma(e.data);if(t.length>0)return{[Cs]:t[0]};try{const s=Ai(e.data),o=e.meta.message,i=(r=(n=o==null?void 0:o.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return i&&o&&(o["x-parser-original-bindings-kafka-key"]=i,o.bindings.kafka.key=Ai(i)),s}catch(s){return{[Cs]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function zS(){try{const e=await Promise.resolve().then(()=>require("./index-QHokKPe8.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 up(e){try{const t=await zS(),n=new t;US(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-Bd0cGKWk.cjs"));r(n);const{document:s,diagnostics:o}=await n.parse(e);return{diagnostics:o,document:s?VS(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function WS(e,t){const{diagnostics:n,document:r}=await up(e);return{diagnostics:n,view:r?c.jsx(Ma,{kind:"resolved",asyncapi:r,config:t}):null}}function VS(e){return e.json()}function KS({raw:e,config:t,onDiagnostics:n}){const[r,s]=T.useState(null),o=T.useRef(n);return o.current=n,T.useEffect(()=>{let i=!0;return up(e).then(({document:a,diagnostics:l})=>{var u;i&&(s(a),(u=o.current)==null||u.call(o,l))}),()=>{i=!1}},[e]),r?c.jsx(Ma,{kind:"resolved",asyncapi:r,config:t}):null}async function JS(){try{return await Promise.resolve().then(()=>require("./index-CkQBQKmb.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 pi=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function fp(e){try{const{validate:t,dereference:n}=await JS(),r=await t(e);if(!r.valid)return{diagnostics:r.errors.map(a=>pi(a,0)),document:null};const s=(r.errors??[]).map(a=>pi(a,1)),{schema:o,errors:i}=n(e);return i!=null&&i.length&&s.push(...i.map(a=>pi(a,0))),{diagnostics:s,document:o??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function YS(e,t){const{diagnostics:n,document:r}=await fp(e);return{diagnostics:n,view:r?c.jsx(Va,{kind:"resolved",openapi:r,config:t}):null}}function ZS({raw:e,config:t,onDiagnostics:n}){const[r,s]=T.useState(null),o=T.useRef(n);return o.current=n,T.useEffect(()=>{let i=!0;return fp(e).then(({document:a,diagnostics:l})=>{var u;i&&(s(a),(u=o.current)==null||u.call(o,l))}),()=>{i=!1}},[e]),r?c.jsx(Va,{kind:"resolved",openapi:r,config:t}):null}function dp(e,t,n){return function({document:s,config:o,children:i}){const a=T.useContext(Vs),l=T.useMemo(()=>s?Ar(s):null,[s]),u=!!a&&a.specType!==n;if(T.useEffect(()=>{u&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${a.specType} document provider, which cannot supply the document it needs. `+(l?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[a,u,l]),a&&!u)return c.jsx(c.Fragment,{children:i});if(!l){if(a)return c.jsx(c.Fragment,{children:i});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return c.jsx(e,{document:l,config:o,children:i})}}function XS({document:e,config:t,children:n}){const r=T.useMemo(()=>Ar(e),[e]);return c.jsx(na,{document:r,config:t,children:n})}const Fr=dp(na,"AsyncAPI","asyncapi");function Ur(){const e=Ve();return e.specType==="asyncapi",e.document}function QS(){const e=Ur();return!e.servers||Object.keys(e.servers).length===0?null:c.jsx(xd,{servers:e.servers})}function GS(e){return c.jsx(Fr,{...e,children:c.jsx(QS,{})})}function ej(){const e=Ur(),[t,n]=T.useState(null);return c.jsx(Sd,{operations:e.operations??{},selectedKey:t,onSelectKey:n})}function tj(e){return c.jsx(Fr,{...e,children:c.jsx(ej,{})})}function nj(){var t;const e=Ur();return c.jsx(ud,{messages:((t=e.components)==null?void 0:t.messages)??{}})}function rj(e){return c.jsx(Fr,{...e,children:c.jsx(nj,{})})}function sj(){var t;const e=Ur();return c.jsx(no,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function oj(e){return c.jsx(Fr,{...e,children:c.jsx(sj,{})})}function ij(){const e=Ur();return e.info?c.jsx(Lf,{...e.info}):null}function aj(e){return c.jsx(Fr,{...e,children:c.jsx(ij,{})})}function lj({document:e,config:t,children:n}){const r=T.useMemo(()=>Ar(e),[e]);return c.jsx(La,{document:r,config:t,children:n})}const Hr=dp(La,"OpenAPI","openapi");function qr(){const e=ta();return e.specType==="openapi",e.document}function cj(){const e=qr();return!e.servers||e.servers.length===0?null:c.jsx(Ed,{servers:e.servers})}function uj(e){return c.jsx(Hr,{...e,children:c.jsx(cj,{})})}function fj(){var r;const e=qr(),[t,n]=T.useState(null);return c.jsx(Ws,{paths:e.paths??{},security:e.security,securitySchemes:(r=e.components)==null?void 0:r.securitySchemes,selectedKey:t,onSelectKey:n})}function dj(e){return c.jsx(Hr,{...e,children:c.jsx(fj,{})})}function pj(){var s;const e=qr(),[t,n]=T.useState(null),r=e.webhooks??{};return Object.keys(r).length===0?null:c.jsx(Ws,{paths:r,security:e.security,securitySchemes:(s=e.components)==null?void 0:s.securitySchemes,selectedKey:t,onSelectKey:n,columnLabel:"Webhook",idPrefix:"webhook"})}function hj(e){return c.jsx(Hr,{...e,children:c.jsx(pj,{})})}function mj(){var t;const e=qr();return c.jsx(no,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function gj(e){return c.jsx(Hr,{...e,children:c.jsx(mj,{})})}function yj(){const e=qr();return e.info?c.jsx(jd,{info:e.info,tags:e.tags,externalDocs:e.externalDocs}):null}function xj(e){return c.jsx(Hr,{...e,children:c.jsx(yj,{})})}exports.AsyncAPI=Ma;exports.AsyncAPIProvider=XS;exports.AsyncAPIRenderer=KS;exports.Info=aj;exports.Messages=rj;exports.OpenAPI=Va;exports.OpenAPIEndpoints=dj;exports.OpenAPIInfo=xj;exports.OpenAPIProvider=lj;exports.OpenAPIRenderer=ZS;exports.OpenAPISchemas=gj;exports.OpenAPIServers=uj;exports.OpenAPIWebhooks=hj;exports.Operations=tj;exports.SchemaTabs=yn;exports.SchemaTree=Pa;exports.Schemas=oj;exports.Servers=GS;exports.X_LIB_CONVERSION_ERROR=Cs;exports.commonjsGlobal=wr;exports.defaultConfig=zn;exports.getDefaultExportFromCjs=Zs;exports.isProtobufSchemaFormat=Cr;exports.parseAndRender=WS;exports.parseAndRender$1=YS;exports.registerSchemaParserWithFallback=cp;exports.require$$0=Nd;exports.useAsyncAPIDocument=Ve;