1import{O as Qn,$ as Aa,M as Qe,a0 as Ua,_ as Je,X as zt,a1 as Jt,a2 as Da,a3 as Ha,a4 as _a,a as v,a5 as La,b as Ia,c as Yn,e as Ma,l as Ae,a6 as Xn,a7 as Zn,a8 as ea,a9 as ta,aa as ra,u as Lt,m as na,f as de,B as We,g as It,i as He,r as se,ab as Fa,ac as aa,ad as oa,ae as Mt,af as sa,ag as Ba,ah as za,ai as Ja,aj as Wa,ak as ia,al as la,am as Va,an as ca,ao as pa,ap as Ga,aq as Ka,ar as Qa,as as ua,at as da,au as Ya,av as Xa,aw as Za,ax as eo,ay as to,h as cr,D as ro,az as Ve,aA as no}from"./entry.client-yzFfjJ06.js";import{u as ao}from"./Pagination-CCxhL836-CvFbHxY3.js";import{C as fa,a as oo,W as so,p as Wt,y as io,j as lo,f as pr,g as co,M as po,P as uo,A as fo}from"./SchemaView-CRl_cQYH-C2m4p64X.js";import"./circular-wJaV4vh_-B-DtfxOE.js";/** 2 * @license lucide-react v0.488.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ho=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],mo=Qn("fold-vertical",ho);/** 7 * @license lucide-react v0.488.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const yo=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],bo=Qn("unfold-vertical",yo),go=Aa;function vo(e,r){return r}const Ge=({value:e,onChange:r,className:t,options:a,showChevrons:p=!0})=>v.jsxs("div",{className:"grid",children:[v.jsx("select",{className:de("w-full row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6","rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",t),value:e,onChange:r,children:a.map(i=>v.jsx("option",{value:i.value,children:i.label},i.value))}),v.jsx("div",{className:de(!p&&"hidden","row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none"),children:v.jsx(fa,{size:14})})]}),xo=He(` 12 query ServersQuery($input: JSON!, $type: SchemaType!) { 13 schema(input: $input, type: $type) { 14 url 15 servers { 16 url 17 } 18 } 19 } 20`),ur=({url:e})=>{const[r,t]=se.useState(!1);return v.jsx(sa,{onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),2e3)})},variant:"ghost",size:"icon",children:r?v.jsx(Ba,{className:"text-green-600",size:14}):v.jsx(za,{size:14,strokeWidth:1.3})})},jo=()=>{const{input:e,type:r}=Qe(),t=Je(xo,{input:e,type:r}),a=zt(t),[,p]=se.useTransition(),{selectedServer:i,setSelectedServer:n}=Jt(a.data.schema.servers),{servers:o}=a.data.schema;if(o.length===0)return null;const s=o.at(0);return o.length===1?v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-medium text-sm",children:"Endpoint:"}),v.jsx(Fa,{className:"text-xs px-2 py-1.5",selectOnClick:!0,children:s.url}),v.jsx(ur,{url:s.url})]}):v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"font-medium text-sm",children:"Endpoint"}),v.jsx(Ge,{className:"font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate",onChange:c=>p(()=>n(c.target.value)),value:i,showChevrons:o.length>1,options:o.map(c=>({value:c.url,label:c.url}))}),v.jsx(ur,{url:i})]})},$o=Ja("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",muted:"bg-muted text-muted-foreground ",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function dr({className:e,variant:r,...t}){return v.jsx("div",{className:de($o({variant:r}),e),...t})}const fr=(e,r)=>e?r(e):void 0,Oo=e=>e.schema!=null&&typeof e.schema=="object"?e.schema:{type:"string"},wo=({parameter:e,group:r,id:t})=>{const a=Oo(e),[p,i]=se.useState(!1);return v.jsxs("li",{className:"p-4 bg-border/20 text-sm flex flex-col gap-1.5",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(oa,{asChild:!0,children:v.jsx("code",{children:r==="path"?v.jsx(ua,{name:e.name,backgroundOpacity:"15%",className:"px-2",slug:`${t}-${e.name}`}):e.name})}),v.jsx(lo,{schema:a,extraItems:[e.required&&v.jsx("span",{className:"text-primary",children:"required"}),e.style&&`style: ${e.style}`,e.explode&&`explode: ${e.explode}`]})]}),e.description&&v.jsx(We,{content:e.description,className:"text-sm prose-p:my-1 prose-code:whitespace-pre-line"}),a.type==="array"&&a.items.enum?v.jsx(pr,{values:a.items.enum}):a.enum&&v.jsx(pr,{values:a.enum}),v.jsx(co,{schema:a}),(a.type==="object"||io(a))&&v.jsxs(Ya,{defaultOpen:!1,onOpenChange:i,open:p,children:[v.jsx(Xa,{asChild:!0,children:v.jsxs(sa,{variant:"expand",size:"sm",children:[p?v.jsx(po,{size:12}):v.jsx(uo,{size:12}),p?"Hide properties":"Show properties"]})}),v.jsx(Za,{children:v.jsx("div",{className:"mt-2",children:v.jsx(Wt,{schema:"items"in a?a.items:a})})})]})]})},So=({summary:e,group:r,parameters:t,id:a})=>v.jsxs(v.Fragment,{children:[v.jsxs(Ae,{level:3,id:`${a}/${r}-parameters`,className:"capitalize",children:[e&&v.jsxs(Mt,{children:[e," ⺠"]}),r==="header"?"Headers":`${r} Parameters`]}),v.jsx(Wa,{children:v.jsx("ul",{className:"list-none m-0 px-0 divide-y ",children:t.sort((p,i)=>p.required===i.required?0:p.required?-1:1).map(p=>v.jsx(wo,{parameter:p,id:a,group:r},`${p.name}-${p.in}`))})})]}),ko=({rootMargin:e="0px",threshold:r,root:t}={})=>{const[a,p]=se.useState(!1),i=se.useRef(null);return se.useEffect(()=>{const n=new IntersectionObserver(([s])=>{s&&p(s.isIntersecting)},{rootMargin:e,threshold:r,root:t}),o=i.current;if(o)return n.observe(o),()=>n.unobserve(o)},[t,e,r]),[i,a]},To=typeof window<"u"?se.useLayoutEffect:se.useEffect,ha=({children:e,maxHeight:r=250})=>{const t=se.useRef(null),[a,p]=se.useState(!1),[i,n]=se.useState(!1);return To(()=>{const o=t.current;if(!o)return;p(o.scrollHeight>r);const s=new ResizeObserver(()=>{p(o.scrollHeight>r)});return s.observe(o),()=>s.disconnect()},[r]),v.jsxs(Yn,{className:"group",open:i,onOpenChange:n,style:{"--max-height":`${r}px`},children:[v.jsxs(na,{forceMount:!0,className:de("relative overflow-hidden group",!i&&a&&"max-h-(--max-height)"),
20children:[!i&&a&&v.jsx("div",{className:" absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/60 dark:to-zinc-950/90 z-10 transition-all group-hover:to-transparent"}),v.jsx("div",{ref:t,children:e}),!i&&a&&v.jsx(Lt,{className:"absolute inset-0 grid place-items-center z-10 cursor-pointer peer",asChild:!0,children:v.jsx("div",{children:v.jsxs(cr,{variant:"outline",className:"hidden group-hover:flex",children:[v.jsx(bo,{size:14,className:"me-1.5"}),"Click to expand"]})})})]}),a&&v.jsx("div",{className:de("flex justify-center w-full py-2 bg-muted/50",!i&&"hidden"),children:v.jsx(Lt,{asChild:!0,children:v.jsxs(cr,{variant:"outline",size:"sm",children:["Collapse",v.jsx(mo,{size:14,className:"ms-1.5"})]})})})]})},No=({server:e,servers:r,operation:t,examples:a})=>{const{isAuthEnabled:p,login:i,signup:n,isPending:o,isAuthenticated:s}=eo(),c=t.parameters?.filter(l=>l.in==="header").sort((l,j)=>l.required&&!j.required?-1:1).map(l=>({name:l.name,defaultValue:l.schema?.default??l.examples?.find(j=>j.value)?.value??"",defaultActive:l.required??!1,isRequired:l.required??!1,enum:l.schema?.type=="array"?l.schema?.items?.enum:l.schema?.enum,type:l.schema?.type??"string"})),d=t.parameters?.filter(l=>l.in==="query").sort((l,j)=>l.required&&!j.required?-1:1).map(l=>({name:l.name,defaultActive:l.required??!1,isRequired:l.required??!1,enum:l.schema?.type=="array"?l.schema?.items?.enum:l.schema?.enum,type:l.schema?.type??"string",defaultValue:l.schema?.default})),f=t.parameters?.filter(l=>l.in==="path").map(l=>({name:l.name,defaultValue:l.schema?.default}));return v.jsx(to,{server:e,servers:r,method:t.method,url:t.path,headers:c,queryParams:d,pathParams:f,examples:a,requiresLogin:p&&!s&&!o,onLogin:()=>i(),onSignUp:()=>n()})},Vt=({children:e,className:r})=>v.jsx("div",{className:de("rounded-xl overflow-hidden border border-border",r),children:e}),Gt=({children:e,className:r})=>v.jsx("div",{className:de("border-b bg-muted dark:bg-transparent text-card-foreground p-3 py-2.5",r),children:e}),ma=({children:e,className:r})=>v.jsx("div",{className:de("bg-card overflow-auto p-2",r),children:e}),ya=({children:e,className:r})=>v.jsx("div",{className:de("border-t bg-muted dark:bg-transparent p-3",r),children:e}),$e=(e,r)=>{if(!e||fo(e))return null;if(e.example!==void 0)return e.example;if(e.examples&&typeof e.examples=="object"&&"default"in e.examples){const t=e.examples.default;if(t!==null)return typeof t=="object"&&"value"in t?t.value:t}if(e.const!==void 0)return e.const;if(e.type==="object"&&e.properties){const t={};for(const[a,p]of Object.entries(e.properties))typeof p=="object"&&(t[a]=$e(p,a));return t}if(e.type==="array")return Array.isArray(e.items)?e.items.map(t=>$e(t)):e.items?[$e(e.items)]:[];if(e.format!==void 0)switch(e.format){case"date-time":return"2024-08-25T15:00:00Z";case"date":return"2024-08-25";case"time":return"15:00:00";case"email":return"[email protected]";case"uri":return"https://www.example.com/path/to/resource";case"uri-reference":return"/path/to/resource";case"uuid":return"00000000-0000-0000-0000-000000000000"}if(e.enum)return e.enum[0];if(e.oneOf){const t=Math.floor(Math.random()*e.oneOf.length);return $e(e.oneOf[t])}if(e.anyOf){const t=Math.floor(Math.random()*e.anyOf.length);return $e(e.anyOf[t])}if(e.allOf)return e.allOf.reduce((t,a)=>({...t,...$e(a)}),{});switch(e.type){case"string":return r||"string";case"number":case"integer":return 0;case"boolean":return!0;case"null":return null;case"object":return{};case void 0:default:return{}}},Co=e=>e==null?"No example":typeof e=="string"?e.trim():JSON.stringify(e,null,2),Po=e=>e?e.endsWith("+json")?"json":e.endsWith("+xml")?"xml":e.endsWith("+yaml")?"yaml":{"text/html":"html","application/x-ndjson":"json","application/json":"json","application/xml":"xml","application/x-yaml":"yaml","text/csv":"csv","application/javascript":"javascript","application/graphql":"graphql"}[e]??"plain":"plain",ba=({content:e,description:r,onExampleChange:t})=>{const[a,p]=se.useState(0),[i,n]=se.useState(0),o=Array.isArray(e)&&e.length===1?e[0]:e[a],s=o?.examples??[],c=s[i],d=se.useMemo(()=>{if(c)return"value"in c?c.value:c;if(o?.schema)return $e(o.schema)}
20,[c,o?.schema]);se.useEffect(()=>{d&&t?.(d)},[d,t]);const f=Co(d),l=Po(o?.mediaType);return v.jsxs(v.Fragment,{children:[v.jsxs(ma,{className:"p-0",children:[c?.externalValue?v.jsx("div",{className:"p-2",children:v.jsx("a",{href:c.externalValue,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline",children:"View External Example â"})}):v.jsx(ha,{children:v.jsx(da,{language:l,noBackground:!0,className:"[--scrollbar-color:gray] rounded-none text-xs max-h-[500px] p-2",code:f})}),c?.description&&v.jsx("div",{className:"border-t text-xs px-3 py-1.5 text-muted-foreground",children:c.description})]}),v.jsxs(ya,{className:"text-xs p-0 divide-y divide-border",children:[r&&v.jsx("div",{className:"text-muted-foreground text-xs px-3 py-2",children:r}),(s.length!==0||e.length!==0)&&v.jsxs("div",{className:"flex items-center gap-2 justify-between min-w-0 px-3 py-2",children:[v.jsx("div",{className:"flex items-center gap-2 min-w-0",children:e.length>1?v.jsx(Ge,{className:"max-w-[200px]",value:a.toString(),onChange:j=>p(Number(j.target.value)),options:e.map((j,x)=>({value:x.toString(),label:j.mediaType}))}):v.jsx("span",{className:"font-mono text-[11px]",children:e[0]?.mediaType})}),s.length>1&&v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Ge,{className:"max-w-[180px]",value:i.toString(),onChange:j=>n(Number(j.target.value)),options:s.map((j,x)=>({value:x.toString(),label:j.summary||j.name||j.description||`Example ${x+1}`}))})})]})]})]})},qo=({content:e,onExampleChange:r})=>e.length===0?null:v.jsxs(Vt,{children:[v.jsx(Gt,{className:"text-xs flex justify-between items-center",children:v.jsx("span",{className:"font-mono",children:"Request Body Example"})}),v.jsx(ba,{content:e,onExampleChange:r})]}),Ro=({responses:e,selectedResponse:r,onSelectResponse:t})=>v.jsx(Vt,{children:v.jsxs(ca,{defaultValue:e[0]?.statusCode,value:r,onValueChange:a=>t(a),children:[v.jsxs(Gt,{className:"text-xs flex flex-col gap-2 pb-0",children:[v.jsx("span",{className:"font-mono",children:"Example Responses"}),v.jsx(ia,{className:"flex gap-2",children:e.map(a=>v.jsx(la,{value:a.statusCode,className:de("text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer","data-[state=active]:text-primary data-[state=active]:dark:text-inherit data-[state=active]:border-primary","hover:border-accent-foreground/25"),children:a.statusCode},a.statusCode))})]}),e.map(a=>v.jsx(pa,{value:a.statusCode,children:v.jsx(ba,{content:a.content??[]})},a.statusCode))]})});var hr=(e,r)=>{const t=e[r.name];return t===void 0?(e[r.name]=r.value,e):Array.isArray(t)?(t.push(r.value),e):(e[r.name]=[t,r.value],e)},mr="",yr=` 21`,V=class{constructor({indent:e,join:r}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=mr,this.lineJoin=yr,this.indentLine=(t,a=0)=>`${this.indentationCharacter.repeat(a)}${t}`,this.unshift=(t,a)=>{const p=this.indentLine(t,a);this.code.unshift(p)},this.push=(t,a)=>{const p=this.indentLine(t,a);this.code.push(p)},this.blank=()=>{this.code.push("")},this.join=()=>{const t=this.code.join(this.lineJoin);return this.postProcessors.reduce((a,p)=>p(a),t)},this.addPostProcessor=t=>{this.postProcessors=[...this.postProcessors,t]},this.indentationCharacter=e||mr,this.lineJoin=r??yr}},br,gr;function Eo(){return gr||(gr=1,br=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"}),br}var vr,xr;function Ao(){return xr||(xr=1,vr=function(e){var r=typeof e;return e!==null&&(r==="object"||r==="function")}),vr}var ct={},jr;function Uo(){return jr||(jr=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.default=e=>Object.getOwnPropertySymbols(e).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r))),ct}var pt,$r;function Do(){if($r)return pt;$r=1;const e=Eo(),r=Ao(),t=Uo().default;return pt=(a,p,i)=>{const n=[];return(function o(s,c,d){c=c||{},c.indent=c.indent||" ",d=d||"";let f;c.inlineCharacterLimit===void 0?f={newLine:` 22`,newLineOrSpace:` 23`,pad:d,indent:d+c.indent}:f={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const l=j=>{if(c.inlineCharacterLimit===void 0)return j;const x=j.replace(new RegExp(f.newLine,"g"),"").replace(new RegExp(f.newLineOrSpace,"g")," ").replace(new RegExp(f.pad+"|"+f.indent,"g"),"");return x.length<=c.inlineCharacterLimit?x:j.replace(new RegExp(f.newLine+"|"+f.newLineOrSpace,"g"),` 24`).replace(new RegExp(f.pad,"g"),d).replace(new RegExp(f.indent,"g"),d+c.indent)}
24;if(n.indexOf(s)!==-1)return'"[Circular]"';if(s==null||typeof s=="number"||typeof s=="boolean"||typeof s=="function"||typeof s=="symbol"||e(s))return String(s);if(s instanceof Date)return`new Date('${s.toISOString()}')`;if(Array.isArray(s)){if(s.length===0)return"[]";n.push(s);const j="["+f.newLine+s.map((x,u)=>{const m=s.length-1===u?f.newLine:","+f.newLineOrSpace;let b=o(x,c,d+c.indent);return c.transform&&(b=c.transform(s,u,b)),f.indent+b+m}).join("")+f.pad+"]";return n.pop(),l(j)}if(r(s)){let j=Object.keys(s).concat(t(s));if(c.filter&&(j=j.filter(u=>c.filter(s,u))),j.length===0)return"{}";n.push(s);const x="{"+f.newLine+j.map((u,m)=>{const b=j.length-1===m?f.newLine:","+f.newLineOrSpace,g=typeof u=="symbol",O=!g&&/^[a-z$_][a-z$_0-9]*$/i.test(u),k=g||O?u:o(u,c);let h=o(s[u],c,d+c.indent);return c.transform&&(h=c.transform(s,u,h)),f.indent+String(k)+": "+h+b}).join("")+f.pad+"}";return n.pop(),l(x)}return s=String(s).replace(/[\r\n]/g,j=>j===` 25`?"\\n":"\\r"),c.singleQuotes===!1?(s=s.replace(/"/g,'\\"'),`"${s}"`):(s=s.replace(/\\?'/g,"\\'"),`'${s}'`)})(a,p,i)},pt}var Ho=Do();const pe=ro(Ho);function Ue(e,r={}){const{delimiter:t='"',escapeChar:a="\\",escapeNewlines:p=!0}=r;return[...e.toString()].map(i=>i==="\b"?`${a}b`:i===" "?`${a}t`:i===` 26`?p?`${a}n`:i:i==="\f"?`${a}f`:i==="\r"?p?`${a}r`:i:i===a?a+a:i===t?a+t:i<" "||i>"~"?JSON.stringify(i).slice(1,-1):i).join("")}var De=e=>Ue(e,{delimiter:"'"}),le=e=>Ue(e,{delimiter:'"'}),_o={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:r,headersObj:t,allHeaders:a,postData:p})=>{const{push:i,blank:n,join:o}=new V;i("CURL *hnd = curl_easy_init();"),n(),i(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`),i("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"),i(`curl_easy_setopt(hnd, CURLOPT_URL, "${r}");`);const s=Object.keys(t);return s.length&&(n(),i("struct curl_slist *headers = NULL;"),s.forEach(c=>{i(`headers = curl_slist_append(headers, "${c}: ${le(t[c])}");`)}),i("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")),a.cookie&&(n(),i(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${a.cookie}");`)),p.text&&(n(),i(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(p.text)});`)),n(),i("CURLcode ret = curl_easy_perform(hnd);"),o()}},Lo={info:{key:"c",title:"C",default:"libcurl",cli:"c"},clientsById:{libcurl:_o}},ue=(e,r)=>Object.keys(e).find(t=>t.toLowerCase()===r.toLowerCase()),ge=(e,r)=>{const t=ue(e,r);if(t)return e[t]},Ye=(e,r)=>!!ue(e,r),Io=e=>["application/json","application/x-json","text/json","text/x-json","+json"].some(r=>e.indexOf(r)>-1),Or=class{constructor(e){this.name="",this.toString=()=>`:${this.name}`,this.name=e}},Mo=class{constructor(e){this.path="",this.toString=()=>`(clojure.java.io/file "${this.path}")`,this.path=e}},ga=e=>e===void 0?null:e===null?"null":e.constructor.name.toLowerCase(),va=e=>e===void 0?!0:ga(e)==="object"?Object.keys(e).length===0:!1,wr=e=>(Object.keys(e).filter(r=>va(e[r])).forEach(r=>{delete e[r]}),e),Be=(e,r)=>{const t=" ".repeat(e);return r.replace(/\n/g,` 27${t}`)},Ft=e=>{switch(ga(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 r=Object.keys(e).reduce((t,a)=>{const p=Be(a.length+2,Ft(e[a]));return`${t}:${a} ${p} 28 `},"").trim();return`{${Be(1,r)}}`}case"array":{const r=e.reduce((t,a)=>`${t} ${Ft(a)}`,"").trim();return`[${Be(1,r)}]`}default:return e.toString()}},Fo={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:r,postData:t,url:a,allHeaders:p},i)=>{const{push:n,join:o}=new V({indent:i?.indent}),s=["get","post","put","delete","patch","head","options"];if(r=r.toLowerCase(),!s.includes(r))return n("Method not supported"),o();const c={headers:p,"query-params":e};switch(t.mimeType){case"application/json":{c["content-type"]=new Or("json"),c["form-params"]=t.jsonObj;const d=ue(c.headers,"content-type");d&&delete c.headers[d]}break;case"application/x-www-form-urlencoded":{c["form-params"]=t.paramsObj;const d=ue(c.headers,"content-type");d&&delete c.headers[d]}break;case"text/plain":{c.body=t.text;const d=ue(c.headers,"content-type");d&&delete c.headers[d]}break;case"multipart/form-data":{if(t.params){c.multipart=t.params.map(f=>f.fileName&&!f.value?{name:f.name,content:new Mo(f.fileName)}:{name:f.name,content:f.value});const d=ue(c.headers,"content-type");d&&delete c.headers[d]}break}}switch(ge(c.headers,"accept")){case"application/json":{c.accept=new Or("json");const d=ue(c.headers,"accept");d&&delete c.headers[d]}break}if(n(`(require '[clj-http.client :as client]) 29`),va(wr(c)))n(`(client/${r} "${a}")`);else{const d=11+r.length+a.length,f=Be(d,Ft(wr(c)));n(`(client/${r} "${a}" ${f})`)}return o()}},Bo={info:{key:"clojure",title:"Clojure",default:"clj_http"},clientsById:{clj_http:Fo}},zo=e=>{let r=ge(e,"accept-encoding");if(!r)return[];const t={gzip:"DecompressionMethods.GZip",deflate:"DecompressionMethods.Deflate"},a=[];return typeof r=="string"&&(r=[r]),r.forEach(p=>{p.split(",").forEach(i=>
29{const n=/\s*([^;\s]+)/.exec(i);if(n){const o=t[n[1]];o&&a.push(o)}})}),a},Jo={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:r,method:t,fullUrl:a},p)=>{const i={indent:" ",...p},{push:n,join:o}=new V({indent:i.indent});n("using System.Net.Http.Headers;");let s="";const c=!!e.cookie,d=zo(e);(c||d.length)&&(s="clientHandler",n("var clientHandler = new HttpClientHandler"),n("{"),c&&n("UseCookies = false,",1),d.length&&n(`AutomaticDecompression = ${d.join(" | ")},`,1),n("};")),n(`var client = new HttpClient(${s});`),n("var request = new HttpRequestMessage"),n("{");const f=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"];t=t.toUpperCase(),t&&f.includes(t)?t=`HttpMethod.${t[0]}${t.substring(1).toLowerCase()}`:t=`new HttpMethod("${t}")`,n(`Method = ${t},`,1),n(`RequestUri = new Uri("${a}"),`,1);const l=Object.keys(e).filter(j=>{switch(j.toLowerCase()){case"content-type":case"content-length":case"accept-encoding":return!1;default:return!0}});if(l.length&&(n("Headers =",1),n("{",1),l.forEach(j=>{n(`{ "${j}", "${le(e[j])}" },`,2)}),n("},",1)),r.text){const j=r.mimeType;switch(j){case"application/x-www-form-urlencoded":n("Content = new FormUrlEncodedContent(new Dictionary<string, string>",1),n("{",1),r.params?.forEach(x=>{n(`{ "${x.name}", "${x.value}" },`,2)}),n("}),",1);break;case"multipart/form-data":n("Content = new MultipartFormDataContent",1),n("{",1),r.params?.forEach(x=>{n(`new StringContent(${JSON.stringify(x.value||"")})`,2),n("{",2),n("Headers =",3),n("{",3),x.contentType&&n(`ContentType = new MediaTypeHeaderValue("${x.contentType}"),`,4),n('ContentDisposition = new ContentDispositionHeaderValue("form-data")',4),n("{",4),n(`Name = "${x.name}",`,5),x.fileName&&n(`FileName = "${x.fileName}",`,5),n("}",4),n("}",3),n("},",2)}),n("},",1);break;default:n(`Content = new StringContent(${JSON.stringify(r.text||"")})`,1),n("{",1),n("Headers =",2),n("{",2),n(`ContentType = new MediaTypeHeaderValue("${j}")`,3),n("}",2),n("}",1);break}}return n("};"),n("using (var response = await client.SendAsync(request))"),n("{"),n("response.EnsureSuccessStatusCode();",1),n("var body = await response.Content.ReadAsStringAsync();",1),n("Console.WriteLine(body);",1),n("}"),o()}};function Wo(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()}var Vo={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:r,headersObj:t,cookies:a,postData:p,uriObj:i})=>{const{push:n,join:o}=new V;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase()))return"Method not supported";n(`using RestSharp; 30 31`),n(`var options = new RestClientOptions("${r}");`),n("var client = new RestClient(options);"),n('var request = new RestRequest("");');const s=p.mimeType&&p.mimeType==="multipart/form-data";switch(s&&n("request.AlwaysMultipartFormData = true;"),Object.keys(t).forEach(c=>{if(p.mimeType&&c.toLowerCase()==="content-type"&&p.text){s&&p.boundary&&n(`request.FormBoundary = "${p.boundary}";`);return}n(`request.AddHeader("${c}", "${le(t[c])}");`)}),a.forEach(({name:c,value:d})=>{n(`request.AddCookie("${c}", "${le(d)}", "${i.pathname}", "${i.host}");`)}),p.mimeType){case"multipart/form-data":if(!p.params)break;p.params.forEach(c=>{c.fileName?n(`request.AddFile("${c.name}", "${c.fileName}");`):n(`request.AddParameter("${c.name}", "${c.value}");`)});break;case"application/x-www-form-urlencoded":if(!p.params)break;p.params.forEach(c=>{n(`request.AddParameter("${c.name}", "${c.value}");`)});break;case"application/json":{if(!p.text)break;const c=JSON.stringify(p.text);n(`request.AddJsonBody(${c}, false);`);break}default:if(!p.text)break;n(`request.AddStringBody("${p.text}", "${p.mimeType}");`)}return n(`var response = await client.${Wo(e)}Async(request); 32`),n(`Console.WriteLine("{0}", response.Content); 33`),o()}},Go={info:{key:"csharp",title:"C#",default:"restsharp",cli:"dotnet"},clientsById:{httpclient:Jo,restsharp:Vo}},Ko={info:{key:"native",title:"NewRequest",link:"http://golang.org/pkg/net/http/#NewRequest",description:"Golang HTTP client request",extname:".go"},convert:({postData:e,method:r,allHeaders:t,fullUrl:a},p={})=>{const{blank:i,push:n,join:o}=new V({indent:" "}),{showBoilerplate:s=!0,checkErrors:c=!1,printBody:d=!0,timeout:f=-1}=p,l=c?"err":"_",j=s?1:0,x=()=>{c&&(n("if err != nil {",j),n("panic(err)",j+1),n("}",j))};s&&(n("package main"),i(),n("import ("),n('"fmt"',j),f>0&&n('"time"',j),e.text&&n('"strings"',j),n('"net/http"',j),d&&n('"io"',j),n(")"),i(),n("func main() {"),i());const u=f>0,m=u,b=m?"client":"http.DefaultClient";return m&&(n("client := http.Client{",j),u&&n(`Timeout: time.Duration(${f} * time.Second),`,j+1),n("}",j),i()),n(`url := "${a}"`,j),i(),e.text?(n(`payload := strings.NewReader(${JSON.stringify(e.text)})`,j),i(),n(`req, ${l} := http.NewRequest("${r}", url, payload)`,j),i()):(n(`req, ${l} := http.NewRequest("${r}
33", url, nil)`,j),i()),x(),Object.keys(t).length&&(Object.keys(t).forEach(g=>{n(`req.Header.Add("${g}", "${le(t[g])}")`,j)}),i()),n(`res, ${l} := ${b}.Do(req)`,j),x(),d&&(i(),n("defer res.Body.Close()",j),n(`body, ${l} := io.ReadAll(res.Body)`,j),x()),i(),d&&n("fmt.Println(string(body))",j),s&&(i(),n("}")),o()}},Qo={info:{key:"go",title:"Go",default:"native",cli:"go"},clientsById:{native:Ko}},Sr=`\r 34`,Yo={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:r,uriObj:t,httpVersion:a,allHeaders:p,postData:i},n)=>{const o={absoluteURI:!1,autoContentLength:!0,autoHost:!0,...n},{blank:s,push:c,join:d}=new V({indent:"",join:Sr}),f=o.absoluteURI?r:t.path;c(`${e} ${f} ${a}`);const l=Object.keys(p);if(l.forEach(u=>{const m=u.toLowerCase().replace(/(^|-)(\w)/g,b=>b.toUpperCase());c(`${m}: ${p[u]}`)}),o.autoHost&&!l.includes("host")&&c(`Host: ${t.host}`),o.autoContentLength&&i.text&&!l.includes("content-length")){const u=new TextEncoder().encode(i.text).length.toString();c(`Content-Length: ${u}`)}s();const j=d(),x=i.text||"";return`${j}${Sr}${x}`}},Xo={info:{key:"http",title:"HTTP",default:"http1.1"},clientsById:{"http1.1":Yo}},Zo={info:{key:"asynchttp",title:"AsyncHttp",link:"https://github.com/AsyncHttpCl
34ient/async-http-client",description:"Asynchronous Http and WebSocket Client library for Java",extname:".java"},convert:({method:e,allHeaders:r,postData:t,fullUrl:a},p)=>{const i={indent:" ",...p},{blank:n,push:o,join:s}=new V({indent:i.indent});return o("AsyncHttpClient client = new DefaultAsyncHttpClient();"),o(`client.prepare("${e.toUpperCase()}", "${a}")`),Object.keys(r).forEach(c=>{o(`.setHeader("${c}", "${le(r[c])}")`,1)}),t.text&&o(`.setBody(${JSON.stringify(t.text)})`,1),o(".execute()",1),o(".toCompletableFuture()",1),o(".thenAccept(System.out::println)",1),o(".join();",1),n(),o("client.close();"),s()}},es={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:r,method:t,postData:a},p)=>{const i={indent:" ",...p},{push:n,join:o}=new V({indent:i.indent});return n("HttpRequest request = HttpRequest.newBuilder()"),n(`.uri(URI.create("${r}"))`,2),Object.keys(e).forEach(s=>{n(`.header("${s}", "${le(e[s])}")`,2)}),a.text?n(`.method("${t.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(a.text)}))`,2):n(`.method("${t.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`,2),n(".build();",2),n("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyH
34andlers.ofString());"),n("System.out.println(response.body());"),o()}},ts={info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".java"},convert:({postData:e,method:r,fullUrl:t,allHeaders:a},p)=>{const i={indent:" ",...p},{push:n,blank:o,join:s}=new V({indent:i.indent}),c=["GET","POST","PUT","DELETE","PATCH","HEAD"],d=["POST","PUT","DELETE","PATCH"];return n("OkHttpClient client = new OkHttpClient();"),o(),e.text&&(e.boundary?n(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`):n(`MediaType mediaType = MediaType.parse("${e.mimeType}");`),n(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)),n("Request request = new Request.Builder()"),n(`.url("${t}")`,1),c.includes(r.toUpperCase())?d.includes(r.toUpperCase())?e.text?n(`.${r.toLowerCase()}(body)`,1):n(`.${r.toLowerCase()}(null)`,1):n(`.${r.toLowerCase()}()`,1):e.text?n(`.method("${r.toUpperCase()}", body)`,1):n(`.method("${r.toUpperCase()}", null)`,1),Object.keys(a).forEach(f=>{n(`.addHeader("${f}", "${le(a[f])}")`,1)}),n(".build();",1),o(),n("Response response = client.newCall(request).execute();"),s()}},rs={info:{key:"unirest",title:"Unirest",link:"http://unirest.io/java.html",description:"Lightweight HTTP Request Client Library",extname:".java"},convert:({method:e,allHeaders:r,postData:t,fullUrl:a},p)=>{const i={indent:" ",...p},{join:n,push:o}=new V({indent:i.indent});return["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase())?o(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${a}")`):o(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${a}")`),Object.keys(r).forEach(s=>{o(`.header("${s}", "${le(r[s])}")`,1)}),t.text&&o(`.body(${JSON.stringify(t.text)})`,1),o(".asString();",1),n()}},ns={info:{key:"java",title:"Java",default:"unirest"},clientsById:{asynchttp:Zo,nethttp:es,okhttp:ts,unirest:rs}},as={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:r,url:t,queryObj:a,postData:p},i)=>{const n={indent:" ",...i},{blank:o,push:s,join:c,addPostProcessor:d}=new V({indent:n.indent});s("import axios from 'axios';"),o();const f={method:r,url:t};switch(Object.keys(a).length&&(f.params=a),Object.keys(e).length&&(f.headers=e),p.mimeType){case"application/x-www-form-urlencoded":p.params&&(s("const encodedParams = new URLSearchParams();"),p.params.forEach(j=>{s(`encodedParams.set('${j.name}', '${j.value}');`)}),o(),f.data="encodedParams,",d(j=>j.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":p.jsonObj&&(f.data=p.jsonObj);break;case"multipart/form-data":if(!p.params)break;s("const form = new FormData();"),p.params.forEach(j=>{s(`form.append('${j.name}', '${j.value||j.fileName||""}');`)}),o(),f.data="[form]";break;default:p.text&&(f.data=p.text)}const l=pe(f,{indent:" ",inlineCharacterLimit:80}).replace('"[form]"',"form");return s(`const options = ${l};`),o(),s("axios"),s(".request(options)",1),s(".then(function (response) {",1),s("console.log(response.data);",2),s("})",1),s(".catch(function (error) {",1),s("console.error(error);",2),s("});",1),c()}},os={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:r,postData:t,fullUrl:a},p)=>{const i={indent:" ",credentials:null,...p},{blank:n,join:o,push:s}=new V({indent:i.indent}),c={method:e};switch(Object.keys(r).length&&(c.headers=r),i.credentials!==null&&(c.credentials=i.credentials),t.mimeType){case"application/x-www-form-urlencoded":c.body=t.paramsObj?t.paramsObj:t.text;break;case"application/json":t.jsonObj&&(c.body=t.jsonObj);break;case"multipart/form-data":if(!t.params)break;const d=ue(r,"content-type");d&&delete r[d],s("const form = new FormData();
34"),t.params.forEach(f=>{s(`form.append('${f.name}', '${f.value||f.fileName||""}');`)}),n();break;default:t.text&&(c.body=t.text)}return c.headers&&!Object.keys(c.headers).length&&delete c.headers,s(`const options = ${pe(c,{indent:i.indent,inlineCharacterLimit:80,transform:(d,f,l)=>{if(f==="body"){if(t.mimeType==="application/x-www-form-urlencoded")return`new URLSearchParams(${l})`;if(t.mimeType==="application/json")return`JSON.stringify(${l})`}return l}})};`),n(),t.params&&t.mimeType==="multipart/form-data"&&(s("options.body = form;"),n()),s(`fetch('${a}', options)`),s(".then(response => response.json())",1),s(".then(response => console.log(response))",1),s(".catch(err => console.error(err));",1),o()}},ss={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:r,allHeaders:t,postData:a},p)=>{const i={indent:" ",...p},{blank:n,push:o,join:s}=new V({indent:i.indent}),c={async:!0,crossDomain:!0,url:e,method:r,headers:t};switch(a.mimeType){case"application/x-www-form-urlencoded":c.data=a.paramsObj?a.paramsObj:a.text;break;case"application/json":c.processData=!1,c.data=a.text;break;case"multipart/form-data":if(!a.params)break;if(o("const form = new FormData();"),a.params.forEach(f=>{o(`form.append('${f.name}', '${f.value||f.fileName||""}');`)}),c.processData=!1,c.contentType=!1,c.mimeType="multipart/form-data",c.data="[form]",Ye(t,"content-type")&&ge(t,"content-type")?.includes("boundary")){const f=ue(t,"content-type");f&&delete c.headers[f]}n();break;default:a.text&&(c.data=a.text)}const d=pe(c,{indent:i.indent}).replace("'[form]'","form");return o(`const settings = ${d};`),n(),o("$.ajax(settings).done(function (response) {"),o("console.log(response);",1),o("});"),s()}},is={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:r,method:t,fullUrl:a},p)=>{const i={indent:" ",cors:!0,...p},{blank:n,push:o,join:s}=new V({indent:i.indent});switch(e.mimeType){case"application/json":o(`const data = JSON.stringify(${pe(e.jsonObj,{indent:i.indent})});`),n();break;case"multipart/form-data":if(!e.params)break;if(o("const data = new FormData();"),e.params.forEach(c=>{o(`data.append('${c.name}', '${c.value||c.fileName||""}');`)}),Ye(r,"content-type")&&ge(r,"content-type")?.includes("boundary")){const c=ue(r,"content-type");c&&delete r[c]}n();break;default:o(`const data = ${e.text?`'${e.text}'`:"null"};`),n()}return o("const xhr = new XMLHttpRequest();"),i.cors&&o("xhr.withCredentials = true;"),n(),o("xhr.addEventListener('readystatechange', function () {"),o("if (this.readyState === this.DONE) {",1),o("console.log(this.responseText);",2),o("}",1),o("});"),n(),o(`xhr.open('${t}', '${a}');`),Object.keys(r).forEach(c=>{o(`xhr.setRequestHeader('${c}', '${De(r[c])}');`)}),n(),o("xhr.send(data);"),s()}},ls={info:{key:"javascript",title:"JavaScript",default:"xhr"},clientsById:{xhr:is,axios:as,fetch:os,jquery:ss}},cs={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},r)=>{const t={indent:" ",...r};let a="";switch(e.mimeType){case"application/x-www-form-urlencoded":a=e.paramsObj?e.paramsObj:e.text;break;case"application/json":e.jsonObj&&(a=e.jsonObj);break;case"multipart/form-data":if(!e.params)break;const p={};e.params.forEach(i=>{p[i.name]=i.value}),a=p;break;default:e.text&&(a=e.text)}return typeof a>"u"||a===""?"No JSON body":JSON.stringify(a,null,t.indent)}},ps={info:{key:"json",title:"JSON",default:"native"},clientsById:{native:cs}},us={info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".kt"},convert:({postData:e,fullUrl:r,method:t,allHeaders:a},p)=>{const i={indent:" ",...p},{blank:n,join:o,push:s}=new V({indent:i.indent}),c=["GET","POST","PUT","DELETE","PATCH","HEAD"],d=["POST","PUT","DELETE","PATCH"];return s("val client = OkHttpClient()"),n(),e.text&&(e.boundary?s(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`):s(`val mediaType = MediaType.parse("${e.mimeType}")`),s(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)),s("val request = Request.Builder()"),s(`.url("${r}")`,1),c.includes(t.toUpperCase())?d.includes(t.toUpperCase())?e.text?s(`.${t.toLowerCase()}(body)`,1):s(`.${t.toLowerCase()}(null)`,1):s(`.${t.toLowerCase()}()`,1):e.text?s(`.method("${t.toUpperCase()}", body)`,1):s(`.method("${t.toUpperCase()}
34", null)`,1),Object.keys(a).forEach(f=>{s(`.addHeader("${f}", "${le(a[f])}")`,1)}),s(".build()",1),n(),s("val response = client.newCall(request).execute()"),o()}},ds={info:{key:"kotlin",title:"Kotlin",default:"okhttp"},clientsById:{okhttp:us}},fs={info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".cjs",installation:"npm install axios --save"},convert:({method:e,fullUrl:r,allHeaders:t,postData:a},p)=>{const i={indent:" ",...p},{blank:n,join:o,push:s,addPostProcessor:c}=new V({indent:i.indent});s("const axios = require('axios');");const d={method:e,url:r};switch(Object.keys(t).length&&(d.headers=t),a.mimeType){case"application/x-www-form-urlencoded":a.params&&(s("const { URLSearchParams } = require('url');"),n(),s("const encodedParams = new URLSearchParams();"),a.params.forEach(l=>{s(`encodedParams.set('${l.name}', '${l.value}');`)}),n(),d.data="encodedParams,",c(l=>l.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":n(),a.jsonObj&&(d.data=a.jsonObj);break;default:n(),a.text&&(d.data=a.text)}const f=pe(d,{indent:" ",inlineCharacterLimit:80});return s(`const options = ${f};`),n(),s("axios"),s(".request(options)",1),s(".then(function (response) {",1),s("console.log(response.data);",2),s("})",1),s(".catch(function (error) {",1),s("console.error(error);",2),s("});",1),o()}},hs={info:{key:"fetch",title:"Fetch",link:"https://github.com/bitinn/node-fetch",description:"Simplified HTTP node-fetch client",extname:".cjs",installation:"npm install node-fetch@2 --save"},convert:({method:e,fullUrl:r,postData:t,headersObj:a,cookies:p},i)=>{const n={indent:" ",...i};let o=!1;const{blank:s,push:c,join:d,unshift:f}=new V({indent:n.indent});c("const fetch = require('node-fetch');");const l=r,j={method:e};switch(Object.keys(a).length&&(j.headers=a),t.mimeType){case"application/x-www-form-urlencoded":f("const { URLSearchParams } = require('url');"),c("const encodedParams = new URLSearchParams();"),s(),t.params?.forEach(m=>{c(`encodedParams.set('${m.name}', '${m.value}');`)}),j.body="encodedParams";break;case"application/json":t.jsonObj&&(j.body=t.jsonObj);break;case"multipart/form-data":if(!t.params)break;const u=ue(a,"content-type");u&&delete a[u],f("const FormData = require('form-data');"),c("const formData = new FormData();"),s(),t.params.forEach(m=>{if(!m.fileName&&!m.fileName&&!m.contentType){c(`formData.append('${m.name}', '${m.value}');`);return}m.fileName&&(o=!0,c(`formData.append('${m.name}', fs.createReadStream('${m.fileName}'));`))});break;default:t.text&&(j.body=t.text)}if(p.length){const u=p.map(({name:m,value:b})=>`${encodeURIComponent(m)}=${encodeURIComponent(b)}`).join("; ");j.headers||(j.headers={}),j.headers.cookie=u}s(),c(`const url = '${l}';`),j.headers&&!Object.keys(j.headers).length&&delete j.headers;const x=pe(j,{indent:" ",inlineCharacterLimit:80,transform:(u,m,b)=>m==="body"&&t.mimeType==="application/json"?`JSON.stringify(${b})`:b});return c(`const options = ${x};`),s(),o&&f("const fs = require('fs');"),t.params&&t.mimeType==="multipart/form-data"&&(c("options.body = formData;"),s()),c("fetch(url, options)"),c(".then(res => res.json())",1),c(".then(json => console.log(json))",1),c(".catch(err => console.error('error:' + err));",1),d().replace(/'encodedParams'/,"encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/,'fs.createReadStream("$1")')}},ms={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:r,allHeaders:t,postData:a},p={})=>{const{indent:i=" "}=p,{blank:n,join:o,push:s,unshift:c}=new V({indent:i}),d={method:r,hostname:e.hostname,port:e.port,path:e.path,headers:t};switch(s(`const http = require('${e.protocol?.replace(":","")}');`),n(),s(`const options = ${pe(d,{indent:i})};`),n(),s("const req = http.request(options, function (res) {"),s("const chunks = [];",1),n(),s("res.on('data', function (chunk) {",1),s("chunks.push(chunk);",2),s("});",1),n(),s("res.on('end', function () {",1),s("const body = Buffer.concat(chunks);",2),s("console.log(body.toString());",2),s("});",1),s("});"),n(),a.mimeType){case"application/x-www-form-urlencoded":a.paramsObj&&(c("const qs = require('querystring');
34"),s(`req.write(qs.stringify(${pe(a.paramsObj,{indent:" ",inlineCharacterLimit:80})}));`));break;case"application/json":a.jsonObj&&s(`req.write(JSON.stringify(${pe(a.jsonObj,{indent:" ",inlineCharacterLimit:80})}));`);break;default:a.text&&s(`req.write(${pe(a.text,{indent:i})});`)}return s("req.end();"),o()}},ys={info:{key:"request",title:"Request",link:"https://github.com/request/request",description:"Simplified HTTP request client",extname:".cjs",installation:"npm install request --save"},convert:({method:e,url:r,fullUrl:t,postData:a,headersObj:p,cookies:i},n)=>{const o={indent:" ",...n};let s=!1;const{push:c,blank:d,join:f,unshift:l,addPostProcessor:j}=new V({indent:o.indent});c("const request = require('request');"),d();const x={method:e,url:t};switch(Object.keys(p).length&&(x.headers=p),a.mimeType){case"application/x-www-form-urlencoded":x.form=a.paramsObj;break;case"application/json":a.jsonObj&&(x.body=a.jsonObj,x.json=!0);break;case"multipart/form-data":if(!a.params)break;x.formData={},a.params.forEach(u=>{if(!u.fileName&&!u.fileName&&!u.contentType){x.formData[u.name]=u.value;return}let m={};u.fileName?(s=!0,m={value:`fs.createReadStream(${u.fileName})`,options:{filename:u.fileName,contentType:u.contentType?u.contentType:null}}):u.value&&(m.value=u.value),x.formData[u.name]=m}),j(u=>u.replace(/'fs\.createReadStream\((.*)\)'/,"fs.createReadStream('$1')"));break;default:a.text&&(x.body=a.text)}return i.length&&(x.jar="JAR",c("const jar = request.jar();"),i.forEach(({name:u,value:m})=>{c(`jar.setCookie(request.cookie('${encodeURIComponent(u)}=${encodeURIComponent(m)}'), '${r}');`)}),d(),j(u=>u.replace(/'JAR'/,"jar"))),s&&l("const fs = require('fs');"),c(`const options = ${pe(x,{indent:" ",inlineCharacterLimit:80})};`),d(),c("request(options, function (error, response, body) {"),c("if (error) throw new Error(error);",1),d(),c("console.log(body);",1),c("});"),f()}},bs={info:{key:"unirest",title:"Unirest",link:"http://unirest.io/nodejs.html",description:"Lightweight HTTP Request Client Library",extname:".cjs"},convert:({method:e,url:r,cookies:t,queryObj:a,postData:p,headersObj:i},n)=>{const o={indent:" ",...n};let s=!1;const{addPostProcessor:c,blank:d,join:f,push:l,unshift:j}=new V({indent:o.indent});switch(l("const unirest = require('unirest');"),d(),l(`const req = unirest('${e}', '${r}');`),d(),t.length&&(l("const CookieJar = unirest.jar();"),t.forEach(x=>{l(`CookieJar.add('${encodeURIComponent(x.name)}=${encodeURIComponent(x.value)}', '${r}');`)}),l("req.jar(CookieJar);"),d()),Object.keys(a).length&&(l(`req.query(${pe(a,{indent:o.indent})});`),d()),Object.keys(i).length&&(l(`req.headers(${pe(i,{indent:o.indent})});`),d()),p.mimeType){case"application/x-www-form-urlencoded":p.paramsObj&&(l(`req.form(${pe(p.paramsObj,{indent:o.indent})});`),d());break;case"application/json":p.jsonObj&&(l("req.type('json');"),l(`req.send(${pe(p.jsonObj,{indent:o.indent})});`),d());break;case"multipart/form-data":{if(!p.params)break;const x=[];p.params.forEach(u=>{const m={};u.fileName&&!u.value?(s=!0,m.body=`fs.createReadStream('${u.fileName}')`,c(b=>b.replace(/'fs\.createReadStream\(\\'(.+)\\'\)'/,"fs.createReadStream('$1')"))):u.value&&(m.body=u.value),m.body&&(u.contentType&&(m["content-type"]=u.contentType),x.push(m))}),l(`req.multipart(${pe(x,{indent:o.indent})});`),d();break}default:p.text&&(l(`req.send(${pe(p.text,{indent:o.indent})});`),d())}return s&&j("const fs = require('fs');"),l("req.end(function (res) {"),l("if (res.error) throw new Error(res.error);",1),d(),l("console.log(res.body);",1),l("});"),f()}},gs={info:{key:"node",title:"Node.js",default:"native",cli:"node %s"},clientsById:{native:ms,request:ys,unirest:bs,axios:fs,fetch:hs}},ut=(e,r,t,a)=>{const p=`${e} *${r} = `,i=Bt(t,a?p.length:void 0);return`${p}${i};`},Bt=(e,r)=>{const t=r===void 0?", ":`, 35 ${" ".repeat(r)}`;switch(Object.prototype.toString.call(e)){case"[object Number]":return`@${e}`;case"[object Array]":return`@[ ${e.map(a=>Bt(a)).join(t)} ]`;case"[object Object]":{const a=[];return Object.keys(e).forEach(p=>{a.push(`@"${p}": ${Bt(e[p])}`)}),`@{ ${a.join(t)} }`}case"[object Boolean]":return e?"@YES":"@NO";default:return e==null?"":`@"${e.toString().replace(/"/g,'\\"')}"`}},vs={info:{key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSe
35ssion_class/index.html",description:"Foundation's NSURLSession request",extname:".m"},convert:({allHeaders:e,postData:r,method:t,fullUrl:a},p)=>{const i={indent:" ",pretty:!0,timeout:10,...p},{push:n,join:o,blank:s}=new V({indent:i.indent}),c={hasHeaders:!1,hasBody:!1};if(n("#import <Foundation/Foundation.h>"),Object.keys(e).length&&(c.hasHeaders=!0,s(),n(ut("NSDictionary","headers",e,i.pretty))),r.text||r.jsonObj||r.params)switch(c.hasBody=!0,r.mimeType){case"application/x-www-form-urlencoded":if(r.params?.length){s();const[d,...f]=r.params;n(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${d.name}=${d.value}" dataUsingEncoding:NSUTF8StringEncoding]];`),f.forEach(({name:l,value:j})=>{n(`[postData appendData:[@"&${l}=${j}" dataUsingEncoding:NSUTF8StringEncoding]];`)})}else c.hasBody=!1;break;case"application/json":r.jsonObj&&(n(ut("NSDictionary","parameters",r.jsonObj,i.pretty)),s(),n("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));break;case"multipart/form-data":n(ut("NSArray","parameters",r.params||[],i.pretty)),n(`NSString *boundary = @"${r.boundary}";`),s(),n("NSError *error;"),n("NSMutableString *body = [NSMutableString string];"),n("for (NSDictionary *param in parameters) {"),n('[body appendFormat:@"--%@\\r\\n", boundary];',1),n('if (param[@"fileName"]) {',1),n('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',2),n('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];',2),n('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',2),n("if (error) {",2),n('NSLog(@"%@", error);',3),n("}",2),n("} else {",1),n('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];',2),n('[body appendFormat:@"%@", param[@"value"]];',2),n("}",1),n("}"),n('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'),n("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");break;default:s(),n(`NSData *postData = [[NSData alloc] initWithData:[@"${r.text}" dataUsingEncoding:NSUTF8StringEncoding]];`)}return s(),n(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${a}"]`),n(" cachePolicy:NSURLRequestUseProtocolCachePolicy"),n(` timeoutInterval:${i.timeout.toFixed(1)}];`),n(`[request setHTTPMethod:@"${t}"];`),c.hasHeaders&&n("[request setAllHTTPHeaderFields:headers];"),c.hasBody&&n("[request setHTTPBody:postData];"),s(),n("NSURLSession *session = [NSURLSession sharedSession];"),n("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"),n(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"),n(" if (error) {",1),n(' NSLog(@"%@", error);',2),n(" } else {",1),n(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",2),n(' NSLog(@"%@", httpResponse);',2),n(" }",1),n(" }];"),n("[dataTask resume];"),o()}},xs={info:{key:"objc",title:"Objective-C",default:"nsurlsession"},clientsById:{nsurlsession:vs}},js={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:r,postData:t,method:a},p)=>{const i={indent:" ",...p},n=["get","post","head","delete","patch","put","options"],{push:o,blank:s,join:c}=new V({indent:i.indent});o("open Cohttp_lwt_unix"),o("open Cohttp"),o("open Lwt"),s(),o(`let uri = Uri.of_string "${e}" in`);const d=Object.keys(r);d.length===1?o(`let headers = Header.add (Header.init ()) "${d[0]}" "${le(r[d[0]])}" in`):d.length>1&&(o("let headers = Header.add_list (Header.init ()) ["),d.forEach(x=>{o(`("${x}", "${le(r[x])}");`,1)}),o("] in")),t.text&&o(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(t.text)} in`),s();const f=d.length?"~headers ":"",l=t.text?"~body ":"",j=n.includes(a.toLowerCase())?`\`${a.toUpperCase()}
35`:`(Code.method_of_string "${a}")`;return o(`Client.call ${f}${l}${j} uri`),o(">>= fun (res, body_stream) ->"),o("(* Do stuff with the result *)",1),c()}},$s={info:{key:"ocaml",title:"OCaml",default:"cohttp"},clientsById:{cohttp:js}},te=(e,r,t)=>{switch(t=t||"",r=r||"",Object.prototype.toString.call(e)){case"[object Boolean]":return e;case"[object Null]":return"null";case"[object Undefined]":return"null";case"[object String]":return`'${Ue(e,{delimiter:"'",escapeNewlines:!1})}'`;case"[object Number]":return e.toString();case"[object Array]":{const a=e.map(p=>te(p,`${r}${r}`,r)).join(`, 36${r}`);return`[ 37${r}${a} 38${t}]`}case"[object Object]":{const a=[];for(const p in e)Object.prototype.hasOwnProperty.call(e,p)&&a.push(`${te(p,r)} => ${te(e[p],`${r}${r}`,r)}`);return`[ 39${r}${a.join(`, 40${r}`)} 41${t}]`}default:return"null"}},kr=["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"],Os={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:r,fullUrl:t,method:a,httpVersion:p,cookies:i,headersObj:n},o={})=>{const{closingTag:s=!1,indent:c=" ",maxRedirects:d=10,namedErrors:f=!1,noTags:l=!1,shortTags:j=!1,timeout:x=30}=o,{push:u,blank:m,join:b}=new V({indent:c});l||(u(j?"<?":"<?php"),m()),u("$curl = curl_init();"),m();const g=[{escape:!0,name:"CURLOPT_PORT",value:e.port},{escape:!0,name:"CURLOPT_URL",value:t},{escape:!1,name:"CURLOPT_RETURNTRANSFER",value:"true"},{escape:!0,name:"CURLOPT_ENCODING",value:""},{escape:!1,name:"CURLOPT_MAXREDIRS",value:d},{escape:!1,name:"CURLOPT_TIMEOUT",value:x},{escape:!1,name:"CURLOPT_HTTP_VERSION",value:p==="HTTP/1.0"?"CURL_HTTP_VERSION_1_0":"CURL_HTTP_VERSION_1_1"},{escape:!0,name:"CURLOPT_CUSTOMREQUEST",value:a},{escape:!r.jsonObj,name:"CURLOPT_POSTFIELDS",value:r?r.jsonObj?`json_encode(${te(r.jsonObj,c.repeat(2),c)})`:r.text:void 0}];u("curl_setopt_array($curl, [");const O=new V({indent:c,join:` 42${c}`});g.forEach(({value:S,name:y,escape:q})=>{S!=null&&O.push(`${y} => ${q?JSON.stringify(S):S},`)});const k=i.map(S=>`${encodeURIComponent(S.name)}=${encodeURIComponent(S.value)}`);k.length&&O.push(`CURLOPT_COOKIE => "${k.join("; ")}",`);const h=Object.keys(n).sort().map(S=>`"${S}: ${le(n[S])}"`);return h.length&&(O.push("CURLOPT_HTTPHEADER => ["),O.push(h.join(`, 43${c}${c}`),1),O.push("],")),u(O.join(),1),u("]);"),m(),u("$response = curl_exec($curl);"),u("$err = curl_error($curl);"),m(),u("curl_close($curl);"),m(),u("if ($err) {"),u(f?'echo array_flip(get_defined_constants(true)["curl"])[$err];':'echo "cURL Error #:" . $err;',1),u("} else {"),u("echo $response;",1),u("}"),!l&&s&&(m(),u("?>")),b()}},ws={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:r,method:t,cookies:a,headersObj:p},i)=>{const n={closingTag:!1,indent:" ",noTags:!1,shortTags:!1,...i},{push:o,blank:s,join:c}=new V({indent:n.indent}),{code:d,push:f,join:l}=new V({indent:n.indent});switch(n.noTags||o(n.shortTags?"<?":"<?php"),o("require_once('vendor/autoload.php');"),s(),e.mimeType){case"application/x-www-form-urlencoded":f(`'form_params' => ${te(e.paramsObj,n.indent+n.indent,n.indent)},`,1);break;case"multipart/form-data":{const u=[];if(e.params&&e.params.forEach(m=>{if(m.fileName){const b={name:m.name,filename:m.fileName,contents:m.value};m.contentType&&(b.headers={"Content-Type":m.contentType}),u.push(b)}else m.value&&u.push({name:m.name,contents:m.value})}),u.length&&(f(`'multipart' => ${te(u,n.indent+n.indent,n.indent)}`,1),Ye(p,"content-type")&&ge(p,"content-type")?.indexOf("boundary"))){const m=ue(p,"content-type");m&&delete p[m]}break}default:e.text&&f(`'body' => ${te(e.text)},`,1)}const j=Object.keys(p).sort().map(function(u){return`${n.indent}${n.indent}'${u}' => '${De(p[u])}',`}),x=a.map(u=>`${encodeURIComponent(u.name)}
43=${encodeURIComponent(u.value)}`).join("; ");return x.length&&j.push(`${n.indent}${n.indent}'cookie' => '${De(x)}',`),j.length&&(f("'headers' => [",1),f(j.join(` 44`)),f("],",1)),o("$client = new \\GuzzleHttp\\Client();"),s(),d.length?(o(`$response = $client->request('${t}', '${r}', [`),o(l()),o("]);")):o(`$response = $client->request('${t}', '${r}');`),s(),o("echo $response->getBody();"),!n.noTags&&n.closingTag&&(s(),o("?>")),c()}},Ss={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:r,postData:t,queryObj:a,headersObj:p,cookiesObj:i},n={})=>{const{closingTag:o=!1,indent:s=" ",noTags:c=!1,shortTags:d=!1}=n,{push:f,blank:l,join:j}=new V({indent:s});switch(c||(f(d?"<?":"<?php"),l()),kr.includes(e.toUpperCase())||f(`HttpRequest::methodRegister('${e}');`),f("$request = new HttpRequest();"),f(`$request->setUrl(${te(r)});`),kr.includes(e.toUpperCase())?f(`$request->setMethod(HTTP_METH_${e.toUpperCase()});`):f(`$request->setMethod(HttpRequest::HTTP_METH_${e.toUpperCase()});`),l(),Object.keys(a).length&&(f(`$request->setQueryData(${te(a,s)});`),l()),Object.keys(p).length&&(f(`$request->setHeaders(${te(p,s)});`),l()),Object.keys(i).length&&(f(`$request->setCookies(${te(i,s)});`),l()),t.mimeType){case"application/x-www-form-urlencoded":f(`$request->setContentType(${te(t.mimeType)});`),f(`$request->setPostFields(${te(t.paramsObj,s)});`),l();break;case"application/json":f(`$request->setContentType(${te(t.mimeType)});`),f(`$request->setBody(json_encode(${te(t.jsonObj,s)}));`),l();break;default:t.text&&(f(`$request->setBody(${te(t.text)});`),l())}return f("try {"),f("$response = $request->send();",1),l(),f("echo $response->getBody();",1),f("} catch (HttpException $ex) {"),f("echo $ex;",1),f("}"),!c&&o&&(l(),f("?>")),j()}},ks={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:r,method:t,queryObj:a,cookiesObj:p,url:i},n={})=>{const{closingTag:o=!1,indent:s=" ",noTags:c=!1,shortTags:d=!1}=n,{push:f,blank:l,join:j}=new V({indent:s});let x=!1;switch(c||(f(d?"<?":"<?php"),l()),f("$client = new http\\Client;"),f("$request = new http\\Client\\Request;"),l(),e.mimeType){case"application/x-www-form-urlencoded":f("$body = new http\\Message\\Body;"),f(`$body->append(new http\\QueryString(${te(e.paramsObj,s)}));`),l(),x=!0;break;case"multipart/form-data":{if(!e.params)break;const u=[],m={};e.params.forEach(({name:O,fileName:k,value:h,contentType:S})=>{if(k){u.push({name:O,type:S,file:k,data:h});return}h&&(m[O]=h)});const b=Object.keys(m).length?te(m,s):"null",g=u.length?te(u,s):"null";if(f("$body = new http\\Message\\Body;"),f(`$body->addForm(${b}, ${g});`),Ye(r,"content-type")&&ge(r,"content-type")?.indexOf("boundary")){const O=ue(r,"content-type");O&&delete r[O]}l(),x=!0;break}case"application/json":f("$body = new http\\Message\\Body;"),f(`$body->append(json_encode(${te(e.jsonObj,s)}));`),x=!0;break;default:e.text&&(f("$body = new http\\Message\\Body;"),f(`$body->append(${te(e.text)});`),l(),x=!0)}return f(`$request->setRequestUrl(${te(i)});`),f(`$request->setRequestMethod(${te(t)});`),x&&(f("$request->setBody($body);"),l()),Object.keys(a).length&&(f(`$request->setQuery(new http\\QueryString(${te(a,s)}));`),l()),Object.keys(r).length&&(f(`$request->setHeaders(${te(r,s)});`),l()),Object.keys(p).length&&(l(),f(`$client->setCookies(${te(p,s)});`),l()),f("$client->enqueue($request)->send();"),f("$response = $client->getResponse();"),l(),f("echo $response->getBody();"),!c&&o&&(l(),f("?>")),j()}},Ts={info:{key:"php",title:"PHP",default:"curl",cli:"php %s"},clientsById:{curl:Os,guzzle:ws,http1:Ss,http2:ks}},xa=e=>({method:r,headersObj:t,cookies:a,uriObj:p,fullUrl:i,postData:n,allHeaders:o})=>{const{push:s,join:c}=new V;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(r.toUpperCase()))return"Method not supported";const d=[],f=Object.keys(t);return f.length&&(s("$headers=@{}"),f.forEach(l=>{l!=="connection"&&s(`$headers.Add("${l}", "${Ue(t[l],{escapeChar:"`"})}")`)}),d.push("-Headers $headers")),a.length&&(s("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"),a.forEach(l=>{s("$cookie = New-Object System.Net.Cookie"),s(`$cookie.Name = '${l.name}'`),s(`$cookie.Value = '${l.value}'`),s(`$cookie.Domain = '${p.host}'`),s("$session.Cookies.Add($cookie)")}),d.push("-WebSession $session")),n.text&&(d.push(`-ContentType '${Ue(ge(o,"content-type"),{delimiter:"'",escapeChar:"`"})}'`),d.push(`-Body '${n.text}'`)),s(`$response = ${e} -Uri '${i}' -Method ${r} ${d.join(" ")}`.trim()),c()},Ns={info:{key:"restmethod",title:"Invoke-RestMethod",link:"https://docs.microsoft.com/en-us
44/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",description:"Powershell Invoke-RestMethod client",extname:".ps1"},convert:xa("Invoke-RestMethod")},Cs={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:xa("Invoke-WebRequest")},Ps={info:{key:"powershell",title:"Powershell",default:"webrequest"},clientsById:{webrequest:Cs,restmethod:Ns}};function Tr(e,r,t,a,p){const i=a.repeat(p),n=a.repeat(p-1),o=t?`, 45${i}`:", ",s=e==="object"?"{":"[",c=e==="object"?"}":"]";return t?`${s} 46${i}${r.join(o)} 47${n}${c}`:e==="object"&&r.length>0?`${s} ${r.join(o)} ${c}`:`${s}${r.join(o)}${c}`}var qe=(e,r,t)=>{switch(t=t===void 0?1:t+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let a=!1;const p=e.map(i=>(Object.prototype.toString.call(i)==="[object Object]"&&(a=Object.keys(i).length>1),qe(i,r,t)));return Tr("array",p,a,r.indent,t)}case"[object Object]":{const a=[];for(const p in e)a.push(`"${p}": ${qe(e[p],r,t)}`);return Tr("object",a,r.pretty&&a.length>1,r.indent,t)}case"[object Null]":return"None";case"[object Boolean]":return e?"True":"False";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},qs=["HEAD","GET","POST","PUT","PATCH","DELETE","OPTIONS"],Rs={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:r,allHeaders:t,method:a},p)=>{const i={indent:" ",pretty:!0,...p},{push:n,blank:o,join:s,addPostProcessor:c}=new V({indent:i.indent});n("import requests"),o(),n(`url = "${e}"`),o();const d=t;let f={};const l={};let j=!1,x=!1,u=!1;switch(r.mimeType){case"application/json":r.jsonObj&&(n(`payload = ${qe(r.jsonObj,i)}`),u=!0,x=!0);break;case"multipart/form-data":if(!r.params)break;if(f={},r.params.forEach(g=>{g.fileName?(g.contentType?l[g.name]=`('${g.fileName}', open('${g.fileName}', 'rb'), '${g.contentType}')`:l[g.name]=`('${g.fileName}', open('${g.fileName}', 'rb'))`,j=!0):(f[g.name]=g.value,x=!0)}),j){n(`files = ${qe(l,i)}`),x&&n(`payload = ${qe(f,i)}`);const g=ue(d,"content-type");g&&delete d[g]}else{const g=JSON.stringify(r.text);g&&(n(`payload = ${g}`),x=!0)}c(g=>g.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g,'("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g,'("$1", open("$2", "rb"), "$3")'));break;default:{if(r.mimeType==="application/x-www-form-urlencoded"&&r.paramsObj){n(`payload = ${qe(r.paramsObj,i)}`),x=!0;break}const g=JSON.stringify(r.text);g&&(n(`payload = ${g}`),x=!0)}}const m=Object.keys(d).length;if(m===0&&(x||j))o();else if(m===1)Object.keys(d).forEach(g=>{n(`headers = {"${g}": "${le(d[g])}"}`),o()});else if(m>1){let g=1;n("headers = {"),Object.keys(d).forEach(O=>{n(g!==m?`"${O}": "${le(d[O])}",`:`"${O}": "${le(d[O])}"`,1),g+=1}),n("}"),o()}let b=qs.includes(a)?`response = requests.${a.toLowerCase()}(url`:`response = requests.request("${a}", url`;return x&&(u?b+=", json=payload":b+=", data=payload"),j&&(b+=", files=files"),m>0&&(b+=", headers=headers"),b+=")",n(b),o(),n("print(response.text)"),s()}},Es={info:{key:"python",title:"Python",default:"requests",cli:"python3 %s"},clientsById:{requests:Rs}},As={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:r,queryString:t,postData:a,allHeaders:p,method:i})=>{const{push:n,blank:o,join:s}=new V;n("library(httr)"),o(),n(`url <- "${e}"`),o();const c=r;delete r.key;const d=Object.keys(c).length;t.length===1?(n(`queryString <- list(${Object.keys(c)} = "${Object.values(c).toString()}")`),o()):t.length>1&&(n("queryString <- list("),Object.keys(c).forEach((h,S)=>{S!==d-1?n(` ${h} = "${c[h].toString()}",`):n(` ${h} = "${c[h].toString()}"`)}),n(")"),o());const f=JSON.stringify(a.text);if(f&&(n(`payload <- ${f}`),o()),a.text||a.jsonObj||a.params)switch(a.mimeType){case"application/x-www-form-urlencoded":n('encode <- "form"'),o();break;case"application/json":n('encode <- "json"'),o();break;case"multipart/form-data":n('encode <- "multipart"'),o();break;default:n('encode <- "raw"'),o();break}const l=ge(p,"cookie"),j=ge(p,"accept"),x=l?`set_cookies(\`${String(l).replace(/;/g,'", `').replace(/` /g,"`").replace(/[=]/g,'` = "')}")`:void 0,u=j?`accept("${le(j)}")`:void 0,m=`content_type("${le(a.mimeType)}")`,b=Object.entries(p).filter(([h])=>!["cookie","accept","content-type"].includes(h.toLowerCase())).map(([h,S])=>`'${h}' = '${De(S)}'`).join(", "),g=b?`add_headers(${b})`:void 0;let O=`response <- VERB("${i}", url`;f&&(O+=", body = payload"),t.length&&(O+=", query = queryString");const k=[g,m,u,x].filter(h=>!!h).join(", ");return k&&(O+=`, ${k}`),(a.text||a.jsonObj||a.params)&&(O+=", encode = encode"),O+=")",
47n(O),o(),n('content(response, "text")'),s()}},Us={info:{key:"r",title:"R",default:"httr"},clientsById:{httr:As}},Ds={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:r,fullUrl:t,postData:a,allHeaders:p})=>{const{push:i,blank:n,join:o}=new V;i("require 'uri'"),i("require 'net/http'"),n();const s=r.toUpperCase(),c=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"],d=s.charAt(0)+s.substring(1).toLowerCase();c.includes(s)||(i(`class Net::HTTP::${d} < Net::HTTPRequest`),i(` METHOD = '${s.toUpperCase()}'`),i(` REQUEST_HAS_BODY = '${a.text?"true":"false"}'`),i(" RESPONSE_HAS_BODY = true"),i("end"),n()),i(`url = URI("${t}")`),n(),i("http = Net::HTTP.new(url.host, url.port)"),e.protocol==="https:"&&i("http.use_ssl = true"),n(),i(`request = Net::HTTP::${d}.new(url)`);const f=Object.keys(p);return f.length&&f.forEach(l=>{i(`request["${l}"] = '${De(p[l])}'`)}),a.text&&i(`request.body = ${JSON.stringify(a.text)}`),n(),i("response = http.request(request)"),i("puts response.read_body"),o()}},Hs={info:{key:"ruby",title:"Ruby",default:"native"},clientsById:{native:Ds}},ce=(e="")=>/^[a-z0-9-_/.@%^=:]+$/i.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`,_s=e=>e.replace(/\r/g,"\\r").replace(/\n/g,"\\n"),Ls={"http1.0":"0","url ":"",cookie:"b",data:"d",form:"F",globoff:"g",header:"H",insecure:"k",request:"X"},Is=e=>r=>{if(e){const t=Ls[r];return t?`-${t}`:""}return`--${r}`},Ms={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:r,httpVersion:t,headersObj:a,allHeaders:p,postData:i},n={})=>{const{indent:o=" ",short:s=!1,binary:c=!1,globOff:d=!1}=n,f=" ",{push:l,join:j}=new V({...typeof o=="string"?{indent:o}:{},join:o!==!1?` \\ 48${o}`:" "}),x=Is(s);let u=ce(e);if(l(`curl ${x("request")} ${r}`),d&&(u=unescape(u),l(x("globoff"))),l(`${x("url ")}${u}`),t==="HTTP/1.0"&&l(x("http1.0")),ge(p,"accept-encoding")&&l("--compressed"),i.mimeType==="multipart/form-data"){const m=ue(a,"content-type");if(m){const b=a[m];if(m&&b){const g=String(b).replace(/; boundary.+?(?=(;|$))/,"");a[m]=g,p[m]=g}}}switch(Object.keys(a).sort().forEach(m=>{const b=`${m}: ${a[m]}`;l(`${x("header")} ${ce(b)}`)}),p.cookie&&l(`${x("cookie")} ${ce(p.cookie)}`),i.mimeType){case"multipart/form-data":i.params?.forEach(b=>{let g="";b.fileName?g=`${b.name}='@${b.fileName}'`:g=ce(`${b.name}=${b.value}`),l(`${x("form")} ${g}`)});break;case"application/x-www-form-urlencoded":i.params?i.params.forEach(b=>{const g=b.name,O=encodeURIComponent(b.name),k=O!==g,h=k?O:g,S=c?"--data-binary":k?"--data-urlencode":x("data");l(`${S} ${ce(`${h}=${b.value}`)}`)}):l(`${c?"--data-binary":x("data")} ${ce(i.text)}`);break;default:if(!i.text)break;let m=!1;if(Io(i.mimeType)&&i.text.length>20)try{const b=JSON.parse(i.text);m=!0,i.text.indexOf("'")>0?l(`${c?"--data-binary":x("data")} @- <<EOF 49${JSON.stringify(b,null,f)} 50EOF`):l(`${c?"--data-binary":x("data")} ' 51${JSON.stringify(b,null,f)} 52'`)}catch{}m||l(`${c?"--data-binary":x("data")} ${ce(i.text)}`)}return j()}},Fs={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:r,queryObj:t,fullUrl:a,method:p,url:i},n)=>{const o={body:!1,cert:!1,headers:!1,indent:" ",pretty:!1,print:!1,queryParams:!1,short:!1,style:!1,timeout:!1,verbose:!1,verify:!1,...n},{push:s,join:c,unshift:d}=new V({indent:o.indent,join:o.indent!==!1?` \\ 53${o.indent}`:" "});let f=!1;const l=[];o.headers&&l.push(o.short?"-h":"--headers"),o.body&&l.push(o.short?"-b":"--body"),o.verbose&&l.push(o.short?"-v":"--verbose"),o.print&&l.push(`${o.short?"-p":"--print"}=${o.print}`),o.verify&&l.push(`--verify=${o.verify}`),o.cert&&l.push(`--cert=${o.cert}`),o.pretty&&l.push(`--pretty=${o.pretty}`),o.style&&l.push(`--style=${o.style}`),o.timeout&&l.push(`--timeout=${o.timeout}`),o.queryParams&&Object.keys(t).forEach(x=>{const u=t[x];Array.isArray(u)?u.forEach(m=>{s(`${x}==${ce(m)}`)}):s(`${x}==${ce(u)}`)}
53),Object.keys(e).sort().forEach(x=>{s(`${x}:${ce(e[x])}`)}),r.mimeType==="application/x-www-form-urlencoded"?r.params&&r.params.length&&(l.push(o.short?"-f":"--form"),r.params.forEach(x=>{s(`${x.name}=${ce(x.value)}`)})):f=!0;const j=l.length?`${l.join(" ")} `:"";if(i=ce(o.queryParams?i:a),d(`http ${j}${p} ${i}`),f&&r.text){const x=ce(r.text);d(`echo ${x} | `)}return c()}},Bs={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:r,allHeaders:t,fullUrl:a},p)=>{const i={indent:" ",short:!1,verbose:!1,...p},{push:n,join:o}=new V({...typeof i.indent=="string"?{indent:i.indent}:{},join:i.indent!==!1?` \\ 54${i.indent}`:" "});return i.verbose?n(`wget ${i.short?"-v":"--verbose"}`):n(`wget ${i.short?"-q":"--quiet"}`),n(`--method ${ce(e)}`),Object.keys(t).forEach(s=>{const c=`${s}: ${t[s]}`;n(`--header ${ce(c)}`)}),r.text&&n(`--body-data ${_s(ce(r.text))}`),n(i.short?"-O":"--output-document"),n(`- ${ce(a)}`),o()}},zs={info:{key:"shell",title:"Shell",default:"curl",cli:"%s"},clientsById:{curl:Ms,httpie:Fs,wget:Bs}},Nr=(e,r)=>r.repeat(e),Cr=(e,r,t,a)=>{const p=Nr(a,t),i=Nr(a-1,t),n=r?`, 55${p}`:", ";return r?`[ 56${p}${e.join(n)} 57${i}]`:`[${e.join(n)}]`},Pr=(e,r,t)=>`let ${e} = ${Ke(r,t)}`,Ke=(e,r,t)=>{switch(t=t===void 0?1:t+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let a=!1;const p=e.map(i=>(Object.prototype.toString.call(i)==="[object Object]"&&(a=Object.keys(i).length>1),Ke(i,r,t)));return Cr(p,a,r.indent,t)}case"[object Object]":{const a=[];for(const p in e)a.push(`"${p}": ${Ke(e[p],r,t)}`);return Cr(a,r.pretty&&a.length>1,r.indent,t)}case"[object Boolean]":return e.toString();default:return e==null?"nil":`"${e.toString().replace(/"/g,'\\"')}"`}},Js={info:{key:"urlsession",title:"URLSession",link:"https://developer.apple.com/documentation/foundation/urlsession",description:"Foundation's URLSession request",extname:".swift"},convert:({allHeaders:e,postData:r,uriObj:t,queryObj:a,method:p},i)=>{const n={indent:" ",pretty:!0,timeout:10,...i},{push:o,blank:s,join:c}=new V({indent:n.indent});o("import Foundation"),s();const d=r.text||r.jsonObj||r.params;if(d)switch(r.mimeType){case"application/x-www-form-urlencoded":if(r.params?.length){const l=r.params.map(j=>`"${j.name}": "${j.value}"`);n.pretty?(o("let parameters = ["),l.forEach(j=>o(`${j},`,1)),o("]")):o(`let parameters = [${l.join(", ")}]`),o('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'),o("let postData = Data(joinedParameters.utf8)"),s()}break;case"application/json":r.jsonObj&&(o(`${Pr("parameters",r.jsonObj,n)} as [String : Any?]`),s(),o("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"),s());break;case"multipart/form-data":o(Pr("parameters",r.params,n)),s(),o(`let boundary = "${r.boundary}"`),s(),o('var body = ""'),o("for param in parameters {"),o('let paramName = param["name"]!',1),o('body += "--\\(boundary)\\r\\n"',1),o('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""',1),o('if let filename = param["fileName"] {',1),o('let contentType = param["contentType"]!',2),o("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)",2),o('body += "; filename=\\"\\(filename)\\"\\r\\n"',2),o('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"',2),o("body += fileContent",2),o('} else if let paramValue = param["value"] {',1),o('body += "\\r\\n\\r\\n\\(paramValue)"',2),o("}",1),o("}"),s(),o("let postData = Data(body.utf8)"),s();break;default:o(`let postData = Data("${r.text}".utf8)`),s()}o(`let url = URL(string: "${t.href}")!`);const f=a?Object.entries(a):[];return f.length<1?o("var request = URLRequest(url: url)"):(o("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"),o("let queryItems: [URLQueryItem] = ["),f.forEach(l=>{const j=l[0],x=l[1];switch(Object.prototype.toString.call(x)){case"[object String]":o(`URLQueryItem(name: "${j}", value: "${x}"),`,1);break;
57case"[object Array]":x.forEach(u=>{o(`URLQueryItem(name: "${j}", value: "${u}"),`,1)});break}}),o("]"),o("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"),s(),o("var request = URLRequest(url: components.url!)")),o(`request.httpMethod = "${p}"`),o(`request.timeoutInterval = ${n.timeout}`),Object.keys(e).length&&o(`request.allHTTPHeaderFields = ${Ke(e,n)}`),d&&o("request.httpBody = postData"),s(),o("let (data, _) = try await URLSession.shared.data(for: request)"),o("print(String(decoding: data, as: UTF8.self))"),c()}},Ws={info:{key:"swift",title:"Swift",default:"urlsession"},clientsById:{urlsession:Js}},Vs={c:Lo,clojure:Bo,csharp:Go,go:Qo,http:Xo,java:ns,javascript:ls,json:ps,kotlin:ds,node:gs,objc:xs,ocaml:$s,php:Ts,powershell:Ps,python:Es,r:Us,ruby:Hs,shell:zs,swift:Ws},Se={},ze={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Gs=ze.exports,qr;function Ks(){return qr||(qr=1,(function(e,r){(function(t){var a=r&&!r.nodeType&&r,p=e&&!e.nodeType&&e,i=typeof Ve=="object"&&Ve;(i.global===i||i.window===i||i.self===i)&&(t=i);var n,o=2147483647,s=36,c=1,d=26,f=38,l=700,j=72,x=128,u="-",m=/^xn--/,b=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=s-c,h=Math.floor,S=String.fromCharCode,y;function q(P){throw new RangeError(O[P])}function T(P,R){for(var H=P.length,N=[];H--;)N[H]=R(P[H]);return N}function I(P,R){var H=P.split("@"),N="";H.length>1&&(N=H[0]+"@",P=H[1]),P=P.replace(g,".");var D=P.split("."),W=T(D,R).join(".");return N+W}function E(P){for(var R=[],H=0,N=P.length,D,W;H<N;)D=P.charCodeAt(H++),D>=55296&&D<=56319&&H<N?(W=P.charCodeAt(H++),(W&64512)==56320?R.push(((D&1023)<<10)+(W&1023)+65536):(R.push(D),H--)):R.push(D);return R}function C(P){return T(P,function(R){var H="";return R>65535&&(R-=65536,H+=S(R>>>10&1023|55296),R=56320|R&1023),H+=S(R),H}).join("")}function ae(P){return P-48<10?P-22:P-65<26?P-65:P-97<26?P-97:s}function F(P,R){return P+22+75*(P<26)-((R!=0)<<5)}function G(P,R,H){var N=0;for(P=H?h(P/l):P>>1,P+=h(P/R);P>k*d>>1;N+=s)P=h(P/k);return h(N+(k+1)*P/(P+f))}function ie(P){var R=[],H=P.length,N,D=0,W=x,J=j,Q,ne,_,L,U,B,Y,K,M;for(Q=P.lastIndexOf(u),Q<0&&(Q=0),ne=0;ne<Q;++ne)P.charCodeAt(ne)>=128&&q("not-basic"),R.push(P.charCodeAt(ne));for(_=Q>0?Q+1:0;_<H;){for(L=D,U=1,B=s;_>=H&&q("invalid-input"),Y=ae(P.charCodeAt(_++)),(Y>=s||Y>h((o-D)/U))&&q("overflow"),D+=Y*U,K=B<=J?c:B>=J+d?d:B-J,!(Y<K);B+=s)M=s-K,U>h(o/M)&&q("overflow"),U*=M;N=R.length+1,J=G(D-L,N,L==0),h(D/N)>o-W&&q("overflow"),W+=h(D/N),D%=N,R.splice(D++,0,W)}return C(R)}function Z(P){var R,H,N,D,W,J,Q,ne,_,L,U,B=[],Y,K,M,fe;for(P=E(P),Y=P.length,R=x,H=0,W=j,J=0;J<Y;++J)U=P[J],U<128&&B.push(S(U));for(N=D=B.length,D&&B.push(u);N<Y;){for(Q=o,J=0;J<Y;++J)U=P[J],U>=R&&U<Q&&(Q=U);for(K=N+1,Q-R>h((o-H)/K)&&q("overflow"),H+=(Q-R)*K,R=Q,J=0;J<Y;++J)if(U=P[J],U<R&&++H>o&&q("overflow"),U==R){for(ne=H,_=s;L=_<=W?c:_>=W+d?d:_-W,!(ne<L);_+=s)fe=ne-L,M=s-L,B.push(S(F(L+fe%M,0))),ne=h(fe/M);B.push(S(F(ne,0))),W=G(H,K,N==D),H=0,++N}++H,++R}return B.join("")}function A(P){return I(P,function(R){return m.test(R)?ie(R.slice(4).toLowerCase()):R})}function re(P){return I(P,function(R){return b.test(R)?"xn--"+Z(R):R})}if(n={version:"1.4.1",ucs2:{decode:E,encode:C},decode:ie,encode:Z,toASCII:re,toUnicode:A},a&&p)if(e.exports==a)p.exports=n;else for(y in n)n.hasOwnProperty(y)&&(a[y]=n[y]);else t.punycode=n})(Gs)})(ze,ze.exports)),ze.exports}var Rr,Er;function ja(){return Er||(Er=1,Rr=Object),Rr}var Ar,Ur;function Qs(){return Ur||(Ur=1,Ar=Error),Ar}var Dr,Hr;function Ys(){return Hr||(Hr=1,Dr=EvalError),Dr}var _r,Lr;function Xs(){return Lr||(Lr=1,_r=RangeError),_r}var Ir,Mr;function Zs(){return Mr||(Mr=1,Ir=ReferenceError),Ir}var Fr,Br;function $a(){return Br||(Br=1,Fr=SyntaxError),Fr}var zr,Jr;function _e(){return Jr||(Jr=1,zr=TypeError),zr}var Wr,Vr;function ei(){return Vr||(Vr=1,Wr=URIError),Wr}var Gr,Kr;function ti(){return Kr||(Kr=1,Gr=Math.abs),Gr}var Qr,Yr;function ri(){return Yr||(Yr=1,Qr=Math.floor),Qr}var Xr,Zr;function ni(){return Zr||(Zr=1,Xr=Math.max),Xr}var en,tn;function ai(){return tn||(tn=1,en=Math.min),en}var rn,nn;function oi(){return nn||(nn=1,rn=Math.pow),rn}var an,on;function si(){return on||(on=1,an=Math.round),an}var sn,ln;function ii(){return ln||(ln=1,sn=Number.isNaN||function(e){return e!==e}),sn}var dt,cn;function li(){if(cn)return dt;cn=1;var e=ii();return dt=function(r){return e(r)||r===0?r:r<0?-1:1},dt}var pn,un;function ci(){return un||(un=1,pn=Object.getOwnPropertyDescriptor),pn}var ft,dn;
vendor: 10,551 bytes, line 57
57function Xe(){if(dn)return ft;dn=1;var e=ci();if(e)try{e([],"length")}catch{e=null}return ft=e,ft}var ht,fn;function Ze(){if(fn)return ht;fn=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ht=e,ht}var hn,mn;function pi(){return mn||(mn=1,hn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),t=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;var a=42;e[r]=a;for(var p in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var n=Object.getOwnPropertyDescriptor(e,r);if(n.value!==a||n.enumerable!==!0)return!1}return!0}),hn}var mt,yn;function ui(){if(yn)return mt;yn=1;var e=typeof Symbol<"u"&&Symbol,r=pi();return mt=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()},mt}var bn,gn;function Oa(){return gn||(gn=1,bn=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),bn}var yt,vn;function wa(){if(vn)return yt;vn=1;var e=ja();return yt=e.getPrototypeOf||null,yt}var bt,xn;function di(){if(xn)return bt;xn=1;var e="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,t=Math.max,a="[object Function]",p=function(o,s){for(var c=[],d=0;d<o.length;d+=1)c[d]=o[d];for(var f=0;f<s.length;f+=1)c[f+o.length]=s[f];return c},i=function(o,s){for(var c=[],d=s,f=0;d<o.length;d+=1,f+=1)c[f]=o[d];return c},n=function(o,s){for(var c="",d=0;d<o.length;d+=1)c+=o[d],d+1<o.length&&(c+=s);return c};return bt=function(o){var s=this;if(typeof s!="function"||r.apply(s)!==a)throw new TypeError(e+s);for(var c=i(arguments,1),d,f=function(){if(this instanceof d){var m=s.apply(this,p(c,arguments));return Object(m)===m?m:this}return s.apply(o,p(c,arguments))},l=t(0,s.length-c.length),j=[],x=0;x<l;x++)j[x]="$"+x;if(d=Function("binder","return function ("+n(j,",")+"){ return binder.apply(this,arguments); }")(f),s.prototype){var u=function(){};u.prototype=s.prototype,d.prototype=new u,u.prototype=null}return d},bt}var gt,jn;function Le(){if(jn)return gt;jn=1;var e=di();return gt=Function.prototype.bind||e,gt}var $n,On;function Kt(){return On||(On=1,$n=Function.prototype.call),$n}var wn,Sn;function Qt(){return Sn||(Sn=1,wn=Function.prototype.apply),wn}var kn,Tn;function fi(){return Tn||(Tn=1,kn=typeof Reflect<"u"&&Reflect&&Reflect.apply),kn}var vt,Nn;function Sa(){if(Nn)return vt;Nn=1;var e=Le(),r=Qt(),t=Kt(),a=fi();return vt=a||e.call(t,r),vt}var xt,Cn;function ka(){if(Cn)return xt;Cn=1;var e=Le(),r=_e(),t=Kt(),a=Sa();return xt=function(p){if(p.length<1||typeof p[0]!="function")throw new r("a function is required");return a(e,t,p)},xt}var jt,Pn;function hi(){if(Pn)return jt;Pn=1;var e=ka(),r=Xe(),t;try{t=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var a=!!t&&r&&r(Object.prototype,"__proto__"),p=Object,i=p.getPrototypeOf;return jt=a&&typeof a.get=="function"?e([a.get]):typeof i=="function"?(function(n){return i(n==null?n:p(n))}):!1,jt}var $t,qn;function mi(){if(qn)return $t;qn=1;var e=Oa(),r=wa(),t=hi();return $t=e?function(a){return e(a)}:r?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return r(a)}:t?function(a){return t(a)}:null,$t}var Ot,Rn;function yi(){if(Rn)return Ot;Rn=1;var e=Function.prototype.call,r=Object.prototype.hasOwnProperty,t=Le();return Ot=t.call(e,r),Ot}var wt,En;function Yt(){if(En)return wt;En=1;var e,r=ja(),t=Qs(),a=Ys(),p=Xs(),i=Zs(),n=$a(),o=_e(),s=ei(),c=ti(),d=ri(),f=ni(),l=ai(),j=oi(),x=si(),u=li(),m=Function,b=function(_){try{return m('"use strict"; return ('+_+").constructor;")()}catch{}},g=Xe(),O=Ze(),k=function(){throw new o},h=g?(function(){try{return arguments.callee,k}catch{try{return g(arguments,"callee").get}catch{return k}}})():k,S=ui()(),y=mi(),q=wa(),T=Oa(),I=Qt(),E=Kt(),C={},ae=typeof Uint8Array>"u"||!y?e:y(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":S&&y?y([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&y?y(y([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!y?e:y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":p,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!y?e:y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&y?y(""[Symbol.iterator]()):e,"%Symbol%":S?Symbol:e,"%SyntaxError%":n,"%ThrowTypeError%":h,"%TypedArray%":ae,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":E,"%Function.prototype.apply%":I,"%Object.defineProperty%":O,"%Object.getPrototypeOf%":q,"%Math.abs%":c,"%Math.floor%":d,"%Math.max%":f,"%Math.min%":l,"%Math.pow%":j,"%Math.round%":x,"%Math.sign%":u,"%Reflect.getPrototypeOf%":T};if(y)try{null.error}catch(_){var G=y(y(_));F["%Error.prototype%"]=G}var ie=function _(L){var U;if(L==="%AsyncFunction%")U=b("async function () {}");else if(L==="%GeneratorFunction%")U=b("function* () {}");else if(L==="%AsyncGeneratorFunction%")U=b("async function* () {}");else if(L==="%AsyncGenerator%"){var B=_("%AsyncGeneratorFunction%");B&&(U=B.prototype)}else if(L==="%AsyncIteratorPrototype%"){var Y=_("%AsyncGenerator%");Y&&y&&(U=y(Y.prototype))}return F[L]=U,U},Z={__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"]},A=Le(),re=yi(),P=A.call(E,Array.prototype.concat),R=A.call(I,Array.prototype.splice),H=A.call(E,String.prototype.replace),N=A.call(E,String.prototype.slice),D=A.call(E,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,J=/\\(\\)?/g,Q=function(_){var L=N(_,0,1),U=N(_,-1);if(L==="%"&&U!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");
vendor: 37,565 bytes, lines 57-63
57if(U==="%"&&L!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var B=[];return H(_,W,function(Y,K,M,fe){B[B.length]=M?H(fe,J,"$1"):K||Y}),B},ne=function(_,L){var U=_,B;if(re(Z,U)&&(B=Z[U],U="%"+B[0]+"%"),re(F,U)){var Y=F[U];if(Y===C&&(Y=ie(U)),typeof Y>"u"&&!L)throw new o("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:B,name:U,value:Y}}throw new n("intrinsic "+_+" does not exist!")};return wt=function(_,L){if(typeof _!="string"||_.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof L!="boolean")throw new o('"allowMissing" argument must be a boolean');if(D(/^%?[^%]*%?$/,_)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var U=Q(_),B=U.length>0?U[0]:"",Y=ne("%"+B+"%",L),K=Y.name,M=Y.value,fe=!1,me=Y.alias;me&&(B=me[0],R(U,P([0,1],me)));for(var ve=1,Oe=!0;ve<U.length;ve+=1){var ye=U[ve],ke=N(ye,0,1),Te=N(ye,-1);if((ke==='"'||ke==="'"||ke==="`"||Te==='"'||Te==="'"||Te==="`")&&ke!==Te)throw new n("property names with quotes must have matching quotes");if((ye==="constructor"||!Oe)&&(fe=!0),B+="."+ye,K="%"+B+"%",re(F,K))M=F[K];else if(M!=null){if(!(ye in M)){if(!L)throw new o("base intrinsic for "+_+" exists, but the property is not available.");return}if(g&&ve+1>=U.length){var Ne=g(M,ye);Oe=!!Ne,Oe&&"get"in Ne&&!("originalValue"in Ne.get)?M=Ne.get:M=M[ye]}else Oe=re(M,ye),M=M[ye];Oe&&!fe&&(F[K]=M)}}return M},wt}var An={exports:{}},St,Un;function bi(){if(Un)return St;Un=1;var e=Ze(),r=$a(),t=_e(),a=Xe();return St=function(p,i,n){if(!p||typeof p!="object"&&typeof p!="function")throw new t("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,f=!!a&&a(p,i);if(e)e(p,i,{configurable:c===null&&f?f.configurable:!c,enumerable:o===null&&f?f.enumerable:!o,value:n,writable:s===null&&f?f.writable:!s});else if(d||!o&&!s&&!c)p[i]=n;else throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},St}var kt,Dn;function gi(){if(Dn)return kt;Dn=1;var e=Ze(),r=function(){return!!e};return r.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},kt=r,kt}var Tt,Hn;function vi(){if(Hn)return Tt;Hn=1;var e=Yt(),r=bi(),t=gi()(),a=Xe(),p=_e(),i=e("%Math.floor%");return Tt=function(n,o){if(typeof n!="function")throw new p("`fn` is not a function");if(typeof o!="number"||o<0||o>4294967295||i(o)!==o)throw new p("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],c=!0,d=!0;if("length"in n&&a){var f=a(n,"length");f&&!f.configurable&&(c=!1),f&&!f.writable&&(d=!1)}return(c||d||!s)&&(t?r(n,"length",o,!0,!0):r(n,"length",o)),n},Tt}var Nt,_n;function xi(){if(_n)return Nt;_n=1;var e=Le(),r=Qt(),t=Sa();return Nt=function(){return t(e,r,arguments)},Nt}var Ln;function ji(){return Ln||(Ln=1,(function(e){var r=vi(),t=Ze(),a=ka(),p=xi();e.exports=function(i){var n=a(arguments),o=i.length-(arguments.length-1);return r(n,1+(o>0?o:0),!0)},t?t(e.exports,"apply",{value:p}):e.exports.apply=p})(An)),An.exports}var Ct,In;function $i(){if(In)return Ct;In=1;var e=Yt(),r=ji(),t=r(e("String.prototype.indexOf"));return Ct=function(a,p){var i=e(a,!!p);return typeof i=="function"&&t(a,".prototype.")>-1?r(i):i},Ct}const Oi={},wi=Object.freeze(Object.defineProperty({__proto__:null,default:Oi},Symbol.toStringTag,{value:"Module"})),Si=no(wi);var Pt,Mn;function ki(){if(Mn)return Pt;Mn=1;var e=typeof Map=="function"&&Map.prototype,r=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&r&&typeof r.get=="function"?r.get:null,a=e&&Map.prototype.forEach,p=typeof Set=="function"&&Set.prototype,i=Object.getOwnPropertyDescriptor&&p?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,n=p&&i&&typeof i.get=="function"?i.get:null,o=p&&Set.prototype.forEach,s=typeof WeakMap=="function"&&WeakMap.prototype,c=s?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,f=d?WeakSet.prototype.has:null,l=typeof WeakRef=="function"&&WeakRef.prototype,j=l?WeakRef.prototype.deref:null,x=Boolean.prototype.valueOf,u=Object.prototype.toString,m=Function.prototype.toString,b=String.prototype.match,g=String.prototype.slice,O=String.prototype.replace,k=String.prototype.toUpperCase,h=String.prototype.toLowerCase,S=RegExp.prototype.test,y=Array.prototype.concat,q=Array.prototype.join,T=Array.prototype.slice,I=Math.floor,E=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,F=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===F||!0)?Symbol.toStringTag:null,ie=Object.prototype.propertyIsEnumerable,Z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function A($,w){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||S.call(/e/,w))return w;var X=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var ee=$<0?-I(-$):I($);if(ee!==$){var oe=String(ee),z=g.call(w,oe.length+1);return O.call(oe,X,"$&_")+"."+O.call(O.call(z,/([0-9]{3})/g,"$&_"),/_$/,"")}}return O.call(w,X,"$&_")}var re=Si,P=re.custom,R=U(P)?P:null;Pt=function $(w,X,ee,oe){var z=X||{};if(K(z,"quoteStyle")&&z.quoteStyle!=="single"&&z.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(K(z,"maxStringLength")&&(typeof z.maxStringLength=="number"?z.maxStringLength<0&&z.maxStringLength!==1/0:z.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var xe=K(z,"customInspect")?z.customInspect:!0;if(typeof xe!="boolean"&&xe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(K(z,"indent")&&z.indent!==null&&z.indent!==" "&&!(parseInt(z.indent,10)===z.indent&&z.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(K(z,"numericSeparator")&&typeof z.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var we=z.numericSeparator;if(typeof w>"u")return"undefined";if(w===null)return"null";if(typeof w=="boolean")return w?"true":"false";if(typeof w=="string")return Zt(w,z);if(typeof w=="number"){if(w===0)return 1/0/w>0?"0":"-0";var he=String(w);return we?A(w,he):he}if(typeof w=="bigint"){var je=String(w)+"n";return we?A(w,je):je}var rt=typeof z.depth>"u"?5:z.depth;if(typeof ee>"u"&&(ee=0),ee>=rt&&rt>0&&typeof w=="object")return D(w)?"[Array]":"[Object]";var Ce=qa(z,ee);if(typeof oe>"u")oe=[];else if(me(oe,w)>=0)return"[Circular]";function be(Pe,Fe,Ea){if(Fe&&(oe=T.call(oe),oe.push(Fe)),Ea){var lr={depth:z.depth};return K(z,"quoteStyle")&&(lr.quoteStyle=z.quoteStyle),$(Pe,lr,ee+1,oe)}return $(Pe,z,ee+1,oe)}if(typeof w=="function"&&!J(w)){var tr=fe(w),rr=Ie(w,be);return"[Function"+(tr?": "+tr:" (anonymous)")+"]"+(rr.length>0?" { "+q.call(rr,", ")+" }":"")}if(U(w)){var nr=F?O.call(String(w),/^(Symbol\(.*\))_[^)]*$/,"$1"):ae.call(w);return typeof w=="object"&&!F?Re(nr):nr}if(Ne(w)){for(var Ee="<"+h.call(String(w.nodeName)),nt=w.attributes||[],Me=0;Me<nt.length;Me++)Ee+=" "+nt[Me].name+"="+H(N(nt[Me].value),"double",z);return Ee+=">",w.childNodes&&w.childNodes.length&&(Ee+="..."),Ee+="</"+h.call(String(w.nodeName))+">",Ee}if(D(w)){if(w.length===0)return"[]";var at=Ie(w,be);return Ce&&!Pa(at)?"["+tt(at,Ce)+"]":"[ "+q.call(at,", ")+" ]"}if(Q(w)){var ot=Ie(w,be);return!("cause"in Error.prototype)&&"cause"in w&&!ie.call(w,"cause")?"{ ["+String(w)+"] "+q.call(y.call("[cause]: "+be(w.cause),ot),", ")+" }":ot.length===0?"["+String(w)+"]":"{ ["+String(w)+"] "+q.call(ot,", ")+" }"}if(typeof w=="object"&&xe){if(R&&typeof w[R]=="function"&&re)return re(w,{depth:rt-ee});if(xe!=="symbol"&&typeof w.inspect=="function")return w.inspect()}if(ve(w)){var ar=[];return a&&a.call(w,function(Pe,Fe){ar.push(be(Fe,w,!0)+" => "+be(Pe,w))}),er("Map",t.call(w),ar,Ce)}if(ke(w)){var or=[];return o&&o.call(w,function(Pe){or.push(be(Pe,w))}),er("Set",n.call(w),or,Ce)}if(Oe(w))return et("WeakMap");if(Te(w))return et("WeakSet");if(ye(w))return et("WeakRef");if(_(w))return Re(be(Number(w)));if(B(w))return Re(be(E.call(w)));if(L(w))return Re(x.call(w));if(ne(w))return Re(be(String(w)));if(typeof window<"u"&&w===window)return"{ [object Window] }";if(typeof globalThis<"u"&&w===globalThis||typeof Ve<"u"&&w===Ve)return"{ [object globalThis] }";if(!W(w)&&!J(w)){var st=Ie(w,be),sr=Z?Z(w)===Object.prototype:w instanceof Object||w.constructor===Object,it=w instanceof Object?"":"null prototype",ir=!sr&&G&&Object(w)===w&&G in w?g.call(M(w),8,-1):it?"Object":"",Ra=sr||typeof w.constructor!="function"?"":w.constructor.name?w.constructor.name+" ":"",lt=Ra+(ir||it?"["+q.call(y.call([],ir||[],it||[]),": ")+"] ":"");return st.length===0?lt+"{}":Ce?lt+"{"+tt(st,Ce)+"}":lt+"{ "+q.call(st,", ")+" }"}return String(w)};function H($,w,X){var ee=(X.quoteStyle||w)==="double"?'"':"'";return ee+$+ee}function N($){return O.call(String($),/"/g,""")}function D($){return M($)==="[object Array]"&&(!G||!(typeof $=="object"&&G in $))}function W($){return M($)==="[object Date]"&&(!G||!(typeof $=="object"&&G in $))}function J($){return M($)==="[object RegExp]"&&(!G||!(typeof $=="object"&&G in $))}function Q($){return M($)==="[object Error]"&&(!G||!(typeof $=="object"&&G in $))}function ne($){return M($)==="[object String]"&&(!G||!(typeof $=="object"&&G in $))}function _($){return M($)==="[object Number]"&&(!G||!(typeof $=="object"&&G in $))}function L($){return M($)==="[object Boolean]"&&(!G||!(typeof $=="object"&&G in $))}function U($){if(F)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!ae)return!1;try{return ae.call($),!0}catch{}return!1}function B($){if(!$||typeof $!="object"||!E)return!1;try{return E.call($),!0}catch{}return!1}var Y=Object.prototype.hasOwnProperty||function($){return $ in this};function K($,w){return Y.call($,w)}function M($){return u.call($)}function fe($){if($.name)return $.name;var w=b.call(m.call($),/^function\s*([\w$]+)/);return w?w[1]:null}function me($,w){if($.indexOf)return $.indexOf(w);for(var X=0,ee=$.length;X<ee;X++)if($[X]===w)return X;return-1}function ve($){if(!t||!$||typeof $!="object")return!1;try{t.call($);try{n.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function Oe($){if(!c||!$||typeof $!="object")return!1;try{c.call($,c);try{f.call($,f)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function ye($){if(!j||!$||typeof $!="object")return!1;try{return j.call($),!0}catch{}return!1}function ke($){if(!n||!$||typeof $!="object")return!1;try{n.call($);try{t.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function Te($){if(!f||!$||typeof $!="object")return!1;try{f.call($,f);try{c.call($,c)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function Ne($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function Zt($,w){if($.length>w.maxStringLength){var X=$.length-w.maxStringLength,ee="... "+X+" more character"+(X>1?"s":"");return Zt(g.call($,0,w.maxStringLength),w)+ee}var oe=O.call(O.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ca);return H(oe,"single",w)}function Ca($){var w=$.charCodeAt(0),X={8:"b",9:"t",10:"n",12:"f",13:"r"}[w];return X?"\\"+X:"\\x"+(w<16?"0":"")+k.call(w.toString(16))}function Re($){return"Object("+$+")"}function et($){return $+" { ? }"}function er($,w,X,ee){var oe=ee?tt(X,ee):q.call(X,", ");return $+" ("+w+") {"+oe+"}"}function Pa($){for(var w=0;w<$.length;w++)if(me($[w],` 58`)>=0)return!1;return!0}function qa($,w){var X;if($.indent===" ")X=" ";else if(typeof $.indent=="number"&&$.indent>0)X=q.call(Array($.indent+1)," ");else return null;return{base:X,prev:q.call(Array(w+1),X)}}function tt($,w){if($.length===0)return"";var X=` 59`+w.prev+w.base;return X+q.call($,","+X)+` 60`+w.prev}function Ie($,w){var X=D($),ee=[];if(X){ee.length=$.length;for(var oe=0;oe<$.length;oe++)ee[oe]=K($,oe)?w($[oe],$):""}var z=typeof C=="function"?C($):[],xe;if(F){xe={};for(var we=0;we<z.length;we++)xe["$"+z[we]]=z[we]}for(var he in $)K($,he)&&(X&&String(Number(he))===he&&he<$.length||F&&xe["$"+he]instanceof Symbol||(S.call(/[^\w$]/,he)?ee.push(w(he,$)+": "+w($[he],$)):ee.push(he+": "+w($[he],$))));if(typeof C=="function")for(var je=0;je<z.length;je++)ie.call($,z[je])&&ee.push("["+w(z[je])+"]: "+w($[z[je]],$));return ee}return Pt}var qt,Fn;function Ti(){if(Fn)return qt;Fn=1;var e=Yt(),r=$i(),t=ki(),a=_e(),p=e("%WeakMap%",!0),i=e("%Map%",!0),n=r("WeakMap.prototype.get",!0),o=r("WeakMap.prototype.set",!0),s=r("WeakMap.prototype.has",!0),c=r("Map.prototype.get",!0),d=r("Map.prototype.set",!0),f=r("Map.prototype.has",!0),l=function(m,b){for(var g=m,O;(O=g.next)!==null;g=O)if(O.key===b)return g.next=O.next,O.next=m.next,m.next=O,O},j=function(m,b){var g=l(m,b);return g&&g.value},x=function(m,b,g){var O=l(m,b);O?O.value=g:m.next={key:b,next:m.next,value:g}},u=function(m,b){return!!l(m,b)};return qt=function(){var m,b,g,O={assert:function(k){if(!O.has(k))throw new a("Side channel does not contain "+t(k))},get:function(k){if(p&&k&&(typeof k=="object"||typeof k=="function")){if(m)return n(m,k)}else if(i){if(b)return c(b,k)}else if(g)return j(g,k)},has:function(k){if(p&&k&&(typeof k=="object"||typeof k=="function")){if(m)return s(m,k)}else if(i){if(b)return f(b,k)}else if(g)return u(g,k);return!1},set:function(k,h){p&&k&&(typeof k=="object"||typeof k=="function")?(m||(m=new p),o(m,k,h)):i?(b||(b=new i),d(b,k,h)):(g||(g={key:{},next:null}),x(g,k,h))}};return O},qt}var Rt,Bn;function Xt(){if(Bn)return Rt;Bn=1;var e=String.prototype.replace,r=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Rt={default:t.RFC3986,formatters:{RFC1738:function(a){return e.call(a,r,"+")},RFC3986:function(a){return String(a)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Rt}var Et,zn;function Ta(){if(zn)return Et;zn=1;var e=Xt(),r=Object.prototype.hasOwnProperty,t=Array.isArray,a=(function(){for(var m=[],b=0;b<256;++b)m.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return m})(),p=function(m){for(;m.length>1;){var b=m.pop(),g=b.obj[b.prop];if(t(g)){for(var O=[],k=0;k<g.length;++k)typeof g[k]<"u"&&O.push(g[k]);b.obj[b.prop]=O}}},i=function(m,b){for(var g=b&&b.plainObjects?Object.create(null):{},O=0;O<m.length;++O)typeof m[O]<"u"&&(g[O]=m[O]);return g},n=function m(b,g,O){if(!g)return b;if(typeof g!="object"){if(t(b))b.push(g);else if(b&&typeof b=="object")(O&&(O.plainObjects||O.allowPrototypes)||!r.call(Object.prototype,g))&&(b[g]=!0);else return[b,g];return b}if(!b||typeof b!="object")return[b].concat(g);var k=b;return t(b)&&!t(g)&&(k=i(b,O)),t(b)&&t(g)?(g.forEach(function(h,S){if(r.call(b,S)){var y=b[S];y&&typeof y=="object"&&h&&typeof h=="object"?b[S]=m(y,h,O):b.push(h)}else b[S]=h}),b):Object.keys(g).reduce(function(h,S){var y=g[S];return r.call(h,S)?h[S]=m(h[S],y,O):h[S]=y,h},k)},o=function(m,b){return Object.keys(b).reduce(function(g,O){return g[O]=b[O],g},m)},s=function(m,b,g){var O=m.replace(/\+/g," ");if(g==="iso-8859-1")return O.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(O)}catch{return O}},c=1024,d=function(m,b,g,O,k){if(m.length===0)return m;var h=m;if(typeof m=="symbol"?h=Symbol.prototype.toString.call(m):typeof m!="string"&&(h=String(m)),g==="iso-8859-1")return escape(h).replace(/%u[0-9a-f]{4}/gi,function(C){return"%26%23"+parseInt(C.slice(2),16)+"%3B"});for(var S="",y=0;y<h.length;y+=c){for(var q=h.length>=c?h.slice(y,y+c):h,T=[],I=0;I<q.length;++I){var E=q.charCodeAt(I);if(E===45||E===46||E===95||E===126||E>=48&&E<=57||E>=65&&E<=90||E>=97&&E<=122||k===e.RFC1738&&(E===40||E===41)){T[T.length]=q.charAt(I);continue}if(E<128){T[T.length]=a[E];continue}if(E<2048){T[T.length]=a[192|E>>6]+a[128|E&63];continue}if(E<55296||E>=57344){T[T.length]=a[224|E>>12]+a[128|E>>6&63]+a[128|E&63];continue}I+=1,E=65536+((E&1023)<<10|q.charCodeAt(I)&1023),T[T.length]=a[240|E>>18]+a[128|E>>12&63]+a[128|E>>6&63]+a[128|E&63]}S+=T.join("")}return S},f=function(m){for(var b=[{obj:{o:m},prop:"o"}],g=[],O=0;O<b.length;++O)for(var k=b[O],h=k.obj[k.prop],S=Object.keys(h),y=0;y<S.length;++y){var q=S[y],T=h[q];typeof T=="object"&&T!==null&&g.indexOf(T)===-1&&(b.push({obj:h,prop:q}),g.push(T))}return p(b),m},l=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},j=function(m){return!m||typeof m!="object"?!1:!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},x=function(m,b){return[].concat(m,b)},u=function(m,b){if(t(m)){for(var g=[],O=0;O<m.length;O+=1)g.push(b(m[O]));return g}return b(m)};return Et={arrayToObject:i,assign:o,combine:x,compact:f,decode:s,encode:d,isBuffer:j,isRegExp:l,maybeMap:u,merge:n},Et}var At,Jn;function Ni(){if(Jn)return At;Jn=1;var e=Ti(),r=Ta(),t=Xt(),a=Object.prototype.hasOwnProperty,p={brackets:function(u){return u+"[]"},comma:"comma",indices:function(u,m){return u+"["+m+"]"},repeat:function(u){return u}},i=Array.isArray,n=Array.prototype.push,o=function(u,m){n.apply(u,i(m)?m:[m])},s=Date.prototype.toISOString,c=t.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,format:c,formatter:t.formatters[c],indices:!1,serializeDate:function(u){return s.call(u)},skipNulls:!1,strictNullHandling:!1},f=function(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u=="symbol"||typeof u=="bigint"},l={},j=function u(m,b,g,O,k,h,S,y,q,T,I,E,C,ae,F,G,ie,Z){for(var A=m,re=Z,P=0,R=!1;(re=re.get(l))!==void 0&&!R;){var H=re.get(m);if(P+=1,typeof H<"u"){if(H===P)throw new RangeError("Cyclic object value");R=!0}typeof re.get(l)>"u"&&(P=0)}if(typeof T=="function"?A=T(b,A):A instanceof Date?A=C(A):g==="comma"&&i(A)&&(A=r.maybeMap(A,function(M){return M instanceof Date?C(M):M})),A===null){if(h)return q&&!G?q(b,d.encoder,ie,"key",ae):b;A=""}if(f(A)||r.isBuffer(A)){if(q){var N=G?b:q(b,d.encoder,ie,"key",ae);return[F(N)+"="+F(q(A,d.encoder,ie,"value",ae))]}return[F(b)+"="+F(String(A))]}var D=[];if(typeof A>"u")return D;var W;if(g==="comma"&&i(A))G&&q&&(A=r.maybeMap(A,q)),W=[{value:A.length>0?A.join(",")||null:void 0}];else if(i(T))W=T;else{var J=Object.keys(A);W=I?J.sort(I):J}var Q=y?b.replace(/\./g,"%2E"):b,ne=O&&i(A)&&A.length===1?Q+"[]":Q;if(k&&i(A)&&A.length===0)return ne+"[]";for(var _=0;_<W.length;++_){var L=W[_],U=typeof L=="object"&&typeof L.value<"u"?L.value:A[L];if(!(S&&U===null)){var B=E&&y?L.replace(/\./g,"%2E"):L,Y=i(A)?typeof g=="function"?g(ne,B):ne:ne+(E?"."+B:"["+B+"]");Z.set(m,P);var K=e();K.set(l,Z),o(D,u(U,Y,g,O,k,h,S,y,g==="comma"&&G&&i(A)?null:q,T,I,E,C,ae,F,G,ie,K))}}return D},x=function(u){if(!u)return d;if(typeof u.allowEmptyArrays<"u"&&typeof u.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof u.encodeDotInKeys<"u"&&typeof u.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(u.encoder!==null&&typeof u.encoder<"u"&&typeof u.encoder!="function")throw new TypeError("Encoder has to be a function.");var m=u.charset||d.charset;if(typeof u.charset<"u"&&u.charset!=="utf-8"&&u.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var b=t.default;if(typeof u.format<"u"){if(!a.call(t.formatters,u.format))throw new TypeError("Unknown format option provided.");b=u.format}var g=t.formatters[b],O=d.filter;(typeof u.filter=="function"||i(u.filter))&&(O=u.filter);var k;if(u.arrayFormat in p?k=u.arrayFormat:"indices"in u?k=u.indices?"indices":"repeat":k=d.arrayFormat,"commaRoundTrip"in u&&typeof u.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=typeof u.allowDots>"u"?u.encodeDotInKeys===!0?!0:d.allowDots:!!u.allowDots;return{addQueryPrefix:typeof u.addQueryPrefix=="boolean"?u.addQueryPrefix:d.addQueryPrefix,allowDots:h,allowEmptyArrays:typeof u.allowEmptyArrays=="boolean"?!!u.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:k,charset:m,charsetSentinel:typeof u.charsetSentinel=="boolean"?u.charsetSentinel:d.charsetSentinel,commaRoundTrip:u.commaRoundTrip,delimiter:typeof u.delimiter>"u"?d.delimiter:u.delimiter,encode:typeof u.encode=="boolean"?u.encode:d.encode,encodeDotInKeys:typeof u.encodeDotInKeys=="boolean"?u.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof u.encoder=="function"?u.encoder:d.encoder,encodeValuesOnly:typeof u.encodeValuesOnly=="boolean"?u.encodeValuesOnly:d.encodeValuesOnly,filter:O,format:b,formatter:g,serializeDate:typeof u.serializeDate=="function"?u.serializeDate:d.serializeDate,skipNulls:typeof u.skipNulls=="boolean"?u.skipNulls:d.skipNulls,sort:typeof u.sort=="function"?u.sort:null,strictNullHandling:typeof u.strictNullHandling=="boolean"?u.strictNullHandling:d.strictNullHandling}};return At=function(u,m){var b=u,g=x(m),O,k;typeof g.filter=="function"?(k=g.filter,b=k("",b)):i(g.filter)&&(k=g.filter,O=k);var h=[];if(typeof b!="object"||b===null)return"";var S=p[g.arrayFormat],y=S==="comma"&&g.commaRoundTrip;O||(O=Object.keys(b)),g.sort&&O.sort(g.sort);for(var q=e(),T=0;T<O.length;++T){var I=O[T];g.skipNulls&&b[I]===null||o(h,j(b[I],I,S,y,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,q))}var E=h.join(g.delimiter),C=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),E.length>0?C+E:""},At}var Ut,Wn;function Ci(){if(Wn)return Ut;Wn=1;var e=Ta(),r=Object.prototype.hasOwnProperty,t=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},p=function(l){return l.replace(/&#(\d+);/g,function(j,x){return String.fromCharCode(parseInt(x,10))})},i=function(l,j){return l&&typeof l=="string"&&j.comma&&l.indexOf(",")>-1?l.split(","):l},n="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",s=function(l,j){var x={__proto__:null},u=j.ignoreQueryPrefix?l.replace(/^\?/,""):l;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=j.parameterLimit===1/0?void 0:j.parameterLimit,b=u.split(j.delimiter,m),g=-1,O,k=j.charset;if(j.charsetSentinel)for(O=0;O<b.length;++O)b[O].indexOf("utf8=")===0&&(b[O]===o?k="utf-8":b[O]===n&&(k="iso-8859-1"),g=O,O=b.length);for(O=0;O<b.length;++O)if(O!==g){var h=b[O],S=h.indexOf("]="),y=S===-1?h.indexOf("="):S+1,q,T;y===-1?(q=j.decoder(h,a.decoder,k,"key"),T=j.strictNullHandling?null:""):(q=j.decoder(h.slice(0,y),a.decoder,k,"key"),T=e.maybeMap(i(h.slice(y+1),j),function(E){return j.decoder(E,a.decoder,k,"value")})),T&&j.interpretNumericEntities&&k==="iso-8859-1"&&(T=p(T)),h.indexOf("[]=")>-1&&(T=t(T)?[T]:T);var I=r.call(x,q);I&&j.duplicates==="combine"?x[q]=e.combine(x[q],T):(!I||j.duplicates==="last")&&(x[q]=T)}return x},c=function(l,j,x,u){for(var m=u?j:i(j,x),b=l.length-1;b>=0;--b){var g,O=l[b];if(O==="[]"&&x.parseArrays)g=x.allowEmptyArrays&&(m===""||x.strictNullHandling&&m===null)?[]:[].concat(m);else{g=x.plainObjects?Object.create(null):{};var k=O.charAt(0)==="["&&O.charAt(O.length-1)==="]"?O.slice(1,-1):O,h=x.decodeDotInKeys?k.replace(/%2E/g,"."):k,S=parseInt(h,10);!x.parseArrays&&h===""?g={0:m}:!isNaN(S)&&O!==h&&String(S)===h&&S>=0&&x.parseArrays&&S<=x.arrayLimit?(g=[],g[S]=m):h!=="__proto__"&&(g[h]=m)}m=g}return m},d=function(l,j,x,u){if(l){var m=x.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l,b=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,O=x.depth>0&&b.exec(m),k=O?m.slice(0,O.index):m,h=[];if(k){if(!x.plainObjects&&r.call(Object.prototype,k)&&!x.allowPrototypes)return;h.push(k)}for(var S=0;x.depth>0&&(O=g.exec(m))!==null&&S<x.depth;){if(S+=1,!x.plainObjects&&r.call(Object.prototype,O[1].slice(1,-1))&&!x.allowPrototypes)return;h.push(O[1])}if(O){if(x.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+x.depth+" and strictDepth is true");h.push("["+m.slice(O.index)+"]")}return c(h,j,x,u)}},f=function(l){if(!l)return a;if(typeof l.allowEmptyArrays<"u"&&typeof l.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof l.decodeDotInKeys<"u"&&typeof l.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(l.decoder!==null&&typeof l.decoder<"u"&&typeof l.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof l.charset<"u"&&l.charset!=="utf-8"&&l.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var j=typeof l.charset>"u"?a.charset:l.charset,x=typeof l.duplicates>"u"?a.duplicates:l.duplicates;if(x!=="combine"&&x!=="first"&&x!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var u=typeof l.allowDots>"u"?l.decodeDotInKeys===!0?!0:a.allowDots:!!l.allowDots;return{allowDots:u,allowEmptyArrays:typeof l.allowEmptyArrays=="boolean"?!!l.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof l.allowPrototypes=="boolean"?l.allowPrototypes:a.allowPrototypes,allowSparse:typeof l.allowSparse=="boolean"?l.allowSparse:a.allowSparse,arrayLimit:typeof l.arrayLimit=="number"?l.arrayLimit:a.arrayLimit,charset:j,charsetSentinel:typeof l.charsetSentinel=="boolean"?l.charsetSentinel:a.charsetSentinel,comma:typeof l.comma=="boolean"?l.comma:a.comma,decodeDotInKeys:typeof l.decodeDotInKeys=="boolean"?l.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof l.decoder=="function"?l.decoder:a.decoder,delimiter:typeof l.delimiter=="string"||e.isRegExp(l.delimiter)?l.delimiter:a.delimiter,depth:typeof l.depth=="number"||l.depth===!1?+l.depth:a.depth,duplicates:x,ignoreQueryPrefix:l.ignoreQueryPrefix===!0,interpretNumericEntities:typeof l.interpretNumericEntities=="boolean"?l.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof l.parameterLimit=="number"?l.parameterLimit:a.parameterLimit,parseArrays:l.parseArrays!==!1,plainObjects:typeof l.plainObjects=="boolean"?l.plainObjects:a.plainObjects,strictDepth:typeof l.strictDepth=="boolean"?!!l.strictDepth:a.strictDepth,strictNullHandling:typeof l.strictNullHandling=="boolean"?l.strictNullHandling:a.strictNullHandling}};return Ut=function(l,j){var x=f(j);if(l===""||l===null||typeof l>"u")return x.plainObjects?Object.create(null):{};for(var u=typeof l=="string"?s(l,x):l,m=x.plainObjects?Object.create(null):{},b=Object.keys(u),g=0;g<b.length;++g){var O=b[g],k=d(O,u[O],x,typeof l=="string");m=e.merge(m,k,x)}return x.allowSparse===!0?m:e.compact(m)},Ut}var Dt,Vn;function Na(){if(Vn)return Dt;Vn=1;var e=Ni(),r=Ci(),t=Xt();return Dt={formats:t,parse:r,stringify:e},Dt}var Gn;function Pi(){if(Gn)return Se;Gn=1;var e=Ks();function r(){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 t=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,i=["<",">",'"',"`"," ","\r",` 61`," "],n=["{","}","|","\\","^","`"].concat(i),o=["'"].concat(n),s=["%","/","?",";","#"].concat(o),c=["/","?","#"],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,l=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,j={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},u={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=Na();function b(h,S,y){if(h&&typeof h=="object"&&h instanceof r)return h;var q=new r;return q.parse(h,S,y),q}r.prototype.parse=function(h,S,y){if(typeof h!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof h);var q=h.indexOf("?"),T=q!==-1&&q<h.indexOf("#")?"?":"#",I=h.split(T),E=/\\/g;I[0]=I[0].replace(E,"/"),h=I.join(T);var C=h;if(C=C.trim(),!y&&h.split("#").length===1){var ae=p.exec(C);if(ae)return this.path=C,this.href=C,this.pathname=ae[1],ae[2]?(this.search=ae[2],S?this.query=m.parse(this.search.substr(1)):this.query=this.search.substr(1)):S&&(this.search="",this.query={}),this}var F=t.exec(C);if(F){F=F[0];var G=F.toLowerCase();this.protocol=G,C=C.substr(F.length)}if(y||F||C.match(/^\/\/[^@/]+@[^@/]+/)){var ie=C.substr(0,2)==="//";ie&&!(F&&x[F])&&(C=C.substr(2),this.slashes=!0)}if(!x[F]&&(ie||F&&!u[F])){for(var Z=-1,A=0;A<c.length;A++){var re=C.indexOf(c[A]);re!==-1&&(Z===-1||re<Z)&&(Z=re)}var P,R;Z===-1?R=C.lastIndexOf("@"):R=C.lastIndexOf("@",Z),R!==-1&&(P=C.slice(0,R),C=C.slice(R+1),this.auth=decodeURIComponent(P)),Z=-1;for(var A=0;A<s.length;A++){var re=C.indexOf(s[A]);re!==-1&&(Z===-1||re<Z)&&(Z=re)}Z===-1&&(Z=C.length),this.host=C.slice(0,Z),C=C.slice(Z),this.parseHost(),this.hostname=this.hostname||"";var H=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!H)for(var N=this.hostname.split(/\./),A=0,D=N.length;A<D;A++){var W=N[A];if(W&&!W.match(f)){for(var J="",Q=0,ne=W.length;Q<ne;Q++)W.charCodeAt(Q)>127?J+="x":J+=W[Q];if(!J.match(f)){var _=N.slice(0,A),L=N.slice(A+1),U=W.match(l);U&&(_.push(U[1]),L.unshift(U[2])),L.length&&(C="/"+L.join(".")+C),this.hostname=_.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),H||(this.hostname=e.toASCII(this.hostname));var B=this.port?":"+this.port:"",Y=this.hostname||"";this.host=Y+B,this.href+=this.host,H&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!j[G])for(var A=0,D=o.length;A<D;A++){var K=o[A];if(C.indexOf(K)!==-1){var M=encodeURIComponent(K);M===K&&(M=escape(K)),C=C.split(K).join(M)}}var fe=C.indexOf("#");fe!==-1&&(this.hash=C.substr(fe),C=C.slice(0,fe));var me=C.indexOf("?");if(me!==-1?(this.search=C.substr(me),this.query=C.substr(me+1),S&&(this.query=m.parse(this.query)),C=C.slice(0,me)):S&&(this.search="",this.query={}),C&&(this.pathname=C),u[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var B=this.pathname||"",ve=this.search||"";this.path=B+ve}return this.href=this.format(),this};function g(h){return typeof h=="string"&&(h=b(h)),h instanceof r?h.format():r.prototype.format.call(h)}r.prototype.format=function(){var h=this.auth||"";h&&(h=encodeURIComponent(h),h=h.replace(/%3A/i,":"),h+="@");var S=this.protocol||"",y=this.pathname||"",q=this.hash||"",T=!1,I="";this.host?T=h+this.host:this.hostname&&(T=h+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(T+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(I=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var E=this.search||I&&"?"+I||"";return S&&S.substr(-1)!==":"&&(S+=":"),this.slashes||(!S||u[S])&&T!==!1?(T="//"+(T||""),y&&y.charAt(0)!=="/"&&(y="/"+y)):T||(T=""),q&&q.charAt(0)!=="#"&&(q="#"+q),E&&E.charAt(0)!=="?"&&(E="?"+E),y=y.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),E=E.replace("#","%23"),S+T+y+E+q};function O(h,S){return b(h,!1,!0).resolve(S)}r.prototype.resolve=function(h){return this.resolveObject(b(h,!1,!0)).format()};function k(h,S){return h?b(h,!1,!0).resolveObject(S):S}return r.prototype.resolveObject=function(h){if(typeof h=="string"){var S=new r;S.parse(h,!1,!0),h=S}for(var y=new r,q=Object.keys(this),T=0;T<q.length;T++){var I=q[T];y[I]=this[I]}if(y.hash=h.hash,h.href==="")return y.href=y.format(),y;if(h.slashes&&!h.protocol){for(var E=Object.keys(h),C=0;C<E.length;C++){var ae=E[C];ae!=="protocol"&&(y[ae]=h[ae])}return u[y.protocol]&&y.hostname&&!y.pathname&&(y.pathname="/",y.path=y.pathname),y.href=y.format(),y}if(h.protocol&&h.protocol!==y.protocol){if(!u[h.protocol]){for(var F=Object.keys(h),G=0;G<F.length;G++){var ie=F[G];y[ie]=h[ie]}return y.href=y.format(),y}if(y.protocol=h.protocol,!h.host&&!x[h.protocol]){for(var D=(h.pathname||"").split("/");D.length&&!(h.host=D.shift()););h.host||(h.host=""),h.hostname||(h.hostname=""),D[0]!==""&&D.unshift(""),D.length<2&&D.unshift(""),y.pathname=D.join("/")}else y.pathname=h.pathname;if(y.search=h.search,y.query=h.query,y.host=h.host||"",y.auth=h.auth,y.hostname=h.hostname||h.host,y.port=h.port,y.pathname||y.search){var Z=y.pathname||"",A=y.search||"";y.path=Z+A}return y.slashes=y.slashes||h.slashes,y.href=y.format(),y}var re=y.pathname&&y.pathname.charAt(0)==="/",P=h.host||h.pathname&&h.pathname.charAt(0)==="/",R=P||re||y.host&&h.pathname,H=R,N=y.pathname&&y.pathname.split("/")||[],D=h.pathname&&h.pathname.split("/")||[],W=y.protocol&&!u[y.protocol];if(W&&(y.hostname="",y.port=null,y.host&&(N[0]===""?N[0]=y.host:N.unshift(y.host)),y.host="",h.protocol&&(h.hostname=null,h.port=null,h.host&&(D[0]===""?D[0]=h.host:D.unshift(h.host)),h.host=null),R=R&&(D[0]===""||N[0]==="")),P)y.host=h.host||h.host===""?h.host:y.host,y.hostname=h.hostname||h.hostname===""?h.hostname:y.hostname,y.search=h.search,y.query=h.query,N=D;else if(D.length)N||(N=[]),N.pop(),N=N.concat(D),y.search=h.search,y.query=h.query;else if(h.search!=null){if(W){y.host=N.shift(),y.hostname=y.host;var J=y.host&&y.host.indexOf("@")>0?y.host.split("@"):!1;J&&(y.auth=J.shift(),y.hostname=J.shift(),y.host=y.hostname)}return y.search=h.search,y.query=h.query,(y.pathname!==null||y.search!==null)&&(y.path=(y.pathname?y.pathname:"")+(y.search?y.search:"")),y.href=y.format(),y}if(!N.length)return y.pathname=null,y.search?y.path="/"+y.search:y.path=null,y.href=y.format(),y;for(var Q=N.slice(-1)[0],ne=(y.host||h.host||N.length>1)&&(Q==="."||Q==="..")||Q==="",_=0,L=N.length;L>=0;L--)Q=N[L],Q==="."?N.splice(L,1):Q===".."?(N.splice(L,1),_++):_&&(N.splice(L,1),_--);if(!R&&!H)for(;_--;_)N.unshift("..");R&&N[0]!==""&&(!N[0]||N[0].charAt(0)!=="/")&&N.unshift(""),ne&&N.join("/").substr(-1)!=="/"&&N.push("");var U=N[0]===""||N[0]&&N[0].charAt(0)==="/";if(W){y.hostname=U?"":N.length?N.shift():"",y.host=y.hostname;var J=y.host&&y.host.indexOf("@")>0?y.host.split("@"):!1;J&&(y.auth=J.shift(),y.hostname=J.shift(),y.host=y.hostname)}return R=R||y.host&&N.length,R&&!U&&N.unshift(""),N.length>0?y.pathname=N.join("/"):(y.pathname=null,y.path=null),(y.pathname!==null||y.search!==null)&&(y.path=(y.pathname?y.pathname:"")+(y.search?y.search:"")),y.auth=h.auth||y.auth,y.slashes=y.slashes||h.slashes,y.href=y.format(),y},r.prototype.parseHost=function(){var h=this.host,S=a.exec(h);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),h=h.substr(0,h.length-S.length)),h&&(this.hostname=h)},Se.parse=b,Se.resolve=O,Se.resolveObject=k,Se.format=g,Se.Url=r,Se}var Ht=Pi(),_t=Na(),qi=e=>typeof e=="object"&&"log"in e&&typeof e.log=="object"&&"entries"in e.log&&Array.isArray(e.log.entries),Ri=class{constructor(e,r={}){this.initCalled=!1,this.entries=[],this.requests=[],this.options={},this.options={harIsAlreadyEncoded:!1,...r},this.requests=[],qi(e)?this.entries=e.log.entries:this.entries=[{request:e}]}init(){return this.initCalled=!0,this.requests=this.entries.map(({request:e})=>{const r={bodySize:0,headersSize:0,headers:[],cookies:[],httpVersion:"HTTP/1.1",queryString:[],postData:{mimeType:e.postData?.mimeType||"application/octet-stream"},...e};return r.postData&&!r.postData.mimeType&&(r.postData.mimeType="application/octet-stream"),this.prepare(r,this.options)}),this}prepare(e,r){const t={...e,fullUrl:"",uriObj:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{}};if(t.queryString&&t.queryString.length&&(t.queryObj=t.queryString.reduce(hr,{})),t.headers&&t.headers.length){const d=/^HTTP\/2/;t.headersObj=t.headers.reduce((f,{name:l,value:j})=>{const x=d.exec(t.httpVersion)?l.toLocaleLowerCase():l;return{...f,[x]:j}},{})}t.cookies&&t.cookies.length&&(t.cookiesObj=t.cookies.reduceRight((d,{name:f,value:l})=>({...d,[f]:l}),{}));const a=t.cookies?.map(({name:d,value:f})=>r.harIsAlreadyEncoded?`${d}=${f}`:`${encodeURIComponent(d)}=${encodeURIComponent(f)}`);switch(a?.length&&(t.allHeaders.cookie=a.join("; ")),t.postData.mimeType){case"multipart/mixed":case"multipart/related":case"multipart/form-data":case"multipart/alternative":if(t.postData.text="",t.postData.mimeType="multipart/form-data",t.postData?.params){const d="---011000010111000001101001",f=`${d}--`,l=`\r 62`,j=b=>b.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=b=>b.replace(/\r?\n|\r/g,`\r 63`),u=[`--${d}`];
63t.postData?.params.forEach((b,g)=>{const O=b.name,k=b.value||"",h=b.fileName||null,S=b.contentType||"application/octet-stream";h?(u.push(`Content-Disposition: form-data; name="${j(x(O))}"; filename="${h}"`),u.push(`Content-Type: ${S}`)):u.push(`Content-Disposition: form-data; name="${j(x(O))}"`),u.push(""),u.push(x(k)),g!==t.postData.params.length-1&&u.push(`--${d}`)}),u.push(`--${f}`),t.postData.boundary=d,t.postData.text=u.join(l);const m=ue(t.headersObj,"content-type")||"content-type";t.headersObj[m]=`multipart/form-data; boundary=${d}`}break;case"application/x-www-form-urlencoded":t.postData.params?(t.postData.paramsObj=t.postData.params.reduce(hr,{}),t.postData.text=_t.stringify(t.postData.paramsObj)):t.postData.text="";break;case"text/json":case"text/x-json":case"application/json":case"application/x-json":if(t.postData.mimeType="application/json",t.postData.text)try{t.postData.jsonObj=JSON.parse(t.postData.text)}catch{t.postData.mimeType="text/plain"}break}const p={...t.allHeaders,...t.headersObj},i=Ht.parse(t.url,!0,!0);t.queryObj={...t.queryObj,...i.query};let n;r.harIsAlreadyEncoded?n=_t.stringify(t.queryObj,{encode:!1,indices:!1}):n=_t.stringify(t.queryObj,{indices:!1});const o={...i,query:t.queryObj,search:n,path:n?`${i.pathname}?${n}`:i.pathname},s=Ht.format({...i,query:null,search:null}),c=Ht.format({...i,...o});return{...t,allHeaders:p,fullUrl:c,url:s,uriObj:o}}convert(e,r,t){this.initCalled||this.init(),!t&&r&&(t=r);const a=Vs[e];if(!a)return!1;const{convert:p}=a.clientsById[r||a.info.default];return this.requests.map(i=>p(i,t))}};const Ei=({operation:e,selectedServer:r,exampleBody:t})=>new Ri({method:e.method.toUpperCase(),url:r+e.path.replaceAll("{",":").replaceAll("}",""),postData:t,headers:[...t.text?[{name:"Content-Type",value:t.mimeType}]:[],...e.parameters?.filter(a=>a.in==="header"&&a.required===!0).map(a=>({name:a.name,value:a.schema?.default??a.examples?.find(p=>p.value)?.value??(a.schema?.type==="string"?"<string>":a.schema?.type==="number"||a.schema?.type==="integer"?"<number>":a.schema?.type==="boolean"?"<bool>":"<value>")}))??[]],queryString:e.parameters?.filter(a=>a.in==="query"&&a.required===!0).map(a=>({name:a.name,value:a.schema?.default??a.examples?.find(p=>p.value)?.value??(a.schema?.type==="string"?"<string>":a.schema?.type==="number"||a.schema?.type==="integer"?"<number>":a.schema?.type==="boolean"?"<bool>":"<value>")}))??[],httpVersion:"",cookies:[],headersSize:0,bodySize:0}),Ai=(e,r)=>{let t;switch(r){case"shell":t=e.convert("shell","curl");break;case"js":t=e.convert("javascript","fetch");break;case"python":t=e.convert("python","requests");break;case"java":t=e.convert("java","okhttp");break;case"go":t=e.convert("go","native");break;case"csharp":t=e.convert("csharp","httpclient");break;case"kotlin":t=e.convert("kotlin","okhttp");break;case"objc":t=e.convert("objc","nsurlsession");break;case"php":t=e.convert("php","http2");break;case"ruby":t=e.convert("ruby");break;case"swift":t=e.convert("swift");break;default:t=e.convert("shell");break}return t?t[0]:""},Ui=He(` 64 query getServerQuery($input: JSON!, $type: SchemaType!) { 65 schema(input: $input, type: $type) { 66 url 67 servers { 68 url 69 } 70 } 71 } 72`),Di=[{value:"shell",label:"cURL"},{value:"js",label:"JavaScript"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"go",label:"Go"},{value:"csharp",label:"C#"},{value:"kotlin",label:"Kotlin"},{value:"objc",label:"Objective-C"},{value:"php",label:"PHP"},{value:"ruby",label:"Ruby"},{value:"swift",label:"Swift"}],Hi=({operation:e,selectedResponse:r,onSelectResponse:t})=>{const{input:a,type:p,options:i}=Qe(),n=Ga(),o=Je(Ui,{input:a,type:p}),s=zt(o),c=go(),d=aa(e.method),[f,l]=Ka(),[,j]=se.useTransition(),[x,u]=se.useState(),m=f.get("lang")??i?.examplesLanguage??"shell",b=e.requestBody?.content,g=b&&i?.transformExamples?i.transformExamples({auth:n,type:"request",operation:e,content:b,context:c}):b,O=v.jsx(Qa,{path:e.path,renderParam:({name:T})=>v.jsx(ua,{name:T,backgroundOpacity:"0",slug:`${e.slug}-${T}`,children:`{${T}}`})}),{selectedServer:k}=Jt(s.data.schema.servers),h=se.useMemo(()=>{const T=x??(g?.[0]?.schema?$e(g[0].schema):void 0),I=Ei({operation:e,selectedServer:k,exampleBody:T?{mimeType:"application/json",text:JSON.stringify(T,null,2)}:{mimeType:"application/json"}});return Ai(I,m)},[x,g,e,k,m]),[S,y]=ko({rootMargin:"200px 0px 200px 0px"}),q=y&&(e.extensions["x-explorer-enabled"]===!0||e.extensions["x-zudoku-playground-enabled"]===!0||e.extensions["x-explorer-enabled"]===void 0&&e.extensions["x-zudoku-playground-enabled"]===void 0&&!i?.disablePlayground);return v.jsxs("aside",{ref:S,className:"flex flex-col overflow-hidden sticky top-(--scroll-padding) gap-4","data-pagefind-ignore":"all",children:[v.jsxs(Vt,{children:[v.jsxs(Gt,{className:"flex justify-between items-center flex-nowrap py-2.5 gap-2 text-xs",children:[v.jsxs("span",{className:"font-mono break-words leading-6",children:[v.jsx("span",{className:de("font-semibold",d),children:e.method.toUpperCase()}),"Â ",O]}),q&&v.jsx(No,{servers:s.data.schema.servers.map(T=>T.url),operation:e,examples:b??void 0})]}),y&&v.jsxs(v.Fragment,{children:[v.jsx(ma,{className:"p-0",children:v.jsx(ha,{children:v.jsx(da,{language:m,noB
72ackground:!0,className:"[--scrollbar-color:gray] rounded-none text-xs max-h-[500px] p-2",code:h})})}),v.jsxs(ya,{className:"flex items-center text-xs gap-2 justify-end py-2.5",children:[v.jsx("span",{children:"Show example in"}),v.jsx(Ge,{className:"self-start max-w-[150px]",value:m,onChange:T=>{j(()=>{l(I=>(I.set("lang",T.target.value),I))})},options:Di})]})]})]}),y&&g&&v.jsx(qo,{content:g,onExampleChange:u}),y&&e.responses.length>0&&v.jsx(Ro,{selectedResponse:r,onSelectResponse:t,responses:e.responses.map(T=>({...T,content:T.content&&i?.transformExamples?i.transformExamples({auth:n,type:"response",context:c,operation:e,content:T.content}):T.content}))})]})},_i=de,Li=({responses:e,selectedResponse:r,onSelectResponse:t})=>{const[a,p]=se.useState(e[0]?.content?.[0]?.mediaType??""),i=e.find(o=>o.statusCode===r)??e[0],n=v.jsxs("div",{className:"flex flex-col bg-muted text-muted-foreground",children:[v.jsxs("div",{className:"flex flex-row items-center gap-2 justify-between px-4 py-2",children:[v.jsx(ia,{className:"flex flex-row font-medium text-sm gap-4",children:e.map(o=>v.jsx(la,{value:o.statusCode,className:_i("py-1 -mx-2 px-2 rounded-md","data-[state=active]:dark:ring-1 data-[state=active]:dark:ring-border data-[state=active]:bg-background data-[state=active]:drop-shadow","data-[state=active]:font-semibold data-[state=active]:text-foreground"),children:o.statusCode},o.statusCode))}),i?.content&&i.content.length>1&&v.jsxs(Xn,{value:a,onValueChange:p,children:[v.jsx(Zn,{className:"h-8 mt-0 max-w-48 text-xs truncate",children:v.jsx(ea,{placeholder:"Select a type"})}),v.jsx(ta,{children:i.content.map(o=>v.jsx(ra,{value:o.mediaType,children:o.mediaType},o.mediaType))})]})]}),i?.description&&v.jsx(Va,{className:"text-sm border-t px-4 py-2 text-muted-foreground",content:i.description})]});return v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(ca,{value:r,onValueChange:o=>{t?.(o);const s=e.find(c=>c.statusCode===o);p(s?.content?.[0]?.mediaType??"")},children:e.map(o=>{const s=o.content?.find(c=>c.mediaType===a);return v.jsx(pa,{value:o.statusCode,children:v.jsx(Wt,{schema:s?.schema,cardHeader:n})},o.statusCode)})})})},Ii=["path","query","header","cookie"],Mi=({operationFragment:e,serverUrl:r})=>{const t=vo(Fi,e),a=so(t.parameters??[],s=>s.in),{options:p}=Qe(),i=t.responses.at(0),[n,o]=se.useState(i?.statusCode);return v.jsxs("div",{children:[t.deprecated&&v.jsx(dr,{variant:"muted",className:"text-xs mb-4",children:"deprecated"}),v.jsxs("div",{className:de("grid grid-cols-1 lg:grid-cols-[minmax(0,4fr)_minmax(0,3fr)] gap-x-8 gap-y-4 items-start",t.deprecated&&"opacity-50 transition hover:opacity-100"),children:[v.jsx(Ae,{level:2,id:t.slug,registerNavigationAnchor:!0,className:"break-all col-span-full",children:t.summary}),v.jsxs("div",{className:"text-sm flex gap-2 font-mono col-span-full",children:[v.jsx("span",{className:aa(t.method),children:t.method.toUpperCase()}),v.jsxs(oa,{className:"max-w-full truncate flex cursor-pointer",children:[r&&v.jsx("div",{className:"text-neutral-400 dark:text-neutral-500 truncate",children:r.replace(/\/$/,"")}),v.jsx("div",{className:"text-neutral-900 dark:text-neutral-200",children:t.path})]})]}),v.jsxs("div",{className:de("flex flex-col gap-4",p?.disableSidecar&&"col-span-full"),children:[t.description&&v.jsx(We,{className:`${It} max-w-full prose-img:max-w-prose`,content:t.description}),t.parameters&&t.parameters.length>0&&v.jsx(v.Fragment,{children:Ii.flatMap(s=>a[s]?.length?v.jsx(So,{summary:t.summary??void 0,id:t.slug,parameters:a[s],group:s},s):[])}),fr(t.requestBody?.content?.at(0)?.schema,s=>v.jsxs("div",{className:"mt-4 flex flex-col gap-4",children:[v.jsxs(Ae,{level:3,className:"capitalize flex items-center gap-2",id:`${t.slug}/request-body`,children:[t.summary&&v.jsxs(Mt,{children:[t.summary," ⺠"]}),"Request Body"," ",t.requestBody?.required===!1?v.jsx(dr,{variant:"muted",children:"optional"}):""]}),v.jsx(Wt,{schema:s})]})),t.responses.length>0&&v.jsxs(v.Fragment,{children:[v.jsxs(Ae,{level:3,className:"capitalize mt-8 pt-8 border-t",id:`${t.slug}/responses`,children:[t.summary&&v.jsxs(Mt,{children:[t.summary," ⺠"]}),"Responses"]}),v.jsx(Li,{responses:t.responses,selectedResponse:n,onSelectResponse:o})]})]}),fr(!p?.disableSidecar,()=>v.jsx(Hi,{selectedResponse:n,onSelectResponse:o,operation:t}))]},t.operationId)]})};function Kn(e,r=160){return e?e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[.*?\]\(.*?\)/g,"").replace(/[_*`~]/g,"").replace(/^(?:>|\s*#+|-{3,}|\*{3,})/gm,"").replace(/[|>{}[\]]/g,"").replace(/\s+/g," ").trim().substring(0,r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}const Fi=He(` 73 fragment OperationsFragment on OperationItem { 74 slug 75 summary 76 method 77 description 78 operationId 79 contentTypes 80 path 81 deprecated 82 extensions 83 parameters { 84 name 85 in 86 description 87 required 88 schema 89 style 90 explode 91 examples { 92 name 93 description 94 externalValue 95 value 96 summary 97 } 98 } 99 requestBody { 100 content { 101 mediaType 102 encoding { 103 name 104 } 105 examples { 106 name 107 description 108 externalValue 109 value 110 summary 111 } 112 schema 113 } 114 description 115 required 116 } 117 responses { 118 statusCode 119 links 120 description 121 content { 122 examples { 123 name 124 description 125 externalValue 126 value 127 summary 128 } 129 mediaType 130 encoding { 131 name 132 } 133 schema 134 } 135 } 136 } 137`),Bi=He(` 138 query SchemaWarmup($input: JSON!, $type: SchemaType!) { 139 schema(input: $input, type: $type) { 140 openapi 141 } 142 } 143`),zi=He(` 144 query OperationsForTag( 145 $input: JSON! 146 $type: SchemaType! 147 $tag: String 148 $untagged: Boolean 149 ) { 150 schema(input: $input, type: $type) { 151 servers { 152 url 153 } 154 description 155 summary 156 title 157 url 158 version 159 tag(slug: $tag, untagged: $untagged) { 160 name 161 description 162 operations { 163 slug 164 ...OperationsFragment 165 } 166 next { 167 name 168 slug 169 } 170 prev { 171 name 172 slug 173 } 174 } 175 } 176 } 177`),Ki=({tag:e,untagged:r})=>{const{input:t,type:a,versions:p,version:i,options:n}=Qe(),{tag:o}=Ua(),s=Je(zi,{input:t,type:a,tag:e??o,untagged:r}),c=zt(s),{data:{schema:d}}=c,{selectedServer:f}=Jt(d.servers),l=d.title,j=d.summary,x=d.description,u=Da(),m=Je(Bi,{input:t,type:a});if(Ha({...m,enabled:typeof window<"u",notifyOnChangeProps:[]}),_a(),!d.tag)return v.jsxs("div",{className:"flex flex-col h-full items-center justify-center text-center",children:[v.jsx("div",{className:"text-muted-foreground font-medium",children:"No operations foun
177d"}),v.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"This API doesn't have any operations defined yet."})]});const{operations:b,next:g,prev:O,description:k}=d.tag,h=k?Kn(k):j||(x?Kn(x):void 0),S=Object.entries(p).length>1,y=n?.showVersionSelect==="always"||S&&n?.showVersionSelect!=="hide",q={prev:O?.name?{to:`../${O.slug}`,label:O.name}:void 0,next:g?{to:`../${g.slug??La}`,label:g.name??"Other endpoints"}:void 0};return v.jsxs("div",{className:"pt-(--padding-content-top)","data-pagefind-filter":"section:openapi","data-pagefind-meta":"section:openapi",children:[v.jsxs(Ia,{children:[v.jsx("title",{children:[d.tag.name,l].filter(Boolean).join(" - ")}),h&&v.jsx("meta",{name:"description",content:h})]}),v.jsxs("div",{className:"mb-8",children:[v.jsxs(Yn,{className:"w-full",children:[v.jsxs("div",{className:"flex flex-col gap-y-4 sm:flex-row justify-around items-start sm:items-end",children:[v.jsxs("div",{className:"flex flex-col flex-1 gap-2",children:[v.jsx(Ma,{children:l}),v.jsxs(Ae,{level:1,id:"description",registerNavigationAnchor:!0,className:"mb-0",children:[d.tag.name??"Other endpoints",y&&v.jsxs("span",{className:"text-xl text-muted-foreground ms-1.5",children:[" ","(",i,")"]})]}),v.jsx(jo,{})]}),v.jsxs("div",{className:"flex flex-col gap-4 sm:items-end",children:[y&&v.jsxs(Xn,{onValueChange:T=>u(p[T]),defaultValue:i,disabled:!S,children:[v.jsx(Zn,{className:"w-[180px]",children:v.jsx(ea,{placeholder:"Select version"})}),v.jsx(ta,{children:Object.entries(p).map(([T])=>v.jsx(ra,{value:T,children:T},T))})]}),d.description&&v.jsxs(Lt,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground group",children:[v.jsx("span",{children:"API information"}),v.jsx(fa,{className:"group-data-[state=open]:hidden translate-y-px",size:14}),v.jsx(oo,{className:"group-data-[state=closed]:hidden translate-y-px",size:13})]})]})]}),d.description&&v.jsx(na,{className:"CollapsibleContent",children:v.jsx("div",{className:de(It,"pt-4 max-w-full prose-img:max-w-prose"),children:v.jsx(We,{className:"border rounded-sm bg-muted/25 border-border px-2.5 md:px-4",content:d.description})})})]}),k&&v.jsx("div",{className:de(It,"my-4 max-w-full prose-img:max-w-prose"),children:v.jsx(We,{content:k})})]}),v.jsx("hr",{}),v.jsxs("div",{className:"px-6 mt-6 -mx-6 [content-visibility:auto]",children:[b.map(T=>v.jsxs("div",{children:[v.jsx(Mi,{serverUrl:f,operationFragment:T}),v.jsx("hr",{className:"my-10"})]},T.slug)),v.jsx(ao,{className:"mb-4",...q})]})]})};export{Ki as OperationList,Fi as OperationsFragment}; 178//# sourceMappingURL=OperationList-m4tFCI4S-BJQyETGc.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.