fern-api 0.94.5 → 0.94.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +4 -4
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -2163,7 +2163,7 @@ ${PAy.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&sbf(th
|
|
|
2163
2163
|
`+wca.default.red(">> ")+t),this.screen.render(r,n)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?wca.default.cyan(BAy(t,this.opt.mask)):wca.default.italic(wca.default.dim("[hidden]")):this.opt.mask?BAy(t,this.opt.mask):wca.default.italic(wca.default.dim("[input is hidden] "))}getSpinningValue(t){return this.getMaskedValue(t)}filterInput(t){return t||(this.opt.default==null?"":this.opt.default)}onEnd(t){this.status="answered",this.answer=t.value,this.render(),this.screen.done(),this.done(t.value)}onError(t){this.render(t.isValid)}onKeypress(){this.opt.default&&=void 0,this.render()}};var gSs=pa(tse(),1);var BPy=pa(Vbf(),1),vSs=require("child_process"),Jka=require("fs"),ySs=pa(require("path"),1),TPy=pa(require("os"),1),qPy=require("crypto"),Sgf=pa(IPy(),1);var pSs=class extends Error{originalError;constructor(t){super(`Failed to create temporary file. ${t.message}`),this.originalError=t}};var SKo=class extends Error{originalError;constructor(t){super(`Failed to launch editor. ${t.message}`),this.originalError=t}};var _Ss=class extends Error{originalError;constructor(t){super(`Failed to read temporary file. ${t.message}`),this.originalError=t}};var hSs=class extends Error{originalError;constructor(t){super(`Failed to remove temporary file. ${t.message}`),this.originalError=t}};function bSs(e="",t,r){let n=new Dgf(e,r);n.runAsync((i,a)=>{if(i)setImmediate(t,i,void 0);else try{n.cleanup(),setImmediate(t,void 0,a)}catch(o){setImmediate(t,o,void 0)}})}function MPy(e){return e?e.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function daC(e){let t=[],r="";for(let n=0;n<e.length;n++){let i=e.charAt(n);n>0&&i===" "&&e[n-1]!=="\\"&&r.length>0?(t.push(r),r=""):r=`${r}${i}`}return r.length>0&&t.push(r),t}var Dgf=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(t="",r){this.text=t,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(t){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(t,void 0,this.text)}catch(r){setImmediate(t,r,void 0)}})}catch(r){setImmediate(t,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let t=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=daC(t).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let t=this.fileOptions.dir??TPy.default.tmpdir(),r=(0,qPy.randomUUID)(),n=MPy(this.fileOptions.prefix),i=MPy(this.fileOptions.postfix),a=`${n}${r}${i}`,o=ySs.default.resolve(t,a),c=ySs.default.resolve(t)+ySs.default.sep;if(!o.startsWith(c))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let d={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(d.mode=this.fileOptions.mode),(0,Jka.writeFileSync)(this.tempFile,this.text,d)}catch(t){throw new pSs(t)}}readTemporaryFile(){try{let t=(0,Jka.readFileSync)(this.tempFile);if(t.length===0)this.text="";else{let r=(0,BPy.detect)(t)??"utf8";Sgf.default.encodingExists(r)||(r="utf8"),this.text=Sgf.default.decode(t,r)}}catch(t){throw new _Ss(t)}}removeTemporaryFile(){try{(0,Jka.unlinkSync)(this.tempFile)}catch(t){throw new hSs(t)}}launchEditor(){try{let t=(0,vSs.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=t.status??0}catch(t){throw new SKo(t)}}launchEditorAsync(t){try{(0,vSs.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(t)})}catch(r){throw new SKo(r)}}};var RPy=pa(Ynt(),1);var DKo=class extends rse{_run(t){this.done=t,this.editorResult=new RPy.Subject;let r=Dbe(this.rl);this.lineSubscription=r.line.subscribe(this.startExternalEditor.bind(this));let n=this.opt.waitUserInput===void 0?!0:this.opt.waitUserInput,i=this.handleSubmitEvents(this.editorResult);return i.success.forEach(this.onEnd.bind(this)),i.error.forEach(this.onError.bind(this)),this.currentText=this.opt.default,this.opt.default=null,n?this.render():this.startExternalEditor(),this}render(t){let r="",n=this.getQuestion();n+=this.status==="answered"?gSs.default.dim("Received"):gSs.default.dim("Press <enter> to launch your preferred editor."),t&&(r=gSs.default.red(">> ")+t),this.screen.render(n,r)}startExternalEditor(){this.rl.pause(),bSs(this.currentText,this.endExternalEditor.bind(this),{postfix:this.opt.postfix??".txt"})}endExternalEditor(t,r){this.rl.resume(),t?this.editorResult.error(t):this.editorResult.next(r)}onEnd(t){this.editorResult.unsubscribe(),this.lineSubscription.unsubscribe(),this.answer=t.value,this.status="answered",this.render(),this.screen.done(),this.done(this.answer)}onError(t){this.render(t.isValid)}};var QPy=require("stream");var xPy=pa(require("readline"),1),zPy=pa(FPy(),1),Dca=class{constructor(t){this.rl||=xPy.default.createInterface(_aC(t)),this.rl.resume(),this.onForceClose=this.onForceClose.bind(this),process.on("exit",this.onForceClose),this.rl.on("SIGINT",this.onForceClose)}onForceClose(){this.close(),process.kill(process.pid,"SIGINT"),console.log("")}close(){this.rl.removeListener("SIGINT",this.onForceClose),process.removeListener("exit",this.onForceClose),this.rl.output.unmute(),this.activePrompt&&typeof this.activePrompt.close=="function"&&this.activePrompt.close(),this.rl.output.end(),this.rl.pause(),this.rl.close()}};function _aC(e={}){e.skipTTYChecks=e.skipTTYChecks===void 0?!0:e.skipTTYChecks;let t=e.input||process.stdin;if(!e.skipTTYChecks&&!t.isTTY){let i=new Error("Prompts can not be meaningfully rendered in non-TTY environments");throw i.isTtyError=!0,i}let r=new zPy.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var CKo=class extends Dca{constructor(t={}){super(t),this.log=new QPy.Writable({write:(r,n,i)=>{this.writeLog(r),i()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return dKo(this.rl,this.bottomBar.split(`
|
|
2164
2164
|
`).length),this}updateBottomBar(t){return dKo(this.rl,1),this.rl.output.unmute(),this.clean(),this.bottomBar=t,this.render(),this.rl.output.mute(),this}writeLog(t){return this.rl.output.unmute(),this.clean(),this.rl.output.write(this.enforceLF(t.toString())),this.render(),this.rl.output.mute(),this}enforceLF(t){return/[\n\r]$/.test(t)?t:t+`
|
|
2165
2165
|
`}write(t){let r=t.split(/\n/);this.height=r.length,this.rl.setPrompt(r.at(-1)),this.rl.output.rows===0&&this.rl.output.columns===0&&LEs(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var X4=pa(Ynt(),1),VPy=pa(TJo(),1);var mSs=pa(Ynt(),1),LPy=pa(TJo(),1),OSs=function(e,t,r){return typeof e[t]!="function"?(0,mSs.of)(e):(0,mSs.from)((0,LPy.default)(e[t])(r).then(n=>(e[t]=n,e)))};var UPy={set:(e,t="",r)=>{let n=e;t.split(".").forEach((i,a,o)=>{i==="__proto__"||i==="constructor"||(a===o.length-1?n[i]=r:(!(i in n)||typeof n[i]!="object")&&(n[i]={}),n=n[i])})},get:(e,t="",r)=>{let n=a=>String.prototype.split.call(t,a).filter(Boolean).reduce((o,c)=>o!=null?o[c]:o,e),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===e?r:i}},Kka=class extends Dca{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=typeof r=="object"?{...r}:{};let n;return Array.isArray(t)?n=(0,X4.from)(t):(0,X4.isObservable)(t)?n=t:Object.values(t).every(i=>typeof i=="object"&&!Array.isArray(i)&&i!=null)?n=(0,X4.from)(Object.entries(t).map(([i,a])=>({name:i,...a}))):n=(0,X4.from)([t]),this.process=n.pipe((0,X4.concatMap)(this.processQuestion.bind(this)),(0,X4.publish)()),this.process.connect(),this.process.pipe((0,X4.reduce)((i,a)=>(UPy.set(i,a.name,a.answer),i),this.answers)).toPromise(Promise).then(this.onCompletion.bind(this),this.onError.bind(this))}onCompletion(){return this.close(),this.answers}onError(t){return this.close(),Promise.reject(t)}processQuestion(t){return t={...t},(0,X4.defer)(()=>(0,X4.of)(t).pipe((0,X4.concatMap)(this.setDefaultType.bind(this)),(0,X4.concatMap)(this.filterIfRunnable.bind(this)),(0,X4.concatMap)(()=>OSs(t,"message",this.answers)),(0,X4.concatMap)(()=>OSs(t,"default",this.answers)),(0,X4.concatMap)(()=>OSs(t,"choices",this.answers)),(0,X4.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,X4.defer)(()=>(0,X4.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,X4.defer)(()=>(0,X4.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&UPy.get(this.answers,t.name)!==void 0)return X4.EMPTY;if(t.when===!1)return X4.EMPTY;if(typeof t.when!="function")return(0,X4.of)(t);let{answers:r}=this;return(0,X4.defer)(()=>(0,X4.from)((0,VPy.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,X4.filter)(n=>n!=null)))}};function WPy(e){let t=function(r,n){let i;try{i=new Kka(t.prompts,e)}catch(o){return Promise.reject(o)}let a=i.run(r,n);return a.ui=i,a};return t.prompts={},t.registerPrompt=function(r,n){return t.prompts[r]=n,this},t.restoreDefaultPrompts=function(){this.registerPrompt("list",_Ko),this.registerPrompt("input",Pca),this.registerPrompt("number",hKo),this.registerPrompt("confirm",yKo),this.registerPrompt("rawlist",vKo),this.registerPrompt("expand",bKo),this.registerPrompt("checkbox",gKo),this.registerPrompt("password",mKo),this.registerPrompt("editor",DKo)},t.restoreDefaultPrompts(),t}var Igf=WPy();function yaC(e,t){Igf.registerPrompt(e,t)}function vaC(){Igf.restoreDefaultPrompts()}var baC={prompt:Igf,ui:{BottomBar:CKo,Prompt:Kka},createPromptModule:WPy,registerPrompt:yaC,restoreDefaultPrompts:vaC,Separator:e3e},ASs=baC;var ueo=require("path"),Ijy=require("fs"),Mjy=require("readline"),tjy="posthog-node";function asC(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"]}={}){return a=>{if(!(i==="*"||i.includes(a.level)))return a;a.tags||(a.tags={});let c=a.tags[HSs.POSTHOG_ID_TAG];if(c===void 0)return a;let d=e.options.host??"https://us.i.posthog.com",s=new URL(`/project/${e.apiKey}/person/${c}`,d).toString();a.tags["PostHog Person URL"]=s;let u=a.exception?.values||[],l=u.map(A=>({...A,stacktrace:A.stacktrace?{...A.stacktrace,type:"raw",frames:(A.stacktrace.frames||[]).map(P=>({...P,platform:"node:javascript"}))}:void 0})),m={$exception_message:u[0]?.value||a.message,$exception_type:u[0]?.type,$exception_personURL:s,$exception_level:a.level,$exception_list:l,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:u[0]?.value||a.message,$sentry_exception_type:u[0]?.type,$sentry_tags:a.tags};return t&&r&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+a.event_id),e.capture({event:"$exception",distinctId:c,properties:m}),a}}var HSs=class{constructor(t,r,n,i){this.name=tjy,this.name=tjy,this.setupOnce=function(a,o){let c=o()?.getClient()?.getDsn()?.projectId;a(asC(t,{organization:r,projectId:c,prefix:n,severityAllowList:i}))}}};HSs.POSTHOG_ID_TAG="posthog_distinct_id";var QSs="0123456789abcdef",GSs=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length!==16)throw new TypeError("not 128-bit length");return new e(t)}static fromFieldsV7(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||t<0||r<0||n<0||i<0||t>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");let a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|r>>>8,a[7]=r,a[8]=128|n>>>24,a[9]=n>>>16,a[10]=n>>>8,a[11]=n,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}static parse(t){let r;switch(t.length){case 32:r=/^[0-9a-f]{32}$/i.exec(t)?.[0];break;case 36:r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break;case 38:r=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t)?.slice(1,6).join("");break;case 45:r=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break}if(r){let n=new Uint8Array(16);for(let i=0;i<16;i+=4){let a=parseInt(r.substring(2*i,2*i+8),16);n[i+0]=a>>>24,n[i+1]=a>>>16,n[i+2]=a>>>8,n[i+3]=a}return new e(n)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=QSs.charAt(this.bytes[r]>>>4),t+=QSs.charAt(this.bytes[r]&15),(r===3||r===5||r===7||r===9)&&(t+="-");return t}toHex(){let t="";for(let r=0;r<this.bytes.length;r++)t+=QSs.charAt(this.bytes[r]>>>4),t+=QSs.charAt(this.bytes[r]&15);return t}toJSON(){return this.toString()}getVariant(){let t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every(r=>r===0)?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every(r=>r===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;r<16;r++){let n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}},b0f=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??osC()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,r){let n=this.generateOrAbortCore(t,r);return n===void 0&&(this.timestamp=0,n=this.generateOrAbortCore(t,r)),n}generateOrAbortCore(t,r){if(!Number.isInteger(t)||t<1||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(r<0||r>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t>this.timestamp)this.timestamp=t,this.resetCounter();else if(t+r>=this.timestamp)this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter());else return;return GSs.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){let t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,GSs.ofInner(t)}},osC=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),rjy,g0f=()=>usC().toString(),usC=()=>(rjy||(rjy=new b0f)).generate();function ssC(e,t){let r=!1;return Object.assign(n=>{let a=global.process.listeners("uncaughtException").filter(o=>o.name!=="domainUncaughtExceptionClear"&&o._posthogErrorHandler!==!0).length===0;e(n,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t())},{_posthogErrorHandler:!0})}function csC(e,t){global.process.on("uncaughtException",ssC(e,t))}function lsC(e){global.process.on("unhandledRejection",t=>{e(t,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var LSs,njy,USs;function fsC(e){let t=globalThis._posthogChunkIds;if(!t)return console.error("No chunk id map found"),{};let r=Object.keys(t);return USs&&r.length===njy||(njy=r.length,USs=r.reduce((n,i)=>{LSs||(LSs={});let a=LSs[i];if(a)n[a[0]]=a[1];else{let o=e(i);for(let c=o.length-1;c>=0;c--){let s=o[c]?.filename,u=t[i];if(s&&u){n[s]=u,LSs[i]=[s,u];break}}}return n},{})),USs}function dsC(e){return typeof Event<"u"&&Bjy(e,Event)}function psC(e){return Tjy(e,"Object")}function S0f(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Bjy(e,Error)}}function Bjy(e,t){try{return e instanceof t}catch{return!1}}function _sC(e){return Tjy(e,"ErrorEvent")}function Tjy(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}async function hsC(e,t,r,n){let a=n&&n.mechanism||{handled:!0,type:"generic"},o=qjy(a,r,n);return{$exception_list:await Promise.all(o.map(async s=>{let u=await AsC(e,t,s);return u.value=u.value||"",u.type=u.type||"Error",u.mechanism=a,u}))}}function qjy(e,t,r){let n=ysC(e,t,r);return n.cause?[n,...qjy(e,n.cause,r)]:[n]}function ysC(e,t,r){if(S0f(t))return t;if(e.synthetic=!0,psC(t)){let i=vsC(t);if(i)return i;let a=bsC(t),o=r?.syntheticException||new Error(a);return o.message=a,o}let n=r?.syntheticException||new Error(t);return n.message=`${t}`,n}function vsC(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(S0f(r))return r}}function bsC(e){if("name"in e&&typeof e.name=="string"){let n=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(n+=` with message '${e.message}'`),n}else if("message"in e&&typeof e.message=="string")return e.message;let t=msC(e);if(_sC(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=gsC(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function gsC(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function msC(e,t=40){let r=Object.keys(OsC(e));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=t)return ijy(n,t);for(let i=r.length;i>0;i--){let a=r.slice(0,i).join(", ");if(!(a.length>t))return i===r.length?a:ijy(a,t)}return""}function ijy(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function OsC(e){return S0f(e)?{message:e.message,name:e.name,stack:e.stack,...ajy(e)}:dsC(e)?{type:e.type,target:ojy(e.target),currentTarget:ojy(e.currentTarget),...ajy(e)}:e}function ajy(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function ojy(e){try{return Object.prototype.toString.call(e)}catch{return"<unknown>"}}async function AsC(e,t,r){let n={type:r.name||r.constructor.name,value:r.message},i=PsC(e,r);for(let a of t)i=await a(i);return i.length&&(n.stacktrace={frames:i,type:"raw"}),n}function PsC(e,t){return wsC(e(t.stack||"",1),e)}function wsC(e,t){let r=fsC(t);return e.forEach(n=>{n.filename&&(n.chunk_id=r[n.filename])}),e}var jsC=2e3,ieo=class e{static async captureException(t,r,n,i,a){let o={...a};i||(o.$process_person_profile=!1);let c=await hsC(this.stackParser,this.frameModifiers,r,n);t.capture({event:"$exception",distinctId:i||g0f(),properties:{...c,...o}})}constructor(t,r){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this.startAutocaptureIfEnabled()}startAutocaptureIfEnabled(){this.isEnabled()&&(csC(this.onException.bind(this),this.onFatalError.bind(this)),lsC(this.onException.bind(this)))}onException(t,r){e.captureException(this.client,t,r)}async onFatalError(){await this.client.shutdown(jsC)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}};function EsC(e=process.argv[1]?(0,ueo.dirname)(process.argv[1]):process.cwd(),t=ueo.sep==="\\"){let r=t?ujy(e):e;return n=>{if(!n)return;let i=t?ujy(n):n,{dir:a,base:o,ext:c}=ueo.posix.parse(i);(c===".js"||c===".mjs"||c===".cjs")&&(o=o.slice(0,c.length*-1));let d=decodeURIComponent(o);a||(a=".");let s=a.lastIndexOf("/node_modules");if(s>-1)return`${a.slice(s+14).replace(/\//g,".")}:${d}`;if(a.startsWith(r)){let u=a.slice(r.length+1).replace(/\//g,".");return u?`${u}:${d}`:d}return d}}function ujy(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var JSs=class{constructor(t){this._maxSize=t,this._cache=new Map}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){this._cache.set(t,r)}reduce(){for(;this._cache.size>=this._maxSize;){let t=this._cache.keys().next().value;t&&this._cache.delete(t)}}},WSs=new JSs(25),Rjy=new JSs(20),D0f=7,SsC=1e3,DsC=1e4;async function CsC(e){let t={};for(let i=e.length-1;i>=0;i--){let a=e[i],o=a?.filename;if(!a||typeof o!="string"||typeof a.lineno!="number"||TsC(o)||qsC(a))continue;t[o]||(t[o]=[]),t[o].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let n=[];for(let i of r){if(Rjy.get(i))continue;let a=t[i];if(!a)continue;a.sort((d,s)=>d-s);let o=NsC(a);if(o.every(d=>RsC(i,d)))continue;let c=FsC(WSs,i,{});n.push(IsC(i,o,c))}return await Promise.all(n).catch(()=>{}),e&&e.length>0&&MsC(e,WSs),WSs.reduce(),e}function IsC(e,t,r){return new Promise(n=>{let i=(0,Ijy.createReadStream)(e),a=(0,Mjy.createInterface)({input:i});function o(){i.destroy(),n()}let c=0,d=0,s=t[d];if(s===void 0){o();return}let u=s[0],l=s[1];function m(){Rjy.set(e,1),a.close(),a.removeAllListeners(),o()}i.on("error",m),a.on("error",m),a.on("close",o),a.on("line",A=>{if(c++,!(c<u)&&(r[c]=xsC(A,0),c>=l)){if(d===t.length-1){a.close(),a.removeAllListeners();return}d++;let P=t[d];if(P===void 0){a.close(),a.removeAllListeners();return}u=P[0],l=P[1]}})})}function MsC(e,t){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let n=t.get(r.filename);if(n===void 0)continue;BsC(r.lineno,r,n)}}function BsC(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=Njy(e);i<e;i++){let a=r[i];if(a===void 0){sjy(t);return}t.pre_context.push(a)}if(r[e]===void 0){sjy(t);return}t.context_line=r[e];let n=Fjy(e);t.post_context=[];for(let i=e+1;i<=n;i++){let a=r[i];if(a===void 0)break;t.post_context.push(a)}}function sjy(e){delete e.pre_context,delete e.context_line,delete e.post_context}function TsC(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function qsC(e){return e.lineno!==void 0&&e.lineno>DsC||e.colno!==void 0&&e.colno>SsC}function RsC(e,t){let r=WSs.get(e);if(r===void 0)return!1;for(let n=t[0];n<=t[1];n++)if(r[n]===void 0)return!1;return!0}function NsC(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=cjy(r),i=[];for(;;){if(t===e.length-1){i.push(n);break}let a=e[t+1];if(typeof a!="number")break;a<=n[1]?n[1]=a+D0f:(i.push(n),n=cjy(a)),t++}return i}function cjy(e){return[Njy(e),Fjy(e)]}function Njy(e){return Math.max(1,e-D0f)}function Fjy(e){return e+D0f}function FsC(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function xsC(e,t){let r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,n);return a>n-5&&(a=n),a===n&&(i=Math.max(a-140,0)),r=r.slice(i,a),i>0&&(r=`...${r}`),a<n&&(r+="..."),r}var zsC="4.18.0",a3e;(function(e){e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.DecideEndpointWasHit="decide_endpoint_was_hit",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config"})(a3e||(a3e={}));var ljy;(function(e){e.Left="left",e.Right="right",e.Center="center"})(ljy||(ljy={}));var fjy;(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})(fjy||(fjy={}));var djy;(function(e){e.Popover="popover",e.API="api",e.Widget="widget"})(djy||(djy={}));var pjy;(function(e){e.Html="html",e.Text="text"})(pjy||(pjy={}));var _jy;(function(e){e.Number="number",e.Emoji="emoji"})(_jy||(_jy={}));var hjy;(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"})(hjy||(hjy={}));var yjy;(function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"})(yjy||(yjy={}));var vjy;(function(e){e.Regex="regex",e.NotRegex="not_regex",e.Exact="exact",e.IsNot="is_not",e.Icontains="icontains",e.NotIcontains="not_icontains"})(vjy||(vjy={}));var bjy;(function(e){e.Contains="contains",e.Exact="exact",e.Regex="regex"})(bjy||(bjy={}));var QsC=e=>{if("flags"in e){let t=UsC(e.flags),r=VsC(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}else{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,a])=>[i,xjy(a)])),n=Object.fromEntries(Object.entries(t).map(([i,a])=>[i,LsC(i,a,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function LsC(e,t,r){return{key:e,enabled:typeof t=="string"?!0:t,variant:typeof t=="string"?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var UsC=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,C0f(r)]).filter(([,t])=>t!==void 0)),VsC=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(r=>{let n=t[r];return n.enabled&&n.metadata&&n.metadata.payload!==void 0}).map(r=>{let n=t[r].metadata?.payload;return[r,n?xjy(n):void 0]}))},C0f=e=>e===void 0?void 0:e.variant??e.enabled,xjy=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},WsC=1,HsC=new Set(["61be3dd8","96f6df5f","8cfdba9b","bf027177","e59430a8","7fa5500b","569798e9","04809ff7","0ebc61a5","32de7f98","3beeb69a","12d34ad9","733853ec","0645bb64","5dcbee21","b1f95fa3","2189e408","82b460c2","3a8cc979","29ef8843","2cdbf767","38084b54","50f9f8de","41d0df91","5c236689","c11aedd3","ada46672","f4331ee1","42fed62a","c957462c","d62f705a","e0162666","01b3e5cf","441cef7f","bb9cafee","8f348eb0","b2553f3a","97469d7d","39f21a76","03706dcc","27d50569","307584a7","6433e92e","150c7fbb","49f57f22","3772f65b","01eb8256","3c9e9234","f853c7f7","c0ac4b67","cd609d40","10ca9b1a","8a87f11b","8e8e5216","1f6b63b3","db7943dd","79b7164c","07f78e33","2d21b6fd","952db5ee","a7d3b43f","1924dd9c","84e1b8f6","dff631b6","c5aa8a79","fa133a95","498a4508","24748755","98f3d658","21bbda67","7dbfed69","be3ec24c","fc80b8e2","75cc0998"]),GsC="utf8";function JsC(e,t){if(!e||typeof e!="string"||KsC(e))throw new Error(t)}function KsC(e){return e.trim().length===0}function $sC(e){return e?.replace(/\/+$/,"")}async function YsC(e,t){let r=null;for(let n=0;n<t.retryCount+1;n++){n>0&&await new Promise(i=>setTimeout(i,t.retryDelay));try{return await e()}catch(i){if(r=i,!t.retryCheck(i))throw i}}throw r}function gjy(){return new Date().getTime()}function y0f(){return new Date().toISOString()}function KSs(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}function XsC(){return typeof fetch<"u"?fetch:typeof globalThis.fetch<"u"?globalThis.fetch:void 0}function ZsC(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return(t>>>0).toString(16).padStart(8,"0")}function ksC(e,t=0,r){let n=ZsC(e);return r?.has(n)?!1:parseInt(n,16)/4294967295<t}function mjy(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var zKo=String.fromCharCode,Ojy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",VSs={};function ecC(e,t){if(!VSs[e]){VSs[e]={};for(let r=0;r<e.length;r++)VSs[e][e.charAt(r)]=r}return VSs[e][t]}var reo={compressToBase64:function(e){if(e==null)return"";let t=reo._compress(e,6,function(r){return Ojy.charAt(r)});switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return e==null?"":e==""?null:reo._decompress(e.length,32,function(t){return ecC(Ojy,e.charAt(t))})},compress:function(e){return reo._compress(e,16,function(t){return zKo(t)})},_compress:function(e,t,r){if(e==null)return"";let n={},i={},a=[],o,c,d="",s="",u="",l=2,m=3,A=2,P=0,C=0,M;for(M=0;M<e.length;M+=1)if(d=e.charAt(M),Object.prototype.hasOwnProperty.call(n,d)||(n[d]=m++,i[d]=!0),s=u+d,Object.prototype.hasOwnProperty.call(n,s))u=s;else{if(Object.prototype.hasOwnProperty.call(i,u)){if(u.charCodeAt(0)<256){for(o=0;o<A;o++)P=P<<1,C==t-1?(C=0,a.push(r(P)),P=0):C++;for(c=u.charCodeAt(0),o=0;o<8;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}else{for(c=1,o=0;o<A;o++)P=P<<1|c,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=0;for(c=u.charCodeAt(0),o=0;o<16;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}l--,l==0&&(l=Math.pow(2,A),A++),delete i[u]}else for(c=n[u],o=0;o<A;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1;l--,l==0&&(l=Math.pow(2,A),A++),n[s]=m++,u=String(d)}if(u!==""){if(Object.prototype.hasOwnProperty.call(i,u)){if(u.charCodeAt(0)<256){for(o=0;o<A;o++)P=P<<1,C==t-1?(C=0,a.push(r(P)),P=0):C++;for(c=u.charCodeAt(0),o=0;o<8;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}else{for(c=1,o=0;o<A;o++)P=P<<1|c,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=0;for(c=u.charCodeAt(0),o=0;o<16;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}l--,l==0&&(l=Math.pow(2,A),A++),delete i[u]}else for(c=n[u],o=0;o<A;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1;l--,l==0&&(l=Math.pow(2,A),A++)}for(c=2,o=0;o<A;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1;for(;;)if(P=P<<1,C==t-1){a.push(r(P));break}else C++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:reo._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(e,t,r){let n=[],i=[],a={val:r(0),position:t,index:1},o=4,c=4,d=3,s="",u,l,m,A,P,C,M;for(u=0;u<3;u+=1)n[u]=u;for(m=0,P=Math.pow(2,2),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;switch(m){case 0:for(m=0,P=Math.pow(2,8),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;M=zKo(m);break;case 1:for(m=0,P=Math.pow(2,16),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;M=zKo(m);break;case 2:return""}for(n[3]=M,l=M,i.push(M);;){if(a.index>e)return"";for(m=0,P=Math.pow(2,d),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;switch(M=m){case 0:for(m=0,P=Math.pow(2,8),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;n[c++]=zKo(m),M=c-1,o--;break;case 1:for(m=0,P=Math.pow(2,16),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;n[c++]=zKo(m),M=c-1,o--;break;case 2:return i.join("")}if(o==0&&(o=Math.pow(2,d),d++),n[M])s=n[M];else if(M===c)s=l+l.charAt(0);else return null;i.push(s),n[c++]=l+s.charAt(0),o--,l=s,o==0&&(o=Math.pow(2,d),d++)}}},m0f=class{constructor(){this.events={},this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),()=>{this.events[t]=this.events[t].filter(n=>n!==r)}}emit(t,r){for(let n of this.events[t]||[])n(r);for(let n of this.events["*"]||[])n(t,r)}},aeo=class extends Error{constructor(t,r){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}},QKo=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function Ajy(e){if(e instanceof aeo){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function v0f(e){return typeof e=="object"&&(e instanceof aeo||e instanceof QKo)}function Pjy(e){return typeof e=="object"&&e instanceof aeo&&e.status===413}var O0f;(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(O0f||(O0f={}));var A0f=class{constructor(t,r){this.flushPromise=null,this.shutdownPromise=null,this.pendingPromises={},this._events=new m0f,this._isInitialized=!1,JsC(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=$sC(r?.host||"https://us.i.posthog.com"),this.flushAt=r?.flushAt?Math.max(r?.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r?.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r?.maxQueueSize??1e3),this.flushInterval=r?.flushInterval??1e4,this.captureMode=r?.captureMode||"json",this.preloadFeatureFlags=r?.preloadFeatureFlags??!0,this.defaultOptIn=r?.defaultOptIn??!0,this.disableSurveys=r?.disableSurveys??!1,this._retryOptions={retryCount:r?.fetchRetryCount??3,retryDelay:r?.fetchRetryDelay??3e3,retryCheck:v0f},this.requestTimeout=r?.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r?.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=r?.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r?.disableGeoip??!0,this.disabled=r?.disabled??!1,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(a3e.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(a3e.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(a3e.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(n,i)=>console.log("PostHog Debug",n,i));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(t){let r=g0f();return this.pendingPromises[r]=t,t.catch(()=>{}).finally(()=>{delete this.pendingPromises[r]}),t}identifyStateless(t,r,n){this.wrap(()=>{let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};this.enqueue("identify",i,n)})}async identifyStatelessImmediate(t,r,n){let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};await this.sendImmediate("identify",i,n)}captureStateless(t,r,n,i){this.wrap(()=>{let a=this.buildPayload({distinct_id:t,event:r,properties:n});this.enqueue("capture",a,i)})}async captureStatelessImmediate(t,r,n,i){let a=this.buildPayload({distinct_id:t,event:r,properties:n});await this.sendImmediate("capture",a,i)}aliasStateless(t,r,n,i){this.wrap(()=>{let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});this.enqueue("alias",a,i)})}async aliasStatelessImmediate(t,r,n,i){let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",a,i)}groupIdentifyStateless(t,r,n,i,a,o){this.wrap(()=>{let c=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...o||{}}});this.enqueue("capture",c,i)})}async getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,n,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(i=>i.json()).catch(i=>{this.logMsgIfDebug(()=>console.error("Remote config could not be loaded",i)),this._events.emit("error",i)})}async getDecide(t,r={},n={},i={},a={}){await this._initPromise;let c=ksC(this.apiKey,WsC,HsC)?`${this.host}/flags/?v=2`:`${this.host}/decide/?v=4`,d={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify({token:this.apiKey,distinct_id:t,groups:r,person_properties:n,group_properties:i,...a})};return this.logMsgIfDebug(()=>console.log("PostHog Debug","Decide URL",c)),this.fetchWithRetry(c,d,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(s=>s.json()).then(s=>QsC(s)).catch(s=>{this._events.emit("error",s)})}async getFeatureFlagStateless(t,r,n={},i={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailStateless(t,r,n,i,a,o);if(c===void 0)return{response:void 0,requestId:void 0};let d=C0f(c.response);return d===void 0&&(d=!1),{response:d,requestId:c.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(r,n,i,a,o,[t]);return c===void 0?void 0:{response:c.flags[t],requestId:c.requestId}}async getFeatureFlagPayloadStateless(t,r,n={},i={},a={},o){await this._initPromise;let c=await this.getFeatureFlagPayloadsStateless(r,n,i,a,o,[t]);if(!c)return;let d=c[t];return d===void 0?null:d}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},a,o){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,a,o)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},a,o){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,a,o)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},a,o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(t,r,n,i,a,o);return c?{flags:c.featureFlags,payloads:c.featureFlagPayloads,requestId:c.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},n={},i={},a,o){await this._initPromise;let c={};(a??this.disableGeoip)&&(c.geoip_disable=!0),o&&(c.flag_keys_to_evaluate=o);let d=await this.getDecide(t,r,n,i,c);if(d!==void 0)return d.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),d.quotaLimited?.includes(O0f.FeatureFlags)?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:d?.requestId}):d}async getSurveysStateless(){if(await this._initPromise,this.disableSurveys===!0)return this.logMsgIfDebug(()=>console.log("PostHog Debug","Loading surveys is disabled.")),[];let t=`${this.host}/api/surveys/?token=${this.apiKey}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},i=(await this.fetchWithRetry(t,r).then(a=>{if(a.status!==200||!a.json){let o=`Surveys API could not be loaded: ${a.status}`,c=new Error(o);this.logMsgIfDebug(()=>console.error(c)),this._events.emit("error",new Error(o));return}return a.json()}).catch(a=>{this.logMsgIfDebug(()=>console.error("Surveys API could not be loaded",a)),this._events.emit("error",a)}))?.surveys;return i&&this.logMsgIfDebug(()=>console.log("PostHog Debug","Surveys fetched from API: ",JSON.stringify(i))),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(a3e.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(a3e.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(a3e.Props,this.props)})}enqueue(t,r,n){this.wrap(()=>{if(this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let i=this.prepareMessage(t,r,n),a=this.getPersistedProperty(a3e.Queue)||[];a.length>=this.maxQueueSize&&(a.shift(),this.logMsgIfDebug(()=>console.info("Queue is full, the oldest event is dropped."))),a.push({message:i}),this.setPersistedProperty(a3e.Queue,a),this._events.emit(t,i),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=KSs(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized||await this._initPromise,this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let i={api_key:this.apiKey,batch:[this.prepareMessage(t,r,n)],sent_at:y0f()};this.historicalMigration&&(i.historical_migration=!0);let a=JSON.stringify(i),o=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${gjy()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,c=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(reo.compressToBase64(a))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:a};try{await this.fetchWithRetry(o,c)}catch(d){this._events.emit("error",d)}}prepareMessage(t,r,n){let i={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:n?.timestamp?n?.timestamp:y0f(),uuid:n?.uuid?n.uuid:g0f()};return(n?.disableGeoip??this.disableGeoip)&&(i.properties||(i.properties={}),i.properties.$geoip_disable=!0),i.distinctId&&(i.distinct_id=i.distinctId,delete i.distinctId),i}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async t=>{await Ajy(t)})}async flush(){let t=mjy([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),mjy([t]).then(()=>{this.flushPromise===t&&(this.flushPromise=null)}),t}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getPersistedProperty(a3e.Queue)||[];if(!t.length)return;let r=[],n=t.length;for(;t.length>0&&r.length<n;){let i=t.slice(0,this.maxBatchSize),a=i.map(m=>m.message),o=()=>{let A=(this.getPersistedProperty(a3e.Queue)||[]).slice(i.length);this.setPersistedProperty(a3e.Queue,A),t=A},c={api_key:this.apiKey,batch:a,sent_at:y0f()};this.historicalMigration&&(c.historical_migration=!0);let d=JSON.stringify(c),s=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${gjy()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,u=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(reo.compressToBase64(d))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:d},l={retryCheck:m=>Pjy(m)?!1:v0f(m)};try{await this.fetchWithRetry(s,u,l)}catch(m){if(Pjy(m)&&a.length>1){this.maxBatchSize=Math.max(1,Math.floor(a.length/2)),this.logMsgIfDebug(()=>console.warn(`Received 413 when sending batch of size ${a.length}, reducing batch size to ${this.maxBatchSize}`));continue}throw m instanceof QKo||o(),this._events.emit("error",m),m}o(),r.push(...a)}this._events.emit("flush",r)}async fetchWithRetry(t,r,n,i){var a;(a=AbortSignal).timeout??(a.timeout=function(s){let u=new AbortController;return setTimeout(()=>u.abort(),s),u.signal});let o=r.body?r.body:"",c=-1;try{c=Buffer.byteLength(o,GsC)}catch{c=new TextEncoder().encode(o).length}return await YsC(async()=>{let d=null;try{d=await this.fetch(t,{signal:AbortSignal.timeout(i??this.requestTimeout),...r})}catch(u){throw new QKo(u)}if(!(r.mode==="no-cors")&&(d.status<200||d.status>=400))throw new aeo(d,c);return d},{...this._retryOptions,...n})}async _shutdown(t=3e4){await this._initPromise;let r=!1;this.clearFlushTimer();let n=async()=>{try{for(await Promise.all(Object.values(this.pendingPromises));!((this.getPersistedProperty(a3e.Queue)||[]).length===0||(await this.flush(),r)););}catch(i){if(!v0f(i))throw i;await Ajy(i)}};return Promise.race([new Promise((i,a)=>{KSs(()=>{this.logMsgIfDebug(()=>console.error("Timed out while shutting down PostHog")),r=!0,a("Timeout while shutting down PostHog. Some events may not have been sent.")},t)}),n()])}async shutdown(t=3e4){return this.shutdownPromise?this.logMsgIfDebug(()=>console.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup")):this.shutdownPromise=this._shutdown(t).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}},P0f=XsC();if(!P0f){let e=ejy();P0f=async(t,r)=>{let n=await e.request({url:t,headers:r.headers,method:r.method.toLowerCase(),data:r.body,signal:r.signal,validateStatus:()=>!0});return{status:n.status,text:async()=>n.data,json:async()=>n.data}}}var zjy=P0f,$Ss=class{constructor(t){this.factory=t}async getValue(){return this.value!==void 0?this.value:(this.initializationPromise===void 0&&(this.initializationPromise=(async()=>{try{let t=await this.factory();return this.value=t,t}finally{this.initializationPromise=void 0}})()),this.initializationPromise)}isInitialized(){return this.value!==void 0}async waitForInitialization(){this.isInitialized()||await this.getValue()}},Qjy=new $Ss(async()=>{try{return await import("crypto")}catch{return}});async function tcC(){return await Qjy.getValue()}var rcC=new $Ss(async()=>{if(typeof globalThis.crypto?.subtle<"u")return globalThis.crypto.subtle;try{let e=await Qjy.getValue();if(e?.webcrypto?.subtle)return e.webcrypto.subtle}catch{}});async function ncC(){return await rcC.getValue()}async function icC(e){let t=await tcC();if(t)return t.createHash("sha1").update(e).digest("hex");let r=await ncC();if(r){let n=await r.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(a=>a.toString(16).padStart(2,"0")).join("")}throw new Error("No crypto implementation available. Tried Node Crypto API and Web SubtleCrypto API")}var acC=60*1e3,ocC=1152921504606847e3,ucC=["is_not"],neo=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},nse=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},w0f=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:a,customHeaders:o,...c}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollingInterval=t,this.personalApiKey=r,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=i,this.projectApiKey=n,this.host=a,this.poller=void 0,this.fetch=c.fetch||zjy,this.onError=c.onError,this.customHeaders=o,this.onLoad=c.onLoad,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,n={},i={},a={}){await this.loadFeatureFlags();let o,c;if(!this.loadedSuccessfullyOnce)return o;for(let d of this.featureFlags)if(t===d.key){c=d;break}if(c!==void 0)try{o=await this.computeFlagLocally(c,r,n,i,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${o}`))}catch(d){d instanceof nse?this.logMsgIfDebug(()=>console.debug(`InconclusiveMatchError when computing flag locally: ${t}: ${d}`)):d instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${d}`))}return o}async computeFeatureFlagPayloadLocally(t,r){await this.loadFeatureFlags();let n;if(this.loadedSuccessfullyOnce){if(typeof r=="boolean"?n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]:typeof r=="string"&&(n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]),n==null)return null;try{return JSON.parse(n)}catch{return n}}}async getAllFlagsAndPayloads(t,r={},n={},i={}){await this.loadFeatureFlags();let a={},o={},c=this.featureFlags.length==0;return await Promise.all(this.featureFlags.map(async d=>{try{let s=await this.computeFlagLocally(d,t,r,n,i);a[d.key]=s;let u=await this.computeFeatureFlagPayloadLocally(d.key,s);u&&(o[d.key]=u)}catch(s){s instanceof nse||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${d.key}: ${s}`)),c=!0}})),{response:a,payloads:o,fallbackToDecide:c}}async computeFlagLocally(t,r,n={},i={},a={}){if(t.ensure_experience_continuity)throw new nse("Flag has experience continuity enabled");if(!t.active)return!1;let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let d=this.groupTypeMapping[String(c)];if(!d)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new nse("Flag has unknown group type index");if(!(d in n))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;let s=a[d];return await this.matchFeatureFlagProperties(t,n[d],s)}else return await this.matchFeatureFlagProperties(t,r,i)}async matchFeatureFlagProperties(t,r,n){let i=t.filters||{},a=i.groups||[],o=!1,c,d=[...a].sort((s,u)=>{let l=!!s.variant,m=!!u.variant;return l&&m?0:l?-1:m?1:0});for(let s of d)try{if(await this.isConditionMatch(t,r,s,n)){let u=s.variant,l=i.multivariate?.variants||[];u&&l.some(m=>m.key===u)?c=u:c=await this.getMatchingVariant(t,r)||!0;break}}catch(u){if(u instanceof nse)o=!0;else throw u}if(c!==void 0)return c;if(o)throw new nse("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i){let a=n.rollout_percentage,o=c=>{this.logMsgIfDebug(()=>console.warn(c))};if((n.properties||[]).length>0){for(let c of n.properties){let d=c.type,s=!1;if(d==="cohort"?s=Ujy(c,i,this.cohorts,this.debugMode):s=Ljy(c,i,o),!s)return!1}if(a==null)return!0}return!(a!=null&&await wjy(t.key,r)>a/100)}async getMatchingVariant(t,r){let n=await wjy(t.key,r,"variant"),i=this.variantLookupTable(t).find(a=>n>=a.valueMin&&n<a.valueMax);if(i)return i.key}variantLookupTable(t){let r=[],n=0,i=0;return((t.filters||{}).multivariate?.variants||[]).forEach(c=>{i=n+c.rollout_percentage/100,r.push({valueMin:n,valueMax:i,key:c.key}),n=i}),r}async loadFeatureFlags(t=!1){(!this.loadedSuccessfullyOnce||t)&&await this._loadFeatureFlags()}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(acC,this.pollingInterval*2**this.backOffCount):this.pollingInterval}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this._loadFeatureFlags(),this.getPollingInterval());try{let t=await this._requestFeatureFlagDefinitions();if(!t)return;switch(t.status){case 401:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new neo(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new neo(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new neo(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let r=await t.json()??{};if(!("flags"in r)){this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`));return}this.featureFlags=r.flags??[],this.featureFlagsByKey=this.featureFlags.reduce((n,i)=>(n[i.key]=i,n),{}),this.groupTypeMapping=r.group_type_mapping||{},this.cohorts=r.cohorts||{},this.loadedSuccessfullyOnce=!0,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.onLoad?.(this.featureFlags.length);break}default:return}}catch(t){t instanceof neo&&this.onError?.(t)}}getPersonalApiKeyRequestOptions(t="GET"){return{method:t,headers:{...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`}}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions(),n=null;if(this.timeout&&typeof this.timeout=="number"){let i=new AbortController;n=KSs(()=>{i.abort()},this.timeout),r.signal=i.signal}try{return await this.fetch(t,r)}finally{clearTimeout(n)}}stopPoller(){clearTimeout(this.poller)}_requestRemoteConfigPayload(t){let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config/`,n=this.getPersonalApiKeyRequestOptions(),i=null;if(this.timeout&&typeof this.timeout=="number"){let a=new AbortController;i=KSs(()=>{a.abort()},this.timeout),n.signal=a.signal}try{return this.fetch(r,n)}finally{clearTimeout(i)}}};async function wjy(e,t,r=""){let n=await icC(`${e}.${t}${r}`);return parseInt(n.slice(0,15),16)/ocC}function Ljy(e,t,r){let n=e.key,i=e.value,a=e.operator||"exact";if(n in t){if(a==="is_not_set")throw new nse("Operator is_not_set is not supported")}else throw new nse(`Property ${n} not found in propertyValues`);let o=t[n];if(o==null&&!ucC.includes(a))return r&&r(`Property ${n} cannot have a value of null/undefined with the ${a} operator`),!1;function c(s,u){return Array.isArray(s)?s.map(l=>String(l).toLowerCase()).includes(String(u).toLowerCase()):String(s).toLowerCase()===String(u).toLowerCase()}function d(s,u,l){if(l==="gt")return s>u;if(l==="gte")return s>=u;if(l==="lt")return s<u;if(l==="lte")return s<=u;throw new Error(`Invalid operator: ${l}`)}switch(a){case"exact":return c(i,o);case"is_not":return!c(i,o);case"is_set":return n in t;case"icontains":return String(o).toLowerCase().includes(String(i).toLowerCase());case"not_icontains":return!String(o).toLowerCase().includes(String(i).toLowerCase());case"regex":return jjy(String(i))&&String(o).match(String(i))!==null;case"not_regex":return jjy(String(i))&&String(o).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let s=typeof i=="number"?i:null;if(typeof i=="string")try{s=parseFloat(i)}catch{}return s!=null&&o!=null?typeof o=="string"?d(o,String(i),a):d(o,s,a):d(String(o),String(i),a)}case"is_date_after":case"is_date_before":{let s=scC(String(i));if(s==null&&(s=Ejy(i)),s==null)throw new nse(`Invalid date: ${i}`);let u=Ejy(o);return["is_date_before"].includes(a)?u<s:u>s}default:throw new nse(`Unknown operator: ${a}`)}}function Ujy(e,t,r,n=!1){let i=String(e.value);if(!(i in r))throw new nse("can't match cohort without a given cohort property value");let a=r[i];return Vjy(a,t,r,n)}function Vjy(e,t,r,n=!1){if(!e)return!0;let i=e.type,a=e.values;if(!a||a.length===0)return!0;let o=!1;if("values"in a[0]){for(let c of a)try{let d=Vjy(c,t,r,n);if(i==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof nse)n&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new nse("Can't match cohort without a given cohort property value");return i==="AND"}else{for(let c of a)try{let d;c.type==="cohort"?d=Ujy(c,t,r,n):d=Ljy(c,t);let s=c.negation||!1;if(i==="AND"){if(!d&&!s||d&&s)return!1}else if(d&&!s||!d&&s)return!0}catch(d){if(d instanceof nse)n&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new nse("can't match cohort without a given cohort property value");return i==="AND"}}function jjy(e){try{return new RegExp(e),!0}catch{return!1}}function Ejy(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(!isNaN(t.valueOf()))return t;throw new nse(`${e} is in an invalid date format`)}else throw new nse(`The date provided ${e} must be a string, number, or date object`)}function scC(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(r){if(!r.groups)return null;let i=parseInt(r.groups.number);if(i>=1e4)return null;let a=r.groups.interval;if(a=="h")n.setUTCHours(n.getUTCHours()-i);else if(a=="d")n.setUTCDate(n.getUTCDate()-i);else if(a=="w")n.setUTCDate(n.getUTCDate()-i*7);else if(a=="m")n.setUTCMonth(n.getUTCMonth()-i);else if(a=="y")n.setUTCFullYear(n.getUTCFullYear()-i);else return null;return n}else return null}var j0f=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},ccC=100,Sjy=30*1e3,lcC=50*1e3,E0f=class extends A0f{constructor(t,r={}){if(super(t,r),this._memoryStorage=new j0f,this.options=r,this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,ccC):Sjy,r.personalApiKey){if(r.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');this.featureFlagsPoller=new w0f({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:n=>{this._events.emit("error",n)},onLoad:n=>{this._events.emit("localEvaluationFlagsLoaded",n)},customHeaders:this.getCustomHeaders()})}this.errorTracking=new ieo(this,r),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||lcC}getPersistedProperty(t){return this._memoryStorage.getProperty(t)}setPersistedProperty(t,r){return this._memoryStorage.setProperty(t,r)}fetch(t,r){return this.options.fetch?this.options.fetch(t,r):zjy(t,r)}getLibraryVersion(){return zsC}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}capture(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:n,properties:i,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s}=t,u=A=>{super.captureStateless(r,n,A,{timestamp:c,disableGeoip:d,uuid:s})},l=async(A,P,C)=>(await super.getFeatureFlagsStateless(A,P,void 0,void 0,C)).flags,m=Promise.resolve().then(async()=>{if(o)return await l(r,a,d);if(n==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let A={};for(let[P,C]of Object.entries(a||{}))A[P]=String(C);return await this.getAllFlags(r,{groups:A,disableGeoip:d,onlyEvaluateLocally:!0})}return{}}).then(A=>{let P={};if(A)for(let[M,T]of Object.entries(A))P[`$feature/${M}`]=T;let C=Object.keys(A||{}).filter(M=>A?.[M]!==!1).sort();return C.length>0&&(P.$active_feature_flags=C),P}).catch(()=>({})).then(A=>{u({...A,...i,$groups:a})});this.addPendingPromise(m)}async captureImmediate(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:n,properties:i,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s}=t,u=A=>super.captureStatelessImmediate(r,n,A,{timestamp:c,disableGeoip:d,uuid:s}),l=async(A,P,C)=>(await super.getFeatureFlagsStateless(A,P,void 0,void 0,C)).flags;await Promise.resolve().then(async()=>{if(o)return await l(r,a,d);if(n==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let A={};for(let[P,C]of Object.entries(a||{}))A[P]=String(C);return await this.getAllFlags(r,{groups:A,disableGeoip:d,onlyEvaluateLocally:!0})}return{}}).then(A=>{let P={};if(A)for(let[M,T]of Object.entries(A))P[`$feature/${M}`]=T;let C=Object.keys(A||{}).filter(M=>A?.[M]!==!1).sort();return C.length>0&&(P.$active_feature_flags=C),P}).catch(()=>({})).then(A=>{u({...A,...i,$groups:a})})}identify({distinctId:t,properties:r,disableGeoip:n}){let i=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;super.identifyStateless(t,{$set:a,$set_once:i},{disableGeoip:n})}async identifyImmediate({distinctId:t,properties:r,disableGeoip:n}){let i=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;await super.identifyStatelessImmediate(t,{$set:a,$set_once:i},{disableGeoip:n})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async aliasImmediate(t){await super.aliasStatelessImmediate(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(t=Sjy){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let n=setTimeout(()=>{i(),r(!1)},t),i=this._events.on("localEvaluationFlagsLoaded",a=>{clearTimeout(n),i(),r(a>0)})})}async getFeatureFlag(t,r,n){let{groups:i,disableGeoip:a}=n||{},{onlyEvaluateLocally:o,sendFeatureFlagEvents:c,personProperties:d,groupProperties:s}=n||{},u=this.addLocalPersonAndGroupProperties(r,i,d,s);d=u.allPersonProperties,s=u.allGroupProperties,o==null&&(o=!1),c==null&&(c=!0);let l=await this.featureFlagsPoller?.getFeatureFlag(t,r,i,d,s),m=l!==void 0,A,P;if(!m&&!o){let M=await super.getFeatureFlagDetailStateless(t,r,i,d,s,a);if(M===void 0)return;P=M.response,l=C0f(P),A=M?.requestId}let C=`${t}_${l}`;return c&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(C))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(C):this.distinctIdHasSentFlagCalls[r]=[C],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:l,$feature_flag_id:P?.metadata?.id,$feature_flag_version:P?.metadata?.version,$feature_flag_reason:P?.reason?.description??P?.reason?.code,locally_evaluated:m,[`$feature/${t}`]:l,$feature_flag_request_id:A},groups:i,disableGeoip:a})),l}async getFeatureFlagPayload(t,r,n,i){let{groups:a,disableGeoip:o}=i||{},{onlyEvaluateLocally:c,sendFeatureFlagEvents:d,personProperties:s,groupProperties:u}=i||{},l=this.addLocalPersonAndGroupProperties(r,a,s,u);s=l.allPersonProperties,u=l.allGroupProperties;let m;return this.featureFlagsPoller!==void 0&&(n||(n=await this.getFeatureFlag(t,r,{...i,onlyEvaluateLocally:!0,sendFeatureFlagEvents:!1})),n&&(m=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,n))),c==null&&(c=!1),d==null&&(d=!0),c==null&&(c=!1),!(m!==void 0)&&!c&&(m=await super.getFeatureFlagPayloadStateless(t,r,a,s,u,o)),m}async getRemoteConfigPayload(t){return(await this.featureFlagsPoller?._requestRemoteConfigPayload(t))?.json()}async isFeatureEnabled(t,r,n){let i=await this.getFeatureFlag(t,r,n);if(i!==void 0)return!!i||!1}async getAllFlags(t,r){return(await this.getAllFlagsAndPayloads(t,r)).featureFlags||{}}async getAllFlagsAndPayloads(t,r){let{groups:n,disableGeoip:i}=r||{},{onlyEvaluateLocally:a,personProperties:o,groupProperties:c}=r||{},d=this.addLocalPersonAndGroupProperties(t,n,o,c);o=d.allPersonProperties,c=d.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,n,o,c),u={},l={},m=!0;if(s&&(u=s.response,l=s.payloads,m=s.fallbackToDecide),m&&!a){let A=await super.getFeatureFlagsAndPayloadsStateless(t,n,o,c,i);u={...u,...A.flags||{}},l={...l,...A.payloads||{}}}return{featureFlags:u,featureFlagPayloads:l}}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:a}){super.groupIdentifyStateless(t,r,n,{disableGeoip:a},i)}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}async _shutdown(t){return this.featureFlagsPoller?.stopPoller(),super._shutdown(t)}addLocalPersonAndGroupProperties(t,r,n,i){let a={distinct_id:t,...n||{}},o={};if(r)for(let c of Object.keys(r))o[c]={$group_key:r[c],...i?.[c]||{}};return{allPersonProperties:a,allGroupProperties:o}}captureException(t,r,n){let i=new Error("PostHog syntheticException");ieo.captureException(this,t,{syntheticException:i},r,n)}},Djy=/\(error: (.*)\)/,Wjy=50,Hjy="?";function fcC(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return n=>{let i=n.match(r);if(i){let a,o,c,d,s;if(i[1]){c=i[1];let m=c.lastIndexOf(".");if(c[m-1]==="."&&m--,m>0){a=c.slice(0,m),o=c.slice(m+1);let A=a.indexOf(".Module");A>0&&(c=c.slice(A+1),a=a.slice(0,A))}d=void 0}o&&(d=a,s=o),o==="<anonymous>"&&(s=void 0,c=void 0),c===void 0&&(s=s||Hjy,c=d?`${d}.${s}`:s);let u=i[2]?.startsWith("file://")?i[2].slice(7):i[2],l=i[5]==="native";return u?.match(/\/[A-Z]:/)&&(u=u.slice(1)),!u&&i[5]&&!l&&(u=i[5]),{filename:u?decodeURI(u):void 0,module:e?e(u):void 0,function:c,lineno:Cjy(i[3]),colno:Cjy(i[4]),in_app:dcC(u||"",l),platform:"node:javascript"}}if(n.match(t))return{filename:n,platform:"node:javascript"}}}function dcC(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function Cjy(e){return parseInt(e||"",10)||void 0}function pcC(e){return[90,fcC(e)]}function _cC(e){let r=[pcC(e)].sort((n,i)=>n[0]-i[0]).map(n=>n[1]);return(n,i=0)=>{let a=[],o=n.split(`
|
|
2166
|
-
`);for(let c=i;c<o.length;c++){let d=o[c];if(d.length>1024)continue;let s=Djy.test(d)?d.replace(Djy,"$1"):d;if(!s.match(/\S*Error: /)){for(let u of r){let l=u(s);if(l){a.push(l);break}}if(a.length>=Wjy)break}}return hcC(a)}}function hcC(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,Wjy).map(r=>({...r,filename:r.filename||ycC(t).filename,function:r.function||Hjy}))}function ycC(e){return e[e.length-1]||{}}ieo.stackParser=_cC(EsC());ieo.frameModifiers=[CsC];var oeo=class extends E0f{getLibraryId(){return"posthog-node"}};var YSs=class{posthog;constructor({posthogApiKey:t}){this.posthog=new oeo(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.94.5",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var LKo=class{async sendEvent(){}async identify(){}async flush(){}};var seo=require("fs/promises"),$jy=require("os"),Yjy=require("path");var Gjy=pa(require("crypto")),ZSs=new Uint8Array(256),XSs=ZSs.length;function I0f(){return XSs>ZSs.length-16&&(Gjy.default.randomFillSync(ZSs),XSs=0),ZSs.slice(XSs,XSs+=16)}var Ibe=[];for(let e=0;e<256;++e)Ibe.push((e+256).toString(16).slice(1));function Jjy(e,t=0){return Ibe[e[t+0]]+Ibe[e[t+1]]+Ibe[e[t+2]]+Ibe[e[t+3]]+"-"+Ibe[e[t+4]]+Ibe[e[t+5]]+"-"+Ibe[e[t+6]]+Ibe[e[t+7]]+"-"+Ibe[e[t+8]]+Ibe[e[t+9]]+"-"+Ibe[e[t+10]]+Ibe[e[t+11]]+Ibe[e[t+12]]+Ibe[e[t+13]]+Ibe[e[t+14]]+Ibe[e[t+15]]}var Kjy=pa(require("crypto")),M0f={randomUUID:Kjy.default.randomUUID};function vcC(e,t,r){if(M0f.randomUUID&&!t&&!e)return M0f.randomUUID();e=e||{};let n=e.random||(e.rng||I0f)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return Jjy(n)}var Zht=vcC;var bcC="id",gcC=".fern",UKo=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new oeo(r),this.userId=t==null?void 0:Hdf(t)}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"0.94.5",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Xl(z_.of((0,$jy.homedir)()),ds.of(gcC),ds.of(bcC));await Rv(t)||(await(0,seo.mkdir)((0,Yjy.dirname)(t),{recursive:!0}),await(0,seo.writeFile)(t,Zht())),this.persistedDistinctId=(await(0,seo.readFile)(t)).toString()}return this.persistedDistinctId}};var B0f;async function ceo(){return B0f==null&&(B0f=await mcC()),B0f}async function mcC(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new LKo;let r=await uAs();return r!=null?new UKo({token:r,posthogApiKey:e}):await cZa()!=null?new YSs({posthogApiKey:e}):new UKo({token:void 0,posthogApiKey:e})}catch{return new LKo}}function VKo(e,t){return function(){return e.apply(t,arguments)}}var{toString:OcC}=Object.prototype,{getPrototypeOf:q0f}=Object,{iterator:eDs,toStringTag:Zjy}=Symbol,tDs=(e=>t=>{let r=OcC.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),xqr=e=>(e=e.toLowerCase(),t=>tDs(t)===e),rDs=e=>t=>typeof t===e,{isArray:feo}=Array,leo=rDs("undefined");function WKo(e){return e!==null&&!leo(e)&&e.constructor!==null&&!leo(e.constructor)&&o3e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var kjy=xqr("ArrayBuffer");function AcC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&kjy(e.buffer),t}var PcC=rDs("string"),o3e=rDs("function"),e1y=rDs("number"),HKo=e=>e!==null&&typeof e=="object",wcC=e=>e===!0||e===!1,kSs=e=>{if(tDs(e)!=="object")return!1;let t=q0f(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Zjy in e)&&!(eDs in e)},jcC=e=>{if(!HKo(e)||WKo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},EcC=xqr("Date"),ScC=xqr("File"),DcC=xqr("Blob"),CcC=xqr("FileList"),IcC=e=>HKo(e)&&o3e(e.pipe),McC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||o3e(e.append)&&((t=tDs(e))==="formdata"||t==="object"&&o3e(e.toString)&&e.toString()==="[object FormData]"))},BcC=xqr("URLSearchParams"),[TcC,qcC,RcC,NcC]=["ReadableStream","Request","Response","Headers"].map(xqr),FcC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function GKo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),feo(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(WKo(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(n=0;n<o;n++)c=a[n],t.call(null,e[c],c,e)}}function t1y(e,t){if(WKo(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}var qca=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,r1y=e=>!leo(e)&&e!==qca;function T0f(){let{caseless:e,skipUndefined:t}=r1y(this)&&this||{},r={},n=(i,a)=>{let o=e&&t1y(r,a)||a;kSs(r[o])&&kSs(i)?r[o]=T0f(r[o],i):kSs(i)?r[o]=T0f({},i):feo(i)?r[o]=i.slice():(!t||!leo(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&GKo(arguments[i],n);return r}var xcC=(e,t,r,{allOwnKeys:n}={})=>(GKo(t,(i,a)=>{r&&o3e(i)?e[a]=VKo(i,r):e[a]=i},{allOwnKeys:n}),e),zcC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),QcC=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},LcC=(e,t,r,n)=>{let i,a,o,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&q0f(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},UcC=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},VcC=e=>{if(!e)return null;if(feo(e))return e;let t=e.length;if(!e1y(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},WcC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&q0f(Uint8Array)),HcC=(e,t)=>{let n=(e&&e[eDs]).call(e),i;for(;(i=n.next())&&!i.done;){let a=i.value;t.call(e,a[0],a[1])}},GcC=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},JcC=xqr("HTMLFormElement"),KcC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Xjy=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$cC=xqr("RegExp"),n1y=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};GKo(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},YcC=e=>{n1y(e,(t,r)=>{if(o3e(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(o3e(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},XcC=(e,t)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return feo(e)?n(e):n(String(e).split(t)),r},ZcC=()=>{},kcC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function elC(e){return!!(e&&o3e(e.append)&&e[Zjy]==="FormData"&&e[eDs])}var tlC=e=>{let t=new Array(10),r=(n,i)=>{if(HKo(n)){if(t.indexOf(n)>=0)return;if(WKo(n))return n;if(!("toJSON"in n)){t[i]=n;let a=feo(n)?[]:{};return GKo(n,(o,c)=>{let d=r(o,i+1);!leo(d)&&(a[c]=d)}),t[i]=void 0,a}}return n};return r(e,0)},rlC=xqr("AsyncFunction"),nlC=e=>e&&(HKo(e)||o3e(e))&&o3e(e.then)&&o3e(e.catch),i1y=((e,t)=>e?setImmediate:t?((r,n)=>(qca.addEventListener("message",({source:i,data:a})=>{i===qca&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),qca.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",o3e(qca.postMessage)),ilC=typeof queueMicrotask<"u"?queueMicrotask.bind(qca):typeof process<"u"&&process.nextTick||i1y,alC=e=>e!=null&&o3e(e[eDs]),$f={isArray:feo,isArrayBuffer:kjy,isBuffer:WKo,isFormData:McC,isArrayBufferView:AcC,isString:PcC,isNumber:e1y,isBoolean:wcC,isObject:HKo,isPlainObject:kSs,isEmptyObject:jcC,isReadableStream:TcC,isRequest:qcC,isResponse:RcC,isHeaders:NcC,isUndefined:leo,isDate:EcC,isFile:ScC,isBlob:DcC,isRegExp:$cC,isFunction:o3e,isStream:IcC,isURLSearchParams:BcC,isTypedArray:WcC,isFileList:CcC,forEach:GKo,merge:T0f,extend:xcC,trim:FcC,stripBOM:zcC,inherits:QcC,toFlatObject:LcC,kindOf:tDs,kindOfTest:xqr,endsWith:UcC,toArray:VcC,forEachEntry:HcC,matchAll:GcC,isHTMLForm:JcC,hasOwnProperty:Xjy,hasOwnProp:Xjy,reduceDescriptors:n1y,freezeMethods:YcC,toObjectSet:XcC,toCamelCase:KcC,noop:ZcC,toFiniteNumber:kcC,findKey:t1y,global:qca,isContextDefined:r1y,isSpecCompliantForm:elC,toJSONObject:tlC,isAsyncFn:rlC,isThenable:nlC,setImmediate:i1y,asap:ilC,isIterable:alC};function deo(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}$f.inherits(deo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$f.toJSONObject(this.config),code:this.code,status:this.status}}});var a1y=deo.prototype,o1y={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{o1y[e]={value:e}});Object.defineProperties(deo,o1y);Object.defineProperty(a1y,"isAxiosError",{value:!0});deo.from=(e,t,r,n,i,a)=>{let o=Object.create(a1y);$f.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return deo.call(o,c,d,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var Mm=deo;var u1y=pa(jSs(),1),nDs=u1y.default;function R0f(e){return $f.isPlainObject(e)||$f.isArray(e)}function c1y(e){return $f.endsWith(e,"[]")?e.slice(0,-2):e}function s1y(e,t,r){return e?e.concat(t).map(function(i,a){return i=c1y(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function olC(e){return $f.isArray(e)&&!e.some(R0f)}var ulC=$f.toFlatObject($f,{},null,function(t){return/^is[A-Z]/.test(t)});function slC(e,t,r){if(!$f.isObject(e))throw new TypeError("target must be an object");t=t||new(nDs||FormData),r=$f.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,M){return!$f.isUndefined(M[C])});let n=r.metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&$f.isSpecCompliantForm(t);if(!$f.isFunction(i))throw new TypeError("visitor must be a function");function s(P){if(P===null)return"";if($f.isDate(P))return P.toISOString();if($f.isBoolean(P))return P.toString();if(!d&&$f.isBlob(P))throw new Mm("Blob is not supported. Use a Buffer instead.");return $f.isArrayBuffer(P)||$f.isTypedArray(P)?d&&typeof Blob=="function"?new Blob([P]):Buffer.from(P):P}function u(P,C,M){let T=P;if(P&&!M&&typeof P=="object"){if($f.endsWith(C,"{}"))C=n?C:C.slice(0,-2),P=JSON.stringify(P);else if($f.isArray(P)&&olC(P)||($f.isFileList(P)||$f.endsWith(C,"[]"))&&(T=$f.toArray(P)))return C=c1y(C),T.forEach(function(U,R){!($f.isUndefined(U)||U===null)&&t.append(o===!0?s1y([C],R,a):o===null?C:C+"[]",s(U))}),!1}return R0f(P)?!0:(t.append(s1y(M,C,a),s(P)),!1)}let l=[],m=Object.assign(ulC,{defaultVisitor:u,convertValue:s,isVisitable:R0f});function A(P,C){if(!$f.isUndefined(P)){if(l.indexOf(P)!==-1)throw Error("Circular reference detected in "+C.join("."));l.push(P),$f.forEach(P,function(T,z){(!($f.isUndefined(T)||T===null)&&i.call(t,T,$f.isString(z)?z.trim():z,C,m))===!0&&A(T,C?C.concat(z):[z])}),l.pop()}}if(!$f.isObject(e))throw new TypeError("data must be an object");return A(e),t}var _7i=slC;function l1y(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function f1y(e,t){this._pairs=[],e&&_7i(e,this,t)}var d1y=f1y.prototype;d1y.append=function(t,r){this._pairs.push([t,r])};d1y.toString=function(t){let r=t?function(n){return t.call(this,n,l1y)}:l1y;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var p1y=f1y;function clC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Rca(e,t,r){if(!t)return e;let n=r&&r.encode||clC;$f.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,a;if(i?a=i(t,r):a=$f.isURLSearchParams(t)?t.toString():new p1y(t,r).toString(n),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var N0f=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){$f.forEach(this.handlers,function(n){n!==null&&t(n)})}},F0f=N0f;var peo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var v1y=pa(require("crypto"),1);var _1y=pa(require("url"),1),h1y=_1y.default.URLSearchParams;var x0f="abcdefghijklmnopqrstuvwxyz",y1y="0123456789",b1y={DIGIT:y1y,ALPHA:x0f,ALPHA_DIGIT:x0f+x0f.toUpperCase()+y1y},llC=(e=16,t=b1y.ALPHA_DIGIT)=>{let r="",{length:n}=t,i=new Uint32Array(e);v1y.default.randomFillSync(i);for(let a=0;a<e;a++)r+=t[i[a]%n];return r},g1y={isNode:!0,classes:{URLSearchParams:h1y,FormData:nDs,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:b1y,generateString:llC,protocols:["http","https","file","data"]};var L0f={};pf(L0f,{hasBrowserEnv:()=>Q0f,hasStandardBrowserEnv:()=>flC,hasStandardBrowserWebWorkerEnv:()=>dlC,navigator:()=>z0f,origin:()=>plC});var Q0f=typeof window<"u"&&typeof document<"u",z0f=typeof navigator=="object"&&navigator||void 0,flC=Q0f&&(!z0f||["ReactNative","NativeScript","NS"].indexOf(z0f.product)<0),dlC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",plC=Q0f&&window.location.href||"http://localhost";var Z7={...L0f,...g1y};function U0f(e,t){return _7i(e,new Z7.classes.URLSearchParams,{visitor:function(r,n,i,a){return Z7.isNode&&$f.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function _lC(e){return $f.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function hlC(e){let t={},r=Object.keys(e),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function ylC(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=a>=r.length;return o=!o&&$f.isArray(i)?i.length:o,d?($f.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!c):((!i[o]||!$f.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&$f.isArray(i[o])&&(i[o]=hlC(i[o])),!c)}if($f.isFormData(e)&&$f.isFunction(e.entries)){let r={};return $f.forEachEntry(e,(n,i)=>{t(_lC(n),i,r,0)}),r}return null}var iDs=ylC;function vlC(e,t,r){if($f.isString(e))try{return(t||JSON.parse)(e),$f.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var V0f={transitional:peo,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=$f.isObject(t);if(a&&$f.isHTMLForm(t)&&(t=new FormData(t)),$f.isFormData(t))return i?JSON.stringify(iDs(t)):t;if($f.isArrayBuffer(t)||$f.isBuffer(t)||$f.isStream(t)||$f.isFile(t)||$f.isBlob(t)||$f.isReadableStream(t))return t;if($f.isArrayBufferView(t))return t.buffer;if($f.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return U0f(t,this.formSerializer).toString();if((c=$f.isFileList(t))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return _7i(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),vlC(t)):t}],transformResponse:[function(t){let r=this.transitional||V0f.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if($f.isResponse(t)||$f.isReadableStream(t))return t;if(t&&$f.isString(t)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?Mm.from(c,Mm.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Z7.classes.FormData,Blob:Z7.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$f.forEach(["delete","get","head","post","put","patch"],e=>{V0f.headers[e]={}});var _eo=V0f;var blC=$f.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),m1y=e=>{let t={},r,n,i;return e&&e.split(`
|
|
2166
|
+
`);for(let c=i;c<o.length;c++){let d=o[c];if(d.length>1024)continue;let s=Djy.test(d)?d.replace(Djy,"$1"):d;if(!s.match(/\S*Error: /)){for(let u of r){let l=u(s);if(l){a.push(l);break}}if(a.length>=Wjy)break}}return hcC(a)}}function hcC(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,Wjy).map(r=>({...r,filename:r.filename||ycC(t).filename,function:r.function||Hjy}))}function ycC(e){return e[e.length-1]||{}}ieo.stackParser=_cC(EsC());ieo.frameModifiers=[CsC];var oeo=class extends E0f{getLibraryId(){return"posthog-node"}};var YSs=class{posthog;constructor({posthogApiKey:t}){this.posthog=new oeo(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.94.6",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var LKo=class{async sendEvent(){}async identify(){}async flush(){}};var seo=require("fs/promises"),$jy=require("os"),Yjy=require("path");var Gjy=pa(require("crypto")),ZSs=new Uint8Array(256),XSs=ZSs.length;function I0f(){return XSs>ZSs.length-16&&(Gjy.default.randomFillSync(ZSs),XSs=0),ZSs.slice(XSs,XSs+=16)}var Ibe=[];for(let e=0;e<256;++e)Ibe.push((e+256).toString(16).slice(1));function Jjy(e,t=0){return Ibe[e[t+0]]+Ibe[e[t+1]]+Ibe[e[t+2]]+Ibe[e[t+3]]+"-"+Ibe[e[t+4]]+Ibe[e[t+5]]+"-"+Ibe[e[t+6]]+Ibe[e[t+7]]+"-"+Ibe[e[t+8]]+Ibe[e[t+9]]+"-"+Ibe[e[t+10]]+Ibe[e[t+11]]+Ibe[e[t+12]]+Ibe[e[t+13]]+Ibe[e[t+14]]+Ibe[e[t+15]]}var Kjy=pa(require("crypto")),M0f={randomUUID:Kjy.default.randomUUID};function vcC(e,t,r){if(M0f.randomUUID&&!t&&!e)return M0f.randomUUID();e=e||{};let n=e.random||(e.rng||I0f)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return Jjy(n)}var Zht=vcC;var bcC="id",gcC=".fern",UKo=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new oeo(r),this.userId=t==null?void 0:Hdf(t)}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"0.94.6",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Xl(z_.of((0,$jy.homedir)()),ds.of(gcC),ds.of(bcC));await Rv(t)||(await(0,seo.mkdir)((0,Yjy.dirname)(t),{recursive:!0}),await(0,seo.writeFile)(t,Zht())),this.persistedDistinctId=(await(0,seo.readFile)(t)).toString()}return this.persistedDistinctId}};var B0f;async function ceo(){return B0f==null&&(B0f=await mcC()),B0f}async function mcC(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new LKo;let r=await uAs();return r!=null?new UKo({token:r,posthogApiKey:e}):await cZa()!=null?new YSs({posthogApiKey:e}):new UKo({token:void 0,posthogApiKey:e})}catch{return new LKo}}function VKo(e,t){return function(){return e.apply(t,arguments)}}var{toString:OcC}=Object.prototype,{getPrototypeOf:q0f}=Object,{iterator:eDs,toStringTag:Zjy}=Symbol,tDs=(e=>t=>{let r=OcC.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),xqr=e=>(e=e.toLowerCase(),t=>tDs(t)===e),rDs=e=>t=>typeof t===e,{isArray:feo}=Array,leo=rDs("undefined");function WKo(e){return e!==null&&!leo(e)&&e.constructor!==null&&!leo(e.constructor)&&o3e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var kjy=xqr("ArrayBuffer");function AcC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&kjy(e.buffer),t}var PcC=rDs("string"),o3e=rDs("function"),e1y=rDs("number"),HKo=e=>e!==null&&typeof e=="object",wcC=e=>e===!0||e===!1,kSs=e=>{if(tDs(e)!=="object")return!1;let t=q0f(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Zjy in e)&&!(eDs in e)},jcC=e=>{if(!HKo(e)||WKo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},EcC=xqr("Date"),ScC=xqr("File"),DcC=xqr("Blob"),CcC=xqr("FileList"),IcC=e=>HKo(e)&&o3e(e.pipe),McC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||o3e(e.append)&&((t=tDs(e))==="formdata"||t==="object"&&o3e(e.toString)&&e.toString()==="[object FormData]"))},BcC=xqr("URLSearchParams"),[TcC,qcC,RcC,NcC]=["ReadableStream","Request","Response","Headers"].map(xqr),FcC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function GKo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),feo(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(WKo(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(n=0;n<o;n++)c=a[n],t.call(null,e[c],c,e)}}function t1y(e,t){if(WKo(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}var qca=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,r1y=e=>!leo(e)&&e!==qca;function T0f(){let{caseless:e,skipUndefined:t}=r1y(this)&&this||{},r={},n=(i,a)=>{let o=e&&t1y(r,a)||a;kSs(r[o])&&kSs(i)?r[o]=T0f(r[o],i):kSs(i)?r[o]=T0f({},i):feo(i)?r[o]=i.slice():(!t||!leo(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&GKo(arguments[i],n);return r}var xcC=(e,t,r,{allOwnKeys:n}={})=>(GKo(t,(i,a)=>{r&&o3e(i)?e[a]=VKo(i,r):e[a]=i},{allOwnKeys:n}),e),zcC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),QcC=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},LcC=(e,t,r,n)=>{let i,a,o,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&q0f(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},UcC=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},VcC=e=>{if(!e)return null;if(feo(e))return e;let t=e.length;if(!e1y(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},WcC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&q0f(Uint8Array)),HcC=(e,t)=>{let n=(e&&e[eDs]).call(e),i;for(;(i=n.next())&&!i.done;){let a=i.value;t.call(e,a[0],a[1])}},GcC=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},JcC=xqr("HTMLFormElement"),KcC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Xjy=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$cC=xqr("RegExp"),n1y=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};GKo(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},YcC=e=>{n1y(e,(t,r)=>{if(o3e(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(o3e(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},XcC=(e,t)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return feo(e)?n(e):n(String(e).split(t)),r},ZcC=()=>{},kcC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function elC(e){return!!(e&&o3e(e.append)&&e[Zjy]==="FormData"&&e[eDs])}var tlC=e=>{let t=new Array(10),r=(n,i)=>{if(HKo(n)){if(t.indexOf(n)>=0)return;if(WKo(n))return n;if(!("toJSON"in n)){t[i]=n;let a=feo(n)?[]:{};return GKo(n,(o,c)=>{let d=r(o,i+1);!leo(d)&&(a[c]=d)}),t[i]=void 0,a}}return n};return r(e,0)},rlC=xqr("AsyncFunction"),nlC=e=>e&&(HKo(e)||o3e(e))&&o3e(e.then)&&o3e(e.catch),i1y=((e,t)=>e?setImmediate:t?((r,n)=>(qca.addEventListener("message",({source:i,data:a})=>{i===qca&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),qca.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",o3e(qca.postMessage)),ilC=typeof queueMicrotask<"u"?queueMicrotask.bind(qca):typeof process<"u"&&process.nextTick||i1y,alC=e=>e!=null&&o3e(e[eDs]),$f={isArray:feo,isArrayBuffer:kjy,isBuffer:WKo,isFormData:McC,isArrayBufferView:AcC,isString:PcC,isNumber:e1y,isBoolean:wcC,isObject:HKo,isPlainObject:kSs,isEmptyObject:jcC,isReadableStream:TcC,isRequest:qcC,isResponse:RcC,isHeaders:NcC,isUndefined:leo,isDate:EcC,isFile:ScC,isBlob:DcC,isRegExp:$cC,isFunction:o3e,isStream:IcC,isURLSearchParams:BcC,isTypedArray:WcC,isFileList:CcC,forEach:GKo,merge:T0f,extend:xcC,trim:FcC,stripBOM:zcC,inherits:QcC,toFlatObject:LcC,kindOf:tDs,kindOfTest:xqr,endsWith:UcC,toArray:VcC,forEachEntry:HcC,matchAll:GcC,isHTMLForm:JcC,hasOwnProperty:Xjy,hasOwnProp:Xjy,reduceDescriptors:n1y,freezeMethods:YcC,toObjectSet:XcC,toCamelCase:KcC,noop:ZcC,toFiniteNumber:kcC,findKey:t1y,global:qca,isContextDefined:r1y,isSpecCompliantForm:elC,toJSONObject:tlC,isAsyncFn:rlC,isThenable:nlC,setImmediate:i1y,asap:ilC,isIterable:alC};function deo(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}$f.inherits(deo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$f.toJSONObject(this.config),code:this.code,status:this.status}}});var a1y=deo.prototype,o1y={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{o1y[e]={value:e}});Object.defineProperties(deo,o1y);Object.defineProperty(a1y,"isAxiosError",{value:!0});deo.from=(e,t,r,n,i,a)=>{let o=Object.create(a1y);$f.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return deo.call(o,c,d,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var Mm=deo;var u1y=pa(jSs(),1),nDs=u1y.default;function R0f(e){return $f.isPlainObject(e)||$f.isArray(e)}function c1y(e){return $f.endsWith(e,"[]")?e.slice(0,-2):e}function s1y(e,t,r){return e?e.concat(t).map(function(i,a){return i=c1y(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function olC(e){return $f.isArray(e)&&!e.some(R0f)}var ulC=$f.toFlatObject($f,{},null,function(t){return/^is[A-Z]/.test(t)});function slC(e,t,r){if(!$f.isObject(e))throw new TypeError("target must be an object");t=t||new(nDs||FormData),r=$f.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,M){return!$f.isUndefined(M[C])});let n=r.metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&$f.isSpecCompliantForm(t);if(!$f.isFunction(i))throw new TypeError("visitor must be a function");function s(P){if(P===null)return"";if($f.isDate(P))return P.toISOString();if($f.isBoolean(P))return P.toString();if(!d&&$f.isBlob(P))throw new Mm("Blob is not supported. Use a Buffer instead.");return $f.isArrayBuffer(P)||$f.isTypedArray(P)?d&&typeof Blob=="function"?new Blob([P]):Buffer.from(P):P}function u(P,C,M){let T=P;if(P&&!M&&typeof P=="object"){if($f.endsWith(C,"{}"))C=n?C:C.slice(0,-2),P=JSON.stringify(P);else if($f.isArray(P)&&olC(P)||($f.isFileList(P)||$f.endsWith(C,"[]"))&&(T=$f.toArray(P)))return C=c1y(C),T.forEach(function(U,R){!($f.isUndefined(U)||U===null)&&t.append(o===!0?s1y([C],R,a):o===null?C:C+"[]",s(U))}),!1}return R0f(P)?!0:(t.append(s1y(M,C,a),s(P)),!1)}let l=[],m=Object.assign(ulC,{defaultVisitor:u,convertValue:s,isVisitable:R0f});function A(P,C){if(!$f.isUndefined(P)){if(l.indexOf(P)!==-1)throw Error("Circular reference detected in "+C.join("."));l.push(P),$f.forEach(P,function(T,z){(!($f.isUndefined(T)||T===null)&&i.call(t,T,$f.isString(z)?z.trim():z,C,m))===!0&&A(T,C?C.concat(z):[z])}),l.pop()}}if(!$f.isObject(e))throw new TypeError("data must be an object");return A(e),t}var _7i=slC;function l1y(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function f1y(e,t){this._pairs=[],e&&_7i(e,this,t)}var d1y=f1y.prototype;d1y.append=function(t,r){this._pairs.push([t,r])};d1y.toString=function(t){let r=t?function(n){return t.call(this,n,l1y)}:l1y;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var p1y=f1y;function clC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Rca(e,t,r){if(!t)return e;let n=r&&r.encode||clC;$f.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,a;if(i?a=i(t,r):a=$f.isURLSearchParams(t)?t.toString():new p1y(t,r).toString(n),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var N0f=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){$f.forEach(this.handlers,function(n){n!==null&&t(n)})}},F0f=N0f;var peo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var v1y=pa(require("crypto"),1);var _1y=pa(require("url"),1),h1y=_1y.default.URLSearchParams;var x0f="abcdefghijklmnopqrstuvwxyz",y1y="0123456789",b1y={DIGIT:y1y,ALPHA:x0f,ALPHA_DIGIT:x0f+x0f.toUpperCase()+y1y},llC=(e=16,t=b1y.ALPHA_DIGIT)=>{let r="",{length:n}=t,i=new Uint32Array(e);v1y.default.randomFillSync(i);for(let a=0;a<e;a++)r+=t[i[a]%n];return r},g1y={isNode:!0,classes:{URLSearchParams:h1y,FormData:nDs,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:b1y,generateString:llC,protocols:["http","https","file","data"]};var L0f={};pf(L0f,{hasBrowserEnv:()=>Q0f,hasStandardBrowserEnv:()=>flC,hasStandardBrowserWebWorkerEnv:()=>dlC,navigator:()=>z0f,origin:()=>plC});var Q0f=typeof window<"u"&&typeof document<"u",z0f=typeof navigator=="object"&&navigator||void 0,flC=Q0f&&(!z0f||["ReactNative","NativeScript","NS"].indexOf(z0f.product)<0),dlC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",plC=Q0f&&window.location.href||"http://localhost";var Z7={...L0f,...g1y};function U0f(e,t){return _7i(e,new Z7.classes.URLSearchParams,{visitor:function(r,n,i,a){return Z7.isNode&&$f.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function _lC(e){return $f.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function hlC(e){let t={},r=Object.keys(e),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function ylC(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=a>=r.length;return o=!o&&$f.isArray(i)?i.length:o,d?($f.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!c):((!i[o]||!$f.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&$f.isArray(i[o])&&(i[o]=hlC(i[o])),!c)}if($f.isFormData(e)&&$f.isFunction(e.entries)){let r={};return $f.forEachEntry(e,(n,i)=>{t(_lC(n),i,r,0)}),r}return null}var iDs=ylC;function vlC(e,t,r){if($f.isString(e))try{return(t||JSON.parse)(e),$f.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var V0f={transitional:peo,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=$f.isObject(t);if(a&&$f.isHTMLForm(t)&&(t=new FormData(t)),$f.isFormData(t))return i?JSON.stringify(iDs(t)):t;if($f.isArrayBuffer(t)||$f.isBuffer(t)||$f.isStream(t)||$f.isFile(t)||$f.isBlob(t)||$f.isReadableStream(t))return t;if($f.isArrayBufferView(t))return t.buffer;if($f.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return U0f(t,this.formSerializer).toString();if((c=$f.isFileList(t))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return _7i(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),vlC(t)):t}],transformResponse:[function(t){let r=this.transitional||V0f.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if($f.isResponse(t)||$f.isReadableStream(t))return t;if(t&&$f.isString(t)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?Mm.from(c,Mm.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Z7.classes.FormData,Blob:Z7.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$f.forEach(["delete","get","head","post","put","patch"],e=>{V0f.headers[e]={}});var _eo=V0f;var blC=$f.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),m1y=e=>{let t={},r,n,i;return e&&e.split(`
|
|
2167
2167
|
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&blC[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var O1y=Symbol("internals");function JKo(e){return e&&String(e).trim().toLowerCase()}function aDs(e){return e===!1||e==null?e:$f.isArray(e)?e.map(aDs):String(e)}function glC(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var mlC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function W0f(e,t,r,n,i){if($f.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!$f.isString(t)){if($f.isString(n))return t.indexOf(n)!==-1;if($f.isRegExp(n))return n.test(t)}}function OlC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function AlC(e,t){let r=$f.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}var heo=class{constructor(t){t&&this.set(t)}set(t,r,n){let i=this;function a(c,d,s){let u=JKo(d);if(!u)throw new Error("header name must be a non-empty string");let l=$f.findKey(i,u);(!l||i[l]===void 0||s===!0||s===void 0&&i[l]!==!1)&&(i[l||d]=aDs(c))}let o=(c,d)=>$f.forEach(c,(s,u)=>a(s,u,d));if($f.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if($f.isString(t)&&(t=t.trim())&&!mlC(t))o(m1y(t),r);else if($f.isObject(t)&&$f.isIterable(t)){let c={},d,s;for(let u of t){if(!$f.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[s=u[0]]=(d=c[s])?$f.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}o(c,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=JKo(t),t){let n=$f.findKey(this,t);if(n){let i=this[n];if(!r)return i;if(r===!0)return glC(i);if($f.isFunction(r))return r.call(this,i,n);if($f.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=JKo(t),t){let n=$f.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||W0f(this,this[n],n,r)))}return!1}delete(t,r){let n=this,i=!1;function a(o){if(o=JKo(o),o){let c=$f.findKey(n,o);c&&(!r||W0f(n,n[c],c,r))&&(delete n[c],i=!0)}}return $f.isArray(t)?t.forEach(a):a(t),i}clear(t){let r=Object.keys(this),n=r.length,i=!1;for(;n--;){let a=r[n];(!t||W0f(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){let r=this,n={};return $f.forEach(this,(i,a)=>{let o=$f.findKey(n,a);if(o){r[o]=aDs(i),delete r[a];return}let c=t?OlC(a):String(a).trim();c!==a&&delete r[a],r[c]=aDs(i),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return $f.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&$f.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
2168
2168
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){let n=(this[O1y]=this[O1y]={accessors:{}}).accessors,i=this.prototype;function a(o){let c=JKo(o);n[c]||(AlC(i,o),n[c]=!0)}return $f.isArray(t)?t.forEach(a):a(t),this}};heo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);$f.reduceDescriptors(heo.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});$f.freezeMethods(heo);var x$=heo;function KKo(e,t){let r=this||_eo,n=t||r,i=x$.from(n.headers),a=n.data;return $f.forEach(e,function(c){a=c.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function $Ko(e){return!!(e&&e.__CANCEL__)}function A1y(e,t,r){Mm.call(this,e??"canceled",Mm.ERR_CANCELED,t,r),this.name="CanceledError"}$f.inherits(A1y,Mm,{__CANCEL__:!0});var Znt=A1y;function lVr(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Mm("Request failed with status code "+r.status,[Mm.ERR_BAD_REQUEST,Mm.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function H0f(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function G0f(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Nca(e,t,r){let n=!H0f(t);return e&&(n||r==!1)?G0f(e,t):t}var x1y=pa(ESs(),1),z1y=pa(require("http"),1),Q1y=pa(require("https"),1),L1y=pa(require("util"),1),U1y=pa(Jgf(),1),rPi=pa(require("zlib"),1);var Fca="1.12.2";function YKo(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var PlC=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function J0f(e,t,r){let n=r&&r.Blob||Z7.classes.Blob,i=YKo(e);if(t===void 0&&n&&(t=!0),i==="data"){e=i.length?e.slice(i.length+1):e;let a=PlC.exec(e);if(!a)throw new Mm("Invalid URL",Mm.ERR_INVALID_URL);let o=a[1],c=a[2],d=a[3],s=Buffer.from(decodeURIComponent(d),c?"base64":"utf8");if(t){if(!n)throw new Mm("Blob is not supported",Mm.ERR_NOT_SUPPORT);return new n([s],{type:o})}return s}throw new Mm("Unsupported protocol "+i,Mm.ERR_NOT_SUPPORT)}var zca=pa(require("stream"),1);var P1y=pa(require("stream"),1);var K0f=Symbol("internals"),$0f=class extends P1y.default.Transform{constructor(t){t=$f.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,i)=>!$f.isUndefined(i[n])),super({readableHighWaterMark:t.chunkSize});let r=this[K0f]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[K0f];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let i=this[K0f],a=i.maxRate,o=this.readableHighWaterMark,c=i.timeWindow,d=1e3/c,s=a/d,u=i.minChunkSize!==!1?Math.max(i.minChunkSize,s*.01):0,l=(A,P)=>{let C=Buffer.byteLength(A);i.bytesSeen+=C,i.bytes+=C,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(A)?process.nextTick(P):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(P)}},m=(A,P)=>{let C=Buffer.byteLength(A),M=null,T=o,z,U=0;if(a){let R=Date.now();(!i.ts||(U=R-i.ts)>=c)&&(i.ts=R,z=s-i.bytes,i.bytes=z<0?-z:0,U=0),z=s-i.bytes}if(a){if(z<=0)return setTimeout(()=>{P(null,A)},c-U);z<T&&(T=z)}T&&C>T&&C-T>u&&(M=A.subarray(T),A=A.subarray(0,T)),l(A,M?()=>{process.nextTick(P,null,M)}:P)};m(t,function A(P,C){if(P)return n(P);C?m(C,A):n(null)})}},Y0f=$0f;var V1y=require("events");var j1y=pa(require("util"),1),E1y=require("stream");var{asyncIterator:w1y}=Symbol,wlC=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[w1y]?yield*e[w1y]():yield e},oDs=wlC;var jlC=Z7.ALPHABET.ALPHA_DIGIT+"-_",XKo=typeof TextEncoder=="function"?new TextEncoder:new j1y.default.TextEncoder,xca=`\r
|
|
2169
2169
|
`,ElC=XKo.encode(xca),SlC=2,X0f=class{constructor(t,r){let{escapeName:n}=this.constructor,i=$f.isString(r),a=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${xca}`;i?r=XKo.encode(String(r).replace(/\r?\n|\r\n?/g,xca)):a+=`Content-Type: ${r.type||"application/octet-stream"}${xca}`,this.headers=XKo.encode(a+xca),this.contentLength=i?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+SlC,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;$f.isTypedArray(t)?yield t:yield*oDs(t),yield ElC}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},DlC=(e,t,r)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+Z7.generateString(i,jlC)}=r||{};if(!$f.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=XKo.encode("--"+a+xca),c=XKo.encode("--"+a+"--"+xca),d=c.byteLength,s=Array.from(e.entries()).map(([l,m])=>{let A=new X0f(l,m);return d+=A.size,A});d+=o.byteLength*s.length,d=$f.toFiniteNumber(d);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(d)&&(u["Content-Length"]=d),t&&t(u),E1y.Readable.from((async function*(){for(let l of s)yield o,yield*l.encode();yield c})())},S1y=DlC;var D1y=pa(require("stream"),1),Z0f=class extends D1y.default.Transform{__transform(t,r,n){this.push(t),n()}_transform(t,r,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,r)}this.__transform(t,r,n)}},C1y=Z0f;var ClC=(e,t)=>$f.isAsyncFn(e)?function(...r){let n=r.pop();e.apply(this,r).then(i=>{try{t?n(null,...t(i)):n(null,i)}catch(a){n(a)}},n)}:e,I1y=ClC;function IlC(e,t){e=e||10;let r=new Array(e),n=new Array(e),i=0,a=0,o;return t=t!==void 0?t:1e3,function(d){let s=Date.now(),u=n[a];o||(o=s),r[i]=d,n[i]=s;let l=a,m=0;for(;l!==i;)m+=r[l++],l=l%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),s-o<t)return;let A=u&&s-u;return A?Math.round(m*1e3/A):void 0}}var M1y=IlC;function MlC(e,t){let r=0,n=1e3/t,i,a,o=(s,u=Date.now())=>{r=u,i=null,a&&(clearTimeout(a),a=null),e(...s)};return[(...s)=>{let u=Date.now(),l=u-r;l>=n?o(s,u):(i=s,a||(a=setTimeout(()=>{a=null,o(i)},n-l)))},()=>i&&o(i)]}var B1y=MlC;var tPi=(e,t,r=3)=>{let n=0,i=M1y(50,250);return B1y(a=>{let o=a.loaded,c=a.lengthComputable?a.total:void 0,d=o-n,s=i(d),u=o<=c;n=o;let l={loaded:o,total:c,progress:c?o/c:void 0,bytes:d,rate:s||void 0,estimated:s&&c&&u?(c-o)/s:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(l)},r)},yeo=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},veo=e=>(...t)=>$f.asap(()=>e(...t));function k0f(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length,o=n.length;for(let m=0;m<o;m++)if(n.charCodeAt(m)===37&&m+2<o){let A=n.charCodeAt(m+1),P=n.charCodeAt(m+2);(A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102)&&(P>=48&&P<=57||P>=65&&P<=70||P>=97&&P<=102)&&(a-=2,m+=2)}let c=0,d=o-1,s=m=>m>=2&&n.charCodeAt(m-2)===37&&n.charCodeAt(m-1)===51&&(n.charCodeAt(m)===68||n.charCodeAt(m)===100);d>=0&&(n.charCodeAt(d)===61?(c++,d--):s(d)&&(c++,d-=3)),c===1&&d>=0&&(n.charCodeAt(d)===61||s(d))&&c++;let l=Math.floor(a/4)*3-(c||0);return l>0?l:0}return Buffer.byteLength(n,"utf8")}var T1y={flush:rPi.default.constants.Z_SYNC_FLUSH,finishFlush:rPi.default.constants.Z_SYNC_FLUSH},BlC={flush:rPi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:rPi.default.constants.BROTLI_OPERATION_FLUSH},q1y=$f.isFunction(rPi.default.createBrotliDecompress),{http:TlC,https:qlC}=U1y.default,RlC=/https:?/,R1y=Z7.protocols.map(e=>e+":"),N1y=(e,[t,r])=>(e.on("end",r).on("error",r),t);function NlC(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function W1y(e,t,r){let n=t;if(!n&&n!==!1){let i=x1y.default.getProxyForUrl(r);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let a=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+a}e.headers.host=e.hostname+(e.port?":"+e.port:"");let i=n.hostname||n.host;e.hostname=i,e.host=i,e.port=n.port,e.path=r,n.protocol&&(e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}e.beforeRedirects.proxy=function(a){W1y(a,t,a.href)}}var FlC=typeof process<"u"&&$f.kindOf(process)==="process",xlC=e=>new Promise((t,r)=>{let n,i,a=(d,s)=>{i||(i=!0,n&&n(d,s))},o=d=>{a(d),t(d)},c=d=>{a(d,!0),r(d)};e(o,c,d=>n=d).catch(c)}),zlC=({address:e,family:t})=>{if(!$f.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},F1y=(e,t)=>zlC($f.isObject(e)?e:{address:e,family:t}),H1y=FlC&&function(t){return xlC(async function(n,i,a){let{data:o,lookup:c,family:d}=t,{responseType:s,responseEncoding:u}=t,l=t.method.toUpperCase(),m,A=!1,P;if(c){let Ee=I1y(c,St=>$f.isArray(St)?St:[St]);c=(St,vt,xe)=>{Ee(St,vt,(Ie,Ut,et)=>{if(Ie)return xe(Ie);let kt=$f.isArray(Ut)?Ut.map(Tt=>F1y(Tt)):[F1y(Ut,et)];vt.all?xe(Ie,kt):xe(Ie,kt[0].address,kt[0].family)})}}let C=new V1y.EventEmitter,M=()=>{t.cancelToken&&t.cancelToken.unsubscribe(T),t.signal&&t.signal.removeEventListener("abort",T),C.removeAllListeners()};a((Ee,St)=>{m=!0,St&&(A=!0,M())});function T(Ee){C.emit("abort",!Ee||Ee.type?new Znt(null,t,P):Ee)}C.once("abort",i),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(T),t.signal&&(t.signal.aborted?T():t.signal.addEventListener("abort",T)));let z=Nca(t.baseURL,t.url,t.allowAbsoluteUrls),U=new URL(z,Z7.hasBrowserEnv?Z7.origin:void 0),R=U.protocol||R1y[0];if(R==="data:"){if(t.maxContentLength>-1){let St=String(t.url||z||"");if(k0f(St)>t.maxContentLength)return i(new Mm("maxContentLength size of "+t.maxContentLength+" exceeded",Mm.ERR_BAD_RESPONSE,t))}let Ee;if(l!=="GET")return lVr(n,i,{status:405,statusText:"method not allowed",headers:{},config:t});try{Ee=J0f(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(St){throw Mm.from(St,Mm.ERR_BAD_REQUEST,t)}return s==="text"?(Ee=Ee.toString(u),(!u||u==="utf8")&&(Ee=$f.stripBOM(Ee))):s==="stream"&&(Ee=zca.default.Readable.from(Ee)),lVr(n,i,{data:Ee,status:200,statusText:"OK",headers:new x$,config:t})}if(R1y.indexOf(R)===-1)return i(new Mm("Unsupported protocol "+R,Mm.ERR_BAD_REQUEST,t));let V=x$.from(t.headers).normalize();V.set("User-Agent","axios/"+Fca,!1);let{onUploadProgress:Y,onDownloadProgress:re}=t,Z=t.maxRate,ee,ne;if($f.isSpecCompliantForm(o)){let Ee=V.getContentType(/boundary=([-_\w\d]{10,70})/i);o=S1y(o,St=>{V.set(St)},{tag:`axios-${Fca}-boundary`,boundary:Ee&&Ee[1]||void 0})}else if($f.isFormData(o)&&$f.isFunction(o.getHeaders)){if(V.set(o.getHeaders()),!V.hasContentLength())try{let Ee=await L1y.default.promisify(o.getLength).call(o);Number.isFinite(Ee)&&Ee>=0&&V.setContentLength(Ee)}catch{}}else if($f.isBlob(o)||$f.isFile(o))o.size&&V.setContentType(o.type||"application/octet-stream"),V.setContentLength(o.size||0),o=zca.default.Readable.from(oDs(o));else if(o&&!$f.isStream(o)){if(!Buffer.isBuffer(o))if($f.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if($f.isString(o))o=Buffer.from(o,"utf-8");else return i(new Mm("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Mm.ERR_BAD_REQUEST,t));if(V.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return i(new Mm("Request body larger than maxBodyLength limit",Mm.ERR_BAD_REQUEST,t))}let me=$f.toFiniteNumber(V.getContentLength());$f.isArray(Z)?(ee=Z[0],ne=Z[1]):ee=ne=Z,o&&(Y||ee)&&($f.isStream(o)||(o=zca.default.Readable.from(o,{objectMode:!1})),o=zca.default.pipeline([o,new Y0f({maxRate:$f.toFiniteNumber(ee)})],$f.noop),Y&&o.on("progress",N1y(o,yeo(me,tPi(veo(Y),!1,3)))));let be;if(t.auth){let Ee=t.auth.username||"",St=t.auth.password||"";be=Ee+":"+St}if(!be&&U.username){let Ee=U.username,St=U.password;be=Ee+":"+St}be&&V.delete("authorization");let Ae;try{Ae=Rca(U.pathname+U.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(Ee){let St=new Error(Ee.message);return St.config=t,St.url=t.url,St.exists=!0,i(St)}V.set("Accept-Encoding","gzip, compress, deflate"+(q1y?", br":""),!1);let ye={path:Ae,method:l,headers:V.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:be,protocol:R,family:d,beforeRedirect:NlC,beforeRedirects:{}};!$f.isUndefined(c)&&(ye.lookup=c),t.socketPath?ye.socketPath=t.socketPath:(ye.hostname=U.hostname.startsWith("[")?U.hostname.slice(1,-1):U.hostname,ye.port=U.port,W1y(ye,t.proxy,R+"//"+U.hostname+(U.port?":"+U.port:"")+ye.path));let Me,Be=RlC.test(ye.protocol);if(ye.agent=Be?t.httpsAgent:t.httpAgent,t.transport?Me=t.transport:t.maxRedirects===0?Me=Be?Q1y.default:z1y.default:(t.maxRedirects&&(ye.maxRedirects=t.maxRedirects),t.beforeRedirect&&(ye.beforeRedirects.config=t.beforeRedirect),Me=Be?qlC:TlC),t.maxBodyLength>-1?ye.maxBodyLength=t.maxBodyLength:ye.maxBodyLength=1/0,t.insecureHTTPParser&&(ye.insecureHTTPParser=t.insecureHTTPParser),P=Me.request(ye,function(St){if(P.destroyed)return;let vt=[St],xe=+St.headers["content-length"];if(re||ne){let Tt=new Y0f({maxRate:$f.toFiniteNumber(ne)});re&&Tt.on("progress",N1y(Tt,yeo(xe,tPi(veo(re),!0,3)))),vt.push(Tt)}let Ie=St,Ut=St.req||P;if(t.decompress!==!1&&St.headers["content-encoding"])switch((l==="HEAD"||St.statusCode===204)&&delete St.headers["content-encoding"],(St.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":vt.push(rPi.default.createUnzip(T1y)),delete St.headers["content-encoding"];break;case"deflate":vt.push(new C1y),vt.push(rPi.default.createUnzip(T1y)),delete St.headers["content-encoding"];break;case"br":q1y&&(vt.push(rPi.default.createBrotliDecompress(BlC)),delete St.headers["content-encoding"])}Ie=vt.length>1?zca.default.pipeline(vt,$f.noop):vt[0];let et=zca.default.finished(Ie,()=>{et(),M()}),kt={status:St.statusCode,statusText:St.statusMessage,headers:new x$(St.headers),config:t,request:Ut};if(s==="stream")kt.data=Ie,lVr(n,i,kt);else{let Tt=[],Ye=0;Ie.on("data",function(cr){Tt.push(cr),Ye+=cr.length,t.maxContentLength>-1&&Ye>t.maxContentLength&&(A=!0,Ie.destroy(),i(new Mm("maxContentLength size of "+t.maxContentLength+" exceeded",Mm.ERR_BAD_RESPONSE,t,Ut)))}),Ie.on("aborted",function(){if(A)return;let cr=new Mm("stream has been aborted",Mm.ERR_BAD_RESPONSE,t,Ut);Ie.destroy(cr),i(cr)}),Ie.on("error",function(cr){P.destroyed||i(Mm.from(cr,null,t,Ut))}),Ie.on("end",function(){try{let cr=Tt.length===1?Tt[0]:Buffer.concat(Tt);s!=="arraybuffer"&&(cr=cr.toString(u),(!u||u==="utf8")&&(cr=$f.stripBOM(cr))),kt.data=cr}catch(cr){return i(Mm.from(cr,null,t,kt.request,kt))}lVr(n,i,kt)})}C.once("abort",Tt=>{Ie.destroyed||(Ie.emit("error",Tt),Ie.destroy())})}),C.once("abort",Ee=>{i(Ee),P.destroy(Ee)}),P.on("error",function(St){i(Mm.from(St,null,t,P))}),P.on("socket",function(St){St.setKeepAlive(!0,1e3*60)}),t.timeout){let Ee=parseInt(t.timeout,10);if(Number.isNaN(Ee)){i(new Mm("error trying to parse `config.timeout` to int",Mm.ERR_BAD_OPTION_VALUE,t,P));return}P.setTimeout(Ee,function(){if(m)return;let vt=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",xe=t.transitional||peo;t.timeoutErrorMessage&&(vt=t.timeoutErrorMessage),i(new Mm(vt,xe.clarifyTimeoutError?Mm.ETIMEDOUT:Mm.ECONNABORTED,t,P)),T()})}if($f.isStream(o)){let Ee=!1,St=!1;o.on("end",()=>{Ee=!0}),o.once("error",vt=>{St=!0,P.destroy(vt)}),o.on("close",()=>{!Ee&&!St&&T(new Znt("Request stream has been aborted",t,P))}),o.pipe(P)}else P.end(o)})};var G1y=Z7.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Z7.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Z7.origin),Z7.navigator&&/(msie|trident)/i.test(Z7.navigator.userAgent)):()=>!0;var J1y=Z7.hasStandardBrowserEnv?{write(e,t,r,n,i,a){let o=[e+"="+encodeURIComponent(t)];$f.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),$f.isString(n)&&o.push("path="+n),$f.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var K1y=e=>e instanceof x$?{...e}:e;function zqr(e,t){t=t||{};let r={};function n(s,u,l,m){return $f.isPlainObject(s)&&$f.isPlainObject(u)?$f.merge.call({caseless:m},s,u):$f.isPlainObject(u)?$f.merge({},u):$f.isArray(u)?u.slice():u}function i(s,u,l,m){if($f.isUndefined(u)){if(!$f.isUndefined(s))return n(void 0,s,l,m)}else return n(s,u,l,m)}function a(s,u){if(!$f.isUndefined(u))return n(void 0,u)}function o(s,u){if($f.isUndefined(u)){if(!$f.isUndefined(s))return n(void 0,s)}else return n(void 0,u)}function c(s,u,l){if(l in t)return n(s,u);if(l in e)return n(void 0,s)}let d={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(s,u,l)=>i(K1y(s),K1y(u),l,!0)};return $f.forEach(Object.keys({...e,...t}),function(u){let l=d[u]||i,m=l(e[u],t[u],u);$f.isUndefined(m)&&l!==c||(r[u]=m)}),r}var uDs=e=>{let t=zqr({},e),{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:c}=t;if(t.headers=o=x$.from(o),t.url=Rca(Nca(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),$f.isFormData(r)){if(Z7.hasStandardBrowserEnv||Z7.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if($f.isFunction(r.getHeaders)){let d=r.getHeaders(),s=["content-type","content-length"];Object.entries(d).forEach(([u,l])=>{s.includes(u.toLowerCase())&&o.set(u,l)})}}if(Z7.hasStandardBrowserEnv&&(n&&$f.isFunction(n)&&(n=n(t)),n||n!==!1&&G1y(t.url))){let d=i&&a&&J1y.read(a);d&&o.set(i,d)}return t};var QlC=typeof XMLHttpRequest<"u",$1y=QlC&&function(e){return new Promise(function(r,n){let i=uDs(e),a=i.data,o=x$.from(i.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:s}=i,u,l,m,A,P;function C(){A&&A(),P&&P(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let M=new XMLHttpRequest;M.open(i.method.toUpperCase(),i.url,!0),M.timeout=i.timeout;function T(){if(!M)return;let U=x$.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),V={data:!c||c==="text"||c==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:U,config:e,request:M};lVr(function(re){r(re),C()},function(re){n(re),C()},V),M=null}"onloadend"in M?M.onloadend=T:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(T)},M.onabort=function(){M&&(n(new Mm("Request aborted",Mm.ECONNABORTED,e,M)),M=null)},M.onerror=function(R){let V=R&&R.message?R.message:"Network Error",Y=new Mm(V,Mm.ERR_NETWORK,e,M);Y.event=R||null,n(Y),M=null},M.ontimeout=function(){let R=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",V=i.transitional||peo;i.timeoutErrorMessage&&(R=i.timeoutErrorMessage),n(new Mm(R,V.clarifyTimeoutError?Mm.ETIMEDOUT:Mm.ECONNABORTED,e,M)),M=null},a===void 0&&o.setContentType(null),"setRequestHeader"in M&&$f.forEach(o.toJSON(),function(R,V){M.setRequestHeader(V,R)}),$f.isUndefined(i.withCredentials)||(M.withCredentials=!!i.withCredentials),c&&c!=="json"&&(M.responseType=i.responseType),s&&([m,P]=tPi(s,!0),M.addEventListener("progress",m)),d&&M.upload&&([l,A]=tPi(d),M.upload.addEventListener("progress",l),M.upload.addEventListener("loadend",A)),(i.cancelToken||i.signal)&&(u=U=>{M&&(n(!U||U.type?new Znt(null,e,M):U),M.abort(),M=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));let z=YKo(i.url);if(z&&Z7.protocols.indexOf(z)===-1){n(new Mm("Unsupported protocol "+z+":",Mm.ERR_BAD_REQUEST,e));return}M.send(a||null)})};var LlC=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i,a=function(s){if(!i){i=!0,c();let u=s instanceof Error?s:this.reason;n.abort(u instanceof Mm?u:new Znt(u instanceof Error?u.message:u))}},o=t&&setTimeout(()=>{o=null,a(new Mm(`timeout ${t} of ms exceeded`,Mm.ETIMEDOUT))},t),c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(a):s.removeEventListener("abort",a)}),e=null)};e.forEach(s=>s.addEventListener("abort",a));let{signal:d}=n;return d.unsubscribe=()=>$f.asap(c),d}},Y1y=LlC;var UlC=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},VlC=async function*(e,t){for await(let r of WlC(e))yield*UlC(r,t)},WlC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},emf=(e,t,r,n)=>{let i=VlC(e,t),a=0,o,c=d=>{o||(o=!0,n&&n(d))};return new ReadableStream({async pull(d){try{let{done:s,value:u}=await i.next();if(s){c(),d.close();return}let l=u.byteLength;if(r){let m=a+=l;r(m)}d.enqueue(new Uint8Array(u))}catch(s){throw c(s),s}},cancel(d){return c(d),i.return()}},{highWaterMark:2})};var X1y=64*1024,{isFunction:sDs}=$f,HlC=(({Request:e,Response:t})=>({Request:e,Response:t}))($f.global),{ReadableStream:Z1y,TextEncoder:k1y}=$f.global,eEy=(e,...t)=>{try{return!!e(...t)}catch{return!1}},GlC=e=>{e=$f.merge.call({skipUndefined:!0},HlC,e);let{fetch:t,Request:r,Response:n}=e,i=t?sDs(t):typeof fetch=="function",a=sDs(r),o=sDs(n);if(!i)return!1;let c=i&&sDs(Z1y),d=i&&(typeof k1y=="function"?(P=>C=>P.encode(C))(new k1y):async P=>new Uint8Array(await new r(P).arrayBuffer())),s=a&&c&&eEy(()=>{let P=!1,C=new r(Z7.origin,{body:new Z1y,method:"POST",get duplex(){return P=!0,"half"}}).headers.has("Content-Type");return P&&!C}),u=o&&c&&eEy(()=>$f.isReadableStream(new n("").body)),l={stream:u&&(P=>P.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(P=>{!l[P]&&(l[P]=(C,M)=>{let T=C&&C[P];if(T)return T.call(C);throw new Mm(`Response type '${P}' is not supported`,Mm.ERR_NOT_SUPPORT,M)})});let m=async P=>{if(P==null)return 0;if($f.isBlob(P))return P.size;if($f.isSpecCompliantForm(P))return(await new r(Z7.origin,{method:"POST",body:P}).arrayBuffer()).byteLength;if($f.isArrayBufferView(P)||$f.isArrayBuffer(P))return P.byteLength;if($f.isURLSearchParams(P)&&(P=P+""),$f.isString(P))return(await d(P)).byteLength},A=async(P,C)=>{let M=$f.toFiniteNumber(P.getContentLength());return M??m(C)};return async P=>{let{url:C,method:M,data:T,signal:z,cancelToken:U,timeout:R,onDownloadProgress:V,onUploadProgress:Y,responseType:re,headers:Z,withCredentials:ee="same-origin",fetchOptions:ne}=uDs(P),me=t||fetch;re=re?(re+"").toLowerCase():"text";let be=Y1y([z,U&&U.toAbortSignal()],R),Ae=null,ye=be&&be.unsubscribe&&(()=>{be.unsubscribe()}),Me;try{if(Y&&s&&M!=="get"&&M!=="head"&&(Me=await A(Z,T))!==0){let Ie=new r(C,{method:"POST",body:T,duplex:"half"}),Ut;if($f.isFormData(T)&&(Ut=Ie.headers.get("content-type"))&&Z.setContentType(Ut),Ie.body){let[et,kt]=yeo(Me,tPi(veo(Y)));T=emf(Ie.body,X1y,et,kt)}}$f.isString(ee)||(ee=ee?"include":"omit");let Be=a&&"credentials"in r.prototype,Ee={...ne,signal:be,method:M.toUpperCase(),headers:Z.normalize().toJSON(),body:T,duplex:"half",credentials:Be?ee:void 0};Ae=a&&new r(C,Ee);let St=await(a?me(Ae,ne):me(C,Ee)),vt=u&&(re==="stream"||re==="response");if(u&&(V||vt&&ye)){let Ie={};["status","statusText","headers"].forEach(Tt=>{Ie[Tt]=St[Tt]});let Ut=$f.toFiniteNumber(St.headers.get("content-length")),[et,kt]=V&&yeo(Ut,tPi(veo(V),!0))||[];St=new n(emf(St.body,X1y,et,()=>{kt&&kt(),ye&&ye()}),Ie)}re=re||"text";let xe=await l[$f.findKey(l,re)||"text"](St,P);return!vt&&ye&&ye(),await new Promise((Ie,Ut)=>{lVr(Ie,Ut,{data:xe,headers:x$.from(St.headers),status:St.status,statusText:St.statusText,config:P,request:Ae})})}catch(Be){throw ye&&ye(),Be&&Be.name==="TypeError"&&/Load failed|fetch/i.test(Be.message)?Object.assign(new Mm("Network Error",Mm.ERR_NETWORK,P,Ae),{cause:Be.cause||Be}):Mm.from(Be,Be&&Be.code,P,Ae)}}},JlC=new Map,tmf=e=>{let t=e?e.env:{},{fetch:r,Request:n,Response:i}=t,a=[n,i,r],o=a.length,c=o,d,s,u=JlC;for(;c--;)d=a[c],s=u.get(d),s===void 0&&u.set(d,s=c?new Map:GlC(t)),u=s;return s},txU=tmf();var rmf={http:H1y,xhr:$1y,fetch:{get:tmf}};$f.forEach(rmf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var tEy=e=>`- ${e}`,$lC=e=>$f.isFunction(e)||e===null||e===!1,cDs={getAdapter:(e,t)=>{e=$f.isArray(e)?e:[e];let{length:r}=e,n,i,a={};for(let o=0;o<r;o++){n=e[o];let c;if(i=n,!$lC(n)&&(i=rmf[(c=String(n)).toLowerCase()],i===void 0))throw new Mm(`Unknown adapter '${c}'`);if(i&&($f.isFunction(i)||(i=i.get(t))))break;a[c||"#"+o]=i}if(!i){let o=Object.entries(a).map(([d,s])=>`adapter ${d} `+(s===!1?"is not supported by the environment":"is not available in the build")),c=r?o.length>1?`since :
|
|
@@ -2399,12 +2399,12 @@ For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides
|
|
|
2399
2399
|
Run ${nd.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
|
|
2400
2400
|
Run ${nd.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),geo(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function hqf({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!XGy(e))return;let i=t??"",a=e.filter(c=>c.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let o=a.sort((c,d)=>c.generatorName.localeCompare(d.generatorName)||c.currentVersion.localeCompare(d.currentVersion));for(let c of o)i+=`
|
|
2401
2401
|
${await HVC(c.generatorName)} (${c.apiName!=null?"API: "+c.apiName+", ":""}Group: ${c.generatorGroup}) `+nd.dim(c.currentVersion)+nd.reset(" \u2192 ")+nd.green(c.latestVersion);return i+=`
|
|
2402
|
-
`,n?geo(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function HVC(e){let r=await new YGy.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new Error(`Generator ${e} not found`);return r.body.displayName}async function GVC({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await kGy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,u,l)=>{c.versions[s]==null&&(c.versions[s]={});let m=kzi(u.name,l),A=await rLr({generatorName:m,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:i,includeMajor:a,context:l});A!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),c}let o={type:"multiApi",versions:{}};return await kGy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,d,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][d]==null&&(o.versions[c][d]={});let l=kzi(s.name,u),m=await rLr({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:i,includeMajor:a,context:u});m!=null&&(o.versions[c][d][s.name]={previousVersion:s.version,latestVersion:m})},generatorFilter:r,groupFilter:n}),o}async function kGy({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await yqr({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(!(c==null||c.groups==null)){for(let d of c.groups)if(!(i!=null&&d.groupName!==i))for(let s of d.generators)n!=null&&s.name!==n||await r(a.workspaceName,d.groupName,s,o)}})}))}function eJy(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${i} has an upgrade available...`);let d=A3e(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),n.push({generatorName:o,generatorGroup:i,apiName:t,isUpgradeAvailable:d,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return n}async function SFs({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let o=[];if(e!=null){let c=await GVC({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(c.type==="multiApi")for(let[d,s]of Object.entries(c.versions))o.push(...eJy(s,d,t.logger));else o.push(...eJy(c.versions,void 0,t.logger))}return o}var $fa=class extends Error{response;request;options;constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${i} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var yqf=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),tJy=typeof globalThis.AbortController=="function",DFs=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",rJy=typeof globalThis.ReadableStream=="function",nJy=typeof globalThis.FormData=="function",CFs=["get","post","put","patch","head","delete"],JVC=()=>{};JVC();var iJy={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},IFs=2147483647,aJy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,MFs=Symbol("stop"),oJy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},uJy={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var KVC=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=aJy,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},sJy=(e,t,r)=>{let n,i=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),n){i+=n.byteLength;let c=t===0?0:i/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,i),transferredBytes:i},n)}n=a},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},n))}}))},cJy=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(sJy(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},lJy=(e,t,r)=>{if(!e.body)return e;let n=KVC(r??e.body);return new Request(e,{duplex:"half",body:sJy(e.body,n,t)})};var Yfa=e=>e!==null&&typeof e=="object";var UZo=(...e)=>{for(let t of e)if((!Yfa(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return gqf({},...e)},vqf=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[a,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function BFs(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:gqf(e[r]??[],t[r]??[])}var bqf=(e={},t={})=>({beforeRequest:BFs(e,t,"beforeRequest"),beforeRetry:BFs(e,t,"beforeRetry"),afterResponse:BFs(e,t,"afterResponse"),beforeError:BFs(e,t,"beforeError")}),$VC=(e,t)=>{let r=new URLSearchParams;for(let n of[e,t])if(n!==void 0)if(n instanceof URLSearchParams)for(let[i,a]of n.entries())r.append(i,a);else if(Array.isArray(n))for(let i of n){if(!Array.isArray(i)||i.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(i[0]),String(i[1]))}else if(Yfa(n))for(let[i,a]of Object.entries(n))a!==void 0&&r.append(i,String(a));else{let i=new URLSearchParams(n);for(let[a,o]of i.entries())r.append(a,o)}return r},gqf=(...e)=>{let t={},r={},n={},i,a=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Yfa(o)){for(let[c,d]of Object.entries(o)){if(c==="signal"&&d instanceof globalThis.AbortSignal){a.push(d);continue}if(c==="searchParams"){d==null?i=void 0:i=i===void 0?d:$VC(i,d);continue}Yfa(d)&&c in t&&(d=gqf(t[c],d)),t={...t,[c]:d}}Yfa(o.hooks)&&(n=bqf(n,o.hooks),t.hooks=n),Yfa(o.headers)&&(r=vqf(r,o.headers),t.headers=r)}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:DFs?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t};var dJy=e=>CFs.includes(e)?e.toUpperCase():e,YVC=["get","put","head","delete","options","trace"],XVC=[408,413,429,500,502,503,504],ZVC=[413,429,503],fJy={limit:2,methods:YVC,statusCodes:XVC,afterStatusCodes:ZVC,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},pJy=(e={})=>{if(typeof e=="number")return{...fJy,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...fJy,...e}};var Xfa=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};async function mqf(e,t,r,n){return new Promise((i,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new Xfa(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Oqf(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(a),n(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}var _Jy=(e,t)=>{let r={};for(let n in t)!(n in uJy)&&!(n in oJy)&&!(n in e)&&(r[n]=t[n]);return r},hJy=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function yJy(e){return e instanceof $fa||e?.name===$fa.name}function vJy(e){return e instanceof Xfa||e?.name===Xfa.name}var VZo=class e{static create(t,r){let n=new e(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>IFs)throw new RangeError(`The \`timeout\` option cannot be greater than ${IFs}`);await Promise.resolve();let c=await n._fetch();for(let d of n._options.hooks.afterResponse){let s=await d(n.request,n.#r(),n._decorateResponse(c.clone()),{retryCount:n._retryCount});s instanceof globalThis.Response&&(c=s)}if(n._decorateResponse(c),!c.ok&&n._options.throwHttpErrors){let d=new $fa(c,n.request,n.#r());for(let s of n._options.hooks.beforeError)d=await s(d,{retryCount:n._retryCount});throw d}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!rJy)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return cJy(c.clone(),n._options.onDownloadProgress)}return c},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{let c=n._originalRequest,d=[];c&&!c.bodyUsed&&d.push(c.body?.cancel()),n.request.bodyUsed||d.push(n.request.body?.cancel()),await Promise.all(d)});for(let[c,d]of Object.entries(iJy))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||d);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;#t;constructor(t,r={}){if(this._input=t,this._options={...r,headers:vqf(this._input.headers,r.headers),hooks:bqf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:dJy(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:pJy(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(tJy&&DFs){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}yqf&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json"));let n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this._input instanceof globalThis.Request&&(nJy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!n&&this._options.headers.delete("content-type"),this.request=new globalThis.Request(this._input,this._options),hJy(this._options.searchParams)){let a="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!yqf)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=lJy(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||vJy(t))throw t;if(yJy(t)){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let a=this._options.retry.maxRetryAfter??i;return i<a?i:a}if(t.response.status===413)throw t}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let n=Math.min(this._calculateRetryDelay(r),IFs);if(this._retryCount<1)throw r;await Oqf(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this.#r(),error:r,retryCount:this._retryCount})===MFs)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this.#r(),{retryCount:this._retryCount});if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=_Jy(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):mqf(this._originalRequest,t,this.abortController,this._options)}#r(){if(!this.#t){let{hooks:t,...r}=this._options;this.#t=Object.freeze(r)}return this.#t}};var Aqf=e=>{let t=(r,n)=>VZo.create(r,UZo(e,n));for(let r of CFs)t[r]=(n,i)=>VZo.create(n,UZo(e,i,{method:r}));return t.create=r=>Aqf(UZo(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Aqf(UZo(e,r))),t.stop=MFs,t},kVC=Aqf(),bJy=kVC;var LJy=pa(QJy(),1);function Sqf(e){let t=(0,LJy.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var RKy=pa(qKy(),1),NKy=pa(XQr(),1),Qqf=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},Lqf=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function Uqf(e,t={}){let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??Sqf(i),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,RKy.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,c&&(d.authorization=`${c.type} ${c.token}`);let s;try{s=await bJy(o,{headers:d,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new Qqf(e):l}if(t.allVersions)return s;let u=new Lqf(e,r);if(s["dist-tags"][r]){let{time:l}=s;s=s.versions[s["dist-tags"][r]],s.time=l}else if(r){let l=!!s.versions[r];if(n&&!l)for(let[A,P]of Object.entries(s.versions))P.deprecated&&delete s.versions[A];if(!l){let A=Object.keys(s.versions);if(r=NKy.default.maxSatisfying(A,r),!r)throw u}let{time:m}=s;if(s=s.versions[r],s.time=m,!s)throw u}return s}async function $Zo(e,t){let{version:r}=await Uqf(e.toLowerCase(),t);return r}async function z8i({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:$Zo(e.packageName,{version:t?"prerelease":"latest"})}var FKy=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],WFs=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Y1.Info;isLocal;constructor(t,r,{isLocal:n}){this.ttyAwareLogger=new EFs(t,r),this.isLocal=n??!1;let i=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(i==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:i,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.94.5"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${nd.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new eie}failWithoutThrowing(t,r){this.didSucceed=!1,PFs({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await ceo()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await ZGy({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
2402
|
+
`,n?geo(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function HVC(e){let r=await new YGy.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new Error(`Generator ${e} not found`);return r.body.displayName}async function GVC({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await kGy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,u,l)=>{c.versions[s]==null&&(c.versions[s]={});let m=kzi(u.name,l),A=await rLr({generatorName:m,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:i,includeMajor:a,context:l});A!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),c}let o={type:"multiApi",versions:{}};return await kGy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,d,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][d]==null&&(o.versions[c][d]={});let l=kzi(s.name,u),m=await rLr({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:i,includeMajor:a,context:u});m!=null&&(o.versions[c][d][s.name]={previousVersion:s.version,latestVersion:m})},generatorFilter:r,groupFilter:n}),o}async function kGy({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await yqr({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(!(c==null||c.groups==null)){for(let d of c.groups)if(!(i!=null&&d.groupName!==i))for(let s of d.generators)n!=null&&s.name!==n||await r(a.workspaceName,d.groupName,s,o)}})}))}function eJy(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${i} has an upgrade available...`);let d=A3e(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),n.push({generatorName:o,generatorGroup:i,apiName:t,isUpgradeAvailable:d,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return n}async function SFs({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let o=[];if(e!=null){let c=await GVC({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(c.type==="multiApi")for(let[d,s]of Object.entries(c.versions))o.push(...eJy(s,d,t.logger));else o.push(...eJy(c.versions,void 0,t.logger))}return o}var $fa=class extends Error{response;request;options;constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${i} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var yqf=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),tJy=typeof globalThis.AbortController=="function",DFs=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",rJy=typeof globalThis.ReadableStream=="function",nJy=typeof globalThis.FormData=="function",CFs=["get","post","put","patch","head","delete"],JVC=()=>{};JVC();var iJy={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},IFs=2147483647,aJy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,MFs=Symbol("stop"),oJy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},uJy={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var KVC=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=aJy,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},sJy=(e,t,r)=>{let n,i=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),n){i+=n.byteLength;let c=t===0?0:i/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,i),transferredBytes:i},n)}n=a},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},n))}}))},cJy=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(sJy(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},lJy=(e,t,r)=>{if(!e.body)return e;let n=KVC(r??e.body);return new Request(e,{duplex:"half",body:sJy(e.body,n,t)})};var Yfa=e=>e!==null&&typeof e=="object";var UZo=(...e)=>{for(let t of e)if((!Yfa(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return gqf({},...e)},vqf=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[a,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function BFs(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:gqf(e[r]??[],t[r]??[])}var bqf=(e={},t={})=>({beforeRequest:BFs(e,t,"beforeRequest"),beforeRetry:BFs(e,t,"beforeRetry"),afterResponse:BFs(e,t,"afterResponse"),beforeError:BFs(e,t,"beforeError")}),$VC=(e,t)=>{let r=new URLSearchParams;for(let n of[e,t])if(n!==void 0)if(n instanceof URLSearchParams)for(let[i,a]of n.entries())r.append(i,a);else if(Array.isArray(n))for(let i of n){if(!Array.isArray(i)||i.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(i[0]),String(i[1]))}else if(Yfa(n))for(let[i,a]of Object.entries(n))a!==void 0&&r.append(i,String(a));else{let i=new URLSearchParams(n);for(let[a,o]of i.entries())r.append(a,o)}return r},gqf=(...e)=>{let t={},r={},n={},i,a=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Yfa(o)){for(let[c,d]of Object.entries(o)){if(c==="signal"&&d instanceof globalThis.AbortSignal){a.push(d);continue}if(c==="searchParams"){d==null?i=void 0:i=i===void 0?d:$VC(i,d);continue}Yfa(d)&&c in t&&(d=gqf(t[c],d)),t={...t,[c]:d}}Yfa(o.hooks)&&(n=bqf(n,o.hooks),t.hooks=n),Yfa(o.headers)&&(r=vqf(r,o.headers),t.headers=r)}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:DFs?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t};var dJy=e=>CFs.includes(e)?e.toUpperCase():e,YVC=["get","put","head","delete","options","trace"],XVC=[408,413,429,500,502,503,504],ZVC=[413,429,503],fJy={limit:2,methods:YVC,statusCodes:XVC,afterStatusCodes:ZVC,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},pJy=(e={})=>{if(typeof e=="number")return{...fJy,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...fJy,...e}};var Xfa=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};async function mqf(e,t,r,n){return new Promise((i,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new Xfa(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Oqf(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(a),n(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}var _Jy=(e,t)=>{let r={};for(let n in t)!(n in uJy)&&!(n in oJy)&&!(n in e)&&(r[n]=t[n]);return r},hJy=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function yJy(e){return e instanceof $fa||e?.name===$fa.name}function vJy(e){return e instanceof Xfa||e?.name===Xfa.name}var VZo=class e{static create(t,r){let n=new e(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>IFs)throw new RangeError(`The \`timeout\` option cannot be greater than ${IFs}`);await Promise.resolve();let c=await n._fetch();for(let d of n._options.hooks.afterResponse){let s=await d(n.request,n.#r(),n._decorateResponse(c.clone()),{retryCount:n._retryCount});s instanceof globalThis.Response&&(c=s)}if(n._decorateResponse(c),!c.ok&&n._options.throwHttpErrors){let d=new $fa(c,n.request,n.#r());for(let s of n._options.hooks.beforeError)d=await s(d,{retryCount:n._retryCount});throw d}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!rJy)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return cJy(c.clone(),n._options.onDownloadProgress)}return c},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{let c=n._originalRequest,d=[];c&&!c.bodyUsed&&d.push(c.body?.cancel()),n.request.bodyUsed||d.push(n.request.body?.cancel()),await Promise.all(d)});for(let[c,d]of Object.entries(iJy))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||d);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;#t;constructor(t,r={}){if(this._input=t,this._options={...r,headers:vqf(this._input.headers,r.headers),hooks:bqf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:dJy(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:pJy(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(tJy&&DFs){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}yqf&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json"));let n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this._input instanceof globalThis.Request&&(nJy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!n&&this._options.headers.delete("content-type"),this.request=new globalThis.Request(this._input,this._options),hJy(this._options.searchParams)){let a="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!yqf)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=lJy(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||vJy(t))throw t;if(yJy(t)){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let a=this._options.retry.maxRetryAfter??i;return i<a?i:a}if(t.response.status===413)throw t}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let n=Math.min(this._calculateRetryDelay(r),IFs);if(this._retryCount<1)throw r;await Oqf(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this.#r(),error:r,retryCount:this._retryCount})===MFs)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this.#r(),{retryCount:this._retryCount});if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=_Jy(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):mqf(this._originalRequest,t,this.abortController,this._options)}#r(){if(!this.#t){let{hooks:t,...r}=this._options;this.#t=Object.freeze(r)}return this.#t}};var Aqf=e=>{let t=(r,n)=>VZo.create(r,UZo(e,n));for(let r of CFs)t[r]=(n,i)=>VZo.create(n,UZo(e,i,{method:r}));return t.create=r=>Aqf(UZo(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Aqf(UZo(e,r))),t.stop=MFs,t},kVC=Aqf(),bJy=kVC;var LJy=pa(QJy(),1);function Sqf(e){let t=(0,LJy.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var RKy=pa(qKy(),1),NKy=pa(XQr(),1),Qqf=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},Lqf=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function Uqf(e,t={}){let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??Sqf(i),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,RKy.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,c&&(d.authorization=`${c.type} ${c.token}`);let s;try{s=await bJy(o,{headers:d,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new Qqf(e):l}if(t.allVersions)return s;let u=new Lqf(e,r);if(s["dist-tags"][r]){let{time:l}=s;s=s.versions[s["dist-tags"][r]],s.time=l}else if(r){let l=!!s.versions[r];if(n&&!l)for(let[A,P]of Object.entries(s.versions))P.deprecated&&delete s.versions[A];if(!l){let A=Object.keys(s.versions);if(r=NKy.default.maxSatisfying(A,r),!r)throw u}let{time:m}=s;if(s=s.versions[r],s.time=m,!s)throw u}return s}async function $Zo(e,t){let{version:r}=await Uqf(e.toLowerCase(),t);return r}async function z8i({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:$Zo(e.packageName,{version:t?"prerelease":"latest"})}var FKy=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],WFs=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Y1.Info;isLocal;constructor(t,r,{isLocal:n}){this.ttyAwareLogger=new EFs(t,r),this.isLocal=n??!1;let i=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(i==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:i,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.94.6"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${nd.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new eie}failWithoutThrowing(t,r){this.didSucceed=!1,PFs({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await ceo()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await ZGy({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
2403
2403
|
`)||(r+=`
|
|
2404
2404
|
`),this.stderr.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram({code:t}={}){process.exit(t??(this.didSucceed?0:1))}longestWorkspaceName;registerWorkspaces(t){let r=hXl(t.map(n=>n.type==="docs"?"docs":n.workspaceName??"api"),n=>n.length);r!=null&&(this.longestWorkspaceName=r)}project;registerProject(t){this.project=t}runTask(t){return this.runTaskWithInit(this.constructTaskInit(),t)}addTask(){return this.addTaskWithInit(this.constructTaskInit())}async runTaskForWorkspace(t,r){await this.runTaskWithInit(this.constructTaskInitForWorkspace(t),r)}addTaskWithInit(t){let r=new NZo(t);return this.ttyAwareLogger.registerTask(r),r}USE_NODE_18_OR_ABOVE_MESSAGE="The Fern CLI requires Node 18+ or above.";async runTaskWithInit(t,r){let n=this.addTaskWithInit(t).start(),i;try{i=await r(n)}catch(a){throw a.message.includes("globalThis")?(n.logger.error(this.USE_NODE_18_OR_ABOVE_MESSAGE),n.failWithoutThrowing()):n.failWithoutThrowing(void 0,a),new eie}finally{n.finish()}return i}async instrumentPostHogEvent(t){this.isLocal||(await ceo()).sendEvent(t)}logger=_5r((t,...r)=>this.log(t,...r));stderr=_5r((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=xKy(t.type==="docs"?"docs":t.workspaceName??"api"),n=1+(this.longestWorkspaceName!=null?xKy(this.longestWorkspaceName):r).length,i=r.padEnd(n),a=FKy[this.numTasks++%FKy.length],o=nd.hex(a)(i);return{...this.constructTaskInit(),logPrefix:o}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===RV.Failure&&(this.didSucceed=!1)},instrumentPostHogEvent:async t=>{await this.instrumentPostHogEvent(t)},shouldBufferLogs:!1}}log(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}])}logStderr(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}],{stderr:!0})}logImmediately(t,{stderr:r=!1}={}){let n=t.filter(i=>lzi.indexOf(i.level)>=lzi.indexOf(this.logLevel));this.ttyAwareLogger.log(n,{includeDebugInfo:this.logLevel===Y1.Debug,stderr:r})}_suppressUpgradeMessage=!1;suppressUpgradeMessage(){this._suppressUpgradeMessage=!0}_isUpgradeAvailable;async isUpgradeAvailable({includePreReleases:t=!1}={}){if(this._isUpgradeAvailable==null){this.logger.debug(`Checking if ${this.environment.packageName} upgrade is available...`);let r=await z8i({cliEnvironment:this.environment,includePreReleases:t}),n=A3e(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(n?"Upgrade available.":"No upgrade available."));let i={isUpgradeAvailable:n,latestVersion:r},a=await SFs({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:i,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){try{return await iqf({message:t,choices:[{name:"No",value:!1},{name:"Yes",value:!0}],default:r,theme:{prefix:nd.yellow("?"),style:{answer:i=>nd.cyan(i),message:i=>nd.bold(i),highlight:i=>nd.cyan(i)}}})}catch(n){throw n?.name==="ExitPromptError"?(this.logger.info(`
|
|
2405
2405
|
Cancelled by user.`),new eie):n}}async getInput(t){return await tqf({message:t.message,default:t.default})}};function xKy(e){return`[${e}]:`}var cRr=class{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;constructor({generatorsConfiguration:t,workspaceName:r,cliVersion:n,absoluteFilePath:i,changelog:a}){this.generatorsConfiguration=t,this.workspaceName=r,this.cliVersion=n,this.absoluteFilePath=i,this.changelog=a}};var jit=class extends cRr{definition;sources;type="fern";constructor({definition:t,sources:r,...n}){super(n),this.definition=t,this.sources=r??[]}async getDefinition(){return this.definition}async toFernWorkspace(){return this}getSources(){return this.sources}getAbsoluteFilePaths(){return[this.absoluteFilePath]}};var Uyt={enableUniqueErrorsPerEndpoint:!1,detectGlobalHeaders:!0,objectQueryParameters:!1,respectReadonlySchemas:!1,respectNullableSchemas:!1,onlyIncludeReferencedSchemas:!1,inlinePathParameters:!1,useBytesForBinaryResponse:!1,respectForwardCompatibleEnums:!1,wrapReferencesToNullableInOptional:!0,coerceOptionalSchemasToNullable:!0,groupEnvironmentsByHost:!1};function YZo({options:e,overrides:t}){return{enableUniqueErrorsPerEndpoint:t?.enableUniqueErrorsPerEndpoint??e?.enableUniqueErrorsPerEndpoint??Uyt.enableUniqueErrorsPerEndpoint,detectGlobalHeaders:t?.detectGlobalHeaders??e?.detectGlobalHeaders??Uyt.detectGlobalHeaders,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??Uyt.objectQueryParameters,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??Uyt.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??Uyt.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??Uyt.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??Uyt.inlinePathParameters,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??Uyt.useBytesForBinaryResponse,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??Uyt.respectForwardCompatibleEnums,wrapReferencesToNullableInOptional:t?.wrapReferencesToNullableInOptional??e?.wrapReferencesToNullableInOptional??Uyt.wrapReferencesToNullableInOptional,coerceOptionalSchemasToNullable:t?.coerceOptionalSchemasToNullable??e?.coerceOptionalSchemasToNullable??Uyt.coerceOptionalSchemasToNullable,groupEnvironmentsByHost:t?.groupEnvironmentsByHost??e?.groupEnvironmentsByHost??Uyt.groupEnvironmentsByHost}}var nwe={openapi:e=>({...e,type:"openapi",_visit:function(t){return nwe._visit(this,t)}}),protobuf:e=>({...e,type:"protobuf",_visit:function(t){return nwe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"openapi":return t.openapi(e);case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var yio={protobuf:e=>({...e,type:"protobuf",_visit:function(t){return yio._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var Tde={basic:e=>({...e,type:"basic",_visit:function(t){return Tde._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return Tde._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return Tde._visit(this,t)}}),query:e=>({...e,type:"query",_visit:function(t){return Tde._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return Tde._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"header":return t.header(e);case"query":return t.query(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var SS={primitive:e=>({value:e,type:"primitive",_visit:function(t){return SS._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return SS._visit(this,t)}}),array:e=>({value:e,type:"array",_visit:function(t){return SS._visit(this,t)}}),map:e=>({value:e,type:"map",_visit:function(t){return SS._visit(this,t)}}),enum:e=>({value:e,type:"enum",_visit:function(t){return SS._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return SS._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return SS._visit(this,t)}}),null:e=>({...e,type:"null",_visit:function(t){return SS._visit(this,t)}}),unknown:e=>({value:e,type:"unknown",_visit:function(t){return SS._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e.value);case"object":return t.object(e);case"array":return t.array(e.value);case"map":return t.map(e.value);case"enum":return t.enum(e.value);case"literal":return t.literal(e.value);case"oneOf":return t.oneOf(e.value);case"null":return t.null(e);case"unknown":return t.unknown(e.value);default:return t._other(e)}}};var CO={int:e=>({value:e,type:"int",_visit:function(t){return CO._visit(this,t)}}),int64:e=>({value:e,type:"int64",_visit:function(t){return CO._visit(this,t)}}),uint:e=>({value:e,type:"uint",_visit:function(t){return CO._visit(this,t)}}),uint64:e=>({value:e,type:"uint64",_visit:function(t){return CO._visit(this,t)}}),float:e=>({value:e,type:"float",_visit:function(t){return CO._visit(this,t)}}),double:e=>({value:e,type:"double",_visit:function(t){return CO._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return CO._visit(this,t)}}),datetime:e=>({value:e,type:"datetime",_visit:function(t){return CO._visit(this,t)}}),date:e=>({value:e,type:"date",_visit:function(t){return CO._visit(this,t)}}),base64:e=>({value:e,type:"base64",_visit:function(t){return CO._visit(this,t)}}),boolean:e=>({value:e,type:"boolean",_visit:function(t){return CO._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e.value);case"int64":return t.int64(e.value);case"uint":return t.uint(e.value);case"uint64":return t.uint64(e.value);case"float":return t.float(e.value);case"double":return t.double(e.value);case"string":return t.string(e.value);case"datetime":return t.datetime(e.value);case"date":return t.date(e.value);case"base64":return t.base64(e.value);case"boolean":return t.boolean(e.value);default:return t._other(e)}}};var Q8i={boolean:e=>({value:e,type:"boolean",_visit:function(t){return Q8i._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Q8i._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var L8i={discriminated:e=>({value:e,type:"discriminated",_visit:function(t){return L8i._visit(this,t)}}),undiscriminated:e=>({value:e,type:"undiscriminated",_visit:function(t){return L8i._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e.value);case"undiscriminated":return t.undiscriminated(e.value);default:return t._other(e)}}};var HFs={};pf(HFs,{Availability:()=>qde,CustomCodeSample:()=>rWr,EndpointExample:()=>Vyt,EndpointResponseExample:()=>Wyt,HttpMethod:()=>Nde,LiteralSchemaValue:()=>eW,MultipartRequestPropertyEncoding:()=>Hqf,MultipartSchema:()=>nWr,OneOfSchema:()=>iWr,Pagination:()=>Eit,PrimitiveSchemaValue:()=>Lq,Request:()=>lRr,Response:()=>Fbe,RetriesConfiguration:()=>XZo,Schema:()=>i1,SupportedSdkLanguage:()=>Rde,WebhookHttpMethod:()=>Wqf,WebsocketMessageOrigin:()=>Vqf});var Vqf={Client:"client",Server:"server",_visit:(e,t)=>{switch(e){case Vqf.Client:return t.client();case Vqf.Server:return t.server();default:return t._other()}}};var Wqf={Get:"GET",Post:"POST",_visit:(e,t)=>{switch(e){case Wqf.Get:return t.get();case Wqf.Post:return t.post();default:return t._other()}}};var qde={GenerallyAvailable:"GenerallyAvailable",Beta:"Beta",Deprecated:"Deprecated",_visit:(e,t)=>{switch(e){case qde.GenerallyAvailable:return t.generallyAvailable();case qde.Beta:return t.beta();case qde.Deprecated:return t.deprecated();default:return t._other()}}};var XZo={disabled:e=>({value:e,type:"disabled",_visit:function(t){return XZo._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"disabled":return t.disabled(e.value);default:return t._other(e)}}};var Eit={cursor:e=>({...e,type:"cursor",_visit:function(t){return Eit._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return Eit._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return Eit._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);case"custom":return t.custom(e);default:return t._other(e)}}};var rWr={language:e=>({...e,type:"language",_visit:function(t){return rWr._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return rWr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"language":return t.language(e);case"sdk":return t.sdk(e);default:return t._other(e)}}};var Rde={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",Js:"js",Node:"node",Ts:"ts",Nodets:"nodets",Golang:"golang",Dotnet:"dotnet",Jvm:"jvm",_visit:(e,t)=>{switch(e){case Rde.Curl:return t.curl();case Rde.Python:return t.python();case Rde.Javascript:return t.javascript();case Rde.Typescript:return t.typescript();case Rde.Go:return t.go();case Rde.Ruby:return t.ruby();case Rde.Csharp:return t.csharp();case Rde.Java:return t.java();case Rde.Js:return t.js();case Rde.Node:return t.node();case Rde.Ts:return t.ts();case Rde.Nodets:return t.nodets();case Rde.Golang:return t.golang();case Rde.Dotnet:return t.dotnet();case Rde.Jvm:return t.jvm();default:return t._other()}}};var Vyt={unknown:e=>({value:e,type:"unknown",_visit:function(t){return Vyt._visit(this,t)}}),full:e=>({...e,type:"full",_visit:function(t){return Vyt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"unknown":return t.unknown(e.value);case"full":return t.full(e);default:return t._other(e)}}};var Wyt={withStreaming:e=>({...e,type:"withStreaming",_visit:function(t){return Wyt._visit(this,t)}}),withoutStreaming:e=>({value:e,type:"withoutStreaming",_visit:function(t){return Wyt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"withStreaming":return t.withStreaming(e);case"withoutStreaming":return t.withoutStreaming(e.value);default:return t._other(e)}}};var Nde={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",Options:"OPTIONS",Trace:"TRACE",_visit:(e,t)=>{switch(e){case Nde.Get:return t.get();case Nde.Post:return t.post();case Nde.Put:return t.put();case Nde.Patch:return t.patch();case Nde.Delete:return t.delete();case Nde.Head:return t.head();case Nde.Options:return t.options();case Nde.Trace:return t.trace();default:return t._other()}}};var lRr={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return lRr._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return lRr._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return lRr._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return lRr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"octetStream":return t.octetStream(e);case"multipart":return t.multipart(e);case"json":return t.json(e);case"formUrlEncoded":return t.formUrlEncoded(e);default:return t._other(e)}}};var Hqf={Json:"json",Form:"form",_visit:(e,t)=>{switch(e){case Hqf.Json:return t.json();case Hqf.Form:return t.form();default:return t._other()}}};var nWr={file:e=>({...e,type:"file",_visit:function(t){return nWr._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return nWr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e.value);default:return t._other(e)}}};var Fbe={file:e=>({...e,type:"file",_visit:function(t){return Fbe._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return Fbe._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return Fbe._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return Fbe._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return Fbe._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return Fbe._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return Fbe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e);case"text":return t.text(e);case"bytes":return t.bytes(e);case"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var i1={primitive:e=>({...e,type:"primitive",_visit:function(t){return i1._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return i1._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return i1._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return i1._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return i1._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return i1._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return i1._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return i1._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return i1._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return i1._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return i1._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e);case"object":return t.object(e);case"array":return t.array(e);case"map":return t.map(e);case"optional":return t.optional(e);case"enum":return t.enum(e);case"reference":return t.reference(e);case"literal":return t.literal(e);case"oneOf":return t.oneOf(e.value);case"nullable":return t.nullable(e);case"unknown":return t.unknown(e);default:return t._other(e)}}};var Lq={int:e=>({...e,type:"int",_visit:function(t){return Lq._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return Lq._visit(this,t)}}),uint:()=>({type:"uint",_visit:function(e){return Lq._visit(this,e)}}),uint64:()=>({type:"uint64",_visit:function(e){return Lq._visit(this,e)}}),float:()=>({type:"float",_visit:function(e){return Lq._visit(this,e)}}),double:e=>({...e,type:"double",_visit:function(t){return Lq._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Lq._visit(this,t)}}),datetime:()=>({type:"datetime",_visit:function(e){return Lq._visit(this,e)}}),date:()=>({type:"date",_visit:function(e){return Lq._visit(this,e)}}),base64:()=>({type:"base64",_visit:function(e){return Lq._visit(this,e)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Lq._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e);case"int64":return t.int64(e);case"uint":return t.uint();case"uint64":return t.uint64();case"float":return t.float();case"double":return t.double(e);case"string":return t.string(e);case"datetime":return t.datetime();case"date":return t.date();case"base64":return t.base64();case"boolean":return t.boolean(e);default:return t._other(e)}}};var eW={boolean:e=>({value:e,type:"boolean",_visit:function(t){return eW._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return eW._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var iWr={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return iWr._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return iWr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undiscriminated":return t.undiscriminated(e);default:return t._other(e)}}};var uIe={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return uIe._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return uIe._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return uIe._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return uIe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"octetStream":return t.octetStream(e);case"multipart":return t.multipart(e);case"json":return t.json(e);case"formUrlEncoded":return t.formUrlEncoded(e);default:return t._other(e)}}};var cL={file:e=>({...e,type:"file",_visit:function(t){return cL._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return cL._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return cL._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return cL._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return cL._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return cL._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return cL._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e);case"text":return t.text(e);case"bytes":return t.bytes(e);case"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var Sh={primitive:e=>({...e,type:"primitive",_visit:function(t){return Sh._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Sh._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return Sh._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Sh._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Sh._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Sh._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return Sh._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Sh._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return Sh._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Sh._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return Sh._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e);case"object":return t.object(e);case"array":return t.array(e);case"map":return t.map(e);case"optional":return t.optional(e);case"enum":return t.enum(e);case"reference":return t.reference(e);case"literal":return t.literal(e);case"oneOf":return t.oneOf(e.value);case"nullable":return t.nullable(e);case"unknown":return t.unknown(e);default:return t._other(e)}}};var Sit={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return Sit._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return Sit._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undiscriminated":return t.undiscriminated(e);default:return t._other(e)}}};var G0={int:e=>({...e,type:"int",_visit:function(t){return G0._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return G0._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return G0._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return G0._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return G0._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return G0._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return G0._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return G0._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return G0._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return G0._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return G0._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e);case"int64":return t.int64(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"string":return t.string(e);case"datetime":return t.datetime(e);case"date":return t.date(e);case"base64":return t.base64(e);case"boolean":return t.boolean(e);default:return t._other(e)}}};var Fj={};pf(Fj,{AllOfPropertyConflict:()=>Uio,ArraySchema:()=>s3s,ArraySchemaWithExample:()=>z3s,Availability:()=>txs,Base64WithExample:()=>q3s,BasicSecurityScheme:()=>nxs,BearerSecurityScheme:()=>ixs,BooleanSchema:()=>r3s,BooleanWithExample:()=>R3s,BytesResponse:()=>Bio,CasingOverrides:()=>uxs,CommonProperty:()=>y3s,CommonPropertyWithExample:()=>K3s,CursorPagination:()=>zxs,CustomCodeSample:()=>Fxs,CustomCodeSampleLanguage:()=>qxs,CustomCodeSampleSdk:()=>Nxs,CustomPagination:()=>Lxs,DateWithExample:()=>T3s,DatetimeWithExample:()=>B3s,DiscriminatedOneOfSchema:()=>_3s,DiscriminatedOneOfSchemaWithExample:()=>G3s,DoubleSchema:()=>e3s,DoubleWithExample:()=>I3s,Encoding:()=>exs,Endpoint:()=>Uxs,EndpointExample:()=>Nio,EndpointResponseExample:()=>Txs,EndpointSdkName:()=>uWr,EndpointSecurity:()=>wio,EndpointWithExample:()=>_$y,EnumSchema:()=>Oio,EnumSchemaWithExample:()=>F3s,EnumValue:()=>W8i,ErrorExample:()=>Dxs,FernExample:()=>Ixs,FileResponse:()=>Iio,FileSchema:()=>mxs,FloatWithExample:()=>C3s,FormUrlEncodedRequest:()=>jxs,FullEndpointExample:()=>xxs,FullExample:()=>HQ,FullObjectExample:()=>hxs,FullOneOfExample:()=>vxs,GlobalHeader:()=>i3s,Header:()=>G8i,HeaderExample:()=>Rio,HeaderSecurityScheme:()=>axs,HeaderWithExample:()=>$8i,HttpEndpointServer:()=>Tio,HttpError:()=>Cxs,HttpErrorWithExample:()=>w3s,HttpMethod:()=>jio,IdempotencyHeader:()=>a3s,Int64WithExample:()=>E3s,IntSchema:()=>Zxs,IntWithExample:()=>j3s,JsonRequest:()=>wxs,JsonRequestWithExample:()=>m3s,JsonResponse:()=>Mio,JsonResponseWithExample:()=>Hio,KeyValuePair:()=>yxs,LiteralExample:()=>pxs,LiteralSchema:()=>Lio,LiteralSchemaValue:()=>o3s,LongSchema:()=>kxs,MapSchema:()=>c3s,MapSchemaWithExample:()=>Q3s,MultipartRequest:()=>Cio,MultipartRequestProperty:()=>Pxs,MultipartRequestPropertyEncoding:()=>Axs,MultipartSchema:()=>Oxs,NamedFullExample:()=>Gyt,Namespace:()=>sxs,NamespaceId:()=>dxs,NullExample:()=>_xs,NullableSchema:()=>f3s,NullableSchemaWithExample:()=>U3s,OauthSecurityScheme:()=>lxs,ObjectProperty:()=>p3s,ObjectPropertyConflictInfo:()=>Vio,ObjectPropertyWithExample:()=>H3s,ObjectSchema:()=>u3s,ObjectSchemaWithExample:()=>V3s,OctetStreamRequest:()=>Dio,OffsetPagination:()=>Qxs,OneOfSchema:()=>d3s,OneOfSchemaWithExample:()=>W3s,OpenApiIntermediateRepresentation:()=>d$y,OpenApiSource:()=>YFs,OptionalSchema:()=>l3s,OptionalSchemaWithExample:()=>L3s,Pagination:()=>Fio,ParseFormUrlEncodedRequest:()=>O3s,ParseMultipartRequest:()=>g3s,ParseOctetStreamRequest:()=>b3s,PathParameter:()=>Eio,PathParameterExample:()=>Mxs,PathParameterWithExample:()=>v3s,PrimitiveExample:()=>Pio,PrimitiveSchema:()=>K8i,PrimitiveSchemaValue:()=>n3s,PrimitiveSchemaValueWithExample:()=>N3s,PrimitiveSchemaWithExample:()=>Gio,PropertyKey:()=>Aio,ProtobufEncoding:()=>kFs,ProtobufSource:()=>XFs,QueryParameter:()=>Sio,QueryParameterExample:()=>qio,QueryParameterWithExample:()=>Wio,QuerySecurityScheme:()=>oxs,ReferencedSchema:()=>sWr,Request:()=>Exs,RequestWithExample:()=>A3s,Response:()=>Sxs,ResponseWithExample:()=>P3s,RetriesConfiguration:()=>xio,Schema:()=>WI,SchemaId:()=>sIe,SchemaWithExample:()=>e6,Schemas:()=>Xxs,SdkGroup:()=>cxs,SdkGroupInfo:()=>bxs,SdkGroupName:()=>H8i,SecurityScheme:()=>fxs,SecuritySchemeId:()=>mio,Server:()=>tko,Source:()=>ZFs,StatusCode:()=>aWr,StreamingResponseExample:()=>Bxs,StringSchema:()=>t3s,StringSchemaWithExample:()=>M3s,SupportedSdkLanguage:()=>Rxs,Tag:()=>rxs,TagId:()=>cIe,Tags:()=>gxs,TextResponse:()=>J8i,Uint64WithExample:()=>D3s,UintWithExample:()=>S3s,UnDiscriminatedOneOfSchema:()=>h3s,UnDiscriminatedOneOfSchemaWithExample:()=>J3s,UnknownSchemaWithExample:()=>x3s,Webhook:()=>Vxs,WebhookExampleCall:()=>Qio,WebhookHttpMethod:()=>zio,WebhookWithExample:()=>h$y,WebsocketChannel:()=>Yxs,WebsocketHandshake:()=>Wxs,WebsocketHandshakeWithExample:()=>p$y,WebsocketMessageExample:()=>Kxs,WebsocketMessageOrigin:()=>Hxs,WebsocketMessageSchema:()=>Gxs,WebsocketServer:()=>Jxs,WebsocketSessionExample:()=>$xs,WithAvailability:()=>WP,WithDescription:()=>_v,WithEncoding:()=>j3e,WithInline:()=>k4,WithName:()=>vD,WithNamespace:()=>DS,WithSdkGroupName:()=>VM,WithSdkMethodName:()=>oWr,WithSource:()=>sP,WithStatusCode:()=>Hyt,WithTitle:()=>UM,commons:()=>Yqf,example:()=>Xqf,finalIr:()=>Zqf,parseIr:()=>kqf});var Yqf={};pf(Yqf,{BasicSecurityScheme:()=>nxs,BearerSecurityScheme:()=>ixs,Encoding:()=>exs,HeaderSecurityScheme:()=>axs,Namespace:()=>sxs,NamespaceId:()=>dxs,OauthSecurityScheme:()=>lxs,OpenApiSource:()=>YFs,ProtobufEncoding:()=>kFs,ProtobufSource:()=>XFs,QuerySecurityScheme:()=>oxs,SchemaId:()=>sIe,SdkGroup:()=>cxs,SdkGroupName:()=>H8i,SecurityScheme:()=>fxs,SecuritySchemeId:()=>mio,Server:()=>tko,Source:()=>ZFs,StatusCode:()=>aWr,Tag:()=>rxs,TagId:()=>cIe,WithAvailability:()=>WP,WithDescription:()=>_v,WithEncoding:()=>j3e,WithInline:()=>k4,WithName:()=>vD,WithNamespace:()=>DS,WithSdkGroupName:()=>VM,WithSdkMethodName:()=>oWr,WithSource:()=>sP,WithStatusCode:()=>Hyt,WithTitle:()=>UM});var Wr={};pf(Wr,{JsonError:()=>vio,ParseError:()=>bio,any:()=>kKy,bigint:()=>QKy,boolean:()=>e$y,booleanLiteral:()=>ZKy,date:()=>LKy,discriminant:()=>c$y,enum_:()=>JFs,getObjectLikeUtils:()=>fRr,getObjectUtils:()=>oda,getSchemaUtils:()=>WQ,isProperty:()=>V8i,lazy:()=>UKy,lazyObject:()=>$Ky,list:()=>$Fs,number:()=>t$y,object:()=>KFs,objectWithoutOptionalProperties:()=>KKy,optional:()=>Gqf,property:()=>WKy,record:()=>a$y,set:()=>o$y,string:()=>r$y,stringLiteral:()=>XKy,transform:()=>Jqf,undiscriminatedUnion:()=>s$y,union:()=>f$y,unknown:()=>n$y,withParsedProperties:()=>$qf});var Uq={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function i8(e,t){return`Expected ${t}. Received ${aHC(e)}.`}function aHC(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function Fde(e){return{...e,json:zKy(e.json),parse:zKy(e.parse)}}function zKy(e){return(t,r)=>{let n=e(t,r),{skipValidation:i=!1}=r??{};return!n.ok&&i?(console.warn(["Failed to validate.",...n.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
2406
2406
|
`)),{ok:!0,value:t}):n}}function GFs(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var vio=class e extends Error{errors;constructor(t){super(t.map(GFs).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var bio=class e extends Error{errors;constructor(t){super(t.map(GFs).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function WQ(e){return{optional:()=>Gqf(e),transform:t=>Jqf(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new bio(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new vio(n.errors)}}}function Gqf(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Uq.OPTIONAL};return{...t,...WQ(t)}}function Jqf(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(n,i)=>{let a=t.untransform(n);return e.json(a,i)},getType:()=>e.getType()};return{...r,...WQ(r)}}function QKy(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:i8(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:i8(t,"bigint")}]},getType:()=>Uq.BIGINT};return{...Fde(e),...WQ(e)}}var oHC=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function LKy(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:i8(t,"string")}]}:oHC.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:i8(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:i8(t,"Date object")}]},getType:()=>Uq.DATE};return{...Fde(e),...WQ(e)}}function iwe(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...Fde(r),...WQ(r)}}}function JFs(e){let t=new Set(e);return iwe(Uq.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:a,message:i8(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:a,message:i8(n,"enum")}]}:{ok:!0,value:n})()}function UKy(e){let t=Kqf(e);return{...t,...WQ(t)}}function Kqf(e){return{parse:(t,r)=>gio(e).parse(t,r),json:(t,r)=>gio(e).json(t,r),getType:()=>gio(e).getType()}}function gio(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function ZZo(e){return Object.entries(e)}function kZo(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,a])=>(r.has(i)&&(n[i]=a),n),{})}function U8i(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function eko(e){return Object.keys(e)}function VKy(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function fRr(e){return{withParsedProperties:t=>$qf(e,t)}}function $qf(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);if(!a.ok)return a;let o=Object.entries(t).reduce((c,[d,s])=>({...c,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...o}}},json:(n,i)=>{if(!U8i(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:i8(n,"object")}]};let a=new Set(Object.keys(t)),o=kZo(n,Object.keys(n).filter(c=>!a.has(c)));return e.json(o,i)},getType:()=>e.getType()};return{...r,...WQ(r),...fRr(r)}}function WKy(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function V8i(e){return e.isProperty}function KFs(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>V8i(n)?n.rawKey:r),_getParsedProperties:()=>eko(e),parse:(r,n)=>{let i={},a=[];for(let[o,c]of ZZo(e)){let d=V8i(c)?c.rawKey:o,s=V8i(c)?c.valueSchema:c,u={rawKey:d,parsedKey:o,valueSchema:s};i[d]=u,JKy(s)&&a.push(d)}return HKy({value:r,requiredKeys:a,getProperty:o=>{let c=i[o];if(c!=null)return{transformedKey:c.parsedKey,transform:d=>c.valueSchema.parse(d,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],o]})}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:(r,n)=>{let i=[];for(let[a,o]of ZZo(e)){let c=V8i(o)?o.valueSchema:o;JKy(c)&&i.push(a)}return HKy({value:r,requiredKeys:i,getProperty:a=>{let o=e[a];if(o!=null)return V8i(o)?{transformedKey:o.rawKey,transform:c=>o.valueSchema.json(c,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:c=>o.json(c,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:()=>Uq.OBJECT};return{...Fde(t),...WQ(t),...fRr(t),...oda(t)}}function HKy({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:a=[]}){if(!U8i(e))return{ok:!1,errors:[{path:a,message:i8(e,"object")}]};let o=new Set(t),c=[],d={};for(let[s,u]of Object.entries(e)){let l=r(s);if(l!=null){o.delete(s);let m=l.transform(u);m.ok?d[l.transformedKey]=m.value:(d[s]=u,c.push(...m.errors))}else switch(n){case"fail":c.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=u;break}}return c.push(...t.filter(s=>o.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),c.length===0||i?{ok:!0,value:d}:{ok:!1,errors:c}}function oda(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>GKy({extensionKeys:t._getRawProperties(),value:n,transformBase:a=>e.parse(a,i),transformExtension:a=>t.parse(a,i)}),json:(n,i)=>GKy({extensionKeys:t._getParsedProperties(),value:n,transformBase:a=>e.json(a,i),transformExtension:a=>t.json(a,i)}),getType:()=>Uq.OBJECT};return{...r,...WQ(r),...fRr(r),...oda(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,n)=>{let i=e.parse(r,{...n,unrecognizedObjectKeys:"passthrough"});return i.ok?{ok:!0,value:{...r,...i.value}}:i},json:(r,n)=>{let i=e.json(r,{...n,unrecognizedObjectKeys:"passthrough"});return i.ok?{ok:!0,value:{...r,...i.value}}:i},getType:()=>Uq.OBJECT};return{...t,...WQ(t),...fRr(t),...oda(t)}}}}function GKy({extensionKeys:e,value:t,transformBase:r,transformExtension:n}){let i=new Set(e),[a,o]=VKy(eko(t),s=>i.has(s)),c=r(kZo(t,o)),d=n(kZo(t,a));return c.ok&&d.ok?{ok:!0,value:{...c.value,...d.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...d.ok?[]:d.errors]}}function JKy(e){return!uHC(e)}function uHC(e){switch(e.getType()){case Uq.ANY:case Uq.UNKNOWN:case Uq.OPTIONAL:return!0;default:return!1}}function KKy(e){return KFs(e)}function $Ky(e){let t={...Kqf(e),_getRawProperties:()=>gio(e)._getRawProperties(),_getParsedProperties:()=>gio(e)._getParsedProperties()};return{...t,...WQ(t),...fRr(t),...oda(t)}}function $Fs(e){let t={parse:(r,n)=>YKy(r,(i,a)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,n)=>YKy(r,(i,a)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Uq.LIST};return{...Fde(t),...WQ(t)}}function YKy(e,t){return Array.isArray(e)?e.map((n,i)=>t(n,i)).reduce((n,i)=>{if(n.ok&&i.ok)return{ok:!0,value:[...n.value,i.value]};let a=[];return n.ok||a.push(...n.errors),i.ok||a.push(...i.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:i8(e,"list"),path:[]}]}}function XKy(e){return iwe(Uq.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:i8(r,`"${e}"`)}]})()}function ZKy(e){return iwe(Uq.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:i8(r,`${e.toString()}`)}]})()}var kKy=iwe(Uq.ANY,e=>({ok:!0,value:e}));var e$y=iwe(Uq.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:i8(e,"boolean")}]});var t$y=iwe(Uq.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:i8(e,"number")}]});var r$y=iwe(Uq.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:i8(e,"string")}]});var n$y=iwe(Uq.UNKNOWN,e=>({ok:!0,value:e}));function a$y(e,t){let r={parse:(n,i)=>i$y({value:n,isKeyNumeric:e.getType()===Uq.NUMBER,transformKey:a=>e.parse(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,o)=>t.parse(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>i$y({value:n,isKeyNumeric:e.getType()===Uq.NUMBER,transformKey:a=>e.json(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,o)=>t.json(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Uq.RECORD};return{...Fde(r),...WQ(r)}}function i$y({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return U8i(e)?ZZo(e).reduce((a,[o,c])=>{if(c==null)return a;let d=a,s=o;if(t){let A=o.length>0?Number(o):NaN;isNaN(A)||(s=A)}let u=r(s),l=n(c,s);if(d.ok&&u.ok&&l.ok)return{ok:!0,value:{...d.value,[u.value]:l.value}};let m=[];return d.ok||m.push(...d.errors),u.ok||m.push(...u.errors),l.ok||m.push(...l.errors),{ok:!1,errors:m}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:i8(e,"object")}]}}function o$y(e){let t=$Fs(e),r={parse:(n,i)=>{let a=t.parse(n,i);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:i8(n,"Set")}]},getType:()=>Uq.SET};return{...Fde(r),...WQ(r)}}function s$y(e){let t={parse:(r,n)=>u$y((i,a)=>i.parse(r,a),e,n),json:(r,n)=>u$y((i,a)=>i.json(r,a),e,n),getType:()=>Uq.UNDISCRIMINATED_UNION};return{...Fde(t),...WQ(t)}}function u$y(e,t,r){let n=[];for(let[i,a]of t.entries()){let o=e(a,{...r,skipValidation:!1});if(o.ok)return o;for(let c of o.errors)n.push({path:c.path,message:`[Variant ${i}] ${c.message}`})}return{ok:!1,errors:n}}function c$y(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function f$y(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=JFs(eko(t)),a={parse:(o,c)=>l$y({value:o,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:d=>i.parse(d,{allowUnrecognizedEnumValues:c?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...c?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:c?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,c),breadcrumbsPrefix:c?.breadcrumbsPrefix}),json:(o,c)=>l$y({value:o,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:d=>i.json(d,{allowUnrecognizedEnumValues:c?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...c?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:c?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,c),breadcrumbsPrefix:c?.breadcrumbsPrefix}),getType:()=>Uq.UNION};return{...Fde(a),...WQ(a),...fRr(a)}}function l$y({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:o,breadcrumbsPrefix:c=[]}){if(!U8i(e))return{ok:!1,errors:[{path:c,message:i8(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:c,message:`Missing discriminant ("${t}")`}]};let u=n(d);if(!u.ok)return{ok:!1,errors:u.errors};let l=i(u.value);if(l==null)return a?{ok:!0,value:{[r]:u.value,...s}}:{ok:!1,errors:[{path:[...c,t],message:"Unexpected discriminant value"}]};let m=o(s,l);return m.ok?{ok:!0,value:{[r]:d,...m.value}}:m}var UM=Wr.objectWithoutOptionalProperties({title:Wr.string().optional()});var YFs=Wr.objectWithoutOptionalProperties({file:Wr.string()});var XFs=Wr.objectWithoutOptionalProperties({file:Wr.string()});var ZFs=Wr.union("type",{openapi:YFs,protobuf:XFs}).transform({transform:e=>{switch(e.type){case"openapi":return nwe.openapi(e);case"protobuf":return nwe.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var sP=Wr.objectWithoutOptionalProperties({source:ZFs.optional()});var kFs=Wr.objectWithoutOptionalProperties({typeName:Wr.string()});var exs=Wr.union("type",{protobuf:kFs}).transform({transform:e=>{switch(e.type){case"protobuf":return yio.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var j3e=Wr.objectWithoutOptionalProperties({encoding:exs.optional()});var _v=Wr.objectWithoutOptionalProperties({description:Wr.string().optional()});var txs=Wr.enum_(["GenerallyAvailable","Beta","Deprecated"]);var WP=Wr.objectWithoutOptionalProperties({availability:txs.optional()});var aWr=Wr.number();var Hyt=Wr.objectWithoutOptionalProperties({statusCode:aWr.optional()});var vD=Wr.objectWithoutOptionalProperties({nameOverride:Wr.string().optional(),generatedName:Wr.string()});var k4=Wr.objectWithoutOptionalProperties({inline:Wr.boolean().optional()});var sIe=Wr.string();var cIe=Wr.string();var rxs=Wr.objectWithoutOptionalProperties({id:cIe}).extend(_v);var mio=Wr.string();var nxs=Wr.objectWithoutOptionalProperties({usernameVariableName:Wr.string().optional(),usernameEnvVar:Wr.string().optional(),passwordVariableName:Wr.string().optional(),passwordEnvVar:Wr.string().optional()});var ixs=Wr.objectWithoutOptionalProperties({tokenVariableName:Wr.string().optional(),tokenEnvVar:Wr.string().optional()});var axs=Wr.objectWithoutOptionalProperties({headerName:Wr.string(),prefix:Wr.string().optional(),headerVariableName:Wr.string().optional(),headerEnvVar:Wr.string().optional()});var oxs=Wr.objectWithoutOptionalProperties({queryParameterName:Wr.string()});var uxs=Wr.objectWithoutOptionalProperties({snake:Wr.string().optional(),camel:Wr.string().optional(),screamingSnake:Wr.string().optional(),pascal:Wr.string().optional()});var W8i=Wr.objectWithoutOptionalProperties({nameOverride:Wr.string().optional(),generatedName:Wr.string(),value:Wr.string(),casing:uxs.optional()}).extend(_v).extend(WP);var sxs=Wr.objectWithoutOptionalProperties({type:Wr.stringLiteral("namespace"),name:Wr.string()});var cxs=Wr.undiscriminatedUnion([Wr.string(),sxs]);var H8i=Wr.list(cxs);var VM=Wr.objectWithoutOptionalProperties({groupName:H8i.optional()});var DS=Wr.objectWithoutOptionalProperties({namespace:Wr.string().optional()});var Oio=Wr.objectWithoutOptionalProperties({default:W8i.optional(),values:Wr.list(W8i)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(sP).extend(UM).extend(k4);var lxs=Wr.objectWithoutOptionalProperties({scopesEnum:Oio.optional()});var fxs=Wr.union("type",{basic:nxs,bearer:ixs,header:axs,query:oxs,oauth:lxs}).transform({transform:e=>{switch(e.type){case"basic":return Tde.basic(e);case"bearer":return Tde.bearer(e);case"header":return Tde.header(e);case"query":return Tde.query(e);case"oauth":return Tde.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var tko=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),url:Wr.string(),audiences:Wr.list(Wr.string()).optional()}).extend(_v);var dxs=Wr.string();var oWr=Wr.objectWithoutOptionalProperties({sdkMethodName:Wr.string().optional()});var Xqf={};pf(Xqf,{FullExample:()=>HQ,FullObjectExample:()=>hxs,FullOneOfExample:()=>vxs,KeyValuePair:()=>yxs,LiteralExample:()=>pxs,NullExample:()=>_xs,PrimitiveExample:()=>Pio,PropertyKey:()=>Aio});var Aio=Wr.string();var Pio=Wr.union("type",{int:Wr.object({value:Wr.number()}),int64:Wr.object({value:Wr.number()}),uint:Wr.object({value:Wr.number()}),uint64:Wr.object({value:Wr.number()}),float:Wr.object({value:Wr.number()}),double:Wr.object({value:Wr.number()}),string:Wr.object({value:Wr.string()}),datetime:Wr.object({value:Wr.string()}),date:Wr.object({value:Wr.string()}),base64:Wr.object({value:Wr.string()}),boolean:Wr.object({value:Wr.boolean()})}).transform({transform:e=>{switch(e.type){case"int":return CO.int(e.value);case"int64":return CO.int64(e.value);case"uint":return CO.uint(e.value);case"uint64":return CO.uint64(e.value);case"float":return CO.float(e.value);case"double":return CO.double(e.value);case"string":return CO.string(e.value);case"datetime":return CO.datetime(e.value);case"date":return CO.date(e.value);case"base64":return CO.base64(e.value);case"boolean":return CO.boolean(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var pxs=Wr.union("type",{boolean:Wr.object({value:Wr.boolean()}),string:Wr.object({value:Wr.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return Q8i.boolean(e.value);case"string":return Q8i.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var _xs=Wr.objectWithoutOptionalProperties({});var HQ=Wr.union("type",{primitive:Wr.object({value:Pio}),object:Wr.lazyObject(()=>hxs),array:Wr.object({value:Wr.list(Wr.lazy(()=>HQ))}),map:Wr.object({value:Wr.list(Wr.lazyObject(()=>yxs))}),enum:Wr.object({value:Wr.string()}),literal:Wr.object({value:pxs}),oneOf:Wr.object({value:Wr.lazy(()=>vxs)}),null:_xs,unknown:Wr.object({value:Wr.lazy(()=>HQ)})}).transform({transform:e=>{switch(e.type){case"primitive":return SS.primitive(e.value);case"object":return SS.object(e);case"array":return SS.array(e.value);case"map":return SS.map(e.value);case"enum":return SS.enum(e.value);case"literal":return SS.literal(e.value);case"oneOf":return SS.oneOf(e.value);case"null":return SS.null(e);case"unknown":return SS.unknown(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var hxs=Wr.objectWithoutOptionalProperties({properties:Wr.record(Aio,Wr.lazy(()=>HQ))});var yxs=Wr.objectWithoutOptionalProperties({key:Pio,value:Wr.lazy(()=>HQ)});var vxs=Wr.union("type",{discriminated:Wr.object({value:Wr.record(Aio,Wr.lazy(()=>HQ))}),undiscriminated:Wr.object({value:Wr.lazy(()=>HQ)})}).transform({transform:e=>{switch(e.type){case"discriminated":return L8i.discriminated(e.value);case"undiscriminated":return L8i.undiscriminated(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Zqf={};pf(Zqf,{AllOfPropertyConflict:()=>Uio,ArraySchema:()=>s3s,Availability:()=>txs,BooleanSchema:()=>r3s,BytesResponse:()=>Bio,CasingOverrides:()=>uxs,CommonProperty:()=>y3s,CursorPagination:()=>zxs,CustomCodeSample:()=>Fxs,CustomCodeSampleLanguage:()=>qxs,CustomCodeSampleSdk:()=>Nxs,CustomPagination:()=>Lxs,DiscriminatedOneOfSchema:()=>_3s,DoubleSchema:()=>e3s,Endpoint:()=>Uxs,EndpointExample:()=>Nio,EndpointResponseExample:()=>Txs,EndpointSdkName:()=>uWr,EndpointSecurity:()=>wio,EnumSchema:()=>Oio,EnumValue:()=>W8i,ErrorExample:()=>Dxs,FernExample:()=>Ixs,FileResponse:()=>Iio,FileSchema:()=>mxs,FormUrlEncodedRequest:()=>jxs,FullEndpointExample:()=>xxs,GlobalHeader:()=>i3s,Header:()=>G8i,HeaderExample:()=>Rio,HttpEndpointServer:()=>Tio,HttpError:()=>Cxs,HttpMethod:()=>jio,IdempotencyHeader:()=>a3s,IntSchema:()=>Zxs,JsonRequest:()=>wxs,JsonResponse:()=>Mio,LiteralSchema:()=>Lio,LiteralSchemaValue:()=>o3s,LongSchema:()=>kxs,MapSchema:()=>c3s,MultipartRequest:()=>Cio,MultipartRequestProperty:()=>Pxs,MultipartRequestPropertyEncoding:()=>Axs,MultipartSchema:()=>Oxs,NullableSchema:()=>f3s,ObjectProperty:()=>p3s,ObjectPropertyConflictInfo:()=>Vio,ObjectSchema:()=>u3s,OctetStreamRequest:()=>Dio,OffsetPagination:()=>Qxs,OneOfSchema:()=>d3s,OpenApiIntermediateRepresentation:()=>d$y,OptionalSchema:()=>l3s,Pagination:()=>Fio,PathParameter:()=>Eio,PathParameterExample:()=>Mxs,PrimitiveSchema:()=>K8i,PrimitiveSchemaValue:()=>n3s,QueryParameter:()=>Sio,QueryParameterExample:()=>qio,ReferencedSchema:()=>sWr,Request:()=>Exs,Response:()=>Sxs,RetriesConfiguration:()=>xio,Schema:()=>WI,Schemas:()=>Xxs,SdkGroupInfo:()=>bxs,StreamingResponseExample:()=>Bxs,StringSchema:()=>t3s,SupportedSdkLanguage:()=>Rxs,Tags:()=>gxs,TextResponse:()=>J8i,UnDiscriminatedOneOfSchema:()=>h3s,Webhook:()=>Vxs,WebhookExampleCall:()=>Qio,WebhookHttpMethod:()=>zio,WebsocketChannel:()=>Yxs,WebsocketHandshake:()=>Wxs,WebsocketMessageExample:()=>Kxs,WebsocketMessageOrigin:()=>Hxs,WebsocketMessageSchema:()=>Gxs,WebsocketServer:()=>Jxs,WebsocketSessionExample:()=>$xs});var bxs=Wr.objectWithoutOptionalProperties({summary:Wr.string().optional(),description:Wr.string().optional()});var gxs=Wr.objectWithoutOptionalProperties({tagsById:Wr.record(cIe,rxs),orderedTagIds:Wr.list(cIe).optional()});var wio=Wr.list(Wr.record(mio,Wr.list(Wr.string())));var jio=Wr.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","TRACE"]);var Eio=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>WI),variableReference:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(_v).extend(WP).extend(sP);var Sio=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>WI),parameterNameOverride:Wr.string().optional()}).extend(_v).extend(WP).extend(sP);var G8i=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>WI),env:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(_v).extend(WP).extend(sP);var uWr=Wr.objectWithoutOptionalProperties({groupName:H8i,methodName:Wr.string()});var Dio=Wr.objectWithoutOptionalProperties({contentType:Wr.string().optional()}).extend(_v).extend(sP);var mxs=Wr.objectWithoutOptionalProperties({isOptional:Wr.boolean(),isArray:Wr.boolean()}).extend(_v);var Oxs=Wr.union("type",{file:mxs,json:Wr.object({value:Wr.lazy(()=>WI)})}).transform({transform:e=>{switch(e.type){case"file":return nWr.file(e);case"json":return nWr.json(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Axs=Wr.enum_(["json","form"]);var Pxs=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Oxs,contentType:Wr.string().optional(),exploded:Wr.boolean().optional(),encoding:Axs.optional()}).extend(_v);var Cio=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),properties:Wr.list(Pxs)}).extend(_v).extend(sP);var wxs=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>WI),contentType:Wr.string().optional(),additionalProperties:Wr.boolean()}).extend(_v).extend(sP);var jxs=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>WI),contentType:Wr.string().optional(),additionalProperties:Wr.boolean()}).extend(_v).extend(sP);var Exs=Wr.union("type",{octetStream:Dio,multipart:Cio,json:wxs,formUrlEncoded:jxs}).transform({transform:e=>{switch(e.type){case"octetStream":return lRr.octetStream(e);case"multipart":return lRr.multipart(e);case"json":return lRr.json(e);case"formUrlEncoded":return lRr.formUrlEncoded(e);default:return e}},untransform:({_visit:e,...t})=>t});var Iio=Wr.objectWithoutOptionalProperties({}).extend(_v).extend(sP).extend(Hyt);var Mio=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>WI),responseProperty:Wr.string().optional()}).extend(_v).extend(sP).extend(Hyt);var J8i=Wr.objectWithoutOptionalProperties({}).extend(_v).extend(sP).extend(Hyt);var Bio=Wr.objectWithoutOptionalProperties({}).extend(_v).extend(sP).extend(Hyt);var Sxs=Wr.union("type",{file:Iio,json:Mio,text:J8i,bytes:Bio,streamingSse:Mio,streamingText:J8i,streamingJson:Mio}).transform({transform:e=>{switch(e.type){case"file":return Fbe.file(e);case"json":return Fbe.json(e);case"text":return Fbe.text(e);case"bytes":return Fbe.bytes(e);case"streamingSse":return Fbe.streamingSse(e);case"streamingText":return Fbe.streamingText(e);case"streamingJson":return Fbe.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var Dxs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),description:Wr.string().optional(),example:Wr.lazy(()=>HQ)});var Cxs=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>WI).optional(),examples:Wr.list(Dxs).optional()}).extend(_v).extend(vD).extend(sP);var Tio=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),url:Wr.string().optional(),audiences:Wr.list(Wr.string()).optional()});var Ixs=Wr.unknown();var Mxs=Wr.objectWithoutOptionalProperties({name:Wr.string(),parameterNameOverride:Wr.string().optional(),value:Wr.lazy(()=>HQ)});var qio=Wr.objectWithoutOptionalProperties({name:Wr.string(),value:Wr.lazy(()=>HQ)});var Rio=Wr.objectWithoutOptionalProperties({name:Wr.string(),value:Wr.lazy(()=>HQ)});var Bxs=Wr.objectWithoutOptionalProperties({sse:Wr.boolean(),events:Wr.list(Wr.lazy(()=>HQ))});var Txs=Wr.union("type",{withStreaming:Bxs,withoutStreaming:Wr.object({value:Wr.lazy(()=>HQ)})}).transform({transform:e=>{switch(e.type){case"withStreaming":return Wyt.withStreaming(e);case"withoutStreaming":return Wyt.withoutStreaming(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var qxs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),language:Wr.string(),code:Wr.string(),install:Wr.string().optional()}).extend(_v);var Rxs=Wr.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","dotnet","jvm"]);var Nxs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),sdk:Rxs,code:Wr.string()}).extend(_v);var Fxs=Wr.union("type",{language:qxs,sdk:Nxs}).transform({transform:e=>{switch(e.type){case"language":return rWr.language(e);case"sdk":return rWr.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var xxs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),pathParameters:Wr.list(Mxs).optional(),queryParameters:Wr.list(qio).optional(),headers:Wr.list(Rio).optional(),request:Wr.lazy(()=>HQ).optional(),response:Txs.optional(),codeSamples:Wr.list(Fxs)}).extend(_v);var Nio=Wr.union("type",{unknown:Wr.object({value:Ixs}),full:xxs}).transform({transform:e=>{switch(e.type){case"unknown":return Vyt.unknown(e.value);case"full":return Vyt.full(e);default:return e}},untransform:({_visit:e,...t})=>t});var zxs=Wr.objectWithoutOptionalProperties({cursor:Wr.string(),nextCursor:Wr.property("next_cursor",Wr.string()),results:Wr.string()});var Qxs=Wr.objectWithoutOptionalProperties({offset:Wr.string(),results:Wr.string(),step:Wr.string().optional(),hasNextPage:Wr.string().optional()});var Lxs=Wr.objectWithoutOptionalProperties({results:Wr.string()});var Fio=Wr.union("type",{cursor:zxs,offset:Qxs,custom:Lxs}).transform({transform:e=>{switch(e.type){case"cursor":return Eit.cursor(e);case"offset":return Eit.offset(e);case"custom":return Eit.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var xio=Wr.union("type",{disabled:Wr.object({value:Wr.boolean().optional()})}).transform({transform:e=>{switch(e.type){case"disabled":return XZo.disabled(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Uxs=Wr.objectWithoutOptionalProperties({authed:Wr.boolean(),security:wio,internal:Wr.boolean().optional(),idempotent:Wr.boolean().optional(),method:jio,audiences:Wr.list(Wr.string()),path:Wr.string(),summary:Wr.string().optional(),operationId:Wr.string().optional(),tags:Wr.list(cIe),pathParameters:Wr.list(Eio),queryParameters:Wr.list(Sio),headers:Wr.list(G8i),sdkName:uWr.optional(),generatedRequestName:Wr.string(),requestNameOverride:Wr.string().optional(),request:Exs.optional(),response:Sxs.optional(),errors:Wr.record(aWr,Cxs),servers:Wr.list(Tio),examples:Wr.list(Nio),pagination:Fio.optional(),retries:xio.optional()}).extend(_v).extend(WP).extend(sP).extend(DS);var zio=Wr.enum_(["GET","POST"]);var Qio=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),payload:Wr.lazy(()=>HQ)}).extend(_v);var Vxs=Wr.objectWithoutOptionalProperties({audiences:Wr.list(Wr.string()),sdkName:uWr.optional(),method:zio,summary:Wr.string().optional(),operationId:Wr.string(),tags:Wr.list(cIe),headers:Wr.list(G8i),generatedPayloadName:Wr.string(),payload:Wr.lazy(()=>WI),examples:Wr.list(Qio)}).extend(_v).extend(sP).extend(DS);var Wxs=Wr.objectWithoutOptionalProperties({queryParameters:Wr.list(Sio),headers:Wr.list(G8i),pathParameters:Wr.list(Eio)});var Hxs=Wr.enum_(["client","server"]);var Gxs=Wr.objectWithoutOptionalProperties({name:Wr.string(),origin:Hxs,body:Wr.lazy(()=>WI)});var Jxs=Wr.objectWithoutOptionalProperties({name:Wr.string(),url:Wr.string()});var Kxs=Wr.objectWithoutOptionalProperties({messageType:Wr.string(),payload:Wr.lazy(()=>HQ)}).extend(_v);var $xs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),queryParameters:Wr.list(qio).optional(),headers:Wr.list(Rio).optional(),messages:Wr.list(Kxs)}).extend(_v);var Yxs=Wr.objectWithoutOptionalProperties({audiences:Wr.list(Wr.string()),path:Wr.string(),groupName:H8i,summary:Wr.string().optional(),handshake:Wxs,messages:Wr.list(Gxs),servers:Wr.list(Jxs),examples:Wr.list($xs)}).extend(_v).extend(sP);var Xxs=Wr.objectWithoutOptionalProperties({rootSchemas:Wr.record(sIe,Wr.lazy(()=>WI)),namespacedSchemas:Wr.record(dxs,Wr.record(sIe,Wr.lazy(()=>WI)))});var Zxs=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),minimum:Wr.number().optional(),maximum:Wr.number().optional(),exclusiveMinimum:Wr.boolean().optional(),exclusiveMaximum:Wr.boolean().optional(),multipleOf:Wr.number().optional()});var kxs=Wr.objectWithoutOptionalProperties({default:Wr.number().optional()});var e3s=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),minimum:Wr.number().optional(),maximum:Wr.number().optional(),exclusiveMinimum:Wr.boolean().optional(),exclusiveMaximum:Wr.boolean().optional(),multipleOf:Wr.number().optional()});var t3s=Wr.objectWithoutOptionalProperties({default:Wr.string().optional(),pattern:Wr.string().optional(),format:Wr.string().optional(),minLength:Wr.number().optional(),maxLength:Wr.number().optional()});var r3s=Wr.objectWithoutOptionalProperties({default:Wr.boolean().optional()});var n3s=Wr.union("type",{int:Zxs,int64:kxs,uint:Wr.object({}),uint64:Wr.object({}),float:Wr.object({}),double:e3s,string:t3s,datetime:Wr.object({}),date:Wr.object({}),base64:Wr.object({}),boolean:r3s}).transform({transform:e=>{switch(e.type){case"int":return Lq.int(e);case"int64":return Lq.int64(e);case"uint":return Lq.uint();case"uint64":return Lq.uint64();case"float":return Lq.float();case"double":return Lq.double(e);case"string":return Lq.string(e);case"datetime":return Lq.datetime();case"date":return Lq.date();case"base64":return Lq.base64();case"boolean":return Lq.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var K8i=Wr.objectWithoutOptionalProperties({schema:n3s}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM);var i3s=Wr.objectWithoutOptionalProperties({header:Wr.string(),name:Wr.string().optional(),optional:Wr.boolean().optional(),env:Wr.string().optional(),schema:Wr.lazy(()=>WI).optional()});var a3s=Wr.objectWithoutOptionalProperties({header:Wr.string(),name:Wr.string().optional(),env:Wr.string().optional(),schema:Wr.lazy(()=>WI).optional()});var d$y=Wr.objectWithoutOptionalProperties({apiVersion:Wr.unknown().optional(),title:Wr.string().optional(),description:Wr.string().optional(),basePath:Wr.string().optional(),servers:Wr.list(tko),websocketServers:Wr.list(tko),groups:Wr.record(Wr.string(),bxs),tags:gxs,hasEndpointsMarkedInternal:Wr.boolean(),endpoints:Wr.list(Uxs),webhooks:Wr.list(Vxs),channels:Wr.record(Wr.string(),Yxs),groupedSchemas:Xxs,variables:Wr.record(Wr.string(),K8i),nonRequestReferencedSchemas:Wr.set(sIe),securitySchemes:Wr.record(mio,fxs),globalHeaders:Wr.list(i3s).optional(),idempotencyHeaders:Wr.list(a3s).optional()});var sWr=Wr.objectWithoutOptionalProperties({schema:sIe}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(sP).extend(UM);var o3s=Wr.union("type",{boolean:Wr.object({value:Wr.boolean()}),string:Wr.object({value:Wr.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return eW.boolean(e.value);case"string":return eW.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Lio=Wr.objectWithoutOptionalProperties({value:o3s}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM);var WI=Wr.union("type",{primitive:K8i,object:Wr.lazyObject(()=>u3s),array:Wr.lazyObject(()=>s3s),map:Wr.lazyObject(()=>c3s),optional:Wr.lazyObject(()=>l3s),enum:Oio,reference:sWr,literal:Lio,oneOf:Wr.object({value:Wr.lazy(()=>d3s)}),nullable:Wr.lazyObject(()=>f3s),unknown:vD}).transform({transform:e=>{switch(e.type){case"primitive":return i1.primitive(e);case"object":return i1.object(e);case"array":return i1.array(e);case"map":return i1.map(e);case"optional":return i1.optional(e);case"enum":return i1.enum(e);case"reference":return i1.reference(e);case"literal":return i1.literal(e);case"oneOf":return i1.oneOf(e.value);case"nullable":return i1.nullable(e);case"unknown":return i1.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var Uio=Wr.objectWithoutOptionalProperties({propertyKey:Wr.string(),allOfSchemaIds:Wr.list(sIe),conflictingTypeSignatures:Wr.boolean()});var u3s=Wr.objectWithoutOptionalProperties({allOf:Wr.list(sWr),properties:Wr.list(Wr.lazyObject(()=>p3s)),allOfPropertyConflicts:Wr.list(Uio),additionalProperties:Wr.boolean()}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(sP).extend(UM).extend(k4);var Vio=Wr.objectWithoutOptionalProperties({differentSchema:Wr.boolean()});var p3s=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>WI),readonly:Wr.boolean().optional(),writeonly:Wr.boolean().optional(),conflict:Wr.record(sIe,Vio),generatedName:Wr.string(),nameOverride:Wr.string().optional(),audiences:Wr.list(Wr.string())}).extend(WP);var s3s=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>WI)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM).extend(k4);var c3s=Wr.objectWithoutOptionalProperties({key:K8i,value:Wr.lazy(()=>WI)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(j3e).extend(UM).extend(k4);var l3s=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>WI)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM).extend(k4);var f3s=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>WI)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM).extend(k4);var d3s=Wr.union("type",{discriminated:Wr.lazyObject(()=>_3s),undiscriminated:Wr.lazyObject(()=>h3s)}).transform({transform:e=>{switch(e.type){case"discriminated":return iWr.discriminated(e);case"undiscriminated":return iWr.undiscriminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var _3s=Wr.objectWithoutOptionalProperties({discriminantProperty:Wr.string(),commonProperties:Wr.list(Wr.lazyObject(()=>y3s)),schemas:Wr.record(Wr.string(),Wr.lazy(()=>WI))}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(j3e).extend(sP).extend(UM).extend(k4);var y3s=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>WI)});var h3s=Wr.objectWithoutOptionalProperties({schemas:Wr.list(Wr.lazy(()=>WI))}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(j3e).extend(sP).extend(UM).extend(k4);var kqf={};pf(kqf,{ArraySchemaWithExample:()=>z3s,Base64WithExample:()=>q3s,BooleanWithExample:()=>R3s,CommonPropertyWithExample:()=>K3s,DateWithExample:()=>T3s,DatetimeWithExample:()=>B3s,DiscriminatedOneOfSchemaWithExample:()=>G3s,DoubleWithExample:()=>I3s,EndpointWithExample:()=>_$y,EnumSchemaWithExample:()=>F3s,FloatWithExample:()=>C3s,HeaderWithExample:()=>$8i,HttpErrorWithExample:()=>w3s,Int64WithExample:()=>E3s,IntWithExample:()=>j3s,JsonRequestWithExample:()=>m3s,JsonResponseWithExample:()=>Hio,MapSchemaWithExample:()=>Q3s,NamedFullExample:()=>Gyt,NullableSchemaWithExample:()=>U3s,ObjectPropertyWithExample:()=>H3s,ObjectSchemaWithExample:()=>V3s,OneOfSchemaWithExample:()=>W3s,OptionalSchemaWithExample:()=>L3s,ParseFormUrlEncodedRequest:()=>O3s,ParseMultipartRequest:()=>g3s,ParseOctetStreamRequest:()=>b3s,PathParameterWithExample:()=>v3s,PrimitiveSchemaValueWithExample:()=>N3s,PrimitiveSchemaWithExample:()=>Gio,QueryParameterWithExample:()=>Wio,RequestWithExample:()=>A3s,ResponseWithExample:()=>P3s,SchemaWithExample:()=>e6,StringSchemaWithExample:()=>M3s,Uint64WithExample:()=>D3s,UintWithExample:()=>S3s,UnDiscriminatedOneOfSchemaWithExample:()=>J3s,UnknownSchemaWithExample:()=>x3s,WebhookWithExample:()=>h$y,WebsocketHandshakeWithExample:()=>p$y});var Gyt=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),value:Wr.unknown()}).extend(_v);var Wio=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>e6),parameterNameOverride:Wr.string().optional()}).extend(_v).extend(WP).extend(sP);var $8i=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>e6),env:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(_v).extend(WP).extend(sP);var p$y=Wr.objectWithoutOptionalProperties({queryParameters:Wr.list(Wio),headers:Wr.list($8i)});var v3s=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>e6),variableReference:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(_v).extend(WP).extend(sP);var b3s=Wr.objectWithoutOptionalProperties({}).extend(Dio).extend(oWr);var g3s=Wr.objectWithoutOptionalProperties({}).extend(Cio).extend(oWr);var m3s=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>e6),contentType:Wr.string().optional(),fullExamples:Wr.list(Gyt).optional(),additionalProperties:Wr.boolean()}).extend(_v).extend(sP).extend(oWr);var O3s=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>e6),contentType:Wr.string().optional(),fullExamples:Wr.list(Gyt).optional(),additionalProperties:Wr.boolean()}).extend(_v).extend(sP).extend(oWr);var A3s=Wr.union("type",{octetStream:b3s,multipart:g3s,json:m3s,formUrlEncoded:O3s}).transform({transform:e=>{switch(e.type){case"octetStream":return uIe.octetStream(e);case"multipart":return uIe.multipart(e);case"json":return uIe.json(e);case"formUrlEncoded":return uIe.formUrlEncoded(e);default:return e}},untransform:({_visit:e,...t})=>t});var Hio=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>e6),responseProperty:Wr.string().optional(),fullExamples:Wr.list(Gyt).optional()}).extend(_v).extend(sP).extend(Hyt);var P3s=Wr.union("type",{file:Iio,json:Hio,text:J8i,bytes:Bio,streamingSse:Hio,streamingText:J8i,streamingJson:Hio}).transform({transform:e=>{switch(e.type){case"file":return cL.file(e);case"json":return cL.json(e);case"text":return cL.text(e);case"bytes":return cL.bytes(e);case"streamingSse":return cL.streamingSse(e);case"streamingText":return cL.streamingText(e);case"streamingJson":return cL.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var w3s=Wr.objectWithoutOptionalProperties({statusCode:aWr,schema:Wr.lazy(()=>e6),fullExamples:Wr.list(Gyt).optional()}).extend(_v).extend(vD).extend(sP);var _$y=Wr.objectWithoutOptionalProperties({authed:Wr.boolean(),security:wio,internal:Wr.boolean().optional(),idempotent:Wr.boolean().optional(),method:jio,audiences:Wr.list(Wr.string()),path:Wr.string(),summary:Wr.string().optional(),operationId:Wr.string().optional(),tags:Wr.list(cIe),pathParameters:Wr.list(v3s),queryParameters:Wr.list(Wio),headers:Wr.list($8i),sdkName:uWr.optional(),generatedRequestName:Wr.string(),requestNameOverride:Wr.string().optional(),request:A3s.optional(),response:P3s.optional(),errors:Wr.record(aWr,w3s),servers:Wr.list(Tio),examples:Wr.list(Nio),pagination:Fio.optional(),retries:xio.optional()}).extend(_v).extend(WP).extend(sP).extend(DS);var h$y=Wr.objectWithoutOptionalProperties({audiences:Wr.list(Wr.string()),sdkName:uWr.optional(),method:zio,summary:Wr.string().optional(),operationId:Wr.string(),tags:Wr.list(cIe),headers:Wr.list($8i),generatedPayloadName:Wr.string(),payload:Wr.lazy(()=>e6),examples:Wr.list(Qio)}).extend(_v).extend(sP).extend(DS);var j3s=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),minimum:Wr.number().optional(),maximum:Wr.number().optional(),exclusiveMinimum:Wr.boolean().optional(),exclusiveMaximum:Wr.boolean().optional(),multipleOf:Wr.number().optional(),example:Wr.number().optional()});var E3s=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),example:Wr.number().optional()});var S3s=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),example:Wr.number().optional()});var D3s=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),example:Wr.number().optional()});var C3s=Wr.objectWithoutOptionalProperties({example:Wr.number().optional()});var I3s=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),minimum:Wr.number().optional(),maximum:Wr.number().optional(),exclusiveMinimum:Wr.boolean().optional(),exclusiveMaximum:Wr.boolean().optional(),multipleOf:Wr.number().optional(),example:Wr.number().optional()});var M3s=Wr.objectWithoutOptionalProperties({default:Wr.string().optional(),pattern:Wr.string().optional(),format:Wr.string().optional(),minLength:Wr.number().optional(),maxLength:Wr.number().optional(),example:Wr.string().optional()});var B3s=Wr.objectWithoutOptionalProperties({example:Wr.string().optional()});var T3s=Wr.objectWithoutOptionalProperties({example:Wr.string().optional()});var q3s=Wr.objectWithoutOptionalProperties({example:Wr.string().optional()});var R3s=Wr.objectWithoutOptionalProperties({default:Wr.boolean().optional(),example:Wr.boolean().optional()});var N3s=Wr.union("type",{int:j3s,int64:E3s,uint:S3s,uint64:D3s,float:C3s,double:I3s,string:M3s,datetime:B3s,date:T3s,base64:q3s,boolean:R3s}).transform({transform:e=>{switch(e.type){case"int":return G0.int(e);case"int64":return G0.int64(e);case"uint":return G0.uint(e);case"uint64":return G0.uint64(e);case"float":return G0.float(e);case"double":return G0.double(e);case"string":return G0.string(e);case"datetime":return G0.datetime(e);case"date":return G0.date(e);case"base64":return G0.base64(e);case"boolean":return G0.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var Gio=Wr.objectWithoutOptionalProperties({schema:N3s}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM);var F3s=Wr.objectWithoutOptionalProperties({default:W8i.optional(),values:Wr.list(W8i),example:Wr.string().optional()}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(sP).extend(UM).extend(k4);var x3s=Wr.objectWithoutOptionalProperties({example:Wr.unknown()}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM);var e6=Wr.union("type",{primitive:Gio,object:Wr.lazyObject(()=>V3s),array:Wr.lazyObject(()=>z3s),map:Wr.lazyObject(()=>Q3s),optional:Wr.lazyObject(()=>L3s),enum:F3s,reference:sWr,literal:Lio,oneOf:Wr.object({value:Wr.lazy(()=>W3s)}),nullable:Wr.lazyObject(()=>U3s),unknown:x3s}).transform({transform:e=>{switch(e.type){case"primitive":return Sh.primitive(e);case"object":return Sh.object(e);case"array":return Sh.array(e);case"map":return Sh.map(e);case"optional":return Sh.optional(e);case"enum":return Sh.enum(e);case"reference":return Sh.reference(e);case"literal":return Sh.literal(e);case"oneOf":return Sh.oneOf(e.value);case"nullable":return Sh.nullable(e);case"unknown":return Sh.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var z3s=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>e6),example:Wr.list(Wr.unknown()).optional()}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM).extend(k4);var Q3s=Wr.objectWithoutOptionalProperties({key:Gio,value:Wr.lazy(()=>e6),example:Wr.unknown().optional()}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(j3e).extend(UM).extend(k4);var L3s=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>e6)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM).extend(k4);var U3s=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>e6)}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(UM).extend(k4);var V3s=Wr.objectWithoutOptionalProperties({allOf:Wr.list(sWr),properties:Wr.list(Wr.lazyObject(()=>H3s)),allOfPropertyConflicts:Wr.list(Uio),fullExamples:Wr.list(Gyt).optional(),additionalProperties:Wr.boolean()}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(sP).extend(UM).extend(k4);var H3s=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>e6),readonly:Wr.boolean().optional(),writeonly:Wr.boolean().optional(),audiences:Wr.list(Wr.string()),conflict:Wr.record(sIe,Vio),nameOverride:Wr.string().optional(),generatedName:Wr.string()}).extend(WP);var W3s=Wr.union("type",{discriminated:Wr.lazyObject(()=>G3s),undiscriminated:Wr.lazyObject(()=>J3s)}).transform({transform:e=>{switch(e.type){case"discriminated":return Sit.discriminated(e);case"undiscriminated":return Sit.undiscriminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var G3s=Wr.objectWithoutOptionalProperties({discriminantProperty:Wr.string(),commonProperties:Wr.list(Wr.lazyObject(()=>K3s)),schemas:Wr.record(Wr.string(),Wr.lazy(()=>e6))}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(j3e).extend(sP).extend(UM).extend(k4);var K3s=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>e6)});var J3s=Wr.objectWithoutOptionalProperties({schemas:Wr.list(Wr.lazy(()=>e6))}).extend(VM).extend(DS).extend(vD).extend(_v).extend(WP).extend(j3e).extend(sP).extend(UM).extend(k4);var y$y=/^(\d+)/,Jio=/^[a-zA-Z][a-zA-Z0-9_]*$/,v$y={"<":"LESS_THAN",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL_TO","<=":"LESS_THAN_OR_EQUAL_TO","!=":"NOT_EQUALS","=":"EQUAL_TO","==":"EQUAL_TO","*":"ALL","":"EMPTY",'""':"EMPTY_STRING","-":"HYPHEN","|":"PIPE",".":"DOT","/":"SLASH"};function Y8i(e){let t=["zero","one","two","three","four","five","six","seven","eight","nine"],r=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],n=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];if(e<0||e>9999)return;if(e<10)return t[e];if(e<20)return r[e-10];if(e<100){let o=Math.floor(e/10),c=e%10;return c===0?n[o]:`${n[o]}_${t[c]}`}if(e<1e3){let o=Math.floor(e/100),c=e%100;return c===0?`${t[o]}_hundred`:`${t[o]}_hundred_${Y8i(c)}`}let i=Math.floor(e/1e3),a=e%1e3;return a===0?`${t[i]}_thousand`:`${t[i]}_thousand_${Y8i(a)}`}function rko(e){let t=e.match(y$y);if(t&&t[0]!=null){let r=t[0],n=e.substring(r.length),i=parseFloat(r);if(!isNaN(i)&&isFinite(i)){let a=Y8i(i);return n.length>0?`${a}_${n}`:a}}}function Kio(e){let t=rko(e),r=v$y[e];return t!=null?bU(FA(t)):r??(e.toLowerCase()==="n/a"?"NOT_APPLICABLE":bU(FA(e)))}function E3e(e,t){return e.type==="primitive"&&t.type==="primitive"?b$y(e.schema,t.schema):e.type==="enum"&&t.type==="enum"?sHC(e.values,t.values):e.type==="array"&&t.type==="array"?E3e(e.value,t.value):e.type==="unknown"&&t.type==="unknown"?!0:e.type==="reference"&&t.type==="reference"?e.schema===t.schema:e.type==="optional"&&t.type==="optional"?E3e(e.value,t.value):e.type==="oneOf"&&t.type==="oneOf"?cHC(e.value,t.value):e.type==="object"&&t.type==="object"?lHC(e,t):e.type==="map"&&t.type==="map"?b$y(e.key.schema,t.key.schema)&&E3e(e.value,t.value):e.type==="literal"&&t.type==="literal"?e.value===t.value:!1}function b$y(e,t){return e.type===t.type}function sHC(e,t){let r=new Set(...e.map(i=>i.value)),n=new Set(...t.map(i=>i.value));return xue(r,n)}function cHC(e,t){return e.type==="discriminated"&&t.type==="discriminated"?e.discriminantProperty===t.discriminantProperty&&Object.keys(e.schemas).length===Object.keys(t.schemas).length&&Object.entries(e.schemas).every(([r,n])=>{let i=t.schemas[r];return i==null?!1:E3e(n,i)}):e.type==="undiscriminated"&&t.type==="undiscriminated"?e.schemas.length===t.schemas.length&&e.schemas.every((r,n)=>{let i=t.schemas[n];return i==null?!1:E3e(r,i)}):!1}function lHC(e,t){if(Object.keys(e.properties).length!==Object.keys(t.properties).length)return!1;let r=Object.fromEntries(e.properties.map(n=>[n.key,n.schema]));return Object.entries(t.properties).every(([n,i])=>{let a=r[n];return a==null?!1:E3e(a,i.schema)})}function uK(e){switch(e){case qde.Deprecated:return"deprecated";case qde.Beta:return"pre-release";case qde.GenerallyAvailable:return"generally-available";default:return}}function fHC(e){let t=e.find(n=>typeof n=="object"&&n.type==="namespace"),r=e.filter(n=>typeof n=="string"||n.type!=="namespace");return t?[t,...r]:r}function g$y(e){let t=e?fHC(e):void 0;if(t==null||t.length===0)return Poa;let r=[];for(let[n,i]of t.entries())if(typeof i=="string")r.push(FA(i));else if(typeof i=="object")switch(i.type){case"namespace":{n<t.length-1?r.push(FA(i.name)):r.push(i.name,Poa);break}default:ks(i.type)}else ks(i);return r.join("/")}function X8i(e){return yw.of(`${g$y(e)}.yml`)}function eRf({sdkName:e,namespaceOverride:t}){let r;return e==null||e.groupName.length===0&&t==null?Poa:(t!=null?r=[{type:"namespace",name:t},...e.groupName.filter(n=>typeof n=="string"||n.type!=="namespace")]:r=e.groupName,g$y(r))}function m$y({sdkName:e,namespaceOverride:t}){return yw.of(`${eRf({sdkName:e,namespaceOverride:t})}.yml`)}function O$y({location:e,namespaceOverride:t}){return t!=null?cZ(yw.of(t),e):e}function $3s(e){switch(e.type){case"protobuf":return{proto:{type:e.typeName}};default:ks(e.type)}}function $io(e){switch(e.type){case"object":case"enum":case"array":case"map":case"reference":case"literal":case"optional":case"nullable":case"primitive":return e.groupName??void 0;case"oneOf":return e.value.groupName??void 0;case"unknown":return;default:ks(e)}}function t6(e){return typeof e=="string"?e:e.type}function Yio(e){if(typeof e!="string")return e.docs}function nko(e){if(typeof e!="string")return e.default}function tRf(e){if(typeof e!="string")return e.validation}function P$y(e){let t=t6(e);return t.startsWith("nullable<")||t.startsWith("optional<nullable<")?e:typeof e=="string"?A$y(e):{...e,type:A$y(e.type)}}function A$y(e){return e.startsWith("nullable<")||e.startsWith("optional<nullable<")?e:e.startsWith("optional<")?e.replace("optional<","optional<nullable<")+">":`nullable<${e}>`}function uda(e){return t6(e).startsWith("optional<")?e:typeof e=="string"?w$y(e):{...e,type:w$y(e.type)}}function w$y(e){return e.startsWith("optional<")?e:`optional<${e}>`}var dHC=-2147483648,pHC=2147483647,_HC=-17976931348623157e292,hHC=17976931348623157e292;function hC({schema:e,fileContainingReference:t,declarationFile:r=t,context:n,namespace:i,declarationDepth:a}){switch(n.shouldMarkSchemaAsReferenced()&&n.markSchemaAsReferenced(e,i),e.type){case"primitive":return Y3s(e);case"array":return iRf({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"map":return aRf({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"reference":return nRf({schema:e,fileContainingReference:t,context:n,namespace:i});case"unknown":return uRf();case"optional":return X3s({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"nullable":return oRf({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"enum":return wHC({schema:e,fileContainingReference:t,context:n,declarationFile:r,declarationDepth:a});case"literal":return e.value,sRf(e);case"object":return jHC({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"oneOf":return EHC({schema:e.value,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});default:ks(e)}}function Y3s(e){switch(e.schema.type){case"string":return bHC({description:e.description,schema:e.schema});case"int":return gHC({description:e.description,schema:e.schema});case"float":return mHC({description:e.description,schema:e.schema});case"double":return OHC({description:e.description,schema:e.schema});case"boolean":return yHC({description:e.description,schema:e.schema});case"int64":return vHC({description:e.description,schema:e.schema})}let t=e.schema._visit({int:()=>"integer",int64:()=>"long",uint:()=>"uint",uint64:()=>"uint64",float:()=>"double",double:()=>"double",string:()=>"string",datetime:()=>"datetime",date:()=>"date",base64:()=>"base64",boolean:()=>"boolean",_other:()=>"unknown"});return e.description==null&&e.title==null?t:{type:t,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:uK(e.availability)}:{}}}function yHC({description:e,schema:t}){let r="boolean";if(e==null&&t.default==null)return r;let n={type:r};return e!=null&&(n.docs=e),t.default!=null&&(n.default=t.default),n}function vHC({description:e,schema:t}){let r="long";if(e==null&&t.default==null)return r;let n={type:r};return e!=null&&(n.docs=e),t.default!=null&&(n.default=t.default),n}function bHC({description:e,schema:t}){let r="string",n=AHC(t);if(e==null&&t.default==null&&n==null)return r;let i={type:r};return e!=null&&(i.docs=e),t.default!=null&&(i.default=t.default),n!=null&&(i.validation=n),i}function gHC({description:e,schema:t}){let r="integer",n=j$y(t,r);if(e==null&&t.default==null&&n==null)return r;let i={type:r};return e!=null&&(i.docs=e),t.default!=null&&(i.default=t.default),n!=null&&(i.validation=n),i}function mHC({description:e,schema:t}){let r="float";if(e==null)return r;let n={type:r};return e!=null&&(n.docs=e),n}function OHC({description:e,schema:t}){let r="double",n=j$y(t,r);if(e==null&&t.default==null&&n==null)return r;let i={type:r};return e!=null&&(i.docs=e),t.default!=null&&(i.default=t.default),n!=null&&(i.validation=n),i}function AHC(e){if(e==null)return;let{format:t,pattern:r,minLength:n,maxLength:i}=e,a=PHC(t);if(!(a==null&&r==null&&n==null&&i==null))return{format:a,pattern:r,minLength:n,maxLength:i}}function PHC(e){switch(e){case"date":case"date-time":case"password":case"byte":case"bytes":case"binary":case"email":case"uuid":case"uri":case"hostname":case"ipv4":case"ipv6":return e;default:return}}function j$y(e,t){if(e==null)return;let{minimum:r,maximum:n,multipleOf:i}=e,{exclusiveMinimum:a,exclusiveMaximum:o}=e;if(r=rRf(r,t),n=rRf(n,t),i=rRf(i,t),!(r==null&&n==null&&a==null&&o==null&&i==null))return{min:r,max:n,exclusiveMin:a,exclusiveMax:o,multipleOf:i}}function rRf(e,t){if(e===void 0)return;let[r,n]=t==="integer"?[dHC,pHC]:[_HC,hHC];return e<r||e>n?void 0:e}function nRf({schema:e,fileContainingReference:t,context:r,namespace:n}){let i=r.getSchema(e.schema,n);if(i==null)return"unknown";let a=SHC(i)??e.schema,o=$io(i),c=DHC(i),s=Z3s({context:r,fileContainingReference:t,declarationFile:X8i(o),type:a});return i.type==="nullable"&&(s=r.wrapReferencesToNullableInOptional?`optional<${s}>`:`nullable<${s}>`),i.type==="optional"&&!s.startsWith("optional<")&&(s=`optional<${s}>`),e.description==null&&c==null?s:{type:s,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:uK(e.availability)}:{}}}function iRf({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let o=hC({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=`list<${t6(o)}>`;return e.description==null&&e.title==null?c:{...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:uK(e.availability)}:{},type:c}}function aRf({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let o=Y3s(e.key),c=hC({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),d=e.encoding!=null?$3s(e.encoding):void 0,s=`map<${t6(o)}, ${t6(c)}>`;if(e.description==null&&d==null&&e.title==null)return s;let u={type:s};return e.description!=null&&(u.docs=e.description),e.encoding!=null&&(u.encoding=d),e.availability!=null&&(u.availability=uK(e.availability)),u}function oRf({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){if(!n.respectNullableSchemas)return X3s({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});let o=hC({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=t6(o),d=Yio(o),s=nko(o),u=tRf(o),l=P$y(c);if(n.wrapReferencesToNullableInOptional&&(l=uda(l)),e.availability==null&&e.description==null&&d==null&&s==null&&u==null&&e.title==null)return l;let m=typeof l=="string"?{type:l}:l;return(e.description!=null||d!=null)&&(m.docs=e.description??d),s!=null&&(m.default=s),u!=null&&(m.validation=u),e.availability!=null&&(m.availability=uK(e.availability)),m}function X3s({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let o=hC({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=t6(o),d=Yio(o),s=nko(o),u=tRf(o),l=uda(c);if(e.availability==null&&e.description==null&&d==null&&s==null&&u==null&&e.title==null)return l;let m=typeof l=="string"?{type:l}:l;return(e.description!=null||d!=null)&&(m.docs=e.description??d),s!=null&&(m.default=s),u!=null&&(m.validation=u),e.availability!=null&&(m.availability=uK(e.availability)),m}function uRf(){return"unknown"}function sRf(e){let t;switch(e.value.type){case"boolean":{t=`literal<${e.value.value}>`;break}case"string":{t=`literal<"${e.value.value}">`;break}default:ks(e.value)}return e.description==null&&e.title==null?t:{type:t,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:uK(e.availability)}:{}}}function wHC({schema:e,fileContainingReference:t,declarationFile:r,context:n,declarationDepth:i}){let a=iko(e,i),o=e.nameOverride??e.generatedName;n.builder.addType(r,{name:o,schema:a.schema});let c=Z3s({type:o,fileContainingReference:t,declarationFile:r,context:n});if(e.description==null&&e.default==null&&e.title==null)return c;let d={type:c};return e.description!=null&&(d.docs=e.description),e.default!=null&&(d.default=e.default.value),e.availability!=null&&(d.availability=uK(e.availability)),d}function jHC({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let o=cRf({schema:e,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=e.nameOverride??e.generatedName;n.builder.addType(r,{name:c,schema:o.schema});let d=Z3s({type:c,fileContainingReference:t,declarationFile:r,context:n});return e.description==null&&e.title==null?d:{type:d,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:uK(e.availability)}:{}}}function EHC({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let o=lRf({schema:e,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=e.nameOverride??e.generatedName;n.builder.addType(r,{name:c,schema:o.schema});let d=Z3s({type:c,fileContainingReference:t,declarationFile:r,context:n});return e.description==null&&e.title==null?d:{...e.title!=null?{"display-name":e.title}:{},type:d,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:uK(e.availability)}:{}}}function Z3s({type:e,fileContainingReference:t,declarationFile:r,context:n}){if(r===t)return e;let i=n.builder.addImport({file:t,fileToImport:r});return i!=null?`${i}.${e}`:e}function SHC(e){return i1._visit(e,{primitive:t=>t.nameOverride??t.generatedName,object:t=>t.nameOverride??t.generatedName,array:t=>t.nameOverride??t.generatedName,map:t=>t.nameOverride??t.generatedName,enum:t=>t.nameOverride??t.generatedName,reference:t=>t.nameOverride??t.generatedName,literal:t=>t.nameOverride??t.generatedName,oneOf:t=>t.nameOverride??t.generatedName,optional:t=>t.nameOverride??t.generatedName,nullable:t=>t.nameOverride??t.generatedName,unknown:t=>t.nameOverride??t.generatedName,_other:()=>{}})}function DHC(e){return i1._visit(e,{primitive:t=>t.title,object:t=>t.title,array:t=>t.title,map:t=>t.title,enum:t=>t.title,reference:t=>t.title,literal:t=>t.title,oneOf:t=>t.title,optional:t=>t.title,nullable:t=>t.title,unknown:t=>{},_other:()=>{}})}var yse;(function(e){e[e.Channel=0]="Channel",e[e.Endpoint=1]="Endpoint",e[e.Request=2]="Request",e[e.Webhook=3]="Webhook"})(yse||(yse={}));function iwi(e){switch(e.type){case"openapi":return{openapi:e.file};case"protobuf":return{proto:e.file};default:ks(e)}}function S$y({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){let a;switch(e.type){case"primitive":a=MHC(e);break;case"array":a=CHC({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"map":a=IHC({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"reference":a=BHC({schema:e,context:t,declarationFile:r,namespace:n});break;case"unknown":a=qHC(e.nameOverride,e.generatedName);break;case"optional":a=C$y({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"nullable":a=THC({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"enum":a=iko(e,i);break;case"literal":a=RHC(e,e.nameOverride,e.generatedName);break;case"object":a=cRf({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"oneOf":a=lRf({schema:e.value,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;default:ks(e)}return a}function cRf({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){let a=t.isInState(yse.Request)&&t.respectReadonlySchemas&&(t.getEndpointMethod()==="POST"||t.getEndpointMethod()==="PUT"||t.getEndpointMethod()==="PATCH"),o=!1,c={},d=new Set;for(let A of e.properties){if(A.readonly&&(o=!0),a&&A.readonly)continue;if(Object.keys(A.conflict).length>0){if(Object.entries(A.conflict).every(([R,V])=>!V.differentSchema))continue;Object.entries(A.conflict).forEach(([R])=>{fRf({property:A.key,schemaId:R,context:t,namespace:n}).forEach(Y=>{d.add(Y)})})}let P=hC({schema:A.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1}),C=A.audiences,M=A.nameOverride,T=uK(A.availability),z=zHC(A);c[A.key]=xHC({typeReference:P,audiences:C,name:M,availability:T,propertyAccess:z})}let s=new Set;for(let A of e.allOfPropertyConflicts)A.allOfSchemaIds.forEach(P=>d.add(P)),A.conflictingTypeSignatures&&s.add(A.propertyKey);let u=[];for(let A of e.allOf){let P=I$y({schema:A.schema,context:t,namespace:n});if(P==null||d.has(A.schema)||d.has(P))continue;let C=hC({schema:i1.reference(A),context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1});u.push(t6(C))}for(let A of d){let P=dRf(t,A,n);for(let C of P.properties)c[C.key]==null&&(s.has(C.key)&&(c[C.key]="unknown"),c[C.key]=hC({schema:C.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1}));for(let C of P.allOf){if(d.has(C.schema))continue;let M=hC({schema:i1.reference(C),context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1});u.push(t6(M))}}let l={docs:e.description??void 0,properties:Object.fromEntries(Object.entries(c).map(([A,P])=>FHC(A)?[A,typeof P=="string"?{type:P,name:`_${A}`}:{...P,name:`_${A}`}]:[A,P]))};u.length>0&&(l.extends=u),e.additionalProperties&&(l["extra-properties"]=!0),e.availability!=null&&(l.availability=uK(e.availability)),e.source!=null&&(l.source=iwi(e.source)),l.inline=pRf(e,i);let m=e.nameOverride??e.generatedName;return{name:o&&t.respectReadonlySchemas&&!a?`${m}Read`:m,schema:l}}function fRf({property:e,schemaId:t,context:r,namespace:n}){let i=r.getSchema(t,n);if(i==null)return[];if(i.type==="reference")return fRf({property:e,schemaId:i.schema,context:r,namespace:n});if(i.type==="object"){let{properties:a,allOf:o}=dRf(r,t,n),c=a.some(s=>s.key===e),d=[...o.flatMap(s=>fRf({property:e,context:r,schemaId:s.schema,namespace:n}))];if(c||d.length>0)return[t,...d]}return[]}function D$y(e,t,r){return t.type==="object"?{properties:t.properties,allOf:t.allOf}:t.type==="reference"?dRf(e,t.schema,r):t.type==="nullable"?D$y(e,t.value,r):{properties:[],allOf:[]}}function dRf(e,t,r){let n=e.getSchema(t,r);return n==null?{properties:[],allOf:[]}:D$y(e,n,r)}function CHC({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return{name:e.nameOverride??e.generatedName,schema:iRf({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:n,declarationDepth:i})}}function IHC({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return{name:e.nameOverride??e.generatedName,schema:aRf({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:n,declarationDepth:i})}}function MHC(e){let t=Y3s(e);if(typeof t=="string")return{name:e.nameOverride??e.generatedName,schema:t};let{default:r,...n}=t;return{name:e.nameOverride??e.generatedName,schema:{...n}}}function E$y(e){return e.camel==null&&e.pascal==null&&e.screamingSnake==null&&e.snake==null}function iko(e,t){let r={enum:e.values.map(a=>{let o=a.nameOverride??a.generatedName,c=a.value;if(o===c&&a.description==null&&(a.casing==null||E$y(a.casing)))return o;let d={value:a.value};if(o!==c&&(d.name=o),a.description!=null&&(d.docs=a.description),a.casing!=null&&!E$y(a.casing)){let s={},u=!1;a.casing.camel!=null&&(s.camel=a.casing.camel,u=!0),a.casing.screamingSnake!=null&&(s["screaming-snake"]=a.casing.screamingSnake,u=!0),a.casing.snake!=null&&(s.snake=a.casing.snake,u=!0),a.casing.pascal!=null&&(s.pascal=a.casing.pascal,u=!0),u&&(d.casing=s)}return d})};e.description!=null&&(r.docs=e.description),e.default!=null&&(r.default=e.default.value),r.inline=pRf(e,t);let n=new Set,i={...r,enum:[],source:e.source!=null?iwi(e.source):void 0};for(let a of r.enum){let o=typeof a=="string"?a:a.name??a.value;n.has(o.toLowerCase())||(i.enum.push(a),n.add(o.toLowerCase()))}return{name:e.nameOverride??e.generatedName,schema:i}}function BHC({schema:e,context:t,declarationFile:r,namespace:n}){return{name:e.nameOverride??e.generatedName,schema:nRf({schema:e,context:t,fileContainingReference:r,namespace:n})}}function THC({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return t.respectNullableSchemas?{name:e.nameOverride??e.generatedName,schema:oRf({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:n,declarationDepth:i})}:C$y({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i})}function C$y({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return{name:e.nameOverride??e.generatedName,schema:X3s({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:n,declarationDepth:i})}}function qHC(e,t){return{name:e??t,schema:uRf()}}function RHC(e,t,r){return{name:t??r,schema:sRf(e)}}function lRf({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){let a=e.encoding!=null?$3s(e.encoding):void 0;if(e.type==="discriminated"){let c={};for(let s of e.commonProperties)c[s.key]=hC({schema:s.schema,fileContainingReference:r,context:t,namespace:n,declarationDepth:i+1});let d={};for(let[s,u]of Object.entries(e.schemas))d[s]=hC({schema:u,context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1});return{name:e.nameOverride??e.generatedName,schema:{discriminant:e.discriminantProperty,"base-properties":c,docs:e.description??void 0,availability:e.availability!=null?uK(e.availability):void 0,union:d,encoding:a,source:e.source!=null?iwi(e.source):void 0}}}let o=[];for(let c of e.schemas)o.push(hC({schema:c,fileContainingReference:r,context:t,namespace:n,declarationDepth:i+1}));return{name:e.nameOverride??e.generatedName,schema:{discriminated:!1,docs:e.description??void 0,union:o,encoding:a,source:e.source!=null?iwi(e.source):void 0,inline:pRf(e,i)}}}var NHC=/^[0-9]/;function FHC(e){return NHC.test(e)}function I$y({schema:e,context:t,namespace:r}){let n=t.getSchema(e,r);if(n!=null)return n.type==="reference"?I$y({context:t,schema:n.schema,namespace:r}):e}function xHC({typeReference:e,audiences:t,name:r,availability:n,propertyAccess:i}){return t.length===0&&r==null&&n==null&&i==null?e:{...typeof e=="string"?{type:e}:{...e},...t.length>0?{audiences:t}:{},...r!=null?{name:r}:{},...n!=null?{availability:n}:{},...i!=null?{access:i}:{}}}function pRf(e,t){return e.inline===!0||t>0?!0:void 0}function zHC(e){if(!(e.readonly&&e.writeonly)){if(e.readonly)return hZ.ObjectPropertyAccess.ReadOnly;if(e.writeonly)return hZ.ObjectPropertyAccess.WriteOnly}}function M$y(e){let t=e.replace(/^x-|^X-/,"");return FA(t)}var B$y="BasicAuthScheme",k3s="BearerAuthScheme";function T$y(e){if(e.authOverrides!=null){for(let[r,n]of Object.entries(e.authOverrides["auth-schemes"]??{}))e.builder.addAuthScheme({name:r,schema:n});e.authOverrides.auth!=null&&e.builder.setAuth(e.authOverrides.auth);return}let t=!1;for(let[r,n]of Object.entries(e.ir.securitySchemes))if(n.type==="basic"){let i={scheme:"basic"};n.usernameVariableName!=null&&(i.username===void 0?i.username={name:n.usernameVariableName}:i.username.name=n.usernameVariableName),n.usernameEnvVar!=null&&(i.username===void 0?i.username={env:n.usernameEnvVar}:i.username.env=n.usernameEnvVar),n.passwordVariableName!=null&&(i.password===void 0?i.password={name:n.passwordVariableName}:i.password.name=n.passwordVariableName),n.passwordEnvVar!=null&&(i.password===void 0?i.password={env:n.passwordEnvVar}:i.password.env=n.passwordEnvVar),e.builder.addAuthScheme({name:B$y,schema:i}),t||(e.builder.setAuth(B$y),t=!0)}else if(n.type==="bearer"){let i={scheme:"bearer"};n.tokenVariableName!=null&&(i.token===void 0?i.token={name:n.tokenVariableName}:i.token.name=n.tokenVariableName),n.tokenEnvVar!=null&&(i.token===void 0?i.token={env:n.tokenEnvVar}:i.token.env=n.tokenEnvVar),e.builder.addAuthScheme({name:k3s,schema:i}),t||(e.builder.setAuth(k3s),t=!0)}else if(n.type==="header")if(t)e.builder.addGlobalHeader({name:n.headerName,schema:{type:"string",name:n.headerVariableName??M$y(n.headerName),env:n.headerEnvVar}});else{let i={header:n.headerName,name:n.headerVariableName??"apiKey",type:"string"};n.headerEnvVar!=null&&(i.env=n.headerEnvVar),n.prefix!=null&&(i.prefix=n.prefix),e.builder.addAuthScheme({name:r,schema:i}),e.builder.setAuth(r),t=!0}else if(n.type==="oauth"){let i={scheme:"bearer"};e.builder.addAuthScheme({name:k3s,schema:i}),t||(e.builder.setAuth(k3s),t=!0),n.scopesEnum!=null&&n.scopesEnum.values.length>0&&e.builder.addType(yw.of("__package__.yml"),{name:"OauthScope",schema:iko(n.scopesEnum,0).schema})}}function cWr({header:e,context:t,fileContainingReference:r,namespace:n}){let i=hC({schema:e.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),a=t6(i),o=e.name.replace(/^x-|^X-/,""),c=e.parameterNameOverride!=null?e.parameterNameOverride:FA(o);if(e.description==null&&e.name===c&&e.env==null&&e.availability==null)return a;let d={type:a};return c!==e.name&&(d.name=c),e.description!=null&&(d.docs=e.description),e.env!=null&&(d.env=e.env),e.availability!=null&&(d.availability=uK(e.availability)),d}function ezs({pathParameter:e,context:t,fileContainingReference:r,namespace:n}){let i=hC({schema:e.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:0});if(e.variableReference==null&&e.description==null&&e.availability==null)return t6(i);let a=e.variableReference!=null?{variable:`$${e.variableReference}`}:{type:t6(i)};return e.description!=null&&(a.docs=e.description),e.availability!=null&&(a.availability=uK(e.availability)),a}function rzs({queryParameter:e,context:t,fileContainingReference:r,namespace:n}){let i=_Rf({schema:e.schema,context:t,fileContainingReference:r,namespace:n});if(i==null)return;let a=t6(i.value),o=nko(i.value);a==="unknown"?a="string":a==="optional<unknown>"&&(a="optional<string>");let c={type:a};return o!=null&&(c.default=o),i.allowMultiple&&(c["allow-multiple"]=!0),e.description!=null&&(c.docs=e.description),e.parameterNameOverride!=null&&(c.name=e.parameterNameOverride),e.availability!=null&&(c.availability=uK(e.availability)),QHC(i.value)&&i.value.validation!==void 0&&(c.validation=i.value.validation),c.default==null&&c["allow-multiple"]==null&&c.docs==null&&c.name==null&&c.availability==null&&c.validation==null?a:c}function _Rf({schema:e,context:t,fileContainingReference:r,namespace:n}){if(e.type==="reference"){let i=t.getSchema(e.schema,n);if(i==null)return;if(i.type==="array")return{value:hC({schema:i1.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:i.value,description:e.description??i.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:void 0}),context:t,declarationFile:yw.of(CF),fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0};if(i.type==="oneOf"&&i.value.type==="undiscriminated"){let a=[],o=!1;for(let[c,d]of Object.entries(i.value.schemas))d.type==="primitive"&&d.schema.type==="string"&&(o=!0),d.type==="literal"&&d.value.type==="string"&&(Jio.test(d.value.value)?a.push(d.value.value):a.push({value:d.value.value,name:Kio(d.value.value)}));if(a.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:a}}),o&&t.respectForwardCompatibleEnums?(t.builder.addType(r,{name:`${e.generatedName}OrString`,schema:{discriminated:!1,union:[{type:"string"},{type:e.generatedName}]}}),{value:`${e.generatedName}OrString`,allowMultiple:!1}):{value:e.generatedName,allowMultiple:!1};if(i.value.schemas.length===2){let[c,d]=i.value.schemas;if(c!=null&&d!=null&&tzs({array:c,primitive:d}))return{value:hC({schema:i1.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:d,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:void 0}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0};if(c!=null&&d!=null&&tzs({array:c,primitive:d}))return{value:hC({schema:i1.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:c,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:void 0}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0}}for(let[c,d]of Object.entries(i.value.schemas))return _Rf({schema:d,context:t,fileContainingReference:r,namespace:n})}else if(t.objectQueryParameters)return{value:hC({schema:e,context:t,fileContainingReference:r,declarationFile:yw.of(CF),namespace:n,declarationDepth:0}),allowMultiple:!1}}if(e.type==="optional"||e.type==="nullable"){let i=e.type==="optional"?i1.optional:i1.nullable;if(e.value.type==="reference"){let a=t.getSchema(e.value.schema,n);if(a==null)return;if(a.type==="array")return{value:hC({schema:i({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:a.value,description:e.description??a.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,declarationFile:yw.of(CF),namespace:n,declarationDepth:0}),allowMultiple:!0};if(t.objectQueryParameters)return{value:hC({schema:e,context:t,fileContainingReference:r,declarationFile:yw.of(CF),namespace:n,declarationDepth:0}),allowMultiple:!1}}if(e.value.type==="array")return{value:hC({schema:i({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value.value,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0};if(e.value.type==="oneOf"&&e.value.value.type==="undiscriminated"){let a=[],o=!1;for(let[c,d]of Object.entries(e.value.value.schemas))d.type==="primitive"&&d.schema.type==="string"&&(o=!0),d.type==="literal"&&d.value.type==="string"&&(Jio.test(d.value.value)?a.push(d.value.value):a.push({value:d.value.value,name:Kio(d.value.value)}));if(a.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:a}}),o&&t.respectForwardCompatibleEnums?(t.builder.addType(r,{name:`${e.generatedName}OrString`,schema:{discriminated:!1,union:[{type:"string"},{type:`optional<${e.value.value.generatedName}>`}]}}),{value:`optional<${e.value.value.generatedName}OrString>`,allowMultiple:!1}):{value:`optional<${e.value.value.generatedName}>`,allowMultiple:!1};if(e.value.value.schemas.length===2){let[c,d]=e.value.value.schemas;if(c!=null&&d!=null&&tzs({array:c,primitive:d}))return{value:hC({schema:i({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:d,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0};if(c!=null&&d!=null&&tzs({array:d,primitive:c}))return{value:hC({schema:i({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:c,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0}}if(t.objectQueryParameters)return{value:hC({schema:e,context:t,fileContainingReference:r,declarationFile:yw.of(CF),namespace:n,declarationDepth:0}),allowMultiple:!1};for(let[c,d]of Object.entries(e.value.value.schemas))return _Rf({schema:i({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:d,description:void 0,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:n})}else if(e.value.type==="object")return t.objectQueryParameters?{value:hC({schema:e,context:t,fileContainingReference:r,declarationFile:yw.of(CF),namespace:n,declarationDepth:0}),allowMultiple:!1}:void 0;return{value:hC({schema:e,context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!1}}return e.type==="array"?{value:hC({schema:i1.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0}:{value:hC({schema:e,context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!1}}function tzs({array:e,primitive:t}){return e?.type==="array"&&e.value.type==="primitive"&&t?.type==="primitive"&&e.value.schema.type===t.schema.type}function QHC(e){return e.type!=null}function q$y({websocketExample:e,context:t}){let r={messages:[]};e.name!=null&&(r.name=e.name),e.description!=null&&(r.docs=e.description),e.queryParameters!=null&&e.queryParameters.length>0&&(r["query-parameters"]=LHC(e.queryParameters)),e.headers!=null&&e.headers.length>0&&(r.headers=UHC({context:t,namedFullExamples:e.headers}));for(let n of e.messages){let i=Z8i(n.payload);i!=null&&r.messages.push({type:n.messageType,body:i})}return r}function LHC(e){let t={};return e.forEach(r=>{let n=Z8i(r.value);Array.isArray(n)?t[r.name]=n[0]:n!=null&&(t[r.name]=n)}),t}function UHC({context:e,namedFullExamples:t}){let r=e.builder.getGlobalHeaderNames(),n={};return t.forEach(i=>{let a=Z8i(i.value);r.has(i.name)||a!=null&&(n[i.name]=a)}),n}function Z8i(e){switch(e.type){case"primitive":return R$y(e.value);case"object":return N$y(e.properties);case"array":return VHC(e.value);case"map":return WHC(e.value);case"oneOf":return HHC(e.value);case"enum":return e.value;case"literal":return GHC(e.value);case"unknown":return Z8i(e.value);case"null":return null;default:ks(e)}}function R$y(e){switch(e.type){case"int":return e.value;case"int64":return e.value;case"uint":return e.value;case"uint64":return e.value;case"float":return e.value;case"double":return e.value;case"string":return e.value.startsWith("$")?`${e.value.slice(1)}`:e.value;case"datetime":try{return new Date(e.value).toISOString().replace(/\.\d{3}Z$/,"Z")}catch{return"2024-01-15T09:30:00Z"}case"date":return e.value;case"base64":case"boolean":return e.value;default:ks(e)}}function N$y(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Z8i(r)]))}function VHC(e){return e.map(t=>Z8i(t))}function WHC(e){return Object.fromEntries(e.map(t=>[R$y(t.key),Z8i(t.value)]))}function HHC(e){return e.type==="discriminated"?N$y(e.value):Z8i(e.value)}function GHC(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:ks(e)}}function ako(e){try{let r=new URL(e).pathname.split("/").filter(n=>n.length>0);if(r.length>0)return r[r.length-1]}catch{}}function nzs(e){try{return new URL(e).protocol.replace(":","")}catch{return}}function izs(e,t,r=!1){let n=ako(t);return r&&n!=null?n:e!=null&&n!=null?`${e}_${n}`:n??e??"websocket"}function awi(e){return e.find(t=>typeof t!="string"&&t.type==="namespace")?.name}function azs(e,t){return t??(e?.groupName!=null?awi(e.groupName):void 0)}function F$y({channel:e,context:t,declarationFile:r}){let n=e.servers[0],i=n!=null?t.groupEnvironmentsByHost?t.getUrlId(n.url)??izs(n.name,n.url,!0):n.name:void 0;t.logger.debug(`[buildChannel] Channel path="${e.path}", server name="${n?.name}", server url="${n?.url}", resolved urlId="${i}" (from collision map: ${t.getUrlId(n?.url??"")!=null})`);let a={path:e.path,url:i,auth:!1};e.audiences!=null&&e.audiences.length>0&&(a.audiences=e.audiences),e.summary!=null&&(a["display-name"]=e.summary),e.description!=null&&(a.docs=e.description);let o=awi(e.groupName),c={};if(e.handshake.pathParameters.length>0)for(let u of e.handshake.pathParameters)c[u.name]=ezs({pathParameter:u,context:t,fileContainingReference:r,namespace:o});Object.keys(c).length>0&&(a["path-parameters"]=c);let d={};if(e.handshake.queryParameters.length>0)for(let u of e.handshake.queryParameters){let l=rzs({queryParameter:u,context:t,fileContainingReference:r,namespace:o});l!=null&&(d[u.name]=l)}Object.keys(d).length>0&&(a["query-parameters"]=d);let s={};if(e.handshake.headers.length>0)for(let u of e.handshake.headers){let l=cWr({header:u,context:t,fileContainingReference:r,namespace:o});s[u.name]=l}Object.keys(s).length>0&&(a.headers=s),t.builder.addChannel(r,{channel:a});for(let u of e.messages)t.builder.addChannelMessage(r,{messageId:u.name,message:{origin:u.origin,body:hC({schema:u.body,context:t,fileContainingReference:r,namespace:o,declarationDepth:0})}});for(let u of e.examples){let l=q$y({context:t,websocketExample:u});t.builder.addChannelExample(r,{example:l})}}function hRf(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="grouped"}var Jyt="Base",Q$y="Default";function x$y(e){try{return new URL(e).hostname}catch{return}}function z$y(e){return e??Q$y}function JHC(e,t){let r=new Map;for(let n of e){if(hRf(n)||!("url"in n)||!n.url)continue;let i=x$y(n.url)??n.url;r.has(i)||r.set(i,{environmentName:z$y(n.name),httpServers:[],websocketServers:[]}),r.get(i)?.httpServers.push({name:n.name,url:n.url,audiences:n.audiences})}for(let n of t){let i=x$y(n.url)??n.url;r.has(i)||r.set(i,{environmentName:z$y(n.name),httpServers:[],websocketServers:[]}),r.get(i)?.websocketServers.push(n)}return r}function sda(e){return Object.entries(e).reduce((t,[r,n])=>(Vnt(n)?Object.entries(n.urls).forEach(([i,a])=>{t[i]=a}):t[r]=typeof n=="string"?n:n.url,t),{})}function L$y(e){if(e.environmentOverrides!=null){for(let[T,z]of Object.entries(e.environmentOverrides.environments??{}))e.builder.addEnvironment({name:T,schema:z});e.environmentOverrides["default-environment"]!=null&&e.builder.setDefaultEnvironment(e.environmentOverrides["default-environment"]),e.environmentOverrides["default-url"]!=null&&e.builder.setDefaultUrl(e.environmentOverrides["default-url"]);return}let t={},r=[],n=e.ir.servers.some(T=>hRf(T)),i=e.ir.servers;for(let T of i)if(hRf(T)){let z={urls:{}};for(let[U,R]of Object.entries(T.urls))z.urls[U]=R.url;T.name&&(t[T.name]=z)}else if("url"in T&&T.url){let z=T.audiences?{url:T.url,audiences:T.audiences}:T.url;if(T.name==null){r.push(z);continue}t[T.name]=z}let a={},o={},c=[];for(let T of e.ir.endpoints)for(let z of T.servers){if(z.url==null&&z.name!=null){a[z.name]||(a[z.name]=[]);continue}if(z.url==null)continue;let U=z.audiences?{url:z.url,audiences:z.audiences}:z.url;if(z.name==null){c.push(U);continue}a[z.name]||(a[z.name]=[]),a[z.name]?.push({url:z.url,audiences:z.audiences}),o[z.name]=U}let d={},s=[];for(let T of e.ir.websocketServers){e.logger.debug(`[buildEnvironments] Processing WebSocket server: name="${T.name}", url="${T.url}"`);let z=T.audiences?{url:T.url,audiences:T.audiences}:T.url;if(T.name==null){s.push(z);continue}d[T.name]=z}let u=Object.keys(t).length,l=u>0,m=Object.keys(o).length>0,A=Object.keys(a).some(T=>a[T]?.length===0),P=Object.keys(d).length>0;if(e.groupEnvironmentsByHost&&P&&(l||e.ir.servers.length>0)){let T=Object.entries(d).map(([U,R])=>({name:U,url:typeof R=="string"?R:R.url,audiences:typeof R=="string"?void 0:R.audiences})),z=JHC(i,T);if(z.size>0){let U=!0;for(let[R,V]of z.entries()){let Y={},re=[...V.httpServers.map(ee=>({...ee,isHttp:!0})),...V.websocketServers.map(ee=>({...ee,isHttp:!1}))],Z=new Map;for(let ee of re){let ne=ako(ee.url),me=nzs(ee.url);ne&&me&&(Z.has(ne)||Z.set(ne,new Set),Z.get(ne)?.add(me))}if(V.httpServers.length>0){let ee=V.httpServers[0];ee!=null&&(Y[Jyt]=ee.url,e.setUrlId(ee.url,Jyt));for(let ne=1;ne<V.httpServers.length;ne++){let me=V.httpServers[ne];if(me!=null){let be=ako(me.url),Ae=nzs(me.url),ye=be?Z.get(be):void 0,Me=ye&&ye.size>1,Ee=Me&&Ae!=="https"?`${be}_${Ae}`:be||`Http${ne+1}`;e.logger.debug(`[buildEnvironments] HTTP server: url="${me.url}", pathSegment="${be}", protocol="${Ae}", hasCollision=${Me}, urlId="${Ee}"`),Y[Ee]=me.url,e.setUrlId(me.url,Ee)}}}for(let ee of V.websocketServers){let ne=ako(ee.url),me=nzs(ee.url),be=ne?Z.get(ne):void 0,Ae=be&&be.size>1,ye=Ae?`${ne}_${me}`:izs(ee.name,ee.url,!0);e.logger.debug(`[buildEnvironments] WebSocket server: name="${ee.name}", url="${ee.url}", pathSegment="${ne}", protocol="${me}", hasCollision=${Ae}, urlId="${ye}"`),Y[ye]=ee.url,e.setUrlId(ee.url,ye)}if(Object.keys(Y).length>1)e.builder.addEnvironment({name:V.environmentName,schema:{urls:Y}});else if(Object.keys(Y).length===1){let ee=Object.values(Y)[0];ee!=null&&e.builder.addEnvironment({name:V.environmentName,schema:ee})}U&&(e.builder.setDefaultEnvironment(V.environmentName),Object.keys(Y).length>1&&e.builder.setDefaultUrl(Jyt),U=!1)}return}}if(!l&&!m&&P&&e.ir.servers.length===0){for(let[T,z]of Object.entries(d))e.builder.addEnvironment({name:T,schema:z});e.builder.setDefaultEnvironment(Object.keys(d)[0]),e.builder.setDefaultUrl(Jyt);return}if(c.length>0&&e.logger.error(`Skipping endpoint level servers ${c.map(T=>typeof T=="string"?T:T.url).join(", ")} because x-fern-server-name was not provided.`),!l){let T=e.ir.servers[0]?.url,z=e.ir.servers[0]?.audiences;if(T!=null){let U=z?{url:T,audiences:z}:T;t[Q$y]=U}}let C=Object.values(t).map(T=>typeof T=="string"?T:Vnt(T)?Object.values(T.urls)[0]:T.url),M=r.filter(T=>{let z=typeof T=="string"?T:T.url;return!C.includes(z)});if(M.length>0&&e.logger.error(`Skipping top level servers ${M.map(T=>typeof T=="string"?T:T.url).join(", ")} because x-fern-server-name was not provided.`),n){let T=!0;for(let[z,U]of Object.entries(t))if(e.builder.addEnvironment({name:z,schema:U}),T){if(e.builder.setDefaultEnvironment(z),Vnt(U)){let R=Object.keys(U.urls)[0];R&&e.builder.setDefaultUrl(R)}T=!1}return}if(!m&&!A){let T=!0;for(let[z,U]of Object.entries(t))if(T){if(P){let R=typeof U=="string"?U:Vnt(U)?Object.values(U.urls)[0]:U.url;e.builder.addEnvironment({name:z,schema:{urls:{[Jyt]:R??"",...sda(d)}}})}else e.builder.addEnvironment({name:z,schema:U});e.builder.setDefaultEnvironment(z),T=!1}else if(P){let R=typeof U=="string"?U:Vnt(U)?Object.values(U.urls)[0]:U.url;e.builder.addEnvironment({name:z,schema:{urls:{[Jyt]:R??"",...sda(d)}}})}else e.builder.addEnvironment({name:z,schema:U});P&&e.builder.setDefaultUrl(Jyt)}else if(u===1){let T=Object.keys(t)[0],z=Object.values(t)[0],U=typeof z=="string"?z:Vnt(z)?Object.values(z.urls)[0]:z.url;e.builder.addEnvironment({name:T,schema:{urls:{[Jyt]:U??"",...sda(o),...sda(d)}}}),e.builder.setDefaultEnvironment(T),e.builder.setDefaultUrl(Jyt)}else{let T=new Map;for(let z of e.ir.endpoints)for(let U of z.servers)if(U.url!=null&&U.name!=null){T.has(U.name)||T.set(U.name,new Map);let R=U.url.match(/[-]([a-z0-9]+)\./i)?.[1]?.toLowerCase()||"production",V=T.get(U.name);V&&V.set(R,U.url)}if(T.size>0){let z=!0;for(let[U,R]of Object.entries(t)){let V=typeof R=="string"?R:Vnt(R)?Object.values(R.urls)[0]:R.url;if(!V)continue;let Y=V.match(/[-]([a-z0-9]+)\./i)?.[1]?.toLowerCase()||"production",re={[Jyt]:V};for(let[Z,ee]of T.entries()){let ne=ee.get(Y)||ee.get("production")||ee.values().next().value;ne&&(re[Z]=ne)}P&&Object.assign(re,sda(d)),Object.keys(re).length>1?e.builder.addEnvironment({name:U,schema:{urls:re}}):e.builder.addEnvironment({name:U,schema:V}),z&&(e.builder.setDefaultEnvironment(U),z=!1)}T.size>0&&e.builder.setDefaultUrl(Jyt)}else{let z=!0;for(let[U,R]of Object.entries(t)){if(P||Object.keys(o).length>0){let V=typeof R=="string"?R:Vnt(R)?Object.values(R.urls)[0]:R.url;e.builder.addEnvironment({name:U,schema:{urls:{[Jyt]:V??"",...sda(o),...sda(d)}}})}else e.builder.addEnvironment({name:U,schema:R});z&&(e.builder.setDefaultEnvironment(U),z=!1)}}}}var yRf=class{schema;count=0;constructor(t){this.schema=t}increment(){this.count+=1}},KHC=.75,$HC=new Set("authorization");function U$y(e){if(e.globalHeaderOverrides!=null){for(let[r,n]of Object.entries(e.globalHeaderOverrides.headers??{}))e.builder.addGlobalHeader({name:r,schema:n});return}let t=Object.fromEntries((e.ir.globalHeaders??[]).map(r=>[r.header,r]));for(let[r,n]of Object.entries(t)){let i="optional<string>";if(n.name==null&&n.env==null&&typeof n.schema=="string")i=n.schema;else if(n!=null){let a=n.schema?$io(n.schema):void 0,o=a!=null?awi(a):void 0,c=yw.of("api.yml");i={name:n.name,env:n.env,type:n.schema!=null?t6(hC({schema:n.schema,context:e,fileContainingReference:o?cZ(yw.of(FA(o)),c):c,namespace:o,declarationDepth:0}))??"optional<string>":"optional<string>"}}e.builder.addGlobalHeader({name:r,schema:i})}if(e.detectGlobalHeaders){let r={};for(let i of e.ir.endpoints)for(let a of i.headers){if($HC.has(a.name.toLowerCase()))continue;let o=r[a.name];if(o==null){let c=t[a.name],d=cWr({header:{...a,schema:c?.schema??a.schema,name:c?.name??a.name},fileContainingReference:yw.of(vee),context:e,namespace:void 0});o=new yRf(d),r[a.name]=o}o.increment()}let n=e.ir.endpoints.length*KHC;for(let[i,a]of Object.entries(r)){let o=t[i],c=a.count===e.ir.endpoints.length,d=a.count>=n;o==null&&(c?e.builder.addGlobalHeader({name:i,schema:a.schema}):d&&e.builder.addGlobalHeader({name:i,schema:uda(a.schema)}))}}}function V$y(e){for(let t of e.ir.idempotencyHeaders??[]){let r=t.schema?$io(t.schema):void 0,n=r!=null?awi(r):void 0,i=cWr({header:{...t,schema:t.schema??i1.primitive({description:void 0,availability:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0,schema:Lq.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0})}),name:t.name??t.header,parameterNameOverride:void 0,description:void 0,availability:void 0,source:void 0},fileContainingReference:yw.of(vee),context:e,namespace:n});e.builder.addIdempotencyHeader({name:t.header,schema:uda(i)})}}function awe(e){switch(e.type){case"primitive":return H$y(e.value);case"object":return G$y(e.properties);case"array":return J$y(e.value);case"map":return XHC(e.value);case"oneOf":return ZHC(e.value);case"enum":return typeof e.value=="string"&&e.value.startsWith("$")?`\\${e.value}`:e.value;case"literal":return kHC(e.value);case"unknown":return awe(e.value);case"null":return null;default:ks(e)}}function W$y(e){switch(e.type){case"withStreaming":return e.sse?{stream:YHC(e.events)}:{stream:J$y(e.events)};case"withoutStreaming":return{body:awe(e.value)};default:ks(e)}}function H$y(e){switch(e.type){case"int":return e.value;case"int64":return e.value;case"uint":return e.value;case"uint64":return e.value;case"float":return e.value;case"double":return e.value;case"string":return e.value.startsWith("$")?`\\${e.value}`:e.value;case"datetime":try{return!e.value.endsWith("Z")&&!e.value.includes("+")&&(e.value+="Z"),new Date(e.value).toISOString().replace(/\.\d{3}Z$/,"Z")}catch{return"2024-01-15T09:30:00Z"}case"date":return e.value;case"base64":case"boolean":return e.value;default:ks(e)}}function G$y(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,awe(r)]))}function YHC(e){return e.map(t=>({event:"",data:awe(t)}))}function J$y(e){return e.map(t=>awe(t))}function XHC(e){return Object.fromEntries(e.map(t=>[H$y(t.key),awe(t.value)]))}function ZHC(e){return e.type==="discriminated"?G$y(e.value):awe(e.value)}function kHC(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:ks(e)}}function K$y({endpointExample:e,context:t}){let r={};if(e.type!=="full")return e.value;e.name!=null&&(r.name=e.name),e.description!=null&&(r.docs=e.description),e.pathParameters!=null&&e.pathParameters.length>0&&(r["path-parameters"]=eGC(e.pathParameters)),e.queryParameters!=null&&e.queryParameters.length>0&&(r["query-parameters"]=tGC(e.queryParameters));let n=e.headers!=null&&e.headers.length>0,i=t.builder.getGlobalHeaders(),a=Object.keys(i).length>0,o=new Set(e.headers?.map(c=>c.name)??[]);if(n||a){let c=[];if(e.headers!=null)for(let d of e.headers)d.name!==t.builder.getAuthHeaderName()&&c.push(d);for(let[d,s]of Object.entries(i))if(!o.has(d))if(s!=null&&typeof s=="object"&&s.type!=null){let u=Mee({type:s.type,_default:void 0,validation:void 0,visitor:{primitive:l=>l.toString(),map:l=>l.toString(),list:l=>l,optional:l=>l,nullable:l=>l,set:l=>l,named:l=>l,literal:l=>{if(l.type==="string")return l.string;if(l.type==="boolean")return l.boolean.toString()},unknown:Hc}});u!=null&&c.push({name:d,value:SS.literal(Q8i.string(u))})}else c.push({name:d,value:SS.primitive(CO.string(d))});r.headers=rGC({context:t,namedFullExamples:c})}return e.request!=null&&(r.request=awe(e.request)),e.response!=null&&(r.response=W$y(e.response)),e.codeSamples!=null&&e.codeSamples.length>0&&(r["code-samples"]=e.codeSamples.map(c=>c.type==="language"?{name:c.name??void 0,docs:c.description??void 0,language:c.language,code:c.code,install:c.install??void 0}:{name:c.name??void 0,docs:c.description??void 0,sdk:c.sdk,code:c.code}).filter(ij)),r}function eGC(e){let t={};return e.forEach(r=>{let n=awe(r.value);n!=null&&(t[r.parameterNameOverride??r.name]=n)}),t}function tGC(e){let t={};return e.forEach(r=>{let n=awe(r.value);Array.isArray(n)?t[r.name]=n[0]:n!=null&&(t[r.name]=n)}),t}function rGC({context:e,namedFullExamples:t}){let r={};return t.forEach(n=>{let i=awe(n.value);i!=null&&(r[n.name]=i)}),r}function $$y(e){return Nde._visit(e,{get:()=>hZ.HttpMethodSchema.Get,post:()=>hZ.HttpMethodSchema.Post,put:()=>hZ.HttpMethodSchema.Put,patch:()=>hZ.HttpMethodSchema.Patch,delete:()=>hZ.HttpMethodSchema.Delete,head:()=>hZ.HttpMethodSchema.Head,options:()=>{throw new Error("OPTIONS is unsupported")},trace:()=>{throw new Error("TRACE is unsupported")},_other:()=>{throw new Error("Unknown http method is unsupported")}})}function Y$y(e){return e==="POST"||e==="PUT"||e==="PATCH"}function X$y({endpoint:e,declarationFile:t,context:r}){let{nonRequestReferencedSchemas:n}=r.ir,i=[],a=new Set,o=e.path,c=azs(e.sdkName,e.namespace),d={};for(let M of e.pathParameters)M.parameterNameOverride&&(o=o.replace(M.name,M.parameterNameOverride)),d[M.parameterNameOverride??M.name]=ezs({pathParameter:M,context:r,fileContainingReference:t,namespace:c}),a.add(M.name);let s={};for(let M of e.queryParameters){let T=rzs({queryParameter:M,context:r,fileContainingReference:t,namespace:c});T!=null&&(s[M.name]=T,a.add(M.name))}let u;if(e.pagination!=null)switch(e.pagination.type){case"cursor":u={cursor:e.pagination.cursor,next_cursor:e.pagination.nextCursor,results:e.pagination.results};break;case"offset":u={offset:e.pagination.offset,step:e.pagination.step,results:e.pagination.results,"has-next-page":e.pagination.hasNextPage};break;case"custom":u={type:"custom",results:e.pagination.results};break;default:ks(e.pagination)}let l={path:o,method:$$y(e.method),auth:Object.keys(e.security).length>0?e.security:void 0,docs:e.description??void 0,pagination:u,source:e.source!=null?iwi(e.source):void 0};!oGC({context:r,request:e.request})&&Object.keys(d).length>0&&(l["path-parameters"]=d),e.summary!=null&&(l["display-name"]=e.summary);let m={},A=r.builder.getGlobalHeaderNames(),P=r.builder.getAuthHeaderName();P!=null&&A.add(P);let C=e.headers.filter(M=>!A.has(M.name));for(let M of C){let T=cWr({header:M,context:r,fileContainingReference:t,namespace:c});m[M.name]=T,a.add(typeof T=="string"?M.name:T.name??M.name)}if(e.request!=null){r.setInState(yse.Request);let M=aGC({endpoint:e,context:r,declarationFile:t,request:e.request,generatedRequestName:e.generatedRequestName,requestNameOverride:e.requestNameOverride??void 0,pathParameters:r.inlinePathParameters&&Object.keys(d).length>0?d:void 0,queryParameters:Object.keys(s).length>0?s:void 0,nonRequestReferencedSchemas:Array.from(n),headers:Object.keys(m).length>0?m:void 0,usedNames:a,namespace:c});l.request=M.value,i=[...i,...M.schemaIdsToExclude??[]],r.unsetInState(yse.Request)}else{let M=r.inlinePathParameters&&Object.keys(d).length>0,T=Object.keys(s).length>0,z=Object.keys(m).length>0,U={};(M||T||z)&&(U.name=e.requestNameOverride??e.generatedRequestName),M&&(U["path-parameters"]=d),T&&(U["query-parameters"]=s),z&&(U.headers=m),Object.keys(U).length>0&&(l.request=U)}if(e.response!=null&&e.response._visit({json:M=>{let T=hC({schema:M.schema,context:r,fileContainingReference:t,namespace:c,declarationDepth:0});l.response={docs:M.description??void 0,type:t6(T)},M.statusCode!=null&&(l.response["status-code"]=M.statusCode),M.responseProperty!=null&&(l.response.property=M.responseProperty)},streamingJson:M=>{let T=hC({schema:M.schema,context:r,fileContainingReference:t,namespace:c,declarationDepth:0});l["response-stream"]={docs:M.description??void 0,type:t6(T),format:"json"}},streamingSse:M=>{let T=hC({schema:M.schema,context:r,fileContainingReference:t,namespace:c,declarationDepth:0});l["response-stream"]={docs:M.description??void 0,type:t6(T),format:"sse"}},file:M=>{l.response={docs:M.description??void 0,type:"file","status-code":M.statusCode}},bytes:M=>{l.response={docs:M.description??void 0,type:"bytes","status-code":M.statusCode}},streamingText:M=>{l["response-stream"]={docs:M.description??void 0,type:"text"}},text:M=>{l.response={docs:M.description??void 0,type:"text","status-code":M.statusCode}},_other:()=>{throw new Error("Unrecognized Response type: "+e.response?.type)}}),r.builder.getEnvironmentType()==="multi"){let M=r.getDefaultServerName(),T=e.servers[0];T==null?M!=null&&(l.url=M):l.url=T.name??void 0}return e.idempotent&&(l.idempotent=!0),e.availability!=null&&(l.availability=uK(e.availability)),Object.entries(e.errors).forEach(([M,T])=>{let z=T.generatedName,U=yw.of(CF);r.builder.enableUniqueErrorsPerEndpoint&&(z=`${e.generatedRequestName}${T.generatedName}`,T.schema!=null&&(T.schema.type!=="reference"&&T.schema.type!=="oneOf"?T.schema.generatedName=`${e.generatedRequestName}${T.schema.generatedName}`:T.schema.type==="oneOf"&&(T.schema.value.generatedName=`${e.generatedRequestName}${T.schema.value.generatedName}`)));let R={"status-code":parseInt(M)},V=O$y({location:Z$y,namespaceOverride:c});if(T.schema!=null){let Z=hC({schema:T.schema,context:r,fileContainingReference:V,declarationFile:V,namespace:c,declarationDepth:0});R.type=t6(Z),R.docs=T.description}r.builder.addError(V,{name:z,schema:r.isErrorUnknownSchema(parseInt(M))?{...R,type:"unknown"}:R}),l.errors==null&&(l.errors=[]);let Y=r.builder.addImport({file:t,fileToImport:V});l.errors.push(Y!=null?`${Y}.${z}`:z),R.type!=null&&T.examples?.forEach(Z=>{let ee={value:awe(Z.example),name:Z.name,docs:Z.description};r.builder.addErrorExample(V,{name:z,example:ee})})}),e.examples.length>0&&(l.examples=nGC({endpointExamples:e.examples,context:r})),e.retries!=null&&(l.retries=iGC({retries:e.retries})),r.ir.hasEndpointsMarkedInternal&&(e.internal==null||!e.internal)?l.audiences=[vRf,...e.audiences]:e.audiences.length>0&&(l.audiences=e.audiences),{value:l,schemaIdsToExclude:i}}function nGC({endpointExamples:e,context:t}){return e.map(r=>{try{return K$y({endpointExample:r,context:t})}catch(n){throw console.error(`Error building endpoint example: ${n}`),n}})}function iGC({retries:e}){if(e!=null)switch(e.type){case"disabled":return{disabled:e.value??void 0};default:ks(e)}}function aGC({endpoint:e,declarationFile:t,context:r,request:n,requestNameOverride:i,generatedRequestName:a,pathParameters:o,queryParameters:c,nonRequestReferencedSchemas:d,headers:s,usedNames:u,namespace:l}){if(n.type==="json"||n.type==="formUrlEncoded"){let m=n.schema.type==="reference"?n.schema.schema:void 0,A=n.schema.type==="reference"?r.getSchema(n.schema.schema,l):n.schema;if(A?.type!=="object"||m!=null&&d.includes(m)){let z=hC({schema:n.schema,fileContainingReference:t,context:r,namespace:l,declarationDepth:0}),U={schemaIdsToExclude:[],value:{body:z}},R=Object.keys(o??{}).length>0,V=Object.keys(c??{}).length>0,Y=Object.keys(s??{}).length>0;return R&&(U.value["path-parameters"]=o),V&&(U.value["query-parameters"]=c),Y&&(U.value.headers=s),(R||V||Y)&&(U.value.name=i??a),n.contentType!=null&&(U.value["content-type"]=n.contentType),n.description!=null&&(U.value.docs=n.description),U}let P=Object.fromEntries(A.properties.filter(z=>z.readonly==null?!0:!(Y$y(e.method)&&z.readonly)).map(z=>{let U=hC({schema:z.schema,fileContainingReference:t,context:r,namespace:l,declarationDepth:1}),R=z.nameOverride??z.key,V=uK(z.availability);if(!u.has(R)&&z.audiences.length<=0)return u.add(R),z.nameOverride!=null?[z.key,{type:t6(U),docs:Yio(U),name:z.nameOverride,availability:V}]:[z.key,V?{...typeof U=="string"?{type:U}:U,availability:V}:U];let Y={type:t6(U),docs:Yio(U)};return u.has(R)&&(Y.name=z.generatedName),z.audiences.length>0&&(Y.audiences=z.audiences),V!=null&&(Y.availability=V),u.add(R),[z.key,Y]})),C=A.allOf.map(z=>{let U=hC({schema:i1.reference(z),fileContainingReference:t,context:r,namespace:l,declarationDepth:0});return t6(U)}).filter(z=>z!=="unknown"),M={properties:P};C.length>0&&(M.extends=C),n.additionalProperties&&(M["extra-properties"]=!0);let T={name:i??A.nameOverride??A.generatedName,"path-parameters":o,"query-parameters":c,headers:s,body:M};return n.contentType!=null&&(T["content-type"]=n.contentType),n.description!=null&&(T.docs=n.description),{schemaIdsToExclude:m!=null?[m]:[],value:T}}else if(n.type==="octetStream"){let m={body:"bytes","content-type":n.contentType??J8.APPLICATION_OCTET_STREAM,"query-parameters":c};return c!=null&&(m.name=i??a),n.description!=null&&(m.docs=n.description),{schemaIdsToExclude:[],value:m}}else if(n.type==="multipart"){let m=Object.fromEntries(n.properties.map(A=>{if(A.schema.type==="file"){let P=A.schema.isArray?"list<file>":"file";if(P=A.schema.isOptional?`optional<${P}>`:P,A.description!=null||A.contentType!=null){let C={type:P};if(A.description!=null&&(C.docs=A.description),A.contentType!=null){let M=A.contentType.split(",")[0];C["content-type"]=M}return[A.key,C]}return[A.key,P]}else{let P=hC({schema:A.schema.value,fileContainingReference:t,context:r,namespace:l,declarationDepth:1});if(A.contentType||A.exploded||A.encoding){let C=typeof P=="string"?{type:P}:P;A.contentType!=null&&(C["content-type"]=A.contentType),A.encoding==="form"?C.style="form":A.encoding==="json"?C.style="json":A.exploded&&(C.style="exploded"),P=C}return[A.key,P]}}));return{schemaIdsToExclude:n.name==null?[]:[n.name],value:{name:i??n.name??a,"path-parameters":o,"query-parameters":c,headers:s,body:{properties:m},"content-type":J8.MULTIPART_FORM_DATA,...n.description?{docs:n.description}:{}}}}else ks(n)}function oGC({context:e,request:t}){if(!e.inlinePathParameters)return!1;if(t==null)return!0;switch(t.type){case"octetStream":return!1;case"multipart":return!0;case"json":return!0;case"formUrlEncoded":return!0;default:ks(t)}}function uGC({location:e,namespaceOverride:t}){return t!=null?{...e,file:cZ(yw.of(t),e.file)}:e}function sGC(e){let t=e.namespace,r=e.tags.filter(d=>d!==t)[0],n=e.operationId;if(n==null)return r!=null?{file:yw.of(`${FA(r)}.yml`),endpointId:e.summary!=null?FA(e.summary):FA(`${e.method}_${e.path.split("/").join("_")}`)}:e.summary!=null?{file:yw.of(CF),endpointId:FA(e.summary)}:{file:yw.of(CF),endpointId:FA(`${e.method}_${e.path.split("/").join("_")}`)};if(r==null)return{file:yw.of(CF),endpointId:n};let i=oko(r),a=oko(n);if(xue(i,a))return{file:yw.of("__package__.yml"),endpointId:r};let o=fGC({operationId:n,tag:r,path:e.path,method:e.method});if(o!=null)return o;let c=[];for(let d=0;d<i.length;++d){let s=i[d];if(s!=null&&s===a[d])c.push(s);else{let u=FA(r);return{file:yw.of(`${u}.yml`),endpointId:n,tag:r}}}if(c.length>=a.length)throw new Error(`Cannot get file for endpoint ${JSON.stringify(e)}`);return{file:yw.of(FA(c.join("_"))+".yml"),endpointId:FA(a.slice(c.length).join("_")),tag:r}}function uko(e){let t=e.tags[0];if(e.sdkName!=null){let r=eRf({sdkName:e.sdkName,namespaceOverride:e.namespace}),n=`${r}.yml`,i=r.toLowerCase()===t?.toLowerCase().replaceAll(" ","");return{file:yw.of(n),endpointId:e.sdkName.methodName,tag:i?t:void 0}}return uGC({namespaceOverride:e.namespace,location:sGC(e)})}function oko(e){let t;return/^[a-z]+(?:[A-Z][a-z]+)*$/.test(e)?t=e.split(/(?=[A-Z])/):t=e.split(/[^a-zA-Z0-9]+/),t=t.map(r=>r.toLowerCase()),t=Hpt(t),t}var cGC=new RegExp("[^a-zA-Z0-9{}]+"),lGC=new RegExp("[{}]","g");function fGC({operationId:e,tag:t,path:r,method:n}){let a=`${r.split(cGC).join("_").replaceAll(lGC,"_")}_${n.toLowerCase()}`;if(e.endsWith(a))return{file:yw.of(FA(t)+".yml"),endpointId:FA(e.slice(0,-1*a.length)),tag:t}}function k$y(e){let t=new Set,{endpoints:r,tags:n}=e.ir,i=[];for(let a of r){let{endpointId:o,file:c,tag:d}=uko(a),s=c.split(".")[0];s!=null&&t.add(s);let u;if(a.sdkName!=null){let A=e.ir.groups;for(let P of a.sdkName.groupName){let C=typeof P=="string"?P:P.name,M=A[C];if(M==null)break;if(M.summary!=null||M.description!=null){u=A[C];break}}}let l=d==null?void 0:n.tagsById[d];e.setInState(yse.Endpoint),e.setEndpointMethod(a.method);let m=X$y({context:e,endpoint:a,declarationFile:c});e.unsetEndpointMethod(),e.unsetInState(yse.Endpoint),i=[...i,...m.schemaIdsToExclude],e.builder.addEndpoint(c,{name:o,schema:m.value,source:a.source!=null?iwi(a.source):void 0}),(l?.id!=null||l?.description!=null)&&e.builder.setServiceInfo(c,{"display-name":u?.summary??l?.id,docs:u?.description??l?.description??void 0})}return{schemaIdsToExclude:i,sdkGroups:t}}function eYy(e){for(let[t,r]of Object.entries(e.ir.variables)){let n=r.groupName!=null?awi(r.groupName):void 0,i=hC({schema:i1.primitive(r),context:e,fileContainingReference:yw.of(CF),namespace:n,declarationDepth:0});e.builder.addVariable({name:t,schema:{type:t6(i),docs:r.description??void 0}})}}function tYy(e){for(let t of e.ir.webhooks){let r=_GC({webhook:t,context:e});if(r==null)continue;let n=azs(t.sdkName,t.namespace),i={};for(let o of t.headers)i[o.name]=cWr({header:o,context:e,fileContainingReference:r.file,namespace:n});let a={audiences:t.audiences,method:t.method,"display-name":t.summary??void 0,headers:i,payload:hC({schema:t.payload,context:e,fileContainingReference:r.file,namespace:n,declarationDepth:0}),examples:t.examples!=null?t.examples.map(o=>({docs:o.description,name:o.name,payload:awe(o.payload)})):void 0};e.builder.addWebhook(r.file,{name:r.endpointId,schema:a}),t.description!=null&&(a.docs=t.description)}}function dGC({location:e,namespaceOverride:t}){if(e!=null)return t!=null?{...e,file:cZ(yw.of(t),e.file)}:e}function pGC({webhook:e,context:t}){let r=e.tags[0],n=e.operationId;if(r==null)return{file:yw.of(CF),endpointId:n};let i=oko(r),a=oko(n);if(xue(i,a))return{file:yw.of("__package__.yml"),endpointId:r};let o=[];for(let c=0;c<i.length;++c){let d=i[c];if(d!=null&&d===a[c])o.push(d);else{let s=FA(r);return{file:yw.of(`${s}.yml`),endpointId:n,tag:r}}}if(o.length>=a.length){t.logger.warn(`Skipping webhook ${e.operationId} because couldn't compute file location`);return}return{file:yw.of(FA(o.join("_"))+".yml"),endpointId:FA(a.slice(o.length).join("_")),tag:r}}function _GC({webhook:e,context:t}){return e.sdkName!=null?{file:m$y({sdkName:e.sdkName,namespaceOverride:e.namespace}),endpointId:e.sdkName.methodName}:dGC({namespaceOverride:e.namespace,location:pGC({webhook:e,context:t})})}var hGC=yw.of(CF);function nYy(e){switch(e.type){case"object":case"primitive":case"enum":case"array":case"map":case"reference":case"literal":case"optional":case"nullable":return rYy({namespace:e.namespace,groupName:e.groupName});case"oneOf":return rYy({namespace:e.value.namespace,groupName:e.value.groupName});case"unknown":return hGC;default:ks(e)}}function rYy({namespace:e,groupName:t}){return e!=null&&t!=null?X8i([{type:"namespace",name:e},...t]):e!=null?X8i([{type:"namespace",name:e}]):X8i(t)}var vRf="external",Z$y=yw.of(CF);function iYy({schemas:e,schemaIdsToExclude:t,namespace:r,context:n}){for(let[i,a]of Object.entries(e)){if(t.includes(i))continue;let o=nYy(a),c=S$y({schema:a,context:n,declarationFile:o,namespace:r,declarationDepth:0});if(V4i(c.schema)){let d=t6(c.schema);if(d===(c.name??i)||d===`optional<${c.name??i}>`||d===`nullable<${c.name??i}>`||d===`optional<nullable<${c.name??i}>>`)continue}n.builder.addType(o,{name:c.name??i,schema:c.schema})}}function aYy(e){e.ir.apiVersion!=null&&e.builder.setApiVersion(e.ir.apiVersion),L$y(e),U$y(e),V$y(e),T$y(e),eYy(e),e.ir.basePath!=null&&e.builder.setBasePath(e.ir.basePath),e.ir.hasEndpointsMarkedInternal&&e.builder.addAudience(vRf);let t=k$y(e),r=t.sdkGroups;e.setInState(yse.Webhook),tYy(e),e.unsetInState(yse.Webhook),e.setInState(yse.Channel);for(let i of Object.values(e.ir.channels)){let a=X8i(i.groupName);F$y({channel:i,context:e,declarationFile:a})}e.unsetInState(yse.Channel);let n=yGC({context:e,schemaIdsToExcludeFromServices:t.schemaIdsToExclude});iYy({schemas:e.ir.groupedSchemas.rootSchemas,schemaIdsToExclude:n,namespace:void 0,context:e});for(let[i,a]of Object.entries(e.ir.groupedSchemas.namespacedSchemas))iYy({schemas:a,schemaIdsToExclude:n,namespace:i,context:e});return e.ir.tags.orderedTagIds!=null&&e.ir.tags.orderedTagIds.length>0&&e.ir.tags.orderedTagIds.every(a=>r.has(a))&&e.builder.addNavigation({navigation:e.ir.tags.orderedTagIds}),e.builder.build()}function yGC({context:e,schemaIdsToExcludeFromServices:t}){let r=e.getReferencedSchemaIds();if(r==null)return t;let n=new Set([...Object.keys(e.ir.groupedSchemas.rootSchemas),...Object.values(e.ir.groupedSchemas.namespacedSchemas).flatMap(a=>Object.keys(a))]),i=new Set(t);for(let a of n)r.includes(a)||i.add(a);return Array.from(i)}var sko=class{context;constructor(t){this.context=t}};var ozs=class e{files={};directories={};getAllFiles(){let t={},r=(n,i)=>{for(let[o,c]of Object.entries(n.files)){let d=i!=null?yw.of(`${i}${"/"}${o}`):yw.of(o);t[d]=c}let a=Object.keys(n.directories).sort();for(let o of a){let c=i!=null?`${i}${"/"}${o}`:o,d=n.directories[o];r(d,c)}};return r(this),t}getOrCreateFile(t){return this.getOrCreateFileRecursive(t.split("/"))}getOrCreateFileRecursive(t){if(t.length===1)return this.files[yw.of(t[0])]??={};let[r,...n]=t;if(r==null)throw new Error(`Internal error; cannot add file with path: ${t}`);return this.directories[r]||(this.directories[r]=new e),this.directories[r].getOrCreateFileRecursive(n)}};var cda=class{enableUniqueErrorsPerEndpoint;root;rootApiFile;packageMarkerFile={};basePath=void 0;constructor(t){this.enableUniqueErrorsPerEndpoint=t,this.root=new ozs,this.rootApiFile={name:"api","error-discrimination":{strategy:"status-code"}}}setDisplayName({displayName:t}){this.rootApiFile["display-name"]=t}addNavigation({navigation:t}){this.packageMarkerFile.navigation=t}setServiceInfo(t,{auth:r,"base-path":n,"display-name":i,docs:a}){let o=this.getOrCreateFile(t);o.service==null&&(o.service={auth:!1,"base-path":"",endpoints:{}}),r!=null&&(o.service.auth=r),n!=null&&(o.service["base-path"]=n),i!=null&&(o.service["display-name"]=i),a!=null&&(o.docs=a)}addAudience(t){this.rootApiFile.audiences==null&&(this.rootApiFile.audiences=[]),this.rootApiFile.audiences.push(t)}setAuth(t){this.rootApiFile.auth=t}addAuthScheme({name:t,schema:r}){this.rootApiFile["auth-schemes"]==null&&(this.rootApiFile["auth-schemes"]={}),this.rootApiFile["auth-schemes"][t]==null&&(this.rootApiFile["auth-schemes"][t]=r)}setDefaultEnvironment(t){this.rootApiFile["default-environment"]=t}setDefaultUrl(t){this.rootApiFile["default-url"]=t}setBasePath(t){this.basePath=t}setApiVersion(t){this.rootApiFile.version=t}getEnvironmentType(){let t=Object.entries(this.rootApiFile.environments??{})[0];if(t!=null)return vLr(t[1],{singleBaseUrl:()=>"single",multipleBaseUrls:()=>"multi"})}addEnvironment({name:t,schema:r}){this.rootApiFile.environments==null&&(this.rootApiFile.environments={}),this.rootApiFile.environments[t]=r}getGlobalHeaderNames(){let t=Object.keys(this.rootApiFile.headers??{});if(this.rootApiFile["auth-schemes"]!=null)for(let n of Object.values(this.rootApiFile["auth-schemes"]))oYy(n)&&t.push(n.header);let r=this.getVersionHeader();return r!=null&&t.push(r),new Set(t)}getAuthHeaderName(){if(this.rootApiFile["auth-schemes"]!=null){for(let t of Object.values(this.rootApiFile["auth-schemes"]))if(oYy(t))return t.header;return"Authorization"}}addGlobalHeader({name:t,schema:r}){let n=this.getVersionHeader();n!=null&&n===t||(this.rootApiFile.headers==null&&(this.rootApiFile.headers={}),this.rootApiFile.headers[t]=r)}getGlobalHeaders(){return this.rootApiFile.headers??{}}addIdempotencyHeader({name:t,schema:r}){this.rootApiFile["idempotency-headers"]==null&&(this.rootApiFile["idempotency-headers"]={}),this.rootApiFile["idempotency-headers"][t]=r}addVariable({name:t,schema:r}){this.rootApiFile.variables==null&&(this.rootApiFile.variables={}),this.rootApiFile.variables[t]=r}addImport({file:t,fileToImport:r,alias:n}){if(t===r)return;let i=n??FA((o_t(r)+"/"+Woa(r,{stripExtension:!0})).replaceAll("__package__","root"));if(t===yw.of(vee))return this.rootApiFile.imports==null&&(this.rootApiFile.imports={}),this.rootApiFile.imports[i]=Eus(o_t(qKa.of(`/${t}`)),qKa.of(`/${r}`)),i;let a=this.getOrCreateFile(t);return a.imports==null&&(a.imports={}),a.imports[i]=Eus(o_t(qKa.of(`/${t}`)),qKa.of(`/${r}`)),i}addType(t,{name:r,schema:n}){if(t===yw.of(vee))return;let i=this.getOrCreateFile(t);i.types==null&&(i.types={}),i.types[r]=n}addTypeExample(t,r,n){let i=this.getOrCreateFile(t);i.types==null&&(i.types={});let a=i.types[r];a!=null&&(typeof a=="string"?i.types[r]={type:a,examples:[n]}:(a.examples==null&&(a.examples=[]),a.examples.push(n)))}addError(t,{name:r,schema:n}){let i=this.getOrCreateFile(t);i.errors==null&&(i.errors={}),i.errors[r]==null?i.errors[r]=n:i.errors[r]?.type!==n.type&&(i.errors[r]={"status-code":n["status-code"],type:"unknown"})}addErrorExample(t,{name:r,example:n}){let i=this.getOrCreateFile(t);if(i.errors==null)return;let a=i.errors[r];if(a==null)return;a.examples==null&&(a.examples=[]),(a.examples.some(c=>xue(c,n))??!1)||a.examples?.push(n)}addEndpoint(t,{name:r,schema:n,source:i}){let a=this.getOrCreateFile(t);a.service==null&&(a.service={auth:!1,"base-path":"",endpoints:{}}),i!=null&&(a.service.source=i),a.service.endpoints[r]=n}addWebhook(t,{name:r,schema:n}){let i=this.getOrCreateFile(t);i.webhooks==null&&(i.webhooks={}),i.webhooks[r]=n}addChannel(t,{channel:r}){let n=this.getOrCreateFile(t);n.channel=r;let i=this.basePath;i!=null&&(n.channel.path=cZ(i,r.path))}addChannelExample(t,{example:r}){let n=this.getOrCreateFile(t);n.channel==null&&(n.channel={path:"",auth:!1}),n.channel.messages==null&&(n.channel.messages={}),n.channel.examples==null&&(n.channel.examples=[]),n.channel.examples.push(r)}addChannelMessage(t,{messageId:r,message:n}){let i=this.getOrCreateFile(t);i.channel==null&&(i.channel={path:"",auth:!1}),i.channel.messages==null&&(i.channel.messages={}),i.channel.messages[r]=n}build(){let t=this.root.getAllFiles(),r=this.basePath;if(r!=null){this.packageMarkerFile.service!=null&&(this.packageMarkerFile.service={...this.packageMarkerFile.service,endpoints:Object.fromEntries(Object.entries(this.packageMarkerFile.service.endpoints).map(([i,a])=>[i,{...a,path:cZ(r,a.path)}]))});for(let i of Object.values(t))i.service!=null&&(i.service={...i.service,endpoints:Object.fromEntries(Object.entries(i.service.endpoints).map(([a,o])=>[a,{...o,path:cZ(r,o.path)}]))})}return{rootApiFile:this.rootApiFile,packageMarkerFile:this.packageMarkerFile,definitionFiles:t}}getOrCreateFile(t){return t===CF?this.packageMarkerFile:this.root.getOrCreateFile(t)}getVersionHeader(){if(this.rootApiFile.version!=null)return typeof this.rootApiFile.version.header=="string"?this.rootApiFile.version.header:this.rootApiFile.version.header.value}};function oYy(e){return e?.header!=null}var uzs=class{logger;taskContext;ir;builder;environmentOverrides;authOverrides;globalHeaderOverrides;detectGlobalHeaders;objectQueryParameters;respectReadonlySchemas;respectNullableSchemas;onlyIncludeReferencedSchemas;inlinePathParameters;useBytesForBinaryResponse;respectForwardCompatibleEnums;wrapReferencesToNullableInOptional;coerceOptionalSchemasToNullable;groupEnvironmentsByHost;enableUniqueErrorsPerEndpoint;defaultServerName=void 0;unknownSchema=new Set;referencedSchemaIds;urlIdMap=new Map;endpointMethod;state=new Set;constructor({taskContext:t,ir:r,options:n,environmentOverrides:i,globalHeaderOverrides:a,authOverrides:o}){this.logger=t.logger,this.taskContext=t,this.ir=r,this.environmentOverrides=i,this.authOverrides=o,this.globalHeaderOverrides=a,this.detectGlobalHeaders=n?.detectGlobalHeaders??!0,this.objectQueryParameters=n?.objectQueryParameters??!1,this.respectReadonlySchemas=n?.respectReadonlySchemas??!1,this.respectNullableSchemas=n?.respectNullableSchemas??!1,this.onlyIncludeReferencedSchemas=n?.onlyIncludeReferencedSchemas??!1,this.inlinePathParameters=n?.inlinePathParameters??!1,this.useBytesForBinaryResponse=n?.useBytesForBinaryResponse??!1,this.respectForwardCompatibleEnums=n?.respectForwardCompatibleEnums??!1,this.referencedSchemaIds=n?.onlyIncludeReferencedSchemas?new Set:void 0,this.enableUniqueErrorsPerEndpoint=n?.enableUniqueErrorsPerEndpoint??!1,this.wrapReferencesToNullableInOptional=n?.wrapReferencesToNullableInOptional??!0,this.coerceOptionalSchemasToNullable=n?.coerceOptionalSchemasToNullable??!0,this.groupEnvironmentsByHost=n?.groupEnvironmentsByHost??!1,this.builder=new cda(this.enableUniqueErrorsPerEndpoint),r.title!=null&&this.builder.setDisplayName({displayName:r.title});let c={};if(!this.enableUniqueErrorsPerEndpoint)for(let d of r.endpoints)for(let[s,u]of Object.entries(d.errors)){let l=parseInt(s),m=c[l];m==null&&u.schema!=null?c[l]=u.schema:m!=null&&u.schema!=null&&E3e(m,u.schema)||this.unknownSchema.add(l)}}getReferencedSchemaIds(){if(this.referencedSchemaIds!=null)return Array.from(this.referencedSchemaIds)}getSchema(t,r){return r==null?this.ir.groupedSchemas.rootSchemas[t]:this.ir.groupedSchemas.namespacedSchemas[r]?.[t]}getDefaultServerName(){return this.defaultServerName}setDefaultServerName(t){this.defaultServerName=t}setUrlId(t,r){this.urlIdMap.set(t,r)}getUrlId(t){return this.urlIdMap.get(t)}isErrorUnknownSchema(t){return this.unknownSchema.has(t)}getEndpointMethod(){return this.endpointMethod}setEndpointMethod(t){this.endpointMethod=t}unsetEndpointMethod(){this.endpointMethod=void 0}isInState(t){return this.state.has(t)}setInState(t){this.state.add(t)}unsetInState(t){this.state.delete(t)}shouldMarkSchemaAsReferenced(){return this.onlyIncludeReferencedSchemas&&this.isInAnyState(yse.Channel,yse.Endpoint,yse.Webhook)}markSchemaAsReferenced(t,r){switch(t.type){case"primitive":return;case"object":this.markObjectSchemaAsReferenced(t,r);return;case"array":this.markSchemaAsReferenced(t.value,r);return;case"map":this.markSchemaAsReferenced(t.value,r);return;case"optional":this.markSchemaAsReferenced(t.value,r);return;case"reference":this.markSchemaIdAsReferenced(t.schema,r);return;case"oneOf":this.markOneofSchemaAsReferenced(t.value,r);return;case"nullable":this.markSchemaAsReferenced(t.value,r);return;case"enum":return;case"literal":return;case"unknown":return;default:ks(t)}}markObjectSchemaAsReferenced(t,r){for(let n of t.allOf)this.markSchemaIdAsReferenced(n.schema,r);for(let n of t.properties)this.markSchemaAsReferenced(n.schema,r)}markOneofSchemaAsReferenced(t,r){switch(t.type){case"discriminated":for(let n of Object.values(t.schemas))this.markSchemaAsReferenced(n,r);return;case"undiscriminated":for(let n of t.schemas)this.markSchemaAsReferenced(n,r);return;default:ks(t)}}markSchemaIdAsReferenced(t,r){if(this.referencedSchemaIds!=null&&!this.referencedSchemaIds.has(t)){this.referencedSchemaIds.add(t);let n=this.getSchema(t,r);n!=null&&this.markSchemaAsReferenced(n,r)}}isInAnyState(...t){return t.some(r=>this.isInState(r))}};function bRf(e){let t=new uzs(e);return aYy(t)}var szs=class{args;constructor(t){this.args=t}convert({context:t,ir:r,settings:n,absoluteFilePath:i}){let a=bRf({taskContext:t,ir:r,options:YZo({overrides:{...n,respectReadonlySchemas:n?.respectReadonlySchemas??this.args.respectReadonlySchemas,respectNullableSchemas:n?.respectNullableSchemas??this.args.respectNullableSchemas,wrapReferencesToNullableInOptional:n?.wrapReferencesToNullableInOptional??this.args.wrapReferencesToNullableInOptional,coerceOptionalSchemasToNullable:n?.coerceOptionalSchemasToNullable??this.args.coerceOptionalSchemasToNullable,onlyIncludeReferencedSchemas:n?.onlyIncludeReferencedSchemas??this.args.onlyIncludeReferencedSchemas,inlinePathParameters:n?.inlinePathParameters??this.args.inlinePathParameters,objectQueryParameters:n?.objectQueryParameters??this.args.objectQueryParameters,useBytesForBinaryResponse:n?.useBytesForBinaryResponse??this.args.useBytesForBinaryResponse,respectForwardCompatibleEnums:n?.respectForwardCompatibleEnums??this.args.respectForwardCompatibleEnums,groupEnvironmentsByHost:n?.groupEnvironmentsByHost??this.args.groupEnvironmentsByHost}}),authOverrides:n?.auth!=null?{auth:n.auth}:this.args.generatorsConfiguration?.api?.auth!=null?{...this.args.generatorsConfiguration.api}:void 0,environmentOverrides:this.args.generatorsConfiguration?.api?.environments!=null?{...this.args.generatorsConfiguration?.api}:void 0,globalHeaderOverrides:this.args.generatorsConfiguration?.api?.headers!=null?{...this.args.generatorsConfiguration?.api}:void 0});return{absoluteFilePath:i??this.args.absoluteFilePath,rootApiFile:{defaultUrl:a.rootApiFile["default-url"],contents:a.rootApiFile,rawContents:Jg.dump(a.rootApiFile)},namedDefinitionFiles:{...Pg(a.definitionFiles,o=>({absoluteFilepath:i??this.args.absoluteFilePath,rawContents:Jg.dump(o),contents:o})),[yw.of(CF)]:{absoluteFilepath:i??this.args.absoluteFilePath,rawContents:Jg.dump(a.packageMarkerFile),contents:a.packageMarkerFile}},packageMarkers:{},importedDefinitions:{}}}};var cko=class extends cRr{inlinePathParameters;objectQueryParameters;onlyIncludeReferencedSchemas;respectReadonlySchemas;respectNullableSchemas;wrapReferencesToNullableInOptional;coerceOptionalSchemasToNullable;exampleGeneration;useBytesForBinaryResponse;respectForwardCompatibleEnums;inlineAllOfSchemas;resolveAliases;groupEnvironmentsByHost;converter;constructor(t){super(t),this.inlinePathParameters=t.inlinePathParameters,this.objectQueryParameters=t.objectQueryParameters,this.onlyIncludeReferencedSchemas=t.onlyIncludeReferencedSchemas,this.respectReadonlySchemas=t.respectReadonlySchemas,this.respectNullableSchemas=t.respectNullableSchemas,this.wrapReferencesToNullableInOptional=t.wrapReferencesToNullableInOptional,this.coerceOptionalSchemasToNullable=t.coerceOptionalSchemasToNullable,this.exampleGeneration=t.exampleGeneration,this.useBytesForBinaryResponse=t.useBytesForBinaryResponse,this.respectForwardCompatibleEnums=t.respectForwardCompatibleEnums,this.inlineAllOfSchemas=t.inlineAllOfSchemas,this.resolveAliases=t.resolveAliases,this.groupEnvironmentsByHost=t.groupEnvironmentsByHost,this.converter=new szs(t)}async getDefinition({context:t,absoluteFilePath:r,relativePathToDependency:n},i){let a=await this.getOpenAPIIr({context:t,relativePathToDependency:n},i);return this.converter.convert({context:t,ir:a,settings:i,absoluteFilePath:r})}async toFernWorkspace({context:t},r){let n=await this.getDefinition({context:t},r);return new jit({absoluteFilePath:this.absoluteFilePath,workspaceName:this.workspaceName,generatorsConfiguration:this.generatorsConfiguration,dependenciesConfiguration:{dependencies:{}},definition:n,cliVersion:this.cliVersion})}};var xbe={BEARER_FORMAT:"x-bearer-format",ENUM_VAR_NAMES:"x-enum-varnames",INTERNAL:"x-internal",EXAMPLES:"x-examples",TAGS:"x-tags",REDOCLY_CODE_SAMPLES_KEBAB:"x-code-samples",REDOCLY_CODE_SAMPLES_CAMEL:"x-codeSamples"};var Xio={of(e){return e}};var uYy={properties:{"stream-condition":{type:"string"},response:"Schema","response-stream":"Schema"},required:["stream-condition","response","response-stream"],extensionsPrefix:"x-"},gRf={id:"",typeExtension:{oas3:e=>({...e,XFernStreaming:uYy,Operation:{...e.Operation,properties:{...e.Operation?.properties,"x-fern-streaming":"XFernStreaming"}}})}},pb={SOURCE:Xio.of("source"),SDK_NAMESPACE:Xio.of("x-fern-sdk-namespace"),SDK_METHOD_NAME:Xio.of("x-fern-sdk-method-name"),SDK_GROUP_NAME:Xio.of("x-fern-sdk-group-name"),REQUEST_NAME_V1:"x-request-name",REQUEST_NAME_V2:"x-fern-request-name",TYPE_NAME:"x-fern-type-name",BOOLEAN_LITERAL:"x-fern-boolean-literal",SERVER_NAME_V1:"x-name",SERVER_NAME_V2:"x-fern-server-name",BASE_PATH:"x-fern-base-path",GROUPS:Xio.of("x-fern-groups"),OPENAPI_OVERIDES_FILEPATH:"x-fern-overrides-filepath",TYPE_DEFINITION:"x-fern-type",STREAMING:"x-fern-streaming",PAGINATION:"x-fern-pagination",WEBHOOK:"x-fern-webhook",ASYNC_CONFIG:"x-fern-async-config",RETRIES:"x-fern-retries",SDK_VARIABLES:"x-fern-sdk-variables",SDK_VARIABLE:"x-fern-sdk-variable",PARAMETER_NAME:"x-fern-parameter-name",BASIC_AUTH_USERNAME_VARIABLE_NAME:"x-fern-username-variable-name",BASIC_AUTH_PASSWORD_VARIABLE_NAME:"x-fern-password-variable-name",BEARER_TOKEN_VARIABLE_NAME:"x-fern-token-variable-name",HEADER_VARIABLE_NAME:"x-fern-header-variable-name",FERN_ENUM:"x-fern-enum",AUDIENCES:"x-fern-audiences",IGNORE:"x-fern-ignore",AVAILABILITY:"x-fern-availability",RESPONSE_PROPERTY:"x-fern-sdk-return-value",RESOLUTIONS:"x-fern-resolutions",EXAMPLES:"x-fern-examples",FERN_BEARER_TOKEN:"x-fern-bearer",FERN_HEADER_AUTH:"x-fern-header",FERN_BASIC_AUTH:"x-fern-basic",FERN_GLOBAL_HEADERS:"x-fern-global-headers",FERN_IDEMPOTENCY_HEADERS:"x-fern-idempotency-headers",IDEMPOTENT:"x-fern-idempotent",FERN_PROPERTY_NAME:"x-fern-property-name",IS_UNDISCRIMINATED:"x-fern-undiscriminated",FERN_VERSION:"x-fern-version",ENCODING:"x-fern-encoding",TRANSPORT:"x-fern-transport",IS_DISCRIMINATED:"x-fern-discriminated"};var IU={disableExamples:!1,discriminatedUnionV2:!1,useTitlesAsName:!0,audiences:void 0,optionalAdditionalProperties:!0,coerceEnumsToLiterals:!0,respectReadonlySchemas:!1,respectNullableSchemas:!1,onlyIncludeReferencedSchemas:!1,inlinePathParameters:!1,preserveSchemaIds:!1,objectQueryParameters:!1,shouldUseUndiscriminatedUnionsWithLiterals:!1,shouldUseIdiomaticRequestNames:!1,filter:void 0,asyncApiNaming:"v1",exampleGeneration:void 0,defaultFormParameterEncoding:"json",useBytesForBinaryResponse:!1,respectForwardCompatibleEnums:!1,additionalPropertiesDefaultsTo:!1,typeDatesAsStrings:!0,preserveSingleSchemaOneOf:!1,inlineAllOfSchemas:!1,resolveAliases:!1,groupMultiApiEnvironments:!1,groupEnvironmentsByHost:!1,wrapReferencesToNullableInOptional:!0,coerceOptionalSchemasToNullable:!0};function Kyt({options:e,overrides:t}){return{disableExamples:t?.disableExamples??IU.disableExamples,discriminatedUnionV2:t?.discriminatedUnionV2??e?.discriminatedUnionV2??IU.discriminatedUnionV2,useTitlesAsName:t?.useTitlesAsName??e?.useTitlesAsName??IU.useTitlesAsName,audiences:t?.audiences??e?.audiences??IU.audiences,optionalAdditionalProperties:t?.optionalAdditionalProperties??e?.optionalAdditionalProperties??IU.optionalAdditionalProperties,coerceEnumsToLiterals:t?.coerceEnumsToLiterals??e?.coerceEnumsToLiterals??IU.coerceEnumsToLiterals,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??IU.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??IU.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??IU.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??IU.inlinePathParameters,preserveSchemaIds:t?.preserveSchemaIds??IU.preserveSchemaIds,shouldUseUndiscriminatedUnionsWithLiterals:t?.shouldUseUndiscriminatedUnionsWithLiterals??e?.shouldUseUndiscriminatedUnionsWithLiterals??IU.shouldUseUndiscriminatedUnionsWithLiterals,shouldUseIdiomaticRequestNames:t?.shouldUseIdiomaticRequestNames??e?.shouldUseIdiomaticRequestNames??IU.shouldUseIdiomaticRequestNames,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??IU.objectQueryParameters,filter:t?.filter??e?.filter??IU.filter,asyncApiNaming:t?.asyncApiNaming??e?.asyncApiNaming??IU.asyncApiNaming,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??IU.useBytesForBinaryResponse,exampleGeneration:t?.exampleGeneration??e?.exampleGeneration??void 0,defaultFormParameterEncoding:t?.defaultFormParameterEncoding??e?.defaultFormParameterEncoding??void 0,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??IU.respectForwardCompatibleEnums,additionalPropertiesDefaultsTo:t?.additionalPropertiesDefaultsTo??e?.additionalPropertiesDefaultsTo??IU.additionalPropertiesDefaultsTo,typeDatesAsStrings:t?.typeDatesAsStrings??e?.typeDatesAsStrings??IU.typeDatesAsStrings,preserveSingleSchemaOneOf:t?.preserveSingleSchemaOneOf??e?.preserveSingleSchemaOneOf??IU.preserveSingleSchemaOneOf,inlineAllOfSchemas:t?.inlineAllOfSchemas??e?.inlineAllOfSchemas??IU.inlineAllOfSchemas,resolveAliases:t?.resolveAliases??e?.resolveAliases??IU.resolveAliases,groupMultiApiEnvironments:t?.groupMultiApiEnvironments??e?.groupMultiApiEnvironments??IU.groupMultiApiEnvironments,groupEnvironmentsByHost:t?.groupEnvironmentsByHost??e?.groupEnvironmentsByHost??IU.groupEnvironmentsByHost,wrapReferencesToNullableInOptional:t?.wrapReferencesToNullableInOptional??e?.wrapReferencesToNullableInOptional??IU.wrapReferencesToNullableInOptional,coerceOptionalSchemasToNullable:t?.coerceOptionalSchemasToNullable??e?.coerceOptionalSchemasToNullable??IU.coerceOptionalSchemasToNullable}}var sYy={naming:"v1"};function ev(e,t){let r=Array.isArray(t)?t:[t];for(let n of r){let i=e[n];if(i!=null)return i}}function lko(e,t,r,n,i=[]){try{let a=ev(e,t);if(a!=null)return r.parse(a)}catch{let o=Hpt(i).join(" -> ");n.error(`${o.length>0?`${o}: `:""}Failed to parse ${t}`)}}function lda(e){let t=ev(e,"examples");if(t!=null){if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null)return Object.values(t).map(r=>typeof r=="object"&&r!==null&&"value"in r?r.value:r)}return[]}function cYy({schema:e,logger:t}){return ev(e,pb.ENCODING)??void 0}function lYy(e){return ev(e,pb.FERN_ENUM)}function fYy({nameOverride:e,generatedName:t,title:r,schema:n,description:i,availability:a}){let o=ev(n,pb.SDK_NAMESPACE),c=ev(n,pb.SDK_GROUP_NAME),d=ev(n,pb.TYPE_DEFINITION);if(d!=null)return fko({fernType:d,nameOverride:e,generatedName:t,title:r,description:i,availability:a,namespace:o,groupName:typeof c=="string"?[c]:c})}function fko({fernType:e,nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c}){return Mee({type:e,_default:void 0,validation:void 0,visitor:{primitive:d=>{switch(d.v1){case"BASE_64":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.base64({example:void 0})});case"BOOLEAN":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.boolean({default:void 0,example:void 0})});case"DATE":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.date({example:void 0})});case"DATE_TIME":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.datetime({example:void 0})});case"FLOAT":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.float({example:void 0})});case"DOUBLE":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.double({default:void 0,minimum:void 0,maximum:void 0,exclusiveMinimum:void 0,exclusiveMaximum:void 0,multipleOf:void 0,example:void 0})});case"UINT":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.uint({default:void 0,example:void 0})});case"INTEGER":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.int({default:void 0,minimum:void 0,maximum:void 0,exclusiveMinimum:void 0,exclusiveMaximum:void 0,multipleOf:void 0,example:void 0})});case"UINT_64":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.uint64({default:void 0,example:void 0})});case"LONG":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.int64({default:void 0,example:void 0})});case"STRING":case"UUID":case"BIG_INTEGER":return Sh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,schema:G0.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})});default:ks(d.v1)}},unknown:()=>Sh.unknown({nameOverride:t,generatedName:r,title:n,example:void 0,description:i,availability:a,namespace:o,groupName:c}),map:({keyType:d,valueType:s})=>d?.type==="primitive"&&s!=null?Sh.map({nameOverride:t,generatedName:r,title:n,key:d,value:s,description:i,availability:a,namespace:o,groupName:c,encoding:void 0,example:void 0,inline:void 0}):void 0,list:d=>d!=null?Sh.array({nameOverride:t,generatedName:r,title:n,value:d,description:i,availability:a,namespace:o,groupName:c,example:void 0,inline:void 0}):void 0,optional:d=>d!=null?Sh.optional({nameOverride:t,generatedName:r,title:n,value:d,description:i,availability:a,namespace:o,groupName:c,inline:void 0}):void 0,nullable:d=>d!=null?Sh.nullable({nameOverride:t,generatedName:r,title:n,value:d,description:i,availability:a,namespace:o,groupName:c,inline:void 0}):void 0,set:d=>d!=null?Sh.array({nameOverride:t,generatedName:r,title:n,value:d,description:i,availability:a,namespace:o,groupName:c,example:void 0,inline:void 0}):void 0,literal:d=>Sh.literal({nameOverride:t,generatedName:r,title:n,value:d._visit({string:s=>eW.string(s),boolean:s=>eW.boolean(s),_other:()=>{throw new Error("Unexpected literal type")}}),description:i,availability:a,namespace:o,groupName:c}),named:d=>Sh.reference({schema:d,nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:o,groupName:c,source:nwe.openapi({file:"<memory>"})})}})}function dYy(e){let t=ev(e,pb.SOURCE);if(t!=null)return t.endsWith(".proto")?nwe.protobuf({file:t}):nwe.openapi({file:t})}function fda(e){if(e!=null&&typeof e=="boolean")return e}function Kg(e){return e?.$ref!=null}function pYy({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,additionalProperties:i,description:a,availability:o,wrapAsOptional:c,wrapAsNullable:d,context:s,namespace:u,groupName:l,example:m,encoding:A,source:P}){return i===void 0&&(i=s.options.additionalPropertiesDefaultsTo),mRf({nameOverride:e,generatedName:t,title:r,wrapAsOptional:c,wrapAsNullable:d,description:a,availability:o,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:G0.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:void 0}),namespace:void 0,groupName:void 0},valueSchema:typeof i=="boolean"||dko(i,s.options)?Sh.unknown({...vGC(i),generatedName:`${t}Value`}):_Yy(CS(i,!1,s.options.optionalAdditionalProperties?d:!1,s,[...n,"Value"],P,u,void 0,void 0,void 0)),namespace:u,groupName:l,example:m,encoding:A})}function _Yy(e){switch(e.type){case"array":case"enum":case"map":case"object":e.inline=!0;break;case"literal":case"primitive":case"reference":case"unknown":break;case"nullable":case"optional":e.inline=!0,e.value=_Yy(e.value);break;case"oneOf":e.value.inline=!0;break;default:ks(e)}return e}function mRf({nameOverride:e,generatedName:t,title:r,keySchema:n,valueSchema:i,wrapAsOptional:a,wrapAsNullable:o,description:c,availability:d,namespace:s,groupName:u,example:l,encoding:m}){let A=Sh.map({nameOverride:e,generatedName:t,title:r,description:c,availability:d,key:n,value:i,namespace:s,groupName:u,encoding:m,example:l,inline:void 0});return o&&(A=Sh.nullable({nameOverride:e,generatedName:t,title:r,value:A,description:c,availability:d,namespace:s,groupName:u,inline:void 0})),a&&(A=Sh.optional({nameOverride:e,generatedName:t,title:r,value:A,description:c,availability:d,namespace:s,groupName:u,inline:void 0})),A}function dko(e,t){return e==null?t.additionalPropertiesDefaultsTo:typeof e=="boolean"?e:!(Kg(e)||"type"in e&&e.type!=null||"oneOf"in e&&e.oneOf!=null||"anyOf"in e&&e.anyOf!=null||"allOf"in e&&e.allOf!=null||"enum"in e&&e.enum!=null)}function vGC(e){let t={nameOverride:void 0,generatedName:"",title:void 0,description:void 0,availability:void 0,example:void 0,namespace:void 0,groupName:void 0};return e==null||typeof e=="boolean"||Kg(e)||typeof e!="object"||(e.title!=null&&(t.title=e.title),e.description!=null&&(t.description=e.description)),t}function hYy({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,item:i,description:a,availability:o,wrapAsOptional:c,wrapAsNullable:d,context:s,namespace:u,groupName:l,example:m,source:A}){let P=i==null?Sh.unknown({nameOverride:e,generatedName:t,title:r,description:void 0,availability:void 0,example:void 0,namespace:u,groupName:l}):CS(i,!1,!1,s,[...n,"Item"],A,u);return bGC({nameOverride:e,generatedName:t,title:r,namespace:u,groupName:l,itemSchema:P,wrapAsOptional:c,wrapAsNullable:d,description:a,availability:o,example:m})}function bGC({nameOverride:e,generatedName:t,title:r,itemSchema:n,wrapAsOptional:i,wrapAsNullable:a,description:o,availability:c,namespace:d,groupName:s,example:u}){let l=Sh.array({nameOverride:e,generatedName:t,title:r,value:n,description:o,availability:c,namespace:d,groupName:s,example:u,inline:void 0});return a&&(l=Sh.nullable({nameOverride:e,generatedName:t,title:r,value:l,description:o,availability:c,namespace:d,groupName:s,inline:void 0})),i&&(l=Sh.optional({nameOverride:e,generatedName:t,title:r,value:l,description:o,availability:c,namespace:d,groupName:s,inline:void 0})),l}function owe(e){switch(ev(e,pb.AVAILABILITY)){case"deprecated":return qde.Deprecated;case"beta":return qde.Beta;case"generally-available":return qde.GenerallyAvailable;default:break}if(!Kg(e)&&e.deprecated)return qde.Deprecated}function ORf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,availability:o,required:c,wrapAsOptional:d,wrapAsNullable:s,discriminator:u,context:l,namespace:m,groupName:A,encoding:P,source:C}){let M=u.propertyName,T=Object.fromEntries(Object.entries(u.mapping??{}).map(([U,R])=>{let V=owi({$ref:R},!1,!1,l,[R],P,C,m);return l.markReferencedByDiscriminatedUnion({$ref:R},M,1),[U,V]})),z=Object.entries(i).filter(([U])=>U!==M).map(([U,R])=>{let V=c!=null&&c.includes(U),[Y,re]=l.options.coerceOptionalSchemasToNullable?[!1,!V]:[!V,!1],Z=CS(R,Y,re,l,[...n,U],C,m);return{key:U,schema:Z}});return yYy({nameOverride:e,generatedName:t,title:r,wrapAsOptional:d,wrapAsNullable:s,properties:z,description:a,availability:o,discriminant:M,subtypes:T,namespace:m,groupName:A,source:C})}function ARf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,availability:o,required:c,wrapAsOptional:d,wrapAsNullable:s,discriminant:u,variants:l,context:m,namespace:A,groupName:P,encoding:C,source:M}){let T=Object.fromEntries(Object.entries(l).map(([U,R])=>{if(Kg(R)){let V=owi(R,!1,!1,m,[R.$ref],C,M,A);return m.markReferencedByDiscriminatedUnion(R,u,1),[U,V]}else{let V=Zio(R,!1,!1,m,[...n,U],C,M,A,new Set([u]));return[U,V]}})),z=Object.entries(i).filter(([U])=>U!==u).map(([U,R])=>{let V=c!=null&&c.includes(U),[Y,re]=m.options.coerceOptionalSchemasToNullable?[!1,!V]:[!V,!1],Z=CS(R,Y,re,m,[...n,U],M,A);return{key:U,schema:Z}});return yYy({nameOverride:e,generatedName:t,title:r,wrapAsOptional:d,wrapAsNullable:s,properties:z,description:a,availability:o,discriminant:u,subtypes:T,namespace:A,groupName:P,source:M})}function yYy({nameOverride:e,generatedName:t,title:r,wrapAsOptional:n,wrapAsNullable:i,properties:a,description:o,availability:c,discriminant:d,subtypes:s,namespace:u,groupName:l,source:m}){let A=Sh.oneOf(Sit.discriminated({description:o,availability:c,discriminantProperty:d,nameOverride:e,generatedName:t,title:r,schemas:s,commonProperties:a,namespace:u,groupName:l,encoding:void 0,source:m,inline:void 0}));return i&&(A=Sh.nullable({nameOverride:e,generatedName:t,title:r,value:A,namespace:u,groupName:l,description:o,availability:c,inline:void 0})),n&&(A=Sh.optional({nameOverride:e,generatedName:t,title:r,value:A,namespace:u,groupName:l,description:o,availability:c,inline:void 0})),A}function vYy(e){if(e.proto!=null)return yio.protobuf({typeName:e.proto.type})}function k8i({nameOverride:e,generatedName:t,title:r,fernEnum:n,enumVarNames:i,enumValues:a,_default:o,description:c,availability:d,wrapAsOptional:s,wrapAsNullable:u,namespace:l,groupName:m,context:A,source:P,inline:C}){let M=mGC(i??[]),T=new Set(a),z=Array.from(T).map((R,V)=>{let Y=n?.[R],re=M[V],Z=Jio.test(R),ee=Y?.name??re,ne=Z?R:Kio(R);return ee!=null&&!Jio.test(ee)&&(A?.logger.warn(`Enum name override ${ee} is not a valid name. Falling back on ${ne}.`),ee=void 0),{nameOverride:ee,generatedName:ne,value:R,description:Y?.description,availability:d,casing:{snake:Y?.casing?.snake??void 0,pascal:Y?.casing?.pascal??void 0,screamingSnake:Y?.casing?.screamingSnake??void 0,camel:Y?.casing?.camel??void 0}}}),U=o!=null?z.find(R=>R.value===o):void 0;return gGC({wrapAsOptional:s,wrapAsNullable:u,nameOverride:e,generatedName:t,title:r,values:z,_default:U,description:c,availability:d,namespace:l,groupName:m,source:P,inline:C})}function gGC({wrapAsOptional:e,wrapAsNullable:t,nameOverride:r,generatedName:n,title:i,values:a,_default:o,description:c,availability:d,namespace:s,groupName:u,source:l,inline:m}){let A=Sh.enum({nameOverride:r,generatedName:n,title:i,values:a,description:c,availability:d,default:o,example:void 0,namespace:s,groupName:u,source:l,inline:m});return t&&(A=Sh.nullable({nameOverride:r,generatedName:n,title:i,value:A,description:c,availability:d,namespace:s,groupName:u,inline:m})),e&&(A=Sh.optional({nameOverride:r,generatedName:n,title:i,value:A,description:c,availability:d,namespace:s,groupName:u,inline:m})),A}function mGC(e){if(e.length<=1||e[0]==null)return e;let t=e[0],r=0;for(;t[r]!=null&&e.every(n=>n[r]===t[r]);)r++;return e.map(n=>n.substring(r))}function bYy({nameOverride:e,generatedName:t,title:r,format:n,_default:i,minimum:a,maximum:o,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:s,description:u,availability:l,wrapAsOptional:m,wrapAsNullable:A,example:P,namespace:C,groupName:M}){return n==="int64"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.int64({default:i,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="uint32"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.uint({default:i,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="uint64"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.uint64({default:i,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):vse({nameOverride:e,generatedName:t,title:r,primitive:G0.int({default:i,minimum:a,maximum:o,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:s,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M})}function OGC(e){return typeof e=="string"?eW.string(e):typeof e=="boolean"?eW.boolean(e):eW.string(`${e}`)}function gYy({nameOverride:e,generatedName:t,title:r,wrapAsOptional:n,wrapAsNullable:i,value:a,description:o,availability:c,namespace:d,groupName:s}){let u=Sh.literal({nameOverride:e,generatedName:t,title:r,value:OGC(a),description:o,availability:c,namespace:d,groupName:s});return i&&(u=Sh.nullable({nameOverride:e,generatedName:t,title:r,value:u,description:o,availability:c,namespace:d,groupName:s,inline:void 0})),n&&(u=Sh.optional({nameOverride:e,generatedName:t,title:r,value:u,description:o,availability:c,namespace:d,groupName:s,inline:void 0})),u}function PRf({nameOverride:e,generatedName:t,title:r,format:n,_default:i,minimum:a,maximum:o,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:s,description:u,availability:l,wrapAsOptional:m,wrapAsNullable:A,example:P,namespace:C,groupName:M}){return n==null||n==="double"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.double({default:i,minimum:a,maximum:o,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:s,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="float"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.float({example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="int32"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.int({default:i,minimum:a,maximum:o,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:s,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="int64"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.int64({default:i,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="uint32"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.uint({default:i,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="uint64"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.uint64({default:i,example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):n==="time-delta"?vse({nameOverride:e,generatedName:t,title:r,primitive:G0.float({example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M}):vse({nameOverride:e,generatedName:t,title:r,primitive:G0.float({example:P}),wrapAsOptional:m,wrapAsNullable:A,description:u,availability:l,namespace:C,groupName:M})}var AGC={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="schemas",applyStrategy:e=>{let t=[e[3]??""];return{refUnderProcessing:e.slice(4),newBreadcrumbs:t}}},PGC={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="responses",applyStrategy:e=>{let t=[e[3]??""];return e=e.slice(4),{refUnderProcessing:e.slice(4),newBreadcrumbs:t}}},wGC={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="parameters",applyStrategy:e=>{let t=[e[3]??""];return e=e.slice(4),e[0]==="schema"&&(e=e.slice(1)),{refUnderProcessing:e,newBreadcrumbs:t}}},jGC={isApplicable:e=>e[0]==="properties",applyStrategy:e=>{let t=[e[1]??""];return{refUnderProcessing:e.slice(2),newBreadcrumbs:t}}},EGC={isApplicable:e=>e[0]==="items",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},SGC={isApplicable:e=>e[0]==="allOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},DGC={isApplicable:e=>e[0]==="anyOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},CGC={isApplicable:e=>e[0]==="oneOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})};function pko(e){let t=e.split("/").map(a=>a.replace(/~1/g,"/")),r=[],n=[AGC,PGC,wGC,jGC,EGC,SGC,DGC,CGC],i;do{i=t;for(let a of n)if(a.isApplicable(t)){let{refUnderProcessing:o,newBreadcrumbs:c}=a.applyStrategy(t);t=o,r=[...r,...c]}}while(t.join("")!==i.join(""));return r}function Cie(e,t){let n=e.map(i=>/^[^a-zA-Z0-9]+$/.test(i)?i:bU(FA(i))).join("");return/^\d/.test(n)?rko(n)??n:n}function mYy(e){let t=e.join("_");return FA(t)}function k6(e){switch(e.type){case"object":return i1.object({allOf:e.allOf,properties:e.properties.map(t=>MGC(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source,inline:e.inline});case"array":return i1.array({description:e.description,availability:e.availability,value:k6(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"enum":return i1.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,values:e.values,default:e.default,namespace:e.namespace,groupName:e.groupName,source:e.source,inline:e.inline});case"literal":return i1.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"nullable":return i1.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:k6(e.value),namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"optional":return i1.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:k6(e.value),namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"primitive":return i1.primitive({description:e.description,availability:e.availability,schema:OYy(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"map":return i1.map({description:e.description,availability:e.availability,key:i1.primitive({description:e.key.description,availability:e.key.availability,schema:OYy(e.key.schema),generatedName:e.key.generatedName,title:e.key.title,nameOverride:e.key.nameOverride,namespace:e.namespace,groupName:e.groupName}),value:k6(e.value),generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,inline:e.inline});case"reference":return i1.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schema:e.schema,namespace:e.namespace,groupName:e.groupName,source:e.source});case"oneOf":return i1.oneOf(IGC(e.value));case"unknown":return i1.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName});default:ks(e)}}function IGC(e){switch(e.type){case"discriminated":return iWr.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:k6(t.schema)})),description:e.description,availability:e.availability,discriminantProperty:e.discriminantProperty,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schemas:Object.fromEntries(Object.entries(e.schemas).map(([t,r])=>[t,k6(r)])),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:e.inline});case"undiscriminated":return iWr.undiscriminated({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schemas:e.schemas.map(t=>k6(t)),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:e.inline});default:ks(e)}}function OYy(e){switch(e.type){case"string":return Lq.string(e);case"base64":return Lq.base64();case"boolean":return Lq.boolean(e);case"date":return Lq.date();case"datetime":return Lq.datetime();case"double":return Lq.double(e);case"float":return Lq.float();case"int":return Lq.int(e);case"int64":return Lq.int64(e);case"uint":return Lq.uint();case"uint64":return Lq.uint64();default:ks(e)}}function MGC(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:k6(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability,readonly:e.readonly,writeonly:e.writeonly}}function czs(e,t){return E3e(k6(e),k6(t))}function AYy({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,required:o,wrapAsOptional:c,wrapAsNullable:d,allOf:s,context:u,propertiesToExclude:l,namespace:m,groupName:A,fullExamples:P,additionalProperties:C,availability:M,source:T}){let z=[...o??[]],U={...i},R=[],V=[];for(let ne of s)if(!u.options.inlineAllOfSchemas&&Kg(ne)){let me=u.resolveSchemaReference(ne);if(me.discriminator!=null&&me.discriminator.mapping!=null)continue;if(me.oneOf!=null||me.anyOf!=null){let Ae=me.oneOf??me.anyOf;if(Ae!=null){for(let ye of Ae){let Me=Kg(ye)?u.resolveSchemaReference(ye):ye,Be=CS(Me,!1,!1,u.DUMMY,n,T,m);Be.type==="object"&&R.push(...Be.properties.map(Ee=>Ee.schema.type!=="optional"&&Ee.schema.type!=="nullable"?{...Ee,schema:Sh.optional({nameOverride:void 0,generatedName:"",title:void 0,value:Ee.schema,description:void 0,availability:Ee.availability,namespace:void 0,groupName:void 0,inline:void 0})}:Ee))}continue}}let be=e2i(ne);if(be==null)continue;V.push({schemaId:be,convertedSchema:wRf(ne,[be],T,u.options.preserveSchemaIds),properties:PYy({schema:ne,context:u,breadcrumbs:n,source:T,namespace:m})}),u.markSchemaAsReferencedByNonRequest(be)}else if(Kg(ne)){let me=u.resolveSchemaReference(ne),be=CS(me,!1,!1,u,n,T,m);be.type==="object"&&R.push(...be.properties)}else{let me=ne.required??[];R=R.map(Ae=>(Ae.schema.type==="optional"||Ae.schema.type==="nullable")&&me.includes(Ae.key)?{...Ae,schema:Ae.schema.value}:Ae);let be=CS(ne,!1,!1,u,n,T,m);be.type==="object"&&R.push(...be.properties)}let Y={};for(let ne of V)for(let[me,be]of Object.entries(ne.properties)){let Ae=Y[me];Ae!=null?(Ae.schemaIds.push(ne.schemaId),Ae.schemas.some(Me=>czs(Me,be))||Ae.schemas.push(be)):Y[me]={schemaIds:[ne.schemaId],schemas:[be]}}let re=[];for(let[ne,me]of Object.entries(Y))me.schemaIds.length>1&&re.push({propertyKey:ne,allOfSchemaIds:me.schemaIds,conflictingTypeSignatures:me.schemas.length>1});let Z=Object.fromEntries(Object.entries(U).filter(([ne,me])=>!(!Kg(me)&&me.type==="null"))),ee=Object.entries(Z).map(([ne,me])=>{let be=ev(me,pb.AUDIENCES)??[],Ae=owe(me),ye=Kg(me)?!1:me.readOnly,Me=Kg(me)?!1:me.writeOnly,Ee=!(z.includes(ne)&&!ye),St=ev(me,pb.FERN_PROPERTY_NAME),vt=[...n,ne],xe=mYy(vt),Ie=CS(me,Ee,!1,u,vt,T,m),Ut={};for(let et of V){let kt=et.properties[ne];kt!=null&&!czs(Ie,kt)?Ut[et.schemaId]={differentSchema:!0}:kt!=null&&(Ut[et.schemaId]={differentSchema:!1})}return{key:ne,schema:Ie,nameOverride:St,audiences:be,conflict:Ut,generatedName:xe,availability:Ae,readonly:ye,writeonly:Me}});return ee.push(...R.map(ne=>{let me=ne.conflict;for(let be of V){let Ae=be.properties[ne.key];Ae!=null&&!czs(ne.schema,Ae)?me[be.schemaId]={differentSchema:!0}:Ae!=null&&(me[be.schemaId]={differentSchema:!1})}return{...ne,conflict:me}})),BGC({nameOverride:e,generatedName:t,title:r,wrapAsOptional:c,wrapAsNullable:d,properties:ee.filter(ne=>!l.has(ne.key)),description:a,allOf:V.map(ne=>ne.convertedSchema),allOfPropertyConflicts:re,namespace:m,groupName:A,fullExamples:P,additionalProperties:C,availability:M,source:T,context:u})}function BGC({nameOverride:e,generatedName:t,title:r,wrapAsOptional:n,wrapAsNullable:i,properties:a,description:o,allOf:c,allOfPropertyConflicts:d,namespace:s,groupName:u,fullExamples:l,additionalProperties:m,availability:A,source:P,context:C}){let M=Sh.object({description:o,properties:a,nameOverride:e,generatedName:t,title:r,allOf:c,allOfPropertyConflicts:d,namespace:s,groupName:u,fullExamples:l,additionalProperties:dko(m,C.options),availability:A,source:P,inline:void 0});return i&&(M=Sh.nullable({nameOverride:e,generatedName:t,title:r,value:M,description:o,availability:A,namespace:s,groupName:u,inline:void 0})),n&&(M=Sh.optional({nameOverride:e,generatedName:t,title:r,value:M,description:o,availability:A,namespace:s,groupName:u,inline:void 0})),M}function PYy({schema:e,context:t,breadcrumbs:r,source:n,namespace:i}){let a={},[o,c]=Kg(e)?[t.resolveSchemaReference(e),pko(e.$ref)]:[e,r];for(let d of o.allOf??[])a={...a,...PYy({schema:d,context:t,breadcrumbs:c,source:n,namespace:i})};for(let[d,s]of Object.entries(o.properties??{})){let u=CS(s,!1,!1,t,[...c,d],n,i);a[d]=u}return a}function t2i({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,description:i,availability:a,wrapAsOptional:o,wrapAsNullable:c,context:d,subtypes:s,namespace:u,groupName:l,encoding:m,source:A,subtypePrefixOverrides:P}){let C=RGC({schemas:s}),M=s.flatMap((z,U)=>{if(!Kg(z)&&z.enum!=null&&d.options.coerceEnumsToLiterals&&z.type==="string")return z.enum.map(V=>Sh.literal({nameOverride:void 0,generatedName:Cie([t,V],d.options.preserveSchemaIds),title:void 0,value:eW.string(String(V)),namespace:u,groupName:void 0,description:void 0,availability:V.availability}));let R=C[U];if(P!=null){let V=P[U];V!=null&&"name"in V&&(R=V.name)}return[CS(z,!1,!1,d,[...n,R??`${U}`],A,u)]}),T=TGC(M);return qGC({uniqueSubtypes:T,nameOverride:e,generatedName:t,title:r,wrapAsOptional:o,wrapAsNullable:c,description:i,availability:a,namespace:u,groupName:l,context:d,encoding:m,source:A})}function TGC(e){let t=[];for(let r=0;r<e.length;++r){let n=e[r],i=!1;for(let a=r+1;a<e.length;++a){let o=e[a];if(n!=null&&o!=null&&E3e(n,o)){i=!0;break}}n!=null&&!i&&t.push(n)}return t}function qGC({uniqueSubtypes:e,nameOverride:t,generatedName:r,title:n,wrapAsOptional:i,wrapAsNullable:a,description:o,availability:c,namespace:d,groupName:s,context:u,encoding:l,source:m}){if(Object.entries(e).every(([P,C])=>C.type==="literal")){let P={},C=[];return Object.entries(e).forEach(([M,T])=>{T.type==="literal"&&T.value.type==="string"&&(C.push(T.value.value),T.description!=null&&(P[T.value.value]={description:T.description}))}),k8i({nameOverride:t,generatedName:r,title:n,wrapAsOptional:i,wrapAsNullable:a,description:o,availability:c,fernEnum:P,enumVarNames:void 0,enumValues:C,_default:void 0,namespace:d,groupName:s,context:u,source:m,inline:void 0})}if(e.length===1&&e[0]!=null&&!u.options.preserveSingleSchemaOneOf){let P=e[0];return a&&(P=Sh.nullable({nameOverride:t,generatedName:r,title:n,value:P,description:o,availability:c,namespace:d,groupName:s,inline:void 0})),i&&(P=Sh.optional({nameOverride:t,generatedName:r,title:n,value:P,description:o,availability:c,namespace:d,groupName:s,inline:void 0})),P}return wYy({nameOverride:t,generatedName:r,title:n,wrapAsOptional:i,wrapAsNullable:a,description:o,availability:c,subtypes:e,namespace:d,groupName:s,encoding:l,source:m})}function jRf({nameOverride:e,generatedName:t,title:r,description:n,availability:i,wrapAsOptional:a,wrapAsNullable:o,context:c,namespace:d,groupName:s,discriminator:u,encoding:l,source:m}){let A=Object.entries(u.mapping??{}).map(([M,T],z)=>{let U={$ref:T},R=owi(U,!1,!1,c,[T],l,m,d);return c.markSchemaWithDiscriminantValue(U,u.propertyName,M),R.type==="object"&&(R.properties={[u.propertyName]:Sh.literal({nameOverride:void 0,generatedName:Cie([t,M],c.options.preserveSchemaIds),title:void 0,value:eW.string(M),namespace:void 0,groupName:void 0,description:void 0,availability:void 0}),...R.properties.filter(V=>V.key!==u.propertyName)}),R}),P=[];for(let M=0;M<A.length;++M){let T=A[M],z=!1;for(let U=M+1;U<A.length;++U){let R=A[U];if(T!=null&&R!=null&&E3e(T,R)){z=!0;break}}T!=null&&!z&&P.push(T)}if(Object.entries(P).every(([M,T])=>T.type==="literal")){let M={},T=[];return Object.entries(P).forEach(([z,U])=>{U.type==="literal"&&U.value.type==="string"&&(T.push(U.value.value),U.description!=null&&(M[U.value.value]={description:U.description}))}),k8i({nameOverride:e,generatedName:t,title:r,wrapAsOptional:a,wrapAsNullable:o,description:n,availability:i,fernEnum:M,enumVarNames:void 0,enumValues:T,_default:void 0,namespace:d,groupName:s,context:c,source:m,inline:void 0})}return P.length===1&&P[0]!=null&&!c.options.preserveSingleSchemaOneOf?P[0]:wYy({nameOverride:e,generatedName:t,title:r,wrapAsOptional:a,wrapAsNullable:o,description:n,availability:i,subtypes:P,namespace:d,groupName:s,encoding:l,source:m})}function RGC({schemas:e}){let t={},r=0;for(let a of e){if(!Kg(a)){if(a.properties!=null&&Object.entries(a.properties).length>0){let o=Object.keys(a.properties),c={},d=o;for(let[s,u]of Object.entries(t)){let l=_ns(u,o);d=_ns(d,u),c[s]=l}c[r]=d,t=c}}r++}let n=[],i=0;for(let a of e){let o=t[i];if(o!=null&&o.length>0){let c=o.sort();if(c[0]!=null){n.push(c[0]),++i;continue}}Kg(a)?n.push(Y8i(i)??`${i}`):a.type==="array"||a.type==="boolean"||a.type==="integer"||a.type==="number"||a.type==="string"?n.push(""):n.push(Y8i(i)??`${i}`),++i}return n}function wYy({nameOverride:e,generatedName:t,title:r,wrapAsOptional:n,wrapAsNullable:i,description:a,availability:o,subtypes:c,namespace:d,groupName:s,encoding:u,source:l}){let m=Sh.oneOf(Sit.undiscriminated({description:a,availability:o,nameOverride:e,generatedName:t,title:r,schemas:c,namespace:d,groupName:s,encoding:u,source:l,inline:void 0}));return i&&(m=Sh.nullable({nameOverride:e,generatedName:t,title:r,value:m,description:a,availability:o,namespace:d,groupName:s,inline:void 0})),n&&(m=Sh.optional({nameOverride:e,generatedName:t,title:r,value:m,description:a,availability:o,namespace:d,groupName:s,inline:void 0})),m}function kio(e){if(e.default!=null&&typeof e.default=="string")return e.default}function lzs({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="number")return e.example;let n=lda(e);for(let i of n??[])if(typeof i=="number")return i;if(r&&typeof r=="number")return r}function jYy({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="boolean")return e.example;let n=lda(e);for(let i of n??[])if(typeof i=="boolean")return i;if(r&&typeof r=="boolean")return r}function lWr({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="string")return e.example;let n=lda(e);for(let i of n??[])if(typeof i=="string")return i;if(r&&typeof r=="string")return r}function EYy({schema:e,logger:t,fallback:r}){if(e.example!=null&&Array.isArray(e.example))return e.example;let n=lda(e);for(let i of n??[])if(Array.isArray(i))return i;if(r&&Array.isArray(r))return r}var dda="#/components/schemas/";function CYy(e,t){let r=Kg(e)?t.resolveSchemaReference(e):e;switch(r.type){case"boolean":case"number":case"string":case"integer":return!0;case"array":return CYy(r.items,t);case"object":return!1;case void 0:return!1;default:return t.logger.warn("Unhandled schema type. Will not inline this schema",JSON.stringify(r)),!1}}function NGC(e,t,r){return r.options.resolveAliases?typeof r.options.resolveAliases=="object"&&r.options.resolveAliases.except?.includes(e)?!1:CYy(t,r):!1}function CS(e,t,r,n,i,a,o,c=!1,d=new Set,s){let u=dYy(e)??a,l=WGC({schema:e,logger:n.logger});if(Kg(e)){let m=e2i(e);return m!=null?NGC(m,e,n)?Zio(n.resolveSchemaReference(e),t,r,n,pko(e.$ref),l,u,o,d,c,s):(c?n.markSchemaAsReferencedByRequest(m):n.markSchemaAsReferencedByNonRequest(m),owi(e,t,r,n,i,l,u,o)):Zio(n.resolveSchemaReference(e),t,r,n,pko(e.$ref),l,u,o,d,c,s)}return Zio(e,t,r,n,i,l,u,o,d,c,s)}function owi(e,t,r,n,i,a,o,c){let d=e.$ref.includes("properties")?Zio(n.resolveSchemaReference(e),t,r,n,i,a,o,c,new Set):Sh.reference(wRf(e,i,o,n.options.preserveSchemaIds));if(r===!1){let s=n.resolveSchemaReference(e);(s.nullable===!0||Array.isArray(s.type)&&s.type.length>=2&&s.type.includes("null"))&&(r=!0)}return r&&(d=Sh.nullable({title:void 0,nameOverride:void 0,generatedName:Cie(i,n.options.preserveSchemaIds),value:d,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,inline:void 0})),t&&(d=Sh.optional({title:void 0,nameOverride:void 0,generatedName:Cie(i,n.options.preserveSchemaIds),value:d,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,inline:void 0})),d}function FGC(e){if(e!=null&&!e.includes(" ")&&/^[a-zA-Z]+$/.test(e))return e}function Zio(e,t,r,n,i,a,o,c,d=new Set,s=!1,u){typeof e=="string"&&(e={type:e});let l=ev(e,pb.TYPE_NAME)??(n.options.useTitlesAsName?FGC(e.title):void 0),m=ev(e,pb.SDK_GROUP_NAME)??ev(e,xbe.TAGS)?.[0],A=(typeof m=="string"?[m]:m)??[];A=n.resolveGroupName(A);let P=Cie(i,n.options.preserveSchemaIds),C=e.title,M=e.description,T=owe(e),z=[];e.example!=null&&z.push({name:void 0,value:e.example,description:void 0});let U=ev(e,xbe.EXAMPLES);U!=null&&Object.keys(U).length>0&&z.push(...Object.entries(U).map(([Y,re])=>({name:re?.summary??Y,value:re.value,description:re.description})));let R=lda(e);R!=null&&Object.keys(R).length>0&&z.push(...R.map(Y=>({name:void 0,value:Y,description:void 0})));let V=fYy({schema:e,description:M,title:C,nameOverride:l,generatedName:P,availability:T});if(V!=null){let Y=V;return r&&(Y=Sh.nullable({availability:T,namespace:c,groupName:A,description:M,generatedName:P,inline:void 0,nameOverride:l,title:C,value:Y})),t&&(Y=Sh.optional({availability:T,namespace:c,groupName:A,description:M,generatedName:P,inline:void 0,nameOverride:l,title:C,value:Y})),Y}try{if(Array.isArray(e.type)){let Z=e.type.indexOf("null"),ee=Z!==-1;if(e.type.length===1)e.type=e.type[0];else if(e.type.length===2&&ee)e.type.splice(Z,1),e.type=e.type[0],e.nullable=!0;else if(ee&&(e.type.splice(Z,1),e.nullable=!0),e.oneOf==null)e.oneOf=[...new Set(e.type)];else{let ne=new Set([...e.oneOf,...e.type]);e.oneOf=[...ne]}}if(r=r||e.nullable===!0,"const"in e&&(e.enum=[e.const]),e.enum!=null&&(e.type==="string"||e.type==null||e.type==="enum")){if(e.enum=e.enum.filter(ee=>ee!==null),!pzs(e.enum))return vse({nameOverride:l,generatedName:P,title:C,primitive:G0.string({default:kio(e),minLength:e.minLength,maxLength:e.maxLength,pattern:e.pattern,format:e.format,example:lWr({schema:e,logger:n.logger,fallback:u})}),namespace:c,groupName:A,wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T});let Z=lYy(e);return e.enum.length===1&&e.enum[0]!=null&&Z==null?gYy({nameOverride:l,generatedName:P,title:C,wrapAsOptional:t,wrapAsNullable:r,value:e.enum[0],description:M,availability:T,namespace:c,groupName:A}):k8i({nameOverride:l,generatedName:P,title:C,fernEnum:Z,enumVarNames:ev(e,[xbe.ENUM_VAR_NAMES]),enumValues:e.enum,_default:e.default,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,namespace:c,groupName:A,context:n,source:o,inline:void 0})}if(pzs(e.type)&&e.type.length>1){let Z=e.type.includes("null"),ee=e.type.filter(ne=>ne!=="null").map(ne=>({type:ne,nullable:Z}));return t2i({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,subtypes:ee,namespace:c,groupName:A,encoding:a,source:o})}if(e.type==="boolean"){let Z=ev(e,pb.BOOLEAN_LITERAL);return Z!=null?SYy({nameOverride:l,generatedName:P,title:C,literal:eW.boolean(Z),wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T,namespace:c,groupName:A}):vse({nameOverride:l,generatedName:P,title:C,primitive:G0.boolean({default:xGC(e.default),example:jYy({schema:e,logger:n.logger,fallback:u})}),wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T,namespace:c,groupName:A})}if(e.type==="number")return PRf({nameOverride:l,generatedName:P,title:C,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:fda(e.exclusiveMinimum),exclusiveMaximum:fda(e.exclusiveMaximum),multipleOf:e.multipleOf,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,example:lzs({schema:e,logger:n.logger,fallback:u}),namespace:c,groupName:A});if(e.type==="integer")return bYy({nameOverride:l,generatedName:P,title:C,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:fda(e.exclusiveMinimum),exclusiveMaximum:fda(e.exclusiveMaximum),multipleOf:e.multipleOf,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,example:lzs({schema:e,logger:n.logger,fallback:u}),namespace:c,groupName:A});if(e.type==="float")return PRf({nameOverride:l,generatedName:P,title:C,format:"float",_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:fda(e.exclusiveMinimum),exclusiveMaximum:fda(e.exclusiveMaximum),multipleOf:e.multipleOf,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,example:lzs({schema:e,logger:n.logger,fallback:u}),namespace:c,groupName:A});if(e.type==="string"){if(e.format==="date-time")return vse({nameOverride:l,generatedName:P,title:C,primitive:G0.datetime({example:lWr({schema:e,logger:n.logger,fallback:u})}),wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T,namespace:c,groupName:A});if(e.format==="date"&&n.options.typeDatesAsStrings===!1)return vse({nameOverride:l,generatedName:P,title:C,primitive:G0.date({example:lWr({schema:e,logger:n.logger,fallback:u})}),wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T,namespace:c,groupName:A});if(e.format==="json-string"){let ee=Sh.unknown({nameOverride:l,generatedName:P,title:C,description:M,availability:T,namespace:c,groupName:A,example:void 0});return r&&(ee=Sh.nullable({availability:T,namespace:c,groupName:A,description:M,generatedName:P,inline:void 0,nameOverride:l,title:C,value:ee})),t&&(ee=Sh.optional({availability:T,namespace:c,groupName:A,description:M,generatedName:P,inline:void 0,nameOverride:l,title:C,value:ee})),ee}let Z=MYy(e,"const");return Z!=null?SYy({nameOverride:l,generatedName:P,title:C,literal:eW.string(Z),wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T,namespace:c,groupName:A}):vse({nameOverride:l,generatedName:P,title:C,primitive:G0.string({default:kio(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:lWr({schema:e,logger:n.logger,fallback:u})}),namespace:c,groupName:A,wrapAsOptional:t,wrapAsNullable:r,description:M,availability:T})}if(e.type==="array")return hYy({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,item:e.items,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,namespace:c,groupName:A,example:EYy({schema:e,logger:n.logger,fallback:u}),source:o});if(e.additionalProperties!=null&&e.additionalProperties!==!1&&fzs(e))return pYy({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,additionalProperties:e.additionalProperties,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,namespace:c,groupName:A,encoding:a,example:e.example,source:o});if(e.oneOf!=null&&e.oneOf.length>0&&ev(e,pb.IS_DISCRIMINATED)===!1)return t2i({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,subtypes:e.oneOf,namespace:c,groupName:A,encoding:a,source:o});if(e.type==="object"&&e.discriminator!=null&&e.discriminator.mapping!=null)return n.options.discriminatedUnionV2?jRf({nameOverride:l,generatedName:P,title:C,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,namespace:c,groupName:A,discriminator:e.discriminator,encoding:a,source:o}):ORf({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsOptional:t,wrapAsNullable:r,context:n,namespace:c,groupName:A,encoding:a,source:o});if(e.oneOf!=null&&e.oneOf.length>0){let Z=ev(e,pb.IS_UNDISCRIMINATED);if(e.discriminator!=null&&e.discriminator.mapping!=null&&Object.keys(e.discriminator.mapping).length>0)return n.options.discriminatedUnionV2||Z?jRf({nameOverride:l,generatedName:P,title:C,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,namespace:c,groupName:A,discriminator:e.discriminator,encoding:a,source:o}):ORf({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsOptional:t,wrapAsNullable:r,context:n,namespace:c,groupName:A,encoding:a,source:o});if(e.oneOf.length===1&&e.oneOf[0]!=null){if(n.options.preserveSingleSchemaOneOf)return t2i({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,context:n,subtypes:e.oneOf.filter(ne=>Kg(ne)||ne.type!=="null"),encoding:a,namespace:c,groupName:A,source:o});let ee=CS(e.oneOf[0],t,r,n,i,o,c,s);return eao(ee,M,c,A)}else if(e.oneOf.length>1){if(e.oneOf.length===2&&e.oneOf[0]!=null&&e.oneOf[1]!=null){let be=e.oneOf[0],Ae=e.oneOf[1];if(!Kg(be)&&be.type==="null")return CS(Ae,!1,!0,n,i,o,c);if(!Kg(Ae)&&Ae.type==="null")return CS(be,!1,!0,n,i,o,c)}let ee=LGC({schemas:e.oneOf});if(ee!=null)return k8i({nameOverride:l,generatedName:P,title:C,fernEnum:void 0,enumVarNames:void 0,enumValues:ee,_default:e.default,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,namespace:c,groupName:A,context:n,source:o,inline:void 0});let ne=DYy({schemas:e.oneOf,context:n});if(ne!=null&&!n.options.discriminatedUnionV2&&!Z)return ARf({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,properties:e.properties??{},required:e.required,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,discriminant:ne.discriminant,variants:ne.schemas,context:n,namespace:c,groupName:A,encoding:a,source:o});let me=e.oneOf.filter(be=>!Kg(be)&&be.type==="null").length>0;return t2i({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r||me,context:n,subtypes:e.oneOf.filter(be=>Kg(be)||be.type!=="null"),encoding:a,namespace:c,groupName:A,source:o})}}if(e.anyOf!=null&&e.anyOf.length>0){if(e.anyOf.length===1&&e.anyOf[0]!=null){let ne=CS(e.anyOf[0],t,r,n,i,o,c,s);return eao(ne,M,c,A)}if(e.anyOf.length===2){let[ne,me]=e.anyOf;if(ne!=null&&me!=null){if(!Kg(ne)&&ne.type==="null"){let be=CS(me,!1,!0,n,i,o,c);return eao(be,M,c,A)}else if(!Kg(me)&&me.type==="null"){let be=CS(ne,!1,!0,n,i,o,c);return eao(be,M,c,A)}}}let Z=DYy({schemas:e.anyOf,context:n});if(Z!=null&&!n.options.discriminatedUnionV2)return ARf({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,properties:e.properties??{},required:e.required,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,discriminant:Z.discriminant,variants:Z.schemas,context:n,namespace:c,groupName:A,encoding:a,source:o});let ee=e.anyOf.filter(ne=>!Kg(ne)&&ne.type==="null").length>0;return t2i({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r||ee,context:n,subtypes:e.anyOf.filter(ne=>Kg(ne)||ne.type!=="null"),encoding:a,namespace:c,groupName:A,source:o})}if(e.allOf!=null||e.properties!=null){let Z=[];for(let ne of e.allOf??[])(Kg(ne)||Object.keys(ne).length>0)&&Z.push(ne);if((e.properties==null||fzs(e))&&Z.length===1&&Z[0]!=null){let ne=CS(Z[0],t,r,n,i,o,c,s);return eao(ne,M,c,A)}let ee=Z.filter(ne=>{let me=dzs(ne);return me||n.logger.warn(`Skipping non-object allOf element: ${JSON.stringify(ne)}`),me});if((e.properties==null||fzs(e))&&ee.length===1&&ee[0]!=null){let ne=CS(ee[0],t,r,n,i,o,c,s);return eao(ne,M,c,A)}return AYy({nameOverride:l,generatedName:P,title:C,breadcrumbs:i,properties:e.properties??{},description:M,required:e.required,wrapAsOptional:t,wrapAsNullable:r,allOf:ee,context:n,propertiesToExclude:d,namespace:c,groupName:A,fullExamples:z,additionalProperties:e.additionalProperties,availability:T,encoding:a,source:o})}if(e.type==="object"&&zGC(e)&&QGC(e)&&fzs(e))return mRf({nameOverride:l,generatedName:P,title:C,description:M,availability:T,wrapAsOptional:t,wrapAsNullable:r,keySchema:{nameOverride:void 0,generatedName:`${P}Key`,title:void 0,description:void 0,availability:void 0,schema:G0.string({default:kio(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:lWr({schema:e,logger:n.logger,fallback:u})}),namespace:c,groupName:A},valueSchema:Sh.unknown({nameOverride:void 0,generatedName:`${P}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,namespace:c,groupName:A}),namespace:c,groupName:A,encoding:a,example:e.example});e.type!=null&&n.logger.warn(`Failed to parse an OpenAPI schema at the following location: ${i.join("->")}. Coercing to unknown.`);let Y=e.example??e.default,re=Sh.unknown({nameOverride:l,generatedName:P,title:C,description:M,availability:T,namespace:c,groupName:A,example:Y});return r&&(re=Sh.nullable({availability:T,namespace:c,groupName:A,description:M,generatedName:P,inline:void 0,nameOverride:l,title:C,value:re})),t&&(re=Sh.optional({availability:T,namespace:c,groupName:A,description:M,generatedName:P,inline:void 0,nameOverride:l,title:C,value:re})),re}catch(Y){return n.logger.debug(`Error converting schema: ${Y.message}
|
|
2407
|
-
Location: ${i.join("-> ")}`),Sh.unknown({nameOverride:l,generatedName:P,title:C,description:M,availability:T,namespace:c,groupName:A,example:void 0})}}function xGC(e){if(e!=null){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase();if(t==="true")return!0;if(t==="false")return!1}}}function e2i(e){if(e.$ref.startsWith(dda))return e.$ref.replace(dda,"")}function wRf(e,t,r,n){let i=ev(e,pb.TYPE_NAME),a=Cie(t,n),o=e.description,c=owe(e),d=e2i(e);if(d==null)throw new Error(`Invalid schema reference ${JSON.stringify(e)}`);return i1.reference({generatedName:a,nameOverride:i,title:void 0,schema:d,description:o??void 0,availability:c,namespace:void 0,groupName:void 0,source:r})}function zGC(e){return e.oneOf==null||e.oneOf.length===0}function QGC(e){return e.allOf==null||e.allOf.length===0}function fzs(e){return e.properties==null||K8(e.properties)===0}function pzs(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function eao(e,t,r,n){return e.type==="reference"?Sh.reference({...e,description:t,availability:e.availability,namespace:r,groupName:n}):e.type==="optional"?Sh.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,namespace:r,groupName:n,inline:void 0}):e.type==="nullable"?Sh.nullable({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,namespace:r,groupName:n,inline:void 0}):e}function dzs(e){return Kg(e)||e.type==="object"||e.properties!=null?!0:e.allOf!=null?e.allOf.every(t=>dzs(t)):e.oneOf!=null?e.oneOf.every(t=>dzs(t)):e.anyOf!=null?e.anyOf.every(t=>dzs(t)):!1}function SYy({literal:e,wrapAsOptional:t,wrapAsNullable:r,namespace:n,groupName:i,description:a,availability:o,nameOverride:c,generatedName:d,title:s}){let u=Sh.literal({nameOverride:c,generatedName:d,title:s,value:e,namespace:n,groupName:i,description:a,availability:o});return r&&(u=Sh.nullable({nameOverride:c,generatedName:d,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),t&&(u=Sh.optional({nameOverride:c,generatedName:d,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),u}function vse({primitive:e,wrapAsOptional:t,wrapAsNullable:r,namespace:n,groupName:i,description:a,availability:o,generatedName:c,nameOverride:d,title:s}){i=typeof i=="string"?[i]:i;let u=Sh.primitive({nameOverride:d,generatedName:c,title:s,schema:e,description:a,availability:o,namespace:n,groupName:i});return r&&(u=Sh.nullable({nameOverride:d,generatedName:c,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),t&&(u=Sh.optional({nameOverride:d,generatedName:c,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),u}function LGC({schemas:e}){let t=new Set;for(let r of e){if(Kg(r))return;if(r.enum!=null&&pzs(r.enum))r.enum.forEach(n=>t.add(n));else return}return Array.from(t)}function DYy({schemas:e,context:t}){let r={};for(let n of e){let i=IYy({schema:n,context:t});for(let[a,o]of Object.entries(i)){let c=r[a];c!=null?c[o]=n:r[a]={[o]:n}}}for(let[n,i]of Object.entries(r))if(Object.keys(i).length===e.length)return{discriminant:n,schemas:i}}function IYy({schema:e,context:t}){let r=Kg(e)?t.resolveSchemaReference(e):e;return UGC({schema:r,context:t})}function UGC({schema:e,context:t}){let r={};if(e.anyOf!=null){for(let n of e.anyOf){let i=IYy({schema:n,context:t});for(let[a,o]of Object.entries(i??{}))r[a]=o}return r}for(let[n,i]of Object.entries(e.properties??{})){let a=Kg(i)?t.resolveSchemaReference(i):i;a.type==="string"&&a.enum!=null&&pzs(a.enum)&&VGC(a.enum).length===1&&a.enum[0]!=null&&(r[n]=a.enum[0]);let o=MYy(a,"const");a.type==="string"&&o!=null&&(r[n]=o),n==="type"&&a.example!=null&&(r[n]=a.example)}return r}function VGC(e){if(!e)return[];let t=new Set;return e.forEach(r=>{typeof r=="string"?t.add(r.toLowerCase()):t.add(r)}),Array.from(t)}function MYy(e,t){let r=e[t];if(r!=null)return r}function WGC({schema:e,logger:t}){let r=cYy({schema:e,logger:t});if(r!=null)return vYy(r)}var tao=class{document;taskContext;logger;DUMMY;options;namespace;static MESSAGE_REFERENCE_PREFIX="#/components/messages/";constructor({document:t,taskContext:r,options:n,namespace:i}){this.document=t,this.taskContext=r,this.logger=r.logger,this.DUMMY=this,this.options=n,this.namespace=i}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveTags(t,r){if(this.namespace==null&&t==null&&r!=null)return[r];let n=[];if(this.namespace!=null){let i={type:"namespace",name:this.namespace};n.push(i)}return n.concat(t??[])}resolveSchemaReference(t){if(!t.$ref.startsWith(dda))throw new Error(`Failed to resolve schema reference: ${t.$ref}`);let n=t.$ref.substring(dda.length).split("/"),i=this.document.components;if(i==null||i.schemas==null)throw new Error("Document does not have components.schemas.");let[a,o,c]=n;if(a==null||a==="")throw new Error(`${t.$ref} cannot be resolved. No schema key provided.`);let d=i.schemas[a];if(d==null)throw new Error(`Schema "${a}" is undefined in document.components.schemas.`);if(Kg(d)&&(d=this.resolveSchemaReference(d)),o==="properties"&&c!=null){let s=d.properties?.[c];if(s==null)throw new Error(`Property "${c}" not found on "${a}". Full ref: ${t.$ref}`);Kg(s)?d=this.resolveSchemaReference(s):d=s}return d}referenceExists(t){let r=t.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return!1;n=n[i]}return!0}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}markReferencedByDiscriminatedUnion(t,r,n){}markSchemaWithDiscriminantValue(t,r,n){}};var _zs=class extends tao{getExampleMessageReference(t){return`#/components/messages/${t.messageId}`}resolveMessageReference(t){let r="#/components/messages/",n=this.document.components;if(n==null||n.messages==null||!t.$ref.startsWith(r))throw new Error(`Failed to resolve message reference: ${t.$ref} in v2 components`);let i=t.$ref.substring(r.length),a=n.messages[i];if(a==null)throw new Error(`${t.$ref} is undefined`);return a}};function rao(e,t){let r={};if(e!=null)return{rootSchemas:r,namespacedSchemas:{[e]:t}};let n={};for(let[i,a]of Object.entries(t))switch(a.type){case"object":case"array":case"map":case"optional":case"enum":case"literal":case"reference":case"nullable":case"primitive":{if(a.namespace==null){r[i]=a;continue}let o=a.namespace;n[o]??={},n[o][i]=a;continue}case"oneOf":case"unknown":r[i]=a;continue;default:ks(a)}return{rootSchemas:r,namespacedSchemas:n}}function r2i(e){if(typeof e=="string")return SS.primitive(CO.string(e));if(typeof e=="number")return Number.isInteger(e)?SS.primitive(CO.int(e)):SS.primitive(CO.double(e));if(typeof e=="boolean")return SS.primitive(CO.boolean(e));if(Array.isArray(e)){let t=e.map(r=>r2i(r));return t.length===0?void 0:SS.array(t.filter(r=>r!=null))}else if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string")){let t=[];for(let[r,n]of Object.entries(e)){let i=r2i(n);i!=null&&t.push({key:CO.string(r),value:i})}return SS.map(t)}}function _ko(e){if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string"))return e}function BYy(e){if(e!=null&&Array.isArray(e))return e}var n2i=class{schemas;nonRequestReferencedSchemas;context;constructor(t,r,n){this.schemas=t,this.nonRequestReferencedSchemas=r,this.context=n}buildExample({schema:t,exampleId:r,example:n,options:i,skipReadonly:a}){return this.buildExampleHelper({schema:t,visitedSchemaIds:new Set,exampleId:r,example:n,options:{...i,maxCheckerDepth:i.maxCheckerDepth??5},depth:0,skipReadonly:a??!1})}buildExampleHelper({exampleId:t,example:r,schema:n,depth:i,visitedSchemaIds:a,options:o,skipReadonly:c}){switch(n.type){case"enum":return typeof r=="string"&&TYy({schema:n,value:r})?SS.enum(r):n.values[0]!=null?SS.enum(n.values[0]?.value):void 0;case"literal":return SS.literal(n.value);case"nullable":{if(r==null&&!this.hasExample(n.value,0,a,o)&&this.exceedsMaxDepth(i,o))return SS.null({});let d=this.buildExampleHelper({schema:n.value,visitedSchemaIds:a,exampleId:t,example:r,depth:i,options:o,skipReadonly:c});return d??SS.null({})}case"optional":{if(r==null&&!this.hasExample(n.value,0,a,o)&&(o.ignoreOptionals||this.exceedsMaxDepth(i,o))||Object.is(r,null))return;let d=this.buildExampleHelper({schema:n.value,visitedSchemaIds:a,exampleId:t,example:r,depth:i,options:o,skipReadonly:c});return d!=null&&d.type==="array"&&d.value.length===0||d!=null&&d.type==="map"&&d.value.length===0||d!=null&&d.type==="object"&&Object.keys(d.properties).length===0?void 0:d}case"primitive":{let d=this.buildExampleFromPrimitive({schema:n.schema,example:r,options:o});return SS.primitive(d)}case"reference":{let d=this.schemas[n.schema];if(d!=null&&!a.has(n.schema)){a.add(n.schema);let s=d?.type==="object"&&!this.nonRequestReferencedSchemas.has(n.schema),u=this.buildExampleHelper({example:r,schema:d,exampleId:t,visitedSchemaIds:a,depth:i,options:o,skipReadonly:s||this.context.options.respectReadonlySchemas?c:!1});return a.delete(n.schema),u}return}case"oneOf":switch(n.value.type){case"discriminated":{let d={},s={},u={},l=_ko(r),m=l?.[n.value.discriminantProperty],A=n.value.schemas[m],P=[],C=this.getDiscriminatedUnionVariantSchema(n.value,l);C!=null&&P.push(C),P.push(...Object.entries(n.value.schemas));for(let M of P)if(m!=null&&A!=null&&A.type==="object"){s=this.getAllProperties(A),u=this.getAllRequiredProperties(A),d[n.value.discriminantProperty]=SS.primitive(CO.string(m));break}else{let T=this.buildExampleHelper({exampleId:t,schema:M[1],example:void 0,visitedSchemaIds:a,depth:i,options:o,skipReadonly:c});if(T!=null){this.mergeExampleWith(T,d),d[n.value.discriminantProperty]=SS.primitive(CO.string(M[0]));break}}for(let M of n.value.commonProperties){s[M.key]={schema:M.schema,readonly:!1};let T=this.getResolvedSchema(M.schema);T.type!=="optional"&&T.type!=="nullable"&&(u[M.key]=M.schema)}for(let[M,T]of Object.entries(s)){let z=M in u;if(z&&l?.[M]!=null){let U=this.buildExampleHelper({schema:T.schema,exampleId:t,example:l[M],visitedSchemaIds:a,depth:i+1,options:o,skipReadonly:c});if(U!=null)d[M]=U;else return}else{let U=this.buildExampleHelper({exampleId:t,schema:T.schema,example:l?.[M],visitedSchemaIds:a,depth:i+1,options:o,skipReadonly:c});if(U!=null)d[M]=U;else if(z)return}}return SS.oneOf(L8i.discriminated(d))}case"undiscriminated":{let d=this.getUnDiscriminatedUnionVariantSchema(n.value,r);if(d!=null)return this.buildExampleHelper({exampleId:t,example:r,schema:d,visitedSchemaIds:a,depth:i,options:o,skipReadonly:c});break}}return;case"unknown":if(r!=null){let d=r2i(r);if(d!=null)return SS.unknown(d)}return o.ignoreOptionals||this.exceedsMaxDepth(i,o)?void 0:o.isParameter?SS.primitive(CO.string(o.name??"string")):SS.map([{key:CO.string("key"),value:SS.primitive(CO.string("value"))}]);case"array":{let d=BYy(r),s=[];if(d!=null&&d.length>0)for(let u of d){let l=this.buildExampleHelper({exampleId:t,example:u,schema:n.value,depth:i+1,visitedSchemaIds:a,options:o,skipReadonly:c});l!=null&&s.push(l)}else if(n.example!=null&&n.example.length>0)for(let u of n.example){let l=this.buildExampleHelper({exampleId:t,example:u,schema:n.value,depth:i+1,visitedSchemaIds:a,options:o,skipReadonly:c});l!=null&&s.push(l)}else{let u=this.buildExampleHelper({exampleId:t,example:void 0,schema:n.value,depth:i+1,visitedSchemaIds:a,options:o,skipReadonly:c});u!=null&&s.push(u)}return SS.array(s)}case"map":{let d=_ko(r??n.example);if(d!=null&&Object.entries(d).length>0){let l=[];for(let[m,A]of Object.entries(d)){let P=this.buildExampleFromPrimitive({schema:n.key.schema,example:m,options:o}),C=this.buildExampleHelper({exampleId:t,example:A,schema:n.value,visitedSchemaIds:a,depth:i+1,options:o,skipReadonly:c});C!=null&&l.push({key:P,value:C})}return SS.map(l)}if(n.key.schema.type==="string"&&n.value.type==="unknown")return SS.map([{key:CO.string("key"),value:SS.unknown(SS.primitive(CO.string("value")))}]);let s=this.buildExampleFromPrimitive({schema:n.key.schema,example:void 0,options:{...o,name:"key"}}),u=this.buildExampleHelper({exampleId:t,example:void 0,schema:n.value,visitedSchemaIds:a,depth:i+1,options:{...o,name:"value"},skipReadonly:c});return u!=null&&u.type!=="null"?SS.map([{key:s,value:u}]):SS.map([])}case"object":{let d={},s=n.fullExamples?.find(A=>A.name===t)??n.fullExamples?.find(A=>A.name==null)??n.fullExamples?.[0],u=_ko(r)??(s!=null?_ko(s.value):{})??{},l=this.getAllProperties(n),m=this.getAllRequiredProperties(n);for(let[A,P]of Object.entries(l)){if(c&&P.readonly||P.schema._visit({optional:z=>typeof z.availability=="string"&&z.availability==="Deprecated",primitive:()=>!1,object:()=>!1,array:()=>!1,map:()=>!1,enum:()=>!1,reference:()=>!1,literal:()=>!1,oneOf:()=>!1,nullable:()=>!1,unknown:()=>!1,_other:()=>!1}))continue;let C=A in m,M=Object.keys(u).includes(A),T=this.buildExampleHelper({schema:P.schema,exampleId:t,example:u[A],visitedSchemaIds:a,depth:i+1,options:{...o,name:A},skipReadonly:c});if(C&&T!=null)d[A]=T;else{if(C)return;(M&&T!=null||!o.ignoreOptionals&&T!=null)&&(d[A]=T)}}if(n.additionalProperties){for(let[A,P]of Object.entries(u))if(!(A in d)){let C=this.buildExampleHelper({schema:Sh.unknown({example:P,title:void 0,availability:void 0,description:void 0,generatedName:"",nameOverride:void 0,namespace:void 0,groupName:void 0}),exampleId:t,example:P,visitedSchemaIds:a,depth:i+1,options:{...o,name:A},skipReadonly:c});C!=null&&(d[A]=C)}}return SS.object({properties:d})}default:ks(n)}}mergeExampleWith(t,r){t._visit({array:Hc,enum:Hc,literal:Hc,map:n=>{for(let i of n){let a=i.key;a.type==="string"&&(r[a.value]=i.value)}},object:n=>{for(let[i,a]of Object.entries(n.properties))r[i]=a},oneOf:n=>{if(n.type==="discriminated")for(let[i,a]of Object.entries(n.value))r[i]=a;else this.mergeExampleWith(n.value,r)},primitive:Hc,unknown:Hc,null:Hc,_other:Hc})}getObjectSchema(t){if(t.type==="object")return t;if(t.type==="reference"){let r=this.schemas[t.schema];if(r!=null)return this.getObjectSchema(r)}}getDiscriminatedUnionVariantSchema(t,r){let n=r?.[t.discriminantProperty];if(n==null||typeof n!="string")return Object.entries(t.schemas)[0];let i=t.schemas[n];return i==null?Object.entries(t.schemas)[0]:[n,i]}getUnDiscriminatedUnionVariantSchema(t,r){return r==null?t.schemas[0]:t.schemas.map(a=>({schema:a,heuristic:this.calcExampleHeuristic(a,r)})).sort((a,o)=>o.heuristic-a.heuristic)[0]?.schema}calcExampleHeuristic(t,r){switch(t.type){case"literal":return t.value.value===r?5:0;case"enum":return TYy({schema:t,value:r})?5:0;case"object":{if(!bR(r))return 0;let n=this.getAllProperties(t),i=0;for(let[a,o]of Object.entries(n))r[a]!=null?(i++,i+=this.calcExampleHeuristic(o.schema,r[a])):i--;return i}case"array":{if(!Array.isArray(r))return 0;let n=0;for(let i of r)n+=this.calcExampleHeuristic(t.value,i);return n}case"map":{if(!bR(r))return 0;let n=0;for(let[,i]of Object.entries(r))n+=this.calcExampleHeuristic(t.value,i);return n}case"nullable":case"optional":return this.calcExampleHeuristic(t.value,r);case"reference":{let n=this.getResolvedSchema(t);return n==null?0:this.calcExampleHeuristic(n,r)}case"oneOf":return Object.values(t.value.schemas).map(i=>this.calcExampleHeuristic(i,r)).sort((i,a)=>a-i)[0]??0;case"primitive":return r==null?0:t.schema._visit({int:()=>typeof r=="number",int64:()=>typeof r=="number",uint:()=>typeof r=="number",uint64:()=>typeof r=="number",float:()=>typeof r=="number",double:()=>typeof r=="number",string:()=>typeof r=="string",datetime:()=>typeof r=="string",date:()=>typeof r=="string",base64:()=>typeof r=="string",boolean:()=>typeof r=="boolean",_other:()=>!0})?1:-1;default:return 0}}hasExample(t,r,n=new Set,i){if(this.exceedsMaxCheckerDepth(r,i))return!1;switch(t.type){case"array":return this.hasExample(t.value,r+1,n,i);case"enum":return t.example!=null;case"literal":return!1;case"map":return t.example!=null||t.key.schema.example!=null&&this.hasExample(t.value,r+1,n,i);case"object":{if(t.fullExamples!=null&&t.fullExamples.length>0)return!0;for(let o of t.properties)if(this.hasExample(o.schema,r+1,n,i))return!0;return!1}case"primitive":return t.schema.example!=null;case"reference":{let a=this.schemas[t.schema];if(a!=null&&!n.has(t.schema)){n.add(t.schema);let o=this.hasExample(a,r,n,i);return n.delete(t.schema),o}return!1}case"unknown":return t.example!=null;case"oneOf":return Object.values(t.value.schemas).some(a=>this.hasExample(a,r,n,i));default:return!1}}exceedsMaxCheckerDepth(t,r){return t>(r.maxCheckerDepth??0)}exceedsMaxDepth(t,r){return t>(r.maxDepth??0)}getAllProperties(t){let r={};for(let n of t.properties)r[n.key]={schema:n.schema,readonly:n.readonly??!1};for(let n of t.allOf){let i=this.schemas[n.schema];if(i==null)continue;let a=this.getResolvedSchema(i);a.type==="object"&&(r={...this.getAllProperties(a),...r})}return r}getAllRequiredProperties(t){let r={};for(let n of t.properties){let i=this.getResolvedSchema(n.schema);i.type!=="optional"&&i.type!=="nullable"&&(r[n.key]=n.schema)}for(let n of t.allOf){let i=this.schemas[n.schema];if(i==null)continue;let a=this.getResolvedSchema(i);a.type==="object"&&(r={...this.getAllRequiredProperties(a),...r})}return r}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}buildExampleFromPrimitive({example:t,schema:r,options:n}){switch(r.type){case"string":return t!=null&&typeof t=="string"?CO.string(t):r.example!=null?CO.string(r.example):CO.string(n.name??PP.STRING);case"base64":return t!=null&&typeof t=="string"?CO.base64(t):r.example!=null?CO.base64(r.example):CO.base64(PP.BASE64);case"boolean":return t!=null&&typeof t=="boolean"?CO.boolean(t):r.example!=null?CO.boolean(r.example):CO.boolean(PP.BOOLEAN);case"date":return t!=null&&typeof t=="string"?CO.date(t):r.example!=null?CO.date(r.example):CO.date(PP.DATE);case"datetime":return t!=null&&typeof t=="string"?CO.datetime(t):r.example!=null?CO.datetime(r.example):CO.datetime(PP.DATE_TIME);case"double":return t!=null&&typeof t=="number"?CO.double(t):r.example!=null?CO.double(r.example):CO.double(PP.DOUBLE);case"float":return t!=null&&typeof t=="number"?CO.float(t):r.example!=null?CO.float(r.example):CO.float(PP.FLOAT);case"int":return t!=null&&typeof t=="number"?CO.int(t):r.example!=null?CO.int(r.example):CO.int(PP.INT);case"int64":return t!=null&&typeof t=="number"?CO.int64(t):r.example!=null?CO.int64(r.example):CO.int64(PP.INT64);case"uint":return t!=null&&typeof t=="number"?CO.uint(t):r.example!=null?CO.uint(r.example):CO.uint(PP.UINT);case"uint64":return t!=null&&typeof t=="number"?CO.uint64(t):r.example!=null?CO.uint64(r.example):CO.uint64(PP.UINT64);default:ks(r)}}};function TYy({schema:e,value:t}){return e.values.map(r=>r.value).includes(t)}function dRr(e){switch(e.type){case"object":return Sh.object({allOf:e.allOf,properties:e.properties.map(t=>GGC(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName,fullExamples:void 0,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source,inline:void 0});case"array":return Sh.array({description:e.description,availability:e.availability,value:dRr(e.value),generatedName:e.generatedName,title:e.title,namespace:e.namespace,nameOverride:e.nameOverride,groupName:e.groupName,example:void 0,inline:void 0});case"enum":return Sh.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,values:e.values,default:e.default,namespace:e.namespace,groupName:e.groupName,example:void 0,source:e.source,inline:void 0});case"literal":return Sh.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName});case"nullable":return Sh.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:dRr(e.value),namespace:e.namespace,groupName:e.groupName,inline:void 0});case"optional":return Sh.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:dRr(e.value),namespace:e.namespace,groupName:e.groupName,inline:void 0});case"primitive":return Sh.primitive({description:e.description,availability:e.availability,schema:qYy(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"map":return Sh.map({description:e.description,availability:e.availability,key:Sh.primitive({description:e.key.description,availability:e.key.availability,schema:qYy(e.key.schema),generatedName:e.key.generatedName,nameOverride:e.key.nameOverride,title:e.key.title,namespace:e.namespace,groupName:e.groupName}),value:dRr(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,example:void 0,inline:void 0});case"reference":return Sh.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schema:e.schema,namespace:e.namespace,groupName:e.groupName,source:e.source});case"oneOf":return Sh.oneOf(HGC(e.value));case"unknown":return Sh.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName,title:void 0,example:void 0,namespace:void 0,groupName:void 0,description:void 0,availability:void 0});default:ks(e)}}function HGC(e){switch(e.type){case"discriminated":return Sit.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:dRr(t.schema)})),description:e.description,availability:e.availability,discriminantProperty:e.discriminantProperty,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:Object.fromEntries(Object.entries(e.schemas).map(([t,r])=>[t,dRr(r)])),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:void 0});case"undiscriminated":return Sit.undiscriminated({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:e.schemas.map(t=>dRr(t)),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:void 0});default:ks(e)}}function qYy(e){switch(e.type){case"string":return G0.string({default:e.default,pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:void 0});case"base64":return G0.base64({example:void 0});case"boolean":return G0.boolean({default:e.default,example:void 0});case"date":return G0.date({example:void 0});case"datetime":return G0.datetime({example:void 0});case"double":return G0.double({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"float":return G0.float({example:void 0});case"int":return G0.int({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"int64":return G0.int64({default:e.default,example:void 0});case"uint":return G0.uint({default:void 0,example:void 0});case"uint64":return G0.uint64({default:void 0,example:void 0});default:ks(e)}}function GGC(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:dRr(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability,readonly:e.readonly,writeonly:e.writeonly}}function hzs(e){return e.type!=="optional"&&e.type!=="nullable"}function ERf(e){return e==="POST"||e==="PUT"||e==="PATCH"}function hko(e){if(e.type==="full")return e.request==null&&e.response==null&&e.queryParameters==null&&e.pathParameters==null&&e.headers==null;{let t=e.value;return t.request==null&&t.response==null&&t["query-parameters"]==null&&t["path-parameters"]==null&&t.headers==null}}var yzs=class{schemas;context;globalHeaders;exampleTypeFactory;logger;constructor(t,r,n){this.schemas=t,this.context=r,this.globalHeaders=n,this.schemas=t,this.exampleTypeFactory=new n2i(t,r.nonRequestReferencedSchemas,r),this.logger=r.logger}buildEndpointExample(t){let r=KGC(t.request),n=$GC(t.response);if(r?.type==="unsupported"||n?.type==="unsupported")return[];let i=[];if(r!=null&&r.type==="present"){let l=this.isSchemaRequired(r.schema);if(r.examples.length===0){let m=this.exampleTypeFactory.buildExample({skipReadonly:ERf(t.method),schema:r.schema,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});m!=null&&i.push([void 0,m])}else for(let{name:m,value:A}of r.examples){let P=this.exampleTypeFactory.buildExample({skipReadonly:ERf(t.method),schema:r.schema,exampleId:m,example:A,options:{isParameter:!1,ignoreOptionals:!0}});P!=null&&i.push([m,P])}if(l&&i.length===0)return this.logger.trace(`Failed to generate required request example for ${t.method.toUpperCase()} ${t.path}`),[]}let a=[];if(n!=null&&n.type==="present"){let l=this.isSchemaRequired(n.schema);if(n.examples.length===0){let m=this.exampleTypeFactory.buildExample({skipReadonly:!1,schema:n.schema,exampleId:void 0,example:void 0,options:{maxDepth:this.context.options.exampleGeneration?.response?.["max-depth"]??3,isParameter:!1,ignoreOptionals:!1}});m!=null&&(t.response?.type==="json"?a.push([void 0,Wyt.withoutStreaming(m)]):(t.response?.type==="streamingJson"||t.response?.type==="streamingSse")&&a.push([void 0,Wyt.withStreaming({sse:t.response?.type==="streamingSse",events:[m]})]))}else for(let{name:m,value:A}of n.examples){let P=this.exampleTypeFactory.buildExample({skipReadonly:!1,schema:n.schema,exampleId:m,example:A,options:{maxDepth:this.context.options.exampleGeneration?.response?.["max-depth"]??3,isParameter:!1,ignoreOptionals:!1}});P!=null&&(t.response?.type==="json"?a.push([m,Wyt.withoutStreaming(P)]):(t.response?.type==="streamingJson"||t.response?.type==="streamingSse")&&a.push([void 0,Wyt.withStreaming({sse:t.response?.type==="streamingSse",events:[P]})]))}if(l&&a.length===0)return this.logger.trace(`Failed to generate required response example for ${t.method.toUpperCase()} ${t.path}`),[]}let o=[];for(let l of t.pathParameters){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for path parameter ${l.name} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),m&&A==null)return[];A!=null&&o.push({name:l.name,parameterNameOverride:l.parameterNameOverride,value:A})}let c=[];for(let l of t.queryParameters){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for query parameter ${l.name} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),m&&A==null)return[];A!=null&&c.push({name:l.name,value:A})}let d=[];for(let l of t.headers){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for header ${l.name} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),m&&A==null)return[];A!=null&&d.push({name:l.name,value:A})}for(let l of this.globalHeaders){let m=l.schema!=null?dRr(l.schema):Sh.primitive({nameOverride:void 0,generatedName:"",title:void 0,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,schema:G0.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})}),A=this.exampleTypeFactory.buildExample({schema:m,exampleId:void 0,example:void 0,options:{name:l.header,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for global header ${l.header} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),A==null)return[];A!=null&&d.push({name:l.header,value:A})}let s=[];t.request!=null&&t.response!=null?s=JGC(i,a):t.request!=null?s=i.map(([l,m])=>({id:l,request:m,response:void 0})):t.response!=null&&(s=a.map(([l,m])=>({id:l,request:void 0,response:m})));let u=t.examples.filter(l=>hko(l)).flatMap(l=>{if(l.type==="unknown"){if(l.value!=null){let m=l.value["code-samples"];if(m!=null)return this.convertCodeSamples(m)}return}else return l.codeSamples}).filter(l=>ij(l));return s.length===0?[Vyt.full({name:void 0,description:void 0,pathParameters:o,queryParameters:c,headers:d,request:void 0,response:void 0,codeSamples:u})]:s.map(({id:l,request:m,response:A})=>Vyt.full({name:l,description:void 0,pathParameters:o,queryParameters:c,headers:d,request:m,response:A,codeSamples:u}))}convertCodeSamples(t){return t.map(r=>"language"in r?rWr.language({name:r.name??void 0,description:r.docs??void 0,language:r.language,code:r.code,install:r.install??void 0}):rWr.sdk({name:r.name??void 0,description:r.docs??void 0,sdk:r.sdk==="c#"?Rde.Csharp:r.sdk,code:r.code})).filter(ij)}isSchemaRequired(t){return hzs(this.getResolvedSchema(t))}getResolvedSchema(t){return t}};function JGC(e,t){let r=[];if(e.length<=1){let[i,a]=e[0]??[];if(t.length===0)return r.push({id:i,request:a,response:void 0}),r;for(let[o,c]of t)r.push({id:o??i,request:a,response:c});return r}if(t.length<=1){let[i,a]=t[0]??[];if(t.length===0)return r.push({id:i,request:void 0,response:a}),r;for(let[o,c]of e)r.push({id:o??i,request:c,response:a});return r}let n=new Set;for(let[i,a]of e){let o=t.find(([d])=>d==null)?.[1]??t[0]?.[1];if(i==null){if(o==null)continue;r.push({id:void 0,request:a,response:o});continue}let c=!1;for(let d=0;d<t.length;d++){let[s,u]=t[d];s==null||n.has(d)||i===s&&(r.push({id:i,request:a,response:u}),s!=null&&n.add(d),c=!0)}!c&&o!=null&&r.push({id:i,request:a,response:o})}for(let i=0;i<t.length;i++){if(n.has(i))continue;let[a,o]=t[i],c=e.find(([d])=>d==null)?.[1]??e[0]?.[1];c!=null&&r.push({id:a,request:c,response:o})}return r}function KGC(e){if(e!=null)return e.type==="multipart"?{type:"present",schema:YGC(e),examples:[]}:e.type==="json"||e.type==="formUrlEncoded"?{type:"present",schema:e.schema,examples:e.fullExamples??[]}:{type:"unsupported"}}function $GC(e){if(e!=null)return e.type!=="json"&&e.type!=="streamingJson"&&e.type!=="streamingSse"?{type:"unsupported"}:{type:"present",schema:e.schema,examples:e.fullExamples??[]}}function pRr(e){switch(e.type){case"primitive":case"enum":case"literal":return!0;case"unknown":return pRr(e);case"array":case"object":case"map":return!1;case"oneOf":switch(e.value.type){case"discriminated":return!1;case"undiscriminated":return pRr(e.value.value);default:return!1}case"null":return!0;default:ks(e)}}function YGC(e){return Sh.object({properties:e.properties.map(t=>t.schema.type==="file"?null:{key:t.key,schema:dRr(t.schema.value),audiences:[],conflict:{},generatedName:t.key,nameOverride:void 0,availability:void 0,readonly:void 0,writeonly:void 0,inline:void 0}).filter(ij),allOf:[],allOfPropertyConflicts:[],fullExamples:void 0,description:e.description,nameOverride:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,additionalProperties:!1,availability:void 0,source:e.source,inline:void 0})}var nao=class{exampleTypeFactory;schemas;constructor(t,r){this.exampleTypeFactory=new n2i(t,new Set,r),this.schemas=t}buildWebsocketSessionExamplesForExtension({context:t,extensionExamples:r,handshake:n,source:i,namespace:a}){let o=[];for(let c of r){let d=[];for(let l of n.queryParameters){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:c.queryParameters?.[l.name],options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});A!=null&&!pRr(A)&&(A=void 0),!(m&&A==null)&&A!=null&&d.push({name:l.name,value:A})}let s=[];for(let l of n.headers){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:c.headers?.[l.name],options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});A!=null&&!pRr(A)&&(A=void 0),!(m&&A==null)&&A!=null&&s.push({name:l.name,value:A})}let u=[];for(let l of c.messages){let m=t.getExampleMessageReference(l),A=t.resolveMessageReference({$ref:m}),P=Kg(A.payload)?t.resolveSchemaReference(A.payload):A.payload,C=this.exampleTypeFactory.buildExample({schema:CS(P,!1,!1,t,[l.messageId],i,a),exampleId:void 0,example:l.value,options:{isParameter:!1,ignoreOptionals:!0}});C!=null&&u.push({messageType:l.type,payload:C,description:void 0})}o.push({name:c.summary,queryParameters:d,headers:s,description:c.description,messages:u})}return o}buildWebsocketSessionExample({handshake:t,messages:r}){let n={name:void 0,queryParameters:[],headers:[],description:void 0,messages:[]},i=[];for(let o of t.queryParameters){let c=this.isSchemaRequired(o.schema),d=this.exampleTypeFactory.buildExample({schema:o.schema,exampleId:void 0,example:void 0,options:{name:o.name,isParameter:!0,ignoreOptionals:!0}});if(d!=null&&!pRr(d)&&(d=void 0),c&&d==null)return;d!=null&&i.push({name:o.name,value:d})}let a=[];for(let o of t.headers){let c=this.isSchemaRequired(o.schema),d=this.exampleTypeFactory.buildExample({schema:o.schema,exampleId:void 0,example:void 0,options:{name:o.name,isParameter:!0,ignoreOptionals:!0}});if(d!=null&&!pRr(d)&&(d=void 0),c&&d==null)return;d!=null&&a.push({name:o.name,value:d})}for(let o of r){let c=this.exampleTypeFactory.buildExample({schema:o.payload,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});c!=null&&n.messages.push({messageType:o.type,payload:c,description:void 0})}return n}isSchemaRequired(t){return hzs(this.getResolvedSchema(t))}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}};var lIe={FERN_PARAMETER_OPTIONAL:"x-fern-optional",FERN_CHANNEL_ADDRESS:"x-fern-address",FERN_DISPLAY_NAME:"x-fern-display-name",FERN_SDK_GROUP_NAME:"x-fern-sdk-group-name",FERN_EXAMPLES:"x-fern-examples",BASE_PATH:"x-fern-base-path",FERN_ENUM:"x-fern-enum",IGNORE:"x-fern-ignore"};function vzs(e){return ev(e,lIe.FERN_EXAMPLES)??[]}function bzs(e,t){return t.includes("://")?t:`${e}://${t}`}function gzs(e){return e.startsWith("/")?e:"/"+e}function FYy({context:e,breadcrumbs:t,source:r,asyncApiOptions:n,document:i}){let a={},o={};for(let[s,u]of Object.entries(i.components?.schemas??{})){let l=CS(u,!1,!1,e,[s],r,e.namespace);a[s]=l}let c=new nao(a,e),d={};for(let[s,u]of Object.entries(i.servers??{}))d[s]={name:s,url:bzs(u.protocol,u.url)};for(let[s,u]of Object.entries(i.channels??{})){let l=ev(u,lIe.IGNORE);if(l!=null&&l){e.logger.debug(`Channel ${s} is marked with x-fern-ignore. Skipping.`);continue}let m=[];if(u.parameters!=null)for(let[T,z]of Object.entries(u.parameters??{}))m.push({name:T,description:z.description,parameterNameOverride:void 0,schema:z.schema!=null?CS(z.schema,!1,!1,e,t,r,e.namespace):Sh.primitive({schema:G0.string({default:void 0,pattern:void 0,format:void 0,maxLength:void 0,minLength:void 0,example:void 0}),description:void 0,availability:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}),variableReference:void 0,availability:owe(z),source:r});let A=[],P=[];if(u.bindings?.ws!=null){if(u.bindings.ws.headers!=null){let T=u.bindings.ws.headers.required??[];for(let[z,U]of Object.entries(u.bindings.ws.headers.properties??{})){if(Kg(U)){let re=e.resolveSchemaReference(U);A.push({name:z,schema:owi(U,!1,!1,e,t,void 0,r,e.namespace),description:re.description,parameterNameOverride:void 0,env:void 0,availability:owe(re),source:r});continue}let R=T.includes(z),[V,Y]=e.options.coerceOptionalSchemasToNullable?[!1,!R]:[!R,!1];A.push({name:z,schema:CS(U,V,Y,e,[...t,z],r,e.namespace),description:U.description,parameterNameOverride:void 0,env:void 0,availability:owe(U),source:r})}}if(u.bindings.ws.query!=null){let T=u.bindings.ws.query.required??[];for(let[z,U]of Object.entries(u.bindings.ws.query.properties??{})){if(Kg(U)){let re=e.resolveSchemaReference(U);P.push({name:z,schema:owi(U,!1,!1,e,t,void 0,r,e.namespace),description:re.description,parameterNameOverride:void 0,availability:owe(re),source:r});continue}let R=T.includes(z),[V,Y]=e.options.coerceOptionalSchemasToNullable?[!1,!R]:[!R,!1];P.push({name:z,schema:CS(U,V,Y,e,[...t,z],r,e.namespace),description:U.description,parameterNameOverride:void 0,availability:owe(U),source:r})}}}let C;u.publish!=null&&("oneOf"in u.publish.message?C=RYy({generatedName:u.publish.operationId??"PublishEvent",event:u.publish,breadcrumbs:t,context:e,source:r,options:e.options,asyncApiOptions:n}):C=NYy({action:"Publish",channelPath:s,message:u.publish.message,context:e,source:r}));let M;if(u.subscribe!=null&&("oneOf"in u.subscribe.message?M=RYy({generatedName:u.subscribe.operationId??"SubscribeEvent",event:u.subscribe,breadcrumbs:t,context:e,source:r,options:e.options,asyncApiOptions:n}):M=NYy({action:"Subscribe",channelPath:s,message:u.subscribe.message,context:e,source:r})),A.length>0||P.length>0||C!=null||M!=null){let T=vzs(u),z=[];if(T.length>0)z=c.buildWebsocketSessionExamplesForExtension({context:e,extensionExamples:T,handshake:{headers:A,queryParameters:P},source:r,namespace:e.namespace});else{let Y=[];C!=null&&Y.push({type:"publish",payload:C}),M!=null&&Y.push({type:"subscribe",payload:M});let re=c.buildWebsocketSessionExample({handshake:{headers:A,queryParameters:P},messages:Y});re!=null&&z.push(re)}let U=ev(u,lIe.FERN_CHANNEL_ADDRESS),R=U??gzs(s),V=[];C!=null&&V.push({origin:"client",name:"publish",body:k6(C)}),M!=null&&V.push({origin:"server",name:"subscribe",body:k6(M)}),o[s]={audiences:ev(u,pb.AUDIENCES)??[],handshake:{headers:A.map(Y=>({...Y,schema:k6(Y.schema),env:Y.env})),queryParameters:P.map(Y=>({...Y,schema:k6(Y.schema)})),pathParameters:m.map(Y=>({...Y,parameterNameOverride:void 0,schema:k6(Y.schema)}))},groupName:e.resolveGroupName([ev(u,lIe.FERN_SDK_GROUP_NAME)??s]),messages:V,servers:(u.servers?.map(Y=>d[Y])??Object.values(d)).filter(Y=>Y!=null&&Y.name!=null).map(Y=>({...Y,name:Y.name})),summary:ev(u,lIe.FERN_DISPLAY_NAME),path:R,description:u.description,examples:z,source:r}}}return{groupedSchemas:rao(e.namespace,a),channels:o??void 0,servers:Object.values(d).map(s=>({...s,name:s.name})),basePath:ev(i,lIe.BASE_PATH)}}function RYy({generatedName:e,event:t,context:r,breadcrumbs:n,source:i,options:a,asyncApiOptions:o}){if("oneOf"in t.message&&t.message.oneOf!=null){let c=[],d=[];for(let s of t.message.oneOf){let u,l={type:"notFound"};if(Kg(s)){let m=r.resolveMessageReference(s);!Kg(m.payload)&&o.naming==="v2"?(l=m.name?{type:"name",name:m.name}:l,u={...m.payload,title:m.name??m.payload.title,description:m.name??m.payload.description}):u=m.payload}else u=s;d.push(l),c.push(u)}return t2i({description:t.description??t.message.description,availability:owe(t.message),subtypes:c,nameOverride:t.operationId,generatedName:e,title:t.message.title,groupName:void 0,wrapAsOptional:!1,wrapAsNullable:!1,breadcrumbs:n,context:r,encoding:void 0,source:i,namespace:r.namespace,subtypePrefixOverrides:o.naming==="v2"?d:[]})}}function NYy({action:e,channelPath:t,message:r,context:n,source:i}){if(r.payload!=null){let a=r.payload;return Kg(r.payload)&&(a=n.resolveSchemaReference(r.payload)),CS(a,!1,!1,n,[t,e],i,n.namespace)}}var mzs=class extends tao{getExampleMessageReference(t){return`#/channels/${t.channelId}/messages/${t.messageId}`}resolveParameterReference(t){let r="#/components/parameters/";if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith(r))throw new Error(`Failed to resolve ${t.$ref}`);let n=t.$ref.substring(r.length),i=this.document.components.parameters[n];if(i==null)throw new Error(`${t.$ref} is undefined`);return"$ref"in i?this.resolveParameterReference(i):i}resolveMessageReference(t){let r="#/channels/",n="#/components/messages/";if(t.$ref.startsWith(r)){let c=t.$ref.split("/"),d=c[2],s=c[4];if(d==null||s==null||!this.document.channels?.[d])throw new Error(`Failed to resolve message reference ${t.$ref} in channel ${d}`);let l=this.document.channels[d].messages?.[s];if(l==null)throw new Error(`${t.$ref} is undefined`);return"$ref"in l?this.resolveMessageReference(l):{name:s,...l}}let i=this.document.components;if(!t.$ref.startsWith(n)||!i?.messages)throw new Error(`Failed to resolve message reference: ${t.$ref} in v3 components`);let a=t.$ref.substring(n.length),o=i.messages[a];if(o==null)throw new Error(`${t.$ref} is undefined`);return{name:a,...o}}isMessageWithPayload(t){return t!=null&&typeof t=="object"&&"payload"in t}isReferenceObject(t){return t!=null&&typeof t=="object"&&"$ref"in t}};var xYy="#/channels/",zYy="#/servers/",SRf="$message.";function LYy({context:e,breadcrumbs:t,source:r,asyncApiOptions:n,document:i}){let a={},o={},c={},d=[],s={};for(let[P,C]of Object.entries(i.components?.schemas??{}))a[P]=CS(C,!1,!1,e,[P],r,e.namespace);for(let[P,C]of Object.entries(i.channels??{}))if(o[P]||(o[P]={}),C.messages){for(let[M,T]of Object.entries(C.messages))if(e.isReferenceObject(T)||e.isMessageWithPayload(T))if(c[M]||(c[M]=[]),e.isReferenceObject(T)){let z=e.resolveMessageReference(T);c[M].push({channelId:P,payload:z.payload})}else c[M].push({channelId:P,payload:T.payload})}for(let[P,C]of Object.entries(c))if(C.length===1){let M=C[0],T=M.channelId;o[T]=o[T]||{},o[T][P]=CS(M.payload,!1,!1,e,[P],r,e.namespace)}else{d.push(P);for(let{channelId:M,payload:T}of C){let z=`${M}_${P}`;o[M]||(o[M]={}),o[M][z]=CS(T,!1,!1,e,[z],r,e.namespace)}}let u=Object.values(o).reduce((P,C)=>({...P,...C}),{}),l=new nao(u,e),m={};for(let[P,C]of Object.entries(i.servers??{}))m[P]={name:P,url:bzs(C.protocol,C.host)};let A={};for(let[P,C]of Object.entries(i.operations??{})){if(ev(C,lIe.IGNORE))continue;let M=XGC(C);if(A[M]||(A[M]={subscribe:[],publish:[],__parsedMessages:[]}),C.action==="receive")A[M].subscribe.push(...C.messages);else if(C.action==="send")A[M].publish.push(...C.messages);else throw new Error(`Operation ${P} has an invalid action: ${C.action}`)}for(let[P,C]of Object.entries(A)){let M=[];M.push(...QYy({messages:C.subscribe,channelPath:P,origin:"server",messageSchemas:o[P]??{},duplicatedMessageIds:d,context:e})),M.push(...QYy({messages:C.publish,channelPath:P,origin:"client",messageSchemas:o[P]??{},duplicatedMessageIds:d,context:e})),A[P]!=null&&(A[P].__parsedMessages=M)}for(let[P,C]of Object.entries(i.channels??{})){if(ev(C,lIe.IGNORE))continue;let M=[],T=[],z=[];if(C.parameters!=null)for(let[U,R]of Object.entries(C.parameters)){let V=e.isReferenceObject(R)?e.resolveParameterReference(R):R,{type:Y,parameterKey:re}=V.location!=null?ZGC(V.location):{type:C.address?.includes(`={${U}}`)?"query":"path",parameterKey:U},Z=ev(V,lIe.FERN_PARAMETER_OPTIONAL),ee=bU(FA(P))+bU(FA(U)),ne={...V,type:"string",title:ee,example:V.examples?.[0],default:V.default,enum:V.enum,required:void 0},me=CS(ne,!1,!1,e,[re],r,e.namespace);Z&&(me=Sh.optional({value:me,description:void 0,availability:void 0,generatedName:"",title:ee,namespace:void 0,groupName:void 0,nameOverride:void 0,inline:void 0}));let be={name:re,description:V.description,parameterNameOverride:void 0,schema:me,variableReference:void 0,availability:owe(R),source:r};Y==="header"?M.push({...be,env:void 0}):Y==="path"?T.push(be):(Y==="payload"||Y==="query")&&z.push(be)}if(M.length>0||z.length>0||A[P]!=null&&(A[P].publish!=null||A[P].subscribe!=null)){let U=vzs(C),R=A[P]?.__parsedMessages??[],V=[];if(U.length>0)V=l.buildWebsocketSessionExamplesForExtension({context:e,extensionExamples:U,handshake:{headers:M,queryParameters:z},source:r,namespace:e.namespace});else{let re=[],{examplePublishMessage:Z,exampleSubscribeMessage:ee}=eJC({messages:R,messageSchemas:o[P]??{}});Z!=null&&re.push(Z),ee!=null&&re.push(ee);let ne=l.buildWebsocketSessionExample({handshake:{headers:M,queryParameters:z},messages:re});ne!=null&&V.push(ne)}let Y=ev(C,lIe.FERN_SDK_GROUP_NAME);s[P]={audiences:ev(C,pb.AUDIENCES)??[],handshake:{headers:M.map(re=>({...re,schema:k6(re.schema),env:re.env})),queryParameters:z.map(re=>({...re,schema:k6(re.schema)})),pathParameters:T.map(re=>({...re,parameterNameOverride:void 0,schema:k6(re.schema)}))},groupName:e.resolveGroupName(typeof Y=="string"?[Y]:Y??[P]),messages:R,summary:ev(C,lIe.FERN_DISPLAY_NAME),servers:(C.servers?.map(re=>kGC(m,re))??Object.values(m)).map(re=>({...re,name:re.name})),path:C.address?.split("?")[0]??gzs(P),description:C.description,examples:V,source:r}}}return{groupedSchemas:rao(e.namespace,a),channels:s,servers:Object.values(m).map(P=>({...P,name:P.name})),basePath:ev(i,lIe.BASE_PATH)}}function XGC(e){if(!e.channel.$ref.startsWith(xYy))throw new Error(`Failed to resolve channel path from operation ${e.channel.$ref}`);return e.channel.$ref.substring(xYy.length)}function ZGC(e){try{let[t,r]=e.split("#/");if(t==null||r==null)throw new Error(`Invalid location format: ${e}; unable to parse message type and parameter key`);if(!t.startsWith(SRf))throw new Error(`Invalid location format: ${e}; expected ${SRf} prefix`);let n=t.substring(SRf.length);if(n!=="header"&&n!=="path"&&n!=="payload")throw new Error(`Invalid message type: ${n}. Must be one of: header, path, payload`);return{type:n,parameterKey:r}}catch{throw new Error(`Invalid location format: ${e}; see here for more details: https://www.asyncapi.com/docs/reference/specification/v3.0.0#runtimeExpression`)}}function kGC(e,t){if(!t.$ref.startsWith(zYy))throw new Error(`Failed to resolve server name from server ref ${t.$ref}`);let r=t.$ref.substring(zYy.length),n=e[r];if(n==null)throw new Error(`Failed to find server with name ${r}`);return n}function QYy({messages:e,channelPath:t,origin:r,messageSchemas:n,duplicatedMessageIds:i,context:a}){let o=[];return e.forEach((c,d)=>{let u=a.resolveMessageReference(c).name;i.includes(u)&&(u=`${t}_${u}`);let l=n[u];l!=null&&o.push({origin:r,name:u??`${r}Message${d+1}`,body:k6(l)})}),o}function eJC({messages:e,messageSchemas:t}){let r=e.find(o=>o.origin==="client")?.name,n=e.find(o=>o.origin==="server")?.name,i=r!=null?t[r]:void 0,a=n!=null?t[n]:void 0;return{examplePublishMessage:i!=null&&r!=null?{type:r,payload:i}:void 0,exampleSubscribeMessage:a!=null&&n!=null?{type:n,payload:a}:void 0}}function UYy({document:e,taskContext:t,options:r,source:n,asyncApiOptions:i,namespace:a}){let o=[];if(a!=null&&o.push(a),parseFloat(e.asyncapi)<3){let c=e;c.tags?.[0]!=null?o.push(c.tags[0].name):i.naming!=="v2"&&o.push("websocket");let d=new _zs({document:c,taskContext:t,options:r,namespace:a});return FYy({context:d,breadcrumbs:o,source:n,asyncApiOptions:i,document:c})}else{let c=e,d=new mzs({document:c,taskContext:t,options:r,namespace:a});return LYy({context:d,breadcrumbs:o,source:n,asyncApiOptions:i,document:c})}}function VYy(e){return ev(e,pb.ASYNC_CONFIG)}var WYy="$request.";function HYy(e){let t=ev(e,pb.STREAMING);if(t!=null)return typeof t=="boolean"?t?{type:"stream",format:"json"}:void 0:t["stream-condition"]==null&&t.format!=null?{type:"stream",format:t.format}:{type:"streamCondition",format:t.format??"json",streamDescription:t["stream-description"],streamConditionProperty:tJC(t["stream-condition"]),responseStream:t["response-stream"],response:t.response}}function tJC(e){return e.startsWith(WYy)?e.slice(WYy.length):e}function GYy(e){let t=e;if(t.cursor!=null)return Eit.cursor({cursor:t.cursor,nextCursor:t.next_cursor,results:t.results});if("offset"in e){let r=e;return Eit.offset({offset:r.offset,results:r.results,step:r.step,hasNextPage:r["has-next-page"]})}if("type"in e&&e.type==="custom"){let r=e;return Eit.custom({results:r.results})}throw new Error("Invalid pagination extension")}function JYy(e,t){let r=ev(t,pb.PAGINATION);if(r!=null){if(typeof r=="boolean"){let n=ev(e,pb.PAGINATION);if(typeof n=="boolean")throw new Error("Global pagination extension is a boolean, expected an object. Only endpoints may declare a boolean for x-fern-pagination.");return n==null?void 0:GYy(n)}return GYy(r)}}function KYy(e){let t=rJC(e),r={};return DRf({obj:t,occurrences:r,breadcrumbs:[]}),r}function DRf({obj:e,occurrences:t,breadcrumbs:r}){if(e!=null){if(Array.isArray(e)){for(let n of e)DRf({obj:n,occurrences:t,breadcrumbs:r});return}if(typeof e=="object"){if(e.$ref!=null&&typeof e.$ref=="string"){let n=e.$ref;t[n]==null?t[n]=1:t[n]+=1;return}for(let n in e)DRf({obj:e[n],occurrences:t,breadcrumbs:[...r,n]})}}}function rJC(e){return{...e,paths:Object.fromEntries(Object.entries(e.paths??{}).map(([t,r])=>[t,{...r,get:r?.get!=null?yko(r.get):void 0,put:r?.put!=null?yko(r.put):void 0,post:r?.post!=null?yko(r.post):void 0,patch:r?.patch!=null?yko(r.patch):void 0,delete:r?.delete!=null?yko(r.delete):void 0}]))}}function yko(e){return{...e,requestBody:e.requestBody!=null?Kg(e.requestBody)?e.requestBody:nJC(e.requestBody):void 0}}function nJC(e){let t,r;for(let n in e.content){let i=J8.parse(n);i!=null&&(i.isJSON()?t=e.content[n]:i.isMultipart()&&(r=e.content[n]))}return r!=null&&t!=null?{...e,content:{[J8.MULTIPART_FORM_DATA]:r}}:e}var Ozs=class{endpoints;parser=new isa;constructor({context:t,options:r}){this.endpoints=r.filter?.endpoints?new Set(this.validateAndFilterEndpoints({context:t,endpoints:r.filter.endpoints})):void 0}skipEndpoint({method:t,path:r}){return this.endpoints!=null&&!this.endpoints.has(`${t} ${r}`)}hasEndpoints(){return this.endpoints!=null}validateAndFilterEndpoints({context:t,endpoints:r}){let n=[];for(let i of r){let a=this.parser.tryParse(i);if(a==null){t.logger.debug(`Ignoring configured filter endpoint "${i}"; expected format "POST /users/get"`);continue}n.push(`${a.method} ${a.path}`)}return n}};var $Yy="#/components/parameters/",YYy="#/components/responses/",XYy="#/components/examples/",ZYy="#/components/requestBodies/",kYy="#/components/securitySchemes/",iao=class{logger;document;taskContext;authHeaders;refOccurrences;DUMMY;options;source;filter;namespace;constructor({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:o}){this.document=t,this.logger=r.logger,this.taskContext=r,this.authHeaders=n,this.refOccurrences=KYy(t),this.options=i,this.source=a,this.filter=new Ozs({context:r,options:i}),this.DUMMY=this.getDummy(),this.namespace=o}getNumberOfOccurrencesForRef(t){return this.refOccurrences[t.$ref]??0}resolveTagsToTagIds(t){let r=[];return this.namespace!=null&&r.push(this.namespace),r.concat(t??[])}resolveTags(t){let r=[];if(this.namespace!=null){let n={type:"namespace",name:this.namespace};r.push(n)}return r.concat(t??[])}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveSchemaReference(t){let r=t.$ref.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return{"x-fern-type":"unknown"};if(Array.isArray(n)){let a=parseInt(i,10);if(isNaN(a)||a<0||a>=n.length)return{"x-fern-type":"unknown"};n=n[a]}else n=n[i]}return n==null?(this.logger.warn(`Encountered undefined reference: ${t.$ref}`),{"x-fern-type":"unknown"}):(Kg(n)&&(n=this.resolveSchemaReference(n)),n)}resolveParameterReference(t){if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith($Yy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring($Yy.length),n=this.document.components.parameters[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveParameterReference(n):n}resolveRequestBodyReference(t){if(this.document.components==null||this.document.components.requestBodies==null||!t.$ref.startsWith(ZYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(ZYy.length),n=this.document.components.requestBodies[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveRequestBodyReference(n):n}resolveResponseReference(t){if(this.document.components==null||this.document.components.responses==null||!t.$ref.startsWith(YYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(YYy.length),n=this.document.components.responses[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveResponseReference(n):n}resolveExampleReference(t){if(this.document.components==null||this.document.components.examples==null||!t.$ref.startsWith(XYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(XYy.length),n=this.document.components.examples[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveExampleReference(n):n}resolveSecuritySchemeReference(t){if(this.document.components==null||this.document.components.securitySchemes==null||!t.$ref.startsWith(kYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(kYy.length),n=this.document.components.securitySchemes[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveSecuritySchemeReference(n):n}referenceExists(t){let r=t.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return!1;n=n[i]}return!0}};var pda=class extends iao{constructor({document:t,taskContext:r,options:n,source:i,namespace:a}){super({document:t,taskContext:r,authHeaders:new Set,options:n,source:i,namespace:a})}getDummy(){return this}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}getReferencedSchemas(){return new Set}markReferencedByDiscriminatedUnion(t,r,n){}getReferencesFromDiscriminatedUnion(t){}excludeSchema(t){}isSchemaExcluded(t){return!1}markSchemaWithDiscriminantValue(t,r,n){}getDiscriminatedUnionMetadata(t){}};var iJC=nl.object({lang:nl.string(),label:nl.optional(nl.string()),source:nl.string()}),CRf=nl.array(iJC);var eXy={README_EXT:"x-readme"};function aJC(e){if(!Array.isArray(e))return!1;for(let t of e)if(!bR(t)||typeof t.language!="string"||typeof t.code!="string")return!1;return!0}function tXy(e){let t=ev(e,eXy.README_EXT);if(!bR(t))return[];let r=t["code-samples"];if(!aJC(r))return[];let n=[];for(let i of r)n.push({name:i.name,language:i.language,code:i.code,install:i.install,docs:void 0});return n}function rXy(e,t,r){let i=(ev(t,pb.EXAMPLES)??[]).filter(s=>{let u=hZ.serialization.ExampleEndpointCallSchema.parse(s);return u.ok||r.logger.error(`Failed to parse x-fern-example in ${e.path}/${e.method}`),u.ok}),a=lko(t,xbe.REDOCLY_CODE_SAMPLES_KEBAB,CRf,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],c=[...lko(t,xbe.REDOCLY_CODE_SAMPLES_CAMEL,CRf,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],...a];c.length>0&&i.push({"code-samples":c.map(s=>({name:s.label??s.lang,language:s.lang,code:s.source,install:void 0,docs:void 0}))});let d=tXy(t);return d.length>0&&i.push({"code-samples":d}),i.map(Vyt.unknown)}function nXy(e){let t=ev(e,pb.AVAILABILITY);if(t==="ga"||t==="generally-available")return qde.GenerallyAvailable;if(t==="beta"||t==="pre-release")return qde.Beta;if(t==="deprecated")return qde.Deprecated;if(e.deprecated)return qde.Deprecated}function iXy(e){let t=ev(e,pb.RETRIES);if(t!=null&&t.disabled===!0)return HFs.RetriesConfiguration.disabled(t.disabled)}function Azs(e,t){return{url:oJC({url:e.url,variables:e.variables??{}}),description:e.description,name:uJC(e,t),audiences:ev(e,pb.AUDIENCES)}}function oJC({url:e,variables:t}){let r=Object.fromEntries(Object.entries(t).map(([n,i])=>[n,i.default]));for(let[n,i]of Object.entries(r))e=e.replace(`{${n}}`,encodeURIComponent(i));return e}function uJC(e,t){let r=ev(e,[pb.SERVER_NAME_V1,pb.SERVER_NAME_V2]);if(r!=null)return r;if(e.description?.toLowerCase()==="production")return"Production";if(e.description?.toLowerCase()==="sandbox")return"Sandbox";if(t?.groupMultiApiEnvironments&&e.description!=null&&e.description.trim()!==""){let n=e.description.toLowerCase();return n==="prd"?"Production":n==="sbx"?"Sandbox":n==="staging"||n==="stg"?"Staging":n==="development"||n==="dev"?"Development":e.description}}function aXy(e){return ev(e,pb.PARAMETER_NAME)}function oXy(e){return ev(e,pb.SDK_VARIABLE)}function Pzs({path:e,httpMethod:t,parameters:r,context:n,requestBreadcrumbs:i,source:a}){let o={pathParameters:[],queryParameters:[],headers:[]};for(let c of r){let d=ev(c,pb.IGNORE);if(d!=null&&d){n.logger.debug(`${t.toUpperCase()} ${e} has a parameter marked with x-fern-ignore. Skipping.`);continue}let s=Kg(c)?n.resolveParameterReference(c):c,u=s.required??!1,l=owe(s),m=[...i,s.name],A=Cie(m,n.options.preserveSchemaIds),[P,C]=n.options.coerceOptionalSchemasToNullable?[!1,!u]:[!u,!1],M=s.schema!=null?CS(s.schema,P,C,n,m,a,n.namespace,!1,new Set,lWr({schema:s,logger:n.logger})):u?Sh.primitive({nameOverride:void 0,generatedName:A,title:void 0,schema:G0.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:lWr({schema:s,logger:n.logger})}),description:void 0,availability:l,namespace:void 0,groupName:void 0}):Sh.optional({nameOverride:void 0,generatedName:A,title:void 0,value:Sh.primitive({nameOverride:void 0,generatedName:A,title:void 0,schema:G0.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:lWr({schema:s,logger:n.logger})}),description:void 0,availability:void 0,namespace:void 0,groupName:void 0}),description:void 0,availability:l,namespace:void 0,groupName:void 0,inline:void 0});if(s.in==="header"&&s.schema!=null&&!Kg(s.schema)&&s.schema.default!=null){let z=s.schema.default;typeof z=="string"&&z.length>0&&(M=Sh.literal({nameOverride:void 0,generatedName:A,title:void 0,value:eW.string(z),description:void 0,availability:l,namespace:void 0,groupName:void 0}))}let T={name:s.name,schema:M,description:s.description,parameterNameOverride:aXy(s),availability:l,source:a};s.in==="query"?o.queryParameters.push(T):s.in==="path"?o.pathParameters.push({...T,variableReference:oXy(s)}):s.in==="header"?!sJC.has(s.name.toLowerCase())&&!n.authHeaders.has(s.name)?o.headers.push({...T,env:void 0}):n.logger.debug(`Ignoring ${s.name} header, in ${t.toUpperCase()} ${e}`):n.logger.warn(`Skipping ${s.in} parameter, ${s.name}, in ${t.toUpperCase()} ${e}`)}return o}var sJC=new Set(["user-agent","content-length","content-type","x-forwarded-for","cookie","origin","content-disposition","x-ping-custom-domain"]);function uXy(e,t){for(let r of Object.keys(e))if(r.includes("text/event-stream")){let n=e[r];if(n==null)continue;let i=n.schema;return{contentType:r,schema:i??{},examples:vko(n,t)}}}function cJC(e){return e.includes("json")||e==="*/*"}function IRf({content:e,context:t}){for(let[r,n]of Object.entries(e))if(wzs({mediaType:r,mediaTypeObject:n,context:t})!=null)return[r,n]}function wzs({mediaType:e,mediaTypeObject:t,context:r}){if(!cJC(e))return;let n=t.schema;return{contentType:e.includes("*")?void 0:e,schema:n??{},examples:vko(t,r)}}function jzs({content:e,context:t}){let r=IRf({content:e,context:t});if(!r)return;let[n,i]=r;return wzs({mediaType:n,mediaTypeObject:i,context:t})}function sXy(e,t){for(let r of Object.keys(e)){let n=e[r];if(n==null)continue;return{schema:n.schema??{},examples:vko(n,t)}}}function vko(e,t){let r=[];e.example!=null&&r.push({name:void 0,value:e.example,description:void 0});let n=ev(e,xbe.EXAMPLES);return n!=null&&Object.keys(n).length>0&&r.push(...Object.entries(n).map(([i,a])=>({name:a.summary??i,value:a.value,description:a.description}))),e.examples!=null&&Object.keys(e.examples).length>0&&r.push(...Object.entries(e.examples).map(([i,a])=>{let o=Kg(a)?t.resolveExampleReference(a):a;return{name:o.summary??i,value:o.value,description:o.description}})),r}function lJC({content:e,context:t}){for(let[r,n]of Object.entries(e))if(lXy({mediaType:r,mediaTypeObject:n,context:t}))return[r,n]}function lXy({mediaType:e,mediaTypeObject:t,context:r}){if(J8.parse(e)?.isURLEncoded())return{schema:t.schema,contentType:e,examples:vko(t,r)}}function fJC({content:e}){for(let[t,r]of Object.entries(e))if(fXy({mediaType:t,mediaTypeObject:r}))return[t,r]}function fXy({mediaType:e,mediaTypeObject:t}){if(J8.parse(e)?.isMultipart())return{schema:t.schema,encoding:t.encoding}}function dXy({mediaType:e}){return J8.parse(e)?.isBinary()??!1}function dJC({content:e}){for(let[t,r]of Object.entries(e))if(dXy({mediaType:t}))return[t,r]}function pJC(e,t){let r=Kg(e)?MRf(e,t):{id:void 0,schema:e};return Object.entries(r.schema.properties??{}).find(([n,i])=>!Kg(i)&&i.type==="string"&&i.format==="binary")!=null}function Szs({content:e,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o}){let c=dJC({content:e});if(c){let[m,A]=c;return fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o})}let d=fJC({content:e}),s=IRf({content:e,context:n}),u=_JC({json:s,multipart:d,document:r,visitor:{json:([m,A])=>fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o}),multipart:([m,A])=>fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o}),neither:()=>{}}});if(u)return u;let l=lJC({content:e,context:n});if(l){let[m,A]=l;return fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o})}}function _JC({json:e,multipart:t,document:r,visitor:n}){if(!e&&!t)return n.neither();let[,i]=e??[void 0,void 0],[,a]=t??[void 0,void 0];return!i?.schema&&!a?.schema?n.neither():i?.schema&&a?.schema?i.schema&&pJC(i.schema,r)?n.multipart(t):n.json(e):i?.schema?n.json(e):a?.schema?n.multipart(t):n.neither()}function fWr({mediaType:e,mediaTypeObject:t,description:r,document:n,context:i,requestBreadcrumbs:a,source:o,namespace:c}){let d=hJC({mediaTypeObject:t});if(dXy({mediaType:e}))return uIe.octetStream({description:r,source:o,sdkMethodName:d,contentType:e});let s=fXy({mediaType:e,mediaTypeObject:t}),u=s?.schema,l=s?.encoding;if(u){let P=Kg(u)?MRf(u,n):{id:void 0,schema:u},C=CS(P.schema,!1,!1,i,a,o,c,!1),M=[];if(C.type==="object")for(let T of C.properties){let{isFile:z,isOptional:U,isArray:R,description:V}=Ezs({schema:T.schema});if(z){let Y=cXy(T.key,l);M.push({key:T.key,schema:nWr.file({isOptional:U,isArray:R,description:V}),description:V,contentType:Y,exploded:!1,encoding:Y==null?i.options.defaultFormParameterEncoding:void 0})}else{let Y=cXy(T.key,l);M.push({key:T.key,schema:nWr.json(T.schema),description:void 0,contentType:Y,exploded:l?.[T.key]?.explode,encoding:Y==null?i.options.defaultFormParameterEncoding:vJC(Y)})}}return uIe.multipart({name:Kg(u)&&i.getNumberOfOccurrencesForRef(u)===1?P.id:void 0,description:P.schema.description,properties:M,source:o,sdkMethodName:d})}let m=wzs({mediaType:e,mediaTypeObject:t,context:i});if(m){let P=CS(m.schema,!1,!1,i,a,o,c,!0);return uIe.json({description:void 0,schema:P,contentType:m.contentType,fullExamples:m.examples,additionalProperties:!Kg(m.schema)&&dko(m.schema.additionalProperties,i.options),source:o,sdkMethodName:d})}let A=lXy({mediaType:e,mediaTypeObject:t,context:i});if(A!=null&&A.schema!=null){let P=CS(A.schema,!1,!1,i,a,o,c,!1);return uIe.formUrlEncoded({schema:P,description:r,contentType:A.contentType,source:o,fullExamples:A.examples,additionalProperties:!1,sdkMethodName:d})}}function hJC({mediaTypeObject:e}){return ev(e,pb.SDK_METHOD_NAME)}var yJC={"application/json":"json"};function vJC(e){return e?yJC[e]:void 0}function MRf(e,t){if(!e.$ref.startsWith(dda))throw new Error(`Failed to resolve schema reference because of unsupported prefix: ${e.$ref}`);let r=e2i(e);if(r==null)throw new Error(`Failed to resolve schema reference because missing schema id: ${e.$ref}`);let n=t.components?.schemas?.[r];if(n==null)throw new Error(`Failed to resolve schema reference because missing: ${e.$ref}`);return Kg(n)?MRf(n,t):{id:r,schema:n}}function Ezs({schema:e,isOptional:t,isArray:r,description:n}){return gJC(e)?Ezs({schema:e.value,isOptional:!0,isArray:r,description:e.description}):mJC(e)?Ezs({schema:e.value,isOptional:t,isArray:r,description:e.description}):OJC(e)?Ezs({schema:e.value,isOptional:t,isArray:!0,description:e.description}):bJC(e)?{isFile:!0,isOptional:t??!1,isArray:r??!1,description:n??e.description}:{isFile:!1,isOptional:t??!1,isArray:r??!1,description:void 0}}function bJC(e){return e.type==="primitive"&&e.schema.type==="string"&&e.schema.format==="binary"}function gJC(e){return e.type==="optional"}function mJC(e){return e.type==="nullable"}function OJC(e){return e.type==="array"}function cXy(e,t){return t?.[e]?.contentType}var BRf={400:"BadRequestError",401:"UnauthorizedError",402:"PaymentRequiredError",403:"ForbiddenError",404:"NotFoundError",405:"MethodNotAllowedError",406:"NotAcceptableError",407:"ProxyAuthenticationRequiredError",408:"RequestTimeoutError",409:"ConflictError",410:"GoneError",411:"LengthRequiredError",412:"PreconditionFailedError",413:"ContentTooLargeError",414:"URITooLongError",415:"UnsupportedMediaTypeError",416:"RangeNotSatisfiableError",417:"ExpectationFailedError",418:"ImATeapotError",419:"AuthenticationTimeoutError",420:"MethodFailureError",421:"MisdirectedRequestError",422:"UnprocessableEntityError",423:"LockedError",424:"FailedDependencyError",425:"TooEarlyError",426:"UpgradeRequiredError",428:"PreconditionError",429:"TooManyRequestsError",430:"RequestHeaderFieldsTooLargeError",431:"RequestHeaderFieldsTooLargeError",444:"NoResponseError",449:"RetryWithError",450:"BlockedByWindowsParentalControlsError",451:"UnavailableForLegalReasonsError",498:"InvalidTokenError",499:"ClientClosedRequestError",500:"InternalServerError",501:"NotImplementedError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError",505:"HTTPVersionNotSupportedError",506:"VariantAlsoNegotiatesError",507:"InsufficientStorageError",508:"LoopDetectedError",509:"BandwidthLimitExceededError",510:"NotExtendedError",511:"NetworkAuthenticationRequiredError"},pXy=new Set(Object.values(BRf));var AJC=["200","201","202","204"];function hXy({operationContext:e,responses:t,context:r,responseBreadcrumbs:n,responseStatusCode:i,streamFormat:a,source:o}){if(t==null)return{value:void 0,errors:{}};let c=PJC({responses:t,context:r,source:o,namespace:r.namespace}),d=!1,s;for(let u of i!=null?[i]:AJC){let l=t[u];l!=null&&(d=!0,s==null&&(s=_Xy({operationContext:e,response:l,context:r,responseBreadcrumbs:n,streamFormat:a,source:o,namespace:r.namespace,statusCode:typeof u=="string"?parseInt(u):u})))}if(s==null&&!d&&t.default!=null&&(s=_Xy({operationContext:e,response:t.default,context:r,responseBreadcrumbs:n,streamFormat:a,source:o,namespace:r.namespace})),s!=null)switch(s.type){case"json":return{value:s,errors:c};case"streamingJson":case"streamingSse":return{value:s,errors:c};case"bytes":case"file":case"text":case"streamingText":return{value:s,errors:c};default:ks(s)}return{value:void 0,errors:c}}function _Xy({operationContext:e,streamFormat:t,response:r,context:n,responseBreadcrumbs:i,source:a,namespace:o,statusCode:c}){let d=Kg(r)?n.resolveResponseReference(r):r;if(d.content!=null&&Object.entries(d.content).find(([m,A])=>{if(A.schema==null)return!1;let P=Kg(A.schema)?n.resolveSchemaReference(A.schema):A.schema;return P.type==="string"&&P.format==="binary"}))return n.options.useBytesForBinaryResponse&&t==null?cL.bytes({description:d.description,source:a,statusCode:c}):cL.file({description:d.description,source:a,statusCode:c});let s=uXy(d.content??{},n);if(s!=null&&t!=null)switch(t){case"json":return cL.streamingJson({statusCode:c,description:d.description,responseProperty:ev(e.operation,pb.RESPONSE_PROPERTY),fullExamples:s.examples,schema:CS(s.schema,!1,!1,n,i,a,o),source:a});case"sse":return cL.streamingSse({description:d.description,responseProperty:void 0,fullExamples:s.examples,schema:CS(s.schema,!1,!1,n,i,a,o),source:a,statusCode:c})}let u=jzs({context:n,content:d.content??{}});if(u){if(t!=null)switch(t){case"json":return cL.streamingJson({description:d.description,responseProperty:void 0,fullExamples:u.examples,schema:CS(u.schema,!1,!1,n,i,a,o),source:a,statusCode:c});case"sse":return cL.streamingSse({description:d.description,responseProperty:void 0,fullExamples:u.examples,schema:CS(u.schema,!1,!1,n,i,a,o),source:a,statusCode:c})}return cL.json({description:d.description,schema:CS(u.schema,!1,!1,n,i,a,o),responseProperty:ev(e.operation,pb.RESPONSE_PROPERTY),fullExamples:u.examples,source:a,statusCode:c})}for(let[l,m]of Object.entries(d.content??{})){let A=J8.parse(l);if(A!=null){if(A.isOctetStream()||A.isPDF()||A.isAudio()||A.isImage()||A.isVideo()||A.isMultiPartMixed())return cL.file({description:d.description,source:a,statusCode:c});if(A.isPlainText()){let P=m.schema;if(P==null)return cL.text({description:d.description,source:a,statusCode:c});let C=Kg(P)?n.resolveSchemaReference(P):P;return C.type==="string"&&C.format==="byte"?cL.file({description:d.description,source:a,statusCode:c}):cL.text({description:d.description,source:a,statusCode:c})}}}}function PJC({responses:e,context:t,source:r,namespace:n}){let i={};for(let[a,o]of Object.entries(e)){if(a==="default")continue;let c=parseInt(a);if(c<400||c>600)continue;let d=Kg(o)?t.resolveResponseReference(o):o,s=sXy(d.content??{},t),u=BRf[c];if(u==null){t.logger.warn(`No error name found for status code ${a}`);continue}i[c]={statusCode:c,nameOverride:void 0,generatedName:u,description:d.description,schema:CS(s?.schema??{},!1,!1,t,[u,"Body"],r,n),fullExamples:s?.examples,source:r}}return i}function uwi({operationContext:e,context:t,responseStatusCode:r,suffix:n,streamFormat:i,source:a}){let{document:o,operation:c,path:d,method:s,baseBreadcrumbs:u}=e,l=ev(c,pb.IDEMPOTENT),m=ev(c,[pb.REQUEST_NAME_V1,pb.REQUEST_NAME_V2]),A=[...u,"Request"],P=Pzs({parameters:[...e.pathItemParameters,...e.operationParameters],context:t,requestBreadcrumbs:A,path:d,httpMethod:s,source:a}),C=/{([^}]+)}/g,M=[...d.matchAll(C)].map(ee=>ee[1]).filter(ee=>ee!==void 0);if(M.length>0){let ee=new Map(P.pathParameters.map(be=>[be.name,be])),ne=[],me=new Set;for(let be of M){let Ae=ee.get(be);me.add(be),Ae?ne.push(Ae):ne.push({name:be,variableReference:void 0,parameterNameOverride:void 0,availability:void 0,source:a,schema:Sh.primitive({schema:G0.string({default:void 0,example:void 0,format:void 0,maxLength:void 0,minLength:void 0,pattern:void 0}),description:void 0,generatedName:"",nameOverride:void 0,namespace:void 0,groupName:void 0,availability:void 0,title:void 0}),description:void 0})}for(let be of P.pathParameters)me.has(be.name)||ne.push(be);P.pathParameters=ne}let T=(()=>{if(e.method==="GET")return[void 0];if(!c.requestBody)return[void 0];let ee=Kg(c.requestBody)?t.resolveRequestBodyReference(c.requestBody):c.requestBody,ne=Object.values(ee.content).every(be=>jJC({mediaTypeObject:be})!=null),me=[];if(ne)return me.push(...Object.entries(ee.content).map(([be,Ae])=>{let ye=fWr({mediaType:be,mediaTypeObject:Ae,description:ee.description,document:o,context:new pda({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:A,source:a,namespace:t.namespace});return yXy({context:t,convertedParameters:P})&&ye!=null&&(ye.type==="json"||ye.type==="formUrlEncoded")&&ye.schema.type!=="object"&&c.requestBody!=null?ye=fWr({mediaType:be,mediaTypeObject:Ae,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A,"Body"],source:a,namespace:t.namespace}):c.requestBody!=null&&(ye=fWr({mediaType:be,mediaTypeObject:Ae,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A],source:a,namespace:t.namespace})),ye}).filter(be=>be!=null)),me.length===0?[void 0]:me;{let be=Szs({content:ee.content,description:ee.description,document:o,context:new pda({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:A,source:a,namespace:t.namespace});return yXy({context:t,convertedParameters:P})&&be!=null&&(be.type==="json"||be.type==="formUrlEncoded")&&be.schema.type!=="object"&&c.requestBody!=null?be=Szs({content:ee.content,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A,"Body"],source:a,namespace:t.namespace}):c.requestBody!=null&&(be=Szs({content:ee.content,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A],source:a,namespace:t.namespace})),[be]}})(),z=T.length>1,U=[...u,"Response"],R=hXy({operationContext:e,streamFormat:i,responses:c.responses,context:t,responseBreadcrumbs:U,responseStatusCode:r,source:a}),V=iXy(c),Y=nXy(c),re=rXy(e,c,t),Z=ev(c,pb.SERVER_NAME_V2);return T.map(ee=>({summary:c.summary,internal:ev(c,xbe.INTERNAL),idempotent:l,audiences:ev(c,pb.AUDIENCES)??[],operationId:c.operationId!=null&&n!=null?c.operationId+"_"+n:c.operationId,tags:t.resolveTagsToTagIds(c.tags),namespace:t.namespace,sdkName:EJC({operationContext:e,request:ee}),pathParameters:P.pathParameters,queryParameters:P.queryParameters,headers:P.headers,requestNameOverride:m??void 0,generatedRequestName:Cie(z?wJC({breadcrumbs:A,request:ee}):A,t.options.preserveSchemaIds),request:ee,response:R.value,errors:R.errors,servers:Z!=null?[{name:Z,url:void 0,audiences:void 0}]:(c.servers??[]).map(ne=>Azs(ne,{groupMultiApiEnvironments:t.options.groupMultiApiEnvironments})),description:c.description,authed:DJC(c,o),security:SJC(c),availability:Y,method:s,path:d,examples:re,pagination:e.pagination,source:a,retries:V}))}function wJC({breadcrumbs:e,request:t}){return t?[...e,t.type]:e}function jJC({mediaTypeObject:e}){return ev(e,pb.SDK_METHOD_NAME)}function EJC({operationContext:e,request:t}){return!t||!t.sdkMethodName?e.sdkMethodName:e.sdkMethodName?{groupName:[...e.sdkMethodName.groupName],methodName:t.sdkMethodName??e.sdkMethodName.methodName}:{groupName:[],methodName:t.sdkMethodName}}function SJC(e){return e.security??[]}function DJC(e,t){return e.security!=null?Object.keys(e.security).length>0:t.security!=null?Object.keys(t.security).length>0:!1}function yXy({context:e,convertedParameters:t}){return e.options.inlinePathParameters&&t.pathParameters.length>0||t.queryParameters.length>0||t.headers.length>0}function bXy({operationContext:e,context:t,asyncExtension:r,source:n}){let{operation:i,pathItemParameters:a,operationParameters:o}=e,c=r.discriminant.name,d=r.discriminant.value,s=r["response-status-code"],u=vXy({context:t,headerToIgnore:c,parameters:a}),l=vXy({context:t,headerToIgnore:c,parameters:o}),m=uwi({operationContext:{...e,pathItemParameters:u,operationParameters:l,operation:{...i,responses:Object.fromEntries(Object.entries(i.responses).filter(([P])=>parseInt(P)!==s))}},context:t,streamFormat:void 0,source:n}),A=uwi({operationContext:{...e,pathItemParameters:u,operationParameters:l,baseBreadcrumbs:[...e.baseBreadcrumbs,"async"]},context:t,suffix:"async",responseStatusCode:s,streamFormat:void 0,source:n});return A.forEach(P=>{P.headers.push({name:c,schema:Sh.literal({nameOverride:void 0,generatedName:Cie([c],t.options.preserveSchemaIds),title:void 0,description:void 0,availability:void 0,value:eW.string(d),namespace:void 0,groupName:void 0}),description:void 0,parameterNameOverride:void 0,env:void 0,availability:void 0,source:n})}),{sync:m,async:A}}function vXy({context:e,headerToIgnore:t,parameters:r}){return r.filter(n=>{let i=Kg(n)?e.resolveParameterReference(n):n;return!(i.in==="header"&&i.name===t)})}var TRf="stream";function AXy({operationContext:e,context:t,streamingExtension:r}){switch(r.type){case"stream":return{streaming:uwi({operationContext:e,context:t,streamFormat:r.format,source:t.source}),nonStreaming:[]};case"streamCondition":{let n=gXy({context:t,operation:e.operation,streamingExtension:r,isStreaming:!0});if(n?.schemaReference!=null){let s=e2i(n.schemaReference);s!=null&&t.excludeSchema(s)}let i=mXy({operation:e.operation,response:r.responseStream}),a=uwi({operationContext:{...e,sdkMethodName:e.sdkMethodName!=null?{groupName:e.sdkMethodName.groupName,methodName:e.sdkMethodName.methodName+"_"+TRf}:void 0,operation:{...e.operation,description:r.streamDescription??e.operation.description,requestBody:n?.requestBody,responses:i},baseBreadcrumbs:[...e.baseBreadcrumbs,TRf]},context:t,streamFormat:r.format,suffix:TRf,source:t.source});a.forEach(s=>{s.examples=s.examples.filter(u=>OXy(u,t)!==!1)});let o=gXy({context:t,operation:e.operation,streamingExtension:r,isStreaming:!1}),c=mXy({operation:e.operation,response:r.response}),d=uwi({streamFormat:void 0,operationContext:{...e,operation:{...e.operation,requestBody:o?.requestBody,responses:c}},context:t,source:t.source});return d.forEach(s=>{s.examples=s.examples.filter(u=>OXy(u,t)!==!0)}),{streaming:a,nonStreaming:d}}default:ks(r)}}function gXy({context:e,operation:t,streamingExtension:r,isStreaming:n}){if(t.requestBody==null)return;let i=Kg(t.requestBody)?e.resolveRequestBodyReference(t.requestBody):t.requestBody,a=jzs({content:i.content,context:e});if(a==null)return;let o=Kg(a.schema)?e.resolveSchemaReference(a.schema):a.schema;if(o.allOf==null&&o.properties==null)return;let c=o.properties?.[r.streamConditionProperty];c!=null&&Kg(c)&&(c=void 0);let d={...o,properties:{...o.properties,[r.streamConditionProperty]:{type:"boolean","x-fern-boolean-literal":n,...c??{}}},title:void 0,required:[...o.required??[],r.streamConditionProperty]};return{requestBody:{content:{[J8.APPLICATION_JSON]:{schema:d}}},schemaReference:Kg(a.schema)?a.schema:void 0}}function mXy({operation:e,response:t}){return{...e.responses,200:{description:"",content:{[J8.APPLICATION_JSON]:{schema:t}}}}}function OXy(e,t){return e._visit({unknown:r=>{let n=hZ.serialization.ExampleEndpointCallSchema.parse(r);if(n.ok&&n.value.response!=null)return n.value.response.stream!=null},full:()=>{},_other:()=>{}})}function PXy({context:e,operationContext:t,source:r}){let{document:n,operation:i,path:a,method:o,baseBreadcrumbs:c,sdkMethodName:d}=t,s=[...c,"Payload"],u=Pzs({parameters:[...t.pathItemParameters,...t.operationParameters],context:e,requestBreadcrumbs:s,path:a,httpMethod:o,source:r});if(i.requestBody==null)return e.logger.error(`Skipping webhook ${o.toUpperCase()} ${a}: Missing a request body`),[];let l=i.operationId;if(l==null)return e.logger.error(`Skipping webhook ${a} because no operation id present`),[];if(o!=="POST"&&o!=="GET")return e.logger.error(`Skipping webhook ${o.toUpperCase()} ${a}: Not POST or GET`),[];let m=Kg(i.requestBody)?e.resolveRequestBodyReference(i.requestBody):i.requestBody;return Object.entries(m.content).map(([A,P])=>fWr({mediaType:A,mediaTypeObject:P,description:m.description,document:n,context:e,requestBreadcrumbs:[...c,"Payload"],source:r,namespace:e.namespace})).filter(A=>A!=null).map(A=>{if(A==null||A.type!=="json"&&A.type!=="formUrlEncoded"){e.logger.error(`Skipping webhook ${a} because non-json and non-formUrlEncoded request body`);return}return{summary:i.summary,audiences:ev(i,pb.AUDIENCES)??[],sdkName:d,namespace:e.namespace,method:o,operationId:l,tags:e.resolveTagsToTagIds(i.tags),headers:u.headers,generatedPayloadName:Cie(s,e.options.preserveSchemaIds),payload:A.schema,description:i.description,examples:CJC(A.fullExamples),source:r}}).filter(A=>A!=null)}function CJC(e){if(e==null)return[];let t=[];for(let r of e){let n=r2i(r.value);n!=null&&t.push({description:r.description,name:r.name,payload:n})}return t}function qRf({context:e,pathItemContext:t,operation:r,convertToWebhook:n}){let i=ev(r,pb.IGNORE);if(i!=null&&i){e.logger.debug(`${t.method.toUpperCase()} ${t.path} is marked with x-fern-ignore. Skipping.`);return}let a=IJC(r,e),o=JYy(e.document,r),c={...t,sdkMethodName:a,baseBreadcrumbs:MJC({operation:r,sdkMethodName:a,httpMethod:t.method,path:t.path,shouldUseIdiomaticRequestNames:e.options.shouldUseIdiomaticRequestNames}),operation:r,operationParameters:r.parameters??[],pagination:o};if(n)return{type:"webhook",value:PXy({context:e,operationContext:c,source:e.source})};let d=HYy(r);if(d!=null){let l=AXy({context:e,operationContext:c,streamingExtension:d});return l!=null?{type:"streaming",streaming:l.streaming,nonStreaming:l.nonStreaming}:void 0}let s=VYy(r);if(s!=null){let l=bXy({context:e,operationContext:c,asyncExtension:s,source:e.source});return{type:"async",async:l.async,sync:l.sync}}return{type:"http",value:uwi({context:e,operationContext:c,streamFormat:void 0,source:e.source})}}function IJC(e,t){let r=ev(e,pb.SDK_METHOD_NAME),n=ev(e,pb.SDK_GROUP_NAME)??[];if(r!=null){let i=typeof n=="string"?[n]:n;return i=t.resolveGroupName(i),{groupName:i,methodName:r}}}function MJC({sdkMethodName:e,operation:t,httpMethod:r,path:n,shouldUseIdiomaticRequestNames:i}){let a=[];if(e!=null){if(i&&a.push(e.methodName),e.groupName.length>0){let o=e.groupName[e.groupName.length-1];o!=null&&a.push(typeof o=="string"?o:o.name)}i||a.push(e.methodName)}else t.operationId!=null?a.push(t.operationId):a.push(FA(`${r}_${n.split("/").join("_")}`));return a}function wXy(e,t,r,n){let i=[],a=EXy(t),o={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let c of a){if(n.filter.skipEndpoint({method:c.method,path:e})){n.logger.debug(`Skipping endpoint "${c.method} ${e}"`);continue}let d=BJC({operation:c.operation}),s=qRf({context:n,pathItemContext:{...o,method:c.method},operation:c.operation,convertToWebhook:d});s&&i.push(s)}return i}function jXy(e,t,r,n){let i=[],a=EXy(t),o={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let c of a){if(n.filter.skipEndpoint({method:c.method,path:e})){n.logger.debug(`Skipping endpoint "${c.method} ${e}"`);continue}let d=qRf({context:n,pathItemContext:{...o,method:c.method},operation:c.operation,convertToWebhook:!0});d&&i.push(d)}return i}function EXy(e){let t=[];return e.get!=null&&t.push({method:Nde.Get,operation:e.get}),e.post!=null&&t.push({method:Nde.Post,operation:e.post}),e.put!=null&&t.push({method:Nde.Put,operation:e.put}),e.delete!=null&&t.push({method:Nde.Delete,operation:e.delete}),e.patch!=null&&t.push({method:Nde.Patch,operation:e.patch}),e.head!=null&&t.push({method:Nde.Head,operation:e.head}),t}function BJC({operation:e}){return ev(e,[pb.WEBHOOK])??!1}function SXy(e){let t=ev(e,pb.BASIC_AUTH_USERNAME_VARIABLE_NAME),r=ev(e,pb.BASIC_AUTH_PASSWORD_VARIABLE_NAME);return{usernameVariable:t,passwordVariable:r}}function DXy(e){return ev(e,pb.FERN_BASIC_AUTH)}function IXy(e,t,r,n){if(Kg(e)){if(n==null)throw new Error(`Converting referenced security schemes requires context: ${JSON.stringify(e)}`);let i=n.resolveSecuritySchemeReference(e);return CXy(i,t,r)}return CXy(e,t,r)}function CXy(e,t,r){try{if(e.type==="apiKey"&&e.in==="header"){let n=ev(e,xbe.BEARER_FORMAT),i=ev(e,pb.FERN_HEADER_AUTH);return Tde.header({headerName:e.name,prefix:n!=null?"Bearer":i?.prefix,headerVariableName:i?.name??ev(e,pb.HEADER_VARIABLE_NAME),headerEnvVar:i?.env})}else if(e.type==="http"&&e.scheme?.toLowerCase()==="bearer"){let n=ev(e,pb.FERN_BEARER_TOKEN);return Tde.bearer({tokenVariableName:n?.name??ev(e,pb.BEARER_TOKEN_VARIABLE_NAME),tokenEnvVar:n?.env})}else if(e.type==="http"&&e.scheme?.toLowerCase()==="basic"){let n=DXy(e),i=SXy(e);return Tde.basic({usernameVariableName:n?.username?.name??i.usernameVariable,usernameEnvVar:n?.username?.env,passwordVariableName:n?.password?.name??i.passwordVariable,passwordEnvVar:n?.password?.env})}else{if(e.type==="openIdConnect")return Tde.bearer({tokenVariableName:void 0,tokenEnvVar:void 0});if(e.type==="oauth2")return Tde.oauth({scopesEnum:TJC(e,t)})}}catch(n){r.logger.debug(`Error converting security scheme: ${n?.message}`)}r.logger.warn(`Skipping security scheme: ${JSON.stringify(e,null)} - not currently supported. Please reach out to Fern support team!`)}function TJC(e,t){let r=e.flows.authorizationCode?.scopes??e.flows.clientCredentials?.scopes??e.flows.implicit?.scopes??e.flows.password?.scopes;if(r!=null){let n=k8i({nameOverride:void 0,generatedName:"OauthScope",title:void 0,enumValues:Object.keys(r),fernEnum:Object.fromEntries(Object.entries(r).map(([a,o])=>[a,{description:o}])),_default:void 0,description:void 0,availability:void 0,enumVarNames:void 0,wrapAsOptional:!1,wrapAsNullable:!1,namespace:void 0,groupName:void 0,context:void 0,source:t,inline:void 0}),i=k6(n);if(i.type==="enum")return i}}function MXy(e){return ev(e,pb.BASE_PATH)}var qJC=nl.record(nl.string(),nl.object({summary:nl.string().optional(),description:nl.string().optional()}));function BXy({document:e,context:t}){return lko(e,pb.GROUPS,qJC,t.logger)}function TXy({context:e,document:t}){return ev(t,pb.FERN_VERSION)??void 0}function qXy(e){let t=ev(e,pb.FERN_GLOBAL_HEADERS),r=[];for(let n of t??[])r.push({...n,schema:n.type!=null?fko({fernType:n.type,description:void 0,availability:void 0,generatedName:n.name??n.header,title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function RXy(e){let t=ev(e,pb.FERN_IDEMPOTENCY_HEADERS),r=[];for(let n of t??[])r.push({...n,schema:n.type!=null?fko({fernType:n.type,description:void 0,availability:void 0,generatedName:n.name??n.header,title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function NXy(e,t){let r=ev(e,pb.SDK_VARIABLES);return r==null?{}:Object.fromEntries(Object.entries(r).map(([n,i])=>{if(i.type==="string")return[n,{nameOverride:void 0,generatedName:Cie([n],t),title:i.title,schema:Lq.string({default:kio(i),pattern:i.pattern,format:i.format,minLength:i.minLength,maxLength:i.maxLength}),description:i.description,availability:void 0,namespace:void 0,groupName:void 0}];throw new Error(`Variable ${n} has unsupported schema ${JSON.stringify(i)}`)}))}var RJC="webhooks";function FXy(e){return ev(e,RJC)??{}}var bko=class extends iao{nonRequestReferencedSchemas=new Set;twoOrMoreRequestsReferencedSchemas=new Set;singleRequestReferencedSchemas=new Set;discriminatedUnionReferences={};discriminatedUnionMetadata={};schemasToExclude=new Set;constructor({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:o}){super({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:o})}getDummy(){return new pda({document:this.document,taskContext:this.taskContext,options:this.options,source:this.source,namespace:this.namespace})}markSchemaAsReferencedByNonRequest(t){this.nonRequestReferencedSchemas.add(t)}markSchemaAsReferencedByRequest(t){this.singleRequestReferencedSchemas.has(t)?this.twoOrMoreRequestsReferencedSchemas.add(t):this.singleRequestReferencedSchemas.add(t)}getReferencedSchemas(){return new Set([...this.nonRequestReferencedSchemas,...this.twoOrMoreRequestsReferencedSchemas])}markReferencedByDiscriminatedUnion(t,r,n){let i=this.discriminatedUnionReferences[t.$ref];i!=null?(i.discriminants.add(r),i.numReferences+=n):this.discriminatedUnionReferences[t.$ref]={discriminants:new Set([r]),numReferences:n}}getReferencesFromDiscriminatedUnion(t){return this.discriminatedUnionReferences[t.$ref]}markSchemaWithDiscriminantValue(t,r,n){let i=this.discriminatedUnionMetadata[t.$ref];i!=null?i.discriminants.set(r,n):this.discriminatedUnionMetadata[t.$ref]={discriminants:new Map([[r,n]])}}getDiscriminatedUnionMetadata(t){return this.discriminatedUnionMetadata[t.$ref]}excludeSchema(t){this.schemasToExclude.add(t)}isSchemaExcluded(t){return this.schemasToExclude.has(t)}};function xXy(e){return ev(e,pb.RESOLUTIONS)}function zXy({openapi:e}){let t=xXy(e);if(t==null)return e;let r={};for(let n of t){let i=`#/components/schemas/${n.name}`;for(let a of n.resolutions)e=NJC({openapi:e,schemaReference:a,schemaName:n.name}),e=QXy({openapi:e,replaceReference:a,schemaReference:i,replacedReferences:r}),r={...r,...Object.fromEntries(n.resolutions.map(o=>[i,o]))}}return e}function NJC({openapi:e,schemaReference:t,schemaName:r}){let n=t.replace("#/","").split("/").map(a=>a.replaceAll("~1","/")),i=e;for(let a of n){let o=i[a];if(o==null)return e;i=o}return e.components==null&&(e.components={}),e.components.schemas==null&&(e.components.schemas={}),e.components.schemas[r]=i,e}function QXy({openapi:e,replaceReference:t,schemaReference:r,replacedReferences:n}){let i=Object.keys(n).filter(d=>t.startsWith(d)).sort((d,s)=>s.length-d.length)[0];if(i!=null){let d=n[i];if(d!=null){let s=r.replace(i,d);return QXy({openapi:e,replaceReference:t,schemaReference:s,replacedReferences:{}})}}let a=t.replace("#/","").split("/").map(d=>d.replaceAll("~1","/")),o=e;for(let d of a.slice(0,-1)){let s=o[d];if(s==null)return e;o=s}let c=a[a.length-1];return c==null||(o[c]={$ref:r}),e}function UXy({openApi:e,taskContext:t,options:r,source:n,namespace:i}){e=zXy({openapi:e});let a=new bko({document:e,taskContext:t,authHeaders:new Set,options:r,source:n,namespace:i}),o=Object.fromEntries(Object.entries(e.components?.securitySchemes??{}).map(([ee,ne])=>{let me=IXy(ne,n,t,a);return me==null?null:[ee,me]}).filter(ee=>ee!==null)),c=new Set(...Object.entries(o).map(([ee,ne])=>ne.type==="basic"||ne.type==="bearer"?"Authorization":ne.type==="header"?ne.headerName:null)),d=NXy(e,r.preserveSchemaIds),s=qXy(e),u=RXy(e),l=r.audiences??[],m=[],A=[],P=new bko({document:e,taskContext:t,authHeaders:c,options:r,source:n,namespace:i});P.filter.hasEndpoints()&&t.logger.debug("Endpoint filter applied..."),Object.entries(e.paths??{}).forEach(([ee,ne])=>{if(ne==null)return;let me=wXy(ee,ne,e,P);for(let be of me){let Ae=LXy({operation:be});if(!(l.length>0&&!l.some(ye=>Ae.includes(ye))))switch(be.type){case"async":m.push(...be.sync),m.push(...be.async);break;case"http":m.push(...be.value);break;case"streaming":m.push(...be.streaming),be.nonStreaming&&m.push(...be.nonStreaming);break;case"webhook":A.push(...be.value);break;default:ks(be)}}}),Object.entries(FXy(e)).forEach(([ee,ne])=>{if(ne==null)return;t.logger.debug(`Converting path ${ee}`);let me=jXy(ee,ne,e,P);for(let be of me){let Ae=LXy({operation:be});l.length>0&&!l.some(ye=>Ae.includes(ye))||A.push(...be.value)}});let C=Object.fromEntries(Object.entries(e.components?.schemas??{}).map(([ee,ne])=>{let me=ev(ne,pb.SDK_NAMESPACE);if(!Kg(ne)){let be=ev(ne,pb.IGNORE);if(be!=null&&be)return[];if(pXy.has(ee))return[ee,CS({...ne,"x-fern-type-name":`${ee}Body`},!1,!1,P,[ee],n,me??i)]}return[ee,CS(ne,!1,!1,P,[ee],n,me??i)]}).filter(ee=>ee.length>0)),M=FJC(C,P,n),T=xJC(M,P),z={};for(let[ee,ne]of Object.entries(T)){let me=k6(ne);P.isSchemaExcluded(ee)||(z[ee]=me)}let U=new n2i(T,P.nonRequestReferencedSchemas,P),R=A.map(ee=>{let me=ee.examples;if(!r.disableExamples&&me.length===0){let be=U.buildExample({schema:ee.payload,exampleId:void 0,example:void 0,skipReadonly:!1,options:{ignoreOptionals:!1,isParameter:!1}});be!=null&&(me=[{name:void 0,description:void 0,payload:be}])}return{...ee,payload:k6(ee.payload),examples:me}}),V=new yzs(T,P,s),Y=m.map(ee=>{let ne=ee.examples,me=ne;if(!r.disableExamples&&(ne.length===0||ne.every(hko))){let ye=V.buildEndpointExample(ee);ye.length>0&&(me=[...ye,...ne.filter(Me=>!hko(Me))])}let be=ee.request,Ae=ee.response;return{...ee,request:be?.type==="json"||be?.type==="formUrlEncoded"?{...be,schema:k6(be.schema)}:be,response:Ae?.type==="json"?{...Ae,schema:k6(Ae.schema)}:Ae,queryParameters:ee.queryParameters.map(ye=>({description:ye.description,name:ye.name,schema:k6(ye.schema),parameterNameOverride:ye.parameterNameOverride,availability:ye.availability,source:ye.source})),pathParameters:ee.pathParameters.map(ye=>({description:ye.description,name:ye.name,schema:k6(ye.schema),parameterNameOverride:ye.parameterNameOverride,variableReference:ye.variableReference,availability:ye.availability,source:ye.source})),headers:ee.headers.map(ye=>({description:ye.description,name:ye.name,schema:k6(ye.schema),parameterNameOverride:ye.parameterNameOverride,env:ye.env,availability:ye.availability,source:ye.source})),examples:me,errors:Pg(ee.errors,ye=>{let Me=ye.fullExamples?.map(Be=>{let Ee=r2i(Be.value);if(Ee!=null)return{name:Be.name,description:Be.description,example:Ee}}).filter(ij);if(Me?.length===0){let Be=U.buildExample({schema:ye.schema,example:void 0,exampleId:void 0,skipReadonly:!1,options:{ignoreOptionals:!1,isParameter:!1}});Be!=null&&Me.push({name:void 0,description:void 0,example:Be})}return{generatedName:ye.generatedName,nameOverride:ye.nameOverride,schema:k6(ye.schema),description:ye.description,source:ye.source,examples:Me}}),retries:ee.retries}}),re=BXy({document:e,context:P});return{apiVersion:TXy({context:P,document:e}),basePath:MXy(e),title:e.info.title??"",description:e.info.description,groups:Object.fromEntries(Object.entries(re??{}).map(([ee,ne])=>[ee,{summary:ne.summary??void 0,description:ne.description??void 0}])),servers:(e.servers??[]).map(ee=>Azs(ee,{groupMultiApiEnvironments:r.groupMultiApiEnvironments})),websocketServers:[],tags:{tagsById:Object.fromEntries((e.tags??[]).map(ee=>[ee.name,{id:ee.name,description:ee.description}])),orderedTagIds:e.tags?.map(ee=>ee.name)},endpoints:Y,webhooks:R,channels:{},groupedSchemas:rao(i,z),securitySchemes:o,hasEndpointsMarkedInternal:Y.some(ee=>ee.internal),nonRequestReferencedSchemas:P.getReferencedSchemas(),variables:d,globalHeaders:s,idempotencyHeaders:u}}function FJC(e,t,r){let n={};for(let[i,a]of Object.entries(e)){if(a.type!=="object"){n[i]=a;continue}let o={$ref:`#/components/schemas/${i}`},c=t.getReferencesFromDiscriminatedUnion(o);if(c==null){n[i]=a;continue}let d={...a,type:"object",properties:a.properties.filter(u=>!c.discriminants.has(u.key)),allOfPropertyConflicts:a.allOfPropertyConflicts.filter(u=>!c.discriminants.has(u.propertyKey)),source:r};n[i]=d;let s=VXy({schema:a,schemas:e});for(let u of[...new Set(s)]){let l=n[u]??e[u];l==null||l.type!=="object"||(n[u]={...l,type:"object",properties:l.properties.filter(m=>!c.discriminants.has(m.key)),allOfPropertyConflicts:l.allOfPropertyConflicts.filter(m=>!c.discriminants.has(m.propertyKey))})}}return n}function xJC(e,t){let r={};for(let[n,i]of Object.entries(e)){if(i.type!=="object"){r[n]=i;continue}let a={$ref:`#/components/schemas/${n}`},o=t.getDiscriminatedUnionMetadata(a);if(o==null){r[n]=i;continue}let c=[];for(let s of i.properties)if(o.discriminants.has(s.key)){let u=o.discriminants.get(s.key);u!=null&&c.push({...s,schema:Sh.literal({nameOverride:void 0,generatedName:Cie([i.generatedName,u],t.options.preserveSchemaIds),title:void 0,value:eW.string(u),namespace:void 0,groupName:void 0,description:void 0,availability:i.availability})})}else c.push(s);let d={...i,type:"object",properties:c};r[n]=d}return r}function VXy({schema:e,schemas:t}){let r=[];for(let n of e.allOf){r.push(n.schema);let i=t[n.schema];i!=null&&i.type==="object"&&r.push(...VXy({schema:i,schemas:t}))}return r}function Dzs(e){return[...new Set(e)]}function LXy({operation:e}){let t=[];switch(e.type){case"async":t=Dzs(e.async.flatMap(r=>r.audiences));break;case"http":t=Dzs(e.value.flatMap(r=>r.audiences));break;case"streaming":t=Dzs(e.streaming.flatMap(r=>r.audiences));break;case"webhook":t=Dzs(e.value.flatMap(r=>r.audiences));break;default:ks(e)}return t}function _da({context:e,documents:t,options:r}){let n={apiVersion:void 0,title:void 0,description:void 0,basePath:void 0,servers:[],websocketServers:[],tags:{tagsById:{},orderedTagIds:void 0},hasEndpointsMarkedInternal:!1,endpoints:[],webhooks:[],channels:{},groupedSchemas:{rootSchemas:{},namespacedSchemas:{}},variables:{},nonRequestReferencedSchemas:new Set,securitySchemes:{},globalHeaders:[],idempotencyHeaders:[],groups:{}},i=0;for(let a of t)try{let o=a.source!=null?a.source:nwe.openapi({file:"<memory>"});switch(a.type){case"openapi":{let c=UXy({taskContext:e,openApi:a.value,options:Kyt({options:a.settings,overrides:r}),source:o,namespace:a.namespace});n=UJC(n,c,Kyt({options:a.settings,overrides:r})),i++;break}case"asyncapi":{let c=UYy({document:a.value,taskContext:e,options:Kyt({options:a.settings,overrides:r}),source:o,asyncApiOptions:zJC({options:a.settings}),namespace:a.namespace});c.servers!=null&&(n.websocketServers=[...n.websocketServers,...c.servers.map(d=>({...d,audiences:void 0,description:void 0}))]),c.channels!=null&&(n.channels={...n.channels,...c.channels}),c.groupedSchemas!=null&&(n.groupedSchemas=Czs(n.groupedSchemas,c.groupedSchemas)),c.basePath!=null&&(n.basePath=c.basePath),i++;break}default:ks(a)}}catch(o){e.logger.error(`Skipping parsing document ${a.type==="openapi"?a.value.info?.title:a.source?.file}`),o instanceof Error&&e.logger.debug(o.message,o.stack?`
|
|
2407
|
+
Location: ${i.join("-> ")}`),Sh.unknown({nameOverride:l,generatedName:P,title:C,description:M,availability:T,namespace:c,groupName:A,example:void 0})}}function xGC(e){if(e!=null){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase();if(t==="true")return!0;if(t==="false")return!1}}}function e2i(e){if(e.$ref.startsWith(dda))return e.$ref.replace(dda,"")}function wRf(e,t,r,n){let i=ev(e,pb.TYPE_NAME),a=Cie(t,n),o=e.description,c=owe(e),d=e2i(e);if(d==null)throw new Error(`Invalid schema reference ${JSON.stringify(e)}`);return i1.reference({generatedName:a,nameOverride:i,title:void 0,schema:d,description:o??void 0,availability:c,namespace:void 0,groupName:void 0,source:r})}function zGC(e){return e.oneOf==null||e.oneOf.length===0}function QGC(e){return e.allOf==null||e.allOf.length===0}function fzs(e){return e.properties==null||K8(e.properties)===0}function pzs(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function eao(e,t,r,n){return e.type==="reference"?Sh.reference({...e,description:t,availability:e.availability,namespace:r,groupName:n}):e.type==="optional"?Sh.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,namespace:r,groupName:n,inline:void 0}):e.type==="nullable"?Sh.nullable({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,namespace:r,groupName:n,inline:void 0}):e}function dzs(e){return Kg(e)||e.type==="object"||e.properties!=null?!0:e.allOf!=null?e.allOf.every(t=>dzs(t)):e.oneOf!=null?e.oneOf.every(t=>dzs(t)):e.anyOf!=null?e.anyOf.every(t=>dzs(t)):!1}function SYy({literal:e,wrapAsOptional:t,wrapAsNullable:r,namespace:n,groupName:i,description:a,availability:o,nameOverride:c,generatedName:d,title:s}){let u=Sh.literal({nameOverride:c,generatedName:d,title:s,value:e,namespace:n,groupName:i,description:a,availability:o});return r&&(u=Sh.nullable({nameOverride:c,generatedName:d,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),t&&(u=Sh.optional({nameOverride:c,generatedName:d,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),u}function vse({primitive:e,wrapAsOptional:t,wrapAsNullable:r,namespace:n,groupName:i,description:a,availability:o,generatedName:c,nameOverride:d,title:s}){i=typeof i=="string"?[i]:i;let u=Sh.primitive({nameOverride:d,generatedName:c,title:s,schema:e,description:a,availability:o,namespace:n,groupName:i});return r&&(u=Sh.nullable({nameOverride:d,generatedName:c,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),t&&(u=Sh.optional({nameOverride:d,generatedName:c,title:s,value:u,namespace:n,groupName:i,description:a,availability:o,inline:void 0})),u}function LGC({schemas:e}){let t=new Set;for(let r of e){if(Kg(r))return;if(r.enum!=null&&pzs(r.enum))r.enum.forEach(n=>t.add(n));else return}return Array.from(t)}function DYy({schemas:e,context:t}){let r={};for(let n of e){let i=IYy({schema:n,context:t});for(let[a,o]of Object.entries(i)){let c=r[a];c!=null?c[o]=n:r[a]={[o]:n}}}for(let[n,i]of Object.entries(r))if(Object.keys(i).length===e.length)return{discriminant:n,schemas:i}}function IYy({schema:e,context:t}){let r=Kg(e)?t.resolveSchemaReference(e):e;return UGC({schema:r,context:t})}function UGC({schema:e,context:t}){let r={};if(e.anyOf!=null){for(let n of e.anyOf){let i=IYy({schema:n,context:t});for(let[a,o]of Object.entries(i??{}))r[a]=o}return r}for(let[n,i]of Object.entries(e.properties??{})){let a=Kg(i)?t.resolveSchemaReference(i):i;a.type==="string"&&a.enum!=null&&pzs(a.enum)&&VGC(a.enum).length===1&&a.enum[0]!=null&&(r[n]=a.enum[0]);let o=MYy(a,"const");a.type==="string"&&o!=null&&(r[n]=o),n==="type"&&a.example!=null&&(r[n]=a.example)}return r}function VGC(e){if(!e)return[];let t=new Set;return e.forEach(r=>{typeof r=="string"?t.add(r.toLowerCase()):t.add(r)}),Array.from(t)}function MYy(e,t){let r=e[t];if(r!=null)return r}function WGC({schema:e,logger:t}){let r=cYy({schema:e,logger:t});if(r!=null)return vYy(r)}var tao=class{document;taskContext;logger;DUMMY;options;namespace;static MESSAGE_REFERENCE_PREFIX="#/components/messages/";constructor({document:t,taskContext:r,options:n,namespace:i}){this.document=t,this.taskContext=r,this.logger=r.logger,this.DUMMY=this,this.options=n,this.namespace=i}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveTags(t,r){if(this.namespace==null&&t==null&&r!=null)return[r];let n=[];if(this.namespace!=null){let i={type:"namespace",name:this.namespace};n.push(i)}return n.concat(t??[])}resolveSchemaReference(t){if(!t.$ref.startsWith(dda))throw new Error(`Failed to resolve schema reference: ${t.$ref}`);let n=t.$ref.substring(dda.length).split("/"),i=this.document.components;if(i==null||i.schemas==null)throw new Error("Document does not have components.schemas.");let[a,o,c]=n;if(a==null||a==="")throw new Error(`${t.$ref} cannot be resolved. No schema key provided.`);let d=i.schemas[a];if(d==null)throw new Error(`Schema "${a}" is undefined in document.components.schemas.`);if(Kg(d)&&(d=this.resolveSchemaReference(d)),o==="properties"&&c!=null){let s=d.properties?.[c];if(s==null)throw new Error(`Property "${c}" not found on "${a}". Full ref: ${t.$ref}`);Kg(s)?d=this.resolveSchemaReference(s):d=s}return d}referenceExists(t){let r=t.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return!1;n=n[i]}return!0}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}markReferencedByDiscriminatedUnion(t,r,n){}markSchemaWithDiscriminantValue(t,r,n){}};var _zs=class extends tao{getExampleMessageReference(t){return`#/components/messages/${t.messageId}`}resolveMessageReference(t){let r="#/components/messages/",n=this.document.components;if(n==null||n.messages==null||!t.$ref.startsWith(r))throw new Error(`Failed to resolve message reference: ${t.$ref} in v2 components`);let i=t.$ref.substring(r.length),a=n.messages[i];if(a==null)throw new Error(`${t.$ref} is undefined`);return a}};function rao(e,t){let r={};if(e!=null)return{rootSchemas:r,namespacedSchemas:{[e]:t}};let n={};for(let[i,a]of Object.entries(t))switch(a.type){case"object":case"array":case"map":case"optional":case"enum":case"literal":case"reference":case"nullable":case"primitive":{if(a.namespace==null){r[i]=a;continue}let o=a.namespace;n[o]??={},n[o][i]=a;continue}case"oneOf":case"unknown":r[i]=a;continue;default:ks(a)}return{rootSchemas:r,namespacedSchemas:n}}function r2i(e){if(typeof e=="string")return SS.primitive(CO.string(e));if(typeof e=="number")return Number.isInteger(e)?SS.primitive(CO.int(e)):SS.primitive(CO.double(e));if(typeof e=="boolean")return SS.primitive(CO.boolean(e));if(Array.isArray(e)){let t=e.map(r=>r2i(r));return t.length===0?void 0:SS.array(t.filter(r=>r!=null))}else if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string")){let t=[];for(let[r,n]of Object.entries(e)){let i=r2i(n);i!=null&&t.push({key:CO.string(r),value:i})}return SS.map(t)}}function _ko(e){if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string"))return e}function BYy(e){if(e!=null&&Array.isArray(e))return e}var n2i=class{schemas;nonRequestReferencedSchemas;context;constructor(t,r,n){this.schemas=t,this.nonRequestReferencedSchemas=r,this.context=n}buildExample({schema:t,exampleId:r,example:n,options:i,skipReadonly:a}){return this.buildExampleHelper({schema:t,visitedSchemaIds:new Set,exampleId:r,example:n,options:{...i,maxCheckerDepth:i.maxCheckerDepth??5},depth:0,skipReadonly:a??!1})}buildExampleHelper({exampleId:t,example:r,schema:n,depth:i,visitedSchemaIds:a,options:o,skipReadonly:c}){switch(n.type){case"enum":return typeof r=="string"&&TYy({schema:n,value:r})?SS.enum(r):n.values[0]!=null?SS.enum(n.values[0]?.value):void 0;case"literal":return SS.literal(n.value);case"nullable":{if(r==null&&!this.hasExample(n.value,0,a,o)&&this.exceedsMaxDepth(i,o))return SS.null({});let d=this.buildExampleHelper({schema:n.value,visitedSchemaIds:a,exampleId:t,example:r,depth:i,options:o,skipReadonly:c});return d??SS.null({})}case"optional":{if(r==null&&!this.hasExample(n.value,0,a,o)&&(o.ignoreOptionals||this.exceedsMaxDepth(i,o))||Object.is(r,null))return;let d=this.buildExampleHelper({schema:n.value,visitedSchemaIds:a,exampleId:t,example:r,depth:i,options:o,skipReadonly:c});return d!=null&&d.type==="array"&&d.value.length===0||d!=null&&d.type==="map"&&d.value.length===0||d!=null&&d.type==="object"&&Object.keys(d.properties).length===0?void 0:d}case"primitive":{let d=this.buildExampleFromPrimitive({schema:n.schema,example:r,options:o});return SS.primitive(d)}case"reference":{let d=this.schemas[n.schema];if(d!=null&&!a.has(n.schema)){a.add(n.schema);let s=d?.type==="object"&&!this.nonRequestReferencedSchemas.has(n.schema),u=this.buildExampleHelper({example:r,schema:d,exampleId:t,visitedSchemaIds:a,depth:i,options:o,skipReadonly:s||this.context.options.respectReadonlySchemas?c:!1});return a.delete(n.schema),u}return}case"oneOf":switch(n.value.type){case"discriminated":{let d={},s={},u={},l=_ko(r),m=l?.[n.value.discriminantProperty],A=n.value.schemas[m],P=[],C=this.getDiscriminatedUnionVariantSchema(n.value,l);C!=null&&P.push(C),P.push(...Object.entries(n.value.schemas));for(let M of P)if(m!=null&&A!=null&&A.type==="object"){s=this.getAllProperties(A),u=this.getAllRequiredProperties(A),d[n.value.discriminantProperty]=SS.primitive(CO.string(m));break}else{let T=this.buildExampleHelper({exampleId:t,schema:M[1],example:void 0,visitedSchemaIds:a,depth:i,options:o,skipReadonly:c});if(T!=null){this.mergeExampleWith(T,d),d[n.value.discriminantProperty]=SS.primitive(CO.string(M[0]));break}}for(let M of n.value.commonProperties){s[M.key]={schema:M.schema,readonly:!1};let T=this.getResolvedSchema(M.schema);T.type!=="optional"&&T.type!=="nullable"&&(u[M.key]=M.schema)}for(let[M,T]of Object.entries(s)){let z=M in u;if(z&&l?.[M]!=null){let U=this.buildExampleHelper({schema:T.schema,exampleId:t,example:l[M],visitedSchemaIds:a,depth:i+1,options:o,skipReadonly:c});if(U!=null)d[M]=U;else return}else{let U=this.buildExampleHelper({exampleId:t,schema:T.schema,example:l?.[M],visitedSchemaIds:a,depth:i+1,options:o,skipReadonly:c});if(U!=null)d[M]=U;else if(z)return}}return SS.oneOf(L8i.discriminated(d))}case"undiscriminated":{let d=this.getUnDiscriminatedUnionVariantSchema(n.value,r);if(d!=null)return this.buildExampleHelper({exampleId:t,example:r,schema:d,visitedSchemaIds:a,depth:i,options:o,skipReadonly:c});break}}return;case"unknown":if(r!=null){let d=r2i(r);if(d!=null)return SS.unknown(d)}return o.ignoreOptionals||this.exceedsMaxDepth(i,o)?void 0:o.isParameter?SS.primitive(CO.string(o.name??"string")):SS.map([{key:CO.string("key"),value:SS.primitive(CO.string("value"))}]);case"array":{let d=BYy(r),s=[];if(d!=null&&d.length>0)for(let u of d){let l=this.buildExampleHelper({exampleId:t,example:u,schema:n.value,depth:i+1,visitedSchemaIds:a,options:o,skipReadonly:c});l!=null&&s.push(l)}else if(n.example!=null&&n.example.length>0)for(let u of n.example){let l=this.buildExampleHelper({exampleId:t,example:u,schema:n.value,depth:i+1,visitedSchemaIds:a,options:o,skipReadonly:c});l!=null&&s.push(l)}else{let u=this.buildExampleHelper({exampleId:t,example:void 0,schema:n.value,depth:i+1,visitedSchemaIds:a,options:o,skipReadonly:c});u!=null&&s.push(u)}return SS.array(s)}case"map":{let d=_ko(r??n.example);if(d!=null&&Object.entries(d).length>0){let l=[];for(let[m,A]of Object.entries(d)){let P=this.buildExampleFromPrimitive({schema:n.key.schema,example:m,options:o}),C=this.buildExampleHelper({exampleId:t,example:A,schema:n.value,visitedSchemaIds:a,depth:i+1,options:o,skipReadonly:c});C!=null&&l.push({key:P,value:C})}return SS.map(l)}if(n.key.schema.type==="string"&&n.value.type==="unknown")return SS.map([{key:CO.string("key"),value:SS.unknown(SS.primitive(CO.string("value")))}]);let s=this.buildExampleFromPrimitive({schema:n.key.schema,example:void 0,options:{...o,name:"key"}}),u=this.buildExampleHelper({exampleId:t,example:void 0,schema:n.value,visitedSchemaIds:a,depth:i+1,options:{...o,name:"value"},skipReadonly:c});return u!=null&&u.type!=="null"?SS.map([{key:s,value:u}]):SS.map([])}case"object":{let d={},s=n.fullExamples?.find(A=>A.name===t)??n.fullExamples?.find(A=>A.name==null)??n.fullExamples?.[0],u=_ko(r)??(s!=null?_ko(s.value):{})??{},l=this.getAllProperties(n),m=this.getAllRequiredProperties(n);for(let[A,P]of Object.entries(l)){if(c&&P.readonly||P.schema._visit({optional:z=>typeof z.availability=="string"&&z.availability==="Deprecated",primitive:()=>!1,object:()=>!1,array:()=>!1,map:()=>!1,enum:()=>!1,reference:()=>!1,literal:()=>!1,oneOf:()=>!1,nullable:()=>!1,unknown:()=>!1,_other:()=>!1}))continue;let C=A in m,M=Object.keys(u).includes(A),T=this.buildExampleHelper({schema:P.schema,exampleId:t,example:u[A],visitedSchemaIds:a,depth:i+1,options:{...o,name:A},skipReadonly:c});if(C&&T!=null)d[A]=T;else{if(C)return;(M&&T!=null||!o.ignoreOptionals&&T!=null)&&(d[A]=T)}}if(n.additionalProperties){for(let[A,P]of Object.entries(u))if(!(A in d)){let C=this.buildExampleHelper({schema:Sh.unknown({example:P,title:void 0,availability:void 0,description:void 0,generatedName:"",nameOverride:void 0,namespace:void 0,groupName:void 0}),exampleId:t,example:P,visitedSchemaIds:a,depth:i+1,options:{...o,name:A},skipReadonly:c});C!=null&&(d[A]=C)}}return SS.object({properties:d})}default:ks(n)}}mergeExampleWith(t,r){t._visit({array:Hc,enum:Hc,literal:Hc,map:n=>{for(let i of n){let a=i.key;a.type==="string"&&(r[a.value]=i.value)}},object:n=>{for(let[i,a]of Object.entries(n.properties))r[i]=a},oneOf:n=>{if(n.type==="discriminated")for(let[i,a]of Object.entries(n.value))r[i]=a;else this.mergeExampleWith(n.value,r)},primitive:Hc,unknown:Hc,null:Hc,_other:Hc})}getObjectSchema(t){if(t.type==="object")return t;if(t.type==="reference"){let r=this.schemas[t.schema];if(r!=null)return this.getObjectSchema(r)}}getDiscriminatedUnionVariantSchema(t,r){let n=r?.[t.discriminantProperty];if(n==null||typeof n!="string")return Object.entries(t.schemas)[0];let i=t.schemas[n];return i==null?Object.entries(t.schemas)[0]:[n,i]}getUnDiscriminatedUnionVariantSchema(t,r){return r==null?t.schemas[0]:t.schemas.map(a=>({schema:a,heuristic:this.calcExampleHeuristic(a,r)})).sort((a,o)=>o.heuristic-a.heuristic)[0]?.schema}calcExampleHeuristic(t,r){switch(t.type){case"literal":return t.value.value===r?5:0;case"enum":return TYy({schema:t,value:r})?5:0;case"object":{if(!bR(r))return 0;let n=this.getAllProperties(t),i=0;for(let[a,o]of Object.entries(n))r[a]!=null?(i++,i+=this.calcExampleHeuristic(o.schema,r[a])):i--;return i}case"array":{if(!Array.isArray(r))return 0;let n=0;for(let i of r)n+=this.calcExampleHeuristic(t.value,i);return n}case"map":{if(!bR(r))return 0;let n=0;for(let[,i]of Object.entries(r))n+=this.calcExampleHeuristic(t.value,i);return n}case"nullable":case"optional":return this.calcExampleHeuristic(t.value,r);case"reference":{let n=this.getResolvedSchema(t);return n==null?0:this.calcExampleHeuristic(n,r)}case"oneOf":return Object.values(t.value.schemas).map(i=>this.calcExampleHeuristic(i,r)).sort((i,a)=>a-i)[0]??0;case"primitive":return r==null?0:t.schema._visit({int:()=>typeof r=="number",int64:()=>typeof r=="number",uint:()=>typeof r=="number",uint64:()=>typeof r=="number",float:()=>typeof r=="number",double:()=>typeof r=="number",string:()=>typeof r=="string",datetime:()=>typeof r=="string",date:()=>typeof r=="string",base64:()=>typeof r=="string",boolean:()=>typeof r=="boolean",_other:()=>!0})?1:-1;default:return 0}}hasExample(t,r,n=new Set,i){if(this.exceedsMaxCheckerDepth(r,i))return!1;switch(t.type){case"array":return this.hasExample(t.value,r+1,n,i);case"enum":return t.example!=null;case"literal":return!1;case"map":return t.example!=null||t.key.schema.example!=null&&this.hasExample(t.value,r+1,n,i);case"object":{if(t.fullExamples!=null&&t.fullExamples.length>0)return!0;for(let o of t.properties)if(this.hasExample(o.schema,r+1,n,i))return!0;return!1}case"primitive":return t.schema.example!=null;case"reference":{let a=this.schemas[t.schema];if(a!=null&&!n.has(t.schema)){n.add(t.schema);let o=this.hasExample(a,r,n,i);return n.delete(t.schema),o}return!1}case"unknown":return t.example!=null;case"oneOf":return Object.values(t.value.schemas).some(a=>this.hasExample(a,r,n,i));default:return!1}}exceedsMaxCheckerDepth(t,r){return t>(r.maxCheckerDepth??0)}exceedsMaxDepth(t,r){return t>(r.maxDepth??0)}getAllProperties(t){let r={};for(let n of t.properties)r[n.key]={schema:n.schema,readonly:n.readonly??!1};for(let n of t.allOf){let i=this.schemas[n.schema];if(i==null)continue;let a=this.getResolvedSchema(i);a.type==="object"&&(r={...this.getAllProperties(a),...r})}return r}getAllRequiredProperties(t){let r={};for(let n of t.properties){let i=this.getResolvedSchema(n.schema);i.type!=="optional"&&i.type!=="nullable"&&(r[n.key]=n.schema)}for(let n of t.allOf){let i=this.schemas[n.schema];if(i==null)continue;let a=this.getResolvedSchema(i);a.type==="object"&&(r={...this.getAllRequiredProperties(a),...r})}return r}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}buildExampleFromPrimitive({example:t,schema:r,options:n}){switch(r.type){case"string":return t!=null&&typeof t=="string"?CO.string(t):r.example!=null?CO.string(r.example):CO.string(n.name??PP.STRING);case"base64":return t!=null&&typeof t=="string"?CO.base64(t):r.example!=null?CO.base64(r.example):CO.base64(PP.BASE64);case"boolean":return t!=null&&typeof t=="boolean"?CO.boolean(t):r.example!=null?CO.boolean(r.example):CO.boolean(PP.BOOLEAN);case"date":return t!=null&&typeof t=="string"?CO.date(t):r.example!=null?CO.date(r.example):CO.date(PP.DATE);case"datetime":return t!=null&&typeof t=="string"?CO.datetime(t):r.example!=null?CO.datetime(r.example):CO.datetime(PP.DATE_TIME);case"double":return t!=null&&typeof t=="number"?CO.double(t):r.example!=null?CO.double(r.example):CO.double(PP.DOUBLE);case"float":return t!=null&&typeof t=="number"?CO.float(t):r.example!=null?CO.float(r.example):CO.float(PP.FLOAT);case"int":return t!=null&&typeof t=="number"?CO.int(t):r.example!=null?CO.int(r.example):CO.int(PP.INT);case"int64":return t!=null&&typeof t=="number"?CO.int64(t):r.example!=null?CO.int64(r.example):CO.int64(PP.INT64);case"uint":return t!=null&&typeof t=="number"?CO.uint(t):r.example!=null?CO.uint(r.example):CO.uint(PP.UINT);case"uint64":return t!=null&&typeof t=="number"?CO.uint64(t):r.example!=null?CO.uint64(r.example):CO.uint64(PP.UINT64);default:ks(r)}}};function TYy({schema:e,value:t}){return e.values.map(r=>r.value).includes(t)}function dRr(e){switch(e.type){case"object":return Sh.object({allOf:e.allOf,properties:e.properties.map(t=>GGC(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName,fullExamples:void 0,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source,inline:void 0});case"array":return Sh.array({description:e.description,availability:e.availability,value:dRr(e.value),generatedName:e.generatedName,title:e.title,namespace:e.namespace,nameOverride:e.nameOverride,groupName:e.groupName,example:void 0,inline:void 0});case"enum":return Sh.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,values:e.values,default:e.default,namespace:e.namespace,groupName:e.groupName,example:void 0,source:e.source,inline:void 0});case"literal":return Sh.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName});case"nullable":return Sh.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:dRr(e.value),namespace:e.namespace,groupName:e.groupName,inline:void 0});case"optional":return Sh.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:dRr(e.value),namespace:e.namespace,groupName:e.groupName,inline:void 0});case"primitive":return Sh.primitive({description:e.description,availability:e.availability,schema:qYy(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"map":return Sh.map({description:e.description,availability:e.availability,key:Sh.primitive({description:e.key.description,availability:e.key.availability,schema:qYy(e.key.schema),generatedName:e.key.generatedName,nameOverride:e.key.nameOverride,title:e.key.title,namespace:e.namespace,groupName:e.groupName}),value:dRr(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,example:void 0,inline:void 0});case"reference":return Sh.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schema:e.schema,namespace:e.namespace,groupName:e.groupName,source:e.source});case"oneOf":return Sh.oneOf(HGC(e.value));case"unknown":return Sh.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName,title:void 0,example:void 0,namespace:void 0,groupName:void 0,description:void 0,availability:void 0});default:ks(e)}}function HGC(e){switch(e.type){case"discriminated":return Sit.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:dRr(t.schema)})),description:e.description,availability:e.availability,discriminantProperty:e.discriminantProperty,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:Object.fromEntries(Object.entries(e.schemas).map(([t,r])=>[t,dRr(r)])),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:void 0});case"undiscriminated":return Sit.undiscriminated({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:e.schemas.map(t=>dRr(t)),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:void 0});default:ks(e)}}function qYy(e){switch(e.type){case"string":return G0.string({default:e.default,pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:void 0});case"base64":return G0.base64({example:void 0});case"boolean":return G0.boolean({default:e.default,example:void 0});case"date":return G0.date({example:void 0});case"datetime":return G0.datetime({example:void 0});case"double":return G0.double({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"float":return G0.float({example:void 0});case"int":return G0.int({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"int64":return G0.int64({default:e.default,example:void 0});case"uint":return G0.uint({default:void 0,example:void 0});case"uint64":return G0.uint64({default:void 0,example:void 0});default:ks(e)}}function GGC(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:dRr(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability,readonly:e.readonly,writeonly:e.writeonly}}function hzs(e){return e.type!=="optional"&&e.type!=="nullable"}function ERf(e){return e==="POST"||e==="PUT"||e==="PATCH"}function hko(e){if(e.type==="full")return e.request==null&&e.response==null&&e.queryParameters==null&&e.pathParameters==null&&e.headers==null;{let t=e.value;return t.request==null&&t.response==null&&t["query-parameters"]==null&&t["path-parameters"]==null&&t.headers==null}}var yzs=class{schemas;context;globalHeaders;exampleTypeFactory;logger;constructor(t,r,n){this.schemas=t,this.context=r,this.globalHeaders=n,this.schemas=t,this.exampleTypeFactory=new n2i(t,r.nonRequestReferencedSchemas,r),this.logger=r.logger}buildEndpointExample(t){let r=KGC(t.request),n=$GC(t.response);if(r?.type==="unsupported"||n?.type==="unsupported")return[];let i=[];if(r!=null&&r.type==="present"){let l=this.isSchemaRequired(r.schema);if(r.examples.length===0){let m=this.exampleTypeFactory.buildExample({skipReadonly:ERf(t.method),schema:r.schema,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});m!=null&&i.push([void 0,m])}else for(let{name:m,value:A}of r.examples){let P=this.exampleTypeFactory.buildExample({skipReadonly:ERf(t.method),schema:r.schema,exampleId:m,example:A,options:{isParameter:!1,ignoreOptionals:!0}});P!=null&&i.push([m,P])}if(l&&i.length===0)return this.logger.trace(`Failed to generate required request example for ${t.method.toUpperCase()} ${t.path}`),[]}let a=[];if(n!=null&&n.type==="present"){let l=this.isSchemaRequired(n.schema);if(n.examples.length===0){let m=this.exampleTypeFactory.buildExample({skipReadonly:!1,schema:n.schema,exampleId:void 0,example:void 0,options:{maxDepth:this.context.options.exampleGeneration?.response?.["max-depth"]??3,isParameter:!1,ignoreOptionals:!1}});m!=null&&(t.response?.type==="json"?a.push([void 0,Wyt.withoutStreaming(m)]):(t.response?.type==="streamingJson"||t.response?.type==="streamingSse")&&a.push([void 0,Wyt.withStreaming({sse:t.response?.type==="streamingSse",events:[m]})]))}else for(let{name:m,value:A}of n.examples){let P=this.exampleTypeFactory.buildExample({skipReadonly:!1,schema:n.schema,exampleId:m,example:A,options:{maxDepth:this.context.options.exampleGeneration?.response?.["max-depth"]??3,isParameter:!1,ignoreOptionals:!1}});P!=null&&(t.response?.type==="json"?a.push([m,Wyt.withoutStreaming(P)]):(t.response?.type==="streamingJson"||t.response?.type==="streamingSse")&&a.push([void 0,Wyt.withStreaming({sse:t.response?.type==="streamingSse",events:[P]})]))}if(l&&a.length===0)return this.logger.trace(`Failed to generate required response example for ${t.method.toUpperCase()} ${t.path}`),[]}let o=[];for(let l of t.pathParameters){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for path parameter ${l.name} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),m&&A==null)return[];A!=null&&o.push({name:l.name,parameterNameOverride:l.parameterNameOverride,value:A})}let c=[];for(let l of t.queryParameters){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for query parameter ${l.name} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),m&&A==null)return[];A!=null&&c.push({name:l.name,value:A})}let d=[];for(let l of t.headers){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for header ${l.name} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),m&&A==null)return[];A!=null&&d.push({name:l.name,value:A})}for(let l of this.globalHeaders){let m=l.schema!=null?dRr(l.schema):Sh.primitive({nameOverride:void 0,generatedName:"",title:void 0,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,schema:G0.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})}),A=this.exampleTypeFactory.buildExample({schema:m,exampleId:void 0,example:void 0,options:{name:l.header,isParameter:!0,ignoreOptionals:!0}});if(A!=null&&!pRr(A)&&(this.logger.warn(`Expected a primitive example but got ${A.type} for global header ${l.header} for ${t.method.toUpperCase()} ${t.path}`),A=void 0),A==null)return[];A!=null&&d.push({name:l.header,value:A})}let s=[];t.request!=null&&t.response!=null?s=JGC(i,a):t.request!=null?s=i.map(([l,m])=>({id:l,request:m,response:void 0})):t.response!=null&&(s=a.map(([l,m])=>({id:l,request:void 0,response:m})));let u=t.examples.filter(l=>hko(l)).flatMap(l=>{if(l.type==="unknown"){if(l.value!=null){let m=l.value["code-samples"];if(m!=null)return this.convertCodeSamples(m)}return}else return l.codeSamples}).filter(l=>ij(l));return s.length===0?[Vyt.full({name:void 0,description:void 0,pathParameters:o,queryParameters:c,headers:d,request:void 0,response:void 0,codeSamples:u})]:s.map(({id:l,request:m,response:A})=>Vyt.full({name:l,description:void 0,pathParameters:o,queryParameters:c,headers:d,request:m,response:A,codeSamples:u}))}convertCodeSamples(t){return t.map(r=>"language"in r?rWr.language({name:r.name??void 0,description:r.docs??void 0,language:r.language,code:r.code,install:r.install??void 0}):rWr.sdk({name:r.name??void 0,description:r.docs??void 0,sdk:r.sdk==="c#"?Rde.Csharp:r.sdk,code:r.code})).filter(ij)}isSchemaRequired(t){return hzs(this.getResolvedSchema(t))}getResolvedSchema(t){return t}};function JGC(e,t){let r=[];if(e.length<=1){let[i,a]=e[0]??[];if(t.length===0)return r.push({id:i,request:a,response:void 0}),r;for(let[o,c]of t)r.push({id:o??i,request:a,response:c});return r}if(t.length<=1){let[i,a]=t[0]??[];if(t.length===0)return r.push({id:i,request:void 0,response:a}),r;for(let[o,c]of e)r.push({id:o??i,request:c,response:a});return r}let n=new Set;for(let[i,a]of e){let o=t.find(([d])=>d==null)?.[1]??t[0]?.[1];if(i==null){if(o==null)continue;r.push({id:void 0,request:a,response:o});continue}let c=!1;for(let d=0;d<t.length;d++){let[s,u]=t[d];s==null||n.has(d)||i===s&&(r.push({id:i,request:a,response:u}),s!=null&&n.add(d),c=!0)}!c&&o!=null&&r.push({id:i,request:a,response:o})}for(let i=0;i<t.length;i++){if(n.has(i))continue;let[a,o]=t[i],c=e.find(([d])=>d==null)?.[1]??e[0]?.[1];c!=null&&r.push({id:a,request:c,response:o})}return r}function KGC(e){if(e!=null)return e.type==="multipart"?{type:"present",schema:YGC(e),examples:[]}:e.type==="json"||e.type==="formUrlEncoded"?{type:"present",schema:e.schema,examples:e.fullExamples??[]}:{type:"unsupported"}}function $GC(e){if(e!=null)return e.type!=="json"&&e.type!=="streamingJson"&&e.type!=="streamingSse"?{type:"unsupported"}:{type:"present",schema:e.schema,examples:e.fullExamples??[]}}function pRr(e){switch(e.type){case"primitive":case"enum":case"literal":return!0;case"unknown":return pRr(e);case"array":case"object":case"map":return!1;case"oneOf":switch(e.value.type){case"discriminated":return!1;case"undiscriminated":return pRr(e.value.value);default:return!1}case"null":return!0;default:ks(e)}}function YGC(e){return Sh.object({properties:e.properties.map(t=>t.schema.type==="file"?null:{key:t.key,schema:dRr(t.schema.value),audiences:[],conflict:{},generatedName:t.key,nameOverride:void 0,availability:void 0,readonly:void 0,writeonly:void 0,inline:void 0}).filter(ij),allOf:[],allOfPropertyConflicts:[],fullExamples:void 0,description:e.description,nameOverride:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,additionalProperties:!1,availability:void 0,source:e.source,inline:void 0})}var nao=class{exampleTypeFactory;schemas;constructor(t,r){this.exampleTypeFactory=new n2i(t,new Set,r),this.schemas=t}buildWebsocketSessionExamplesForExtension({context:t,extensionExamples:r,handshake:n,source:i,namespace:a}){let o=[];for(let c of r){let d=[];for(let l of n.queryParameters){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:c.queryParameters?.[l.name],options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});A!=null&&!pRr(A)&&(A=void 0),!(m&&A==null)&&A!=null&&d.push({name:l.name,value:A})}let s=[];for(let l of n.headers){let m=this.isSchemaRequired(l.schema),A=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:c.headers?.[l.name],options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});A!=null&&!pRr(A)&&(A=void 0),!(m&&A==null)&&A!=null&&s.push({name:l.name,value:A})}let u=[];for(let l of c.messages){let m=t.getExampleMessageReference(l),A=t.resolveMessageReference({$ref:m}),P=Kg(A.payload)?t.resolveSchemaReference(A.payload):A.payload,C=this.exampleTypeFactory.buildExample({schema:CS(P,!1,!1,t,[l.messageId],i,a),exampleId:void 0,example:l.value,options:{isParameter:!1,ignoreOptionals:!0}});C!=null&&u.push({messageType:l.type,payload:C,description:void 0})}o.push({name:c.summary,queryParameters:d,headers:s,description:c.description,messages:u})}return o}buildWebsocketSessionExample({handshake:t,messages:r}){let n={name:void 0,queryParameters:[],headers:[],description:void 0,messages:[]},i=[];for(let o of t.queryParameters){let c=this.isSchemaRequired(o.schema),d=this.exampleTypeFactory.buildExample({schema:o.schema,exampleId:void 0,example:void 0,options:{name:o.name,isParameter:!0,ignoreOptionals:!0}});if(d!=null&&!pRr(d)&&(d=void 0),c&&d==null)return;d!=null&&i.push({name:o.name,value:d})}let a=[];for(let o of t.headers){let c=this.isSchemaRequired(o.schema),d=this.exampleTypeFactory.buildExample({schema:o.schema,exampleId:void 0,example:void 0,options:{name:o.name,isParameter:!0,ignoreOptionals:!0}});if(d!=null&&!pRr(d)&&(d=void 0),c&&d==null)return;d!=null&&a.push({name:o.name,value:d})}for(let o of r){let c=this.exampleTypeFactory.buildExample({schema:o.payload,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});c!=null&&n.messages.push({messageType:o.type,payload:c,description:void 0})}return n}isSchemaRequired(t){return hzs(this.getResolvedSchema(t))}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}};var lIe={FERN_PARAMETER_OPTIONAL:"x-fern-optional",FERN_CHANNEL_ADDRESS:"x-fern-address",FERN_DISPLAY_NAME:"x-fern-display-name",FERN_SDK_GROUP_NAME:"x-fern-sdk-group-name",FERN_EXAMPLES:"x-fern-examples",BASE_PATH:"x-fern-base-path",FERN_ENUM:"x-fern-enum",IGNORE:"x-fern-ignore"};function vzs(e){return ev(e,lIe.FERN_EXAMPLES)??[]}function bzs(e,t){return t.includes("://")?t:`${e}://${t}`}function gzs(e){return e.startsWith("/")?e:"/"+e}function FYy({context:e,breadcrumbs:t,source:r,asyncApiOptions:n,document:i}){let a={},o={};for(let[s,u]of Object.entries(i.components?.schemas??{})){let l=CS(u,!1,!1,e,[s],r,e.namespace);a[s]=l}let c=new nao(a,e),d={};for(let[s,u]of Object.entries(i.servers??{}))d[s]={name:s,url:bzs(u.protocol,u.url)};for(let[s,u]of Object.entries(i.channels??{})){let l=ev(u,lIe.IGNORE);if(l!=null&&l){e.logger.debug(`Channel ${s} is marked with x-fern-ignore. Skipping.`);continue}let m=[];if(u.parameters!=null)for(let[T,z]of Object.entries(u.parameters??{}))m.push({name:T,description:z.description,parameterNameOverride:void 0,schema:z.schema!=null?CS(z.schema,!1,!1,e,t,r,e.namespace):Sh.primitive({schema:G0.string({default:void 0,pattern:void 0,format:void 0,maxLength:void 0,minLength:void 0,example:void 0}),description:void 0,availability:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}),variableReference:void 0,availability:owe(z),source:r});let A=[],P=[];if(u.bindings?.ws!=null){if(u.bindings.ws.headers!=null){let T=u.bindings.ws.headers.required??[];for(let[z,U]of Object.entries(u.bindings.ws.headers.properties??{})){if(Kg(U)){let re=e.resolveSchemaReference(U);A.push({name:z,schema:owi(U,!1,!1,e,t,void 0,r,e.namespace),description:re.description,parameterNameOverride:void 0,env:void 0,availability:owe(re),source:r});continue}let R=T.includes(z),[V,Y]=e.options.coerceOptionalSchemasToNullable?[!1,!R]:[!R,!1];A.push({name:z,schema:CS(U,V,Y,e,[...t,z],r,e.namespace),description:U.description,parameterNameOverride:void 0,env:void 0,availability:owe(U),source:r})}}if(u.bindings.ws.query!=null){let T=u.bindings.ws.query.required??[];for(let[z,U]of Object.entries(u.bindings.ws.query.properties??{})){if(Kg(U)){let re=e.resolveSchemaReference(U);P.push({name:z,schema:owi(U,!1,!1,e,t,void 0,r,e.namespace),description:re.description,parameterNameOverride:void 0,availability:owe(re),source:r});continue}let R=T.includes(z),[V,Y]=e.options.coerceOptionalSchemasToNullable?[!1,!R]:[!R,!1];P.push({name:z,schema:CS(U,V,Y,e,[...t,z],r,e.namespace),description:U.description,parameterNameOverride:void 0,availability:owe(U),source:r})}}}let C;u.publish!=null&&("oneOf"in u.publish.message?C=RYy({generatedName:u.publish.operationId??"PublishEvent",event:u.publish,breadcrumbs:t,context:e,source:r,options:e.options,asyncApiOptions:n}):C=NYy({action:"Publish",channelPath:s,message:u.publish.message,context:e,source:r}));let M;if(u.subscribe!=null&&("oneOf"in u.subscribe.message?M=RYy({generatedName:u.subscribe.operationId??"SubscribeEvent",event:u.subscribe,breadcrumbs:t,context:e,source:r,options:e.options,asyncApiOptions:n}):M=NYy({action:"Subscribe",channelPath:s,message:u.subscribe.message,context:e,source:r})),A.length>0||P.length>0||C!=null||M!=null){let T=vzs(u),z=[];if(T.length>0)z=c.buildWebsocketSessionExamplesForExtension({context:e,extensionExamples:T,handshake:{headers:A,queryParameters:P},source:r,namespace:e.namespace});else{let Y=[];C!=null&&Y.push({type:"publish",payload:C}),M!=null&&Y.push({type:"subscribe",payload:M});let re=c.buildWebsocketSessionExample({handshake:{headers:A,queryParameters:P},messages:Y});re!=null&&z.push(re)}let U=ev(u,lIe.FERN_CHANNEL_ADDRESS),R=U??gzs(s),V=[];C!=null&&V.push({origin:"client",name:"publish",body:k6(C)}),M!=null&&V.push({origin:"server",name:"subscribe",body:k6(M)}),o[s]={audiences:ev(u,pb.AUDIENCES)??[],handshake:{headers:A.map(Y=>({...Y,schema:k6(Y.schema),env:Y.env})),queryParameters:P.map(Y=>({...Y,schema:k6(Y.schema)})),pathParameters:m.map(Y=>({...Y,parameterNameOverride:void 0,schema:k6(Y.schema)}))},groupName:e.resolveGroupName([ev(u,lIe.FERN_SDK_GROUP_NAME)??s]),messages:V,servers:(u.servers?.map(Y=>d[Y])??Object.values(d)).filter(Y=>Y!=null&&Y.name!=null).map(Y=>({...Y,name:Y.name})),summary:ev(u,lIe.FERN_DISPLAY_NAME),path:R,description:u.description,examples:z,source:r}}}return{groupedSchemas:rao(e.namespace,a),channels:o??void 0,servers:Object.values(d).map(s=>({...s,name:s.name})),basePath:ev(i,lIe.BASE_PATH)}}function RYy({generatedName:e,event:t,context:r,breadcrumbs:n,source:i,options:a,asyncApiOptions:o}){if("oneOf"in t.message&&t.message.oneOf!=null){let c=[],d=[];for(let s of t.message.oneOf){let u,l={type:"notFound"};if(Kg(s)){let m=r.resolveMessageReference(s);!Kg(m.payload)&&o.naming==="v2"?(l=m.name?{type:"name",name:m.name}:l,u={...m.payload,title:m.name??m.payload.title,description:m.name??m.payload.description}):u=m.payload}else u=s;d.push(l),c.push(u)}return t2i({description:t.description??t.message.description,availability:owe(t.message),subtypes:c,nameOverride:t.operationId,generatedName:e,title:t.message.title,groupName:void 0,wrapAsOptional:!1,wrapAsNullable:!1,breadcrumbs:n,context:r,encoding:void 0,source:i,namespace:r.namespace,subtypePrefixOverrides:o.naming==="v2"?d:[]})}}function NYy({action:e,channelPath:t,message:r,context:n,source:i}){if(r.payload!=null){let a=r.payload;return Kg(r.payload)&&(a=n.resolveSchemaReference(r.payload)),CS(a,!1,!1,n,[t,e],i,n.namespace)}}var mzs=class extends tao{getExampleMessageReference(t){return`#/channels/${t.channelId}/messages/${t.messageId}`}resolveParameterReference(t){let r="#/components/parameters/";if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith(r))throw new Error(`Failed to resolve ${t.$ref}`);let n=t.$ref.substring(r.length),i=this.document.components.parameters[n];if(i==null)throw new Error(`${t.$ref} is undefined`);return"$ref"in i?this.resolveParameterReference(i):i}resolveMessageReference(t){let r="#/channels/",n="#/components/messages/";if(t.$ref.startsWith(r)){let c=t.$ref.split("/"),d=c[2],s=c[4];if(d==null||s==null||!this.document.channels?.[d])throw new Error(`Failed to resolve message reference ${t.$ref} in channel ${d}`);let l=this.document.channels[d].messages?.[s];if(l==null)throw new Error(`${t.$ref} is undefined`);return"$ref"in l?this.resolveMessageReference(l):{name:s,...l}}let i=this.document.components;if(!t.$ref.startsWith(n)||!i?.messages)throw new Error(`Failed to resolve message reference: ${t.$ref} in v3 components`);let a=t.$ref.substring(n.length),o=i.messages[a];if(o==null)throw new Error(`${t.$ref} is undefined`);return{name:a,...o}}isMessageWithPayload(t){return t!=null&&typeof t=="object"&&"payload"in t}isReferenceObject(t){return t!=null&&typeof t=="object"&&"$ref"in t}};var xYy="#/channels/",zYy="#/servers/",SRf="$message.";function LYy({context:e,breadcrumbs:t,source:r,asyncApiOptions:n,document:i}){let a={},o={},c={},d=[],s={};for(let[P,C]of Object.entries(i.components?.schemas??{}))a[P]=CS(C,!1,!1,e,[P],r,e.namespace);for(let[P,C]of Object.entries(i.channels??{}))if(o[P]||(o[P]={}),C.messages){for(let[M,T]of Object.entries(C.messages))if(e.isReferenceObject(T)||e.isMessageWithPayload(T))if(c[M]||(c[M]=[]),e.isReferenceObject(T)){let z=e.resolveMessageReference(T);c[M].push({channelId:P,payload:z.payload})}else c[M].push({channelId:P,payload:T.payload})}for(let[P,C]of Object.entries(c))if(C.length===1){let M=C[0],T=M.channelId;o[T]=o[T]||{},o[T][P]=CS(M.payload,!1,!1,e,[P],r,e.namespace)}else{d.push(P);for(let{channelId:M,payload:T}of C){let z=`${M}_${P}`;o[M]||(o[M]={}),o[M][z]=CS(T,!1,!1,e,[z],r,e.namespace)}}let u=Object.values(o).reduce((P,C)=>({...P,...C}),{}),l=new nao(u,e),m={};for(let[P,C]of Object.entries(i.servers??{}))m[P]={name:P,url:bzs(C.protocol,C.host)};let A={};for(let[P,C]of Object.entries(i.operations??{})){if(ev(C,lIe.IGNORE))continue;let M=XGC(C);if(A[M]||(A[M]={subscribe:[],publish:[],__parsedMessages:[]}),C.action==="receive")A[M].subscribe.push(...C.messages);else if(C.action==="send")A[M].publish.push(...C.messages);else throw new Error(`Operation ${P} has an invalid action: ${C.action}`)}for(let[P,C]of Object.entries(A)){let M=[];M.push(...QYy({messages:C.subscribe,channelPath:P,origin:"server",messageSchemas:o[P]??{},duplicatedMessageIds:d,context:e})),M.push(...QYy({messages:C.publish,channelPath:P,origin:"client",messageSchemas:o[P]??{},duplicatedMessageIds:d,context:e})),A[P]!=null&&(A[P].__parsedMessages=M)}for(let[P,C]of Object.entries(i.channels??{})){if(ev(C,lIe.IGNORE))continue;let M=[],T=[],z=[];if(C.parameters!=null)for(let[U,R]of Object.entries(C.parameters)){let V=e.isReferenceObject(R)?e.resolveParameterReference(R):R,{type:Y,parameterKey:re}=V.location!=null?ZGC(V.location):{type:C.address?.includes(`={${U}}`)?"query":"path",parameterKey:U},Z=ev(V,lIe.FERN_PARAMETER_OPTIONAL),ee=bU(FA(P))+bU(FA(U)),ne={...V,type:"string",title:ee,example:V.examples?.[0],default:V.default,enum:V.enum,required:void 0},me=CS(ne,!1,!1,e,[re],r,e.namespace);Z&&(me=Sh.optional({value:me,description:void 0,availability:void 0,generatedName:"",title:ee,namespace:void 0,groupName:void 0,nameOverride:void 0,inline:void 0}));let be={name:re,description:V.description,parameterNameOverride:void 0,schema:me,variableReference:void 0,availability:owe(R),source:r};Y==="header"?M.push({...be,env:void 0}):Y==="path"?T.push(be):(Y==="payload"||Y==="query")&&z.push(be)}if(M.length>0||z.length>0||A[P]!=null&&(A[P].publish!=null||A[P].subscribe!=null)){let U=vzs(C),R=A[P]?.__parsedMessages??[],V=[];if(U.length>0)V=l.buildWebsocketSessionExamplesForExtension({context:e,extensionExamples:U,handshake:{headers:M,queryParameters:z},source:r,namespace:e.namespace});else{let re=[],{examplePublishMessage:Z,exampleSubscribeMessage:ee}=eJC({messages:R,messageSchemas:o[P]??{}});Z!=null&&re.push(Z),ee!=null&&re.push(ee);let ne=l.buildWebsocketSessionExample({handshake:{headers:M,queryParameters:z},messages:re});ne!=null&&V.push(ne)}let Y=ev(C,lIe.FERN_SDK_GROUP_NAME);s[P]={audiences:ev(C,pb.AUDIENCES)??[],handshake:{headers:M.map(re=>({...re,schema:k6(re.schema),env:re.env})),queryParameters:z.map(re=>({...re,schema:k6(re.schema)})),pathParameters:T.map(re=>({...re,parameterNameOverride:void 0,schema:k6(re.schema)}))},groupName:e.resolveGroupName(typeof Y=="string"?[Y]:Y??[P]),messages:R,summary:ev(C,lIe.FERN_DISPLAY_NAME),servers:(C.servers?.map(re=>kGC(m,re))??Object.values(m)).map(re=>({...re,name:re.name})),path:C.address?.split("?")[0]??gzs(P),description:C.description,examples:V,source:r}}}return{groupedSchemas:rao(e.namespace,a),channels:s,servers:Object.values(m).map(P=>({...P,name:P.name})),basePath:ev(i,lIe.BASE_PATH)}}function XGC(e){if(!e.channel.$ref.startsWith(xYy))throw new Error(`Failed to resolve channel path from operation ${e.channel.$ref}`);return e.channel.$ref.substring(xYy.length)}function ZGC(e){try{let[t,r]=e.split("#/");if(t==null||r==null)throw new Error(`Invalid location format: ${e}; unable to parse message type and parameter key`);if(!t.startsWith(SRf))throw new Error(`Invalid location format: ${e}; expected ${SRf} prefix`);let n=t.substring(SRf.length);if(n!=="header"&&n!=="path"&&n!=="payload")throw new Error(`Invalid message type: ${n}. Must be one of: header, path, payload`);return{type:n,parameterKey:r}}catch{throw new Error(`Invalid location format: ${e}; see here for more details: https://www.asyncapi.com/docs/reference/specification/v3.0.0#runtimeExpression`)}}function kGC(e,t){if(!t.$ref.startsWith(zYy))throw new Error(`Failed to resolve server name from server ref ${t.$ref}`);let r=t.$ref.substring(zYy.length),n=e[r];if(n==null)throw new Error(`Failed to find server with name ${r}`);return n}function QYy({messages:e,channelPath:t,origin:r,messageSchemas:n,duplicatedMessageIds:i,context:a}){let o=[];return e.forEach((c,d)=>{let u=a.resolveMessageReference(c).name;i.includes(u)&&(u=`${t}_${u}`);let l=n[u];l!=null&&o.push({origin:r,name:u??`${r}Message${d+1}`,body:k6(l)})}),o}function eJC({messages:e,messageSchemas:t}){let r=e.find(o=>o.origin==="client")?.name,n=e.find(o=>o.origin==="server")?.name,i=r!=null?t[r]:void 0,a=n!=null?t[n]:void 0;return{examplePublishMessage:i!=null&&r!=null?{type:r,payload:i}:void 0,exampleSubscribeMessage:a!=null&&n!=null?{type:n,payload:a}:void 0}}function UYy({document:e,taskContext:t,options:r,source:n,asyncApiOptions:i,namespace:a}){let o=[];if(a!=null&&o.push(a),parseFloat(e.asyncapi)<3){let c=e;c.tags?.[0]!=null?o.push(c.tags[0].name):i.naming!=="v2"&&o.push("websocket");let d=new _zs({document:c,taskContext:t,options:r,namespace:a});return FYy({context:d,breadcrumbs:o,source:n,asyncApiOptions:i,document:c})}else{let c=e,d=new mzs({document:c,taskContext:t,options:r,namespace:a});return LYy({context:d,breadcrumbs:o,source:n,asyncApiOptions:i,document:c})}}function VYy(e){return ev(e,pb.ASYNC_CONFIG)}var WYy="$request.";function HYy(e){let t=ev(e,pb.STREAMING);if(t!=null)return typeof t=="boolean"?t?{type:"stream",format:"json"}:void 0:t["stream-condition"]==null&&t.format!=null?{type:"stream",format:t.format}:{type:"streamCondition",format:t.format??"json",streamDescription:t["stream-description"],streamConditionProperty:tJC(t["stream-condition"]),responseStream:t["response-stream"],response:t.response}}function tJC(e){return e.startsWith(WYy)?e.slice(WYy.length):e}function GYy(e){let t=e;if(t.cursor!=null)return Eit.cursor({cursor:t.cursor,nextCursor:t.next_cursor,results:t.results});if("offset"in e){let r=e;return Eit.offset({offset:r.offset,results:r.results,step:r.step,hasNextPage:r["has-next-page"]})}if("type"in e&&e.type==="custom"){let r=e;return Eit.custom({results:r.results})}throw new Error("Invalid pagination extension")}function JYy(e,t){let r=ev(t,pb.PAGINATION);if(r!=null){if(typeof r=="boolean"){let n=ev(e,pb.PAGINATION);if(typeof n=="boolean")throw new Error("Global pagination extension is a boolean, expected an object. Only endpoints may declare a boolean for x-fern-pagination.");return n==null?void 0:GYy(n)}return GYy(r)}}function KYy(e){let t=rJC(e),r={};return DRf({obj:t,occurrences:r,breadcrumbs:[]}),r}function DRf({obj:e,occurrences:t,breadcrumbs:r}){if(e!=null){if(Array.isArray(e)){for(let n of e)DRf({obj:n,occurrences:t,breadcrumbs:r});return}if(typeof e=="object"){if(e.$ref!=null&&typeof e.$ref=="string"){let n=e.$ref;t[n]==null?t[n]=1:t[n]+=1;return}for(let n in e)DRf({obj:e[n],occurrences:t,breadcrumbs:[...r,n]})}}}function rJC(e){return{...e,paths:Object.fromEntries(Object.entries(e.paths??{}).map(([t,r])=>[t,{...r,get:r?.get!=null?yko(r.get):void 0,put:r?.put!=null?yko(r.put):void 0,post:r?.post!=null?yko(r.post):void 0,patch:r?.patch!=null?yko(r.patch):void 0,delete:r?.delete!=null?yko(r.delete):void 0}]))}}function yko(e){return{...e,requestBody:e.requestBody!=null?Kg(e.requestBody)?e.requestBody:nJC(e.requestBody):void 0}}function nJC(e){let t,r;for(let n in e.content){let i=J8.parse(n);i!=null&&(i.isJSON()?t=e.content[n]:i.isMultipart()&&(r=e.content[n]))}return r!=null&&t!=null?{...e,content:{[J8.MULTIPART_FORM_DATA]:r}}:e}var Ozs=class{endpoints;parser=new isa;constructor({context:t,options:r}){this.endpoints=r.filter?.endpoints?new Set(this.validateAndFilterEndpoints({context:t,endpoints:r.filter.endpoints})):void 0}skipEndpoint({method:t,path:r}){return this.endpoints!=null&&!this.endpoints.has(`${t} ${r}`)}hasEndpoints(){return this.endpoints!=null}validateAndFilterEndpoints({context:t,endpoints:r}){let n=[];for(let i of r){let a=this.parser.tryParse(i);if(a==null){t.logger.debug(`Ignoring configured filter endpoint "${i}"; expected format "POST /users/get"`);continue}n.push(`${a.method} ${a.path}`)}return n}};var $Yy="#/components/parameters/",YYy="#/components/responses/",XYy="#/components/examples/",ZYy="#/components/requestBodies/",kYy="#/components/securitySchemes/",iao=class{logger;document;taskContext;authHeaders;refOccurrences;DUMMY;options;source;filter;namespace;constructor({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:o}){this.document=t,this.logger=r.logger,this.taskContext=r,this.authHeaders=n,this.refOccurrences=KYy(t),this.options=i,this.source=a,this.filter=new Ozs({context:r,options:i}),this.DUMMY=this.getDummy(),this.namespace=o}getNumberOfOccurrencesForRef(t){return this.refOccurrences[t.$ref]??0}resolveTagsToTagIds(t){let r=[];return this.namespace!=null&&r.push(this.namespace),r.concat(t??[])}resolveTags(t){let r=[];if(this.namespace!=null){let n={type:"namespace",name:this.namespace};r.push(n)}return r.concat(t??[])}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveSchemaReference(t){let r=t.$ref.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return{"x-fern-type":"unknown"};if(Array.isArray(n)){let a=parseInt(i,10);if(isNaN(a)||a<0||a>=n.length)return{"x-fern-type":"unknown"};n=n[a]}else n=n[i]}return n==null?(this.logger.warn(`Encountered undefined reference: ${t.$ref}`),{"x-fern-type":"unknown"}):(Kg(n)&&(n=this.resolveSchemaReference(n)),n)}resolveParameterReference(t){if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith($Yy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring($Yy.length),n=this.document.components.parameters[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveParameterReference(n):n}resolveRequestBodyReference(t){if(this.document.components==null||this.document.components.requestBodies==null||!t.$ref.startsWith(ZYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(ZYy.length),n=this.document.components.requestBodies[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveRequestBodyReference(n):n}resolveResponseReference(t){if(this.document.components==null||this.document.components.responses==null||!t.$ref.startsWith(YYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(YYy.length),n=this.document.components.responses[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveResponseReference(n):n}resolveExampleReference(t){if(this.document.components==null||this.document.components.examples==null||!t.$ref.startsWith(XYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(XYy.length),n=this.document.components.examples[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveExampleReference(n):n}resolveSecuritySchemeReference(t){if(this.document.components==null||this.document.components.securitySchemes==null||!t.$ref.startsWith(kYy))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(kYy.length),n=this.document.components.securitySchemes[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return Kg(n)?this.resolveSecuritySchemeReference(n):n}referenceExists(t){let r=t.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return!1;n=n[i]}return!0}};var pda=class extends iao{constructor({document:t,taskContext:r,options:n,source:i,namespace:a}){super({document:t,taskContext:r,authHeaders:new Set,options:n,source:i,namespace:a})}getDummy(){return this}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}getReferencedSchemas(){return new Set}markReferencedByDiscriminatedUnion(t,r,n){}getReferencesFromDiscriminatedUnion(t){}excludeSchema(t){}isSchemaExcluded(t){return!1}markSchemaWithDiscriminantValue(t,r,n){}getDiscriminatedUnionMetadata(t){}};var iJC=nl.object({lang:nl.string(),label:nl.optional(nl.string()),source:nl.string()}),CRf=nl.array(iJC);var eXy={README_EXT:"x-readme"};function aJC(e){if(!Array.isArray(e))return!1;for(let t of e)if(!bR(t)||typeof t.language!="string"||typeof t.code!="string")return!1;return!0}function tXy(e){let t=ev(e,eXy.README_EXT);if(!bR(t))return[];let r=t["code-samples"];if(!aJC(r))return[];let n=[];for(let i of r)n.push({name:i.name,language:i.language,code:i.code,install:i.install,docs:void 0});return n}function rXy(e,t,r){let i=(ev(t,pb.EXAMPLES)??[]).filter(s=>{let u=hZ.serialization.ExampleEndpointCallSchema.parse(s);return u.ok||r.logger.error(`Failed to parse x-fern-example in ${e.path}/${e.method}`),u.ok}),a=lko(t,xbe.REDOCLY_CODE_SAMPLES_KEBAB,CRf,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],c=[...lko(t,xbe.REDOCLY_CODE_SAMPLES_CAMEL,CRf,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],...a];c.length>0&&i.push({"code-samples":c.map(s=>({name:s.label??s.lang,language:s.lang,code:s.source,install:void 0,docs:void 0}))});let d=tXy(t);return d.length>0&&i.push({"code-samples":d}),i.map(Vyt.unknown)}function nXy(e){let t=ev(e,pb.AVAILABILITY);if(t==="ga"||t==="generally-available")return qde.GenerallyAvailable;if(t==="beta"||t==="pre-release")return qde.Beta;if(t==="deprecated")return qde.Deprecated;if(e.deprecated)return qde.Deprecated}function iXy(e){let t=ev(e,pb.RETRIES);if(t!=null&&t.disabled===!0)return HFs.RetriesConfiguration.disabled(t.disabled)}function Azs(e,t){return{url:oJC({url:e.url,variables:e.variables??{}}),description:e.description,name:uJC(e,t),audiences:ev(e,pb.AUDIENCES)}}function oJC({url:e,variables:t}){let r=Object.fromEntries(Object.entries(t).map(([n,i])=>[n,i.default]));for(let[n,i]of Object.entries(r))e=e.replace(`{${n}}`,encodeURIComponent(i));return e}function uJC(e,t){let r=ev(e,[pb.SERVER_NAME_V1,pb.SERVER_NAME_V2]);if(r!=null)return r;if(e.description?.toLowerCase()==="production")return"Production";if(e.description?.toLowerCase()==="sandbox")return"Sandbox";if(t?.groupMultiApiEnvironments&&e.description!=null&&e.description.trim()!==""){let n=e.description.toLowerCase();return n==="prd"?"Production":n==="sbx"?"Sandbox":n==="staging"||n==="stg"?"Staging":n==="development"||n==="dev"?"Development":e.description}}function aXy(e){return ev(e,pb.PARAMETER_NAME)}function oXy(e){return ev(e,pb.SDK_VARIABLE)}function Pzs({path:e,httpMethod:t,parameters:r,context:n,requestBreadcrumbs:i,source:a}){let o={pathParameters:[],queryParameters:[],headers:[]};for(let c of r){let d=ev(c,pb.IGNORE);if(d!=null&&d){n.logger.debug(`${t.toUpperCase()} ${e} has a parameter marked with x-fern-ignore. Skipping.`);continue}let s=Kg(c)?n.resolveParameterReference(c):c,u=s.required??!1,l=owe(s),m=[...i,s.name],A=Cie(m,n.options.preserveSchemaIds),[P,C]=n.options.coerceOptionalSchemasToNullable?[!1,!u]:[!u,!1],M=s.schema!=null?CS(s.schema,P,C,n,m,a,n.namespace,!1,new Set,lWr({schema:s,logger:n.logger})):u?Sh.primitive({nameOverride:void 0,generatedName:A,title:void 0,schema:G0.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:lWr({schema:s,logger:n.logger})}),description:void 0,availability:l,namespace:void 0,groupName:void 0}):Sh.optional({nameOverride:void 0,generatedName:A,title:void 0,value:Sh.primitive({nameOverride:void 0,generatedName:A,title:void 0,schema:G0.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:lWr({schema:s,logger:n.logger})}),description:void 0,availability:void 0,namespace:void 0,groupName:void 0}),description:void 0,availability:l,namespace:void 0,groupName:void 0,inline:void 0});if(s.in==="header"&&s.schema!=null&&!Kg(s.schema)&&s.schema.default!=null){let z=s.schema.default;typeof z=="string"&&z.length>0&&(M=Sh.literal({nameOverride:void 0,generatedName:A,title:void 0,value:eW.string(z),description:void 0,availability:l,namespace:void 0,groupName:void 0}))}let T={name:s.name,schema:M,description:s.description,parameterNameOverride:aXy(s),availability:l,source:a};s.in==="query"?o.queryParameters.push(T):s.in==="path"?o.pathParameters.push({...T,variableReference:oXy(s)}):s.in==="header"?!sJC.has(s.name.toLowerCase())&&!n.authHeaders.has(s.name)?o.headers.push({...T,env:void 0}):n.logger.debug(`Ignoring ${s.name} header, in ${t.toUpperCase()} ${e}`):n.logger.warn(`Skipping ${s.in} parameter, ${s.name}, in ${t.toUpperCase()} ${e}`)}return o}var sJC=new Set(["user-agent","content-length","content-type","x-forwarded-for","cookie","origin","content-disposition","x-ping-custom-domain"]);function uXy(e,t){for(let r of Object.keys(e))if(r.includes("text/event-stream")){let n=e[r];if(n==null)continue;let i=n.schema;return{contentType:r,schema:i??{},examples:vko(n,t)}}}function cJC(e){return e.includes("json")||e==="*/*"}function IRf({content:e,context:t}){for(let[r,n]of Object.entries(e))if(wzs({mediaType:r,mediaTypeObject:n,context:t})!=null)return[r,n]}function wzs({mediaType:e,mediaTypeObject:t,context:r}){if(!cJC(e))return;let n=t.schema;return{contentType:e.includes("*")?void 0:e,schema:n??{},examples:vko(t,r)}}function jzs({content:e,context:t}){let r=IRf({content:e,context:t});if(!r)return;let[n,i]=r;return wzs({mediaType:n,mediaTypeObject:i,context:t})}function sXy(e,t){for(let r of Object.keys(e)){let n=e[r];if(n==null)continue;return{schema:n.schema??{},examples:vko(n,t)}}}function vko(e,t){let r=[];e.example!=null&&r.push({name:void 0,value:e.example,description:void 0});let n=ev(e,xbe.EXAMPLES);return n!=null&&Object.keys(n).length>0&&r.push(...Object.entries(n).map(([i,a])=>({name:a.summary??i,value:a.value,description:a.description}))),e.examples!=null&&Object.keys(e.examples).length>0&&r.push(...Object.entries(e.examples).map(([i,a])=>{let o=Kg(a)?t.resolveExampleReference(a):a;return{name:o.summary??i,value:o.value,description:o.description}})),r}function lJC({content:e,context:t}){for(let[r,n]of Object.entries(e))if(lXy({mediaType:r,mediaTypeObject:n,context:t}))return[r,n]}function lXy({mediaType:e,mediaTypeObject:t,context:r}){if(J8.parse(e)?.isURLEncoded())return{schema:t.schema,contentType:e,examples:vko(t,r)}}function fJC({content:e}){for(let[t,r]of Object.entries(e))if(fXy({mediaType:t,mediaTypeObject:r}))return[t,r]}function fXy({mediaType:e,mediaTypeObject:t}){if(J8.parse(e)?.isMultipart())return{schema:t.schema,encoding:t.encoding}}function dXy({mediaType:e}){return J8.parse(e)?.isBinary()??!1}function dJC({content:e}){for(let[t,r]of Object.entries(e))if(dXy({mediaType:t}))return[t,r]}function pJC(e,t){let r=Kg(e)?MRf(e,t):{id:void 0,schema:e};return Object.entries(r.schema.properties??{}).find(([n,i])=>!Kg(i)&&i.type==="string"&&i.format==="binary")!=null}function Szs({content:e,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o}){let c=dJC({content:e});if(c){let[m,A]=c;return fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o})}let d=fJC({content:e}),s=IRf({content:e,context:n}),u=_JC({json:s,multipart:d,document:r,visitor:{json:([m,A])=>fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o}),multipart:([m,A])=>fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o}),neither:()=>{}}});if(u)return u;let l=lJC({content:e,context:n});if(l){let[m,A]=l;return fWr({mediaType:m,mediaTypeObject:A,description:t,document:r,context:n,requestBreadcrumbs:i,source:a,namespace:o})}}function _JC({json:e,multipart:t,document:r,visitor:n}){if(!e&&!t)return n.neither();let[,i]=e??[void 0,void 0],[,a]=t??[void 0,void 0];return!i?.schema&&!a?.schema?n.neither():i?.schema&&a?.schema?i.schema&&pJC(i.schema,r)?n.multipart(t):n.json(e):i?.schema?n.json(e):a?.schema?n.multipart(t):n.neither()}function fWr({mediaType:e,mediaTypeObject:t,description:r,document:n,context:i,requestBreadcrumbs:a,source:o,namespace:c}){let d=hJC({mediaTypeObject:t});if(dXy({mediaType:e}))return uIe.octetStream({description:r,source:o,sdkMethodName:d,contentType:e});let s=fXy({mediaType:e,mediaTypeObject:t}),u=s?.schema,l=s?.encoding;if(u){let P=Kg(u)?MRf(u,n):{id:void 0,schema:u},C=CS(P.schema,!1,!1,i,a,o,c,!1),M=[];if(C.type==="object"){let T=new Set(P.schema.required??[]);for(let z of C.properties){let U=T.has(z.key),{isFile:R,isOptional:V,isArray:Y,description:re}=Ezs({schema:z.schema,isOptional:!U});if(R){let Z=cXy(z.key,l);M.push({key:z.key,schema:nWr.file({isOptional:V,isArray:Y,description:re}),description:re,contentType:Z,exploded:!1,encoding:Z==null?i.options.defaultFormParameterEncoding:void 0})}else{let Z=cXy(z.key,l);M.push({key:z.key,schema:nWr.json(z.schema),description:void 0,contentType:Z,exploded:l?.[z.key]?.explode,encoding:Z==null?i.options.defaultFormParameterEncoding:vJC(Z)})}}}return uIe.multipart({name:Kg(u)&&i.getNumberOfOccurrencesForRef(u)===1?P.id:void 0,description:P.schema.description,properties:M,source:o,sdkMethodName:d})}let m=wzs({mediaType:e,mediaTypeObject:t,context:i});if(m){let P=CS(m.schema,!1,!1,i,a,o,c,!0);return uIe.json({description:void 0,schema:P,contentType:m.contentType,fullExamples:m.examples,additionalProperties:!Kg(m.schema)&&dko(m.schema.additionalProperties,i.options),source:o,sdkMethodName:d})}let A=lXy({mediaType:e,mediaTypeObject:t,context:i});if(A!=null&&A.schema!=null){let P=CS(A.schema,!1,!1,i,a,o,c,!1);return uIe.formUrlEncoded({schema:P,description:r,contentType:A.contentType,source:o,fullExamples:A.examples,additionalProperties:!1,sdkMethodName:d})}}function hJC({mediaTypeObject:e}){return ev(e,pb.SDK_METHOD_NAME)}var yJC={"application/json":"json"};function vJC(e){return e?yJC[e]:void 0}function MRf(e,t){if(!e.$ref.startsWith(dda))throw new Error(`Failed to resolve schema reference because of unsupported prefix: ${e.$ref}`);let r=e2i(e);if(r==null)throw new Error(`Failed to resolve schema reference because missing schema id: ${e.$ref}`);let n=t.components?.schemas?.[r];if(n==null)throw new Error(`Failed to resolve schema reference because missing: ${e.$ref}`);return Kg(n)?MRf(n,t):{id:r,schema:n}}function Ezs({schema:e,isOptional:t,isArray:r,description:n}){return gJC(e)?Ezs({schema:e.value,isOptional:!0,isArray:r,description:e.description}):mJC(e)?Ezs({schema:e.value,isOptional:t,isArray:r,description:e.description}):OJC(e)?Ezs({schema:e.value,isOptional:t,isArray:!0,description:e.description}):bJC(e)?{isFile:!0,isOptional:t??!1,isArray:r??!1,description:n??e.description}:{isFile:!1,isOptional:t??!1,isArray:r??!1,description:void 0}}function bJC(e){return e.type==="primitive"&&e.schema.type==="string"&&e.schema.format==="binary"}function gJC(e){return e.type==="optional"}function mJC(e){return e.type==="nullable"}function OJC(e){return e.type==="array"}function cXy(e,t){return t?.[e]?.contentType}var BRf={400:"BadRequestError",401:"UnauthorizedError",402:"PaymentRequiredError",403:"ForbiddenError",404:"NotFoundError",405:"MethodNotAllowedError",406:"NotAcceptableError",407:"ProxyAuthenticationRequiredError",408:"RequestTimeoutError",409:"ConflictError",410:"GoneError",411:"LengthRequiredError",412:"PreconditionFailedError",413:"ContentTooLargeError",414:"URITooLongError",415:"UnsupportedMediaTypeError",416:"RangeNotSatisfiableError",417:"ExpectationFailedError",418:"ImATeapotError",419:"AuthenticationTimeoutError",420:"MethodFailureError",421:"MisdirectedRequestError",422:"UnprocessableEntityError",423:"LockedError",424:"FailedDependencyError",425:"TooEarlyError",426:"UpgradeRequiredError",428:"PreconditionError",429:"TooManyRequestsError",430:"RequestHeaderFieldsTooLargeError",431:"RequestHeaderFieldsTooLargeError",444:"NoResponseError",449:"RetryWithError",450:"BlockedByWindowsParentalControlsError",451:"UnavailableForLegalReasonsError",498:"InvalidTokenError",499:"ClientClosedRequestError",500:"InternalServerError",501:"NotImplementedError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError",505:"HTTPVersionNotSupportedError",506:"VariantAlsoNegotiatesError",507:"InsufficientStorageError",508:"LoopDetectedError",509:"BandwidthLimitExceededError",510:"NotExtendedError",511:"NetworkAuthenticationRequiredError"},pXy=new Set(Object.values(BRf));var AJC=["200","201","202","204"];function hXy({operationContext:e,responses:t,context:r,responseBreadcrumbs:n,responseStatusCode:i,streamFormat:a,source:o}){if(t==null)return{value:void 0,errors:{}};let c=PJC({responses:t,context:r,source:o,namespace:r.namespace}),d=!1,s;for(let u of i!=null?[i]:AJC){let l=t[u];l!=null&&(d=!0,s==null&&(s=_Xy({operationContext:e,response:l,context:r,responseBreadcrumbs:n,streamFormat:a,source:o,namespace:r.namespace,statusCode:typeof u=="string"?parseInt(u):u})))}if(s==null&&!d&&t.default!=null&&(s=_Xy({operationContext:e,response:t.default,context:r,responseBreadcrumbs:n,streamFormat:a,source:o,namespace:r.namespace})),s!=null)switch(s.type){case"json":return{value:s,errors:c};case"streamingJson":case"streamingSse":return{value:s,errors:c};case"bytes":case"file":case"text":case"streamingText":return{value:s,errors:c};default:ks(s)}return{value:void 0,errors:c}}function _Xy({operationContext:e,streamFormat:t,response:r,context:n,responseBreadcrumbs:i,source:a,namespace:o,statusCode:c}){let d=Kg(r)?n.resolveResponseReference(r):r;if(d.content!=null&&Object.entries(d.content).find(([m,A])=>{if(A.schema==null)return!1;let P=Kg(A.schema)?n.resolveSchemaReference(A.schema):A.schema;return P.type==="string"&&P.format==="binary"}))return n.options.useBytesForBinaryResponse&&t==null?cL.bytes({description:d.description,source:a,statusCode:c}):cL.file({description:d.description,source:a,statusCode:c});let s=uXy(d.content??{},n);if(s!=null&&t!=null)switch(t){case"json":return cL.streamingJson({statusCode:c,description:d.description,responseProperty:ev(e.operation,pb.RESPONSE_PROPERTY),fullExamples:s.examples,schema:CS(s.schema,!1,!1,n,i,a,o),source:a});case"sse":return cL.streamingSse({description:d.description,responseProperty:void 0,fullExamples:s.examples,schema:CS(s.schema,!1,!1,n,i,a,o),source:a,statusCode:c})}let u=jzs({context:n,content:d.content??{}});if(u){if(t!=null)switch(t){case"json":return cL.streamingJson({description:d.description,responseProperty:void 0,fullExamples:u.examples,schema:CS(u.schema,!1,!1,n,i,a,o),source:a,statusCode:c});case"sse":return cL.streamingSse({description:d.description,responseProperty:void 0,fullExamples:u.examples,schema:CS(u.schema,!1,!1,n,i,a,o),source:a,statusCode:c})}return cL.json({description:d.description,schema:CS(u.schema,!1,!1,n,i,a,o),responseProperty:ev(e.operation,pb.RESPONSE_PROPERTY),fullExamples:u.examples,source:a,statusCode:c})}for(let[l,m]of Object.entries(d.content??{})){let A=J8.parse(l);if(A!=null){if(A.isOctetStream()||A.isPDF()||A.isAudio()||A.isImage()||A.isVideo()||A.isMultiPartMixed())return cL.file({description:d.description,source:a,statusCode:c});if(A.isPlainText()){let P=m.schema;if(P==null)return cL.text({description:d.description,source:a,statusCode:c});let C=Kg(P)?n.resolveSchemaReference(P):P;return C.type==="string"&&C.format==="byte"?cL.file({description:d.description,source:a,statusCode:c}):cL.text({description:d.description,source:a,statusCode:c})}}}}function PJC({responses:e,context:t,source:r,namespace:n}){let i={};for(let[a,o]of Object.entries(e)){if(a==="default")continue;let c=parseInt(a);if(c<400||c>600)continue;let d=Kg(o)?t.resolveResponseReference(o):o,s=sXy(d.content??{},t),u=BRf[c];if(u==null){t.logger.warn(`No error name found for status code ${a}`);continue}i[c]={statusCode:c,nameOverride:void 0,generatedName:u,description:d.description,schema:CS(s?.schema??{},!1,!1,t,[u,"Body"],r,n),fullExamples:s?.examples,source:r}}return i}function uwi({operationContext:e,context:t,responseStatusCode:r,suffix:n,streamFormat:i,source:a}){let{document:o,operation:c,path:d,method:s,baseBreadcrumbs:u}=e,l=ev(c,pb.IDEMPOTENT),m=ev(c,[pb.REQUEST_NAME_V1,pb.REQUEST_NAME_V2]),A=[...u,"Request"],P=Pzs({parameters:[...e.pathItemParameters,...e.operationParameters],context:t,requestBreadcrumbs:A,path:d,httpMethod:s,source:a}),C=/{([^}]+)}/g,M=[...d.matchAll(C)].map(ee=>ee[1]).filter(ee=>ee!==void 0);if(M.length>0){let ee=new Map(P.pathParameters.map(be=>[be.name,be])),ne=[],me=new Set;for(let be of M){let Ae=ee.get(be);me.add(be),Ae?ne.push(Ae):ne.push({name:be,variableReference:void 0,parameterNameOverride:void 0,availability:void 0,source:a,schema:Sh.primitive({schema:G0.string({default:void 0,example:void 0,format:void 0,maxLength:void 0,minLength:void 0,pattern:void 0}),description:void 0,generatedName:"",nameOverride:void 0,namespace:void 0,groupName:void 0,availability:void 0,title:void 0}),description:void 0})}for(let be of P.pathParameters)me.has(be.name)||ne.push(be);P.pathParameters=ne}let T=(()=>{if(e.method==="GET")return[void 0];if(!c.requestBody)return[void 0];let ee=Kg(c.requestBody)?t.resolveRequestBodyReference(c.requestBody):c.requestBody,ne=Object.values(ee.content).every(be=>jJC({mediaTypeObject:be})!=null),me=[];if(ne)return me.push(...Object.entries(ee.content).map(([be,Ae])=>{let ye=fWr({mediaType:be,mediaTypeObject:Ae,description:ee.description,document:o,context:new pda({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:A,source:a,namespace:t.namespace});return yXy({context:t,convertedParameters:P})&&ye!=null&&(ye.type==="json"||ye.type==="formUrlEncoded")&&ye.schema.type!=="object"&&c.requestBody!=null?ye=fWr({mediaType:be,mediaTypeObject:Ae,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A,"Body"],source:a,namespace:t.namespace}):c.requestBody!=null&&(ye=fWr({mediaType:be,mediaTypeObject:Ae,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A],source:a,namespace:t.namespace})),ye}).filter(be=>be!=null)),me.length===0?[void 0]:me;{let be=Szs({content:ee.content,description:ee.description,document:o,context:new pda({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:A,source:a,namespace:t.namespace});return yXy({context:t,convertedParameters:P})&&be!=null&&(be.type==="json"||be.type==="formUrlEncoded")&&be.schema.type!=="object"&&c.requestBody!=null?be=Szs({content:ee.content,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A,"Body"],source:a,namespace:t.namespace}):c.requestBody!=null&&(be=Szs({content:ee.content,description:ee.description,document:o,context:t,requestBreadcrumbs:[...A],source:a,namespace:t.namespace})),[be]}})(),z=T.length>1,U=[...u,"Response"],R=hXy({operationContext:e,streamFormat:i,responses:c.responses,context:t,responseBreadcrumbs:U,responseStatusCode:r,source:a}),V=iXy(c),Y=nXy(c),re=rXy(e,c,t),Z=ev(c,pb.SERVER_NAME_V2);return T.map(ee=>({summary:c.summary,internal:ev(c,xbe.INTERNAL),idempotent:l,audiences:ev(c,pb.AUDIENCES)??[],operationId:c.operationId!=null&&n!=null?c.operationId+"_"+n:c.operationId,tags:t.resolveTagsToTagIds(c.tags),namespace:t.namespace,sdkName:EJC({operationContext:e,request:ee}),pathParameters:P.pathParameters,queryParameters:P.queryParameters,headers:P.headers,requestNameOverride:m??void 0,generatedRequestName:Cie(z?wJC({breadcrumbs:A,request:ee}):A,t.options.preserveSchemaIds),request:ee,response:R.value,errors:R.errors,servers:Z!=null?[{name:Z,url:void 0,audiences:void 0}]:(c.servers??[]).map(ne=>Azs(ne,{groupMultiApiEnvironments:t.options.groupMultiApiEnvironments})),description:c.description,authed:DJC(c,o),security:SJC(c),availability:Y,method:s,path:d,examples:re,pagination:e.pagination,source:a,retries:V}))}function wJC({breadcrumbs:e,request:t}){return t?[...e,t.type]:e}function jJC({mediaTypeObject:e}){return ev(e,pb.SDK_METHOD_NAME)}function EJC({operationContext:e,request:t}){return!t||!t.sdkMethodName?e.sdkMethodName:e.sdkMethodName?{groupName:[...e.sdkMethodName.groupName],methodName:t.sdkMethodName??e.sdkMethodName.methodName}:{groupName:[],methodName:t.sdkMethodName}}function SJC(e){return e.security??[]}function DJC(e,t){return e.security!=null?Object.keys(e.security).length>0:t.security!=null?Object.keys(t.security).length>0:!1}function yXy({context:e,convertedParameters:t}){return e.options.inlinePathParameters&&t.pathParameters.length>0||t.queryParameters.length>0||t.headers.length>0}function bXy({operationContext:e,context:t,asyncExtension:r,source:n}){let{operation:i,pathItemParameters:a,operationParameters:o}=e,c=r.discriminant.name,d=r.discriminant.value,s=r["response-status-code"],u=vXy({context:t,headerToIgnore:c,parameters:a}),l=vXy({context:t,headerToIgnore:c,parameters:o}),m=uwi({operationContext:{...e,pathItemParameters:u,operationParameters:l,operation:{...i,responses:Object.fromEntries(Object.entries(i.responses).filter(([P])=>parseInt(P)!==s))}},context:t,streamFormat:void 0,source:n}),A=uwi({operationContext:{...e,pathItemParameters:u,operationParameters:l,baseBreadcrumbs:[...e.baseBreadcrumbs,"async"]},context:t,suffix:"async",responseStatusCode:s,streamFormat:void 0,source:n});return A.forEach(P=>{P.headers.push({name:c,schema:Sh.literal({nameOverride:void 0,generatedName:Cie([c],t.options.preserveSchemaIds),title:void 0,description:void 0,availability:void 0,value:eW.string(d),namespace:void 0,groupName:void 0}),description:void 0,parameterNameOverride:void 0,env:void 0,availability:void 0,source:n})}),{sync:m,async:A}}function vXy({context:e,headerToIgnore:t,parameters:r}){return r.filter(n=>{let i=Kg(n)?e.resolveParameterReference(n):n;return!(i.in==="header"&&i.name===t)})}var TRf="stream";function AXy({operationContext:e,context:t,streamingExtension:r}){switch(r.type){case"stream":return{streaming:uwi({operationContext:e,context:t,streamFormat:r.format,source:t.source}),nonStreaming:[]};case"streamCondition":{let n=gXy({context:t,operation:e.operation,streamingExtension:r,isStreaming:!0});if(n?.schemaReference!=null){let s=e2i(n.schemaReference);s!=null&&t.excludeSchema(s)}let i=mXy({operation:e.operation,response:r.responseStream}),a=uwi({operationContext:{...e,sdkMethodName:e.sdkMethodName!=null?{groupName:e.sdkMethodName.groupName,methodName:e.sdkMethodName.methodName+"_"+TRf}:void 0,operation:{...e.operation,description:r.streamDescription??e.operation.description,requestBody:n?.requestBody,responses:i},baseBreadcrumbs:[...e.baseBreadcrumbs,TRf]},context:t,streamFormat:r.format,suffix:TRf,source:t.source});a.forEach(s=>{s.examples=s.examples.filter(u=>OXy(u,t)!==!1)});let o=gXy({context:t,operation:e.operation,streamingExtension:r,isStreaming:!1}),c=mXy({operation:e.operation,response:r.response}),d=uwi({streamFormat:void 0,operationContext:{...e,operation:{...e.operation,requestBody:o?.requestBody,responses:c}},context:t,source:t.source});return d.forEach(s=>{s.examples=s.examples.filter(u=>OXy(u,t)!==!0)}),{streaming:a,nonStreaming:d}}default:ks(r)}}function gXy({context:e,operation:t,streamingExtension:r,isStreaming:n}){if(t.requestBody==null)return;let i=Kg(t.requestBody)?e.resolveRequestBodyReference(t.requestBody):t.requestBody,a=jzs({content:i.content,context:e});if(a==null)return;let o=Kg(a.schema)?e.resolveSchemaReference(a.schema):a.schema;if(o.allOf==null&&o.properties==null)return;let c=o.properties?.[r.streamConditionProperty];c!=null&&Kg(c)&&(c=void 0);let d={...o,properties:{...o.properties,[r.streamConditionProperty]:{type:"boolean","x-fern-boolean-literal":n,...c??{}}},title:void 0,required:[...o.required??[],r.streamConditionProperty]};return{requestBody:{content:{[J8.APPLICATION_JSON]:{schema:d}}},schemaReference:Kg(a.schema)?a.schema:void 0}}function mXy({operation:e,response:t}){return{...e.responses,200:{description:"",content:{[J8.APPLICATION_JSON]:{schema:t}}}}}function OXy(e,t){return e._visit({unknown:r=>{let n=hZ.serialization.ExampleEndpointCallSchema.parse(r);if(n.ok&&n.value.response!=null)return n.value.response.stream!=null},full:()=>{},_other:()=>{}})}function PXy({context:e,operationContext:t,source:r}){let{document:n,operation:i,path:a,method:o,baseBreadcrumbs:c,sdkMethodName:d}=t,s=[...c,"Payload"],u=Pzs({parameters:[...t.pathItemParameters,...t.operationParameters],context:e,requestBreadcrumbs:s,path:a,httpMethod:o,source:r});if(i.requestBody==null)return e.logger.error(`Skipping webhook ${o.toUpperCase()} ${a}: Missing a request body`),[];let l=i.operationId;if(l==null)return e.logger.error(`Skipping webhook ${a} because no operation id present`),[];if(o!=="POST"&&o!=="GET")return e.logger.error(`Skipping webhook ${o.toUpperCase()} ${a}: Not POST or GET`),[];let m=Kg(i.requestBody)?e.resolveRequestBodyReference(i.requestBody):i.requestBody;return Object.entries(m.content).map(([A,P])=>fWr({mediaType:A,mediaTypeObject:P,description:m.description,document:n,context:e,requestBreadcrumbs:[...c,"Payload"],source:r,namespace:e.namespace})).filter(A=>A!=null).map(A=>{if(A==null||A.type!=="json"&&A.type!=="formUrlEncoded"){e.logger.error(`Skipping webhook ${a} because non-json and non-formUrlEncoded request body`);return}return{summary:i.summary,audiences:ev(i,pb.AUDIENCES)??[],sdkName:d,namespace:e.namespace,method:o,operationId:l,tags:e.resolveTagsToTagIds(i.tags),headers:u.headers,generatedPayloadName:Cie(s,e.options.preserveSchemaIds),payload:A.schema,description:i.description,examples:CJC(A.fullExamples),source:r}}).filter(A=>A!=null)}function CJC(e){if(e==null)return[];let t=[];for(let r of e){let n=r2i(r.value);n!=null&&t.push({description:r.description,name:r.name,payload:n})}return t}function qRf({context:e,pathItemContext:t,operation:r,convertToWebhook:n}){let i=ev(r,pb.IGNORE);if(i!=null&&i){e.logger.debug(`${t.method.toUpperCase()} ${t.path} is marked with x-fern-ignore. Skipping.`);return}let a=IJC(r,e),o=JYy(e.document,r),c={...t,sdkMethodName:a,baseBreadcrumbs:MJC({operation:r,sdkMethodName:a,httpMethod:t.method,path:t.path,shouldUseIdiomaticRequestNames:e.options.shouldUseIdiomaticRequestNames}),operation:r,operationParameters:r.parameters??[],pagination:o};if(n)return{type:"webhook",value:PXy({context:e,operationContext:c,source:e.source})};let d=HYy(r);if(d!=null){let l=AXy({context:e,operationContext:c,streamingExtension:d});return l!=null?{type:"streaming",streaming:l.streaming,nonStreaming:l.nonStreaming}:void 0}let s=VYy(r);if(s!=null){let l=bXy({context:e,operationContext:c,asyncExtension:s,source:e.source});return{type:"async",async:l.async,sync:l.sync}}return{type:"http",value:uwi({context:e,operationContext:c,streamFormat:void 0,source:e.source})}}function IJC(e,t){let r=ev(e,pb.SDK_METHOD_NAME),n=ev(e,pb.SDK_GROUP_NAME)??[];if(r!=null){let i=typeof n=="string"?[n]:n;return i=t.resolveGroupName(i),{groupName:i,methodName:r}}}function MJC({sdkMethodName:e,operation:t,httpMethod:r,path:n,shouldUseIdiomaticRequestNames:i}){let a=[];if(e!=null){if(i&&a.push(e.methodName),e.groupName.length>0){let o=e.groupName[e.groupName.length-1];o!=null&&a.push(typeof o=="string"?o:o.name)}i||a.push(e.methodName)}else t.operationId!=null?a.push(t.operationId):a.push(FA(`${r}_${n.split("/").join("_")}`));return a}function wXy(e,t,r,n){let i=[],a=EXy(t),o={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let c of a){if(n.filter.skipEndpoint({method:c.method,path:e})){n.logger.debug(`Skipping endpoint "${c.method} ${e}"`);continue}let d=BJC({operation:c.operation}),s=qRf({context:n,pathItemContext:{...o,method:c.method},operation:c.operation,convertToWebhook:d});s&&i.push(s)}return i}function jXy(e,t,r,n){let i=[],a=EXy(t),o={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let c of a){if(n.filter.skipEndpoint({method:c.method,path:e})){n.logger.debug(`Skipping endpoint "${c.method} ${e}"`);continue}let d=qRf({context:n,pathItemContext:{...o,method:c.method},operation:c.operation,convertToWebhook:!0});d&&i.push(d)}return i}function EXy(e){let t=[];return e.get!=null&&t.push({method:Nde.Get,operation:e.get}),e.post!=null&&t.push({method:Nde.Post,operation:e.post}),e.put!=null&&t.push({method:Nde.Put,operation:e.put}),e.delete!=null&&t.push({method:Nde.Delete,operation:e.delete}),e.patch!=null&&t.push({method:Nde.Patch,operation:e.patch}),e.head!=null&&t.push({method:Nde.Head,operation:e.head}),t}function BJC({operation:e}){return ev(e,[pb.WEBHOOK])??!1}function SXy(e){let t=ev(e,pb.BASIC_AUTH_USERNAME_VARIABLE_NAME),r=ev(e,pb.BASIC_AUTH_PASSWORD_VARIABLE_NAME);return{usernameVariable:t,passwordVariable:r}}function DXy(e){return ev(e,pb.FERN_BASIC_AUTH)}function IXy(e,t,r,n){if(Kg(e)){if(n==null)throw new Error(`Converting referenced security schemes requires context: ${JSON.stringify(e)}`);let i=n.resolveSecuritySchemeReference(e);return CXy(i,t,r)}return CXy(e,t,r)}function CXy(e,t,r){try{if(e.type==="apiKey"&&e.in==="header"){let n=ev(e,xbe.BEARER_FORMAT),i=ev(e,pb.FERN_HEADER_AUTH);return Tde.header({headerName:e.name,prefix:n!=null?"Bearer":i?.prefix,headerVariableName:i?.name??ev(e,pb.HEADER_VARIABLE_NAME),headerEnvVar:i?.env})}else if(e.type==="http"&&e.scheme?.toLowerCase()==="bearer"){let n=ev(e,pb.FERN_BEARER_TOKEN);return Tde.bearer({tokenVariableName:n?.name??ev(e,pb.BEARER_TOKEN_VARIABLE_NAME),tokenEnvVar:n?.env})}else if(e.type==="http"&&e.scheme?.toLowerCase()==="basic"){let n=DXy(e),i=SXy(e);return Tde.basic({usernameVariableName:n?.username?.name??i.usernameVariable,usernameEnvVar:n?.username?.env,passwordVariableName:n?.password?.name??i.passwordVariable,passwordEnvVar:n?.password?.env})}else{if(e.type==="openIdConnect")return Tde.bearer({tokenVariableName:void 0,tokenEnvVar:void 0});if(e.type==="oauth2")return Tde.oauth({scopesEnum:TJC(e,t)})}}catch(n){r.logger.debug(`Error converting security scheme: ${n?.message}`)}r.logger.warn(`Skipping security scheme: ${JSON.stringify(e,null)} - not currently supported. Please reach out to Fern support team!`)}function TJC(e,t){let r=e.flows.authorizationCode?.scopes??e.flows.clientCredentials?.scopes??e.flows.implicit?.scopes??e.flows.password?.scopes;if(r!=null){let n=k8i({nameOverride:void 0,generatedName:"OauthScope",title:void 0,enumValues:Object.keys(r),fernEnum:Object.fromEntries(Object.entries(r).map(([a,o])=>[a,{description:o}])),_default:void 0,description:void 0,availability:void 0,enumVarNames:void 0,wrapAsOptional:!1,wrapAsNullable:!1,namespace:void 0,groupName:void 0,context:void 0,source:t,inline:void 0}),i=k6(n);if(i.type==="enum")return i}}function MXy(e){return ev(e,pb.BASE_PATH)}var qJC=nl.record(nl.string(),nl.object({summary:nl.string().optional(),description:nl.string().optional()}));function BXy({document:e,context:t}){return lko(e,pb.GROUPS,qJC,t.logger)}function TXy({context:e,document:t}){return ev(t,pb.FERN_VERSION)??void 0}function qXy(e){let t=ev(e,pb.FERN_GLOBAL_HEADERS),r=[];for(let n of t??[])r.push({...n,schema:n.type!=null?fko({fernType:n.type,description:void 0,availability:void 0,generatedName:n.name??n.header,title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function RXy(e){let t=ev(e,pb.FERN_IDEMPOTENCY_HEADERS),r=[];for(let n of t??[])r.push({...n,schema:n.type!=null?fko({fernType:n.type,description:void 0,availability:void 0,generatedName:n.name??n.header,title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function NXy(e,t){let r=ev(e,pb.SDK_VARIABLES);return r==null?{}:Object.fromEntries(Object.entries(r).map(([n,i])=>{if(i.type==="string")return[n,{nameOverride:void 0,generatedName:Cie([n],t),title:i.title,schema:Lq.string({default:kio(i),pattern:i.pattern,format:i.format,minLength:i.minLength,maxLength:i.maxLength}),description:i.description,availability:void 0,namespace:void 0,groupName:void 0}];throw new Error(`Variable ${n} has unsupported schema ${JSON.stringify(i)}`)}))}var RJC="webhooks";function FXy(e){return ev(e,RJC)??{}}var bko=class extends iao{nonRequestReferencedSchemas=new Set;twoOrMoreRequestsReferencedSchemas=new Set;singleRequestReferencedSchemas=new Set;discriminatedUnionReferences={};discriminatedUnionMetadata={};schemasToExclude=new Set;constructor({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:o}){super({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:o})}getDummy(){return new pda({document:this.document,taskContext:this.taskContext,options:this.options,source:this.source,namespace:this.namespace})}markSchemaAsReferencedByNonRequest(t){this.nonRequestReferencedSchemas.add(t)}markSchemaAsReferencedByRequest(t){this.singleRequestReferencedSchemas.has(t)?this.twoOrMoreRequestsReferencedSchemas.add(t):this.singleRequestReferencedSchemas.add(t)}getReferencedSchemas(){return new Set([...this.nonRequestReferencedSchemas,...this.twoOrMoreRequestsReferencedSchemas])}markReferencedByDiscriminatedUnion(t,r,n){let i=this.discriminatedUnionReferences[t.$ref];i!=null?(i.discriminants.add(r),i.numReferences+=n):this.discriminatedUnionReferences[t.$ref]={discriminants:new Set([r]),numReferences:n}}getReferencesFromDiscriminatedUnion(t){return this.discriminatedUnionReferences[t.$ref]}markSchemaWithDiscriminantValue(t,r,n){let i=this.discriminatedUnionMetadata[t.$ref];i!=null?i.discriminants.set(r,n):this.discriminatedUnionMetadata[t.$ref]={discriminants:new Map([[r,n]])}}getDiscriminatedUnionMetadata(t){return this.discriminatedUnionMetadata[t.$ref]}excludeSchema(t){this.schemasToExclude.add(t)}isSchemaExcluded(t){return this.schemasToExclude.has(t)}};function xXy(e){return ev(e,pb.RESOLUTIONS)}function zXy({openapi:e}){let t=xXy(e);if(t==null)return e;let r={};for(let n of t){let i=`#/components/schemas/${n.name}`;for(let a of n.resolutions)e=NJC({openapi:e,schemaReference:a,schemaName:n.name}),e=QXy({openapi:e,replaceReference:a,schemaReference:i,replacedReferences:r}),r={...r,...Object.fromEntries(n.resolutions.map(o=>[i,o]))}}return e}function NJC({openapi:e,schemaReference:t,schemaName:r}){let n=t.replace("#/","").split("/").map(a=>a.replaceAll("~1","/")),i=e;for(let a of n){let o=i[a];if(o==null)return e;i=o}return e.components==null&&(e.components={}),e.components.schemas==null&&(e.components.schemas={}),e.components.schemas[r]=i,e}function QXy({openapi:e,replaceReference:t,schemaReference:r,replacedReferences:n}){let i=Object.keys(n).filter(d=>t.startsWith(d)).sort((d,s)=>s.length-d.length)[0];if(i!=null){let d=n[i];if(d!=null){let s=r.replace(i,d);return QXy({openapi:e,replaceReference:t,schemaReference:s,replacedReferences:{}})}}let a=t.replace("#/","").split("/").map(d=>d.replaceAll("~1","/")),o=e;for(let d of a.slice(0,-1)){let s=o[d];if(s==null)return e;o=s}let c=a[a.length-1];return c==null||(o[c]={$ref:r}),e}function UXy({openApi:e,taskContext:t,options:r,source:n,namespace:i}){e=zXy({openapi:e});let a=new bko({document:e,taskContext:t,authHeaders:new Set,options:r,source:n,namespace:i}),o=Object.fromEntries(Object.entries(e.components?.securitySchemes??{}).map(([ee,ne])=>{let me=IXy(ne,n,t,a);return me==null?null:[ee,me]}).filter(ee=>ee!==null)),c=new Set(...Object.entries(o).map(([ee,ne])=>ne.type==="basic"||ne.type==="bearer"?"Authorization":ne.type==="header"?ne.headerName:null)),d=NXy(e,r.preserveSchemaIds),s=qXy(e),u=RXy(e),l=r.audiences??[],m=[],A=[],P=new bko({document:e,taskContext:t,authHeaders:c,options:r,source:n,namespace:i});P.filter.hasEndpoints()&&t.logger.debug("Endpoint filter applied..."),Object.entries(e.paths??{}).forEach(([ee,ne])=>{if(ne==null)return;let me=wXy(ee,ne,e,P);for(let be of me){let Ae=LXy({operation:be});if(!(l.length>0&&!l.some(ye=>Ae.includes(ye))))switch(be.type){case"async":m.push(...be.sync),m.push(...be.async);break;case"http":m.push(...be.value);break;case"streaming":m.push(...be.streaming),be.nonStreaming&&m.push(...be.nonStreaming);break;case"webhook":A.push(...be.value);break;default:ks(be)}}}),Object.entries(FXy(e)).forEach(([ee,ne])=>{if(ne==null)return;t.logger.debug(`Converting path ${ee}`);let me=jXy(ee,ne,e,P);for(let be of me){let Ae=LXy({operation:be});l.length>0&&!l.some(ye=>Ae.includes(ye))||A.push(...be.value)}});let C=Object.fromEntries(Object.entries(e.components?.schemas??{}).map(([ee,ne])=>{let me=ev(ne,pb.SDK_NAMESPACE);if(!Kg(ne)){let be=ev(ne,pb.IGNORE);if(be!=null&&be)return[];if(pXy.has(ee))return[ee,CS({...ne,"x-fern-type-name":`${ee}Body`},!1,!1,P,[ee],n,me??i)]}return[ee,CS(ne,!1,!1,P,[ee],n,me??i)]}).filter(ee=>ee.length>0)),M=FJC(C,P,n),T=xJC(M,P),z={};for(let[ee,ne]of Object.entries(T)){let me=k6(ne);P.isSchemaExcluded(ee)||(z[ee]=me)}let U=new n2i(T,P.nonRequestReferencedSchemas,P),R=A.map(ee=>{let me=ee.examples;if(!r.disableExamples&&me.length===0){let be=U.buildExample({schema:ee.payload,exampleId:void 0,example:void 0,skipReadonly:!1,options:{ignoreOptionals:!1,isParameter:!1}});be!=null&&(me=[{name:void 0,description:void 0,payload:be}])}return{...ee,payload:k6(ee.payload),examples:me}}),V=new yzs(T,P,s),Y=m.map(ee=>{let ne=ee.examples,me=ne;if(!r.disableExamples&&(ne.length===0||ne.every(hko))){let ye=V.buildEndpointExample(ee);ye.length>0&&(me=[...ye,...ne.filter(Me=>!hko(Me))])}let be=ee.request,Ae=ee.response;return{...ee,request:be?.type==="json"||be?.type==="formUrlEncoded"?{...be,schema:k6(be.schema)}:be,response:Ae?.type==="json"?{...Ae,schema:k6(Ae.schema)}:Ae,queryParameters:ee.queryParameters.map(ye=>({description:ye.description,name:ye.name,schema:k6(ye.schema),parameterNameOverride:ye.parameterNameOverride,availability:ye.availability,source:ye.source})),pathParameters:ee.pathParameters.map(ye=>({description:ye.description,name:ye.name,schema:k6(ye.schema),parameterNameOverride:ye.parameterNameOverride,variableReference:ye.variableReference,availability:ye.availability,source:ye.source})),headers:ee.headers.map(ye=>({description:ye.description,name:ye.name,schema:k6(ye.schema),parameterNameOverride:ye.parameterNameOverride,env:ye.env,availability:ye.availability,source:ye.source})),examples:me,errors:Pg(ee.errors,ye=>{let Me=ye.fullExamples?.map(Be=>{let Ee=r2i(Be.value);if(Ee!=null)return{name:Be.name,description:Be.description,example:Ee}}).filter(ij);if(Me?.length===0){let Be=U.buildExample({schema:ye.schema,example:void 0,exampleId:void 0,skipReadonly:!1,options:{ignoreOptionals:!1,isParameter:!1}});Be!=null&&Me.push({name:void 0,description:void 0,example:Be})}return{generatedName:ye.generatedName,nameOverride:ye.nameOverride,schema:k6(ye.schema),description:ye.description,source:ye.source,examples:Me}}),retries:ee.retries}}),re=BXy({document:e,context:P});return{apiVersion:TXy({context:P,document:e}),basePath:MXy(e),title:e.info.title??"",description:e.info.description,groups:Object.fromEntries(Object.entries(re??{}).map(([ee,ne])=>[ee,{summary:ne.summary??void 0,description:ne.description??void 0}])),servers:(e.servers??[]).map(ee=>Azs(ee,{groupMultiApiEnvironments:r.groupMultiApiEnvironments})),websocketServers:[],tags:{tagsById:Object.fromEntries((e.tags??[]).map(ee=>[ee.name,{id:ee.name,description:ee.description}])),orderedTagIds:e.tags?.map(ee=>ee.name)},endpoints:Y,webhooks:R,channels:{},groupedSchemas:rao(i,z),securitySchemes:o,hasEndpointsMarkedInternal:Y.some(ee=>ee.internal),nonRequestReferencedSchemas:P.getReferencedSchemas(),variables:d,globalHeaders:s,idempotencyHeaders:u}}function FJC(e,t,r){let n={};for(let[i,a]of Object.entries(e)){if(a.type!=="object"){n[i]=a;continue}let o={$ref:`#/components/schemas/${i}`},c=t.getReferencesFromDiscriminatedUnion(o);if(c==null){n[i]=a;continue}let d={...a,type:"object",properties:a.properties.filter(u=>!c.discriminants.has(u.key)),allOfPropertyConflicts:a.allOfPropertyConflicts.filter(u=>!c.discriminants.has(u.propertyKey)),source:r};n[i]=d;let s=VXy({schema:a,schemas:e});for(let u of[...new Set(s)]){let l=n[u]??e[u];l==null||l.type!=="object"||(n[u]={...l,type:"object",properties:l.properties.filter(m=>!c.discriminants.has(m.key)),allOfPropertyConflicts:l.allOfPropertyConflicts.filter(m=>!c.discriminants.has(m.propertyKey))})}}return n}function xJC(e,t){let r={};for(let[n,i]of Object.entries(e)){if(i.type!=="object"){r[n]=i;continue}let a={$ref:`#/components/schemas/${n}`},o=t.getDiscriminatedUnionMetadata(a);if(o==null){r[n]=i;continue}let c=[];for(let s of i.properties)if(o.discriminants.has(s.key)){let u=o.discriminants.get(s.key);u!=null&&c.push({...s,schema:Sh.literal({nameOverride:void 0,generatedName:Cie([i.generatedName,u],t.options.preserveSchemaIds),title:void 0,value:eW.string(u),namespace:void 0,groupName:void 0,description:void 0,availability:i.availability})})}else c.push(s);let d={...i,type:"object",properties:c};r[n]=d}return r}function VXy({schema:e,schemas:t}){let r=[];for(let n of e.allOf){r.push(n.schema);let i=t[n.schema];i!=null&&i.type==="object"&&r.push(...VXy({schema:i,schemas:t}))}return r}function Dzs(e){return[...new Set(e)]}function LXy({operation:e}){let t=[];switch(e.type){case"async":t=Dzs(e.async.flatMap(r=>r.audiences));break;case"http":t=Dzs(e.value.flatMap(r=>r.audiences));break;case"streaming":t=Dzs(e.streaming.flatMap(r=>r.audiences));break;case"webhook":t=Dzs(e.value.flatMap(r=>r.audiences));break;default:ks(e)}return t}function _da({context:e,documents:t,options:r}){let n={apiVersion:void 0,title:void 0,description:void 0,basePath:void 0,servers:[],websocketServers:[],tags:{tagsById:{},orderedTagIds:void 0},hasEndpointsMarkedInternal:!1,endpoints:[],webhooks:[],channels:{},groupedSchemas:{rootSchemas:{},namespacedSchemas:{}},variables:{},nonRequestReferencedSchemas:new Set,securitySchemes:{},globalHeaders:[],idempotencyHeaders:[],groups:{}},i=0;for(let a of t)try{let o=a.source!=null?a.source:nwe.openapi({file:"<memory>"});switch(a.type){case"openapi":{let c=UXy({taskContext:e,openApi:a.value,options:Kyt({options:a.settings,overrides:r}),source:o,namespace:a.namespace});n=UJC(n,c,Kyt({options:a.settings,overrides:r})),i++;break}case"asyncapi":{let c=UYy({document:a.value,taskContext:e,options:Kyt({options:a.settings,overrides:r}),source:o,asyncApiOptions:zJC({options:a.settings}),namespace:a.namespace});c.servers!=null&&(n.websocketServers=[...n.websocketServers,...c.servers.map(d=>({...d,audiences:void 0,description:void 0}))]),c.channels!=null&&(n.channels={...n.channels,...c.channels}),c.groupedSchemas!=null&&(n.groupedSchemas=Czs(n.groupedSchemas,c.groupedSchemas)),c.basePath!=null&&(n.basePath=c.basePath),i++;break}default:ks(a)}}catch(o){e.logger.error(`Skipping parsing document ${a.type==="openapi"?a.value.info?.title:a.source?.file}`),o instanceof Error&&e.logger.debug(o.message,o.stack?`
|
|
2408
2408
|
`+o.stack:"")}return n}function zJC({options:e,overrides:t}){return{naming:t?.naming??e?.asyncApiNaming??sYy.naming}}function Izs(e){let t=String(e.description||e.name||e["x-fern-server-name"]||"default").trim(),r=t.toUpperCase();return r==="PRODUCTION"||r==="PRD"||r==="PROD"?"PRD":r==="SANDBOX"||r==="SBX"?"SBX":r==="STAGING"||r==="STG"?"STG":r==="PERFORMANCE"||r==="PRF"||r==="PERF"?"PRF":r==="E2E"||r==="E_2_E"?"E2E":r==="QAL"||r==="QUALITY"?"QAL":t}function QJC(e){try{let n=new URL(e).hostname.split("."),i=new Set(["api","www","service","services","example","com","org","net","io"]);for(let o of n){let c=o.split("-")[0];if(c&&!i.has(c.toLowerCase())&&c.length>2)return c.toLowerCase()}let a=n[0]?.split("-")[0];return a?a.toLowerCase():"api"}catch{let t=e.match(/https?:\/\/([^./-]+)/);return t&&t[1]?t[1].toLowerCase():"api"}}function LJC(e,t){if(e.length===0||t.length===0||e.length!==t.length)return!1;let r=new Map;for(let a of e){let o=Izs(a);r.set(o,a.url)}let n=!0,i=!0;for(let a of t){let o=Izs(a),c=r.get(o);c?c===a.url&&(i=!1):n=!1}return n&&i}function WXy(e){if(e.length===0||!e[0])return"api";let t=e[0].url;return QJC(t)}function UJC(e,t,r){if(!(r?.groupMultiApiEnvironments===!0))return{apiVersion:e.apiVersion??t.apiVersion,title:e.title??t.title,description:e.description??t.description,basePath:e.basePath??t.basePath,servers:[...e.servers,...t.servers],websocketServers:[...e.websocketServers,...t.websocketServers],tags:{tagsById:{...e.tags.tagsById,...t.tags.tagsById},orderedTagIds:e.tags.orderedTagIds==null&&t.tags.orderedTagIds==null?void 0:[...e.tags.orderedTagIds??[],...t.tags.orderedTagIds??[]]},hasEndpointsMarkedInternal:e.hasEndpointsMarkedInternal||t.hasEndpointsMarkedInternal,endpoints:[...e.endpoints,...t.endpoints],webhooks:[...e.webhooks,...t.webhooks],channels:{...e.channels,...t.channels},groupedSchemas:Czs(e.groupedSchemas,t.groupedSchemas),variables:{...e.variables,...t.variables},nonRequestReferencedSchemas:new Set([...e.nonRequestReferencedSchemas,...t.nonRequestReferencedSchemas]),securitySchemes:{...e.securitySchemes,...t.securitySchemes},globalHeaders:e.globalHeaders!=null?[...e.globalHeaders,...t.globalHeaders??[]]:void 0,idempotencyHeaders:e.idempotencyHeaders!=null?[...e.idempotencyHeaders,...t.idempotencyHeaders??[]]:void 0,groups:{...e.groups,...t.groups}};if(LJC(e.servers,t.servers)){let a=[],o=[],c=WXy(e.servers),d=WXy(t.servers),s=new Map;for(let m of e.servers){let A=Izs(m);s.has(A)||s.set(A,{});let P=s.get(A);P&&(P[c]={url:m.url,audiences:m.audiences})}for(let m of t.servers){let A=Izs(m);s.has(A)||s.set(A,{});let P=s.get(A);P&&(P[d]={url:m.url,audiences:m.audiences})}for(let[m,A]of s.entries()){let P={type:"grouped",name:m,description:`${m} environment`,urls:A};a.push(P)}let u=e.endpoints.map(m=>({...m,type:"multi-api",apiName:c,servers:[{name:c,url:void 0,audiences:void 0}]})),l=t.endpoints.map(m=>({...m,type:"multi-api",apiName:d,servers:[{name:d,url:void 0,audiences:void 0}]}));return o=[...u,...l],{apiVersion:e.apiVersion??t.apiVersion,title:e.title??t.title,description:e.description??t.description,basePath:e.basePath??t.basePath,servers:a.map(m=>(m.type==="single",m)),websocketServers:[...e.websocketServers,...t.websocketServers],tags:{tagsById:{...e.tags.tagsById,...t.tags.tagsById},orderedTagIds:e.tags.orderedTagIds==null&&t.tags.orderedTagIds==null?void 0:[...e.tags.orderedTagIds??[],...t.tags.orderedTagIds??[]]},hasEndpointsMarkedInternal:e.hasEndpointsMarkedInternal||t.hasEndpointsMarkedInternal,endpoints:o.map(m=>{if(m.type==="multi-api"){let{type:C,apiName:M,servers:T,...z}=m;return{...z,__apiName:M,servers:T}}let{type:A,...P}=m;return P}),webhooks:[...e.webhooks,...t.webhooks],channels:{...e.channels,...t.channels},groupedSchemas:Czs(e.groupedSchemas,t.groupedSchemas),variables:{...e.variables,...t.variables},nonRequestReferencedSchemas:new Set([...e.nonRequestReferencedSchemas,...t.nonRequestReferencedSchemas]),securitySchemes:{...e.securitySchemes,...t.securitySchemes},globalHeaders:e.globalHeaders!=null?[...e.globalHeaders,...t.globalHeaders??[]]:void 0,idempotencyHeaders:e.idempotencyHeaders!=null?[...e.idempotencyHeaders,...t.idempotencyHeaders??[]]:void 0,groups:{...e.groups,...t.groups}}}return{apiVersion:e.apiVersion??t.apiVersion,title:e.title??t.title,description:e.description??t.description,basePath:e.basePath??t.basePath,servers:[...e.servers,...t.servers],websocketServers:[...e.websocketServers,...t.websocketServers],tags:{tagsById:{...e.tags.tagsById,...t.tags.tagsById},orderedTagIds:e.tags.orderedTagIds==null&&t.tags.orderedTagIds==null?void 0:[...e.tags.orderedTagIds??[],...t.tags.orderedTagIds??[]]},hasEndpointsMarkedInternal:e.hasEndpointsMarkedInternal||t.hasEndpointsMarkedInternal,endpoints:[...e.endpoints,...t.endpoints],webhooks:[...e.webhooks,...t.webhooks],channels:{...e.channels,...t.channels},groupedSchemas:Czs(e.groupedSchemas,t.groupedSchemas),variables:{...e.variables,...t.variables},nonRequestReferencedSchemas:new Set([...e.nonRequestReferencedSchemas,...t.nonRequestReferencedSchemas]),securitySchemes:{...e.securitySchemes,...t.securitySchemes},globalHeaders:e.globalHeaders!=null?[...e.globalHeaders,...t.globalHeaders??[]]:void 0,idempotencyHeaders:e.idempotencyHeaders!=null?[...e.idempotencyHeaders,...t.idempotencyHeaders??[]]:void 0,groups:{...e.groups,...t.groups}}}function Czs(e,t){e.rootSchemas={...e.rootSchemas,...t.rootSchemas};for(let[r,n]of Object.entries(t.namespacedSchemas))e.namespacedSchemas[r]!=null?e.namespacedSchemas[r]={...e.namespacedSchemas[r],...n}:e.namespacedSchemas[r]=n;return e}var tuv=pa(P8s(),1),w8s={config:new tuv.Config({apis:{},styleguide:{plugins:[gRf],rules:{struct:"warn"}}},void 0),dereference:!1,removeUnusedComponents:!1,keepUrlRefs:!1};function eoo(e){if(e.settings==null&&e.raw?.api?.auth==null)return;let t={detectGlobalHeaders:!0};return e.settings?.unions==="v1"&&(t.discriminatedUnionV2=!0),e.raw?.api?.auth!=null&&(t.auth=e.raw?.api?.auth),t}function Aeu(e){return e.swagger!=null}function Gzf(e){return e.openapi!=null}function Peu({options:e,overrides:t}={}){return{...Kyt({options:e,overrides:t}),...YZo({options:e,overrides:t})}}function M2i(e,t={}){return{...Object.fromEntries(hee(e.namedDefinitionFiles).map(([r,n])=>[r,{...n,defaultUrl:t.defaultURL}])),...hee(e.importedDefinitions).reduce((r,[n,i])=>({...r,...dVo(M2i(i.definition,{defaultURL:i.url}),(a,o)=>cZ(n,yw.of(o)))}),{})}}function weu(e,t={}){return{...Object.fromEntries(hee(e.packageMarkers).map(([r,n])=>[r,{...n,defaultUrl:t.defaultURL}])),...hee(e.importedDefinitions).reduce((r,[n,i])=>({...r,...dVo(weu(i.definition,{defaultURL:i.url}),(a,o)=>cZ(n,yw.of(o)))}),{})}}function jwi(e){return{...weu(e),...M2i(e)}}function T3e(e,t){return jwi(e.definition)[t]?.contents}function kee(e,t){for(let[r,n]of hee(jwi(e.definition)))t(r,n.contents,{isPackageMarker:Woa(r)===CF,defaultUrl:n.defaultUrl})}function Qda(e,t){for(let[r,n]of hee(weu(e.definition)))t(r,n.contents)}function nvt({breadcrumbs:e=[],title:t,subtitle:r}){let n=[];return e.length>0&&n.push(nd.blue(e.join(" -> "))),n.push(t),r!=null&&n.push(nd.dim(r)),n.join(`
|
|
2409
2409
|
`)}var ruv={None:"none",Header:"header"};var J8s={};pf(J8s,{ConjureAliasDeclaration:()=>M8s,ConjureArgument:()=>W8s,ConjureArgumentWithParamType:()=>V8s,ConjureAuthDefinition:()=>ioo,ConjureAuthDefinitionType:()=>L8s,ConjureDefinitions:()=>z8s,ConjureEndpointDefinition:()=>H8s,ConjureEnumDeclaration:()=>F8s,ConjureEnumVariant:()=>N8s,ConjureEnumWithDocs:()=>R8s,ConjureObjectDeclaration:()=>q8s,ConjureParamType:()=>U8s,ConjurePrimitive:()=>I8s,ConjureService:()=>G8s,ConjureServiceName:()=>C8s,ConjureType:()=>q2i,ConjureTypeDeclaration:()=>x8s,ConjureTypeReference:()=>R2i,ConjureTypeWithDocs:()=>B8s,ConjureTypes:()=>Q8s,ConjureUnionDeclaration:()=>T8s,DefinitionFile:()=>Iuv,WithDocs:()=>mWr,commons:()=>Xzf,conjure:()=>Zzf,services:()=>kzf,types:()=>e4f});var Xzf={};pf(Xzf,{WithDocs:()=>mWr});var J0={};pf(J0,{JsonError:()=>too,ParseError:()=>roo,any:()=>vuv,bigint:()=>iuv,boolean:()=>buv,booleanLiteral:()=>yuv,date:()=>auv,discriminant:()=>Suv,enum_:()=>E8s,getObjectLikeUtils:()=>ARr,getObjectUtils:()=>Lda,getSchemaUtils:()=>GQ,isProperty:()=>T2i,lazy:()=>ouv,lazyObject:()=>puv,list:()=>D8s,number:()=>guv,object:()=>S8s,objectWithoutOptionalProperties:()=>duv,optional:()=>Jzf,property:()=>suv,record:()=>Puv,set:()=>wuv,string:()=>muv,stringLiteral:()=>huv,transform:()=>Kzf,undiscriminatedUnion:()=>Euv,union:()=>Cuv,unknown:()=>Ouv,withParsedProperties:()=>Yzf});var Wq={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function a8(e,t){return`Expected ${t}. Received ${IvI(e)}.`}function IvI(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function Qde(e){return{...e,json:nuv(e.json),parse:nuv(e.parse)}}function nuv(e){return(t,r)=>{let n=e(t,r),{skipValidation:i=!1}=r??{};return!n.ok&&i?(console.warn(["Failed to validate.",...n.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
2410
2410
|
`)),{ok:!0,value:t}):n}}function j8s(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var too=class e extends Error{errors;constructor(t){super(t.map(j8s).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var roo=class e extends Error{errors;constructor(t){super(t.map(j8s).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function GQ(e){return{optional:()=>Jzf(e),transform:t=>Kzf(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new roo(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new too(n.errors)}}}function Jzf(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Wq.OPTIONAL};return{...t,...GQ(t)}}function Kzf(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(n,i)=>{let a=t.untransform(n);return e.json(a,i)},getType:()=>e.getType()};return{...r,...GQ(r)}}function iuv(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:a8(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:a8(t,"bigint")}]},getType:()=>Wq.BIGINT};return{...Qde(e),...GQ(e)}}var MvI=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function auv(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:a8(t,"string")}]}:MvI.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:a8(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:a8(t,"Date object")}]},getType:()=>Wq.DATE};return{...Qde(e),...GQ(e)}}function dwe(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...Qde(r),...GQ(r)}}}function E8s(e){let t=new Set(e);return dwe(Wq.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:a,message:a8(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:a,message:a8(n,"enum")}]}:{ok:!0,value:n})()}function ouv(e){let t=$zf(e);return{...t,...GQ(t)}}function $zf(e){return{parse:(t,r)=>noo(e).parse(t,r),json:(t,r)=>noo(e).json(t,r),getType:()=>noo(e).getType()}}function noo(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function jeu(e){return Object.entries(e)}function Eeu(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,a])=>(r.has(i)&&(n[i]=a),n),{})}function B2i(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Seu(e){return Object.keys(e)}function uuv(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function ARr(e){return{withParsedProperties:t=>Yzf(e,t)}}function Yzf(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);if(!a.ok)return a;let o=Object.entries(t).reduce((c,[d,s])=>({...c,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...o}}},json:(n,i)=>{if(!B2i(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:a8(n,"object")}]};let a=new Set(Object.keys(t)),o=Eeu(n,Object.keys(n).filter(c=>!a.has(c)));return e.json(o,i)},getType:()=>e.getType()};return{...r,...GQ(r),...ARr(r)}}function suv(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function T2i(e){return e.isProperty}function S8s(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>T2i(n)?n.rawKey:r),_getParsedProperties:()=>Seu(e),parse:(r,n)=>{let i={},a=[];for(let[o,c]of jeu(e)){let d=T2i(c)?c.rawKey:o,s=T2i(c)?c.valueSchema:c,u={rawKey:d,parsedKey:o,valueSchema:s};i[d]=u,fuv(s)&&a.push(d)}return cuv({value:r,requiredKeys:a,getProperty:o=>{let c=i[o];if(c!=null)return{transformedKey:c.parsedKey,transform:d=>c.valueSchema.parse(d,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],o]})}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:(r,n)=>{let i=[];for(let[a,o]of jeu(e)){let c=T2i(o)?o.valueSchema:o;fuv(c)&&i.push(a)}return cuv({value:r,requiredKeys:i,getProperty:a=>{let o=e[a];if(o!=null)return T2i(o)?{transformedKey:o.rawKey,transform:c=>o.valueSchema.json(c,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:c=>o.json(c,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:()=>Wq.OBJECT};return{...Qde(t),...GQ(t),...ARr(t),...Lda(t)}}function cuv({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:a=[]}){if(!B2i(e))return{ok:!1,errors:[{path:a,message:a8(e,"object")}]};let o=new Set(t),c=[],d={};for(let[s,u]of Object.entries(e)){let l=r(s);if(l!=null){o.delete(s);let m=l.transform(u);m.ok?d[l.transformedKey]=m.value:(d[s]=u,c.push(...m.errors))}else switch(n){case"fail":c.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=u;break}}return c.push(...t.filter(s=>o.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),c.length===0||i?{ok:!0,value:d}:{ok:!1,errors:c}}function Lda(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>luv({extensionKeys:t._getRawProperties(),value:n,transformBase:a=>e.parse(a,i),transformExtension:a=>t.parse(a,i)}),json:(n,i)=>luv({extensionKeys:t._getParsedProperties(),value:n,transformBase:a=>e.json(a,i),transformExtension:a=>t.json(a,i)}),getType:()=>Wq.OBJECT};return{...r,...GQ(r),...ARr(r),...Lda(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,n)=>{let i=e.parse(r,{...n,unrecognizedObjectKeys:"passthrough"});return i.ok?{ok:!0,value:{...r,...i.value}}:i},json:(r,n)=>{let i=e.json(r,{...n,unrecognizedObjectKeys:"passthrough"});return i.ok?{ok:!0,value:{...r,...i.value}}:i},getType:()=>Wq.OBJECT};return{...t,...GQ(t),...ARr(t),...Lda(t)}}}}function luv({extensionKeys:e,value:t,transformBase:r,transformExtension:n}){let i=new Set(e),[a,o]=uuv(Seu(t),s=>i.has(s)),c=r(Eeu(t,o)),d=n(Eeu(t,a));return c.ok&&d.ok?{ok:!0,value:{...c.value,...d.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...d.ok?[]:d.errors]}}function fuv(e){return!BvI(e)}function BvI(e){switch(e.getType()){case Wq.ANY:case Wq.UNKNOWN:case Wq.OPTIONAL:return!0;default:return!1}}function duv(e){return S8s(e)}function puv(e){let t={...$zf(e),_getRawProperties:()=>noo(e)._getRawProperties(),_getParsedProperties:()=>noo(e)._getParsedProperties()};return{...t,...GQ(t),...ARr(t),...Lda(t)}}function D8s(e){let t={parse:(r,n)=>_uv(r,(i,a)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,n)=>_uv(r,(i,a)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Wq.LIST};return{...Qde(t),...GQ(t)}}function _uv(e,t){return Array.isArray(e)?e.map((n,i)=>t(n,i)).reduce((n,i)=>{if(n.ok&&i.ok)return{ok:!0,value:[...n.value,i.value]};let a=[];return n.ok||a.push(...n.errors),i.ok||a.push(...i.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:a8(e,"list"),path:[]}]}}function huv(e){return dwe(Wq.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:a8(r,`"${e}"`)}]})()}function yuv(e){return dwe(Wq.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:a8(r,`${e.toString()}`)}]})()}var vuv=dwe(Wq.ANY,e=>({ok:!0,value:e}));var buv=dwe(Wq.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:a8(e,"boolean")}]});var guv=dwe(Wq.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:a8(e,"number")}]});var muv=dwe(Wq.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:a8(e,"string")}]});var Ouv=dwe(Wq.UNKNOWN,e=>({ok:!0,value:e}));function Puv(e,t){let r={parse:(n,i)=>Auv({value:n,isKeyNumeric:e.getType()===Wq.NUMBER,transformKey:a=>e.parse(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,o)=>t.parse(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Auv({value:n,isKeyNumeric:e.getType()===Wq.NUMBER,transformKey:a=>e.json(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,o)=>t.json(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Wq.RECORD};return{...Qde(r),...GQ(r)}}function Auv({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return B2i(e)?jeu(e).reduce((a,[o,c])=>{if(c==null)return a;let d=a,s=o;if(t){let A=o.length>0?Number(o):NaN;isNaN(A)||(s=A)}let u=r(s),l=n(c,s);if(d.ok&&u.ok&&l.ok)return{ok:!0,value:{...d.value,[u.value]:l.value}};let m=[];return d.ok||m.push(...d.errors),u.ok||m.push(...u.errors),l.ok||m.push(...l.errors),{ok:!1,errors:m}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:a8(e,"object")}]}}function wuv(e){let t=D8s(e),r={parse:(n,i)=>{let a=t.parse(n,i);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:a8(n,"Set")}]},getType:()=>Wq.SET};return{...Qde(r),...GQ(r)}}function Euv(e){let t={parse:(r,n)=>juv((i,a)=>i.parse(r,a),e,n),json:(r,n)=>juv((i,a)=>i.json(r,a),e,n),getType:()=>Wq.UNDISCRIMINATED_UNION};return{...Qde(t),...GQ(t)}}function juv(e,t,r){let n=[];for(let[i,a]of t.entries()){let o=e(a,{...r,skipValidation:!1});if(o.ok)return o;for(let c of o.errors)n.push({path:c.path,message:`[Variant ${i}] ${c.message}`})}return{ok:!1,errors:n}}function Suv(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function Cuv(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=E8s(Seu(t)),a={parse:(o,c)=>Duv({value:o,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:d=>i.parse(d,{allowUnrecognizedEnumValues:c?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...c?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:c?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,c),breadcrumbsPrefix:c?.breadcrumbsPrefix}),json:(o,c)=>Duv({value:o,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:d=>i.json(d,{allowUnrecognizedEnumValues:c?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...c?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:c?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,c),breadcrumbsPrefix:c?.breadcrumbsPrefix}),getType:()=>Wq.UNION};return{...Qde(a),...GQ(a),...ARr(a)}}function Duv({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:o,breadcrumbsPrefix:c=[]}){if(!B2i(e))return{ok:!1,errors:[{path:c,message:a8(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:c,message:`Missing discriminant ("${t}")`}]};let u=n(d);if(!u.ok)return{ok:!1,errors:u.errors};let l=i(u.value);if(l==null)return a?{ok:!0,value:{[r]:u.value,...s}}:{ok:!1,errors:[{path:[...c,t],message:"Unexpected discriminant value"}]};let m=o(s,l);return m.ok?{ok:!0,value:{[r]:d,...m.value}}:m}var mWr=J0.objectWithoutOptionalProperties({docs:J0.string().optional()});var Zzf={};pf(Zzf,{ConjureServiceName:()=>C8s,DefinitionFile:()=>Iuv});var C8s=J0.string();var I8s=J0.enum_(["rid","string","safelong","integer","double","boolean"]);var q2i=J0.undiscriminatedUnion([I8s,J0.string()]);var M8s=J0.objectWithoutOptionalProperties({alias:q2i,docs:J0.string().optional()});var B8s=J0.objectWithoutOptionalProperties({type:q2i,docs:J0.string().optional()});var R2i=J0.undiscriminatedUnion([q2i,B8s]);var T8s=J0.objectWithoutOptionalProperties({union:J0.record(J0.string(),R2i)});var q8s=J0.objectWithoutOptionalProperties({fields:J0.record(J0.string(),R2i)});var R8s=J0.objectWithoutOptionalProperties({value:J0.string()}).extend(mWr);var N8s=J0.undiscriminatedUnion([J0.string(),R8s]);var F8s=J0.objectWithoutOptionalProperties({values:J0.list(N8s)});var x8s=J0.undiscriminatedUnion([M8s,T8s,q8s,F8s]);var z8s=J0.objectWithoutOptionalProperties({objects:J0.record(J0.string(),x8s).optional()});var Q8s=J0.objectWithoutOptionalProperties({conjureImports:J0.property("conjure-imports",J0.record(J0.string(),J0.string()).optional()),definitions:z8s.optional()});var L8s=J0.enum_(["none","header"]);var ioo=J0.undiscriminatedUnion([L8s,J0.string()]);var U8s=J0.enum_(["path","query","body"]);var V8s=J0.objectWithoutOptionalProperties({paramType:J0.property("param-type",U8s),type:J0.string()}).extend(mWr);var W8s=J0.undiscriminatedUnion([J0.string(),V8s]);var H8s=J0.objectWithoutOptionalProperties({http:J0.string(),auth:ioo.optional(),args:J0.record(J0.string(),W8s).optional(),returns:R2i.optional()}).extend(mWr);var G8s=J0.objectWithoutOptionalProperties({name:J0.string().optional(),package:J0.string().optional(),basePath:J0.property("base-path",J0.string().optional()),defaultAuth:J0.property("default-auth",ioo.optional()),endpoints:J0.record(J0.string(),H8s).optional()}).extend(mWr);var Iuv=J0.objectWithoutOptionalProperties({types:Q8s.optional(),services:J0.record(C8s,G8s).optional()});var kzf={};pf(kzf,{ConjureArgument:()=>W8s,ConjureArgumentWithParamType:()=>V8s,ConjureAuthDefinition:()=>ioo,ConjureAuthDefinitionType:()=>L8s,ConjureEndpointDefinition:()=>H8s,ConjureParamType:()=>U8s,ConjureService:()=>G8s});var e4f={};pf(e4f,{ConjureAliasDeclaration:()=>M8s,ConjureDefinitions:()=>z8s,ConjureEnumDeclaration:()=>F8s,ConjureEnumVariant:()=>N8s,ConjureEnumWithDocs:()=>R8s,ConjureObjectDeclaration:()=>q8s,ConjurePrimitive:()=>I8s,ConjureType:()=>q2i,ConjureTypeDeclaration:()=>x8s,ConjureTypeReference:()=>R2i,ConjureTypeWithDocs:()=>B8s,ConjureTypes:()=>Q8s,ConjureUnionDeclaration:()=>T8s});var Muv=require("fs/promises");async function Buv(e,t){let r=[];for(let n of await Jve(e,t))r.push(await TvI({relativeFilepath:NQ(e,n),absoluteFilepath:n}));return r}async function TvI({relativeFilepath:e,absoluteFilepath:t}){let r=(await(0,Muv.readFile)(t)).toString().replaceAll(/: rid(?:$|\s)/g,`: string
|
|
@@ -3035,7 +3035,7 @@ More information: https://mdxjs.com/docs/troubleshooting-mdx`);return i.stack=""
|
|
|
3035
3035
|
`)}function YqM(e){return e.some(t=>t.severity==="fatal")?"fatal":e.some(t=>t.severity==="error")?"error":"warning"}function XqM(e){switch(e){case"fatal":return Y1.Error;case"error":return Y1.Error;case"warning":return Y1.Warn;default:ks(e)}}function ZqM({stats:e,context:t,logWarnings:r,elapsedMillis:n=0}){let{numFatal:i,numErrors:a,numWarnings:o}=e,c=n>0?` in ${(n/1e3).toFixed(3)} seconds.`:".",d=`Found ${i+a} errors and ${o} warnings`+c;!r&&o>0&&(d+=" Run fern check --warnings to print out the warnings not shown."),i+a>0?t.logger.error(d):o>0?t.logger.warn(d):t.logger.info(nd.green("\u2713 All checks passed"))}function kqM(e){let t=0,r=0,n=0;for(let i of e)switch(i.severity){case"fatal":t+=1;continue;case"error":r+=1;continue;case"warning":n+=1;continue;default:ks(i.severity)}return{numFatal:t,numErrors:r,numWarnings:n}}async function Nco({workspace:e,apiWorkspaces:t,ossWorkspaces:r,context:n,logWarnings:i,errorOnBrokenLinks:a,logSummary:o=!0,excludeRules:c}){let d=performance.now(),s=await Jou(e,n,t,r,!1,c),u=performance.now()-d,{hasErrors:l}=Rco({violations:s,context:n,logWarnings:i,logSummary:o,logBreadcrumbs:!1,elapsedMillis:u});return a&&(l=l||s.some(m=>m.name==="valid-markdown-links")),{hasErrors:l}}async function KKs({workspace:e,apiWorkspaces:t,ossWorkspaces:r,context:n,logWarnings:i,errorOnBrokenLinks:a,excludeRules:o}){let{hasErrors:c}=await Nco({workspace:e,context:n,logWarnings:i,apiWorkspaces:t,ossWorkspaces:r,errorOnBrokenLinks:a,excludeRules:o});c&&n.failAndThrow()}async function mab({loadProject:e,cliContext:t,port:r,bundlePath:n,brokenLinks:i,legacyPreview:a,backendPort:o}){let c=await e(),d=c.docsWorkspaces;d!=null&&(a&&(await t.instrumentPostHogEvent({orgId:c.config.organization,command:"fern docs dev --legacy"}),await t.runTaskForWorkspace(d,async s=>{s.logger.info(`Starting server on port ${r}`),await oYf({initialProject:c,reloadProject:e,validateProject:async u=>{let l=u.docsWorkspaces;if(l==null)return;let m=i?[]:["valid-markdown-links"],A=l.config.experimental?.openapiParserV3;A==null||A?await Nco({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:[],ossWorkspaces:await kbe(u),excludeRules:m}):await Nco({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:u.apiWorkspaces,ossWorkspaces:await kbe(u),excludeRules:m})},context:s,port:r,bundlePath:n})})),await t.instrumentPostHogEvent({orgId:c.config.organization,command:"fern docs dev --beta"}),await t.runTaskForWorkspace(d,async s=>{s.logger.info(`Starting server on port ${r}`),await iYf({initialProject:c,reloadProject:e,validateProject:async u=>{let l=u.docsWorkspaces;if(l==null)return;let m=i?[]:["valid-markdown-links"],A=l.config.experimental?.openapiParserV3;A==null||A?await Nco({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:[],ossWorkspaces:await kbe(u),excludeRules:m}):await Nco({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:u.apiWorkspaces,ossWorkspaces:await kbe(u),excludeRules:m})},context:s,port:r,bundlePath:n,backendPort:o})}))}var kKs=require("fs/promises");var qha=pa(y5s(),1);_I();function Oab(e,t){let r=e.shape,n=e.docs??void 0;return{openApiSchema:UE._visit(r,{alias:a=>eRM({aliasTypeDeclaration:a,docs:n}),enum:a=>tRM({enumTypeDeclaration:a,docs:n}),object:a=>{let o=e.userProvidedExamples[0],c=o==null?oRM(t,e.name):void 0,d=o==null&&c==null?uRM(t,e.name):void 0;return YKs({properties:a.properties.map(s=>{let u;return o!=null&&o.shape.type==="object"?u=o.shape.properties.find(l=>l.name.wireValue===s.name.wireValue):c!=null?c.type==="reference"&&c.shape.type==="named"&&c.shape.shape.type==="object"&&(u=c.shape.shape.properties.find(l=>l.name.wireValue===s.name.wireValue)):d!=null&&d.type==="body"&&d.value?.shape.type==="named"&&d.value.shape.shape.type==="object"&&(u=d.value.shape.shape.properties.find(l=>l.name.wireValue===s.name.wireValue)),{docs:s.docs??void 0,name:s.name,valueType:s.valueType,example:u}}),extensions:a.extends,docs:n})},union:a=>rRM({unionTypeDeclaration:a,docs:n}),undiscriminatedUnion:a=>nRM({undiscriminatedUnionDeclaration:a,docs:n}),_other:()=>{throw new Error("Encountered unknown type: "+r.type)}}),schemaName:Aab(e.name)}}function eRM({aliasTypeDeclaration:e,docs:t}){return{...dte(e.aliasOf),description:t}}function tRM({enumTypeDeclaration:e,docs:t}){return{type:"string",enum:e.values.map(r=>r.name.wireValue),description:t}}function rRM({unionTypeDeclaration:e,docs:t}){let n={oneOf:e.types.map(i=>{let a={[e.discriminant.wireValue]:{type:"string",enum:[i.discriminantValue.wireValue]}};return nde._visit(i.shape,{noProperties:()=>({type:"object",properties:a,required:[e.discriminant.wireValue]}),singleProperty:o=>({type:"object",properties:{...a,[o.name.wireValue]:dte(o.type)},required:[e.discriminant.wireValue]}),samePropertiesAsObject:o=>({type:"object",allOf:[{type:"object",properties:a},{$ref:$Ks(o)}],required:[e.discriminant.wireValue]}),_other:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+i.shape.propertiesType)}})}),description:t};return e.baseProperties.length>0&&(n.properties=e.baseProperties.reduce((i,a)=>(i[a.name.wireValue]={description:a.docs??void 0,...dte(a.valueType)},a.valueType.type==="container"&&a.valueType.container.type==="optional"||(n.required=[...n.required??[],a.name.wireValue]),i),{})),n}function nRM({undiscriminatedUnionDeclaration:e,docs:t}){return{oneOf:e.members.map(r=>({description:r.docs??void 0,...dte(r.type)})),description:t}}function dte(e){return Eh._visit(e,{container:t=>aRM(t),named:t=>({$ref:$Ks(t)}),primitive:t=>iRM(t),unknown:()=>({}),_other:()=>{throw new Error("Encountered unknown typeReference: "+e.type)}})}function iRM(e){return e.v2==null?nw._visit(e.v1,{boolean:()=>({type:"boolean"}),dateTime:()=>({type:"string",format:"date-time"}),double:()=>({type:"number",format:"double"}),integer:()=>({type:"integer"}),long:()=>({type:"integer",format:"int64"}),string:()=>({type:"string"}),uuid:()=>({type:"string",format:"uuid"}),date:()=>({type:"string",format:"date"}),base64:()=>({type:"string",format:"byte"}),uint:()=>({type:"integer",format:"int64"}),uint64:()=>({type:"integer",format:"int64"}),float:()=>({type:"number",format:"float"}),bigInteger:()=>({type:"integer",format:"bigint"}),_other:()=>{throw new Error("Encountered unknown primitiveType: "+e.v1)}})??{}:t0._visit(e.v2,{boolean:()=>({type:"boolean"}),dateTime:()=>({type:"string",format:"date-time"}),double:()=>({type:"number",format:"double"}),integer:()=>({type:"integer"}),long:()=>({type:"integer",format:"int64"}),string:t=>{let r={type:"string"};return t.validation?.format!=null&&(r.format=t.validation.format),t.validation?.pattern!=null&&(r.pattern=t.validation.pattern),r},uuid:()=>({type:"string",format:"uuid"}),date:()=>({type:"string",format:"date"}),base64:()=>({type:"string",format:"byte"}),uint:()=>({type:"integer",format:"int64"}),uint64:()=>({type:"integer",format:"int64"}),float:()=>({type:"number",format:"float"}),bigInteger:()=>({type:"integer",format:"bigint"}),_other:()=>{throw new Error("Encountered unknown primitiveType: "+e.v2)}})}function aRM(e){return Uw._visit(e,{list:t=>({type:"array",items:dte(t)}),set:t=>({type:"array",items:dte(t)}),map:t=>t.keyType.type==="primitive"&&t.keyType.primitive.v1==="STRING"&&t.valueType.type==="unknown"?{type:"object",additionalProperties:!0}:{type:"object",additionalProperties:dte(t.valueType)},optional:t=>({...dte(t),nullable:!0}),nullable:t=>({...dte(t),nullable:!0}),literal:t=>t._visit({boolean:r=>({type:"boolean",const:r}),string:r=>({type:"string",const:r}),_other:()=>({})}),_other:()=>{throw new Error("Encountered unknown containerType: "+e.type)}})}function $Ks(e){return`#/components/schemas/${Aab(e)}`}function Aab(e){return[...e.fernFilepath.packagePath.map(t=>t.originalName),e.name.originalName].join("")}function oRM(e,t){for(let r of Object.values(e.services))for(let n of r.endpoints)if(!(n.userSpecifiedExamples.length<=0)&&n.requestBody?.type==="reference"&&n.requestBody.requestBodyType.type==="named"&&sRM(n.requestBody.requestBodyType,t))return n.userSpecifiedExamples[0]?.example?.request??void 0}function uRM(e,t){for(let r of Object.values(e.services))for(let n of r.endpoints)if(!(n.userSpecifiedExamples.length<=0||n.response?.body?.type!=="json")&&n.response.body.value.responseBodyType.type==="named"&&n.response.body.value.responseBodyType.typeId===t.typeId){let i=n.userSpecifiedExamples.find(a=>a.example?.response.type==="ok");if(i!=null&&i.example?.response.type==="ok")return i.example.response.value}}function sRM(e,t){return xue(e.fernFilepath,t.fernFilepath)&&xue(e.name,t.name)}function YKs({docs:e,properties:t,extensions:r}){let n={},i=[];t.forEach(o=>{let c=dte(o.valueType),d;(o.example!=null&&o.valueType.type==="primitive"||o.example!=null&&o.valueType.type==="container"&&o.valueType.container.type==="list"&&o.valueType.container.list.type==="primitive")&&(d=o.example.value.jsonExample),n[o.name.wireValue]={...c,description:o.docs??void 0,example:d},o.valueType.type==="container"&&o.valueType.container.type==="optional"||i.push(o.name.wireValue)});let a={type:"object",description:e,properties:n};return i.length>0&&(a.required=i),r.length>0&&(a.allOf=r.map(o=>({$ref:$Ks(o)}))),a}function Pab({ir:e,httpServices:t,typesByName:r,errorsByName:n,errorDiscriminationStrategy:i,security:a,environments:o,mode:c}){let d={};return t.forEach(s=>{s.endpoints.forEach(u=>{let{fullPath:l,convertedHttpMethod:m,operationObject:A}=cRM({ir:e,httpEndpoint:u,httpService:s,typesByName:r,errorsByName:n,errorDiscriminationStrategy:i,security:a,environments:o,mode:c}),P=d[l]??={};if(P[m]!=null)throw new Error(`Duplicate ${m} endpoint at ${l}`);P[m]=A})}),d}function cRM({httpEndpoint:e,httpService:t,typesByName:r,errorsByName:n,errorDiscriminationStrategy:i,security:a,environments:o,mode:c,ir:d}){let s=TD(d.basePath!=null?eXf(d.basePath):"",eXf(t.basePath),eXf(e.path));s=s.startsWith("/")?s:`/${s}`;let u=lRM(e.method),l=d.pathParameters.map(U=>kYf({pathParameter:U,examples:e.userSpecifiedExamples.map(R=>R.example).filter(ij)??[]})),m=t.pathParameters.map(U=>kYf({pathParameter:U,examples:e.userSpecifiedExamples.map(R=>R.example).filter(ij)??[]})),A=e.pathParameters.map(U=>kYf({pathParameter:U,examples:e.userSpecifiedExamples.map(R=>R.example).filter(ij)??[]})),P=e.queryParameters.map(U=>hRM({queryParameter:U,typesByName:r,examples:e.userSpecifiedExamples.map(R=>R.example).filter(ij)??[]})),C=e.headers.map(U=>yRM({httpHeader:U,typesByName:r,examples:e.userSpecifiedExamples.map(R=>R.example).filter(ij)??[]})),M=[...l,...m,...A,...P,...C],T=c==="stoplight"?t.displayName??t.name.fernFilepath.allParts.map(U=>U.originalName).join(" "):t.name.fernFilepath.allParts.map(U=>U.pascalCase.unsafeName).join(""),z={description:e.docs??void 0,operationId:[...t.name.fernFilepath.allParts.map(U=>U.camelCase.unsafeName),e.name.originalName].join("_"),tags:[T],parameters:M,responses:dRM({httpResponse:e.response,responseErrors:e.errors,errorsByName:n,errorDiscriminationStrategy:i,examples:e.userSpecifiedExamples.map(U=>U.example).filter(ij)??[]}),summary:e.displayName??void 0};if(e.baseUrl!=null){let U=e.baseUrl;if(o?.environments.type!=="multipleBaseUrls")throw new Error("baseUrl is defined environments are not multipleBaseUrls");z.servers=o.environments.environments.map(R=>{let V=R.urls[U];if(V==null)throw new Error("No URL defined for "+U);let Y={url:V};return R.docs!=null&&(Y.description=R.docs),Y})}return e.auth&&(z.security=a),e.requestBody!=null&&(z.requestBody=fRM({httpRequest:e.requestBody,typesByName:r,examples:e.userSpecifiedExamples.map(U=>U.example).filter(ij)??[]})),{fullPath:s,convertedHttpMethod:u,operationObject:z}}function lRM(e){return jU._visit(e,{get:()=>qha.OpenAPIV3.HttpMethods.GET,post:()=>qha.OpenAPIV3.HttpMethods.POST,put:()=>qha.OpenAPIV3.HttpMethods.PUT,patch:()=>qha.OpenAPIV3.HttpMethods.PATCH,delete:()=>qha.OpenAPIV3.HttpMethods.DELETE,head:()=>qha.OpenAPIV3.HttpMethods.HEAD,_other:()=>{throw new Error("Encountered unknown http method: "+e)}})}function fRM({httpRequest:e,typesByName:t,examples:r}){let n={};for(let i of r)i.request!=null&&(i.name&&i.name.originalName!==""?n[i.name.originalName]={value:i.request.jsonExample}:n[`Example${K8(n)+1}`]={value:i.request.jsonExample});return G7._visit(e,{inlinedRequestBody:i=>{let a={schema:YKs({docs:void 0,properties:i.properties.map(o=>{let c;return r.length>0&&r[0]?.request?.type==="inlinedRequestBody"&&(c=r[0]?.request.properties.find(d=>d.name.wireValue===o.name.wireValue)),{docs:o.docs??void 0,name:o.name,valueType:o.valueType,example:c}}),extensions:i.extends})};return K8(n)>0&&(a.examples=n),{required:!0,content:{"application/json":a}}},reference:i=>{let a={schema:dte(i.requestBodyType)};return K8(n)>0&&(a.examples=n),{description:i.docs??void 0,required:XKs({typeReference:i.requestBodyType,typesByName:t}),content:{"application/json":a}}},fileUpload:i=>({required:!0,content:{"multipart/form-data":{schema:{type:"object",properties:i.properties.reduce((a,o)=>(fie._visit(o,{file:c=>{a[c.key.wireValue]={type:"string",format:"binary"}},bodyProperty:c=>{a[c.name.wireValue]={description:c.docs??void 0,...dte(c.valueType)}},_other:()=>{throw new Error("Unknown FileUploadRequestProperty: "+o.type)}}),{...a}),{})}}}}),bytes:()=>{throw new Error("bytes is not supported")},_other:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function dRM({httpResponse:e,responseErrors:t,errorsByName:r,errorDiscriminationStrategy:n,examples:i}){let a={};if(e?.body?.type==="json"){let o={schema:dte(e.body.value.responseBodyType)},c={};for(let d of i)d.response.type==="ok"&&d.response.value.type==="body"&&d.response.value.value!=null&&(d.name&&d.name.originalName!==""?c[d.name.originalName]={value:d.response.value.value.jsonExample}:c[`Example${K8(c)+1}`]={value:d.response.value.value.jsonExample});K8(c)>0&&(o.examples=c),a[String(e.statusCode??200)]={description:e.body.value.docs??"",content:{"application/json":o}}}else a[204]={description:""};return Qnt._visit(n,{statusCode:()=>{for(let o of t){let c=r[ZKs(o.error)];if(c==null)throw new Error("Encountered undefined error declaration: "+o.error.name.originalName);let d={description:o.docs??""};if(c.type!=null){let s={schema:dte(c.type)},u={};for(let l of i)l.response.type==="error"&&l.response.body!=null&&xue(o.error,l.response.error)&&(l.name&&l.name.originalName!==""?u[l.name.originalName]={value:l.response.body.jsonExample}:u[`Example${K8(u)+1}`]={value:l.response.body.jsonExample});K8(u)>0&&(s.examples=u),d.content={"application/json":s}}a[c.statusCode]=d}},property:o=>{let c=_RM({responseErrors:t,errorsByName:r});for(let d of Object.keys(c)){let s=c[d];if(s==null||s.length===0)continue;let u={schema:{oneOf:s.map(m=>pRM({errorInfo:m,property:o}))}},l={};for(let m of i)if(m.response.type==="error"&&m.response.body!=null){let A=m.response.error;s.some(P=>xue(P.errorDeclaration.name,A))&&(m.name&&m.name.originalName!==""?l[m.name.originalName]={value:m.response.body.jsonExample}:l[`Example${K8(l)+1}`]={value:m.response.body.jsonExample})}K8(l)>0&&(u.examples=l),a[d]={description:"",content:{"application/json":u}}}},_other:()=>{throw new Error("Unknown error discrimination strategy: "+n.type)}}),a}function pRM({errorInfo:e,property:t}){let r=e.errorDeclaration.discriminantValue.wireValue,n=e.responseError.docs??void 0,i={[t.discriminant.wireValue]:{type:"string",enum:[r]}};return e.errorDeclaration.type!=null&&(i[t.contentProperty.wireValue]=dte(e.errorDeclaration.type)),{type:"object",description:n,properties:i}}function _RM({responseErrors:e,errorsByName:t}){let r={};for(let n of e){let i=t[ZKs(n.error)];if(i==null)throw new Error("Encountered undefined error declaration: "+n.error.name.originalName);let a=i.statusCode,o=r[a];o==null?r[a]=[{responseError:n,errorDeclaration:i}]:o.push({responseError:n,errorDeclaration:i})}return r}function kYf({pathParameter:e,examples:t}){let r={name:e.name.originalName,in:"path",description:e.docs??void 0,required:!0,schema:dte(e.valueType)},n={};for(let i of t){let a=[...i.rootPathParameters,...i.servicePathParameters,...i.endpointPathParameters].find(o=>o.name.originalName===e.name.originalName);a!=null&&(i.name&&i.name.originalName!==""?n[i.name.originalName]={value:a.value.jsonExample}:n[`Example${K8(n)+1}`]={value:a.value.jsonExample},r.example==null&&(r.example=a.value.jsonExample))}return K8(n)>0&&(r.examples=n),r}function hRM({queryParameter:e,typesByName:t,examples:r}){let n={name:e.name.wireValue,in:"query",description:e.docs??void 0,required:XKs({typeReference:e.valueType,typesByName:t}),schema:e.allowMultiple?dte(Eh.container(Uw.list(e.valueType))):dte(e.valueType)},i={};for(let a of r){let o=a.queryParameters.find(c=>c.name.wireValue===e.name.wireValue);o!=null&&(a.name&&a.name.originalName!==""?i[a.name.originalName]={value:o.value.jsonExample}:i[`Example${K8(i)+1}`]={value:o.value.jsonExample},n.example==null&&(n.example=o.value.jsonExample))}return K8(i)>0&&(n.examples=i),n}function yRM({httpHeader:e,typesByName:t,examples:r}){let n={name:e.name.wireValue,in:"header",description:e.docs??void 0,required:XKs({typeReference:e.valueType,typesByName:t}),schema:dte(e.valueType)},i={};for(let a of r){let o=[...a.serviceHeaders,...a.endpointHeaders].find(c=>c.name.wireValue===e.name.wireValue);o!=null&&(a.name&&a.name.originalName!==""?i[a.name.originalName]={value:o.value.jsonExample}:i[`Example${K8(i)+1}`]={value:o.value.jsonExample},n.example==null&&(n.example=o.value.jsonExample))}return K8(i)>0&&(n.examples=i),n}function eXf(e){let t=e.head;for(let r of e.parts)t+=`{${r.pathParameter}}${r.tail}`;return t}function XKs({typeReference:e,typesByName:t}){if(e.type==="container"&&e.container.type==="optional")return!1;if(e.type==="named"){let r=tXf(e),n=t[r];if(n==null)throw new Error("Encountered non-existent type: "+e.name.originalName);if(n.shape.type==="alias")return XKs({typeReference:n.shape.aliasOf,typesByName:t})}return!0}function wab(e){return gPe._visit(e.requirement,{all:()=>[e.schemes.reduce((t,r)=>({...t,[rXf(r)]:[]}),{})],any:()=>e.schemes.map(t=>({[rXf(t)]:[]})),_other:()=>{throw new Error("Unknown auth scheme requirement: "+e.requirement)}})}function jab(e){let t={};for(let r of e.schemes){let n=H7._visit(r,{bearer:()=>({type:"http",scheme:"bearer"}),basic:()=>({type:"http",scheme:"basic"}),header:i=>({type:"apiKey",in:"header",name:i.name.wireValue}),oauth:()=>({type:"http",scheme:"bearer"}),inferred:()=>{},_other:()=>{throw new Error("Unknown auth scheme: "+r.type)}});n&&(t[rXf(r)]=n)}return t}function rXf(e){return H7._visit(e,{bearer:()=>"BearerAuth",inferred:()=>"InferredAuth",basic:()=>"BasicAuth",oauth:()=>"BearerAuth",header:t=>`${t.name.name.pascalCase.unsafeName}Auth`,_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function Eab({apiName:e,ir:t,mode:r}){let n={},i={};Object.values(t.types).forEach(u=>{let l=Oab(u,t);n[l.schemaName]={title:l.schemaName,...l.openApiSchema},i[tXf(u.name)]=u});let a={};Object.values(t.errors).forEach(u=>{a[ZKs(u.name)]=u});let o=wab(t.auth),c=Pab({ir:t,httpServices:Object.values(t.services),typesByName:i,errorsByName:a,errorDiscriminationStrategy:t.errorDiscriminationStrategy,security:o,environments:t.environments??void 0,mode:r}),d={title:t.apiDisplayName??e,version:""};t.apiDocs!=null&&(d.description=t.apiDocs);let s={openapi:"3.0.1",info:d,paths:c,components:{schemas:n,securitySchemes:jab(t.auth)}};return t.environments!=null&&t.environments.environments.type==="singleBaseUrl"&&(s.servers=t.environments.environments.environments.map(u=>({url:u.url,description:u.docs!=null?`${u.name.originalName} (${u.docs})`:u.name.originalName}))),s}function tXf(e){return[...e.fernFilepath.allParts.map(t=>t.originalName),e.name.originalName].join("-")}function ZKs(e){return[...e.fernFilepath.allParts.map(t=>t.originalName),e.name.originalName].join("-")}async function Sab({project:e,cliContext:t,outputPath:r}){await Promise.all(e.apiWorkspaces.map(async n=>{await t.runTaskForWorkspace(n,async i=>{let a=await n.toFernWorkspace({context:i}),o=iG({workspace:a,audiences:{type:"all"},generationLanguage:void 0,keywords:void 0,smartCasing:!1,exampleGeneration:{disabled:!0},readme:void 0,version:void 0,packageName:void 0,context:i,sourceResolver:new eG(i,a)}),c=Eab({apiName:n.workspaceName??"api",ir:o,mode:"openapi"});await(0,kKs.mkdir)(Rg(r),{recursive:!0}),await(0,kKs.writeFile)(r,r.endsWith(".json")?JSON.stringify(c,void 0,2):Jg.dump(c))})}))}async function Dab({project:e,cliContext:t,shouldFix:r}){await Promise.all(e.apiWorkspaces.map(async n=>{n instanceof G$||await t.runTaskForWorkspace(n,async i=>{await ROf({workspace:await n.toFernWorkspace({context:i}),context:i,shouldFix:r})})}))}var Cab="group";var Iab=".preview",Mab="approved-output-directories",Bab=".fern";var xab=require("fs/promises");var qab=require("fs/promises");var Tab=require("os");function Kou(){return Xl(z_.of((0,Tab.homedir)()),ds.of(Bab),ds.of(Mab))}async function Rab(){let e=Kou();if(!await Rv(e))return[];let r=await(0,qab.readFile)(e,{encoding:"utf-8"});return JSON.parse(r)}var e$s=require("fs/promises"),Nab=pa(require("path"),1);async function Fab(e){await(0,e$s.mkdir)(Nab.default.dirname(Kou()),{recursive:!0}),await(0,e$s.writeFile)(Kou(),JSON.stringify(e,null,2))}async function zab(e,t,r){if(!e||Bef()||r)return{shouldProceed:!0};let n=await Rab();return n?.includes(e)?{shouldProceed:!0}:await Rv(e)?(await(0,xab.readdir)(e)).length===0?{shouldProceed:!0}:await t.confirmPrompt(`Directory ${e} contains existing files that may be overwritten. Continue?`,!1)?(await Fab([...n??[],e]),{shouldProceed:!0}):{shouldProceed:!1}:{shouldProceed:!0}}var Qab=require("fs/promises"),Lab=pa(bCe(),1);async function nXf({logger:e,imageName:t,args:r=[],binds:n=[],envVars:i={},ports:a={},writeLogsToFile:o=!0,removeAfterCompletion:c=!1,runner:d}){let s=()=>vRM({logger:e,imageName:t,args:r,binds:n,envVars:i,ports:a,removeAfterCompletion:c,writeLogsToFile:o,runner:d});try{await s()}catch(u){if(u instanceof Error&&u.message.includes("No such image"))await bRM(t),await s();else throw u}}async function vRM({logger:e,imageName:t,args:r,binds:n,envVars:i={},ports:a={},removeAfterCompletion:o,writeLogsToFile:c,runner:d}){process.env.FERN_STACK_TRACK&&(i.FERN_STACK_TRACK="true");let s=["run","--user","root",...n.flatMap(P=>["-v",P]),...Object.entries(i).flatMap(([P,C])=>["-e",`${P}="${C}"`]),...Object.entries(a).flatMap(([P,C])=>["-p",`${P}:${C}`]),o?"--rm":"",t,...r].filter(Boolean),{stdout:u,stderr:l,exitCode:m}=await kH(e,d??"docker",s,{reject:!1,all:!0,doNotPipeOutput:!0}),A=u+l;if(c){let P=await Lab.default.file();await(0,Qab.writeFile)(P.path,A),e.info(`Generator logs here: ${P.path}`)}if(m!==0)throw new Error(`Docker exited with code ${m}.
|
|
3036
3036
|
${u}
|
|
3037
3037
|
${l}`)}async function bRM(e){await kH(void 0,"docker",["pull",e],{all:!0,doNotPipeOutput:!0})}var S5i=pa(require("path"),1),Rha="/fern",iXf="output",aXf="config.json",oXf="ir.json",gRM="snippet.json",mRM="snippet-templates.json",ORM="generators",ARM="sources",t$s=S5i.default.join(Rha,iXf),$ou=S5i.default.join(Rha,aXf),r$s=S5i.default.join(Rha,oXf),n$s=S5i.default.join(Rha,gRM),i$s=S5i.default.join(Rha,mRM),ufH=S5i.default.join(Rha,ORM),Uab=S5i.default.join(Rha,ARM),a$s="9229";var You=class{dockerImage;keepDocker;constructor({dockerImage:t,keepDocker:r}){this.dockerImage=t,this.keepDocker=r}async execute({generatorName:t,irPath:r,configPath:n,outputPath:i,snippetPath:a,snippetTemplatePath:o,licenseFilePath:c,context:d,inspect:s,runner:u}){d.logger.info(`Executing generator ${t} using Docker image: ${this.dockerImage}`);let l=[`${n}:${$ou}:ro`,`${r}:${r$s}:ro`,`${i}:${t$s}`];a&&l.push(`${a}:${n$s}`),o&&l.push(`${o}:${i$s}`),c&&l.push(`${c}:/tmp/LICENSE:ro`);let m={},A={};s&&(m.NODE_OPTIONS=`--inspect-brk=0.0.0.0:${a$s}`,A[a$s]=a$s),await nXf({logger:d.logger,imageName:this.dockerImage,args:[$ou],binds:l,envVars:m,ports:A,removeAfterCompletion:!this.keepDocker,runner:u})}};var vHE=pa(ib(),1),RQa=require("fs/promises"),sNo=pa(require("path"),1),uNo=require("path"),bHE=pa(bCe(),1);var gdb=pa(xI(),1),oge=pa(ydb(),1),Dze=pa(A9(),1),mdb=pa(require("fs"),1),V5i=pa(require("path"),1),$7M="0.0.1";function CZf(e){if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let t=e.raw.github;if(t.license!=null){if(typeof t.license=="string")return{type:"basic",value:t.license};if(typeof t.license=="object"&&"custom"in t.license)return{type:"custom",value:t.license.custom}}}if(e.raw?.metadata?.license!=null){let t=e.raw.metadata.license;if(typeof t=="string")return{type:"basic",value:t};if(typeof t=="object"&&"custom"in t)return{type:"custom",value:t.custom}}}function Y7M(e,t){let r=CZf(e);if(r!=null){if(r.type==="basic"){if(r.value==="MIT"||r.value==="Apache-2.0")return oge.FernGeneratorExec.LicenseConfig.basic({id:r.value==="MIT"?oge.FernGeneratorExec.LicenseId.Mit:oge.FernGeneratorExec.LicenseId.Apache2})}else if(r.type==="custom")return oge.FernGeneratorExec.LicenseConfig.custom({filename:V5i.basename(r.value)})}}function vdb(e){return e!=null?gdb.GithubPublishInfo._visit(e,{npm:t=>{let r=(t.token||"${NPM_TOKEN}").trim(),n=r==="<USE_OIDC>"||r==="OIDC";return oge.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,Dze.EnvironmentVariable)(n?"<USE_OIDC>":r.startsWith("${")&&r.endsWith("}")?r.slice(2,-1).trim():"")})},maven:t=>oge.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:t.registryUrl,coordinate:t.coordinate,usernameEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.credentials?.password??""),signature:t.signature!=null?{keyIdEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.signature.keyId??""),passwordEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.signature.password??""),secretKeyEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.signature.secretKey??"")}:void 0}),pypi:t=>oge.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:t.registryUrl,packageName:t.packageName,usernameEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.credentials?.password??"")}),rubygems:t=>oge.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.apiKey??"")}),postman:t=>oge.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.apiKey??""),workspaceIdEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.workspaceId??"")}),nuget:t=>oge.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.apiKey??"")}),crates:t=>oge.FernGeneratorExec.GithubPublishInfo.crates({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,Dze.EnvironmentVariable)(t.token??"")}),_other:()=>{}}):void 0}function Odb({generatorInvocation:e,customConfig:t,workspaceName:r,organization:n,outputVersion:i=$7M,absolutePathToSnippet:a,absolutePathToSnippetTemplates:o,absolutePathToFernConfig:c,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,paths:l}){let m=t,A=Y7M(e,c);if(A!=null&&A.type==="custom"){let U;if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let R=e.raw.github;if(R.license!=null&&typeof R.license=="object"&&"custom"in R.license){let V=R.license.custom;try{let Y=c?V5i.dirname(c):process.cwd(),re=V5i.isAbsolute(V)?V:V5i.resolve(Y,V),ee=mdb.readFileSync(re,"utf-8").split(`
|
|
3038
|
-
`).find(ne=>ne.trim().length>0)||"Custom License";ee=ee.trim().replace(/^#+\s*/,""),ee=ee.replace(/[.:;]+$/,"").trim(),U=ee}catch{}}}U!=null&&(m={...t,_fernLicenseName:U})}let{snippetPath:P,snippetTemplatePath:C,irPath:M,outputDirectory:T}=l,z=e.outputMode._visit({publish:U=>({...bdb(i,U,e,l),snippetFilepath:P,publishingMetadata:e.publishMetadata}),publishV2:U=>({...bdb(i,U,e,l),snippetFilepath:P,publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:oge.FernGeneratorExec.OutputMode.downloadFiles(),path:T,snippetFilepath:P,publishingMetadata:e.publishMetadata}),github:U=>{let R={mode:oge.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${U.owner}/${U.repo}`,version:i,publishInfo:vdb(U.publishInfo),installationToken:void 0}),path:T,publishingMetadata:e.publishMetadata};return a!==void 0&&(R.snippetFilepath=P),o!==void 0&&(R.snippetTemplateFilepath=C),R},githubV2:U=>{let R=U._visit({commitAndRelease:Y=>`https://github.com/${Y.owner}/${Y.repo}`,push:Y=>`https://github.com/${Y.owner}/${Y.repo}`,pullRequest:Y=>`https://github.com/${Y.owner}/${Y.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),V={mode:oge.FernGeneratorExec.OutputMode.github({repoUrl:R,version:i,publishInfo:vdb(U.publishInfo)}),path:T,publishingMetadata:e.publishMetadata};return a!==void 0&&(V.snippetFilepath=P),o!==void 0&&(V.snippetTemplateFilepath=C),V},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{irFilepath:M,output:z,publish:void 0,customConfig:m,workspaceName:r,organization:n,environment:oge.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:!1,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,license:A}}function bdb(e,t,r,n){let{outputDirectory:i}=n,a;"registryOverrides"in t?a=t.registryOverrides.maven??t.registryOverrides.npm:a!=null&&(a=t._visit({mavenOverride:c=>c,npmOverride:c=>c,pypiOverride:c=>c,rubyGemsOverride:c=>c,postman:c=>c,nugetOverride:c=>c,cratesOverride:c=>c,_other:()=>{}}));let o="";return r.raw?.github!=null&&(TGo(r.raw.github)?o=r.raw.github.uri:o=r.raw?.github.repository),{mode:oge.FernGeneratorExec.OutputMode.github({repoUrl:o,version:e}),path:i}}var Qt=Symbol(),$n=Symbol();var Adb={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.246",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types,services:e.services,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,errors:e.errors.map(t=>({name:t.name,docs:t.docs,discriminantValue:{originalValue:t.discriminantValueV4.name.unsafeName.originalValue,camelCase:t.discriminantValueV4.name.unsafeName.camelCase,pascalCase:t.discriminantValueV4.name.unsafeName.pascalCase,snakeCase:t.discriminantValueV4.name.unsafeName.snakeCase,screamingSnakeCase:t.discriminantValueV4.name.unsafeName.screamingSnakeCase,wireValue:t.discriminantValueV4.wireValue},discriminantValueV2:t.discriminantValueV2,discriminantValueV3:t.discriminantValueV3,discriminantValueV4:t.discriminantValueV4,type:t.type,typeV2:t.typeV2,typeV3:t.typeV3,http:t.http,statusCode:t.statusCode}))})};var st={};pf(st,{V1:()=>N5z,V10:()=>H5z,V11:()=>G5z,V12:()=>J5z,V13:()=>K5z,V14:()=>$5z,V15:()=>Y5z,V16:()=>X5z,V17:()=>Z5z,V18:()=>k5z,V19:()=>e9z,V2:()=>F5z,V20:()=>t9z,V21:()=>r9z,V22:()=>n9z,V23:()=>DPw.FernIrV23,V24:()=>CPw.FernIrV24,V25:()=>IPw.FernIrV25,V26:()=>MPw.FernIrV26,V27:()=>BPw.FernIrV27,V28:()=>TPw.FernIrV28,V29:()=>qPw.FernIrV29,V3:()=>x5z,V30:()=>RPw.FernIrV30,V31:()=>NPw.FernIrV31,V32:()=>FPw.FernIrV32,V33:()=>xPw.FernIrV33,V34:()=>zPw.FernIrV34,V35:()=>QPw.FernIrV35,V36:()=>LPw.FernIrV36,V37:()=>UPw.FernIrV37,V38:()=>VPw.FernIrV38,V39:()=>WPw.FernIrV39,V4:()=>z5z,V40:()=>HPw.FernIrV40,V41:()=>GPw.FernIrV41,V42:()=>JPw.FernIrV42,V43:()=>KPw.FernIrV43,V44:()=>$Pw.FernIrV44,V45:()=>YPw.FernIrV45,V46:()=>XPw.FernIrV46,V47:()=>ZPw.FernIrV47,V48:()=>kPw.FernIrV48,V49:()=>eww.FernIrV49,V5:()=>Q5z,V50:()=>tww.FernIrV50,V51:()=>rww.FernIrV51,V52:()=>nww.FernIrV52,V53:()=>iww.FernIrV53,V54:()=>aww.FernIrV54,V55:()=>oww.FernIrV55,V56:()=>uww.FernIrV56,V57:()=>sww.FernIrV57,V58:()=>cww.FernIrV58,V59:()=>lww.FernIrV59,V6:()=>L5z,V60:()=>fww.FernIrV60,V61:()=>Zd,V7:()=>U5z,V8:()=>V5z,V9:()=>W5z});var N5z=pa(vbb(),1),F5z=pa(dPb(),1),x5z=pa(tCb(),1),z5z=pa(kRb(),1),Q5z=pa(x4b(),1),L5z=pa(G5b(),1),U5z=pa(eGb(),1),V5z=pa(sZb(),1),W5z=pa(qig(),1),H5z=pa(tfg(),1),G5z=pa(jvg(),1),J5z=pa(APg(),1),K5z=pa(gCg(),1),$5z=pa(yNg(),1),Y5z=pa(p7g(),1),X5z=pa(jUg(),1),Z5z=pa(F$g(),1),k5z=pa($r0(),1),e9z=pa(ll0(),1),t9z=pa(Qv0(),1),r9z=pa(gw0(),1),n9z=pa(ZI0(),1),DPw=pa(vR0(),1),CPw=pa(ez0(),1),IPw=pa(L80(),1),MPw=pa(BL0(),1),BPw=pa(SG0(),1),TPw=pa(PX0(),1),qPw=pa(grm(),1),RPw=pa(Oum(),1),NPw=pa(Pdm(),1),FPw=pa(qvm(),1),xPw=pa(UPd(),1),zPw=pa(nSm(),1),QPw=pa(ZBm(),1),LPw=pa(Jxm(),1),UPw=pa(W8m(),1),VPw=pa(WUm(),1),WPw=pa(u$m(),1),HPw=pa(wtO(),1),GPw=pa(VuO(),1),JPw=pa(d_O(),1),KPw=pa(F0O(),1),$Pw=pa(c1O(),1),YPw=pa(YMO(),1),XPw=pa(VxO(),1),ZPw=pa(Q2O(),1),kPw=pa(FWO(),1),eww=pa(FXO(),1),tww=pa(GiA(),1),rww=pa(fdA(),1),nww=pa(RgA(),1),iww=pa(cCA(),1),aww=pa(HzA(),1),oww=pa(TWA(),1),uww=pa(ArP(),1),sww=pa(fAP(),1),cww=pa(m6P(),1),lww=pa(Wtw(),1),fww=pa(SPw(),1);function dww({inlinedRequest:e,allTypes:t}){let r=new Set,n=t.reduce((i,a)=>({...i,[Cip(a.name)]:a}),{});for(let i of e.extends)pww({typeName:i,typeNameToDeclaration:n,referencedTypes:r});for(let i of e.properties)Mvo({reference:i.valueType,typeNameToDeclaration:n,referencedTypes:r});return[...r].reduce((i,a)=>{let o=n[a];if(o==null)throw new Error("Cannot find declaration for ID: "+a);return[...i,o.name]},[])}function Mvo({reference:e,typeNameToDeclaration:t,referencedTypes:r}){st.V2.types.TypeReference._visit(e,{primitive:Hc,container:n=>{i9z({container:n,typeNameToDeclaration:t,referencedTypes:r})},named:n=>{pww({typeName:n,typeNameToDeclaration:t,referencedTypes:r})},unknown:Hc,void:Hc,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function i9z({container:e,typeNameToDeclaration:t,referencedTypes:r}){st.V2.types.ContainerType._visit(e,{list:n=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r})},set:n=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r})},optional:n=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:n,valueType:i})=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r}),Mvo({reference:i,typeNameToDeclaration:t,referencedTypes:r})},literal:Hc,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function pww({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let n=Cip(e);r.add(n);let i=t[n];if(i==null)throw new Error("Cannot locate type: "+n);for(let a of i.referencedTypes)r.add(Cip(a))}function Cip(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var _ww={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.249",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.0.134-3-g97d4964",[ge.JAVA_SDK]:"0.0.134-3-g97d4964",[ge.JAVA_SPRING]:"0.0.134-3-g97d4964",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=[...e.types];return{apiName:e.apiName,auth:e.auth,headers:e.headers,types:t,errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{websocket:e.services.websocket,http:e.services.http.map(r=>({availability:r.availability,docs:r.docs,name:r.name,basePath:r.basePath,basePathV2:r.basePathV2,headers:r.headers,pathParameters:r.pathParameters,endpoints:r.endpoints.map(n=>a9z(r,n,e.types,i=>{t.push(i)}))}))}}}};function a9z(e,t,r,n){return{docs:t.docs,availability:t.availability,id:t.id,name:t.name,nameV2:t.nameV2,method:t.method,headers:t.headers,path:t.path,pathParameters:t.pathParameters,queryParameters:t.queryParameters,request:o9z(t,e,r,n),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function o9z(e,t,r,n){let i=e.requestBody;return i==null?{docs:void 0,type:st.V2.types.TypeReference.void(),typeV2:void 0}:st.V3.services.http.HttpRequestBody._visit(i,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let o={fernFilepath:t.name.fernFilepath,fernFilepathV2:t.name.fernFilepathV2,name:a.name.unsafeName.originalValue,nameV2:{originalValue:a.name.unsafeName.originalValue,camelCase:a.name.unsafeName.camelCase,pascalCase:a.name.unsafeName.pascalCase,snakeCase:a.name.unsafeName.snakeCase,screamingSnakeCase:a.name.unsafeName.screamingSnakeCase},nameV3:a.name},c=st.V2.types.Type.object({extends:a.extends,properties:a.properties.map(s=>({availability:e.availability,docs:s.docs,name:{originalValue:s.name.name.unsafeName.originalValue,camelCase:s.name.name.unsafeName.camelCase,pascalCase:s.name.name.unsafeName.pascalCase,snakeCase:s.name.name.unsafeName.snakeCase,screamingSnakeCase:s.name.name.unsafeName.screamingSnakeCase,wireValue:s.name.wireValue},nameV2:s.name,valueType:s.valueType}))});n({docs:void 0,availability:e.availability,name:o,shape:c,referencedTypes:dww({inlinedRequest:a,allTypes:r}),examples:[]});let d=st.V2.types.TypeReference.named(o);return{docs:void 0,type:d,typeV2:d}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+i.type)}})}var vww={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:"0.0.11-4-g1c29f6c",[ge.POSTMAN]:"0.0.32-rc0",[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types.map(t=>({docs:t.docs,availability:t.availability,name:t.name,shape:t.shape,examples:t.examples.map(r=>bww(r.shape)),referencedTypes:t.referencedTypes})),errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{...e.services,http:e.services.http.map(t=>({...t,endpoints:t.endpoints.map(r=>({...r,examples:r.examples.map(n=>f9z(n))}))}))}})};function bww(e){return st.V4.types.ExampleTypeShape._visit(e,{object:t=>st.V3.types.ExampleType.object(u9z(t)),union:t=>st.V3.types.ExampleType.union(c9z(t)),alias:t=>st.V3.types.ExampleType.alias(l9z(t)),enum:st.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function u9z(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:LBe(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function LBe(e){return st.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:st.V3.types.ExampleTypeReference.primitive,container:t=>st.V3.types.ExampleTypeReference.container(s9z(t)),named:t=>st.V3.types.ExampleTypeReference.named(gww(t)),unknown:st.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function s9z(e){return st.V4.types.ExampleContainer._visit(e,{list:t=>st.V3.types.ExampleContainer.list(t.map(LBe)),set:t=>st.V3.types.ExampleContainer.set(t.map(LBe)),optional:t=>st.V3.types.ExampleContainer.optional(t!=null?LBe(t):void 0),map:t=>st.V3.types.ExampleContainer.map(t.map(r=>({key:LBe(r.key),value:LBe(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function gww(e){return{typeName:e.typeName,shape:bww(e.shape)}}function c9z(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:st.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>st.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(gww(t)),singleProperty:t=>st.V3.types.ExampleSingleUnionTypeProperties.singleProperty(LBe(t)),noProperties:()=>st.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function l9z(e){return{value:LBe(e.value)}}function f9z(e){return{servicePathParameters:e.servicePathParameters.map(t=>hww(t)),endpointPathParameters:e.servicePathParameters.map(t=>hww(t)),serviceHeaders:e.serviceHeaders.map(t=>yww(t)),endpointHeaders:e.endpointHeaders.map(t=>yww(t)),queryParameters:e.queryParameters.map(t=>d9z(t)),request:e.request!=null?p9z(e.request):void 0,response:h9z(e.response)}}function hww(e){return{key:e.key,value:LBe(e.value)}}function yww(e){return{key:e.wireKey,value:LBe(e.value)}}function d9z(e){return{key:e.wireKey,value:LBe(e.value)}}function p9z(e){return st.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>st.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>_9z(r))}),reference:t=>st.V3.services.http.ExampleRequestBody.reference(LBe(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function _9z(e){return{wireKey:e.wireKey,value:LBe(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function h9z(e){return st.V4.services.http.ExampleResponse._visit(e,{ok:t=>st.V3.services.http.ExampleResponse.ok({body:t.body!=null?LBe(t.body):void 0}),error:t=>st.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?LBe(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function zxr(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function hut(e){return{...zxr(e.name),wireValue:e.wireValue}}function Gse(e){return{safeName:{originalValue:e.originalName,camelCase:e.camelCase.safeName,pascalCase:e.pascalCase.safeName,snakeCase:e.snakeCase.safeName,screamingSnakeCase:e.screamingSnakeCase.safeName},unsafeName:{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}}function Jse(e){return{wireValue:e.wireValue,name:Gse(e.name)}}function Bvo(e){return st.V5.types.ContainerType._visit(e,{list:t=>st.V4.types.ContainerType.list(jY(t)),set:t=>st.V4.types.ContainerType.set(jY(t)),map:({keyType:t,valueType:r})=>st.V4.types.ContainerType.map({keyType:jY(t),valueType:jY(r)}),optional:t=>st.V4.types.ContainerType.optional(jY(t)),literal:t=>st.V5.types.Literal._visit(t,{string:r=>st.V4.types.ContainerType.literal(st.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function qIa(e){return e.map(t=>zxr(t))}function RIa(e){return e.map(t=>Gse(t))}function h_e(e){return{fernFilepath:qIa(e.fernFilepath),fernFilepathV2:RIa(e.fernFilepath),name:e.name.originalName,nameV2:zxr(e.name),nameV3:Gse(e.name)}}function jY(e){return st.V5.types.TypeReference._visit(e,{named:t=>st.V4.types.TypeReference.named(h_e(t)),container:t=>st.V4.types.TypeReference.container(Bvo(t)),primitive:t=>st.V4.types.TypeReference.primitive(t),unknown:st.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function NIa(e){return{name:hut(e.name),nameV2:Jse(e.name),valueType:jY(e.valueType),availability:e.availability,docs:e.docs}}function mww(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>y9z(t))}}function y9z(e){return st.V5.auth.AuthScheme._visit(e,{basic:st.V4.auth.AuthScheme.basic,bearer:st.V4.auth.AuthScheme.bearer,header:t=>st.V4.auth.AuthScheme.header(NIa(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function Oww(e){return{docs:e.docs,id:e.id,url:e.url,name:Gse(e.name)}}function Aww({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let n=e.type!=null?st.V4.types.Type.alias({aliasOf:jY(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:zxr(e.name.name),nameV3:Gse(e.name.name),fernFilepath:qIa(e.name.fernFilepath),fernFilepathV2:RIa(e.name.fernFilepath)},discriminantValueV2:Jse(e.discriminantValue),discriminantValueV3:st.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:st.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:i=>st.V4.errors.ErrorDeclarationDiscriminantValue.property(Jse(i.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:Jse(e.discriminantValue),type:n??st.V4.types.Type.alias({aliasOf:st.V4.types.TypeReference.void(),resolvedType:st.V4.types.ResolvedTypeReference.void()}),typeV2:n,typeV3:e.type!=null?jY(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function UBe(e){return{jsonExample:e.jsonExample,shape:Pww(e.shape)}}function Pww(e){return st.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:st.V4.types.ExampleTypeReferenceShape.primitive,container:t=>st.V4.types.ExampleTypeReferenceShape.container(b9z(t)),unknown:st.V4.types.ExampleTypeReferenceShape.unknown,named:t=>st.V4.types.ExampleTypeReferenceShape.named(v9z(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function v9z(e){return{typeName:h_e(e.typeName),shape:Wpc(e.shape)}}function b9z(e){return st.V5.types.ExampleContainer._visit(e,{list:t=>st.V4.types.ExampleContainer.list(t.map(r=>UBe(r))),set:t=>st.V4.types.ExampleContainer.set(t.map(r=>UBe(r))),optional:t=>st.V4.types.ExampleContainer.optional(t!=null?UBe(t):void 0),map:t=>st.V4.types.ExampleContainer.map(t.map(r=>({key:UBe(r.key),value:UBe(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function Wpc(e){return st.V5.types.ExampleTypeShape._visit(e,{alias:t=>st.V4.types.ExampleTypeShape.alias({value:UBe(t.value)}),object:t=>st.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:UBe(r.value),originalTypeDeclaration:h_e(r.originalTypeDeclaration)}))}),union:t=>st.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:st.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>st.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:h_e(r.typeName),shape:Wpc(r.shape)}),singleProperty:r=>st.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:Pww(r.shape)}),noProperties:st.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>st.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function Eww({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:g9z(e.name),basePath:m9z(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>O9z({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>NIa(r)),pathParameters:e.pathParameters.map(r=>Sww(r))}}function g9z(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:qIa(e.fernFilepath),fernFilepathV2:RIa(e.fernFilepath)}}function m9z(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function O9z({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:zxr(e.name),nameV2:Gse(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>NIa(r)),path:e.path,pathParameters:e.pathParameters.map(r=>Sww(r)),queryParameters:e.queryParameters.map(r=>A9z(r)),requestBody:e.requestBody!=null?P9z(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?w9z(e.sdkRequest):void 0,response:j9z(e.response),errors:e.errors.map(r=>E9z(r)),errorsV2:S9z({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>I9z(r))}}function Sww(e){return{docs:e.docs,availability:e.availability,name:zxr(e.name),nameV2:Gse(e.name),valueType:jY(e.valueType)}}function A9z(e){return{docs:e.docs,availability:e.availability,name:hut(e.name),nameV2:Jse(e.name),valueType:jY(e.valueType),allowMultiple:e.allowMultiple}}function P9z(e){return st.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V4.services.http.HttpRequestBody.inlinedRequestBody({name:Gse(t.name),extends:t.extends.map(r=>h_e(r)),properties:t.properties.map(r=>({docs:r.docs,name:Jse(r.name),valueType:jY(r.valueType)}))}),reference:t=>st.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:jY(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function w9z(e){return{requestParameterName:Gse(e.requestParameterName),shape:st.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>st.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:jY(t.requestBodyType)}),wrapper:t=>st.V4.services.http.SdkRequestShape.wrapper({wrapperName:Gse(t.wrapperName),bodyKey:Gse(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function j9z(e){let t=e.type!=null?jY(e.type):void 0;return{docs:e.docs,type:t??st.V4.types.TypeReference.void(),typeV2:t}}function E9z(e){return{docs:e.docs,error:Iip(e.error)}}function S9z({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>D9z({responseError:r,errorResolver:t}))}}function D9z({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:hut(r.discriminantValue),shape:C9z({responseError:e,declaration:r})}}function C9z({responseError:e,declaration:t}){return t.type==null?st.V4.services.commons.ResponseErrorShape.noProperties():st.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:Iip(e.error)})}function Iip(e){return{name:e.name.originalName,nameV2:zxr(e.name),nameV3:Gse(e.name),fernFilepath:qIa(e.fernFilepath),fernFilepathV2:RIa(e.fernFilepath)}}function I9z(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>www(t)),endpointPathParameters:e.endpointPathParameters.map(t=>www(t)),serviceHeaders:e.serviceHeaders.map(t=>jww(t)),endpointHeaders:e.endpointHeaders.map(t=>jww(t)),queryParameters:e.queryParameters.map(t=>M9z(t)),request:e.request!=null?B9z(e.request):void 0,response:q9z(e.response)}}function www(e){return{key:e.key,value:UBe(e.value)}}function jww(e){return{wireKey:e.wireKey,value:UBe(e.value)}}function M9z(e){return{wireKey:e.wireKey,value:UBe(e.value)}}function B9z(e){return st.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>st.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>T9z(r))}),reference:t=>st.V4.services.http.ExampleRequestBody.reference(UBe(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function T9z(e){return{wireKey:e.wireKey,value:UBe(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?h_e(e.originalTypeDeclaration):void 0}}function q9z(e){return st.V5.http.ExampleResponse._visit(e,{ok:t=>st.V4.services.http.ExampleResponse.ok({body:t.body!=null?UBe(t.body):void 0}),error:t=>st.V4.services.http.ExampleResponse.error({error:Iip(t.error),body:t.body!=null?UBe(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function Dww(e){return{docs:e.docs,availability:e.availability,name:h_e(e.name),shape:R9z(e.shape),examples:e.examples.map(t=>N9z(t)),referencedTypes:e.referencedTypes.map(t=>h_e(t))}}function R9z(e){return st.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>st.V4.types.Type.alias({aliasOf:jY(t),resolvedType:F9z(r)}),enum:t=>st.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:hut(r.name),nameV2:Jse(r.name),value:r.name.wireValue}))}),object:t=>st.V4.types.Type.object({extends:t.extends.map(r=>h_e(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:hut(r.name),nameV2:Jse(r.name),valueType:jY(r.valueType)}))}),union:t=>st.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:hut(t.discriminant),discriminantV3:Jse(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:hut(r.discriminantValue),discriminantValueV2:Jse(r.discriminantValue),valueType:st.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>st.V4.types.TypeReference.named(h_e(n)),singleProperty:n=>jY(n.type),noProperties:st.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:st.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>st.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(h_e(n)),singleProperty:n=>st.V4.types.SingleUnionTypeProperties.singleProperty({name:hut(n.name),nameV2:Jse(n.name),type:jY(n.type)}),noProperties:st.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function N9z(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:Wpc(e.shape)}}function F9z(e){return st.V5.types.ResolvedTypeReference._visit(e,{named:t=>st.V4.types.ResolvedTypeReference.named({name:h_e(t.name),shape:x9z(t.shape)}),container:t=>st.V4.types.ResolvedTypeReference.container(Bvo(t)),primitive:st.V4.types.ResolvedTypeReference.primitive,unknown:st.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function x9z(e){return st.V5.types.ShapeType._visit(e,{enum:()=>st.V5.types.ShapeType.Enum,object:()=>st.V5.types.ShapeType.Object,union:()=>st.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var Hpc=class{errors;constructor(t){this.errors=t.errors.reduce((r,n)=>({...r,[Cww(n.name)]:n}),{})}getDeclaration(t){let r=Cww(t),n=this.errors[r];if(n==null)throw new Error("Error does not exist: "+r);return n}};function Cww(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}var Gpc=class{types;constructor(t){this.types=t.types.reduce((r,n)=>({...r,[Iww(n.name)]:n}),{})}resolveTypeReference(t){return st.V5.types.TypeReference._visit(t,{container:r=>st.V4.types.ResolvedTypeReference.container(Bvo(r)),named:r=>{let n=this.getTypeDeclaration(r);return n.shape._type==="alias"?this.resolveTypeReference(n.shape.aliasOf):st.V4.types.ResolvedTypeReference.named({name:h_e(r),shape:z9z(n.shape._type)})},primitive:st.V4.types.ResolvedTypeReference.primitive,unknown:st.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=Iww(t),n=this.types[r];if(n==null)throw new Error("Type does not exist: "+n);return n}};function Iww(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function z9z(e){switch(e){case"object":return st.V4.types.ShapeType.Object;case"union":return st.V4.types.ShapeType.Union;case"enum":return st.V4.types.ShapeType.Enum;default:ks(e)}}var Mww={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[ge.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new Gpc(e),r=new Hpc(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:mww(e.auth),headers:e.headers.map(n=>NIa(n)),types:e.types.map(n=>Dww(n)),services:{http:e.services.map(n=>Eww({service:n,errorResolver:r})),websocket:[]},errors:e.errors.map(n=>Aww({errorDeclaration:n,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:hut(e.constants.errorInstanceIdKey),errorDiscriminant:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR",wireValue:"error"},errorContentKey:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"}},errorsV2:{errorInstanceIdKey:Jse(e.constants.errorInstanceIdKey),errorDiscriminant:{name:{unsafeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"},safeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"}},wireValue:"error"},errorContentKey:{name:{unsafeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"},safeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"}},wireValue:"content"}}},defaultEnvironment:e.defaultEnvironment,environments:e.environments.map(n=>Oww(n)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?Gse(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:st.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:st.V4.ir.ErrorDiscriminationStrategy.statusCode,property:n=>st.V4.ir.ErrorDiscriminationStrategy.property({discriminant:Jse(n.discriminant),contentProperty:Jse(n.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var Bww={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[ge.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[ge.OPENAPI]:"0.0.16-1-ga2c0ada",[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?st.V6.environment.Environments._visit(e.environments.environments,{singleBaseUrl:n=>n.environments,multipleBaseUrls:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying multiple URLs for a single environment. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a multiple URls for a single environment."),_unknown:()=>{throw new Error("Unknown Environments: "+e.environments?.environments.type)}}):[]})};var Tww={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.268",[ge.TYPESCRIPT_EXPRESS]:"0.0.268",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:e.services.map(t=>{let r=t.name.fernFilepath[t.name.fernFilepath.length-1],n=r!=null?`${r.pascalCase.safeName}Service`:"Service",i=r!=null?`${r.camelCase.unsafeName}Service`:"Service",a=r!=null?`${r.snakeCase.unsafeName}_service`:"service",o=a.toUpperCase(),c=bU(i);return{...t,name:{name:{originalName:n,camelCase:{safeName:i,unsafeName:i},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:o,unsafeName:o},pascalCase:{safeName:c,unsafeName:c}},fernFilepath:t.name.fernFilepath}}})})};var Nww={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[ge.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[ge.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[ge.OPENAPI_PYTHON_CLIENT]:"0.0.0",[ge.OPENAPI]:"0.0.20-1-gbbeb9bd",[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:Q9z(e.auth),headers:e.headers.map(t=>Jpc(t)),types:e.types.map(t=>L9z(t)),errors:e.errors.map(t=>K9z(t)),services:e.services.map(t=>$9z(t))})};function Mip(e){return e.allParts}function Q9z(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:st.V7.auth.AuthScheme.header(Jpc(t)))}}function Jpc(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:r1e(e.valueType)}}function r1e(e){return st.V8.types.TypeReference._visit(e,{container:t=>st.V7.types.TypeReference.container(Fww(t)),named:t=>st.V7.types.TypeReference.named(Qxr(t)),primitive:st.V7.types.TypeReference.primitive,unknown:st.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function Fww(e){return st.V8.types.ContainerType._visit(e,{list:t=>st.V7.types.ContainerType.list(r1e(t)),optional:t=>st.V7.types.ContainerType.optional(r1e(t)),set:t=>st.V7.types.ContainerType.set(r1e(t)),map:({keyType:t,valueType:r})=>st.V7.types.ContainerType.map({keyType:r1e(t),valueType:r1e(r)}),literal:st.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function Qxr(e){return{name:e.name,fernFilepath:Mip(e.fernFilepath)}}function L9z(e){return{docs:e.docs,availability:e.availability,name:Qxr(e.name),shape:U9z(e.shape),examples:e.examples.map(t=>G9z(t)),referencedTypes:e.referencedTypes.map(t=>Qxr(t))}}function U9z(e){return st.V8.types.Type._visit(e,{alias:t=>st.V7.types.Type.alias({aliasOf:r1e(t.aliasOf),resolvedType:V9z(t.resolvedType)}),enum:st.V7.types.Type.enum,object:t=>st.V7.types.Type.object({extends:t.extends.map(r=>Qxr(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:r1e(r.valueType)}))}),union:t=>st.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>W9z(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function V9z(e){return st.V8.types.ResolvedTypeReference._visit(e,{container:t=>st.V7.types.ResolvedTypeReference.container(Fww(t)),named:t=>st.V7.types.ResolvedTypeReference.named({name:Qxr(t.name),shape:t.shape}),primitive:st.V7.types.ResolvedTypeReference.primitive,unknown:st.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function W9z(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:H9z(e.shape)}}function H9z(e){return st.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(Qxr(t)),singleProperty:t=>st.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:r1e(t.type)}),noProperties:st.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function G9z(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:Bip(e.shape)}}function Bip(e){return st.V8.types.ExampleTypeShape._visit(e,{alias:t=>st.V7.types.ExampleTypeShape.alias({value:Y6e(t.value)}),enum:st.V7.types.ExampleTypeShape.enum,object:t=>st.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:Y6e(r.value),originalTypeDeclaration:Qxr(r.originalTypeDeclaration)}))}),union:t=>st.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:J9z(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function Y6e(e){return{jsonExample:e.jsonExample,shape:xww(e.shape)}}function xww(e){return st.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>st.V7.types.ExampleTypeReferenceShape.named({typeName:Qxr(t.typeName),shape:Bip(t.shape)}),container:t=>st.V7.types.ExampleTypeReferenceShape.container(st.V8.types.ExampleContainer._visit(t,{list:r=>st.V7.types.ExampleContainer.list(r.map(n=>Y6e(n))),set:r=>st.V7.types.ExampleContainer.set(r.map(n=>Y6e(n))),optional:r=>st.V7.types.ExampleContainer.optional(r!=null?Y6e(r):void 0),map:r=>st.V7.types.ExampleContainer.map(r.map(n=>({key:Y6e(n.key),value:Y6e(n.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:st.V7.types.ExampleTypeReferenceShape.primitive,unknown:st.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function J9z(e){return st.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:Qxr(t.typeName),shape:Bip(t.shape)}),singleProperty:t=>st.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:xww(t.shape)}),noProperties:st.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function K9z(e){return{docs:e.docs,name:Tip(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?r1e(e.type):void 0,statusCode:e.statusCode}}function Tip(e){return{name:e.name,fernFilepath:Mip(e.fernFilepath)}}function $9z(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:Mip(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>zww(t)),headers:e.headers.map(t=>Jpc(t)),endpoints:e.endpoints.map(t=>Y9z(t))}}function zww(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:r1e(e.valueType)}}function Y9z(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>X9z(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>zww(t)),sdkRequest:e.sdkRequest!=null?k9z(e.sdkRequest):void 0,requestBody:e.requestBody!=null?tLz(e.requestBody):void 0,response:rLz(e.response),headers:e.headers.map(t=>Jpc(t)),queryParameters:e.queryParameters.map(t=>Z9z(t)),examples:e.examples.map(t=>nLz(t))}}function X9z(e){return{docs:e.docs,error:Tip(e.error)}}function Z9z(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:r1e(e.valueType),allowMultiple:e.allowMultiple}}function k9z(e){return{requestParameterName:e.requestParameterName,shape:eLz(e.shape)}}function eLz(e){return st.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:r1e(t.requestBodyType)}),wrapper:st.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function tLz(e){return st.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>Qxr(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:r1e(r.valueType)}))}),reference:t=>st.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:r1e(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function rLz(e){return{docs:e.docs,type:e.type!=null?r1e(e.type):void 0}}function nLz(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>qww(t)),endpointPathParameters:e.endpointPathParameters.map(t=>qww(t)),queryParameters:e.queryParameters.map(t=>iLz(t)),serviceHeaders:e.serviceHeaders.map(t=>Rww(t)),endpointHeaders:e.endpointHeaders.map(t=>Rww(t)),request:e.request!=null?aLz(e.request):void 0,response:oLz(e.response)}}function qww(e){return{key:e.key,value:Y6e(e.value)}}function iLz(e){return{wireKey:e.wireKey,value:Y6e(e.value)}}function Rww(e){return{wireKey:e.wireKey,value:Y6e(e.value)}}function aLz(e){return st.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>st.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:Y6e(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?Qxr(r.originalTypeDeclaration):void 0}))}),reference:t=>st.V7.http.ExampleRequestBody.reference(Y6e(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function oLz(e){return st.V8.http.ExampleResponse._visit(e,{ok:t=>st.V7.http.ExampleResponse.ok({body:t.body!=null?Y6e(t.body):void 0}),error:t=>st.V7.http.ExampleResponse.error({error:Tip(t.error),body:t.body!=null?Y6e(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var Qww={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[ge.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[ge.JAVA_SDK]:"0.0.134-4-gef1ec4f",[ge.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[ge.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[ge.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[n,i]of Object.entries(e.types))i.shape._type==="union"&&i.shape.baseProperties.length>0&&t.failWithoutThrowing(r!=null?`Type ${i.name.name.originalName} uses base-properties. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a union with base-properties.");return t.getResult()===RV.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var Lww={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.STOPLIGHT]:$n,[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Pg(e.services,r=>({docs:void 0,...r}));for(let r of Object.values(e.subpackages))if(r.docs!=null&&r.service!=null){let n=t[r.service];if(n==null)throw new Error("Service does not exist: "+r.service);n.docs=r.docs}return{...e,services:t}}};var Uww={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[ge.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.0.134-15-ge1ac358",[ge.JAVA_SDK]:"0.0.134-15-ge1ac358",[ge.JAVA_SPRING]:"0.0.134-15-ge1ac358",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.STOPLIGHT]:$n,[ge.OPENAPI]:Qt,[ge.POSTMAN]:"0.0.40-1-g9aa2117",[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:uLz(e.auth,t)})};function uLz(e,t){return{...e,schemes:e.schemes.map(r=>sLz(r,t))}}function sLz(e,{taskContext:t,targetGenerator:r}){return st.V11.auth.AuthScheme._visit(e,{bearer:st.V10.auth.AuthScheme.bearer,basic:st.V10.auth.AuthScheme.basic,header:n=>n.prefix!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying an auth header prefix. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an auth header prefix."):st.V10.auth.AuthScheme.header({docs:n.docs,availability:{status:st.V10.commons.AvailabilityStatus.GeneralAvailability,message:void 0},name:{name:n.name,wireValue:n.header},valueType:n.valueType}),_unknown:()=>{throw new Error("Unknown auth scheme: "+e._type)}})}var Www={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[ge.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.1.0-1-gdb5c636",[ge.JAVA_SDK]:"0.1.0-1-gdb5c636",[ge.JAVA_SPRING]:"0.1.0-1-gdb5c636",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.STOPLIGHT]:"0.0.23-8-g479c860",[ge.OPENAPI]:"0.0.22-1-g1c86b58",[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let n=Pg(e.types,i=>({...i,shape:st.V12.types.Type._visit(i.shape,{union:st.V11.types.Type.union,enum:st.V11.types.Type.enum,object:st.V11.types.Type.object,alias:a=>st.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:st.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:st.V11.types.ResolvedTypeReference.container,primitive:st.V11.types.ResolvedTypeReference.primitive,named:o=>o.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(Vww({taskContext:t,targetGenerator:r})):st.V11.types.ResolvedTypeReference.named({shape:o.shape,name:o.name}),unknown:st.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(Vww({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:n,services:Pg(e.services,i=>cLz(i,{taskContext:t,targetGenerator:r}))}}};function Vww(e){return e.targetGenerator!=null?`Generator ${e.targetGenerator.name}@${e.targetGenerator.version} does not support undiscriminated unions If you'd like to use this feature, please upgrade ${e.targetGenerator.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an undiscriminated union."}function cLz(e,t){return{...e,endpoints:e.endpoints.map(r=>lLz(r,t))}}function lLz(e,{taskContext:t,targetGenerator:r}){return e.streamingResponse!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a streaming response."):{...e,requestBody:e.requestBody!=null?st.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:st.V11.http.HttpRequestBody.inlinedRequestBody,reference:st.V11.http.HttpRequestBody.reference,fileUpload:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support file upload requests. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a file upload request."),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.requestBody?.type)}}):void 0,response:e.response!=null?{docs:e.response.docs,type:e.response.responseBodyType}:{docs:void 0,type:void 0}}}var Hww={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:Pg(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:st.V12.types.Type.undiscriminatedUnion({docs:void 0,members:t.shape.members})}),auth:{...e.auth,schemes:e.auth.schemes.map(t=>t._type!=="header"?t:{...t,name:t.name.name,header:t.name.wireValue})}})};var Gww={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V14.types.Type._visit(r.shape,{union:n=>st.V13.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:Ute(i.valueType)})),types:n.types.map(i=>pLz(i))}),enum:st.V13.types.Type.enum,object:n=>st.V13.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:Ute(i.valueType)}))}),alias:n=>st.V13.types.Type.alias({aliasOf:Ute(n.aliasOf),resolvedType:hLz(n.resolvedType)}),undiscriminatedUnion:n=>st.V13.types.Type.undiscriminatedUnion(yLz(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:fLz(e.auth),headers:e.headers.map(r=>Nip(r)),types:t,services:Pg(e.services,r=>vLz(r)),errors:Pg(e.errors,r=>wLz(r))}}};function fLz(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:st.V13.auth.AuthScheme.header(dLz(t)))}}function dLz(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:Ute(e.valueType)}}function Nip(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:Ute(e.valueType)}}function Ute(e){return st.V14.types.TypeReference._visit(e,{container:t=>st.V13.types.TypeReference.container(Jww(t)),primitive:t=>t==="DATE"?st.V13.types.TypeReference.primitive(st.V13.types.PrimitiveType.String):st.V13.types.TypeReference.primitive(t),named:st.V13.types.TypeReference.named,unknown:st.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function Jww(e){return st.V14.types.ContainerType._visit(e,{list:t=>st.V13.types.ContainerType.list(Ute(t)),optional:t=>st.V13.types.ContainerType.optional(Ute(t)),set:t=>st.V13.types.ContainerType.set(Ute(t)),map:({keyType:t,valueType:r})=>st.V13.types.ContainerType.map({keyType:Ute(t),valueType:Ute(r)}),literal:st.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function pLz(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:_Lz(e.shape)}}function _Lz(e){return st.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:Ute(t.type)}),noProperties:st.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function hLz(e){return st.V14.types.ResolvedTypeReference._visit(e,{container:t=>st.V13.types.ResolvedTypeReference.container(Jww(t)),named:st.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?st.V13.types.ResolvedTypeReference.primitive(st.V13.types.PrimitiveType.String):st.V13.types.ResolvedTypeReference.primitive(t),unknown:st.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function yLz(e){return{members:e.members.map(t=>({...t,type:Ute(t.type)}))}}function vLz(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>Kww(t)),headers:e.headers.map(t=>Nip(t)),endpoints:e.endpoints.map(t=>bLz(t))}}function Kww(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ute(e.valueType)}}function bLz(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>Kww(t)),sdkRequest:e.sdkRequest!=null?mLz(e.sdkRequest):void 0,requestBody:e.requestBody!=null?ALz(e.requestBody):void 0,response:e.response!=null?qip(e.response):void 0,headers:e.headers.map(t=>Nip(t)),queryParameters:e.queryParameters.map(t=>gLz(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?Rip(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?PLz(e.sdkResponse):void 0}}function gLz(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ute(e.valueType),allowMultiple:e.allowMultiple}}function mLz(e){return{requestParameterName:e.requestParameterName,shape:OLz(e.shape)}}function OLz(e){return st.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:Ute(t.requestBodyType)}),wrapper:st.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function ALz(e){return st.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:Ute(r.valueType)}))}),reference:t=>st.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:Ute(t.requestBodyType)}),fileUpload:t=>st.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:Ute(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function qip(e){return{docs:e.docs,responseBodyType:Ute(e.responseBodyType)}}function Rip(e){return{dataEventType:Ute(e.dataEventType),terminator:e.terminator}}function PLz(e){return st.V14.http.SdkResponse._visit(e,{streaming:t=>st.V13.http.SdkResponse.streaming(Rip(t)),nonStreaming:t=>st.V13.http.SdkResponse.nonStreaming(qip(t)),maybeStreaming:t=>st.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:qip(t.nonStreaming),streaming:Rip(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function wLz(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?Ute(e.type):void 0,statusCode:e.statusCode}}var $ww={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[ge.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.0.52-3-gd9df38df",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V15.types.Type._visit(r.shape,{union:n=>st.V14.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:Vte(i.valueType)})),types:n.types.map(i=>SLz(i))}),enum:st.V14.types.Type.enum,object:n=>st.V14.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:Vte(i.valueType)}))}),alias:n=>st.V14.types.Type.alias({aliasOf:Vte(n.aliasOf),resolvedType:CLz(n.resolvedType)}),undiscriminatedUnion:n=>st.V14.types.Type.undiscriminatedUnion(ILz(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:jLz(e.auth),headers:e.headers.map(r=>zip(r)),types:t,services:Pg(e.services,r=>MLz(r)),errors:Pg(e.errors,r=>xLz(r))}}};function jLz(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:st.V14.auth.AuthScheme.header(ELz(t)))}}function ELz(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:Vte(e.valueType)}}function zip(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:Vte(e.valueType)}}function Vte(e){return st.V15.types.TypeReference._visit(e,{container:t=>st.V14.types.TypeReference.container(Yww(t)),primitive:t=>t==="BASE_64"?st.V14.types.TypeReference.primitive(st.V14.types.PrimitiveType.String):st.V14.types.TypeReference.primitive(t),named:st.V14.types.TypeReference.named,unknown:st.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function Yww(e){return st.V15.types.ContainerType._visit(e,{list:t=>st.V14.types.ContainerType.list(Vte(t)),optional:t=>st.V14.types.ContainerType.optional(Vte(t)),set:t=>st.V14.types.ContainerType.set(Vte(t)),map:({keyType:t,valueType:r})=>st.V14.types.ContainerType.map({keyType:Vte(t),valueType:Vte(r)}),literal:st.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function SLz(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:DLz(e.shape)}}function DLz(e){return st.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:Vte(t.type)}),noProperties:st.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function CLz(e){return st.V15.types.ResolvedTypeReference._visit(e,{container:t=>st.V14.types.ResolvedTypeReference.container(Yww(t)),named:st.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?st.V14.types.ResolvedTypeReference.primitive(st.V14.types.PrimitiveType.String):st.V14.types.ResolvedTypeReference.primitive(t),unknown:st.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function ILz(e){return{members:e.members.map(t=>({...t,type:Vte(t.type)}))}}function MLz(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>Xww(t)),headers:e.headers.map(t=>zip(t)),endpoints:e.endpoints.map(t=>BLz(t))}}function Xww(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Vte(e.valueType)}}function BLz(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>Xww(t)),sdkRequest:e.sdkRequest!=null?qLz(e.sdkRequest):void 0,requestBody:e.requestBody!=null?NLz(e.requestBody):void 0,response:e.response!=null?Fip(e.response):void 0,headers:e.headers.map(t=>zip(t)),queryParameters:e.queryParameters.map(t=>TLz(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?xip(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?FLz(e.sdkResponse):void 0}}function TLz(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Vte(e.valueType),allowMultiple:e.allowMultiple}}function qLz(e){return{requestParameterName:e.requestParameterName,shape:RLz(e.shape)}}function RLz(e){return st.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:Vte(t.requestBodyType)}),wrapper:st.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function NLz(e){return st.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:Vte(r.valueType)}))}),reference:t=>st.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:Vte(t.requestBodyType)}),fileUpload:t=>st.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:Vte(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Fip(e){return{docs:e.docs,responseBodyType:Vte(e.responseBodyType)}}function xip(e){return{dataEventType:Vte(e.dataEventType),terminator:e.terminator}}function FLz(e){return st.V15.http.SdkResponse._visit(e,{streaming:t=>st.V14.http.SdkResponse.streaming(xip(t)),nonStreaming:t=>st.V14.http.SdkResponse.nonStreaming(Fip(t)),maybeStreaming:t=>st.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:Fip(t.nonStreaming),streaming:xip(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function xLz(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?Vte(e.type):void 0,statusCode:e.statusCode}}var Zww={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[ge.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[ge.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[ge.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>e.basePath!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying a base-path in api.yml. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a root base-path."):{...e,services:Pg(e.services,n=>({...n,pathParameters:Qip(n.pathParameters),endpoints:n.endpoints.map(i=>({...i,allPathParameters:Qip(i.allPathParameters),pathParameters:Qip(i.pathParameters)}))}))}};function Qip(e){return e.map(t=>zLz(t))}function zLz(e){return{...e,availability:{status:st.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var kww={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[n,i]of Object.entries(e.types))if(i.shape._type==="union"&&i.shape.extends.length>0)return t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support union types with extensions. See ${n} in file ${i.name.fernFilepath.allParts.join("/")}. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains union types with extensions.");return{...e}}};var ejw={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[ge.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[ge.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.3.0-3-ge125e311",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:Pg(e.services,n=>{let i=n.endpoints[0]?.baseUrl;return n.endpoints.some(a=>a.baseUrl!==i)?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support endpoint-level server URLs. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains endpoint-level server URLs."):{...n,baseUrl:i}})})};var rjw={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[ge.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[ge.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:"0.0.44-1-gbf4b0f3",[ge.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Pg(e.services,r=>QLz(r,t)),types:Pg(e.types,r=>GLz(r,t))})};function QLz(e,t){return{...e,endpoints:e.endpoints.map(r=>LLz(r,t))}}function LLz(e,t){return{...e,examples:e.examples.map(r=>ULz(r,t))}}function ULz(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>Lip(r,t)),servicePathParameters:e.servicePathParameters.map(r=>Lip(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>Lip(r,t)),serviceHeaders:e.serviceHeaders.map(r=>tjw(r,t)),endpointHeaders:e.endpointHeaders.map(r=>tjw(r,t)),queryParameters:e.queryParameters.map(r=>VLz(r,t)),request:e.request!=null?WLz(e.request,t):void 0,response:HLz(e.response,t)}}function Lip(e,t){return{key:e.key,value:X6e(e.value,t)}}function tjw(e,t){return{wireKey:e.wireKey,value:X6e(e.value,t)}}function VLz(e,t){return{wireKey:e.wireKey,value:X6e(e.value,t)}}function WLz(e,t){return st.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>st.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(n=>({wireKey:n.wireKey,value:X6e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),reference:r=>st.V18.http.ExampleRequestBody.reference(X6e(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function HLz(e,t){return st.V19.http.ExampleResponse._visit(e,{ok:r=>st.V18.http.ExampleResponse.ok({body:r.body!=null?X6e(r.body,t):void 0}),error:r=>st.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?X6e(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function GLz(e,t){return{...e,examples:e.examples.map(r=>JLz(r,t))}}function JLz(e,t){return{...e,shape:Uip(e.shape,t)}}function Uip(e,t){return st.V19.types.ExampleTypeShape._visit(e,{alias:r=>st.V18.types.ExampleTypeShape.alias({value:X6e(r.value,t)}),object:r=>st.V18.types.ExampleTypeShape.object({properties:r.properties.map(n=>({wireKey:n.wireKey,value:X6e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),union:r=>st.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:st.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:n=>st.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:n.jsonExample,shape:njw(n.shape,t)}),samePropertiesAsObject:n=>st.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:n.typeName,shape:Uip(n.shape,t)}),noProperties:st.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:st.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function X6e(e,t){return{jsonExample:e.jsonExample,shape:njw(e.shape,t)}}function njw(e,t){return st.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>st.V18.types.ExampleTypeReferenceShape.primitive(KLz(r,t)),named:r=>st.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:Uip(r.shape,t)}),container:r=>st.V18.types.ExampleTypeReferenceShape.container(st.V19.types.ExampleContainer._visit(r,{list:n=>st.V18.types.ExampleContainer.list(n.map(i=>X6e(i,t))),set:n=>st.V18.types.ExampleContainer.set(n.map(i=>X6e(i,t))),optional:n=>st.V18.types.ExampleContainer.optional(n!=null?X6e(n,t):void 0),map:n=>st.V18.types.ExampleContainer.map(n.map(i=>({key:X6e(i.key,t),value:X6e(i.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:st.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function KLz(e,{taskContext:t,targetGenerator:r}){return e.type==="date"?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support examples for dates. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains date examples."):e}var ijw={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[ge.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.26-rc0-3-gdfabd674",[ge.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[ge.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[ge.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[ge.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[ge.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:"0.0.0",[ge.GO_SDK]:"0.0.0",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Pg(e.services,r=>$Lz(r,t))})};function $Lz(e,t){return{...e,endpoints:e.endpoints.map(r=>YLz(r,t))}}function YLz(e,t){return{...e,response:e.response!=null?ajw(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?XLz(e.sdkResponse,t):void 0}}function ajw(e,t){return st.V20.http.HttpResponse._visit(e,{fileDownload:()=>ojw(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function XLz(e,t){return st.V20.http.SdkResponse._visit(e,{fileDownload:()=>ojw(t),streaming:st.V19.http.SdkResponse.streaming,maybeStreaming:r=>st.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:ajw(r.nonStreaming,t)}),json:st.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function ojw({targetGenerator:e,taskContext:t}){return t.failAndThrow(e!=null?`Generator ${e.name}@${e.version} does not support file download. If you'd like to use this feature, please upgrade ${e.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains file download.")}var ujw={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Pg(e.services,r=>ZLz(r,t))})};function ZLz(e,t){return{...e,endpoints:e.endpoints.map(r=>kLz(r,t))}}function kLz(e,t){return{...e,streamingResponse:e.streamingResponse!=null?Vip(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?eUz(e.sdkResponse,t):void 0}}function Vip(e,{taskContext:t,targetGenerator:r}){return{dataEventType:st.V21.http.StreamingResponseChunkType._visit(e.dataEventType,{json:n=>n,text:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming text responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains streaming text responses."),_unknown:()=>{throw new Error("Unknown StreamingResponseChunkType: "+e.dataEventType.type)}}),terminator:e.terminator}}function eUz(e,t){return st.V21.http.SdkResponse._visit(e,{fileDownload:st.V20.http.SdkResponse.fileDownload,streaming:r=>st.V20.http.SdkResponse.streaming(Vip(r,t)),maybeStreaming:r=>st.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:Vip(r.streaming,t),nonStreaming:r.nonStreaming}),json:st.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var sjw={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.5.0-3-gac7ce7c",[ge.GO_MODEL]:"0.0.14-8-g2fa39f7",[ge.GO_SDK]:"0.0.14-8-g2fa39f7",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:Pg(e.services,t=>tUz(t))})};function tUz(e){return{...e,endpoints:e.endpoints.map(t=>rUz(t))}}function rUz(e){return{...e,...e.response!=null?st.V22.http.HttpResponse._visit(e.response,{json:t=>({response:st.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:st.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:st.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:st.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:st.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var fjw={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[ge.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.7.4-rc3-4-g6cf92f81",[ge.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:"0.0.28-3-g112d3dd",[ge.STOPLIGHT]:"0.0.28-3-g112d3dd",[ge.POSTMAN]:"0.0.44-4-gddab2ae",[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],n={};for(let[i,a]of Object.entries(e.services)){let o=[];for(let c of a.endpoints){let d=nUz(c);d==null?r.push(c):o.push(d)}n[i]={...a,endpoints:o,headers:a.headers.map(c=>Hip(c)),pathParameters:a.pathParameters.map(c=>Kpc(c))}}return r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(i=>i.name.originalName).join(", ")} will be skipped.`)),{...e,auth:{...e.auth,schemes:e.auth.schemes.map(i=>aUz(i))},headers:e.headers.map(i=>Hip(i)),types:Pg(e.types,i=>oUz(i)),services:n,errors:Pg(e.errors,i=>dUz(i)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(i=>Kpc(i)),variables:e.variables.map(i=>pUz(i))}}};function nUz(e){let t;if(!(e.requestBody!=null&&(t=iUz(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>Hip(r)),pathParameters:e.pathParameters.map(r=>Kpc(r)),allPathParameters:e.allPathParameters.map(r=>Kpc(r)),queryParameters:e.queryParameters.map(r=>_Uz(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:hUz(e.sdkRequest.shape)}:void 0,response:e.response!=null?yUz(e.response):void 0,examples:e.examples.map(r=>vUz(r))}}function iUz(e){switch(e.type){case"bytes":return;case"fileUpload":return st.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>gUz(t))});case"inlinedRequestBody":return st.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>mUz(t))});case"reference":return st.V22.http.HttpRequestBody.reference({...e,requestBodyType:Wte(e.requestBodyType)});default:ks(e)}}function Hip(e){return{...e,valueType:Wte(e.valueType)}}function aUz(e){return e._visit({bearer:st.V22.auth.AuthScheme.bearer,basic:st.V22.auth.AuthScheme.basic,header:t=>st.V22.auth.AuthScheme.header({...t,valueType:Wte(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function oUz(e){return{...e,shape:uUz(e.shape),examples:e.examples.map(t=>sUz(t))}}function uUz(e){return e._visit({alias:t=>st.V22.types.Type.alias({...t,aliasOf:Wte(t.aliasOf),resolvedType:lUz(t.resolvedType)}),enum:st.V22.types.Type.enum,object:t=>st.V22.types.Type.object({...t,properties:t.properties.map(r=>cjw(r))}),union:t=>st.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>cjw(r)),types:t.types.map(r=>({...r,shape:fUz(r.shape)}))}),undiscriminatedUnion:t=>st.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:Wte(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function sUz(e){return{...e,shape:Gip(e.shape)}}function Gip(e){return e._visit({alias:t=>st.V22.types.ExampleTypeShape.alias({...t,value:yut(t.value)}),enum:st.V22.types.ExampleTypeShape.enum,object:t=>st.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:yut(r.value)}))}),union:t=>st.V22.types.ExampleTypeShape.union({...t,properties:cUz(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function yut(e){return{...e,shape:Jip(e.shape)}}function Jip(e){return e._visit({primitive:t=>st.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:st.V22.types.ExamplePrimitive.integer,double:st.V22.types.ExamplePrimitive.double,string:st.V22.types.ExamplePrimitive.string,boolean:st.V22.types.ExamplePrimitive.boolean,long:st.V22.types.ExamplePrimitive.long,datetime:r=>st.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:st.V22.types.ExamplePrimitive.date,uuid:st.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>st.V22.types.ExampleTypeReferenceShape.named({...t,shape:Gip(t.shape)}),container:t=>st.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>st.V22.types.ExampleContainer.list(r.map(n=>yut(n))),set:r=>st.V22.types.ExampleContainer.set(r.map(n=>yut(n))),optional:r=>st.V22.types.ExampleContainer.optional(r!=null?yut(r):void 0),map:r=>st.V22.types.ExampleContainer.map(r.map(n=>({key:yut(n.key),value:yut(n.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:st.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function cUz(e){return e._visit({singleProperty:t=>st.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:Jip(t.shape)}),noProperties:st.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>st.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:Gip(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function Wte(e){return e._visit({container:t=>st.V22.types.TypeReference.container(djw(t)),primitive:st.V22.types.TypeReference.primitive,named:st.V22.types.TypeReference.named,unknown:st.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function djw(e){return e._visit({list:t=>st.V22.types.ContainerType.list(Wte(t)),set:t=>st.V22.types.ContainerType.set(Wte(t)),optional:t=>st.V22.types.ContainerType.optional(Wte(t)),map:t=>st.V22.types.ContainerType.map({keyType:Wte(t.keyType),valueType:Wte(t.valueType)}),literal:st.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function lUz(e){return e._visit({container:t=>st.V22.types.ResolvedTypeReference.container(djw(t)),primitive:st.V22.types.ResolvedTypeReference.primitive,named:st.V22.types.ResolvedTypeReference.named,unknown:st.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function cjw(e){return{...e,valueType:Wte(e.valueType)}}function fUz(e){return e._visit({noProperties:st.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>st.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:Wte(t.type)}),samePropertiesAsObject:st.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function dUz(e){return{...e,type:e.type!=null?Wte(e.type):void 0}}function pUz(e){return{...e,type:Wte(e.type)}}function Kpc(e){return{...e,valueType:Wte(e.valueType)}}function _Uz(e){return{...e,valueType:Wte(e.valueType)}}function hUz(e){return e._visit({justRequestBody:t=>st.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:Wte(t.requestBodyType)}),wrapper:st.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function yUz(e){return e._visit({json:t=>st.V22.http.HttpResponse.json({...t,responseBodyType:Wte(t.responseBodyType)}),fileDownload:st.V22.http.HttpResponse.fileDownload,streaming:t=>st.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>st.V22.http.StreamingResponseChunkType.json(Wte(r)),text:st.V22.http.StreamingResponseChunkType.text,_other:()=>{throw new Error("Unknown streaming data event type: "+t.dataEventType.type)}})}),_other:()=>{throw new Error("Unknown response: "+e.type)}})}function vUz(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>Wip(t)),servicePathParameters:e.servicePathParameters.map(t=>Wip(t)),endpointPathParameters:e.endpointPathParameters.map(t=>Wip(t)),serviceHeaders:e.serviceHeaders.map(t=>ljw(t)),endpointHeaders:e.endpointHeaders.map(t=>ljw(t)),queryParameters:e.queryParameters.map(t=>bUz(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>st.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:yut(r.value)}))}),reference:t=>st.V22.http.ExampleRequestBody.reference({...t,shape:Jip(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>st.V22.http.ExampleResponse.ok({...t,body:t.body!=null?yut(t.body):void 0}),error:t=>st.V22.http.ExampleResponse.error({...t,body:t.body!=null?yut(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function Wip(e){return{...e,value:yut(e.value)}}function bUz(e){return{...e,value:yut(e.value)}}function ljw(e){return{...e,value:yut(e.value)}}function gUz(e){return e._visit({file:st.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>st.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:Wte(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function mUz(e){return{...e,valueType:Wte(e.valueType)}}var Cm={};pf(Cm,{V23:()=>tK5,V24:()=>rK5,V25:()=>nK5,V26:()=>iK5,V27:()=>aK5,V28:()=>oK5,V29:()=>uK5,V30:()=>sK5,V31:()=>cK5,V32:()=>lK5,V33:()=>fK5,V34:()=>dK5,V35:()=>pK5,V36:()=>_K5,V37:()=>hK5,V38:()=>yK5,V39:()=>vK5,V40:()=>bK5,V41:()=>gK5,V42:()=>mK5,V43:()=>OK5,V44:()=>AK5,V45:()=>PK5,V46:()=>wK5,V47:()=>jK5,V48:()=>EK5,V49:()=>SK5,V50:()=>DK5,V51:()=>CK5,V52:()=>IK5,V53:()=>MK5,V54:()=>BK5,V55:()=>TK5,V56:()=>qK5,V57:()=>RK5,V58:()=>NK5,V59:()=>FK5,V60:()=>xK5,V61:()=>F0});var tK5=pa(Lc(),1),rK5=pa(fc(),1),nK5=pa(tc(),1),iK5=pa(Gs(),1),aK5=pa(Rs(),1),oK5=pa(Ns(),1),uK5=pa(Fs(),1),sK5=pa(Ss(),1),cK5=pa(ws(),1),lK5=pa(ss(),1),fK5=pa(Ou(),1),dK5=pa(_u(),1),pK5=pa(eu(),1),_K5=pa(tu(),1),hK5=pa(Xo(),1),yK5=pa(Jo(),1),vK5=pa(Po(),1),bK5=pa(wo(),1),gK5=pa(go(),1),mK5=pa(_o(),1),OK5=pa(po(),1),AK5=pa(lo(),1),PK5=pa(io(),1),wK5=pa(Xa(),1),jK5=pa(Ya(),1),EK5=pa(Ja(),1),SK5=pa(Va(),1),DK5=pa(xa(),1),CK5=pa(Ma(),1),IK5=pa(Ea(),1),MK5=pa(Rn(),1),BK5=pa(tj(),1),TK5=pa(Bw(),1),qK5=pa(Tw(),1),RK5=pa(ow(),1),NK5=pa(uw(),1),FK5=pa(sw(),1),xK5=pa(DP(),1);var EVE={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var SVE={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.4.9-1-ge0997b3",[ge.JAVA_SDK]:"0.4.9-1-ge0997b3",[ge.JAVA_SPRING]:"0.4.9-1-ge0997b3",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],n=[],i={};for(let[a,o]of Object.entries(e.services)){let c=[];for(let d of o.endpoints){let s;if(d.sdkRequest!=null&&(s=zK5(d.sdkRequest),s==null)){r.push(d);continue}if(d.response!=null){let u=d.response._visit({fileDownload:l=>st.V24.HttpResponse.fileDownload(l),json:l=>st.V24.HttpResponse.json(l),streaming:l=>st.V24.HttpResponse.streaming(l),text:()=>(n.push(d),st.V24.HttpResponse.json({docs:void 0,responseBodyType:st.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});c.push({...d,sdkRequest:s,response:u})}else c.push({...d,sdkRequest:s,response:void 0})}i[a]={...o,endpoints:c}}return n.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support text/plain responses. `),n.length===1&&n[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${n[0].name.originalName} response type will be casted to unknown.`):t.taskContext.logger.warn(`Therefore, endpoints ${n.map(a=>a.name.originalName).join(", ")} response types will be casted to unknown.`)),r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(a=>a.name.originalName).join(", ")} will be skipped.`)),{...e,services:i}}};function zK5(e){let t=e.shape;if(t.type==="wrapper")return{shape:st.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:st.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var CVE={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[ge.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,WK5(r)])),headers:e.headers.map(t=>aOl(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(n=>QK5(n))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,LK5(r)]))})};function QK5(e){return{...e,headers:e.headers.map(t=>aOl(t)),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function LK5(e){return{...e,endpoints:e.endpoints.map(t=>UK5(t)),headers:e.headers.map(t=>aOl(t)),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function UK5(e){return{...e,headers:e.headers.map(t=>aOl(t)),queryParameters:e.queryParameters.map(t=>VK5(t)),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function aOl(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function VK5(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function WK5(e){return{...e,shape:e.shape._visit({union:t=>st.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>DVE(r))}),object:t=>st.V25.Type.object({...t,properties:t.properties.map(r=>DVE(r))}),enum:t=>st.V25.Type.enum({...t,values:t.values.map(r=>HK5(r))}),alias:t=>st.V25.Type.alias(t),undiscriminatedUnion:t=>st.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function DVE(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function HK5(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var IVE={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.6.1-3-g94ee67a",[ge.GO_MODEL]:"0.6.1-3-g94ee67a",[ge.GO_SDK]:"0.6.1-3-g94ee67a",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,GK5(r)]))})};function GK5(e){return{...e,endpoints:e.endpoints.map(t=>JK5(t))}}function JK5(e){return{...e,response:e.response!=null?KK5(e.response):void 0}}function KK5(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?st.V26.HttpResponse.json(t):st.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var MVE={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[ge.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.8.1-1-g0f40bf18",[ge.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.9.0-2-g6b0be0e",[ge.GO_MODEL]:"0.9.0-2-g6b0be0e",[ge.GO_SDK]:"0.9.0-2-g6b0be0e",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:P$5(e.auth),headers:uOl(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,D$5(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,i$5(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,ZK5(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,XK5(r)])),pathParameters:oOl(e.pathParameters),variables:$K5(e.variables)})};function $K5(e){return e.map(t=>YK5(t))}function YK5(e){return{...e,type:ZZ(e.type)}}function XK5(e){return{...e,type:e.type!=null?ZZ(e.type):void 0}}function ZK5(e){return e.map(t=>kK5(t))}function kK5(e){return{...e,headers:uOl(e.headers),payload:e$5(e.payload)}}function e$5(e){switch(e.type){case"inlinedPayload":return st.V27.WebhookPayload.inlinedPayload(t$5(e));case"reference":return st.V27.WebhookPayload.reference({...e,payloadType:ZZ(e.payloadType)})}}function t$5(e){return{...e,properties:r$5(e.properties)}}function r$5(e){return e.map(t=>n$5(t))}function n$5(e){return{...e,valueType:ZZ(e.valueType)}}function i$5(e){return{...e,endpoints:a$5(e.endpoints),headers:uOl(e.headers),pathParameters:oOl(e.pathParameters)}}function a$5(e){return e.map(t=>o$5(t))}function o$5(e){return{...e,headers:uOl(e.headers),pathParameters:oOl(e.pathParameters),allPathParameters:oOl(e.allPathParameters),queryParameters:O$5(e.queryParameters),requestBody:e.requestBody!=null?_$5(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?f$5(e.sdkRequest):void 0,response:e.response!=null?u$5(e.response):void 0}}function u$5(e){switch(e.type){case"json":return st.V27.HttpResponse.json(l$5(e.value));case"fileDownload":return st.V27.HttpResponse.fileDownload(e);case"text":return st.V27.HttpResponse.text(e);case"streaming":return st.V27.HttpResponse.streaming(s$5(e));default:ks(e)}}function s$5(e){return{...e,dataEventType:c$5(e.dataEventType)}}function c$5(e){switch(e.type){case"json":return st.V27.StreamingResponseChunkType.json(ZZ(e.json));case"text":return st.V27.StreamingResponseChunkType.text();default:ks(e)}}function l$5(e){switch(e.type){case"response":return st.V27.JsonResponse.response({...e,responseBodyType:ZZ(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:ZZ(e.responseBodyType),responseProperty:e.responseProperty!=null?RVE(e.responseProperty):void 0});default:ks(e)}}function f$5(e){return{...e,shape:d$5(e.shape)}}function d$5(e){switch(e.type){case"justRequestBody":return st.V27.SdkRequestShape.justRequestBody(p$5(e.value));case"wrapper":return st.V27.SdkRequestShape.wrapper(e);default:ks(e)}}function p$5(e){switch(e.type){case"typeReference":return st.V27.SdkRequestBodyType.typeReference(BVE(e));case"bytes":return st.V27.SdkRequestBodyType.bytes(e);default:ks(e)}}function _$5(e){switch(e.type){case"inlinedRequestBody":return st.V27.HttpRequestBody.inlinedRequestBody(b$5(e));case"reference":return st.V27.HttpRequestBody.reference(BVE(e));case"fileUpload":return st.V27.HttpRequestBody.fileUpload(h$5(e));case"bytes":return st.V27.HttpRequestBody.bytes(e);default:ks(e)}}function h$5(e){return{...e,properties:y$5(e.properties)}}function y$5(e){return e.map(t=>v$5(t))}function v$5(e){switch(e.type){case"file":return st.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return st.V27.FileUploadRequestProperty.bodyProperty(TVE(e));default:ks(e)}}function BVE(e){return{...e,requestBodyType:ZZ(e.requestBodyType)}}function b$5(e){return{...e,properties:g$5(e.properties)}}function g$5(e){return e.map(t=>TVE(t))}function TVE(e){return{...e,valueType:ZZ(e.valueType)}}function oOl(e){return e.map(t=>m$5(t))}function m$5(e){return{...e,valueType:ZZ(e.valueType)}}function O$5(e){return e.map(t=>A$5(t))}function A$5(e){return{...e,valueType:ZZ(e.valueType)}}function P$5(e){return{...e,schemes:w$5(e.schemes)}}function w$5(e){return e.map(t=>j$5(t))}function j$5(e){switch(e.type){case"basic":return st.V27.AuthScheme.basic(e);case"bearer":return st.V27.AuthScheme.bearer(e);case"header":return E$5(e);default:ks(e)}}function E$5(e){return st.V27.AuthScheme.header({...e,valueType:ZZ(e.valueType)})}function uOl(e){return e.map(t=>S$5(t))}function S$5(e){return{...e,valueType:ZZ(e.valueType)}}function D$5(e){return{...e,shape:C$5(e.shape)}}function C$5(e){switch(e.type){case"alias":return st.V27.Type.alias(I$5(e));case"enum":return st.V27.Type.enum(e);case"object":return st.V27.Type.object(M$5(e));case"union":return st.V27.Type.union(B$5(e));case"undiscriminatedUnion":return st.V27.Type.undiscriminatedUnion(T$5(e));default:ks(e)}}function I$5(e){return{aliasOf:ZZ(e.aliasOf),resolvedType:F$5(e.resolvedType)}}function M$5(e){return{...e,properties:qVE(e.properties)}}function B$5(e){return{...e,types:q$5(e.types),baseProperties:qVE(e.baseProperties)}}function T$5(e){return{members:N$5(e.members)}}function qVE(e){return e.map(t=>RVE(t))}function RVE(e){return{...e,valueType:ZZ(e.valueType)}}function q$5(e){return e.map(t=>({...t,shape:R$5(t.shape)}))}function R$5(e){switch(e.propertiesType){case"samePropertiesAsObject":return st.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return st.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:ZZ(e.type)});case"noProperties":return st.V27.SingleUnionTypeProperties.noProperties();default:ks(e)}}function N$5(e){return e.map(t=>({...t,type:ZZ(t.type)}))}function F$5(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?st.V27.ResolvedTypeReference.primitive(st.V27.PrimitiveType.Boolean):st.V27.ResolvedTypeReference.container(st.V27.ContainerType.literal(st.V27.Literal.string(e.container.literal.string))):st.V27.ResolvedTypeReference.container(NVE(e.container));case"named":return st.V27.ResolvedTypeReference.named(e);case"primitive":return st.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return st.V27.ResolvedTypeReference.unknown();default:ks(e)}}function ZZ(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?st.V27.TypeReference.primitive(st.V27.PrimitiveType.Boolean):st.V27.TypeReference.container(st.V27.ContainerType.literal(st.V27.Literal.string(e.container.literal.string))):st.V27.TypeReference.container(NVE(e.container));case"named":return st.V27.TypeReference.named(e);case"primitive":return st.V27.TypeReference.primitive(e.primitive);case"unknown":return st.V27.TypeReference.unknown();default:ks(e)}}function NVE(e){switch(e.type){case"list":return st.V27.ContainerType.list(ZZ(e.list));case"map":return st.V27.ContainerType.map({keyType:ZZ(e.keyType),valueType:ZZ(e.valueType)});case"optional":return st.V27.ContainerType.optional(ZZ(e.optional));case"set":return st.V27.ContainerType.set(ZZ(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return st.V27.ContainerType.literal(st.V27.Literal.string(e.literal.string));default:ks(e)}}var xVE={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[ge.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.8.6-1-g3d8d8591",[ge.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[ge.JAVA_SDK]:"0.5.14-1-ge4bcd98",[ge.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,x$5({typeId:t,allTypes:e.types})]))})};function x$5({typeId:e,allTypes:t}){let r=FVE({typeId:e,allTypes:t});return{availability:r.availability,docs:r.docs,name:r.name,shape:r.shape,examples:r.examples,referencedTypes:Array.from(r.referencedTypes).map(n=>{let i=FVE({typeId:n,allTypes:t});return{typeId:n,fernFilepath:i.name.fernFilepath,name:i.name.name}})}}function FVE({typeId:e,allTypes:t}){let r=t[e];if(r==null)throw new Error(`Type definition for type id ${e} is undefined`);return r}var zVE={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[ge.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new JL_(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},JL_=class{ir;constructor(t){this.ir=t}convertTypes(t){return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,this.convertType(n)]))}convertServices(t){return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,this.convertService(n)]))}convertService(t){return{...t,endpoints:this.convertEndpoints(t.endpoints)}}convertEndpoints(t){return t.map(r=>({...r,examples:this.convertExampleEndpointCalls(r.examples)}))}convertExampleEndpointCalls(t){return t.map(r=>({...r,rootPathParameters:this.convertExamplePathParameters(r.rootPathParameters),servicePathParameters:this.convertExamplePathParameters(r.servicePathParameters),endpointPathParameters:this.convertExamplePathParameters(r.endpointPathParameters),serviceHeaders:this.convertExampleHeaders(r.serviceHeaders),endpointHeaders:this.convertExampleHeaders(r.endpointHeaders),queryParameters:this.convertExampleQueryParameters(r.queryParameters),request:r.request!=null?this.convertExampleRequestBody(r.request):void 0,response:this.convertExampleResponse(r.response)}))}convertExamplePathParameters(t){return t.map(r=>({key:r.name.originalName,value:this.convertExampleTypeReference(r.value)}))}convertExampleHeaders(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleQueryParameters(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleRequestBody(t){switch(t.type){case"inlinedRequestBody":return st.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return st.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:ks(t)}}convertExampleResponse(t){switch(t.type){case"ok":return st.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return st.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:ks(t)}}convertType(t){return{...t,examples:this.convertExampleTypes(t.examples)}}convertExampleTypes(t){return t.map(r=>this.convertExampleType(r))}convertExampleType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeReferences(t){return t.map(r=>this.convertExampleTypeReference(r))}convertExampleTypeReference(t){return{...t,shape:this.convertExampleTypeReferenceShape(t.shape)}}convertExampleTypeReferenceShape(t){switch(t.type){case"primitive":return st.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return st.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return st.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return st.V29.ExampleTypeReferenceShape.unknown(t);default:ks(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return st.V29.ExamplePrimitive.integer(t.integer);case"double":return st.V29.ExamplePrimitive.double(t.double);case"string":return st.V29.ExamplePrimitive.string(t.string.original);case"boolean":return st.V29.ExamplePrimitive.boolean(t.boolean);case"long":return st.V29.ExamplePrimitive.long(t.long);case"datetime":return st.V29.ExamplePrimitive.datetime(t.datetime);case"date":return st.V29.ExamplePrimitive.date(t.date);case"uuid":return st.V29.ExamplePrimitive.uuid(t.uuid);default:ks(t)}}convertExampleContainer(t){switch(t.type){case"list":return st.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return st.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return st.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return st.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:ks(t)}}convertKeyValuePairs(t){return t.map(r=>({key:this.convertExampleTypeReference(r.key),value:this.convertExampleTypeReference(r.value)}))}convertExampleNamedType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeShape(t){switch(t.type){case"alias":return st.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return st.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return st.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return st.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:ks(t)}}convertExampleObjectType(t){return{properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}}convertExampleUnionType(t){return{wireDiscriminantValue:t.singleUnionType.wireDiscriminantValue.wireValue,properties:this.convertExampleSingleUnionTypeProperties(t.singleUnionType.shape)}}convertExampleSingleUnionTypeProperties(t){switch(t.type){case"samePropertiesAsObject":{let r=this.ir.types[t.typeId]?.name;if(r==null)throw new Error(`Internal error; type ID ${t.typeId} does not exist in the IR`);return st.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(st.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return st.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return st.V29.ExampleSingleUnionTypeProperties.noProperties();default:ks(t)}}};var QVE={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.8.8",[ge.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.8.8",[ge.TYPESCRIPT_EXPRESS]:"0.8.8",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.7.0-rc0",[ge.JAVA_SDK]:"0.7.0-rc0",[ge.JAVA_SPRING]:"0.7.0-rc0",[ge.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[ge.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.7.5-1-gb54fb677",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V30.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({apiName:e.apiName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:e.auth,headers:e.headers,types:e.types,webhookGroups:e.webhookGroups,errors:e.errors,subpackages:e.subpackages,rootPackage:e.rootPackage,constants:e.constants,environments:e.environments,basePath:e.basePath,pathParameters:e.pathParameters,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,variables:e.variables,serviceTypeReferenceInfo:e.serviceTypeReferenceInfo,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{availability:r.availability,name:r.name,displayName:r.displayName,basePath:r.basePath,endpoints:r.endpoints.map(n=>({id:n.id,docs:n.docs,availability:n.availability,name:n.name,displayName:n.displayName,method:n.method,headers:n.headers,baseUrl:n.baseUrl,path:n.path,fullPath:n.fullPath,pathParameters:n.pathParameters,allPathParameters:n.allPathParameters,queryParameters:n.queryParameters,requestBody:n.requestBody,sdkRequest:n.sdkRequest,response:n.response,errors:n.errors,auth:n.auth,examples:n.examples})),headers:r.headers,pathParameters:r.pathParameters}]))})};var UVE={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.9.4-2-g139cf36",[ge.GO_MODEL]:"0.9.4-2-g139cf36",[ge.GO_SDK]:"0.9.4-2-g139cf36",[ge.RUBY_MODEL]:"0.0.0",[ge.RUBY_SDK]:"0.0.0",[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:W$5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(z$5)}]))})};function IQa({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function z$5(e){return{...e,examples:IQa({examples:e.examples,convert:Q$5})}}function Q$5(e){let t;if(e.request!=null&&(t=L$5(e.request),t==null))return;let r=U$5(e.response);if(r!=null)return{...e,rootPathParameters:IQa({examples:e.rootPathParameters,convert:KL_}),endpointPathParameters:IQa({examples:e.endpointPathParameters,convert:KL_}),servicePathParameters:IQa({examples:e.servicePathParameters,convert:KL_}),endpointHeaders:IQa({examples:e.endpointHeaders,convert:LVE}),serviceHeaders:IQa({examples:e.serviceHeaders,convert:LVE}),queryParameters:IQa({examples:e.queryParameters,convert:V$5}),request:t,response:r}}function L$5(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let n=Wke(r.value);n!=null&&t.push({...r,value:n})}return st.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=$L_(e.shape);return t==null?void 0:st.V31.ExampleRequestBody.reference({...e,shape:t})}default:ks(e)}}function U$5(e){switch(e.type){case"ok":{if(e.body==null)return st.V31.ExampleResponse.ok({body:void 0});let t=Wke(e.body);return t==null?void 0:st.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return st.V31.ExampleResponse.error({...e,body:void 0});let t=Wke(e.body);return t==null?void 0:st.V31.ExampleResponse.error({...e,body:t})}}}function KL_(e){let t=Wke(e.value);if(t!=null)return{...e,value:t}}function LVE(e){let t=Wke(e.value);if(t!=null)return{...e,value:t}}function V$5(e){let t=Wke(e.value);if(t!=null)return{...e,value:t}}function W$5(e){let t=[];for(let r of e){let n=H$5(r);n!=null&&t.push(n)}return t}function H$5(e){let t=VVE(e.shape);if(t!=null)return{...e,shape:t}}function VVE(e){switch(e.type){case"enum":return st.V31.ExampleTypeShape.enum(e);case"alias":{let t=Wke(e.value);return t==null?void 0:st.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let n=Wke(r.value);n!=null&&t.push({...r,value:n})}return st.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=G$5(e.singleUnionType);return t==null?void 0:st.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:ks(e)}}function Wke(e){let t=$L_(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function G$5(e){let t=J$5(e.shape);if(t!=null)return{...e,shape:t}}function J$5(e){switch(e.type){case"noProperties":return st.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=$L_(e.shape);return t==null?void 0:st.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let n=Wke(r.value);n!=null&&t.push({...r,value:n})}return st.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:ks(e)}}function $L_(e){switch(e.type){case"container":{let t=K$5(e.container);return t==null?void 0:st.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=VVE(e.shape);return t==null?void 0:st.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return st.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return st.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:ks(e)}}function K$5(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let n=Wke(r);n!=null&&t.push(n)}return st.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let n=Wke(r);n!=null&&t.push(n)}return st.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let n=Wke(r.key),i=Wke(r.value);n!=null&&i!=null&&t.push({key:n,value:i})}return st.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return st.V31.ExampleContainer.optional();let t=Wke(e.optional);return t==null?st.V31.ExampleContainer.optional():st.V31.ExampleContainer.optional(t)}default:ks(e)}}var WVE={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.12.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.12.0",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.13.0-3-g8c56a41",[ge.GO_MODEL]:"0.13.0-3-g8c56a41",[ge.GO_SDK]:"0.13.0-3-g8c56a41",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:"0.0.0",[ge.CSHARP_SDK]:"0.0.0",[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new YL_(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>t.convertEndpoint(i))}]))}}},YL_=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:st.V33.TypeReference.container(st.V33.ContainerType.optional(st.V33.TypeReference.primitive("STRING")))}:r),examples:$$5({examples:t.examples,convert:Y$5})}}isTypeReferenceObject(t){switch(t.type){case"container":return this.isContainerObject(t.container);case"named":return this.isNamedTypeObject(t);case"primitive":return!1;case"unknown":return!0;default:ks(t)}}isContainerObject(t){switch(t.type){case"map":case"list":case"set":return!0;case"optional":return this.isTypeReferenceObject(t.optional);case"literal":return!1;default:ks(t)}}isNamedTypeObject(t){let r=this.ir.types[t.typeId];if(r==null)return!0;switch(r.shape.type){case"alias":return this.isTypeReferenceObject(r.shape.aliasOf);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:ks(r.shape)}}};function $$5({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function Y$5(e){return{...e,queryParameters:e.queryParameters.filter(t=>!XL_(t.value))}}function XL_(e){switch(e.shape.type){case"container":return X$5(e.shape.container);case"named":return Z$5(e.shape);case"primitive":return!1;case"unknown":return!0;default:ks(e.shape)}}function X$5(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&XL_(e.optional);default:ks(e)}}function Z$5(e){switch(e.shape.type){case"alias":return XL_(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:ks(e.shape)}}var rNo=pa(UPd(),1);var HVE={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.10.4",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V33.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,requestBody:i.requestBody?._visit({inlinedRequestBody:a=>rNo.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>rNo.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>rNo.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(o=>(o.type==="file"&&o.value.type==="fileArray"&&t.taskContext.logger.warn(`${i.method} ${i.fullPath.head} accepts a list of files however the ${t.targetGenerator?.name}@${t.targetGenerator?.version} only supports accepting a single file. File an [issue](https://github.com/fern-api/fern/issues) to add request for file arrays in ${t.targetGenerator?.name}@${t.targetGenerator?.version}!`),o.type==="file"?rNo.FernIrV33.FileUploadRequestProperty.file({...o.value}):o))}),bytes:a=>rNo.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var GVE={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.18.0",[ge.GO_MODEL]:"0.18.0",[ge.GO_SDK]:"0.18.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V34.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>({docs:n.docs,availability:n.availability,id:n.id,name:n.name,displayName:n.displayName,method:n.method,headers:n.headers,baseUrl:n.baseUrl,path:n.path,fullPath:n.fullPath,pathParameters:n.pathParameters,allPathParameters:n.allPathParameters,queryParameters:n.queryParameters,requestBody:n.requestBody,sdkRequest:n.sdkRequest,response:n.response,errors:n.errors,auth:n.auth,idempotent:n.idempotent,examples:n.examples}))}]))})};var JVE={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.11.6",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var KVE={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.13.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.13.0",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.12.0",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V36.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,examples:i.examples.filter(a=>a.exampleType==="userProvided")}))}]))})};var $VE={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.15.0-rc0",[ge.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.9.0-rc0",[ge.PYTHON_PYDANTIC]:"0.9.0-rc0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"1.2.0-rc0",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V37.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,response:i.response?._visit({fileDownload:a=>st.V37.HttpResponse.fileDownload(a),json:a=>st.V37.HttpResponse.json(a),streaming:a=>a._visit({json:o=>st.V37.HttpResponse.streaming({dataEventType:st.V37.StreamingResponseChunkType.json(o.payload),docs:o.docs,terminator:o.terminator}),sse:()=>{},text:o=>st.V37.HttpResponse.streaming({dataEventType:st.V37.StreamingResponseChunkType.text(),docs:o.docs,terminator:void 0}),_other:()=>{}}),text:a=>st.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var YVE={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.9.0-rc1",[ge.PYTHON_PYDANTIC]:"0.9.0-rc1",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"1.4.0-rc1",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:"0.7.0-rc0",[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>k$5(r))}})};function k$5(e){switch(e.type){case"basic":return st.V38.AuthScheme.basic(e);case"bearer":return st.V38.AuthScheme.bearer(e);case"header":return st.V38.AuthScheme.header(e);case"oauth":return st.V38.AuthScheme.bearer({docs:e.docs,token:{originalName:"token",camelCase:{unsafeName:"token",safeName:"token"},pascalCase:{unsafeName:"Token",safeName:"Token"},snakeCase:{unsafeName:"token",safeName:"token"},screamingSnakeCase:{unsafeName:"TOKEN",safeName:"TOKEN"}},tokenEnvVar:void 0});default:ks(e)}}var XVE={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.20.0",[ge.GO_MODEL]:"0.20.0",[ge.GO_SDK]:"0.20.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var ZVE={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V40.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,errors:Object.fromEntries(Object.entries(e.errors).map(([r,n])=>[r,{name:n.name,discriminantValue:n.discriminantValue,type:n.type,statusCode:n.statusCode,docs:n.docs}]))})};var kVE={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.8.0-rc0",[ge.JAVA_SDK]:"0.9.0-rc0",[ge.JAVA_SPRING]:"0.8.0-rc0",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>eY5(r))}})};function eY5(e){switch(e.type){case"basic":return st.V41.AuthScheme.basic(e);case"bearer":return st.V41.AuthScheme.bearer(e);case"header":return st.V41.AuthScheme.header(e);case"oauth":return st.V41.AuthScheme.oauth(tY5(e));default:ks(e)}}function tY5(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:st.V41.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:{...e.configuration.tokenEndpoint,endpointReference:e.configuration.tokenEndpoint.endpointReference.endpointId},refreshEndpoint:e.configuration.refreshEndpoint!=null?{...e.configuration.refreshEndpoint,endpointReference:e.configuration.refreshEndpoint?.endpointReference.endpointId}:void 0})};default:ks(e.configuration.type)}}var eWE={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.17.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.17.0",[ge.TYPESCRIPT_EXPRESS]:"0.13.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V42.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,response:i.response?.body}))}]))})};var rWE={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V43.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,examples:i.examples.map(a=>rY5({example:a})).filter(ij)}))}]))})};function rY5({example:e}){return e._visit({userProvided:t=>st.V43.HttpEndpointExample.userProvided(tWE({example:t})),generated:t=>st.V43.HttpEndpointExample.generated(tWE({example:t})),_other:()=>{}})}function tWE({example:e}){return{...e,response:nY5({example:e.response})}}function nY5({example:e}){switch(e.type){case"ok":return iY5({example:e.value});case"error":return st.V43.ExampleResponse.error(e);default:ks(e)}}function iY5({example:e}){switch(e.type){case"body":return st.V43.ExampleResponse.ok({body:e.value});case"sse":return st.V43.ExampleResponse.ok({body:void 0});case"stream":return st.V43.ExampleResponse.ok({body:void 0});default:ks(e)}}var nWE={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V45.types.Type._visit(r.shape,{union:n=>st.V44.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:T9(i.valueType)})),types:n.types.map(i=>yY5(i))}),enum:st.V44.types.Type.enum,object:n=>st.V44.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:T9(i.valueType)}))}),alias:n=>st.V44.types.Type.alias({aliasOf:T9(n.aliasOf),resolvedType:bY5(n.resolvedType)}),undiscriminatedUnion:n=>st.V44.types.Type.undiscriminatedUnion(gY5(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:fY5(e.auth),headers:e.headers.map(r=>nNo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>nNo(r)),types:t,services:Pg(e.services,r=>mY5(r)),errors:Pg(e.errors,r=>NY5(r)),webhookGroups:Pg(e.webhookGroups,r=>sY5(r)),websocketChannels:Pg(e.websocketChannels,r=>aY5(r)),pathParameters:e.pathParameters.map(r=>l3u(r)),variables:e.variables.map(r=>OY5(r))}}};function aY5(e){return{...e,headers:e.headers.map(t=>nNo(t)),queryParameters:e.queryParameters.map(t=>f3u(t)),pathParameters:e.pathParameters.map(t=>l3u(t)),messages:e.messages.map(t=>oY5(t))}}function oY5(e){return{...e,body:uY5(e.body)}}function uY5(e){switch(e.type){case"inlinedBody":return st.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:T9(t.valueType)}))});case"reference":return st.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:T9(e.bodyType)})}}function sY5(e){return e.map(t=>cY5(t))}function cY5(e){return{...e,headers:e.headers.map(t=>nNo(t)),payload:lY5(e.payload)}}function lY5(e){switch(e.type){case"reference":return st.V44.webhooks.WebhookPayload.reference({...e,payloadType:T9(e.payloadType)});case"inlinedPayload":return st.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:T9(t.valueType)}))})}}function fY5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V44.auth.AuthScheme.basic(t);case"bearer":return st.V44.auth.AuthScheme.bearer(t);case"header":return st.V44.auth.AuthScheme.header(dY5(t));case"oauth":return st.V44.auth.AuthScheme.oauth(pY5(t))}})}}function dY5(e){return{...e,valueType:T9(e.valueType)}}function pY5(e){return{...e,configuration:st.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:_Y5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?hY5(e.configuration.refreshEndpoint):void 0})}}function _Y5(e){return{...e,requestProperties:{clientId:sOl(e.requestProperties.clientId),clientSecret:sOl(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?sOl(e.requestProperties.scopes):void 0},responseProperties:{accessToken:_Ti(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?_Ti(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?_Ti(e.responseProperties.refreshToken):void 0}}}function hY5(e){return{...e,requestProperties:{refreshToken:sOl(e.requestProperties.refreshToken)},responseProperties:{accessToken:_Ti(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?_Ti(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?_Ti(e.responseProperties.refreshToken):void 0}}}function nNo(e){return{...e,valueType:T9(e.valueType)}}function T9(e){return st.V45.types.TypeReference._visit(e,{container:t=>st.V44.types.TypeReference.container(iWE(t)),primitive:t=>t.v1==="BIG_INTEGER"?st.V44.types.TypeReference.primitive(st.V44.types.PrimitiveType.String):st.V44.types.TypeReference.primitive(t.v1),named:st.V44.types.TypeReference.named,unknown:st.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function iWE(e){return st.V45.types.ContainerType._visit(e,{list:t=>st.V44.types.ContainerType.list(T9(t)),optional:t=>st.V44.types.ContainerType.optional(T9(t)),set:t=>st.V44.types.ContainerType.set(T9(t)),map:({keyType:t,valueType:r})=>st.V44.types.ContainerType.map({keyType:T9(t),valueType:T9(r)}),literal:st.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function yY5(e){return{...e,shape:vY5(e.shape)}}function vY5(e){return st.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:T9(t.type)}),noProperties:st.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function bY5(e){return st.V45.types.ResolvedTypeReference._visit(e,{container:t=>st.V44.types.ResolvedTypeReference.container(iWE(t)),named:st.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?st.V44.types.ResolvedTypeReference.primitive(st.V44.types.PrimitiveType.String):st.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:st.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function gY5(e){return{members:e.members.map(t=>({...t,type:T9(t.type)}))}}function mY5(e){return{...e,pathParameters:e.pathParameters.map(t=>l3u(t)),headers:e.headers.map(t=>nNo(t)),endpoints:e.endpoints.map(t=>AY5(t))}}function l3u(e){return{...e,valueType:T9(e.valueType)}}function OY5(e){return{...e,type:T9(e.type)}}function AY5(e){return{...e,pagination:e.pagination!=null?SY5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>l3u(t)),pathParameters:e.pathParameters.map(t=>l3u(t)),sdkRequest:e.sdkRequest!=null?MY5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?qY5(e.requestBody):void 0,response:e.response!=null?PY5(e.response):void 0,headers:e.headers.map(t=>nNo(t)),queryParameters:e.queryParameters.map(t=>f3u(t))}}function PY5(e){return{...e,body:e.body!=null?wY5(e.body):void 0}}function wY5(e){switch(e.type){case"json":return st.V44.http.HttpResponseBody.json(jY5(e.value));case"fileDownload":return st.V44.http.HttpResponseBody.fileDownload(e);case"text":return st.V44.http.HttpResponseBody.text(e);case"streaming":return st.V44.http.HttpResponseBody.streaming(EY5(e.value))}}function jY5(e){switch(e.type){case"response":return st.V44.http.JsonResponse.response({...e,responseBodyType:T9(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:T9(e.responseBodyType),responseProperty:e.responseProperty!=null?ZL_(e.responseProperty):void 0})}}function EY5(e){switch(e.type){case"json":return st.V44.http.StreamingResponse.json({...e,payload:T9(e.payload)});case"text":return st.V44.http.StreamingResponse.text(e);case"sse":return st.V44.http.StreamingResponse.sse({...e,payload:T9(e.payload)})}}function SY5(e){switch(e.type){case"cursor":return st.V44.http.Pagination.cursor(DY5(e));case"offset":return st.V44.http.Pagination.offset(CY5(e))}}function DY5(e){return{...e,page:f3u(e.page),next:_Ti(e.next),results:_Ti(e.results)}}function CY5(e){return{...e,page:f3u(e.page),results:_Ti(e.results)}}function sOl(e){return{...e,property:IY5(e.property)}}function IY5(e){switch(e.type){case"query":return st.V44.RequestPropertyValue.query(f3u(e));case"body":return st.V44.RequestPropertyValue.body(ZL_(e))}}function _Ti(e){return{...e,property:ZL_(e.property)}}function ZL_(e){return{...e,valueType:T9(e.valueType)}}function f3u(e){return{...e,valueType:T9(e.valueType)}}function MY5(e){return{...e,shape:BY5(e.shape)}}function BY5(e){return st.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V44.http.SdkRequestShape.justRequestBody(TY5(t)),wrapper:st.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function TY5(e){switch(e.type){case"bytes":return st.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:T9(e.requestBodyType)})}}function qY5(e){return st.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:T9(r.valueType)}))}),reference:t=>st.V44.http.HttpRequestBody.reference({...t,requestBodyType:T9(t.requestBodyType)}),fileUpload:t=>st.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:T9(r.valueType)});case"file":return st.V44.http.FileUploadRequestProperty.file(RY5(r.value))}})}),bytes:t=>st.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function RY5(e){switch(e.type){case"file":return st.V44.http.FileProperty.file(e);case"fileArray":return st.V44.http.FileProperty.fileArray(e)}}function NY5(e){return{...e,type:e.type!=null?T9(e.type):void 0}}var oWE={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.21.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.21.0",[ge.TYPESCRIPT_EXPRESS]:"0.16.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.9.0",[ge.JAVA_SDK]:"0.10.0",[ge.JAVA_SPRING]:"0.9.0",[ge.PYTHON_FASTAPI]:"0.10.1",[ge.PYTHON_PYDANTIC]:"0.9.1",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"2.9.9",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:FY5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>({...n,examples:xY5(n.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:zY5(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(n=>({...n,shape:bre(n.shape)}))}]))})};function bre(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.list(r.map(n=>bre(n)))),set:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.set(r.map(n=>bre(n)))),map:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.map(r.map(n=>({key:bre(n.key),value:bre(n.value)})))),optional:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.optional(r!=null?bre(r):void 0)),literal:r=>st.V45.ExampleTypeReferenceShape.primitive(r._visit({string:n=>st.V45.ExamplePrimitive.string(n),integer:n=>st.V45.ExamplePrimitive.integer(n),double:n=>st.V45.ExamplePrimitive.double(n),long:n=>st.V45.ExamplePrimitive.long(n),boolean:n=>st.V45.ExamplePrimitive.boolean(n),datetime:n=>st.V45.ExamplePrimitive.datetime(n),date:n=>st.V45.ExamplePrimitive.date(n),uuid:n=>st.V45.ExamplePrimitive.uuid(n),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}})}),named:t=>({...e,shape:st.V45.ExampleTypeReferenceShape.named({...t,shape:uWE(t.shape)})}),primitive:t=>({...e,shape:st.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>st.V45.ExamplePrimitive.string(r),integer:r=>st.V45.ExamplePrimitive.integer(r),double:r=>st.V45.ExamplePrimitive.double(r),long:r=>st.V45.ExamplePrimitive.long(r),boolean:r=>st.V45.ExamplePrimitive.boolean(r),datetime:r=>st.V45.ExamplePrimitive.datetime(r),date:r=>st.V45.ExamplePrimitive.date(r),uuid:r=>st.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:st.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function aWE(e){return{...e,properties:e.properties.map(t=>({...t,value:bre(t.value)}))}}function uWE(e){return e.type==="alias"?st.V45.ExampleTypeShape.alias({value:bre(e.value)}):e.type==="object"?st.V45.ExampleTypeShape.object(aWE(e)):e.type==="union"?st.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>st.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:aWE(t.object)}),singleProperty:t=>st.V45.ExampleSingleUnionTypeProperties.singleProperty(bre(t)),noProperties:()=>st.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?st.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:bre(e.singleUnionType)}):st.V45.ExampleTypeShape.enum(e)}function FY5(e){return e.map(t=>({...t,shape:uWE(t.shape)}))}function cOl(e){return e.map(t=>({...t,value:bre(t.value)}))}function kL_(e){return e.map(t=>({...t,value:bre(t.value)}))}function sWE(e){return e.map(t=>({...t,value:bre(t.value)}))}function xY5(e){return e.map(t=>{let r={...t,rootPathParameters:cOl(t.rootPathParameters),servicePathParameters:cOl(t.servicePathParameters),endpointPathParameters:cOl(t.endpointPathParameters),serviceHeaders:kL_(t.serviceHeaders),endpointHeaders:kL_(t.endpointHeaders),queryParameters:sWE(t.queryParameters),request:t.request?._visit({inlinedRequestBody:n=>st.V45.ExampleRequestBody.inlinedRequestBody({...n,properties:n.properties.map(i=>({...i,value:bre(i.value)}))}),reference:n=>st.V45.ExampleRequestBody.reference(bre(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}}),response:t.response._visit({ok:n=>st.V45.ExampleResponse.ok(n._visit({body:i=>st.V45.ExampleEndpointSuccessResponse.body(i!=null?bre(i):void 0),stream:i=>st.V45.ExampleEndpointSuccessResponse.stream(i.map(bre)),sse:i=>st.V45.ExampleEndpointSuccessResponse.sse(i.map(a=>({...a,data:bre(a.data)}))),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),error:n=>st.V45.ExampleResponse.error({...n,body:n.body!=null?bre(n.body):void 0}),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})};return t._visit({userProvided:()=>st.V45.HttpEndpointExample.userProvided(r),generated:()=>st.V45.HttpEndpointExample.generated(r),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})})}function zY5(e){return e.map(t=>({...t,pathParameters:cOl(t.pathParameters),headers:kL_(t.headers),queryParameters:sWE(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:n=>st.V45.ExampleWebSocketMessageBody.inlinedBody({...n,properties:n.properties.map(i=>({...i,value:bre(i.value)}))}),reference:n=>st.V45.ExampleWebSocketMessageBody.reference(bre(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})}))}))}var cWE={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V46.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>{let n=r.endpoints.map(i=>{let{autogeneratedExamples:a,userSpecifiedExamples:o,...c}=i;return{...c,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...i.userSpecifiedExamples.map(s=>{if(s.example!=null)return st.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(ij),...i.autogeneratedExamples.map(s=>st.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:n}]}))})};var lWE={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.29.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.29.0",[ge.TYPESCRIPT_EXPRESS]:"0.17.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V47.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,n])=>{let i=n.endpoints.map(a=>({...a,pagination:a.pagination!=null?LY5(a.pagination):void 0}));return[r,{...n,endpoints:i}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:QY5(t)},services:t}}};function QY5(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function LY5(e){switch(e.type){case"cursor":{let t=UY5(e);return t!=null?st.V47.Pagination.cursor(t):void 0}case"offset":{let t=VY5(e);return t!=null?st.V47.Pagination.offset(t):void 0}default:ks(e)}}function UY5(e){let t=fWE(e.page);if(t!=null)return{...e,page:t}}function VY5(e){if(e.step!=null)return;let t=fWE(e.page);if(t!=null)return{...e,page:t}}function fWE(e){switch(e.property.type){case"query":return e.property}}var dWE={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.11.0-rc0",[ge.PYTHON_PYDANTIC]:"0.10.0-rc0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"2.11.0-rc0",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V48.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,n])=>{let i=n.endpoints.flatMap(a=>{let o;return a.response?.body!=null&&(o=a.response.body?._visit({json:d=>st.V48.HttpResponseBody.json({...d}),fileDownload:d=>st.V48.HttpResponseBody.fileDownload({...d}),text:d=>st.V48.HttpResponseBody.text({...d}),streaming:d=>st.V48.HttpResponseBody.streaming({...d}),streamParameter:()=>{},_other:()=>{}}),o==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:o}}});return[r,{...n,endpoints:i}]}));return{...e,services:t}}};var pWE={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.34.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.34.0",[ge.TYPESCRIPT_EXPRESS]:"0.17.2",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:"0.0.0",[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V50.types.Type._visit(r.shape,{union:n=>st.V49.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:q9(i.valueType)})),types:n.types.map(i=>tX5(i))}),enum:st.V49.types.Type.enum,object:n=>st.V49.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:q9(i.valueType)}))}),alias:n=>st.V49.types.Type.alias({aliasOf:q9(n.aliasOf),resolvedType:nX5(n.resolvedType)}),undiscriminatedUnion:n=>st.V49.types.Type.undiscriminatedUnion(iX5(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:YY5(e.auth),headers:e.headers.map(r=>iNo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>iNo(r)),types:t,services:Pg(e.services,r=>aX5(r)),errors:Pg(e.errors,r=>OX5(r)),webhookGroups:Pg(e.webhookGroups,r=>JY5(r)),websocketChannels:Pg(e.websocketChannels,r=>WY5(r)),pathParameters:e.pathParameters.map(r=>d3u(r)),variables:e.variables.map(r=>oX5(r))}}};function WY5(e){return{...e,headers:e.headers.map(t=>iNo(t)),queryParameters:e.queryParameters.map(t=>tU_(t)),pathParameters:e.pathParameters.map(t=>d3u(t)),messages:e.messages.map(t=>HY5(t))}}function HY5(e){return{...e,body:GY5(e.body)}}function GY5(e){switch(e.type){case"inlinedBody":return st.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:q9(t.valueType)}))});case"reference":return st.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:q9(e.bodyType)})}}function JY5(e){return e.map(t=>KY5(t))}function KY5(e){return{...e,headers:e.headers.map(t=>iNo(t)),payload:$Y5(e.payload)}}function $Y5(e){switch(e.type){case"reference":return st.V49.webhooks.WebhookPayload.reference({...e,payloadType:q9(e.payloadType)});case"inlinedPayload":return st.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:q9(t.valueType)}))})}}function YY5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V49.auth.AuthScheme.basic(t);case"bearer":return st.V49.auth.AuthScheme.bearer(t);case"header":return st.V49.auth.AuthScheme.header(XY5(t));case"oauth":return st.V49.auth.AuthScheme.oauth(ZY5(t))}})}}function XY5(e){return{...e,valueType:q9(e.valueType)}}function ZY5(e){return{...e,configuration:st.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:kY5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?eX5(e.configuration.refreshEndpoint):void 0})}}function kY5(e){return{...e,requestProperties:{clientId:Tki(e.requestProperties.clientId),clientSecret:Tki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Tki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:hTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?hTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?hTi(e.responseProperties.refreshToken):void 0}}}function eX5(e){return{...e,requestProperties:{refreshToken:Tki(e.requestProperties.refreshToken)},responseProperties:{accessToken:hTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?hTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?hTi(e.responseProperties.refreshToken):void 0}}}function iNo(e){return{...e,valueType:q9(e.valueType)}}function q9(e){return st.V50.types.TypeReference._visit(e,{container:t=>st.V49.types.TypeReference.container(_WE(t)),primitive:t=>t.v2?.type==="integer"?st.V49.types.TypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?st.V49.types.TypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?st.V49.types.TypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.string(t.v2)}):st.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:st.V49.types.TypeReference.named,unknown:st.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function _WE(e){return st.V50.types.ContainerType._visit(e,{list:t=>st.V49.types.ContainerType.list(q9(t)),optional:t=>st.V49.types.ContainerType.optional(q9(t)),set:t=>st.V49.types.ContainerType.set(q9(t)),map:({keyType:t,valueType:r})=>st.V49.types.ContainerType.map({keyType:q9(t),valueType:q9(r)}),literal:st.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function tX5(e){return{...e,shape:rX5(e.shape)}}function rX5(e){return st.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:q9(t.type)}),noProperties:st.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function nX5(e){return st.V50.types.ResolvedTypeReference._visit(e,{container:t=>st.V49.types.ResolvedTypeReference.container(_WE(t)),named:st.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.string(t.v2)}):st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:st.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function iX5(e){return{members:e.members.map(t=>({...t,type:q9(t.type)}))}}function aX5(e){return{...e,pathParameters:e.pathParameters.map(t=>d3u(t)),headers:e.headers.map(t=>iNo(t)),endpoints:e.endpoints.map(t=>uX5(t))}}function d3u(e){return{...e,valueType:q9(e.valueType)}}function oX5(e){return{...e,type:q9(e.type)}}function uX5(e){return{...e,pagination:e.pagination!=null?dX5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>d3u(t)),pathParameters:e.pathParameters.map(t=>d3u(t)),sdkRequest:e.sdkRequest!=null?yX5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?gX5(e.requestBody):void 0,response:e.response!=null?sX5(e.response):void 0,headers:e.headers.map(t=>iNo(t)),queryParameters:e.queryParameters.map(t=>tU_(t))}}function sX5(e){return{...e,body:e.body!=null?cX5(e.body):void 0}}function cX5(e){switch(e.type){case"json":return st.V49.http.HttpResponseBody.json(hWE(e.value));case"fileDownload":return st.V49.http.HttpResponseBody.fileDownload(e);case"text":return st.V49.http.HttpResponseBody.text(e);case"streaming":return st.V49.http.HttpResponseBody.streaming(yWE(e.value));case"streamParameter":return st.V49.http.HttpResponseBody.streamParameter(fX5(e))}}function hWE(e){switch(e.type){case"response":return st.V49.http.JsonResponse.response({...e,responseBodyType:q9(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:q9(e.responseBodyType),responseProperty:e.responseProperty!=null?eU_(e.responseProperty):void 0})}}function yWE(e){switch(e.type){case"json":return st.V49.http.StreamingResponse.json({...e,payload:q9(e.payload)});case"text":return st.V49.http.StreamingResponse.text(e);case"sse":return st.V49.http.StreamingResponse.sse({...e,payload:q9(e.payload)})}}function lX5(e){switch(e.type){case"json":return st.V49.http.NonStreamHttpResponseBody.json(hWE(e.value));case"text":return st.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function fX5(e){return{nonStreamResponse:lX5(e.nonStreamResponse),streamResponse:yWE(e.streamResponse)}}function dX5(e){switch(e.type){case"cursor":return st.V49.http.Pagination.cursor(pX5(e));case"offset":return st.V49.http.Pagination.offset(_X5(e))}}function pX5(e){return{...e,page:Tki(e.page),next:hTi(e.next),results:hTi(e.results)}}function _X5(e){return{...e,page:Tki(e.page),results:hTi(e.results),step:e.step!=null?Tki(e.step):void 0}}function Tki(e){return{...e,property:hX5(e.property)}}function hX5(e){switch(e.type){case"query":return st.V49.RequestPropertyValue.query(tU_(e));case"body":return st.V49.RequestPropertyValue.body(eU_(e))}}function hTi(e){return{...e,property:eU_(e.property)}}function eU_(e){return{...e,valueType:q9(e.valueType)}}function tU_(e){return{...e,valueType:q9(e.valueType)}}function yX5(e){return{...e,streamParameter:e.streamParameter!=null?Tki(e.streamParameter):void 0,shape:vX5(e.shape)}}function vX5(e){return st.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V49.http.SdkRequestShape.justRequestBody(bX5(t)),wrapper:st.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function bX5(e){switch(e.type){case"bytes":return st.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:q9(e.requestBodyType)})}}function gX5(e){return st.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:q9(r.valueType)}))}),reference:t=>st.V49.http.HttpRequestBody.reference({...t,requestBodyType:q9(t.requestBodyType)}),fileUpload:t=>st.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:q9(r.valueType)});case"file":return st.V49.http.FileUploadRequestProperty.file(mX5(r.value))}})}),bytes:t=>st.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function mX5(e){switch(e.type){case"file":return st.V49.http.FileProperty.file(e);case"fileArray":return st.V49.http.FileProperty.fileArray(e)}}function OX5(e){return{...e,type:e.type!=null?q9(e.type):void 0}}var gWE={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"0.1.2",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Pg(e.types,r=>{let n=r.autogeneratedExamples.map(a=>vWE(a)),i=r.userProvidedExamples.map(a=>vWE(a));return{...r,examples:[...n,...i]}});return{...e,types:t,services:Pg(e.services,r=>BX5(r)),errors:Pg(e.errors,r=>FX5(r)),webhookGroups:Pg(e.webhookGroups,r=>jX5(r)),websocketChannels:Pg(e.websocketChannels,r=>AX5(r))}}};function AX5(e){return{...e,examples:e.examples.map(t=>PX5(t))}}function PX5(e){return{...e,pathParameters:e.pathParameters.map(t=>lOl(t)),headers:e.headers.map(t=>rU_(t)),queryParameters:e.queryParameters.map(t=>mWE(t)),messages:e.messages.map(t=>({...t,body:wX5(t.body)}))}}function mWE(e){return{...e,value:Hce(e.value)}}function rU_(e){return{...e,value:Hce(e.value)}}function lOl(e){return{...e,value:Hce(e.value)}}function wX5(e){switch(e.type){case"inlinedBody":return st.V50.ExampleWebSocketMessageBody.inlinedBody(OWE(e));case"reference":return st.V50.ExampleWebSocketMessageBody.reference(Hce(e))}}function OWE(e){return{...e,properties:e.properties.map(t=>({...t,value:Hce(t.value)}))}}function jX5(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:Hce(r.payload)}))}))}function vWE(e){return{...e,shape:AWE(e.shape)}}function nU_(e){switch(e.type){case"primitive":return st.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return st.V50.ExampleTypeReferenceShape.container(EX5(e));case"unknown":return st.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:AWE(e.shape)})}}function EX5(e){switch(e.container.type){case"list":return st.V50.ExampleContainer.list(e.container.list.map(t=>Hce(t)));case"set":return st.V50.ExampleContainer.set(e.container.set.map(t=>Hce(t)));case"optional":return st.V50.ExampleContainer.optional(e.container.optional!=null?Hce(e.container.optional):void 0);case"map":return st.V50.ExampleContainer.map(e.container.map.map(t=>({key:Hce(t.key),value:Hce(t.value)})));case"literal":return st.V50.ExampleContainer.literal(e.container.literal)}}function Hce(e){return{...e,shape:nU_(e.shape)}}function AWE(e){switch(e.type){case"object":return st.V50.ExampleTypeShape.object({properties:e.properties.map(t=>PWE(t))});case"alias":return st.V50.ExampleTypeShape.alias({value:{...Hce(e.value)}});case"enum":return st.V50.ExampleTypeShape.enum(e);case"union":return st.V50.ExampleTypeShape.union(DX5(e));case"undiscriminatedUnion":return st.V50.ExampleTypeShape.undiscriminatedUnion(SX5(e))}}function SX5(e){return{...e,singleUnionType:Hce(e.singleUnionType)}}function DX5(e){return{...e,singleUnionType:CX5(e.singleUnionType)}}function CX5(e){return{...e,shape:IX5(e.shape)}}function IX5(e){switch(e.type){case"samePropertiesAsObject":return st.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:MX5(e.object)});case"singleProperty":return st.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:nU_(e.shape)});case"noProperties":return st.V50.ExampleSingleUnionTypeProperties.noProperties()}}function MX5(e){return{...e,properties:e.properties.map(t=>PWE(t))}}function PWE(e){return{...e,value:{...e.value,shape:nU_(e.value.shape)}}}function BX5(e){return{...e,endpoints:e.endpoints.map(t=>TX5(t))}}function TX5(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:bWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?bWE(t.example):void 0}))}}function bWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>lOl(t)),servicePathParameters:e.servicePathParameters.map(t=>lOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>lOl(t)),serviceHeaders:e.serviceHeaders.map(t=>rU_(t)),endpointHeaders:e.endpointHeaders.map(t=>rU_(t)),queryParameters:e.queryParameters.map(t=>mWE(t)),request:e.request!=null?NX5(e.request):void 0,response:qX5(e.response)}}function qX5(e){switch(e.type){case"error":return st.V50.ExampleResponse.error({...e,body:e.body!=null?Hce(e.body):void 0});case"ok":return st.V50.ExampleResponse.ok(RX5(e))}}function RX5(e){switch(e.value.type){case"body":return st.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?Hce(e.value.value):void 0);case"stream":return st.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Hce(t)));case"sse":return st.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Hce(t.data)})))}}function NX5(e){switch(e.type){case"inlinedRequestBody":return st.V50.ExampleRequestBody.inlinedRequestBody(OWE(e));case"reference":return st.V50.ExampleRequestBody.reference(Hce(e))}}function FX5(e){return{...e,examples:e.examples.map(t=>({...t,shape:Hce(t.shape)}))}}var EWE={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?zX5(e.apiVersion):void 0,auth:JX5(e.auth),headers:e.headers.map(t=>MQa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>MQa(t)),types:xX5(e.types),services:Pg(e.services,t=>iZ5(t)),webhookGroups:Pg(e.webhookGroups,t=>VX5(t)),websocketChannels:Pg(e.websocketChannels,t=>QX5(t)),errors:Pg(e.errors,t=>mZ5(t)),pathParameters:e.pathParameters.map(t=>p3u(t)),variables:e.variables.map(t=>aZ5(t))})};function xX5(e){return Pg(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>wWE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>wWE(r)),shape:st.V52.types.Type._visit(t.shape,{union:r=>st.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:b6(n.valueType)})),types:r.types.map(n=>eZ5(n))}),enum:st.V51.types.Type.enum,object:r=>st.V51.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:b6(n.valueType)}))}),alias:r=>st.V51.types.Type.alias({aliasOf:b6(r.aliasOf),resolvedType:rZ5(r.resolvedType)}),undiscriminatedUnion:r=>st.V51.types.Type.undiscriminatedUnion(nZ5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function zX5(e){return st.V51.ApiVersionScheme.header({...e,header:MQa(e.header)})}function QX5(e){return{...e,headers:e.headers.map(t=>MQa(t)),queryParameters:e.queryParameters.map(t=>oU_(t)),pathParameters:e.pathParameters.map(t=>p3u(t)),messages:e.messages.map(t=>LX5(t)),examples:e.examples.map(t=>OZ5(t))}}function LX5(e){return{...e,body:UX5(e.body)}}function UX5(e){switch(e.type){case"inlinedBody":return st.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:b6(t.valueType)}))});case"reference":return st.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:b6(e.bodyType)})}}function VX5(e){return e.map(t=>WX5(t))}function WX5(e){return{...e,headers:e.headers.map(t=>MQa(t)),payload:HX5(e.payload),examples:e.examples!=null?e.examples.map(t=>GX5(t)):void 0}}function HX5(e){switch(e.type){case"reference":return st.V51.webhooks.WebhookPayload.reference({...e,payloadType:b6(e.payloadType)});case"inlinedPayload":return st.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:b6(t.valueType)}))})}}function GX5(e){return{...e,payload:Gce(e.payload)}}function JX5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V51.auth.AuthScheme.basic(t);case"bearer":return st.V51.auth.AuthScheme.bearer(t);case"header":return st.V51.auth.AuthScheme.header(KX5(t));case"oauth":return st.V51.auth.AuthScheme.oauth($X5(t))}})}}function KX5(e){return{...e,valueType:b6(e.valueType)}}function $X5(e){return{...e,configuration:st.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:YX5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?XX5(e.configuration.refreshEndpoint):void 0})}}function YX5(e){return{...e,requestProperties:{clientId:qki(e.requestProperties.clientId),clientSecret:qki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?qki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:yTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?yTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?yTi(e.responseProperties.refreshToken):void 0}}}function XX5(e){return{...e,requestProperties:{refreshToken:qki(e.requestProperties.refreshToken)},responseProperties:{accessToken:yTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?yTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?yTi(e.responseProperties.refreshToken):void 0}}}function MQa(e){return{...e,valueType:b6(e.valueType)}}function b6(e){return st.V52.types.TypeReference._visit(e,{container:t=>st.V51.types.TypeReference.container(DWE(t)),primitive:t=>st.V51.types.TypeReference.primitive(SWE(t)),named:st.V51.types.TypeReference.named,unknown:st.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function SWE(e){return{v1:ZX5(e.v1),v2:e.v2!=null?kX5(e.v2):void 0}}function ZX5(e){switch(e){case"UINT":return st.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return st.V51.types.PrimitiveTypeV1.Long}return e}function kX5(e){switch(e.type){case"integer":return st.V51.types.PrimitiveTypeV2.integer(e);case"double":return st.V51.types.PrimitiveTypeV2.double(e);case"string":return st.V51.types.PrimitiveTypeV2.string(e);case"boolean":return st.V51.types.PrimitiveTypeV2.boolean(e);case"long":return st.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return st.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:ks(e)}}function DWE(e){return st.V52.types.ContainerType._visit(e,{list:t=>st.V51.types.ContainerType.list(b6(t)),optional:t=>st.V51.types.ContainerType.optional(b6(t)),set:t=>st.V51.types.ContainerType.set(b6(t)),map:({keyType:t,valueType:r})=>st.V51.types.ContainerType.map({keyType:b6(t),valueType:b6(r)}),literal:st.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function eZ5(e){return{...e,shape:tZ5(e.shape)}}function tZ5(e){return st.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:b6(t.type)}),noProperties:st.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function rZ5(e){return st.V52.types.ResolvedTypeReference._visit(e,{container:t=>st.V51.types.ResolvedTypeReference.container(DWE(t)),named:st.V51.types.ResolvedTypeReference.named,primitive:t=>st.V51.types.ResolvedTypeReference.primitive(SWE(t)),unknown:st.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function nZ5(e){return{members:e.members.map(t=>({...t,type:b6(t.type)}))}}function iZ5(e){return{...e,pathParameters:e.pathParameters.map(t=>p3u(t)),headers:e.headers.map(t=>MQa(t)),endpoints:e.endpoints.map(t=>oZ5(t))}}function p3u(e){return{...e,valueType:b6(e.valueType)}}function aZ5(e){return{...e,type:b6(e.type)}}function oZ5(e){return{...e,pagination:e.pagination!=null?fZ5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>p3u(t)),pathParameters:e.pathParameters.map(t=>p3u(t)),sdkRequest:e.sdkRequest!=null?hZ5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?bZ5(e.requestBody):void 0,response:e.response!=null?uZ5(e.response):void 0,headers:e.headers.map(t=>MQa(t)),queryParameters:e.queryParameters.map(t=>oU_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:jWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?jWE(t.example):void 0}))}}function uZ5(e){return{...e,body:e.body!=null?sZ5(e.body):void 0}}function sZ5(e){switch(e.type){case"json":return st.V51.http.HttpResponseBody.json(CWE(e.value));case"fileDownload":return st.V51.http.HttpResponseBody.fileDownload(e);case"text":return st.V51.http.HttpResponseBody.text(e);case"streaming":return st.V51.http.HttpResponseBody.streaming(IWE(e.value));case"streamParameter":return st.V51.http.HttpResponseBody.streamParameter(lZ5(e))}}function CWE(e){switch(e.type){case"response":return st.V51.http.JsonResponse.response({...e,responseBodyType:b6(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:b6(e.responseBodyType),responseProperty:e.responseProperty!=null?aU_(e.responseProperty):void 0})}}function IWE(e){switch(e.type){case"json":return st.V51.http.StreamingResponse.json({...e,payload:b6(e.payload)});case"text":return st.V51.http.StreamingResponse.text(e);case"sse":return st.V51.http.StreamingResponse.sse({...e,payload:b6(e.payload)})}}function cZ5(e){switch(e.type){case"json":return st.V51.http.NonStreamHttpResponseBody.json(CWE(e.value));case"text":return st.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function lZ5(e){return{nonStreamResponse:cZ5(e.nonStreamResponse),streamResponse:IWE(e.streamResponse)}}function fZ5(e){switch(e.type){case"cursor":return st.V51.http.Pagination.cursor(dZ5(e));case"offset":return st.V51.http.Pagination.offset(pZ5(e))}}function dZ5(e){return{...e,page:qki(e.page),next:yTi(e.next),results:yTi(e.results)}}function pZ5(e){return{...e,page:qki(e.page),results:yTi(e.results),step:e.step!=null?qki(e.step):void 0}}function qki(e){return{...e,property:_Z5(e.property)}}function _Z5(e){switch(e.type){case"query":return st.V51.RequestPropertyValue.query(oU_(e));case"body":return st.V51.RequestPropertyValue.body(aU_(e))}}function yTi(e){return{...e,property:aU_(e.property)}}function aU_(e){return{...e,valueType:b6(e.valueType)}}function oU_(e){return{...e,valueType:b6(e.valueType)}}function hZ5(e){return{...e,streamParameter:e.streamParameter!=null?qki(e.streamParameter):void 0,shape:yZ5(e.shape)}}function yZ5(e){return st.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V51.http.SdkRequestShape.justRequestBody(vZ5(t)),wrapper:st.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function vZ5(e){switch(e.type){case"bytes":return st.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:b6(e.requestBodyType)})}}function bZ5(e){return st.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:b6(r.valueType)}))}),reference:t=>st.V51.http.HttpRequestBody.reference({...t,requestBodyType:b6(t.requestBodyType)}),fileUpload:t=>st.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:b6(r.valueType)});case"file":return st.V51.http.FileUploadRequestProperty.file(gZ5(r.value))}})}),bytes:t=>st.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function gZ5(e){switch(e.type){case"file":return st.V51.http.FileProperty.file(e);case"fileArray":return st.V51.http.FileProperty.fileArray(e)}}function mZ5(e){return{...e,type:e.type!=null?b6(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Gce(t.shape)}))}}function OZ5(e){return{...e,pathParameters:e.pathParameters.map(t=>fOl(t)),headers:e.headers.map(t=>iU_(t)),queryParameters:e.queryParameters.map(t=>MWE(t)),messages:e.messages.map(t=>({...t,body:AZ5(t.body)}))}}function MWE(e){return{...e,value:Gce(e.value)}}function iU_(e){return{...e,value:Gce(e.value)}}function fOl(e){return{...e,value:Gce(e.value)}}function AZ5(e){switch(e.type){case"inlinedBody":return st.V51.ExampleWebSocketMessageBody.inlinedBody(BWE(e));case"reference":return st.V51.ExampleWebSocketMessageBody.reference(Gce(e))}}function BWE(e){return{...e,properties:e.properties.map(t=>({...t,value:Gce(t.value)}))}}function wWE(e){return{...e,shape:qWE(e.shape)}}function uU_(e){switch(e.type){case"primitive":return st.V51.ExampleTypeReferenceShape.primitive(PZ5(e));case"container":return st.V51.ExampleTypeReferenceShape.container(wZ5(e));case"unknown":return st.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:qWE(e.shape)})}}function TWE(e){switch(e.type){case"integer":return st.V51.ExamplePrimitive.integer(e.integer);case"uint":return st.V51.ExamplePrimitive.integer(e.uint);case"uint64":return st.V51.ExamplePrimitive.integer(e.uint64);case"double":return st.V51.ExamplePrimitive.double(e.double);case"long":return st.V51.ExamplePrimitive.long(e.long);case"boolean":return st.V51.ExamplePrimitive.boolean(e.boolean);case"string":return st.V51.ExamplePrimitive.string(e.string);case"date":return st.V51.ExamplePrimitive.date(e.date);case"datetime":return st.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return st.V51.ExamplePrimitive.uuid(e.uuid)}}function PZ5(e){return TWE(e.primitive)}function wZ5(e){switch(e.container.type){case"list":return st.V51.ExampleContainer.list({list:e.container.list.map(t=>Gce(t)),itemType:b6(e.container.itemType)});case"set":return st.V51.ExampleContainer.set({set:e.container.set.map(t=>Gce(t)),itemType:b6(e.container.itemType)});case"optional":return st.V51.ExampleContainer.optional({optional:e.container.optional!=null?Gce(e.container.optional):void 0,valueType:b6(e.container.valueType)});case"map":return st.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:Gce(t.key),value:Gce(t.value)})),keyType:b6(e.container.keyType),valueType:b6(e.container.valueType)});case"literal":return st.V51.ExampleContainer.literal({literal:TWE(e.container.literal)})}}function Gce(e){return{...e,shape:uU_(e.shape)}}function qWE(e){switch(e.type){case"object":return st.V51.ExampleTypeShape.object({properties:e.properties.map(t=>RWE(t))});case"alias":return st.V51.ExampleTypeShape.alias({value:{...Gce(e.value)}});case"enum":return st.V51.ExampleTypeShape.enum(e);case"union":return st.V51.ExampleTypeShape.union(EZ5(e));case"undiscriminatedUnion":return st.V51.ExampleTypeShape.undiscriminatedUnion(jZ5(e))}}function jZ5(e){return{...e,singleUnionType:Gce(e.singleUnionType)}}function EZ5(e){return{...e,singleUnionType:SZ5(e.singleUnionType)}}function SZ5(e){return{...e,shape:DZ5(e.shape)}}function DZ5(e){switch(e.type){case"samePropertiesAsObject":return st.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:CZ5(e.object)});case"singleProperty":return st.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:uU_(e.shape)});case"noProperties":return st.V51.ExampleSingleUnionTypeProperties.noProperties()}}function CZ5(e){return{...e,properties:e.properties.map(t=>RWE(t))}}function RWE(e){return{...e,value:{...e.value,shape:uU_(e.value.shape)}}}function jWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>fOl(t)),servicePathParameters:e.servicePathParameters.map(t=>fOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>fOl(t)),serviceHeaders:e.serviceHeaders.map(t=>iU_(t)),endpointHeaders:e.endpointHeaders.map(t=>iU_(t)),queryParameters:e.queryParameters.map(t=>MWE(t)),request:e.request!=null?BZ5(e.request):void 0,response:IZ5(e.response)}}function IZ5(e){switch(e.type){case"error":return st.V51.ExampleResponse.error({...e,body:e.body!=null?Gce(e.body):void 0});case"ok":return st.V51.ExampleResponse.ok(MZ5(e))}}function MZ5(e){switch(e.value.type){case"body":return st.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?Gce(e.value.value):void 0);case"stream":return st.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Gce(t)));case"sse":return st.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Gce(t.data)})))}}function BZ5(e){switch(e.type){case"inlinedRequestBody":return st.V51.ExampleRequestBody.inlinedRequestBody(BWE(e));case"reference":return st.V51.ExampleRequestBody.reference(Gce(e))}}var xWE={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[ge.TYPESCRIPT]:"0.38.0-rc0",[ge.TYPESCRIPT_SDK]:"0.38.0-rc0",[ge.TYPESCRIPT_EXPRESS]:"0.17.3",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.3.0",[ge.JAVA_SDK]:"2.5.0",[ge.JAVA_SPRING]:"1.3.0",[ge.PYTHON_FASTAPI]:"1.1.0-rc0",[ge.PYTHON_PYDANTIC]:"1.1.0-rc0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:"0.1.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:"0.2.0",[ge.PYTHON_SDK]:"3.3.0-rc0",[ge.GO_FIBER]:"0.23.5",[ge.GO_MODEL]:"0.23.5",[ge.GO_SDK]:"0.28.3",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"0.5.0",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:"0.1.0",[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?qZ5(e.apiVersion):void 0,auth:UZ5(e.auth),headers:e.headers.map(t=>BQa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>BQa(t)),types:TZ5(e.types),services:Pg(e.services,t=>kZ5(t)),webhookGroups:Pg(e.webhookGroups,t=>xZ5(t)),websocketChannels:Pg(e.websocketChannels,t=>RZ5(t)),errors:Pg(e.errors,t=>hk5(t)),pathParameters:e.pathParameters.map(t=>_3u(t)),variables:e.variables.map(t=>ek5(t))})};function TZ5(e){return Pg(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>NWE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>NWE(r)),shape:st.V53.types.Type._visit(t.shape,{union:r=>st.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:g6(n.valueType)})),types:r.types.map(n=>$Z5(n))}),enum:st.V52.types.Type.enum,object:r=>st.V52.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:g6(n.valueType)}))}),alias:r=>st.V52.types.Type.alias({aliasOf:g6(r.aliasOf),resolvedType:XZ5(r.resolvedType)}),undiscriminatedUnion:r=>st.V52.types.Type.undiscriminatedUnion(ZZ5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function qZ5(e){return st.V52.ApiVersionScheme.header({...e,header:BQa(e.header)})}function RZ5(e){return{...e,headers:e.headers.map(t=>BQa(t)),queryParameters:e.queryParameters.map(t=>lU_(t)),pathParameters:e.pathParameters.map(t=>_3u(t)),messages:e.messages.map(t=>NZ5(t)),examples:e.examples.map(t=>yk5(t))}}function NZ5(e){return{...e,body:FZ5(e.body)}}function FZ5(e){switch(e.type){case"inlinedBody":return st.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:g6(t.valueType)}))});case"reference":return st.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:g6(e.bodyType)})}}function xZ5(e){return e.map(t=>zZ5(t))}function zZ5(e){return{...e,headers:e.headers.map(t=>BQa(t)),payload:QZ5(e.payload),examples:e.examples!=null?e.examples.map(t=>LZ5(t)):void 0}}function QZ5(e){switch(e.type){case"reference":return st.V52.webhooks.WebhookPayload.reference({...e,payloadType:g6(e.payloadType)});case"inlinedPayload":return st.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:g6(t.valueType)}))})}}function LZ5(e){return{...e,payload:Jce(e.payload)}}function UZ5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V52.auth.AuthScheme.basic(t);case"bearer":return st.V52.auth.AuthScheme.bearer(t);case"header":return st.V52.auth.AuthScheme.header(VZ5(t));case"oauth":return st.V52.auth.AuthScheme.oauth(WZ5(t))}})}}function VZ5(e){return{...e,valueType:g6(e.valueType)}}function WZ5(e){return{...e,configuration:st.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:HZ5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?GZ5(e.configuration.refreshEndpoint):void 0})}}function HZ5(e){return{...e,requestProperties:{clientId:Rki(e.requestProperties.clientId),clientSecret:Rki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Rki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:vTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?vTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?vTi(e.responseProperties.refreshToken):void 0}}}function GZ5(e){return{...e,requestProperties:{refreshToken:Rki(e.requestProperties.refreshToken)},responseProperties:{accessToken:vTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?vTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?vTi(e.responseProperties.refreshToken):void 0}}}function BQa(e){return{...e,valueType:g6(e.valueType)}}function g6(e){return st.V53.types.TypeReference._visit(e,{container:t=>st.V52.types.TypeReference.container(QWE(t)),primitive:t=>st.V52.types.TypeReference.primitive(zWE(t)),named:st.V52.types.TypeReference.named,unknown:st.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function zWE(e){return{v1:JZ5(e.v1),v2:e.v2!=null?KZ5(e.v2):void 0}}function JZ5(e){switch(e){case"FLOAT":return st.V52.types.PrimitiveTypeV1.Double}return e}function KZ5(e){switch(e.type){case"integer":return st.V52.types.PrimitiveTypeV2.integer(e);case"double":return st.V52.types.PrimitiveTypeV2.double(e);case"string":return st.V52.types.PrimitiveTypeV2.string(e);case"boolean":return st.V52.types.PrimitiveTypeV2.boolean(e);case"long":return st.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return st.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return st.V52.types.PrimitiveTypeV2.uint();case"uint64":return st.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:ks(e)}}function QWE(e){return st.V53.types.ContainerType._visit(e,{list:t=>st.V52.types.ContainerType.list(g6(t)),optional:t=>st.V52.types.ContainerType.optional(g6(t)),set:t=>st.V52.types.ContainerType.set(g6(t)),map:({keyType:t,valueType:r})=>st.V52.types.ContainerType.map({keyType:g6(t),valueType:g6(r)}),literal:st.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function $Z5(e){return{...e,shape:YZ5(e.shape)}}function YZ5(e){return st.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:g6(t.type)}),noProperties:st.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function XZ5(e){return st.V53.types.ResolvedTypeReference._visit(e,{container:t=>st.V52.types.ResolvedTypeReference.container(QWE(t)),named:st.V52.types.ResolvedTypeReference.named,primitive:t=>st.V52.types.ResolvedTypeReference.primitive(zWE(t)),unknown:st.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function ZZ5(e){return{members:e.members.map(t=>({...t,type:g6(t.type)}))}}function kZ5(e){return{...e,pathParameters:e.pathParameters.map(t=>_3u(t)),headers:e.headers.map(t=>BQa(t)),endpoints:e.endpoints.map(t=>tk5(t))}}function _3u(e){return{...e,valueType:g6(e.valueType)}}function ek5(e){return{...e,type:g6(e.type)}}function tk5(e){return{...e,pagination:e.pagination!=null?ok5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>_3u(t)),pathParameters:e.pathParameters.map(t=>_3u(t)),sdkRequest:e.sdkRequest!=null?lk5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?pk5(e.requestBody):void 0,response:e.response!=null?rk5(e.response):void 0,headers:e.headers.map(t=>BQa(t)),queryParameters:e.queryParameters.map(t=>lU_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:FWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?FWE(t.example):void 0}))}}function rk5(e){return{...e,body:e.body!=null?nk5(e.body):void 0}}function nk5(e){switch(e.type){case"json":return st.V52.http.HttpResponseBody.json(LWE(e.value));case"fileDownload":return st.V52.http.HttpResponseBody.fileDownload(e);case"text":return st.V52.http.HttpResponseBody.text(e);case"streaming":return st.V52.http.HttpResponseBody.streaming(UWE(e.value));case"streamParameter":return st.V52.http.HttpResponseBody.streamParameter(ak5(e))}}function LWE(e){switch(e.type){case"response":return st.V52.http.JsonResponse.response({...e,responseBodyType:g6(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:g6(e.responseBodyType),responseProperty:e.responseProperty!=null?cU_(e.responseProperty):void 0})}}function UWE(e){switch(e.type){case"json":return st.V52.http.StreamingResponse.json({...e,payload:g6(e.payload)});case"text":return st.V52.http.StreamingResponse.text(e);case"sse":return st.V52.http.StreamingResponse.sse({...e,payload:g6(e.payload)})}}function ik5(e){switch(e.type){case"json":return st.V52.http.NonStreamHttpResponseBody.json(LWE(e.value));case"text":return st.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function ak5(e){return{nonStreamResponse:ik5(e.nonStreamResponse),streamResponse:UWE(e.streamResponse)}}function ok5(e){switch(e.type){case"cursor":return st.V52.http.Pagination.cursor(uk5(e));case"offset":return st.V52.http.Pagination.offset(sk5(e))}}function uk5(e){return{...e,page:Rki(e.page),next:vTi(e.next),results:vTi(e.results)}}function sk5(e){return{...e,page:Rki(e.page),results:vTi(e.results),step:e.step!=null?Rki(e.step):void 0}}function Rki(e){return{...e,property:ck5(e.property)}}function ck5(e){switch(e.type){case"query":return st.V52.RequestPropertyValue.query(lU_(e));case"body":return st.V52.RequestPropertyValue.body(cU_(e))}}function vTi(e){return{...e,property:cU_(e.property)}}function cU_(e){return{...e,valueType:g6(e.valueType)}}function lU_(e){return{...e,valueType:g6(e.valueType)}}function lk5(e){return{...e,streamParameter:e.streamParameter!=null?Rki(e.streamParameter):void 0,shape:fk5(e.shape)}}function fk5(e){return st.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V52.http.SdkRequestShape.justRequestBody(dk5(t)),wrapper:st.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function dk5(e){switch(e.type){case"bytes":return st.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:g6(e.requestBodyType)})}}function pk5(e){return st.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:g6(r.valueType)}))}),reference:t=>st.V52.http.HttpRequestBody.reference({...t,requestBodyType:g6(t.requestBodyType)}),fileUpload:t=>st.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:g6(r.valueType)});case"file":return st.V52.http.FileUploadRequestProperty.file(_k5(r.value))}})}),bytes:t=>st.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function _k5(e){switch(e.type){case"file":return st.V52.http.FileProperty.file(e);case"fileArray":return st.V52.http.FileProperty.fileArray(e)}}function hk5(e){return{...e,type:e.type!=null?g6(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Jce(t.shape)}))}}function yk5(e){return{...e,pathParameters:e.pathParameters.map(t=>dOl(t)),headers:e.headers.map(t=>sU_(t)),queryParameters:e.queryParameters.map(t=>VWE(t)),messages:e.messages.map(t=>({...t,body:vk5(t.body)}))}}function VWE(e){return{...e,value:Jce(e.value)}}function sU_(e){return{...e,value:Jce(e.value)}}function dOl(e){return{...e,value:Jce(e.value)}}function vk5(e){switch(e.type){case"inlinedBody":return st.V52.ExampleWebSocketMessageBody.inlinedBody(WWE(e));case"reference":return st.V52.ExampleWebSocketMessageBody.reference(Jce(e))}}function WWE(e){return{...e,properties:e.properties.map(t=>({...t,value:Jce(t.value)}))}}function NWE(e){return{...e,shape:GWE(e.shape)}}function fU_(e){switch(e.type){case"primitive":return st.V52.ExampleTypeReferenceShape.primitive(bk5(e));case"container":return st.V52.ExampleTypeReferenceShape.container(gk5(e));case"unknown":return st.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:GWE(e.shape)})}}function HWE(e){switch(e.type){case"integer":return st.V52.ExamplePrimitive.integer(e.integer);case"uint":return st.V52.ExamplePrimitive.integer(e.uint);case"uint64":return st.V52.ExamplePrimitive.integer(e.uint64);case"float":return st.V52.ExamplePrimitive.double(e.float);case"double":return st.V52.ExamplePrimitive.double(e.double);case"long":return st.V52.ExamplePrimitive.long(e.long);case"boolean":return st.V52.ExamplePrimitive.boolean(e.boolean);case"string":return st.V52.ExamplePrimitive.string(e.string);case"date":return st.V52.ExamplePrimitive.date(e.date);case"datetime":return st.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return st.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return st.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return st.V52.ExamplePrimitive.string({original:e.bigInteger})}}function bk5(e){return HWE(e.primitive)}function gk5(e){switch(e.container.type){case"list":return st.V52.ExampleContainer.list({list:e.container.list.map(t=>Jce(t)),itemType:g6(e.container.itemType)});case"set":return st.V52.ExampleContainer.set({set:e.container.set.map(t=>Jce(t)),itemType:g6(e.container.itemType)});case"optional":return st.V52.ExampleContainer.optional({optional:e.container.optional!=null?Jce(e.container.optional):void 0,valueType:g6(e.container.valueType)});case"map":return st.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:Jce(t.key),value:Jce(t.value)})),keyType:g6(e.container.keyType),valueType:g6(e.container.valueType)});case"literal":return st.V52.ExampleContainer.literal({literal:HWE(e.container.literal)})}}function Jce(e){return{...e,shape:fU_(e.shape)}}function GWE(e){switch(e.type){case"object":return st.V52.ExampleTypeShape.object({properties:e.properties.map(t=>JWE(t))});case"alias":return st.V52.ExampleTypeShape.alias({value:{...Jce(e.value)}});case"enum":return st.V52.ExampleTypeShape.enum(e);case"union":return st.V52.ExampleTypeShape.union(Ok5(e));case"undiscriminatedUnion":return st.V52.ExampleTypeShape.undiscriminatedUnion(mk5(e))}}function mk5(e){return{...e,singleUnionType:Jce(e.singleUnionType)}}function Ok5(e){return{...e,singleUnionType:Ak5(e.singleUnionType)}}function Ak5(e){return{...e,shape:Pk5(e.shape)}}function Pk5(e){switch(e.type){case"samePropertiesAsObject":return st.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:wk5(e.object)});case"singleProperty":return st.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:fU_(e.shape)});case"noProperties":return st.V52.ExampleSingleUnionTypeProperties.noProperties()}}function wk5(e){return{...e,properties:e.properties.map(t=>JWE(t))}}function JWE(e){return{...e,value:{...e.value,shape:fU_(e.value.shape)}}}function FWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>dOl(t)),servicePathParameters:e.servicePathParameters.map(t=>dOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>dOl(t)),serviceHeaders:e.serviceHeaders.map(t=>sU_(t)),endpointHeaders:e.endpointHeaders.map(t=>sU_(t)),queryParameters:e.queryParameters.map(t=>VWE(t)),request:e.request!=null?Sk5(e.request):void 0,response:jk5(e.response)}}function jk5(e){switch(e.type){case"error":return st.V52.ExampleResponse.error({...e,body:e.body!=null?Jce(e.body):void 0});case"ok":return st.V52.ExampleResponse.ok(Ek5(e))}}function Ek5(e){switch(e.value.type){case"body":return st.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?Jce(e.value.value):void 0);case"stream":return st.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Jce(t)));case"sse":return st.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Jce(t.data)})))}}function Sk5(e){switch(e.type){case"inlinedRequestBody":return st.V52.ExampleRequestBody.inlinedRequestBody(WWE(e));case"reference":return st.V52.ExampleRequestBody.reference(Jce(e))}}var KWE={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Pg(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:Dk5(r.response)}))}))})};function Dk5(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?st.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var XWE={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.47.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[ge.TYPESCRIPT]:"0.47.0",[ge.TYPESCRIPT_SDK]:"0.47.0",[ge.TYPESCRIPT_EXPRESS]:"0.17.7",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.7.0",[ge.JAVA_SDK]:"2.16.0",[ge.JAVA_SPRING]:"1.5.0",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"1.10.1",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:"0.3.2",[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Ik5(e.apiVersion):void 0,auth:xk5(e.auth),headers:e.headers.map(t=>TQa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>TQa(t)),types:Ck5(e.types),services:Pg(e.services,t=>Jk5(t)),webhookGroups:Pg(e.webhookGroups,t=>qk5(t)),websocketChannels:Pg(e.websocketChannels,t=>Mk5(t)),errors:Pg(e.errors,t=>ce9(t)),pathParameters:e.pathParameters.map(t=>h3u(t)),variables:e.variables.map(t=>Kk5(t)),dynamic:e.dynamic!=null?Ae9(e.dynamic):void 0})};function Ck5(e){return Pg(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>$WE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>$WE(r)),shape:st.V55.types.Type._visit(t.shape,{union:r=>st.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:Aq(n.valueType)})),types:r.types.map(n=>Vk5(n))}),enum:st.V54.types.Type.enum,object:r=>st.V54.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:Aq(n.valueType)})),extendedProperties:r.extendedProperties?.map(n=>({...n,valueType:Aq(n.valueType)}))}),alias:r=>st.V54.types.Type.alias({aliasOf:Aq(r.aliasOf),resolvedType:Hk5(r.resolvedType)}),undiscriminatedUnion:r=>st.V54.types.Type.undiscriminatedUnion(Gk5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Ik5(e){return st.V54.ApiVersionScheme.header({...e,header:TQa(e.header)})}function Mk5(e){return{...e,headers:e.headers.map(t=>TQa(t)),queryParameters:e.queryParameters.map(t=>_U_(t)),pathParameters:e.pathParameters.map(t=>h3u(t)),messages:e.messages.map(t=>Bk5(t)),examples:e.examples.map(t=>le9(t))}}function Bk5(e){return{...e,body:Tk5(e.body)}}function Tk5(e){switch(e.type){case"inlinedBody":return st.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Aq(t.valueType)}))});case"reference":return st.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:Aq(e.bodyType)})}}function qk5(e){return e.map(t=>Rk5(t))}function Rk5(e){return{...e,headers:e.headers.map(t=>TQa(t)),payload:Nk5(e.payload),examples:e.examples!=null?e.examples.map(t=>Fk5(t)):void 0}}function Nk5(e){switch(e.type){case"reference":return st.V54.webhooks.WebhookPayload.reference({...e,payloadType:Aq(e.payloadType)});case"inlinedPayload":return st.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Aq(t.valueType)}))})}}function Fk5(e){return{...e,payload:Zae(e.payload)}}function xk5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V54.auth.AuthScheme.basic(t);case"bearer":return st.V54.auth.AuthScheme.bearer(t);case"header":return st.V54.auth.AuthScheme.header(zk5(t));case"oauth":return st.V54.auth.AuthScheme.oauth(Qk5(t))}})}}function zk5(e){return{...e,valueType:Aq(e.valueType)}}function Qk5(e){return{...e,configuration:st.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:Lk5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?Uk5(e.configuration.refreshEndpoint):void 0})}}function Lk5(e){return{...e,requestProperties:{clientId:Nki(e.requestProperties.clientId),clientSecret:Nki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Nki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:bvi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?bvi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?bvi(e.responseProperties.refreshToken):void 0}}}function Uk5(e){return{...e,requestProperties:{refreshToken:Nki(e.requestProperties.refreshToken)},responseProperties:{accessToken:bvi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?bvi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?bvi(e.responseProperties.refreshToken):void 0}}}function TQa(e){return{...e,valueType:Aq(e.valueType)}}function Aq(e){return e.type==="container"&&e.container.type==="nullable"?Re9(e.container.nullable):e.type==="container"&&e.container.type==="optional"?qe9(e.container.optional):st.V55.types.TypeReference._visit(e,{container:t=>st.V54.types.TypeReference.container(kWE(t)),primitive:t=>st.V54.types.TypeReference.primitive(ZWE(t)),named:st.V54.types.TypeReference.named,unknown:st.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function ZWE(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function kWE(e){return st.V55.types.ContainerType._visit(e,{list:t=>st.V54.types.ContainerType.list(Aq(t)),optional:t=>st.V54.types.ContainerType.optional(Aq(t)),nullable:t=>st.V54.types.ContainerType.optional(Aq(t)),set:t=>st.V54.types.ContainerType.set(Aq(t)),map:({keyType:t,valueType:r})=>st.V54.types.ContainerType.map({keyType:Aq(t),valueType:Aq(r)}),literal:st.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function Vk5(e){return{...e,shape:Wk5(e.shape)}}function Wk5(e){return st.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:Aq(t.type)}),noProperties:st.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function Hk5(e){return st.V55.types.ResolvedTypeReference._visit(e,{container:t=>st.V54.types.ResolvedTypeReference.container(kWE(t)),named:st.V54.types.ResolvedTypeReference.named,primitive:t=>st.V54.types.ResolvedTypeReference.primitive(ZWE(t)),unknown:st.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function Gk5(e){return{members:e.members.map(t=>({...t,type:Aq(t.type)}))}}function Jk5(e){return{...e,pathParameters:e.pathParameters.map(t=>h3u(t)),headers:e.headers.map(t=>TQa(t)),endpoints:e.endpoints.map(t=>$k5(t))}}function h3u(e){return{...e,valueType:Aq(e.valueType)}}function Kk5(e){return{...e,type:Aq(e.type)}}function $k5(e){return{...e,pagination:e.pagination!=null?ee9(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>h3u(t)),pathParameters:e.pathParameters.map(t=>h3u(t)),sdkRequest:e.sdkRequest!=null?ie9(e.sdkRequest):void 0,requestBody:e.requestBody!=null?ue9(e.requestBody):void 0,response:e.response!=null?Yk5(e.response):void 0,headers:e.headers.map(t=>TQa(t)),queryParameters:e.queryParameters.map(t=>_U_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:YWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?YWE(t.example):void 0}))}}function Yk5(e){return{...e,body:e.body!=null?Xk5(e.body):void 0}}function Xk5(e){switch(e.type){case"json":return st.V54.http.HttpResponseBody.json(eHE(e.value));case"fileDownload":return st.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return st.V54.http.HttpResponseBody.bytes(e);case"text":return st.V54.http.HttpResponseBody.text(e);case"streaming":return st.V54.http.HttpResponseBody.streaming(tHE(e.value));case"streamParameter":return st.V54.http.HttpResponseBody.streamParameter(kk5(e));default:ks(e)}}function eHE(e){switch(e.type){case"response":return st.V54.http.JsonResponse.response({...e,responseBodyType:Aq(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Aq(e.responseBodyType),responseProperty:e.responseProperty!=null?pU_(e.responseProperty):void 0})}}function tHE(e){switch(e.type){case"json":return st.V54.http.StreamingResponse.json({...e,payload:Aq(e.payload)});case"text":return st.V54.http.StreamingResponse.text(e);case"sse":return st.V54.http.StreamingResponse.sse({...e,payload:Aq(e.payload)})}}function Zk5(e){switch(e.type){case"json":return st.V54.http.NonStreamHttpResponseBody.json(eHE(e.value));case"bytes":return st.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return st.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:ks(e)}}function kk5(e){return{nonStreamResponse:Zk5(e.nonStreamResponse),streamResponse:tHE(e.streamResponse)}}function ee9(e){switch(e.type){case"cursor":return st.V54.http.Pagination.cursor(te9(e));case"offset":return st.V54.http.Pagination.offset(re9(e))}}function te9(e){return{...e,page:Nki(e.page),next:bvi(e.next),results:bvi(e.results)}}function re9(e){return{...e,page:Nki(e.page),results:bvi(e.results),step:e.step!=null?Nki(e.step):void 0,hasNextPage:e.hasNextPage!=null?bvi(e.hasNextPage):void 0}}function Nki(e){return{...e,property:ne9(e.property)}}function ne9(e){switch(e.type){case"query":return st.V54.RequestPropertyValue.query(_U_(e));case"body":return st.V54.RequestPropertyValue.body(pU_(e))}}function bvi(e){return{...e,property:pU_(e.property)}}function pU_(e){return{...e,valueType:Aq(e.valueType)}}function _U_(e){return{...e,valueType:Aq(e.valueType)}}function ie9(e){return{...e,streamParameter:e.streamParameter!=null?Nki(e.streamParameter):void 0,shape:ae9(e.shape)}}function ae9(e){return st.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V54.http.SdkRequestShape.justRequestBody(oe9(t)),wrapper:st.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function oe9(e){switch(e.type){case"bytes":return st.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Aq(e.requestBodyType)})}}function ue9(e){return st.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Aq(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:Aq(r.valueType)}))}),reference:t=>st.V54.http.HttpRequestBody.reference({...t,requestBodyType:Aq(t.requestBodyType)}),fileUpload:t=>st.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Aq(r.valueType)});case"file":return st.V54.http.FileUploadRequestProperty.file(se9(r.value))}})}),bytes:t=>st.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function se9(e){switch(e.type){case"file":return st.V54.http.FileProperty.file(e);case"fileArray":return st.V54.http.FileProperty.fileArray(e)}}function ce9(e){return{...e,type:e.type!=null?Aq(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Zae(t.shape)}))}}function le9(e){return{...e,pathParameters:e.pathParameters.map(t=>pOl(t)),headers:e.headers.map(t=>dU_(t)),queryParameters:e.queryParameters.map(t=>rHE(t)),messages:e.messages.map(t=>({...t,body:fe9(t.body)}))}}function rHE(e){return{...e,value:Zae(e.value)}}function dU_(e){return{...e,value:Zae(e.value)}}function pOl(e){return{...e,value:Zae(e.value)}}function fe9(e){switch(e.type){case"inlinedBody":return st.V54.ExampleWebSocketMessageBody.inlinedBody(nHE(e));case"reference":return st.V54.ExampleWebSocketMessageBody.reference(Zae(e))}}function nHE(e){return{...e,properties:e.properties.map(t=>({...t,value:Zae(t.value)}))}}function $WE(e){return{...e,shape:iHE(e.shape)}}function hU_(e){switch(e.type){case"primitive":return st.V54.ExampleTypeReferenceShape.primitive(de9(e));case"container":return st.V54.ExampleTypeReferenceShape.container(pe9(e));case"unknown":return st.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:iHE(e.shape)})}}function de9(e){return e.primitive}function pe9(e){switch(e.container.type){case"list":return st.V54.ExampleContainer.list({list:e.container.list.map(t=>Zae(t)),itemType:Aq(e.container.itemType)});case"set":return st.V54.ExampleContainer.set({set:e.container.set.map(t=>Zae(t)),itemType:Aq(e.container.itemType)});case"optional":return st.V54.ExampleContainer.optional({optional:e.container.optional!=null?Zae(e.container.optional):void 0,valueType:Aq(e.container.valueType)});case"nullable":return st.V54.ExampleContainer.optional({optional:e.container.nullable!=null?Zae(e.container.nullable):void 0,valueType:Aq(e.container.valueType)});case"map":return st.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:Zae(t.key),value:Zae(t.value)})),keyType:Aq(e.container.keyType),valueType:Aq(e.container.valueType)});case"literal":return st.V54.ExampleContainer.literal({literal:e.container.literal})}}function Zae(e){return{...e,shape:hU_(e.shape)}}function iHE(e){switch(e.type){case"object":return st.V54.ExampleTypeShape.object({properties:e.properties.map(t=>aHE(t))});case"alias":return st.V54.ExampleTypeShape.alias({value:{...Zae(e.value)}});case"enum":return st.V54.ExampleTypeShape.enum(e);case"union":return st.V54.ExampleTypeShape.union(he9(e));case"undiscriminatedUnion":return st.V54.ExampleTypeShape.undiscriminatedUnion(_e9(e))}}function _e9(e){return{...e,singleUnionType:Zae(e.singleUnionType)}}function he9(e){return{...e,singleUnionType:ye9(e.singleUnionType)}}function ye9(e){return{...e,shape:ve9(e.shape)}}function ve9(e){switch(e.type){case"samePropertiesAsObject":return st.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:be9(e.object)});case"singleProperty":return st.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:hU_(e.shape)});case"noProperties":return st.V54.ExampleSingleUnionTypeProperties.noProperties()}}function be9(e){return{...e,properties:e.properties.map(t=>aHE(t))}}function aHE(e){return{...e,value:{...e.value,shape:hU_(e.value.shape)}}}function YWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>pOl(t)),servicePathParameters:e.servicePathParameters.map(t=>pOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>pOl(t)),serviceHeaders:e.serviceHeaders.map(t=>dU_(t)),endpointHeaders:e.endpointHeaders.map(t=>dU_(t)),queryParameters:e.queryParameters.map(t=>rHE(t)),request:e.request!=null?Oe9(e.request):void 0,response:ge9(e.response)}}function ge9(e){switch(e.type){case"error":return st.V54.ExampleResponse.error({...e,body:e.body!=null?Zae(e.body):void 0});case"ok":return st.V54.ExampleResponse.ok(me9(e))}}function me9(e){switch(e.value.type){case"body":return st.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?Zae(e.value.value):void 0);case"stream":return st.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Zae(t)));case"sse":return st.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Zae(t.data)})))}}function Oe9(e){switch(e.type){case"inlinedRequestBody":return st.V54.ExampleRequestBody.inlinedRequestBody(nHE(e));case"reference":return st.V54.ExampleRequestBody.reference(Zae(e))}}function Ae9(e){return{...e,types:Pg(e.types,t=>Pe9(t)),endpoints:Pg(e.endpoints,t=>we9(t)),headers:e.headers?.map(t=>BDr(t))}}function Pe9(e){switch(e.type){case"alias":return st.V54.dynamic.NamedType.alias({...e,typeReference:qct(e.typeReference)});case"enum":return st.V54.dynamic.NamedType.enum(e);case"object":return st.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>BDr(t))});case"discriminatedUnion":return st.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Ee9(r)]))});case"undiscriminatedUnion":return st.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>qct(t))});default:ks(e)}}function we9(e){return{...e,auth:e.auth!=null?je9(e.auth):void 0,request:Se9(e.request)}}function je9(e){switch(e.type){case"basic":return st.V54.dynamic.Auth.basic(e);case"bearer":return st.V54.dynamic.Auth.bearer(e);case"header":return st.V54.dynamic.Auth.header({header:BDr(e.header)})}}function qct(e){switch(e.type){case"list":return st.V54.dynamic.TypeReference.list(qct(e.value));case"optional":return Fe9(e.value);case"nullable":return Ne9(e.value);case"map":return st.V54.dynamic.TypeReference.map({...e,key:qct(e.key),value:qct(e.value)});case"literal":return st.V54.dynamic.TypeReference.literal(e.value);case"named":return st.V54.dynamic.TypeReference.named(e.value);case"primitive":return st.V54.dynamic.TypeReference.primitive(e.value);case"set":return st.V54.dynamic.TypeReference.set(qct(e.value));case"unknown":return st.V54.dynamic.TypeReference.unknown();default:ks(e)}}function Ee9(e){switch(e.type){case"samePropertiesAsObject":return st.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>BDr(t))});case"singleProperty":return st.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:qct(e.typeReference),properties:e.properties?.map(t=>BDr(t))});case"noProperties":return st.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>BDr(t))});default:ks(e)}}function BDr(e){return{...e,typeReference:qct(e.typeReference)}}function Se9(e){switch(e.type){case"body":return st.V54.dynamic.Request.body(De9(e));case"inlined":return st.V54.dynamic.Request.inlined(Ce9(e));default:ks(e)}}function De9(e){return{pathParameters:e.pathParameters?.map(t=>BDr(t)),body:e.body!=null?oHE(e.body):void 0}}function Ce9(e){return{...e,pathParameters:e.pathParameters?.map(t=>BDr(t)),queryParameters:e.queryParameters?.map(t=>BDr(t)),headers:e.headers?.map(t=>BDr(t)),body:e.body!=null?Ie9(e.body):void 0}}function Ie9(e){switch(e.type){case"properties":return st.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>BDr(t)));case"referenced":return st.V54.dynamic.InlinedRequestBody.referenced(Me9(e));case"fileUpload":return st.V54.dynamic.InlinedRequestBody.fileUpload(Be9(e));default:ks(e)}}function Me9(e){return{...e,bodyType:oHE(e.bodyType)}}function oHE(e){switch(e.type){case"bytes":return st.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return st.V54.dynamic.ReferencedRequestBodyType.typeReference(qct(e.value));default:ks(e)}}function Be9(e){return{properties:e.properties.map(t=>Te9(t))}}function Te9(e){switch(e.type){case"file":return st.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return st.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return st.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(BDr(e));default:ks(e)}}function qe9(e){return e.type==="container"&&e.container.type==="nullable"?st.V54.types.TypeReference.container(st.V54.types.ContainerType.optional(Aq(e.container.nullable))):st.V54.types.TypeReference.container(st.V54.types.ContainerType.optional(Aq(e)))}function Re9(e){return e.type==="container"&&e.container.type==="optional"?Aq(e):st.V54.types.TypeReference.container(st.V54.types.ContainerType.optional(Aq(e)))}function Ne9(e){return e.type==="optional"?qct(e):st.V54.dynamic.TypeReference.optional(qct(e))}function Fe9(e){return e.type==="nullable"?st.V54.dynamic.TypeReference.optional(qct(e.value)):st.V54.dynamic.TypeReference.optional(qct(e))}var uHE={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:"0.0.2",[ge.CSHARP_SDK]:"1.12.0-rc0",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Pg(e.services,t=>xe9(t))})};function xe9(e){return{...e,endpoints:e.endpoints.map(t=>ze9(t))}}function ze9(e){return{...e,pagination:Qe9(e.pagination)}}function Qe9(e){if(e!=null)switch(e.type){case"cursor":return st.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return st.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:ks(e)}}var sHE={laterVersion:"v57",earlierVersion:"v56",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.49.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.49.0",[ge.TYPESCRIPT]:"0.49.0",[ge.TYPESCRIPT_SDK]:"0.49.0",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.8.0",[ge.JAVA_SDK]:"2.34.0",[ge.JAVA_SPRING]:"1.6.0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.6.3",[ge.PYTHON_PYDANTIC]:"1.4.8",[ge.PYTHON_SDK]:"4.3.19",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:"0.23.6",[ge.GO_MODEL]:"0.23.6",[ge.GO_SDK]:"0.37.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"1.12.0-rc11",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:"0.14.1",[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V56.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?Le9(e.dynamic):void 0})};function Le9(e){return{...e,endpoints:Ue9(e.endpoints)}}function Ue9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Ve9(r)]).filter(([t,r])=>r!=null))}function Ve9(e){return{...e,auth:e.auth!=null?Ge9(e.auth):void 0,examples:e.examples!=null?We9(e.examples):void 0}}function We9(e){return e.map(t=>He9(t)).filter(t=>t!=null)}function He9(e){return{...e,auth:e.auth!=null?Je9(e.auth):void 0}}function Ge9(e){switch(e.type){case"basic":return st.V56.dynamic.Auth.basic(e);case"bearer":return st.V56.dynamic.Auth.bearer(e);case"header":return st.V56.dynamic.Auth.header(e);case"oauth":return;default:ks(e)}}function Je9(e){switch(e.type){case"basic":return st.V56.dynamic.AuthValues.basic(e);case"bearer":return st.V56.dynamic.AuthValues.bearer(e);case"header":return st.V56.dynamic.AuthValues.header(e);case"oauth":return;default:ks(e)}}var lHE={laterVersion:"v58",earlierVersion:"v57",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"1.2.0",[ge.TYPESCRIPT_BROWSER_SDK]:"1.2.0",[ge.TYPESCRIPT]:"1.2.0",[ge.TYPESCRIPT_SDK]:"1.2.0",[ge.TYPESCRIPT_EXPRESS]:"0.18.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:"2.36.5",[ge.JAVA_SPRING]:"1.6.1",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.7.0",[ge.PYTHON_PYDANTIC]:"1.5.0",[ge.PYTHON_SDK]:"4.21.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:"1.1.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"1.17.5",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:"0.1.0",[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:"1.15.1",[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:"0.0.0"},jsonifyEarlierVersion:e=>Cm.V57.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,publishConfig:e.publishConfig!=null?nt9(e.publishConfig):void 0,services:Ke9(e.services),dynamic:e.dynamic!=null?Ze9(e.dynamic):void 0})};function Ke9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,$e9(r)]))}function $e9(e){return{...e,endpoints:Ye9(e.endpoints)}}function Ye9(e){return e.map(Xe9).filter(t=>t!=null)}function Xe9(e){if(e.method!=="HEAD")return{...e,method:e.method}}function Ze9(e){return{...e,endpoints:ke9(e.endpoints)}}function ke9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,et9(r)]).filter(([t,r])=>r!=null))}function et9(e){let t=e.location.method;if(t!=="HEAD")return{...e,examples:e.examples!=null?tt9(e.examples):void 0,location:{...e.location,method:t}}}function tt9(e){return e.map(t=>rt9(t)).filter(t=>t!=null)}function rt9(e){let t=e.endpoint.method;if(t!=="HEAD")return{...e,endpoint:{...e.endpoint,method:t}}}function nt9(e){switch(e.type){case"github":{let t=cHE(e.target);return t==null?void 0:st.V57.publish.PublishingConfig.github({...e,target:t})}case"direct":{let t=cHE(e.target);return t==null?void 0:st.V57.publish.PublishingConfig.direct({target:t})}case"filesystem":return;default:ks(e)}}function cHE(e){switch(e.type){case"postman":return st.V57.publish.PublishTarget.postman(e);case"npm":return st.V57.publish.PublishTarget.npm(e);case"maven":return st.V57.publish.PublishTarget.maven(e);case"pypi":return;default:ks(e)}}var fHE={laterVersion:"v59",earlierVersion:"v58",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"2.6.8",[ge.TYPESCRIPT_BROWSER_SDK]:"2.6.8",[ge.TYPESCRIPT]:"2.6.8",[ge.TYPESCRIPT_SDK]:"2.6.8",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.8.1",[ge.JAVA_SDK]:"2.43.0",[ge.JAVA_SPRING]:"1.8.2",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.8.0",[ge.PYTHON_PYDANTIC]:"1.6.0",[ge.PYTHON_SDK]:"4.26.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:"0.23.7",[ge.GO_MODEL]:"0.23.7",[ge.GO_SDK]:"1.7.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:"1.0.0-rc26",[ge.CSHARP_MODEL]:"0.0.3",[ge.CSHARP_SDK]:"2.2.0",[ge.SWIFT_MODEL]:"0.0.1",[ge.SWIFT_SDK]:"0.16.0",[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:"1.17.0",[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:"0.1.1"},jsonifyEarlierVersion:e=>Cm.V58.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?at9(e.dynamic):void 0,auth:e.auth!=null?it9(e.auth):void 0})};function it9(e){return{...e,schemes:e.schemes.filter(t=>t.type!=="inferred")}}function at9(e){return{...e,endpoints:ot9(e.endpoints)}}function ot9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ut9(r)]).filter(([t,r])=>r!=null))}function ut9(e){return{...e,examples:e.examples!=null?ct9(e.examples):void 0,auth:st9(e.auth)}}function st9(e){return e==null?e:e._visit({basic:t=>st.V58.dynamic.Auth.basic(t),bearer:t=>st.V58.dynamic.Auth.bearer(t),header:t=>st.V58.dynamic.Auth.header(t),oauth:t=>st.V58.dynamic.Auth.oauth(t),inferred:()=>{},_other:()=>{}})}function ct9(e){return e.map(t=>lt9(t)).filter(t=>t!=null)}function lt9(e){return{...e,auth:ft9(e.auth)}}function ft9(e){if(e==null)return e;if(e.type!=="inferred")return e}var dHE={laterVersion:"v60",earlierVersion:"v59",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"2.11.2",[ge.TYPESCRIPT_BROWSER_SDK]:"2.11.2",[ge.TYPESCRIPT]:"2.11.2",[ge.TYPESCRIPT_SDK]:"2.11.2",[ge.TYPESCRIPT_EXPRESS]:"0.18.6",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.8.2",[ge.JAVA_SDK]:"3.5.10",[ge.JAVA_SPRING]:"1.8.3",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.9.0",[ge.PYTHON_PYDANTIC]:"1.7.0",[ge.PYTHON_SDK]:"4.30.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:"0.23.8",[ge.GO_MODEL]:"0.23.8",[ge.GO_SDK]:"1.12.4",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:Qt,[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:Qt},jsonifyEarlierVersion:e=>Cm.V59.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:_t9(e.services),auth:dt9(e.auth)})};function dt9(e){return{...e,schemes:pt9(e.schemes)}}function pt9(e){return e.map(t=>{switch(t.type){case"bearer":return st.V59.AuthScheme.bearer({...t});case"basic":return st.V59.AuthScheme.basic({...t});case"header":return st.V59.AuthScheme.header({...t});case"oauth":switch(t.configuration.type){case"clientCredentials":return st.V59.AuthScheme.oauth({...t,configuration:st.V59.OAuthConfiguration.clientCredentials({...t.configuration,refreshEndpoint:t.configuration.refreshEndpoint?{...t.configuration.refreshEndpoint,responseProperties:{accessToken:qQa(t.configuration.refreshEndpoint.responseProperties.accessToken),expiresIn:aNo(t.configuration.refreshEndpoint.responseProperties.expiresIn),refreshToken:aNo(t.configuration.refreshEndpoint.responseProperties.refreshToken)},requestProperties:{refreshToken:oNo(t.configuration.refreshEndpoint.requestProperties.refreshToken)}}:void 0,tokenEndpoint:{...t.configuration.tokenEndpoint,responseProperties:{accessToken:qQa(t.configuration.tokenEndpoint.responseProperties.accessToken),expiresIn:aNo(t.configuration.tokenEndpoint.responseProperties.expiresIn),refreshToken:aNo(t.configuration.tokenEndpoint.responseProperties.refreshToken)},requestProperties:{clientId:oNo(t.configuration.tokenEndpoint.requestProperties.clientId),clientSecret:oNo(t.configuration.tokenEndpoint.requestProperties.clientSecret),scopes:yU_(t.configuration.tokenEndpoint.requestProperties.scopes),customProperties:t.configuration.tokenEndpoint.requestProperties.customProperties?.map(oNo)}}})});default:ks(t.configuration.type)}break;case"inferred":return st.V59.AuthScheme.inferred({...t,tokenEndpoint:{...t.tokenEndpoint,expiryProperty:aNo(t.tokenEndpoint.expiryProperty),authenticatedRequestHeaders:t.tokenEndpoint.authenticatedRequestHeaders.map(r=>({...r,responseProperty:qQa(r.responseProperty)}))}});default:ks(t)}})}function _t9(e){return Object.entries(e).reduce((t,[r,n])=>(t[r]={...n,endpoints:ht9(n.endpoints)},t),{})}function ht9(e){return e.map(t=>({...t,pagination:yt9(t.pagination),sdkRequest:vt9(t.sdkRequest)}))}function yt9(e){if(!e)return e;switch(e.type){case"cursor":return st.V59.Pagination.cursor({next:qQa(e.next),results:qQa(e.results),page:oNo(e.page)});case"offset":return st.V59.Pagination.offset({hasNextPage:aNo(e.hasNextPage),results:qQa(e.results),page:oNo(e.page),step:yU_(e.step)});case"custom":return st.V59.Pagination.custom({results:qQa(e.results)});default:ks(e)}}function yU_(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function oNo(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function aNo(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function qQa(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function vt9(e){return e&&{...e,streamParameter:yU_(e.streamParameter)}}var pHE={laterVersion:"v61",earlierVersion:"v60",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"3.7.2",[ge.TYPESCRIPT_BROWSER_SDK]:"3.7.2",[ge.TYPESCRIPT]:"3.7.2",[ge.TYPESCRIPT_SDK]:"3.7.2",[ge.TYPESCRIPT_EXPRESS]:"3.7.2",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.PYTHON_SDK]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:"0.0.4",[ge.CSHARP_SDK]:"2.4.0",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:Qt,[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:"0.7.2"},jsonifyEarlierVersion:e=>Cm.V60.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?gt9(e.dynamic):void 0,publishConfig:e.publishConfig!=null?bt9(e.publishConfig):void 0})};function bt9(e){return st.V61.PublishingConfig._visit(e,{github:t=>{let r=vU_(t.target);return r!=null?st.V60.PublishingConfig.github({...t,target:r}):void 0},direct:t=>{let r=vU_(t.target);return r!=null?st.V60.PublishingConfig.direct({target:r}):void 0},filesystem:t=>{let r=t.publishTarget!=null?vU_(t.publishTarget):void 0;return st.V60.PublishingConfig.filesystem({generateFullProject:t.generateFullProject,publishTarget:r})},_other:()=>{}})}function vU_(e){return st.V61.PublishTarget._visit(e,{postman:st.V60.PublishTarget.postman,npm:st.V60.PublishTarget.npm,maven:st.V60.PublishTarget.maven,pypi:st.V60.PublishTarget.pypi,crates:t=>st.V60.PublishTarget.pypi({version:t.version,packageName:t.packageName}),_other:()=>{}})}function gt9(e){return{...e,endpoints:Pt9(e.endpoints),generatorConfig:e.generatorConfig!=null?mt9(e.generatorConfig):void 0}}function mt9(e){return{...e,outputConfig:Ot9(e.outputConfig)}}function Ot9(e){return st.V61.dynamic.GeneratorOutputConfig._visit(e,{publish:t=>{let r=At9(t);return r!=null?st.V60.dynamic.GeneratorOutputConfig.publish(r):st.V60.dynamic.GeneratorOutputConfig.local()},local:st.V60.dynamic.GeneratorOutputConfig.local,_other:st.V60.dynamic.GeneratorOutputConfig.local})}function At9(e){return st.V61.dynamic.PublishInfo._visit(e,{go:st.V60.dynamic.PublishInfo.go,swift:()=>{},maven:st.V60.dynamic.PublishInfo.maven,npm:st.V60.dynamic.PublishInfo.npm,nuget:st.V60.dynamic.PublishInfo.nuget,pypi:st.V60.dynamic.PublishInfo.pypi,rubygems:st.V60.dynamic.PublishInfo.rubygems,crates:()=>{},_other:()=>{}})}function Pt9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,wt9(r)]).filter(([t,r])=>r!=null))}function wt9(e){return{...e,response:jt9(e.response)}}function jt9(e){return st.V61.dynamic.Response._visit(e,{json:st.V60.dynamic.Response.json,streaming:st.V60.dynamic.Response.json,streamParameter:st.V60.dynamic.Response.json,fileDownload:st.V60.dynamic.Response.json,text:st.V60.dynamic.Response.json,bytes:st.V60.dynamic.Response.json,_other:st.V60.dynamic.Response.json})}function y3u(){return St9}var _Ol=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new bU_([...this.migrations,t])}},bU_=class extends _Ol{build(){return new gU_(this.migrations)}},gU_=class{migrations;constructor(t){this.migrations=t}migrateForGenerator({intermediateRepresentation:t,context:r,targetGenerator:n}){return this.migrate({intermediateRepresentation:t,shouldMigrate:i=>this.shouldRunMigration({migration:i,targetGenerator:n}),context:r,targetGenerator:n})}migrateThroughMigration({migration:t,intermediateRepresentation:r,context:n,targetGenerator:i}){return this.migrateThroughVersion({version:t.earlierVersion,intermediateRepresentation:r,context:n,targetGenerator:i})}migrateThroughVersion({version:t,intermediateRepresentation:r,context:n,targetGenerator:i}){let a=!1;if(this.migrations[0]?.laterVersion===t)return{ir:r,jsonify:()=>Promise.resolve().then(()=>F0.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let c=this.migrate({intermediateRepresentation:r,shouldMigrate:d=>{let s=d.earlierVersion===t;return a||=s,s||!a},context:n,targetGenerator:i});return a||n.failAndThrow(`IR ${t} does not exist`),c}migrate({intermediateRepresentation:t,shouldMigrate:r,context:n,targetGenerator:i}){let a=t,o=async()=>F0.IntermediateRepresentation.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"});for(let c of this.migrations){if(!r(c))break;n.logger.debug(`Migrating IR from ${c.laterVersion} to ${c.earlierVersion}`),a=c.migrateBackwards(a,{taskContext:n,targetGenerator:i}),o=()=>Promise.resolve().then(()=>c.jsonifyEarlierVersion(a))}return{ir:a,jsonify:o}}shouldRunMigration({migration:t,targetGenerator:r}){let n=t.firstGeneratorVersionToConsumeNewIR[r.name];if(n==null)throw new Error(`Cannot migrate intermediate representation. Unrecognized generator: ${r.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`);switch(n){case Qt:return!0;case $n:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return A3e(n,r.version)}getIRVersionForGenerator({targetGenerator:t}){let r=this.migrations[0]?.laterVersion;for(let n of this.migrations)if(this.shouldRunMigration({migration:n,targetGenerator:t}))r=n.earlierVersion;else break;return r}},Et9={Builder:new _Ol([])},St9=Et9.Builder.withMigration(pHE).withMigration(dHE).withMigration(fHE).withMigration(lHE).withMigration(sHE).withMigration(uHE).withMigration(XWE).withMigration(KWE).withMigration(xWE).withMigration(EWE).withMigration(gWE).withMigration(pWE).withMigration(dWE).withMigration(lWE).withMigration(cWE).withMigration(oWE).withMigration(nWE).withMigration(rWE).withMigration(eWE).withMigration(kVE).withMigration(ZVE).withMigration(XVE).withMigration(YVE).withMigration($VE).withMigration(KVE).withMigration(JVE).withMigration(GVE).withMigration(HVE).withMigration(WVE).withMigration(UVE).withMigration(QVE).withMigration(zVE).withMigration(xVE).withMigration(MVE).withMigration(IVE).withMigration(CVE).withMigration(SVE).withMigration(EVE).withMigration(fjw).withMigration(sjw).withMigration(ujw).withMigration(ijw).withMigration(rjw).withMigration(ejw).withMigration(kww).withMigration(Zww).withMigration($ww).withMigration(Gww).withMigration(Hww).withMigration(Www).withMigration(Uww).withMigration(Lww).withMigration(Qww).withMigration(Nww).withMigration(Tww).withMigration(Bww).withMigration(Mww).withMigration(vww).withMigration(_ww).withMigration(Adb).build();function v3u({intermediateRepresentation:e,context:t,targetGenerator:r}){return y3u().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function mU_({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:n}){return y3u().migrateThroughVersion({version:n,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function b3u({intermediateRepresentation:e,context:t,version:r}){return y3u().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function _HE({workspace:e,audiences:t,generatorInvocation:r,context:n,irVersionOverride:i,version:a,packageName:o,sourceConfig:c,includeOptionalRequestPropertyExamples:d,ir:s}){let u=s??iG({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:d,disabled:r.disableExamples},readme:r.readme,version:a,packageName:o,context:n,sourceResolver:new eG(n,e)});c!=null&&(u.sourceConfig=c),n.logger.debug("Generated IR");let l=await Lsa(r).then(P=>P==null?void 0:"v"+P.toString()),m=i??l,A=m!=null?await b3u({intermediateRepresentation:u,context:n,version:m}):await v3u({intermediateRepresentation:u,context:n,targetGenerator:{name:r.name,version:r.version}});return{latest:u,migrated:A}}var hHE=pa(HJs(),1),Hke=require("fs/promises"),yHE=pa(bCe(),1),hOl=class{context;absolutePathToTmpOutputDirectory;absolutePathToTmpSnippetJSON;absolutePathToTmpSnippetTemplatesJSON;absolutePathToLocalSnippetTemplateJSON;absolutePathToLocalOutput;absolutePathToLocalSnippetJSON;constructor({context:t,absolutePathToTmpOutputDirectory:r,absolutePathToTmpSnippetJSON:n,absolutePathToLocalSnippetTemplateJSON:i,absolutePathToLocalOutput:a,absolutePathToLocalSnippetJSON:o,absolutePathToTmpSnippetTemplatesJSON:c}){this.context=t,this.absolutePathToLocalOutput=a,this.absolutePathToTmpOutputDirectory=r,this.absolutePathToTmpSnippetJSON=n,this.absolutePathToLocalSnippetJSON=o,this.absolutePathToLocalSnippetTemplateJSON=i,this.absolutePathToTmpSnippetTemplatesJSON=c}async copyGeneratedFiles(){await this.isFernIgnorePresent()?await this.copyGeneratedFilesWithFernIgnore():await this.copyGeneratedFilesNoFernIgnore(),this.absolutePathToTmpSnippetJSON!=null&&this.absolutePathToLocalSnippetJSON!=null&&await Rv(this.absolutePathToTmpSnippetJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetJSON}),this.absolutePathToTmpSnippetTemplatesJSON!=null&&this.absolutePathToLocalSnippetTemplateJSON!=null&&await Rv(this.absolutePathToTmpSnippetTemplatesJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetTemplatesJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetTemplateJSON})}async isFernIgnorePresent(){let t=z_.of(Xl(this.absolutePathToLocalOutput,ds.of(pis)));return await Rv(t)}async copyGeneratedFilesWithFernIgnore(){let t=z_.of((await yHE.default.dir({})).path),r=z_.of(Xl(this.absolutePathToLocalOutput,ds.of(pis))),n=await Ct9({absolutePathToFernignore:r});await(0,Hke.cp)(this.absolutePathToLocalOutput,t,{recursive:!0}),await this.runGitCommand(["init"],t),await this.runGitCommand(["add","."],t),(await this.runGitCommand(["config","--list"],t)).includes("user.name")||(await this.runGitCommand(["config","user.name","fern-api"],t),await this.runGitCommand(["config","user.email","info@buildwithfern.com"],t)),await this.runGitCommand(["commit","--allow-empty","-m",'"init"'],t),await this.runGitCommand(["rm","-rf","."],t),await this.copyGeneratedFilesToDirectory(t),await this.runGitCommand(["reset","--",...n],t),await this.runGitCommand(["restore","."],t),await(0,Hke.rm)(Xl(t,ds.of(".git")),{recursive:!0}),await(0,Hke.rm)(this.absolutePathToLocalOutput,{recursive:!0}),await(0,Hke.cp)(t,this.absolutePathToLocalOutput,{recursive:!0})}async copyGeneratedFilesNoFernIgnore(){this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`),await(0,Hke.rm)(this.absolutePathToLocalOutput,{force:!0,recursive:!0}),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesToDirectory(t){let[r,...n]=await(0,Hke.readdir)(this.absolutePathToTmpOutputDirectory);if(r!=null)if(this.context.logger.debug(`Copying generated files to ${t}`),r.endsWith(".zip")){await(0,hHE.default)(Xl(this.absolutePathToTmpOutputDirectory,ds.of(r)),t);for(let i of n)await(0,Hke.cp)(Xl(this.absolutePathToTmpOutputDirectory,ds.of(i)),Xl(t,ds.of(i)),{recursive:!0})}else await(0,Hke.cp)(this.absolutePathToTmpOutputDirectory,t,{recursive:!0})}async copySnippetJSON({absolutePathToTmpSnippetJSON:t,absolutePathToLocalSnippetJSON:r}){this.context.logger.debug(`Copying generated snippets to ${r}`),await(0,Hke.cp)(t,r)}async runGitCommand(t,r){return(await kH(this.context.logger,"git",t,{cwd:r,doNotPipeOutput:!0})).stdout}},Dt9=/\r?\n/;async function Ct9({absolutePathToFernignore:e}){let t=(await(0,Hke.readFile)(e)).toString();return[pis,...t.trim().split(Dt9).map(r=>{let n=r.indexOf("#");return n!==-1?r.slice(0,n).trim():r.trim()}).filter(r=>r.length>0)]}function It9(e,t){let r=CZf(e);if(r?.type==="custom"){let n=r.value,i=t?sNo.dirname(t):process.cwd(),a=sNo.isAbsolute(n)?n:sNo.resolve(i,n);return z_.of(a)}}async function gHE({organization:e,absolutePathToFernConfig:t,workspace:r,generatorInvocation:n,absolutePathToLocalOutput:i,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:o,audiences:c,version:d,workspaceTempDir:s,keepDocker:u,context:l,irVersionOverride:m,outputVersionOverride:A,writeUnitTests:P,generateOauthClients:C,generatePaginatedClients:M,includeOptionalRequestPropertyExamples:T,inspect:z,executionEnvironment:U,runner:R,ir:V}){let{latest:Y,migrated:re}=await _HE({workspace:r,audiences:c,generatorInvocation:n,context:l,irVersionOverride:m,packageName:LP.getPackageName({generatorInvocation:n}),version:d??A,sourceConfig:Bt9(r),includeOptionalRequestPropertyExamples:T,ir:V}),Z=await Mt9({workspaceTempDir:s,filename:oXf,context:l,ir:re});l.logger.debug("Wrote IR to: "+Z);let ee=(0,uNo.join)(s.path,aXf),ne=z_.of(ee);await(0,RQa.writeFile)(ee,""),l.logger.debug("Will write config.json to: "+ne);let me=(0,uNo.join)(s.path,iXf),be=z_.of(me);await(0,RQa.mkdir)(me,{recursive:!0}),l.logger.debug("Will write output to: "+be);let Ae;if(a!=null){let Ie=(0,uNo.join)(s.path,"snippet.json");Ae=z_.of(Ie),await(0,RQa.writeFile)(Ie,""),l.logger.debug("Will write snippet.json to: "+Ae)}let ye;if(o!=null){let Ie=(0,uNo.join)(s.path,o_h);ye=z_.of(Ie),await(0,RQa.writeFile)(Ie,""),l.logger.debug("Will write snippet-templates.json to: "+ye)}let Me=U??new You({dockerImage:`${n.name}:${n.version}`,keepDocker:u}),Ee=Me instanceof You?{outputDirectory:z_.of(t$s),irPath:z_.of(r$s),configPath:z_.of($ou),snippetPath:z_.of(n$s),snippetTemplatePath:z_.of(i$s)}:{outputDirectory:be,configPath:ne,irPath:Z,snippetPath:Ae,snippetTemplatePath:ye},St=Odb({generatorInvocation:n,customConfig:n.config,workspaceName:r.definition.rootApiFile.contents.name,outputVersion:A,organization:e,absolutePathToSnippet:Ae,absolutePathToSnippetTemplates:ye,absolutePathToFernConfig:t,writeUnitTests:P,generateOauthClients:C,generatePaginatedClients:M,paths:Ee});await(0,RQa.writeFile)(ne,JSON.stringify(await vHE.GeneratorConfig.jsonOrThrow(St),void 0,4));let vt=It9(n,t);return await Me.execute({generatorName:n.name,irPath:Z,configPath:ne,outputPath:be,snippetPath:Ae,snippetTemplatePath:ye,licenseFilePath:vt,context:l,inspect:z,runner:R}),await new hOl({context:l,absolutePathToLocalOutput:i,absolutePathToTmpOutputDirectory:be,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:o,absolutePathToTmpSnippetJSON:Ae,absolutePathToTmpSnippetTemplatesJSON:ye}).copyGeneratedFiles(),{ir:Y,generatorConfig:St}}async function Mt9({ir:e,workspaceTempDir:t,filename:r,context:n}){n.logger.debug("Migrated IR");let i;if(r)i=z_.of((0,uNo.join)(t.path,r));else{let a=await bHE.default.file({tmpdir:t.path});i=z_.of(a.path)}return await vCe(i,e,{pretty:!1}),n.logger.debug(`Wrote IR to ${i}`),i}function Bt9(e){return{sources:e.getSources().map(t=>t.type==="protobuf"?Exe.proto({id:t.id,protoRootUrl:`file:///${Tt9(t)}`}):Exe.openapi())}}function Tt9(e){return`${Uab}/${e.id}`}var OU_=pa(require("os"),1),mHE=pa(require("path"),1),OHE=pa(bCe(),1);async function AHE({token:e,projectConfig:t,workspace:r,generatorGroup:n,version:i,keepDocker:a,inspect:o,context:c,runner:d}){(await Promise.all(n.generators.map(async u=>c.runInteractiveTask({name:u.name},async l=>{u=(Y=>M3i(Y,{onError:re=>l.failAndThrow(re)}))(u);let A=await r.toFernWorkspace({context:c},eoo(u)),P=iG({workspace:A,audiences:n.audiences,generationLanguage:u.language,keywords:u.keywords,smartCasing:u.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:!1,disabled:u.disableExamples},readme:u.readme,version:i,packageName:LP.getPackageName({generatorInvocation:u}),context:c,sourceResolver:new eG(c,A)}),C=zCe({token:e?.value});if(u.absolutePathToLocalOutput==null&&(e=await cZa(),e==null)){l.failWithoutThrowing("Please provide a FERN_TOKEN in your environment.");return}let M=await C.organization.get(PR.OrganizationId(t.organization));if(u.absolutePathToLocalOutput==null&&!M.ok){l.failWithoutThrowing(`Failed to load details for organization ${t.organization}.`);return}M.ok&&(M.body.selfHostedSdKs&&(P.selfHosted=!0),M.body.isWhitelabled&&(P.readmeConfig==null&&(P.readmeConfig=zt9),P.readmeConfig.whiteLabel=!0));let T=qt9(u),z=Nt9({generatorInvocation:u,org:M.ok?M.body:void 0,version:i,packageName:T,context:l});z!=null&&(P.publishConfig=z);let U=u.absolutePathToLocalOutput??Xl(r.absoluteFilePath,ds.of("sdks"),ds.of(u.language??u.name)),R=u.raw?.snippets?.path!=null?z_.of(Xl(r.absoluteFilePath,ds.of(u.raw.snippets.path))):void 0,V=await Rt9();await gHE({organization:t.organization,absolutePathToFernConfig:t._absolutePath,workspace:A,generatorInvocation:u,absolutePathToLocalOutput:U,absolutePathToLocalSnippetJSON:R,absolutePathToLocalSnippetTemplateJSON:void 0,version:i,audiences:n.audiences,workspaceTempDir:V,keepDocker:a,context:l,irVersionOverride:u.irVersionOverride,outputVersionOverride:void 0,writeUnitTests:M.ok?M?.body.snippetUnitTestsEnabled??!1:!1,generateOauthClients:M.ok?M?.body.oauthClientEnabled??!1:!1,generatePaginatedClients:M.ok?M?.body.paginationEnabled??!1:!1,includeOptionalRequestPropertyExamples:!1,inspect:o,executionEnvironment:void 0,ir:P,runner:d}),l.logger.info(nd.green("Wrote files to "+U))})))).some(u=>!u)&&c.failAndThrow()}function qt9(e){return typeof e.raw?.config=="object"&&e.raw?.config!==null?e.raw.config.package_name:void 0}async function Rt9(){return OHE.default.dir({tmpdir:OU_.default.platform()==="darwin"?mHE.default.join("/private",OU_.default.tmpdir()):void 0,prefix:"fern"})}function Nt9({generatorInvocation:e,org:t,version:r,packageName:n,context:i}){if(e.raw?.github!=null&&xt9(e.raw.github)){let[a,o]=e.raw.github.uri.split("/");return a==null||o==null?i.failAndThrow(`Invalid GitHub repository URI: ${e.raw.github.uri}. Expected format: owner/repo`):Zd.PublishingConfig.github({owner:a,repo:o,uri:e.raw.github.uri,token:e.raw.github.token,mode:e.raw.github.mode,target:Ft9({outputSchema:e.raw.output,version:r,packageName:n})})}if(e.raw?.output?.location==="local-file-system"){let a;if(e.language==="python")a=Cee.pypi({version:r,packageName:n}),i.logger.debug(`Created PyPiPublishTarget: version ${r} package name: ${n}`);else if(e.language==="rust")a=Cee.crates({version:r,packageName:n}),i.logger.debug(`Created CratesPublishTarget: version ${r} package name: ${n}`);else if(e.language==="java"){let o=e.raw?.config,c=(()=>{if(!o||typeof o!="object"||o===null)return;let s=o;if(typeof s.group=="string"&&typeof s.artifact=="string")return{groupId:s.group,artifactId:s.artifact};if(typeof s["package-prefix"]=="string"&&n)return{groupId:s["package-prefix"],artifactId:n};typeof s["package-prefix"]=="string"&&!n&&i.logger.warn("Java generator has package-prefix configured but packageName is missing")})(),d=c?`${c.groupId}:${c.artifactId}`:void 0;if(d){let s=r??"0.0.0";a=Cee.maven({coordinate:d,version:s,usernameEnvironmentVariable:"MAVEN_USERNAME",passwordEnvironmentVariable:"MAVEN_PASSWORD",mavenUrlEnvironmentVariable:"MAVEN_PUBLISH_REGISTRY_URL"}),i.logger.debug(`Created MavenPublishTarget: coordinate ${d} version ${s}`)}else o&&typeof o=="object"&&i.logger.debug("Java generator config provided but could not construct Maven coordinate. Expected either 'group' and 'artifact' or 'package-prefix' with packageName.")}return Zd.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:a})}return e.outputMode._visit({downloadFiles:()=>Zd.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:void 0}),github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:()=>{},_other:()=>{}})}function Ft9({outputSchema:e,version:t,packageName:r}){let n=Zd.PublishTarget.postman({apiKey:"",workspaceId:"",collectionId:void 0});if(e==null)return n;if(e.location==="npm"){let i=(e.token||"${NPM_TOKEN}").trim(),a=i==="<USE_OIDC>"||i==="OIDC";return Cee.npm({packageName:e["package-name"],version:t??"0.0.0",tokenEnvironmentVariable:a?"<USE_OIDC>":i.startsWith("${")&&i.endsWith("}")?i.slice(2,-1).trim():""})}else return e.location==="maven"?Cee.maven({version:t??"0.0.0",coordinate:e.coordinate,usernameEnvironmentVariable:e.username||"MAVEN_USERNAME",passwordEnvironmentVariable:e.password||"MAVEN_PASSWORD",mavenUrlEnvironmentVariable:e.url||"MAVEN_PUBLISH_REGISTRY_URL"}):e.location==="pypi"?Cee.pypi({version:t,packageName:r}):n}function xt9(e){return e==null?!1:"uri"in e&&"token"in e}var zt9={defaultEndpoint:void 0,bannerLink:void 0,introduction:void 0,apiReferenceLink:void 0,apiName:void 0,disabledFeatures:void 0,whiteLabel:void 0,customSections:void 0,features:void 0,exampleStyle:void 0};var POl=pa(d6i(),1);var PHE=require("fs"),yOl=require("fs/promises"),wHE=require("stream/promises");async function jHE({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await Qt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(nd.green(`Downloaded to ${t}`))}catch{r.logger.debug(nd.yellow("Failed to download snippet.json from output."))}}async function Qt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await OZ.get(e,{responseType:"stream"});await Rv(t)&&await(0,yOl.rm)(t,{recursive:!0}),await(0,yOl.mkdir)(Rg(t),{recursive:!0}),await(0,wHE.pipeline)(r.data,(0,PHE.createWriteStream)(t))}var wU_=pa(Nnt(),1);var cNo=pa(d6i(),1);var EHE=pa(jSs(),1),Gke=require("fs/promises");var SHE=require("path"),DHE=pa(rQs(),1),CHE=pa(bCe(),1);_I();async function IHE({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:n,generatorInvocation:i,version:a,context:o,shouldLogS3Url:c,token:d,whitelabel:s,irVersionOverride:u,absolutePathToPreview:l}){let m=await Lt9({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:a,context:o,shouldLogS3Url:c,token:d,whitelabel:s,absolutePathToPreview:l});return await Ut9({intermediateRepresentation:n,job:m,context:o,generatorInvocation:i,irVersionOverride:u}),m}async function Lt9({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:i,context:a,shouldLogS3Url:o,token:c,whitelabel:d,absolutePathToPreview:s}){let u=zAi({token:c.value}),l={id:n.name,version:n.version,outputMode:n.outputMode,customConfig:n.config,publishMetadata:n.publishMetadata},m;if(n.outputMode.type.startsWith("github"))try{let P=await CHE.default.dir(),C=z_.of(P.path);a.logger.debug(`Writing mock fern definition to ${C}`);let M=Xl(C,ds.of(Wve)),T=Xl(M,ds.of(kne));await(0,Gke.mkdir)(T,{recursive:!0});let z=Xl(T,ds.of(vee));await(0,Gke.writeFile)(z,Jg.dump(t.definition.rootApiFile.contents)),await MHE({absolutePathToDefinitionDirectory:T,definition:t.definition});let U=Xl(M,ds.of(NFe));await(0,Gke.writeFile)(U,JSON.stringify(e.rawConfig,void 0,2));try{let Y=t.getSources();for(let re of Y){let Z=await(0,Gke.readFile)(re.absoluteFilePath),ee=(0,SHE.relative)(t.absoluteFilePath,re.absoluteFilePath),ne=Xl(M,ds.of(ee));await(0,Gke.mkdir)(Rg(ne),{recursive:!0}),await(0,Gke.writeFile)(ne,new Uint8Array(Z))}}catch(Y){a.logger.debug(`Failed to write source files to disk, continuing: ${Y}`)}let R=Xl(C,ds.of("definition.tgz"));await(0,DHE.create)({file:R,cwd:M},["."]),a.logger.debug("Getting upload URL for Fern definition.");let V=await u.remoteGen.getDefinitionUploadUrl({apiName:t.definition.rootApiFile.contents.name,organizationName:r,version:i});V.ok?(a.logger.debug("Uploading definition..."),await OZ.put(V.body.s3Url,await(0,Gke.readFile)(R)),m={definitionS3DownloadUrl:V.body.s3Url,outputPath:".mock",cliVersion:e.version}):V.error.content.reason==="status-code"?a.logger.debug(`Failed with status-code to get upload URL with status code ${V.error.content.statusCode}, continuing: ${V.error.content.body}`):V.error.content.reason==="non-json"?a.logger.debug(`Failed with non-json to get upload URL with status code ${V.error.content.statusCode}, continuing: ${V.error.content.rawBody}`):V.error.content.reason==="unknown"&&a.logger.debug(`Failed to get upload URL as unknown error occurred continuing: ${V.error.content.errorMessage}`)}catch(P){a.logger.debug(`Failed to upload definition to S3, continuing: ${P}`)}let A=await u.remoteGen.createJobV3({apiName:t.definition.rootApiFile.contents.name,version:i,organizationName:r,generators:[l],uploadToS3:Wt9({outputMode:n.outputMode,generatorInvocation:n,absolutePathToPreview:s,shouldLogS3Url:o}),whitelabel:d,fernDefinitionMetadata:m,preview:s!=null});return A.ok?A.body:Vt9(A.error)._visit({illegalApiNameError:()=>a.failAndThrow("API name is invalid: "+t.definition.rootApiFile.contents.name),illegalApiVersionError:()=>a.failAndThrow("API version is invalid: "+i),cannotPublishToNpmScope:({validScope:P,invalidScope:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${P})`),cannotPublishToMavenGroup:({validGroup:P,invalidGroup:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${P})`),cannotPublishPypiPackage:({validPrefix:P,invalidPackageName:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${P})`),generatorsDoNotExistError:P=>a.failAndThrow("Generators do not exist: "+P.nonExistentGenerators.map(C=>`${C.id}@${C.version}`).join(", ")),insufficientPermissions:()=>a.failAndThrow(`You do not have permission to run this generator. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
3038
|
+
`).find(ne=>ne.trim().length>0)||"Custom License";ee=ee.trim().replace(/^#+\s*/,""),ee=ee.replace(/[.:;]+$/,"").trim(),U=ee}catch{}}}U!=null&&(m={...t,_fernLicenseName:U})}let{snippetPath:P,snippetTemplatePath:C,irPath:M,outputDirectory:T}=l,z=e.outputMode._visit({publish:U=>({...bdb(i,U,e,l),snippetFilepath:P,publishingMetadata:e.publishMetadata}),publishV2:U=>({...bdb(i,U,e,l),snippetFilepath:P,publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:oge.FernGeneratorExec.OutputMode.downloadFiles(),path:T,snippetFilepath:P,publishingMetadata:e.publishMetadata}),github:U=>{let R={mode:oge.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${U.owner}/${U.repo}`,version:i,publishInfo:vdb(U.publishInfo),installationToken:void 0}),path:T,publishingMetadata:e.publishMetadata};return a!==void 0&&(R.snippetFilepath=P),o!==void 0&&(R.snippetTemplateFilepath=C),R},githubV2:U=>{let R=U._visit({commitAndRelease:Y=>`https://github.com/${Y.owner}/${Y.repo}`,push:Y=>`https://github.com/${Y.owner}/${Y.repo}`,pullRequest:Y=>`https://github.com/${Y.owner}/${Y.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),V={mode:oge.FernGeneratorExec.OutputMode.github({repoUrl:R,version:i,publishInfo:vdb(U.publishInfo)}),path:T,publishingMetadata:e.publishMetadata};return a!==void 0&&(V.snippetFilepath=P),o!==void 0&&(V.snippetTemplateFilepath=C),V},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{irFilepath:M,output:z,publish:void 0,customConfig:m,workspaceName:r,organization:n,environment:oge.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:!1,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,license:A}}function bdb(e,t,r,n){let{outputDirectory:i}=n,a;"registryOverrides"in t?a=t.registryOverrides.maven??t.registryOverrides.npm:a!=null&&(a=t._visit({mavenOverride:c=>c,npmOverride:c=>c,pypiOverride:c=>c,rubyGemsOverride:c=>c,postman:c=>c,nugetOverride:c=>c,cratesOverride:c=>c,_other:()=>{}}));let o="";return r.raw?.github!=null&&(TGo(r.raw.github)?o=r.raw.github.uri:o=r.raw?.github.repository),{mode:oge.FernGeneratorExec.OutputMode.github({repoUrl:o,version:e}),path:i}}var Qt=Symbol(),$n=Symbol();var Adb={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.246",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types,services:e.services,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,errors:e.errors.map(t=>({name:t.name,docs:t.docs,discriminantValue:{originalValue:t.discriminantValueV4.name.unsafeName.originalValue,camelCase:t.discriminantValueV4.name.unsafeName.camelCase,pascalCase:t.discriminantValueV4.name.unsafeName.pascalCase,snakeCase:t.discriminantValueV4.name.unsafeName.snakeCase,screamingSnakeCase:t.discriminantValueV4.name.unsafeName.screamingSnakeCase,wireValue:t.discriminantValueV4.wireValue},discriminantValueV2:t.discriminantValueV2,discriminantValueV3:t.discriminantValueV3,discriminantValueV4:t.discriminantValueV4,type:t.type,typeV2:t.typeV2,typeV3:t.typeV3,http:t.http,statusCode:t.statusCode}))})};var st={};pf(st,{V1:()=>N5z,V10:()=>H5z,V11:()=>G5z,V12:()=>J5z,V13:()=>K5z,V14:()=>$5z,V15:()=>Y5z,V16:()=>X5z,V17:()=>Z5z,V18:()=>k5z,V19:()=>e9z,V2:()=>F5z,V20:()=>t9z,V21:()=>r9z,V22:()=>n9z,V23:()=>DPw.FernIrV23,V24:()=>CPw.FernIrV24,V25:()=>IPw.FernIrV25,V26:()=>MPw.FernIrV26,V27:()=>BPw.FernIrV27,V28:()=>TPw.FernIrV28,V29:()=>qPw.FernIrV29,V3:()=>x5z,V30:()=>RPw.FernIrV30,V31:()=>NPw.FernIrV31,V32:()=>FPw.FernIrV32,V33:()=>xPw.FernIrV33,V34:()=>zPw.FernIrV34,V35:()=>QPw.FernIrV35,V36:()=>LPw.FernIrV36,V37:()=>UPw.FernIrV37,V38:()=>VPw.FernIrV38,V39:()=>WPw.FernIrV39,V4:()=>z5z,V40:()=>HPw.FernIrV40,V41:()=>GPw.FernIrV41,V42:()=>JPw.FernIrV42,V43:()=>KPw.FernIrV43,V44:()=>$Pw.FernIrV44,V45:()=>YPw.FernIrV45,V46:()=>XPw.FernIrV46,V47:()=>ZPw.FernIrV47,V48:()=>kPw.FernIrV48,V49:()=>eww.FernIrV49,V5:()=>Q5z,V50:()=>tww.FernIrV50,V51:()=>rww.FernIrV51,V52:()=>nww.FernIrV52,V53:()=>iww.FernIrV53,V54:()=>aww.FernIrV54,V55:()=>oww.FernIrV55,V56:()=>uww.FernIrV56,V57:()=>sww.FernIrV57,V58:()=>cww.FernIrV58,V59:()=>lww.FernIrV59,V6:()=>L5z,V60:()=>fww.FernIrV60,V61:()=>Zd,V7:()=>U5z,V8:()=>V5z,V9:()=>W5z});var N5z=pa(vbb(),1),F5z=pa(dPb(),1),x5z=pa(tCb(),1),z5z=pa(kRb(),1),Q5z=pa(x4b(),1),L5z=pa(G5b(),1),U5z=pa(eGb(),1),V5z=pa(sZb(),1),W5z=pa(qig(),1),H5z=pa(tfg(),1),G5z=pa(jvg(),1),J5z=pa(APg(),1),K5z=pa(gCg(),1),$5z=pa(yNg(),1),Y5z=pa(p7g(),1),X5z=pa(jUg(),1),Z5z=pa(F$g(),1),k5z=pa($r0(),1),e9z=pa(ll0(),1),t9z=pa(Qv0(),1),r9z=pa(gw0(),1),n9z=pa(ZI0(),1),DPw=pa(vR0(),1),CPw=pa(ez0(),1),IPw=pa(L80(),1),MPw=pa(BL0(),1),BPw=pa(SG0(),1),TPw=pa(PX0(),1),qPw=pa(grm(),1),RPw=pa(Oum(),1),NPw=pa(Pdm(),1),FPw=pa(qvm(),1),xPw=pa(UPd(),1),zPw=pa(nSm(),1),QPw=pa(ZBm(),1),LPw=pa(Jxm(),1),UPw=pa(W8m(),1),VPw=pa(WUm(),1),WPw=pa(u$m(),1),HPw=pa(wtO(),1),GPw=pa(VuO(),1),JPw=pa(d_O(),1),KPw=pa(F0O(),1),$Pw=pa(c1O(),1),YPw=pa(YMO(),1),XPw=pa(VxO(),1),ZPw=pa(Q2O(),1),kPw=pa(FWO(),1),eww=pa(FXO(),1),tww=pa(GiA(),1),rww=pa(fdA(),1),nww=pa(RgA(),1),iww=pa(cCA(),1),aww=pa(HzA(),1),oww=pa(TWA(),1),uww=pa(ArP(),1),sww=pa(fAP(),1),cww=pa(m6P(),1),lww=pa(Wtw(),1),fww=pa(SPw(),1);function dww({inlinedRequest:e,allTypes:t}){let r=new Set,n=t.reduce((i,a)=>({...i,[Cip(a.name)]:a}),{});for(let i of e.extends)pww({typeName:i,typeNameToDeclaration:n,referencedTypes:r});for(let i of e.properties)Mvo({reference:i.valueType,typeNameToDeclaration:n,referencedTypes:r});return[...r].reduce((i,a)=>{let o=n[a];if(o==null)throw new Error("Cannot find declaration for ID: "+a);return[...i,o.name]},[])}function Mvo({reference:e,typeNameToDeclaration:t,referencedTypes:r}){st.V2.types.TypeReference._visit(e,{primitive:Hc,container:n=>{i9z({container:n,typeNameToDeclaration:t,referencedTypes:r})},named:n=>{pww({typeName:n,typeNameToDeclaration:t,referencedTypes:r})},unknown:Hc,void:Hc,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function i9z({container:e,typeNameToDeclaration:t,referencedTypes:r}){st.V2.types.ContainerType._visit(e,{list:n=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r})},set:n=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r})},optional:n=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:n,valueType:i})=>{Mvo({reference:n,typeNameToDeclaration:t,referencedTypes:r}),Mvo({reference:i,typeNameToDeclaration:t,referencedTypes:r})},literal:Hc,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function pww({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let n=Cip(e);r.add(n);let i=t[n];if(i==null)throw new Error("Cannot locate type: "+n);for(let a of i.referencedTypes)r.add(Cip(a))}function Cip(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var _ww={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.249",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.0.134-3-g97d4964",[ge.JAVA_SDK]:"0.0.134-3-g97d4964",[ge.JAVA_SPRING]:"0.0.134-3-g97d4964",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=[...e.types];return{apiName:e.apiName,auth:e.auth,headers:e.headers,types:t,errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{websocket:e.services.websocket,http:e.services.http.map(r=>({availability:r.availability,docs:r.docs,name:r.name,basePath:r.basePath,basePathV2:r.basePathV2,headers:r.headers,pathParameters:r.pathParameters,endpoints:r.endpoints.map(n=>a9z(r,n,e.types,i=>{t.push(i)}))}))}}}};function a9z(e,t,r,n){return{docs:t.docs,availability:t.availability,id:t.id,name:t.name,nameV2:t.nameV2,method:t.method,headers:t.headers,path:t.path,pathParameters:t.pathParameters,queryParameters:t.queryParameters,request:o9z(t,e,r,n),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function o9z(e,t,r,n){let i=e.requestBody;return i==null?{docs:void 0,type:st.V2.types.TypeReference.void(),typeV2:void 0}:st.V3.services.http.HttpRequestBody._visit(i,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let o={fernFilepath:t.name.fernFilepath,fernFilepathV2:t.name.fernFilepathV2,name:a.name.unsafeName.originalValue,nameV2:{originalValue:a.name.unsafeName.originalValue,camelCase:a.name.unsafeName.camelCase,pascalCase:a.name.unsafeName.pascalCase,snakeCase:a.name.unsafeName.snakeCase,screamingSnakeCase:a.name.unsafeName.screamingSnakeCase},nameV3:a.name},c=st.V2.types.Type.object({extends:a.extends,properties:a.properties.map(s=>({availability:e.availability,docs:s.docs,name:{originalValue:s.name.name.unsafeName.originalValue,camelCase:s.name.name.unsafeName.camelCase,pascalCase:s.name.name.unsafeName.pascalCase,snakeCase:s.name.name.unsafeName.snakeCase,screamingSnakeCase:s.name.name.unsafeName.screamingSnakeCase,wireValue:s.name.wireValue},nameV2:s.name,valueType:s.valueType}))});n({docs:void 0,availability:e.availability,name:o,shape:c,referencedTypes:dww({inlinedRequest:a,allTypes:r}),examples:[]});let d=st.V2.types.TypeReference.named(o);return{docs:void 0,type:d,typeV2:d}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+i.type)}})}var vww={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:"0.0.11-4-g1c29f6c",[ge.POSTMAN]:"0.0.32-rc0",[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types.map(t=>({docs:t.docs,availability:t.availability,name:t.name,shape:t.shape,examples:t.examples.map(r=>bww(r.shape)),referencedTypes:t.referencedTypes})),errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{...e.services,http:e.services.http.map(t=>({...t,endpoints:t.endpoints.map(r=>({...r,examples:r.examples.map(n=>f9z(n))}))}))}})};function bww(e){return st.V4.types.ExampleTypeShape._visit(e,{object:t=>st.V3.types.ExampleType.object(u9z(t)),union:t=>st.V3.types.ExampleType.union(c9z(t)),alias:t=>st.V3.types.ExampleType.alias(l9z(t)),enum:st.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function u9z(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:LBe(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function LBe(e){return st.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:st.V3.types.ExampleTypeReference.primitive,container:t=>st.V3.types.ExampleTypeReference.container(s9z(t)),named:t=>st.V3.types.ExampleTypeReference.named(gww(t)),unknown:st.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function s9z(e){return st.V4.types.ExampleContainer._visit(e,{list:t=>st.V3.types.ExampleContainer.list(t.map(LBe)),set:t=>st.V3.types.ExampleContainer.set(t.map(LBe)),optional:t=>st.V3.types.ExampleContainer.optional(t!=null?LBe(t):void 0),map:t=>st.V3.types.ExampleContainer.map(t.map(r=>({key:LBe(r.key),value:LBe(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function gww(e){return{typeName:e.typeName,shape:bww(e.shape)}}function c9z(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:st.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>st.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(gww(t)),singleProperty:t=>st.V3.types.ExampleSingleUnionTypeProperties.singleProperty(LBe(t)),noProperties:()=>st.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function l9z(e){return{value:LBe(e.value)}}function f9z(e){return{servicePathParameters:e.servicePathParameters.map(t=>hww(t)),endpointPathParameters:e.servicePathParameters.map(t=>hww(t)),serviceHeaders:e.serviceHeaders.map(t=>yww(t)),endpointHeaders:e.endpointHeaders.map(t=>yww(t)),queryParameters:e.queryParameters.map(t=>d9z(t)),request:e.request!=null?p9z(e.request):void 0,response:h9z(e.response)}}function hww(e){return{key:e.key,value:LBe(e.value)}}function yww(e){return{key:e.wireKey,value:LBe(e.value)}}function d9z(e){return{key:e.wireKey,value:LBe(e.value)}}function p9z(e){return st.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>st.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>_9z(r))}),reference:t=>st.V3.services.http.ExampleRequestBody.reference(LBe(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function _9z(e){return{wireKey:e.wireKey,value:LBe(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function h9z(e){return st.V4.services.http.ExampleResponse._visit(e,{ok:t=>st.V3.services.http.ExampleResponse.ok({body:t.body!=null?LBe(t.body):void 0}),error:t=>st.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?LBe(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function zxr(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function hut(e){return{...zxr(e.name),wireValue:e.wireValue}}function Gse(e){return{safeName:{originalValue:e.originalName,camelCase:e.camelCase.safeName,pascalCase:e.pascalCase.safeName,snakeCase:e.snakeCase.safeName,screamingSnakeCase:e.screamingSnakeCase.safeName},unsafeName:{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}}function Jse(e){return{wireValue:e.wireValue,name:Gse(e.name)}}function Bvo(e){return st.V5.types.ContainerType._visit(e,{list:t=>st.V4.types.ContainerType.list(jY(t)),set:t=>st.V4.types.ContainerType.set(jY(t)),map:({keyType:t,valueType:r})=>st.V4.types.ContainerType.map({keyType:jY(t),valueType:jY(r)}),optional:t=>st.V4.types.ContainerType.optional(jY(t)),literal:t=>st.V5.types.Literal._visit(t,{string:r=>st.V4.types.ContainerType.literal(st.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function qIa(e){return e.map(t=>zxr(t))}function RIa(e){return e.map(t=>Gse(t))}function h_e(e){return{fernFilepath:qIa(e.fernFilepath),fernFilepathV2:RIa(e.fernFilepath),name:e.name.originalName,nameV2:zxr(e.name),nameV3:Gse(e.name)}}function jY(e){return st.V5.types.TypeReference._visit(e,{named:t=>st.V4.types.TypeReference.named(h_e(t)),container:t=>st.V4.types.TypeReference.container(Bvo(t)),primitive:t=>st.V4.types.TypeReference.primitive(t),unknown:st.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function NIa(e){return{name:hut(e.name),nameV2:Jse(e.name),valueType:jY(e.valueType),availability:e.availability,docs:e.docs}}function mww(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>y9z(t))}}function y9z(e){return st.V5.auth.AuthScheme._visit(e,{basic:st.V4.auth.AuthScheme.basic,bearer:st.V4.auth.AuthScheme.bearer,header:t=>st.V4.auth.AuthScheme.header(NIa(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function Oww(e){return{docs:e.docs,id:e.id,url:e.url,name:Gse(e.name)}}function Aww({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let n=e.type!=null?st.V4.types.Type.alias({aliasOf:jY(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:zxr(e.name.name),nameV3:Gse(e.name.name),fernFilepath:qIa(e.name.fernFilepath),fernFilepathV2:RIa(e.name.fernFilepath)},discriminantValueV2:Jse(e.discriminantValue),discriminantValueV3:st.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:st.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:i=>st.V4.errors.ErrorDeclarationDiscriminantValue.property(Jse(i.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:Jse(e.discriminantValue),type:n??st.V4.types.Type.alias({aliasOf:st.V4.types.TypeReference.void(),resolvedType:st.V4.types.ResolvedTypeReference.void()}),typeV2:n,typeV3:e.type!=null?jY(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function UBe(e){return{jsonExample:e.jsonExample,shape:Pww(e.shape)}}function Pww(e){return st.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:st.V4.types.ExampleTypeReferenceShape.primitive,container:t=>st.V4.types.ExampleTypeReferenceShape.container(b9z(t)),unknown:st.V4.types.ExampleTypeReferenceShape.unknown,named:t=>st.V4.types.ExampleTypeReferenceShape.named(v9z(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function v9z(e){return{typeName:h_e(e.typeName),shape:Wpc(e.shape)}}function b9z(e){return st.V5.types.ExampleContainer._visit(e,{list:t=>st.V4.types.ExampleContainer.list(t.map(r=>UBe(r))),set:t=>st.V4.types.ExampleContainer.set(t.map(r=>UBe(r))),optional:t=>st.V4.types.ExampleContainer.optional(t!=null?UBe(t):void 0),map:t=>st.V4.types.ExampleContainer.map(t.map(r=>({key:UBe(r.key),value:UBe(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function Wpc(e){return st.V5.types.ExampleTypeShape._visit(e,{alias:t=>st.V4.types.ExampleTypeShape.alias({value:UBe(t.value)}),object:t=>st.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:UBe(r.value),originalTypeDeclaration:h_e(r.originalTypeDeclaration)}))}),union:t=>st.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:st.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>st.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:h_e(r.typeName),shape:Wpc(r.shape)}),singleProperty:r=>st.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:Pww(r.shape)}),noProperties:st.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>st.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function Eww({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:g9z(e.name),basePath:m9z(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>O9z({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>NIa(r)),pathParameters:e.pathParameters.map(r=>Sww(r))}}function g9z(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:qIa(e.fernFilepath),fernFilepathV2:RIa(e.fernFilepath)}}function m9z(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function O9z({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:zxr(e.name),nameV2:Gse(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>NIa(r)),path:e.path,pathParameters:e.pathParameters.map(r=>Sww(r)),queryParameters:e.queryParameters.map(r=>A9z(r)),requestBody:e.requestBody!=null?P9z(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?w9z(e.sdkRequest):void 0,response:j9z(e.response),errors:e.errors.map(r=>E9z(r)),errorsV2:S9z({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>I9z(r))}}function Sww(e){return{docs:e.docs,availability:e.availability,name:zxr(e.name),nameV2:Gse(e.name),valueType:jY(e.valueType)}}function A9z(e){return{docs:e.docs,availability:e.availability,name:hut(e.name),nameV2:Jse(e.name),valueType:jY(e.valueType),allowMultiple:e.allowMultiple}}function P9z(e){return st.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V4.services.http.HttpRequestBody.inlinedRequestBody({name:Gse(t.name),extends:t.extends.map(r=>h_e(r)),properties:t.properties.map(r=>({docs:r.docs,name:Jse(r.name),valueType:jY(r.valueType)}))}),reference:t=>st.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:jY(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function w9z(e){return{requestParameterName:Gse(e.requestParameterName),shape:st.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>st.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:jY(t.requestBodyType)}),wrapper:t=>st.V4.services.http.SdkRequestShape.wrapper({wrapperName:Gse(t.wrapperName),bodyKey:Gse(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function j9z(e){let t=e.type!=null?jY(e.type):void 0;return{docs:e.docs,type:t??st.V4.types.TypeReference.void(),typeV2:t}}function E9z(e){return{docs:e.docs,error:Iip(e.error)}}function S9z({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>D9z({responseError:r,errorResolver:t}))}}function D9z({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:hut(r.discriminantValue),shape:C9z({responseError:e,declaration:r})}}function C9z({responseError:e,declaration:t}){return t.type==null?st.V4.services.commons.ResponseErrorShape.noProperties():st.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:Iip(e.error)})}function Iip(e){return{name:e.name.originalName,nameV2:zxr(e.name),nameV3:Gse(e.name),fernFilepath:qIa(e.fernFilepath),fernFilepathV2:RIa(e.fernFilepath)}}function I9z(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>www(t)),endpointPathParameters:e.endpointPathParameters.map(t=>www(t)),serviceHeaders:e.serviceHeaders.map(t=>jww(t)),endpointHeaders:e.endpointHeaders.map(t=>jww(t)),queryParameters:e.queryParameters.map(t=>M9z(t)),request:e.request!=null?B9z(e.request):void 0,response:q9z(e.response)}}function www(e){return{key:e.key,value:UBe(e.value)}}function jww(e){return{wireKey:e.wireKey,value:UBe(e.value)}}function M9z(e){return{wireKey:e.wireKey,value:UBe(e.value)}}function B9z(e){return st.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>st.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>T9z(r))}),reference:t=>st.V4.services.http.ExampleRequestBody.reference(UBe(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function T9z(e){return{wireKey:e.wireKey,value:UBe(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?h_e(e.originalTypeDeclaration):void 0}}function q9z(e){return st.V5.http.ExampleResponse._visit(e,{ok:t=>st.V4.services.http.ExampleResponse.ok({body:t.body!=null?UBe(t.body):void 0}),error:t=>st.V4.services.http.ExampleResponse.error({error:Iip(t.error),body:t.body!=null?UBe(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function Dww(e){return{docs:e.docs,availability:e.availability,name:h_e(e.name),shape:R9z(e.shape),examples:e.examples.map(t=>N9z(t)),referencedTypes:e.referencedTypes.map(t=>h_e(t))}}function R9z(e){return st.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>st.V4.types.Type.alias({aliasOf:jY(t),resolvedType:F9z(r)}),enum:t=>st.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:hut(r.name),nameV2:Jse(r.name),value:r.name.wireValue}))}),object:t=>st.V4.types.Type.object({extends:t.extends.map(r=>h_e(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:hut(r.name),nameV2:Jse(r.name),valueType:jY(r.valueType)}))}),union:t=>st.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:hut(t.discriminant),discriminantV3:Jse(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:hut(r.discriminantValue),discriminantValueV2:Jse(r.discriminantValue),valueType:st.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>st.V4.types.TypeReference.named(h_e(n)),singleProperty:n=>jY(n.type),noProperties:st.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:st.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>st.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(h_e(n)),singleProperty:n=>st.V4.types.SingleUnionTypeProperties.singleProperty({name:hut(n.name),nameV2:Jse(n.name),type:jY(n.type)}),noProperties:st.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function N9z(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:Wpc(e.shape)}}function F9z(e){return st.V5.types.ResolvedTypeReference._visit(e,{named:t=>st.V4.types.ResolvedTypeReference.named({name:h_e(t.name),shape:x9z(t.shape)}),container:t=>st.V4.types.ResolvedTypeReference.container(Bvo(t)),primitive:st.V4.types.ResolvedTypeReference.primitive,unknown:st.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function x9z(e){return st.V5.types.ShapeType._visit(e,{enum:()=>st.V5.types.ShapeType.Enum,object:()=>st.V5.types.ShapeType.Object,union:()=>st.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var Hpc=class{errors;constructor(t){this.errors=t.errors.reduce((r,n)=>({...r,[Cww(n.name)]:n}),{})}getDeclaration(t){let r=Cww(t),n=this.errors[r];if(n==null)throw new Error("Error does not exist: "+r);return n}};function Cww(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}var Gpc=class{types;constructor(t){this.types=t.types.reduce((r,n)=>({...r,[Iww(n.name)]:n}),{})}resolveTypeReference(t){return st.V5.types.TypeReference._visit(t,{container:r=>st.V4.types.ResolvedTypeReference.container(Bvo(r)),named:r=>{let n=this.getTypeDeclaration(r);return n.shape._type==="alias"?this.resolveTypeReference(n.shape.aliasOf):st.V4.types.ResolvedTypeReference.named({name:h_e(r),shape:z9z(n.shape._type)})},primitive:st.V4.types.ResolvedTypeReference.primitive,unknown:st.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=Iww(t),n=this.types[r];if(n==null)throw new Error("Type does not exist: "+n);return n}};function Iww(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function z9z(e){switch(e){case"object":return st.V4.types.ShapeType.Object;case"union":return st.V4.types.ShapeType.Union;case"enum":return st.V4.types.ShapeType.Enum;default:ks(e)}}var Mww={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[ge.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.STOPLIGHT]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new Gpc(e),r=new Hpc(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:mww(e.auth),headers:e.headers.map(n=>NIa(n)),types:e.types.map(n=>Dww(n)),services:{http:e.services.map(n=>Eww({service:n,errorResolver:r})),websocket:[]},errors:e.errors.map(n=>Aww({errorDeclaration:n,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:hut(e.constants.errorInstanceIdKey),errorDiscriminant:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR",wireValue:"error"},errorContentKey:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"}},errorsV2:{errorInstanceIdKey:Jse(e.constants.errorInstanceIdKey),errorDiscriminant:{name:{unsafeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"},safeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"}},wireValue:"error"},errorContentKey:{name:{unsafeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"},safeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"}},wireValue:"content"}}},defaultEnvironment:e.defaultEnvironment,environments:e.environments.map(n=>Oww(n)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?Gse(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:st.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:st.V4.ir.ErrorDiscriminationStrategy.statusCode,property:n=>st.V4.ir.ErrorDiscriminationStrategy.property({discriminant:Jse(n.discriminant),contentProperty:Jse(n.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var Bww={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[ge.TYPESCRIPT_EXPRESS]:"0.0.264",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[ge.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[ge.OPENAPI]:"0.0.16-1-ga2c0ada",[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?st.V6.environment.Environments._visit(e.environments.environments,{singleBaseUrl:n=>n.environments,multipleBaseUrls:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying multiple URLs for a single environment. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a multiple URls for a single environment."),_unknown:()=>{throw new Error("Unknown Environments: "+e.environments?.environments.type)}}):[]})};var Tww={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.268",[ge.TYPESCRIPT_EXPRESS]:"0.0.268",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.OPENAPI_PYTHON_CLIENT]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:e.services.map(t=>{let r=t.name.fernFilepath[t.name.fernFilepath.length-1],n=r!=null?`${r.pascalCase.safeName}Service`:"Service",i=r!=null?`${r.camelCase.unsafeName}Service`:"Service",a=r!=null?`${r.snakeCase.unsafeName}_service`:"service",o=a.toUpperCase(),c=bU(i);return{...t,name:{name:{originalName:n,camelCase:{safeName:i,unsafeName:i},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:o,unsafeName:o},pascalCase:{safeName:c,unsafeName:c}},fernFilepath:t.name.fernFilepath}}})})};var Nww={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[ge.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[ge.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[ge.OPENAPI_PYTHON_CLIENT]:"0.0.0",[ge.OPENAPI]:"0.0.20-1-gbbeb9bd",[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:Q9z(e.auth),headers:e.headers.map(t=>Jpc(t)),types:e.types.map(t=>L9z(t)),errors:e.errors.map(t=>K9z(t)),services:e.services.map(t=>$9z(t))})};function Mip(e){return e.allParts}function Q9z(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:st.V7.auth.AuthScheme.header(Jpc(t)))}}function Jpc(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:r1e(e.valueType)}}function r1e(e){return st.V8.types.TypeReference._visit(e,{container:t=>st.V7.types.TypeReference.container(Fww(t)),named:t=>st.V7.types.TypeReference.named(Qxr(t)),primitive:st.V7.types.TypeReference.primitive,unknown:st.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function Fww(e){return st.V8.types.ContainerType._visit(e,{list:t=>st.V7.types.ContainerType.list(r1e(t)),optional:t=>st.V7.types.ContainerType.optional(r1e(t)),set:t=>st.V7.types.ContainerType.set(r1e(t)),map:({keyType:t,valueType:r})=>st.V7.types.ContainerType.map({keyType:r1e(t),valueType:r1e(r)}),literal:st.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function Qxr(e){return{name:e.name,fernFilepath:Mip(e.fernFilepath)}}function L9z(e){return{docs:e.docs,availability:e.availability,name:Qxr(e.name),shape:U9z(e.shape),examples:e.examples.map(t=>G9z(t)),referencedTypes:e.referencedTypes.map(t=>Qxr(t))}}function U9z(e){return st.V8.types.Type._visit(e,{alias:t=>st.V7.types.Type.alias({aliasOf:r1e(t.aliasOf),resolvedType:V9z(t.resolvedType)}),enum:st.V7.types.Type.enum,object:t=>st.V7.types.Type.object({extends:t.extends.map(r=>Qxr(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:r1e(r.valueType)}))}),union:t=>st.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>W9z(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function V9z(e){return st.V8.types.ResolvedTypeReference._visit(e,{container:t=>st.V7.types.ResolvedTypeReference.container(Fww(t)),named:t=>st.V7.types.ResolvedTypeReference.named({name:Qxr(t.name),shape:t.shape}),primitive:st.V7.types.ResolvedTypeReference.primitive,unknown:st.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function W9z(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:H9z(e.shape)}}function H9z(e){return st.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(Qxr(t)),singleProperty:t=>st.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:r1e(t.type)}),noProperties:st.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function G9z(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:Bip(e.shape)}}function Bip(e){return st.V8.types.ExampleTypeShape._visit(e,{alias:t=>st.V7.types.ExampleTypeShape.alias({value:Y6e(t.value)}),enum:st.V7.types.ExampleTypeShape.enum,object:t=>st.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:Y6e(r.value),originalTypeDeclaration:Qxr(r.originalTypeDeclaration)}))}),union:t=>st.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:J9z(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function Y6e(e){return{jsonExample:e.jsonExample,shape:xww(e.shape)}}function xww(e){return st.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>st.V7.types.ExampleTypeReferenceShape.named({typeName:Qxr(t.typeName),shape:Bip(t.shape)}),container:t=>st.V7.types.ExampleTypeReferenceShape.container(st.V8.types.ExampleContainer._visit(t,{list:r=>st.V7.types.ExampleContainer.list(r.map(n=>Y6e(n))),set:r=>st.V7.types.ExampleContainer.set(r.map(n=>Y6e(n))),optional:r=>st.V7.types.ExampleContainer.optional(r!=null?Y6e(r):void 0),map:r=>st.V7.types.ExampleContainer.map(r.map(n=>({key:Y6e(n.key),value:Y6e(n.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:st.V7.types.ExampleTypeReferenceShape.primitive,unknown:st.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function J9z(e){return st.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:Qxr(t.typeName),shape:Bip(t.shape)}),singleProperty:t=>st.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:xww(t.shape)}),noProperties:st.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function K9z(e){return{docs:e.docs,name:Tip(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?r1e(e.type):void 0,statusCode:e.statusCode}}function Tip(e){return{name:e.name,fernFilepath:Mip(e.fernFilepath)}}function $9z(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:Mip(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>zww(t)),headers:e.headers.map(t=>Jpc(t)),endpoints:e.endpoints.map(t=>Y9z(t))}}function zww(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:r1e(e.valueType)}}function Y9z(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>X9z(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>zww(t)),sdkRequest:e.sdkRequest!=null?k9z(e.sdkRequest):void 0,requestBody:e.requestBody!=null?tLz(e.requestBody):void 0,response:rLz(e.response),headers:e.headers.map(t=>Jpc(t)),queryParameters:e.queryParameters.map(t=>Z9z(t)),examples:e.examples.map(t=>nLz(t))}}function X9z(e){return{docs:e.docs,error:Tip(e.error)}}function Z9z(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:r1e(e.valueType),allowMultiple:e.allowMultiple}}function k9z(e){return{requestParameterName:e.requestParameterName,shape:eLz(e.shape)}}function eLz(e){return st.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:r1e(t.requestBodyType)}),wrapper:st.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function tLz(e){return st.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>Qxr(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:r1e(r.valueType)}))}),reference:t=>st.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:r1e(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function rLz(e){return{docs:e.docs,type:e.type!=null?r1e(e.type):void 0}}function nLz(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>qww(t)),endpointPathParameters:e.endpointPathParameters.map(t=>qww(t)),queryParameters:e.queryParameters.map(t=>iLz(t)),serviceHeaders:e.serviceHeaders.map(t=>Rww(t)),endpointHeaders:e.endpointHeaders.map(t=>Rww(t)),request:e.request!=null?aLz(e.request):void 0,response:oLz(e.response)}}function qww(e){return{key:e.key,value:Y6e(e.value)}}function iLz(e){return{wireKey:e.wireKey,value:Y6e(e.value)}}function Rww(e){return{wireKey:e.wireKey,value:Y6e(e.value)}}function aLz(e){return st.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>st.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:Y6e(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?Qxr(r.originalTypeDeclaration):void 0}))}),reference:t=>st.V7.http.ExampleRequestBody.reference(Y6e(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function oLz(e){return st.V8.http.ExampleResponse._visit(e,{ok:t=>st.V7.http.ExampleResponse.ok({body:t.body!=null?Y6e(t.body):void 0}),error:t=>st.V7.http.ExampleResponse.error({error:Tip(t.error),body:t.body!=null?Y6e(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var Qww={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[ge.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[ge.JAVA_SDK]:"0.0.134-4-gef1ec4f",[ge.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[ge.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[ge.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:$n,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[n,i]of Object.entries(e.types))i.shape._type==="union"&&i.shape.baseProperties.length>0&&t.failWithoutThrowing(r!=null?`Type ${i.name.name.originalName} uses base-properties. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a union with base-properties.");return t.getResult()===RV.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var Lww={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.STOPLIGHT]:$n,[ge.OPENAPI]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Pg(e.services,r=>({docs:void 0,...r}));for(let r of Object.values(e.subpackages))if(r.docs!=null&&r.service!=null){let n=t[r.service];if(n==null)throw new Error("Service does not exist: "+r.service);n.docs=r.docs}return{...e,services:t}}};var Uww={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[ge.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.0.134-15-ge1ac358",[ge.JAVA_SDK]:"0.0.134-15-ge1ac358",[ge.JAVA_SPRING]:"0.0.134-15-ge1ac358",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.STOPLIGHT]:$n,[ge.OPENAPI]:Qt,[ge.POSTMAN]:"0.0.40-1-g9aa2117",[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:uLz(e.auth,t)})};function uLz(e,t){return{...e,schemes:e.schemes.map(r=>sLz(r,t))}}function sLz(e,{taskContext:t,targetGenerator:r}){return st.V11.auth.AuthScheme._visit(e,{bearer:st.V10.auth.AuthScheme.bearer,basic:st.V10.auth.AuthScheme.basic,header:n=>n.prefix!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying an auth header prefix. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an auth header prefix."):st.V10.auth.AuthScheme.header({docs:n.docs,availability:{status:st.V10.commons.AvailabilityStatus.GeneralAvailability,message:void 0},name:{name:n.name,wireValue:n.header},valueType:n.valueType}),_unknown:()=>{throw new Error("Unknown auth scheme: "+e._type)}})}var Www={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[ge.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.1.0-1-gdb5c636",[ge.JAVA_SDK]:"0.1.0-1-gdb5c636",[ge.JAVA_SPRING]:"0.1.0-1-gdb5c636",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.STOPLIGHT]:"0.0.23-8-g479c860",[ge.OPENAPI]:"0.0.22-1-g1c86b58",[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let n=Pg(e.types,i=>({...i,shape:st.V12.types.Type._visit(i.shape,{union:st.V11.types.Type.union,enum:st.V11.types.Type.enum,object:st.V11.types.Type.object,alias:a=>st.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:st.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:st.V11.types.ResolvedTypeReference.container,primitive:st.V11.types.ResolvedTypeReference.primitive,named:o=>o.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(Vww({taskContext:t,targetGenerator:r})):st.V11.types.ResolvedTypeReference.named({shape:o.shape,name:o.name}),unknown:st.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(Vww({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:n,services:Pg(e.services,i=>cLz(i,{taskContext:t,targetGenerator:r}))}}};function Vww(e){return e.targetGenerator!=null?`Generator ${e.targetGenerator.name}@${e.targetGenerator.version} does not support undiscriminated unions If you'd like to use this feature, please upgrade ${e.targetGenerator.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an undiscriminated union."}function cLz(e,t){return{...e,endpoints:e.endpoints.map(r=>lLz(r,t))}}function lLz(e,{taskContext:t,targetGenerator:r}){return e.streamingResponse!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a streaming response."):{...e,requestBody:e.requestBody!=null?st.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:st.V11.http.HttpRequestBody.inlinedRequestBody,reference:st.V11.http.HttpRequestBody.reference,fileUpload:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support file upload requests. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a file upload request."),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.requestBody?.type)}}):void 0,response:e.response!=null?{docs:e.response.docs,type:e.response.responseBodyType}:{docs:void 0,type:void 0}}}var Hww={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:Pg(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:st.V12.types.Type.undiscriminatedUnion({docs:void 0,members:t.shape.members})}),auth:{...e.auth,schemes:e.auth.schemes.map(t=>t._type!=="header"?t:{...t,name:t.name.name,header:t.name.wireValue})}})};var Gww={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:$n,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V14.types.Type._visit(r.shape,{union:n=>st.V13.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:Ute(i.valueType)})),types:n.types.map(i=>pLz(i))}),enum:st.V13.types.Type.enum,object:n=>st.V13.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:Ute(i.valueType)}))}),alias:n=>st.V13.types.Type.alias({aliasOf:Ute(n.aliasOf),resolvedType:hLz(n.resolvedType)}),undiscriminatedUnion:n=>st.V13.types.Type.undiscriminatedUnion(yLz(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:fLz(e.auth),headers:e.headers.map(r=>Nip(r)),types:t,services:Pg(e.services,r=>vLz(r)),errors:Pg(e.errors,r=>wLz(r))}}};function fLz(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:st.V13.auth.AuthScheme.header(dLz(t)))}}function dLz(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:Ute(e.valueType)}}function Nip(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:Ute(e.valueType)}}function Ute(e){return st.V14.types.TypeReference._visit(e,{container:t=>st.V13.types.TypeReference.container(Jww(t)),primitive:t=>t==="DATE"?st.V13.types.TypeReference.primitive(st.V13.types.PrimitiveType.String):st.V13.types.TypeReference.primitive(t),named:st.V13.types.TypeReference.named,unknown:st.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function Jww(e){return st.V14.types.ContainerType._visit(e,{list:t=>st.V13.types.ContainerType.list(Ute(t)),optional:t=>st.V13.types.ContainerType.optional(Ute(t)),set:t=>st.V13.types.ContainerType.set(Ute(t)),map:({keyType:t,valueType:r})=>st.V13.types.ContainerType.map({keyType:Ute(t),valueType:Ute(r)}),literal:st.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function pLz(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:_Lz(e.shape)}}function _Lz(e){return st.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:Ute(t.type)}),noProperties:st.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function hLz(e){return st.V14.types.ResolvedTypeReference._visit(e,{container:t=>st.V13.types.ResolvedTypeReference.container(Jww(t)),named:st.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?st.V13.types.ResolvedTypeReference.primitive(st.V13.types.PrimitiveType.String):st.V13.types.ResolvedTypeReference.primitive(t),unknown:st.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function yLz(e){return{members:e.members.map(t=>({...t,type:Ute(t.type)}))}}function vLz(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>Kww(t)),headers:e.headers.map(t=>Nip(t)),endpoints:e.endpoints.map(t=>bLz(t))}}function Kww(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ute(e.valueType)}}function bLz(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>Kww(t)),sdkRequest:e.sdkRequest!=null?mLz(e.sdkRequest):void 0,requestBody:e.requestBody!=null?ALz(e.requestBody):void 0,response:e.response!=null?qip(e.response):void 0,headers:e.headers.map(t=>Nip(t)),queryParameters:e.queryParameters.map(t=>gLz(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?Rip(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?PLz(e.sdkResponse):void 0}}function gLz(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ute(e.valueType),allowMultiple:e.allowMultiple}}function mLz(e){return{requestParameterName:e.requestParameterName,shape:OLz(e.shape)}}function OLz(e){return st.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:Ute(t.requestBodyType)}),wrapper:st.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function ALz(e){return st.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:Ute(r.valueType)}))}),reference:t=>st.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:Ute(t.requestBodyType)}),fileUpload:t=>st.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:Ute(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function qip(e){return{docs:e.docs,responseBodyType:Ute(e.responseBodyType)}}function Rip(e){return{dataEventType:Ute(e.dataEventType),terminator:e.terminator}}function PLz(e){return st.V14.http.SdkResponse._visit(e,{streaming:t=>st.V13.http.SdkResponse.streaming(Rip(t)),nonStreaming:t=>st.V13.http.SdkResponse.nonStreaming(qip(t)),maybeStreaming:t=>st.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:qip(t.nonStreaming),streaming:Rip(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function wLz(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?Ute(e.type):void 0,statusCode:e.statusCode}}var $ww={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[ge.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.0.52-3-gd9df38df",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V15.types.Type._visit(r.shape,{union:n=>st.V14.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:Vte(i.valueType)})),types:n.types.map(i=>SLz(i))}),enum:st.V14.types.Type.enum,object:n=>st.V14.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:Vte(i.valueType)}))}),alias:n=>st.V14.types.Type.alias({aliasOf:Vte(n.aliasOf),resolvedType:CLz(n.resolvedType)}),undiscriminatedUnion:n=>st.V14.types.Type.undiscriminatedUnion(ILz(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:jLz(e.auth),headers:e.headers.map(r=>zip(r)),types:t,services:Pg(e.services,r=>MLz(r)),errors:Pg(e.errors,r=>xLz(r))}}};function jLz(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:st.V14.auth.AuthScheme.header(ELz(t)))}}function ELz(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:Vte(e.valueType)}}function zip(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:Vte(e.valueType)}}function Vte(e){return st.V15.types.TypeReference._visit(e,{container:t=>st.V14.types.TypeReference.container(Yww(t)),primitive:t=>t==="BASE_64"?st.V14.types.TypeReference.primitive(st.V14.types.PrimitiveType.String):st.V14.types.TypeReference.primitive(t),named:st.V14.types.TypeReference.named,unknown:st.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function Yww(e){return st.V15.types.ContainerType._visit(e,{list:t=>st.V14.types.ContainerType.list(Vte(t)),optional:t=>st.V14.types.ContainerType.optional(Vte(t)),set:t=>st.V14.types.ContainerType.set(Vte(t)),map:({keyType:t,valueType:r})=>st.V14.types.ContainerType.map({keyType:Vte(t),valueType:Vte(r)}),literal:st.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function SLz(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:DLz(e.shape)}}function DLz(e){return st.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:Vte(t.type)}),noProperties:st.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function CLz(e){return st.V15.types.ResolvedTypeReference._visit(e,{container:t=>st.V14.types.ResolvedTypeReference.container(Yww(t)),named:st.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?st.V14.types.ResolvedTypeReference.primitive(st.V14.types.PrimitiveType.String):st.V14.types.ResolvedTypeReference.primitive(t),unknown:st.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function ILz(e){return{members:e.members.map(t=>({...t,type:Vte(t.type)}))}}function MLz(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>Xww(t)),headers:e.headers.map(t=>zip(t)),endpoints:e.endpoints.map(t=>BLz(t))}}function Xww(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Vte(e.valueType)}}function BLz(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>Xww(t)),sdkRequest:e.sdkRequest!=null?qLz(e.sdkRequest):void 0,requestBody:e.requestBody!=null?NLz(e.requestBody):void 0,response:e.response!=null?Fip(e.response):void 0,headers:e.headers.map(t=>zip(t)),queryParameters:e.queryParameters.map(t=>TLz(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?xip(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?FLz(e.sdkResponse):void 0}}function TLz(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Vte(e.valueType),allowMultiple:e.allowMultiple}}function qLz(e){return{requestParameterName:e.requestParameterName,shape:RLz(e.shape)}}function RLz(e){return st.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:Vte(t.requestBodyType)}),wrapper:st.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function NLz(e){return st.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:Vte(r.valueType)}))}),reference:t=>st.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:Vte(t.requestBodyType)}),fileUpload:t=>st.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:Vte(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Fip(e){return{docs:e.docs,responseBodyType:Vte(e.responseBodyType)}}function xip(e){return{dataEventType:Vte(e.dataEventType),terminator:e.terminator}}function FLz(e){return st.V15.http.SdkResponse._visit(e,{streaming:t=>st.V14.http.SdkResponse.streaming(xip(t)),nonStreaming:t=>st.V14.http.SdkResponse.nonStreaming(Fip(t)),maybeStreaming:t=>st.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:Fip(t.nonStreaming),streaming:xip(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function xLz(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?Vte(e.type):void 0,statusCode:e.statusCode}}var Zww={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[ge.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[ge.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[ge.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>e.basePath!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying a base-path in api.yml. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a root base-path."):{...e,services:Pg(e.services,n=>({...n,pathParameters:Qip(n.pathParameters),endpoints:n.endpoints.map(i=>({...i,allPathParameters:Qip(i.allPathParameters),pathParameters:Qip(i.pathParameters)}))}))}};function Qip(e){return e.map(t=>zLz(t))}function zLz(e){return{...e,availability:{status:st.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var kww={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[n,i]of Object.entries(e.types))if(i.shape._type==="union"&&i.shape.extends.length>0)return t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support union types with extensions. See ${n} in file ${i.name.fernFilepath.allParts.join("/")}. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains union types with extensions.");return{...e}}};var ejw={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[ge.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[ge.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.3.0-3-ge125e311",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:Pg(e.services,n=>{let i=n.endpoints[0]?.baseUrl;return n.endpoints.some(a=>a.baseUrl!==i)?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support endpoint-level server URLs. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains endpoint-level server URLs."):{...n,baseUrl:i}})})};var rjw={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:$n,[ge.TYPESCRIPT_BROWSER_SDK]:$n,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[ge.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[ge.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:"0.0.44-1-gbf4b0f3",[ge.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:$n,[ge.GO_SDK]:$n,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Pg(e.services,r=>QLz(r,t)),types:Pg(e.types,r=>GLz(r,t))})};function QLz(e,t){return{...e,endpoints:e.endpoints.map(r=>LLz(r,t))}}function LLz(e,t){return{...e,examples:e.examples.map(r=>ULz(r,t))}}function ULz(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>Lip(r,t)),servicePathParameters:e.servicePathParameters.map(r=>Lip(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>Lip(r,t)),serviceHeaders:e.serviceHeaders.map(r=>tjw(r,t)),endpointHeaders:e.endpointHeaders.map(r=>tjw(r,t)),queryParameters:e.queryParameters.map(r=>VLz(r,t)),request:e.request!=null?WLz(e.request,t):void 0,response:HLz(e.response,t)}}function Lip(e,t){return{key:e.key,value:X6e(e.value,t)}}function tjw(e,t){return{wireKey:e.wireKey,value:X6e(e.value,t)}}function VLz(e,t){return{wireKey:e.wireKey,value:X6e(e.value,t)}}function WLz(e,t){return st.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>st.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(n=>({wireKey:n.wireKey,value:X6e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),reference:r=>st.V18.http.ExampleRequestBody.reference(X6e(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function HLz(e,t){return st.V19.http.ExampleResponse._visit(e,{ok:r=>st.V18.http.ExampleResponse.ok({body:r.body!=null?X6e(r.body,t):void 0}),error:r=>st.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?X6e(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function GLz(e,t){return{...e,examples:e.examples.map(r=>JLz(r,t))}}function JLz(e,t){return{...e,shape:Uip(e.shape,t)}}function Uip(e,t){return st.V19.types.ExampleTypeShape._visit(e,{alias:r=>st.V18.types.ExampleTypeShape.alias({value:X6e(r.value,t)}),object:r=>st.V18.types.ExampleTypeShape.object({properties:r.properties.map(n=>({wireKey:n.wireKey,value:X6e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),union:r=>st.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:st.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:n=>st.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:n.jsonExample,shape:njw(n.shape,t)}),samePropertiesAsObject:n=>st.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:n.typeName,shape:Uip(n.shape,t)}),noProperties:st.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:st.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function X6e(e,t){return{jsonExample:e.jsonExample,shape:njw(e.shape,t)}}function njw(e,t){return st.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>st.V18.types.ExampleTypeReferenceShape.primitive(KLz(r,t)),named:r=>st.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:Uip(r.shape,t)}),container:r=>st.V18.types.ExampleTypeReferenceShape.container(st.V19.types.ExampleContainer._visit(r,{list:n=>st.V18.types.ExampleContainer.list(n.map(i=>X6e(i,t))),set:n=>st.V18.types.ExampleContainer.set(n.map(i=>X6e(i,t))),optional:n=>st.V18.types.ExampleContainer.optional(n!=null?X6e(n,t):void 0),map:n=>st.V18.types.ExampleContainer.map(n.map(i=>({key:X6e(i.key,t),value:X6e(i.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:st.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function KLz(e,{taskContext:t,targetGenerator:r}){return e.type==="date"?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support examples for dates. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains date examples."):e}var ijw={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[ge.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.5.26-rc0-3-gdfabd674",[ge.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[ge.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[ge.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[ge.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[ge.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[ge.GO_FIBER]:$n,[ge.GO_MODEL]:"0.0.0",[ge.GO_SDK]:"0.0.0",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Pg(e.services,r=>$Lz(r,t))})};function $Lz(e,t){return{...e,endpoints:e.endpoints.map(r=>YLz(r,t))}}function YLz(e,t){return{...e,response:e.response!=null?ajw(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?XLz(e.sdkResponse,t):void 0}}function ajw(e,t){return st.V20.http.HttpResponse._visit(e,{fileDownload:()=>ojw(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function XLz(e,t){return st.V20.http.SdkResponse._visit(e,{fileDownload:()=>ojw(t),streaming:st.V19.http.SdkResponse.streaming,maybeStreaming:r=>st.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:ajw(r.nonStreaming,t)}),json:st.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function ojw({targetGenerator:e,taskContext:t}){return t.failAndThrow(e!=null?`Generator ${e.name}@${e.version} does not support file download. If you'd like to use this feature, please upgrade ${e.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains file download.")}var ujw={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:$n,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Pg(e.services,r=>ZLz(r,t))})};function ZLz(e,t){return{...e,endpoints:e.endpoints.map(r=>kLz(r,t))}}function kLz(e,t){return{...e,streamingResponse:e.streamingResponse!=null?Vip(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?eUz(e.sdkResponse,t):void 0}}function Vip(e,{taskContext:t,targetGenerator:r}){return{dataEventType:st.V21.http.StreamingResponseChunkType._visit(e.dataEventType,{json:n=>n,text:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming text responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains streaming text responses."),_unknown:()=>{throw new Error("Unknown StreamingResponseChunkType: "+e.dataEventType.type)}}),terminator:e.terminator}}function eUz(e,t){return st.V21.http.SdkResponse._visit(e,{fileDownload:st.V20.http.SdkResponse.fileDownload,streaming:r=>st.V20.http.SdkResponse.streaming(Vip(r,t)),maybeStreaming:r=>st.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:Vip(r.streaming,t),nonStreaming:r.nonStreaming}),json:st.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var sjw={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.5.0-3-gac7ce7c",[ge.GO_MODEL]:"0.0.14-8-g2fa39f7",[ge.GO_SDK]:"0.0.14-8-g2fa39f7",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:Pg(e.services,t=>tUz(t))})};function tUz(e){return{...e,endpoints:e.endpoints.map(t=>rUz(t))}}function rUz(e){return{...e,...e.response!=null?st.V22.http.HttpResponse._visit(e.response,{json:t=>({response:st.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:st.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:st.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:st.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:st.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var fjw={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[ge.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.7.4-rc3-4-g6cf92f81",[ge.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:"0.0.28-3-g112d3dd",[ge.STOPLIGHT]:"0.0.28-3-g112d3dd",[ge.POSTMAN]:"0.0.44-4-gddab2ae",[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],n={};for(let[i,a]of Object.entries(e.services)){let o=[];for(let c of a.endpoints){let d=nUz(c);d==null?r.push(c):o.push(d)}n[i]={...a,endpoints:o,headers:a.headers.map(c=>Hip(c)),pathParameters:a.pathParameters.map(c=>Kpc(c))}}return r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(i=>i.name.originalName).join(", ")} will be skipped.`)),{...e,auth:{...e.auth,schemes:e.auth.schemes.map(i=>aUz(i))},headers:e.headers.map(i=>Hip(i)),types:Pg(e.types,i=>oUz(i)),services:n,errors:Pg(e.errors,i=>dUz(i)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(i=>Kpc(i)),variables:e.variables.map(i=>pUz(i))}}};function nUz(e){let t;if(!(e.requestBody!=null&&(t=iUz(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>Hip(r)),pathParameters:e.pathParameters.map(r=>Kpc(r)),allPathParameters:e.allPathParameters.map(r=>Kpc(r)),queryParameters:e.queryParameters.map(r=>_Uz(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:hUz(e.sdkRequest.shape)}:void 0,response:e.response!=null?yUz(e.response):void 0,examples:e.examples.map(r=>vUz(r))}}function iUz(e){switch(e.type){case"bytes":return;case"fileUpload":return st.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>gUz(t))});case"inlinedRequestBody":return st.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>mUz(t))});case"reference":return st.V22.http.HttpRequestBody.reference({...e,requestBodyType:Wte(e.requestBodyType)});default:ks(e)}}function Hip(e){return{...e,valueType:Wte(e.valueType)}}function aUz(e){return e._visit({bearer:st.V22.auth.AuthScheme.bearer,basic:st.V22.auth.AuthScheme.basic,header:t=>st.V22.auth.AuthScheme.header({...t,valueType:Wte(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function oUz(e){return{...e,shape:uUz(e.shape),examples:e.examples.map(t=>sUz(t))}}function uUz(e){return e._visit({alias:t=>st.V22.types.Type.alias({...t,aliasOf:Wte(t.aliasOf),resolvedType:lUz(t.resolvedType)}),enum:st.V22.types.Type.enum,object:t=>st.V22.types.Type.object({...t,properties:t.properties.map(r=>cjw(r))}),union:t=>st.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>cjw(r)),types:t.types.map(r=>({...r,shape:fUz(r.shape)}))}),undiscriminatedUnion:t=>st.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:Wte(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function sUz(e){return{...e,shape:Gip(e.shape)}}function Gip(e){return e._visit({alias:t=>st.V22.types.ExampleTypeShape.alias({...t,value:yut(t.value)}),enum:st.V22.types.ExampleTypeShape.enum,object:t=>st.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:yut(r.value)}))}),union:t=>st.V22.types.ExampleTypeShape.union({...t,properties:cUz(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function yut(e){return{...e,shape:Jip(e.shape)}}function Jip(e){return e._visit({primitive:t=>st.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:st.V22.types.ExamplePrimitive.integer,double:st.V22.types.ExamplePrimitive.double,string:st.V22.types.ExamplePrimitive.string,boolean:st.V22.types.ExamplePrimitive.boolean,long:st.V22.types.ExamplePrimitive.long,datetime:r=>st.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:st.V22.types.ExamplePrimitive.date,uuid:st.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>st.V22.types.ExampleTypeReferenceShape.named({...t,shape:Gip(t.shape)}),container:t=>st.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>st.V22.types.ExampleContainer.list(r.map(n=>yut(n))),set:r=>st.V22.types.ExampleContainer.set(r.map(n=>yut(n))),optional:r=>st.V22.types.ExampleContainer.optional(r!=null?yut(r):void 0),map:r=>st.V22.types.ExampleContainer.map(r.map(n=>({key:yut(n.key),value:yut(n.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:st.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function cUz(e){return e._visit({singleProperty:t=>st.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:Jip(t.shape)}),noProperties:st.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>st.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:Gip(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function Wte(e){return e._visit({container:t=>st.V22.types.TypeReference.container(djw(t)),primitive:st.V22.types.TypeReference.primitive,named:st.V22.types.TypeReference.named,unknown:st.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function djw(e){return e._visit({list:t=>st.V22.types.ContainerType.list(Wte(t)),set:t=>st.V22.types.ContainerType.set(Wte(t)),optional:t=>st.V22.types.ContainerType.optional(Wte(t)),map:t=>st.V22.types.ContainerType.map({keyType:Wte(t.keyType),valueType:Wte(t.valueType)}),literal:st.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function lUz(e){return e._visit({container:t=>st.V22.types.ResolvedTypeReference.container(djw(t)),primitive:st.V22.types.ResolvedTypeReference.primitive,named:st.V22.types.ResolvedTypeReference.named,unknown:st.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function cjw(e){return{...e,valueType:Wte(e.valueType)}}function fUz(e){return e._visit({noProperties:st.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>st.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:Wte(t.type)}),samePropertiesAsObject:st.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function dUz(e){return{...e,type:e.type!=null?Wte(e.type):void 0}}function pUz(e){return{...e,type:Wte(e.type)}}function Kpc(e){return{...e,valueType:Wte(e.valueType)}}function _Uz(e){return{...e,valueType:Wte(e.valueType)}}function hUz(e){return e._visit({justRequestBody:t=>st.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:Wte(t.requestBodyType)}),wrapper:st.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function yUz(e){return e._visit({json:t=>st.V22.http.HttpResponse.json({...t,responseBodyType:Wte(t.responseBodyType)}),fileDownload:st.V22.http.HttpResponse.fileDownload,streaming:t=>st.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>st.V22.http.StreamingResponseChunkType.json(Wte(r)),text:st.V22.http.StreamingResponseChunkType.text,_other:()=>{throw new Error("Unknown streaming data event type: "+t.dataEventType.type)}})}),_other:()=>{throw new Error("Unknown response: "+e.type)}})}function vUz(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>Wip(t)),servicePathParameters:e.servicePathParameters.map(t=>Wip(t)),endpointPathParameters:e.endpointPathParameters.map(t=>Wip(t)),serviceHeaders:e.serviceHeaders.map(t=>ljw(t)),endpointHeaders:e.endpointHeaders.map(t=>ljw(t)),queryParameters:e.queryParameters.map(t=>bUz(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>st.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:yut(r.value)}))}),reference:t=>st.V22.http.ExampleRequestBody.reference({...t,shape:Jip(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>st.V22.http.ExampleResponse.ok({...t,body:t.body!=null?yut(t.body):void 0}),error:t=>st.V22.http.ExampleResponse.error({...t,body:t.body!=null?yut(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function Wip(e){return{...e,value:yut(e.value)}}function bUz(e){return{...e,value:yut(e.value)}}function ljw(e){return{...e,value:yut(e.value)}}function gUz(e){return e._visit({file:st.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>st.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:Wte(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function mUz(e){return{...e,valueType:Wte(e.valueType)}}var Cm={};pf(Cm,{V23:()=>tK5,V24:()=>rK5,V25:()=>nK5,V26:()=>iK5,V27:()=>aK5,V28:()=>oK5,V29:()=>uK5,V30:()=>sK5,V31:()=>cK5,V32:()=>lK5,V33:()=>fK5,V34:()=>dK5,V35:()=>pK5,V36:()=>_K5,V37:()=>hK5,V38:()=>yK5,V39:()=>vK5,V40:()=>bK5,V41:()=>gK5,V42:()=>mK5,V43:()=>OK5,V44:()=>AK5,V45:()=>PK5,V46:()=>wK5,V47:()=>jK5,V48:()=>EK5,V49:()=>SK5,V50:()=>DK5,V51:()=>CK5,V52:()=>IK5,V53:()=>MK5,V54:()=>BK5,V55:()=>TK5,V56:()=>qK5,V57:()=>RK5,V58:()=>NK5,V59:()=>FK5,V60:()=>xK5,V61:()=>F0});var tK5=pa(Lc(),1),rK5=pa(fc(),1),nK5=pa(tc(),1),iK5=pa(Gs(),1),aK5=pa(Rs(),1),oK5=pa(Ns(),1),uK5=pa(Fs(),1),sK5=pa(Ss(),1),cK5=pa(ws(),1),lK5=pa(ss(),1),fK5=pa(Ou(),1),dK5=pa(_u(),1),pK5=pa(eu(),1),_K5=pa(tu(),1),hK5=pa(Xo(),1),yK5=pa(Jo(),1),vK5=pa(Po(),1),bK5=pa(wo(),1),gK5=pa(go(),1),mK5=pa(_o(),1),OK5=pa(po(),1),AK5=pa(lo(),1),PK5=pa(io(),1),wK5=pa(Xa(),1),jK5=pa(Ya(),1),EK5=pa(Ja(),1),SK5=pa(Va(),1),DK5=pa(xa(),1),CK5=pa(Ma(),1),IK5=pa(Ea(),1),MK5=pa(Rn(),1),BK5=pa(tj(),1),TK5=pa(Bw(),1),qK5=pa(Tw(),1),RK5=pa(ow(),1),NK5=pa(uw(),1),FK5=pa(sw(),1),xK5=pa(DP(),1);var EVE={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var SVE={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.4.9-1-ge0997b3",[ge.JAVA_SDK]:"0.4.9-1-ge0997b3",[ge.JAVA_SPRING]:"0.4.9-1-ge0997b3",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],n=[],i={};for(let[a,o]of Object.entries(e.services)){let c=[];for(let d of o.endpoints){let s;if(d.sdkRequest!=null&&(s=zK5(d.sdkRequest),s==null)){r.push(d);continue}if(d.response!=null){let u=d.response._visit({fileDownload:l=>st.V24.HttpResponse.fileDownload(l),json:l=>st.V24.HttpResponse.json(l),streaming:l=>st.V24.HttpResponse.streaming(l),text:()=>(n.push(d),st.V24.HttpResponse.json({docs:void 0,responseBodyType:st.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});c.push({...d,sdkRequest:s,response:u})}else c.push({...d,sdkRequest:s,response:void 0})}i[a]={...o,endpoints:c}}return n.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support text/plain responses. `),n.length===1&&n[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${n[0].name.originalName} response type will be casted to unknown.`):t.taskContext.logger.warn(`Therefore, endpoints ${n.map(a=>a.name.originalName).join(", ")} response types will be casted to unknown.`)),r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(a=>a.name.originalName).join(", ")} will be skipped.`)),{...e,services:i}}};function zK5(e){let t=e.shape;if(t.type==="wrapper")return{shape:st.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:st.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var CVE={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[ge.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,WK5(r)])),headers:e.headers.map(t=>aOl(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(n=>QK5(n))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,LK5(r)]))})};function QK5(e){return{...e,headers:e.headers.map(t=>aOl(t)),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function LK5(e){return{...e,endpoints:e.endpoints.map(t=>UK5(t)),headers:e.headers.map(t=>aOl(t)),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function UK5(e){return{...e,headers:e.headers.map(t=>aOl(t)),queryParameters:e.queryParameters.map(t=>VK5(t)),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function aOl(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function VK5(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function WK5(e){return{...e,shape:e.shape._visit({union:t=>st.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>DVE(r))}),object:t=>st.V25.Type.object({...t,properties:t.properties.map(r=>DVE(r))}),enum:t=>st.V25.Type.enum({...t,values:t.values.map(r=>HK5(r))}),alias:t=>st.V25.Type.alias(t),undiscriminatedUnion:t=>st.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function DVE(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function HK5(e){return{...e,availability:e.availability==null?{status:st.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var IVE={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.6.1-3-g94ee67a",[ge.GO_MODEL]:"0.6.1-3-g94ee67a",[ge.GO_SDK]:"0.6.1-3-g94ee67a",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,GK5(r)]))})};function GK5(e){return{...e,endpoints:e.endpoints.map(t=>JK5(t))}}function JK5(e){return{...e,response:e.response!=null?KK5(e.response):void 0}}function KK5(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?st.V26.HttpResponse.json(t):st.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var MVE={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[ge.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.8.1-1-g0f40bf18",[ge.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.9.0-2-g6b0be0e",[ge.GO_MODEL]:"0.9.0-2-g6b0be0e",[ge.GO_SDK]:"0.9.0-2-g6b0be0e",[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:P$5(e.auth),headers:uOl(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,D$5(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,i$5(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,ZK5(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,XK5(r)])),pathParameters:oOl(e.pathParameters),variables:$K5(e.variables)})};function $K5(e){return e.map(t=>YK5(t))}function YK5(e){return{...e,type:ZZ(e.type)}}function XK5(e){return{...e,type:e.type!=null?ZZ(e.type):void 0}}function ZK5(e){return e.map(t=>kK5(t))}function kK5(e){return{...e,headers:uOl(e.headers),payload:e$5(e.payload)}}function e$5(e){switch(e.type){case"inlinedPayload":return st.V27.WebhookPayload.inlinedPayload(t$5(e));case"reference":return st.V27.WebhookPayload.reference({...e,payloadType:ZZ(e.payloadType)})}}function t$5(e){return{...e,properties:r$5(e.properties)}}function r$5(e){return e.map(t=>n$5(t))}function n$5(e){return{...e,valueType:ZZ(e.valueType)}}function i$5(e){return{...e,endpoints:a$5(e.endpoints),headers:uOl(e.headers),pathParameters:oOl(e.pathParameters)}}function a$5(e){return e.map(t=>o$5(t))}function o$5(e){return{...e,headers:uOl(e.headers),pathParameters:oOl(e.pathParameters),allPathParameters:oOl(e.allPathParameters),queryParameters:O$5(e.queryParameters),requestBody:e.requestBody!=null?_$5(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?f$5(e.sdkRequest):void 0,response:e.response!=null?u$5(e.response):void 0}}function u$5(e){switch(e.type){case"json":return st.V27.HttpResponse.json(l$5(e.value));case"fileDownload":return st.V27.HttpResponse.fileDownload(e);case"text":return st.V27.HttpResponse.text(e);case"streaming":return st.V27.HttpResponse.streaming(s$5(e));default:ks(e)}}function s$5(e){return{...e,dataEventType:c$5(e.dataEventType)}}function c$5(e){switch(e.type){case"json":return st.V27.StreamingResponseChunkType.json(ZZ(e.json));case"text":return st.V27.StreamingResponseChunkType.text();default:ks(e)}}function l$5(e){switch(e.type){case"response":return st.V27.JsonResponse.response({...e,responseBodyType:ZZ(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:ZZ(e.responseBodyType),responseProperty:e.responseProperty!=null?RVE(e.responseProperty):void 0});default:ks(e)}}function f$5(e){return{...e,shape:d$5(e.shape)}}function d$5(e){switch(e.type){case"justRequestBody":return st.V27.SdkRequestShape.justRequestBody(p$5(e.value));case"wrapper":return st.V27.SdkRequestShape.wrapper(e);default:ks(e)}}function p$5(e){switch(e.type){case"typeReference":return st.V27.SdkRequestBodyType.typeReference(BVE(e));case"bytes":return st.V27.SdkRequestBodyType.bytes(e);default:ks(e)}}function _$5(e){switch(e.type){case"inlinedRequestBody":return st.V27.HttpRequestBody.inlinedRequestBody(b$5(e));case"reference":return st.V27.HttpRequestBody.reference(BVE(e));case"fileUpload":return st.V27.HttpRequestBody.fileUpload(h$5(e));case"bytes":return st.V27.HttpRequestBody.bytes(e);default:ks(e)}}function h$5(e){return{...e,properties:y$5(e.properties)}}function y$5(e){return e.map(t=>v$5(t))}function v$5(e){switch(e.type){case"file":return st.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return st.V27.FileUploadRequestProperty.bodyProperty(TVE(e));default:ks(e)}}function BVE(e){return{...e,requestBodyType:ZZ(e.requestBodyType)}}function b$5(e){return{...e,properties:g$5(e.properties)}}function g$5(e){return e.map(t=>TVE(t))}function TVE(e){return{...e,valueType:ZZ(e.valueType)}}function oOl(e){return e.map(t=>m$5(t))}function m$5(e){return{...e,valueType:ZZ(e.valueType)}}function O$5(e){return e.map(t=>A$5(t))}function A$5(e){return{...e,valueType:ZZ(e.valueType)}}function P$5(e){return{...e,schemes:w$5(e.schemes)}}function w$5(e){return e.map(t=>j$5(t))}function j$5(e){switch(e.type){case"basic":return st.V27.AuthScheme.basic(e);case"bearer":return st.V27.AuthScheme.bearer(e);case"header":return E$5(e);default:ks(e)}}function E$5(e){return st.V27.AuthScheme.header({...e,valueType:ZZ(e.valueType)})}function uOl(e){return e.map(t=>S$5(t))}function S$5(e){return{...e,valueType:ZZ(e.valueType)}}function D$5(e){return{...e,shape:C$5(e.shape)}}function C$5(e){switch(e.type){case"alias":return st.V27.Type.alias(I$5(e));case"enum":return st.V27.Type.enum(e);case"object":return st.V27.Type.object(M$5(e));case"union":return st.V27.Type.union(B$5(e));case"undiscriminatedUnion":return st.V27.Type.undiscriminatedUnion(T$5(e));default:ks(e)}}function I$5(e){return{aliasOf:ZZ(e.aliasOf),resolvedType:F$5(e.resolvedType)}}function M$5(e){return{...e,properties:qVE(e.properties)}}function B$5(e){return{...e,types:q$5(e.types),baseProperties:qVE(e.baseProperties)}}function T$5(e){return{members:N$5(e.members)}}function qVE(e){return e.map(t=>RVE(t))}function RVE(e){return{...e,valueType:ZZ(e.valueType)}}function q$5(e){return e.map(t=>({...t,shape:R$5(t.shape)}))}function R$5(e){switch(e.propertiesType){case"samePropertiesAsObject":return st.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return st.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:ZZ(e.type)});case"noProperties":return st.V27.SingleUnionTypeProperties.noProperties();default:ks(e)}}function N$5(e){return e.map(t=>({...t,type:ZZ(t.type)}))}function F$5(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?st.V27.ResolvedTypeReference.primitive(st.V27.PrimitiveType.Boolean):st.V27.ResolvedTypeReference.container(st.V27.ContainerType.literal(st.V27.Literal.string(e.container.literal.string))):st.V27.ResolvedTypeReference.container(NVE(e.container));case"named":return st.V27.ResolvedTypeReference.named(e);case"primitive":return st.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return st.V27.ResolvedTypeReference.unknown();default:ks(e)}}function ZZ(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?st.V27.TypeReference.primitive(st.V27.PrimitiveType.Boolean):st.V27.TypeReference.container(st.V27.ContainerType.literal(st.V27.Literal.string(e.container.literal.string))):st.V27.TypeReference.container(NVE(e.container));case"named":return st.V27.TypeReference.named(e);case"primitive":return st.V27.TypeReference.primitive(e.primitive);case"unknown":return st.V27.TypeReference.unknown();default:ks(e)}}function NVE(e){switch(e.type){case"list":return st.V27.ContainerType.list(ZZ(e.list));case"map":return st.V27.ContainerType.map({keyType:ZZ(e.keyType),valueType:ZZ(e.valueType)});case"optional":return st.V27.ContainerType.optional(ZZ(e.optional));case"set":return st.V27.ContainerType.set(ZZ(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return st.V27.ContainerType.literal(st.V27.Literal.string(e.literal.string));default:ks(e)}}var xVE={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[ge.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.8.6-1-g3d8d8591",[ge.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[ge.JAVA_SDK]:"0.5.14-1-ge4bcd98",[ge.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,x$5({typeId:t,allTypes:e.types})]))})};function x$5({typeId:e,allTypes:t}){let r=FVE({typeId:e,allTypes:t});return{availability:r.availability,docs:r.docs,name:r.name,shape:r.shape,examples:r.examples,referencedTypes:Array.from(r.referencedTypes).map(n=>{let i=FVE({typeId:n,allTypes:t});return{typeId:n,fernFilepath:i.name.fernFilepath,name:i.name.name}})}}function FVE({typeId:e,allTypes:t}){let r=t[e];if(r==null)throw new Error(`Type definition for type id ${e} is undefined`);return r}var zVE={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[ge.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new JL_(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},JL_=class{ir;constructor(t){this.ir=t}convertTypes(t){return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,this.convertType(n)]))}convertServices(t){return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,this.convertService(n)]))}convertService(t){return{...t,endpoints:this.convertEndpoints(t.endpoints)}}convertEndpoints(t){return t.map(r=>({...r,examples:this.convertExampleEndpointCalls(r.examples)}))}convertExampleEndpointCalls(t){return t.map(r=>({...r,rootPathParameters:this.convertExamplePathParameters(r.rootPathParameters),servicePathParameters:this.convertExamplePathParameters(r.servicePathParameters),endpointPathParameters:this.convertExamplePathParameters(r.endpointPathParameters),serviceHeaders:this.convertExampleHeaders(r.serviceHeaders),endpointHeaders:this.convertExampleHeaders(r.endpointHeaders),queryParameters:this.convertExampleQueryParameters(r.queryParameters),request:r.request!=null?this.convertExampleRequestBody(r.request):void 0,response:this.convertExampleResponse(r.response)}))}convertExamplePathParameters(t){return t.map(r=>({key:r.name.originalName,value:this.convertExampleTypeReference(r.value)}))}convertExampleHeaders(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleQueryParameters(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleRequestBody(t){switch(t.type){case"inlinedRequestBody":return st.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return st.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:ks(t)}}convertExampleResponse(t){switch(t.type){case"ok":return st.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return st.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:ks(t)}}convertType(t){return{...t,examples:this.convertExampleTypes(t.examples)}}convertExampleTypes(t){return t.map(r=>this.convertExampleType(r))}convertExampleType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeReferences(t){return t.map(r=>this.convertExampleTypeReference(r))}convertExampleTypeReference(t){return{...t,shape:this.convertExampleTypeReferenceShape(t.shape)}}convertExampleTypeReferenceShape(t){switch(t.type){case"primitive":return st.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return st.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return st.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return st.V29.ExampleTypeReferenceShape.unknown(t);default:ks(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return st.V29.ExamplePrimitive.integer(t.integer);case"double":return st.V29.ExamplePrimitive.double(t.double);case"string":return st.V29.ExamplePrimitive.string(t.string.original);case"boolean":return st.V29.ExamplePrimitive.boolean(t.boolean);case"long":return st.V29.ExamplePrimitive.long(t.long);case"datetime":return st.V29.ExamplePrimitive.datetime(t.datetime);case"date":return st.V29.ExamplePrimitive.date(t.date);case"uuid":return st.V29.ExamplePrimitive.uuid(t.uuid);default:ks(t)}}convertExampleContainer(t){switch(t.type){case"list":return st.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return st.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return st.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return st.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:ks(t)}}convertKeyValuePairs(t){return t.map(r=>({key:this.convertExampleTypeReference(r.key),value:this.convertExampleTypeReference(r.value)}))}convertExampleNamedType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeShape(t){switch(t.type){case"alias":return st.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return st.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return st.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return st.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:ks(t)}}convertExampleObjectType(t){return{properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}}convertExampleUnionType(t){return{wireDiscriminantValue:t.singleUnionType.wireDiscriminantValue.wireValue,properties:this.convertExampleSingleUnionTypeProperties(t.singleUnionType.shape)}}convertExampleSingleUnionTypeProperties(t){switch(t.type){case"samePropertiesAsObject":{let r=this.ir.types[t.typeId]?.name;if(r==null)throw new Error(`Internal error; type ID ${t.typeId} does not exist in the IR`);return st.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(st.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return st.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return st.V29.ExampleSingleUnionTypeProperties.noProperties();default:ks(t)}}};var QVE={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.8.8",[ge.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.8.8",[ge.TYPESCRIPT_EXPRESS]:"0.8.8",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.7.0-rc0",[ge.JAVA_SDK]:"0.7.0-rc0",[ge.JAVA_SPRING]:"0.7.0-rc0",[ge.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[ge.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.7.5-1-gb54fb677",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:$n,[ge.RUBY_SDK]:$n,[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V30.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({apiName:e.apiName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:e.auth,headers:e.headers,types:e.types,webhookGroups:e.webhookGroups,errors:e.errors,subpackages:e.subpackages,rootPackage:e.rootPackage,constants:e.constants,environments:e.environments,basePath:e.basePath,pathParameters:e.pathParameters,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,variables:e.variables,serviceTypeReferenceInfo:e.serviceTypeReferenceInfo,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{availability:r.availability,name:r.name,displayName:r.displayName,basePath:r.basePath,endpoints:r.endpoints.map(n=>({id:n.id,docs:n.docs,availability:n.availability,name:n.name,displayName:n.displayName,method:n.method,headers:n.headers,baseUrl:n.baseUrl,path:n.path,fullPath:n.fullPath,pathParameters:n.pathParameters,allPathParameters:n.allPathParameters,queryParameters:n.queryParameters,requestBody:n.requestBody,sdkRequest:n.sdkRequest,response:n.response,errors:n.errors,auth:n.auth,examples:n.examples})),headers:r.headers,pathParameters:r.pathParameters}]))})};var UVE={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.9.4-2-g139cf36",[ge.GO_MODEL]:"0.9.4-2-g139cf36",[ge.GO_SDK]:"0.9.4-2-g139cf36",[ge.RUBY_MODEL]:"0.0.0",[ge.RUBY_SDK]:"0.0.0",[ge.CSHARP_MODEL]:$n,[ge.CSHARP_SDK]:$n,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:W$5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(z$5)}]))})};function IQa({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function z$5(e){return{...e,examples:IQa({examples:e.examples,convert:Q$5})}}function Q$5(e){let t;if(e.request!=null&&(t=L$5(e.request),t==null))return;let r=U$5(e.response);if(r!=null)return{...e,rootPathParameters:IQa({examples:e.rootPathParameters,convert:KL_}),endpointPathParameters:IQa({examples:e.endpointPathParameters,convert:KL_}),servicePathParameters:IQa({examples:e.servicePathParameters,convert:KL_}),endpointHeaders:IQa({examples:e.endpointHeaders,convert:LVE}),serviceHeaders:IQa({examples:e.serviceHeaders,convert:LVE}),queryParameters:IQa({examples:e.queryParameters,convert:V$5}),request:t,response:r}}function L$5(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let n=Wke(r.value);n!=null&&t.push({...r,value:n})}return st.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=$L_(e.shape);return t==null?void 0:st.V31.ExampleRequestBody.reference({...e,shape:t})}default:ks(e)}}function U$5(e){switch(e.type){case"ok":{if(e.body==null)return st.V31.ExampleResponse.ok({body:void 0});let t=Wke(e.body);return t==null?void 0:st.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return st.V31.ExampleResponse.error({...e,body:void 0});let t=Wke(e.body);return t==null?void 0:st.V31.ExampleResponse.error({...e,body:t})}}}function KL_(e){let t=Wke(e.value);if(t!=null)return{...e,value:t}}function LVE(e){let t=Wke(e.value);if(t!=null)return{...e,value:t}}function V$5(e){let t=Wke(e.value);if(t!=null)return{...e,value:t}}function W$5(e){let t=[];for(let r of e){let n=H$5(r);n!=null&&t.push(n)}return t}function H$5(e){let t=VVE(e.shape);if(t!=null)return{...e,shape:t}}function VVE(e){switch(e.type){case"enum":return st.V31.ExampleTypeShape.enum(e);case"alias":{let t=Wke(e.value);return t==null?void 0:st.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let n=Wke(r.value);n!=null&&t.push({...r,value:n})}return st.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=G$5(e.singleUnionType);return t==null?void 0:st.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:ks(e)}}function Wke(e){let t=$L_(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function G$5(e){let t=J$5(e.shape);if(t!=null)return{...e,shape:t}}function J$5(e){switch(e.type){case"noProperties":return st.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=$L_(e.shape);return t==null?void 0:st.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let n=Wke(r.value);n!=null&&t.push({...r,value:n})}return st.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:ks(e)}}function $L_(e){switch(e.type){case"container":{let t=K$5(e.container);return t==null?void 0:st.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=VVE(e.shape);return t==null?void 0:st.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return st.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return st.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:ks(e)}}function K$5(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let n=Wke(r);n!=null&&t.push(n)}return st.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let n=Wke(r);n!=null&&t.push(n)}return st.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let n=Wke(r.key),i=Wke(r.value);n!=null&&i!=null&&t.push({key:n,value:i})}return st.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return st.V31.ExampleContainer.optional();let t=Wke(e.optional);return t==null?st.V31.ExampleContainer.optional():st.V31.ExampleContainer.optional(t)}default:ks(e)}}var WVE={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.12.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.12.0",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.13.0-3-g8c56a41",[ge.GO_MODEL]:"0.13.0-3-g8c56a41",[ge.GO_SDK]:"0.13.0-3-g8c56a41",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:"0.0.0",[ge.CSHARP_SDK]:"0.0.0",[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new YL_(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>t.convertEndpoint(i))}]))}}},YL_=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:st.V33.TypeReference.container(st.V33.ContainerType.optional(st.V33.TypeReference.primitive("STRING")))}:r),examples:$$5({examples:t.examples,convert:Y$5})}}isTypeReferenceObject(t){switch(t.type){case"container":return this.isContainerObject(t.container);case"named":return this.isNamedTypeObject(t);case"primitive":return!1;case"unknown":return!0;default:ks(t)}}isContainerObject(t){switch(t.type){case"map":case"list":case"set":return!0;case"optional":return this.isTypeReferenceObject(t.optional);case"literal":return!1;default:ks(t)}}isNamedTypeObject(t){let r=this.ir.types[t.typeId];if(r==null)return!0;switch(r.shape.type){case"alias":return this.isTypeReferenceObject(r.shape.aliasOf);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:ks(r.shape)}}};function $$5({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function Y$5(e){return{...e,queryParameters:e.queryParameters.filter(t=>!XL_(t.value))}}function XL_(e){switch(e.shape.type){case"container":return X$5(e.shape.container);case"named":return Z$5(e.shape);case"primitive":return!1;case"unknown":return!0;default:ks(e.shape)}}function X$5(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&XL_(e.optional);default:ks(e)}}function Z$5(e){switch(e.shape.type){case"alias":return XL_(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:ks(e.shape)}}var rNo=pa(UPd(),1);var HVE={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.10.4",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V33.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,requestBody:i.requestBody?._visit({inlinedRequestBody:a=>rNo.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>rNo.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>rNo.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(o=>(o.type==="file"&&o.value.type==="fileArray"&&t.taskContext.logger.warn(`${i.method} ${i.fullPath.head} accepts a list of files however the ${t.targetGenerator?.name}@${t.targetGenerator?.version} only supports accepting a single file. File an [issue](https://github.com/fern-api/fern/issues) to add request for file arrays in ${t.targetGenerator?.name}@${t.targetGenerator?.version}!`),o.type==="file"?rNo.FernIrV33.FileUploadRequestProperty.file({...o.value}):o))}),bytes:a=>rNo.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var GVE={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.18.0",[ge.GO_MODEL]:"0.18.0",[ge.GO_SDK]:"0.18.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V34.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>({docs:n.docs,availability:n.availability,id:n.id,name:n.name,displayName:n.displayName,method:n.method,headers:n.headers,baseUrl:n.baseUrl,path:n.path,fullPath:n.fullPath,pathParameters:n.pathParameters,allPathParameters:n.allPathParameters,queryParameters:n.queryParameters,requestBody:n.requestBody,sdkRequest:n.sdkRequest,response:n.response,errors:n.errors,auth:n.auth,idempotent:n.idempotent,examples:n.examples}))}]))})};var JVE={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.11.6",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var KVE={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.13.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.13.0",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"0.12.0",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V36.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,examples:i.examples.filter(a=>a.exampleType==="userProvided")}))}]))})};var $VE={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.15.0-rc0",[ge.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.9.0-rc0",[ge.PYTHON_PYDANTIC]:"0.9.0-rc0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"1.2.0-rc0",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V37.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,response:i.response?._visit({fileDownload:a=>st.V37.HttpResponse.fileDownload(a),json:a=>st.V37.HttpResponse.json(a),streaming:a=>a._visit({json:o=>st.V37.HttpResponse.streaming({dataEventType:st.V37.StreamingResponseChunkType.json(o.payload),docs:o.docs,terminator:o.terminator}),sse:()=>{},text:o=>st.V37.HttpResponse.streaming({dataEventType:st.V37.StreamingResponseChunkType.text(),docs:o.docs,terminator:void 0}),_other:()=>{}}),text:a=>st.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var YVE={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.9.0-rc1",[ge.PYTHON_PYDANTIC]:"0.9.0-rc1",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"1.4.0-rc1",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:"0.7.0-rc0",[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>k$5(r))}})};function k$5(e){switch(e.type){case"basic":return st.V38.AuthScheme.basic(e);case"bearer":return st.V38.AuthScheme.bearer(e);case"header":return st.V38.AuthScheme.header(e);case"oauth":return st.V38.AuthScheme.bearer({docs:e.docs,token:{originalName:"token",camelCase:{unsafeName:"token",safeName:"token"},pascalCase:{unsafeName:"Token",safeName:"Token"},snakeCase:{unsafeName:"token",safeName:"token"},screamingSnakeCase:{unsafeName:"TOKEN",safeName:"TOKEN"}},tokenEnvVar:void 0});default:ks(e)}}var XVE={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:"0.20.0",[ge.GO_MODEL]:"0.20.0",[ge.GO_SDK]:"0.20.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var ZVE={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V40.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,errors:Object.fromEntries(Object.entries(e.errors).map(([r,n])=>[r,{name:n.name,discriminantValue:n.discriminantValue,type:n.type,statusCode:n.statusCode,docs:n.docs}]))})};var kVE={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.8.0-rc0",[ge.JAVA_SDK]:"0.9.0-rc0",[ge.JAVA_SPRING]:"0.8.0-rc0",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>eY5(r))}})};function eY5(e){switch(e.type){case"basic":return st.V41.AuthScheme.basic(e);case"bearer":return st.V41.AuthScheme.bearer(e);case"header":return st.V41.AuthScheme.header(e);case"oauth":return st.V41.AuthScheme.oauth(tY5(e));default:ks(e)}}function tY5(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:st.V41.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:{...e.configuration.tokenEndpoint,endpointReference:e.configuration.tokenEndpoint.endpointReference.endpointId},refreshEndpoint:e.configuration.refreshEndpoint!=null?{...e.configuration.refreshEndpoint,endpointReference:e.configuration.refreshEndpoint?.endpointReference.endpointId}:void 0})};default:ks(e.configuration.type)}}var eWE={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.17.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.17.0",[ge.TYPESCRIPT_EXPRESS]:"0.13.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V42.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,response:i.response?.body}))}]))})};var rWE={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V43.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>({...i,examples:i.examples.map(a=>rY5({example:a})).filter(ij)}))}]))})};function rY5({example:e}){return e._visit({userProvided:t=>st.V43.HttpEndpointExample.userProvided(tWE({example:t})),generated:t=>st.V43.HttpEndpointExample.generated(tWE({example:t})),_other:()=>{}})}function tWE({example:e}){return{...e,response:nY5({example:e.response})}}function nY5({example:e}){switch(e.type){case"ok":return iY5({example:e.value});case"error":return st.V43.ExampleResponse.error(e);default:ks(e)}}function iY5({example:e}){switch(e.type){case"body":return st.V43.ExampleResponse.ok({body:e.value});case"sse":return st.V43.ExampleResponse.ok({body:void 0});case"stream":return st.V43.ExampleResponse.ok({body:void 0});default:ks(e)}}var nWE={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V45.types.Type._visit(r.shape,{union:n=>st.V44.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:T9(i.valueType)})),types:n.types.map(i=>yY5(i))}),enum:st.V44.types.Type.enum,object:n=>st.V44.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:T9(i.valueType)}))}),alias:n=>st.V44.types.Type.alias({aliasOf:T9(n.aliasOf),resolvedType:bY5(n.resolvedType)}),undiscriminatedUnion:n=>st.V44.types.Type.undiscriminatedUnion(gY5(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:fY5(e.auth),headers:e.headers.map(r=>nNo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>nNo(r)),types:t,services:Pg(e.services,r=>mY5(r)),errors:Pg(e.errors,r=>NY5(r)),webhookGroups:Pg(e.webhookGroups,r=>sY5(r)),websocketChannels:Pg(e.websocketChannels,r=>aY5(r)),pathParameters:e.pathParameters.map(r=>l3u(r)),variables:e.variables.map(r=>OY5(r))}}};function aY5(e){return{...e,headers:e.headers.map(t=>nNo(t)),queryParameters:e.queryParameters.map(t=>f3u(t)),pathParameters:e.pathParameters.map(t=>l3u(t)),messages:e.messages.map(t=>oY5(t))}}function oY5(e){return{...e,body:uY5(e.body)}}function uY5(e){switch(e.type){case"inlinedBody":return st.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:T9(t.valueType)}))});case"reference":return st.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:T9(e.bodyType)})}}function sY5(e){return e.map(t=>cY5(t))}function cY5(e){return{...e,headers:e.headers.map(t=>nNo(t)),payload:lY5(e.payload)}}function lY5(e){switch(e.type){case"reference":return st.V44.webhooks.WebhookPayload.reference({...e,payloadType:T9(e.payloadType)});case"inlinedPayload":return st.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:T9(t.valueType)}))})}}function fY5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V44.auth.AuthScheme.basic(t);case"bearer":return st.V44.auth.AuthScheme.bearer(t);case"header":return st.V44.auth.AuthScheme.header(dY5(t));case"oauth":return st.V44.auth.AuthScheme.oauth(pY5(t))}})}}function dY5(e){return{...e,valueType:T9(e.valueType)}}function pY5(e){return{...e,configuration:st.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:_Y5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?hY5(e.configuration.refreshEndpoint):void 0})}}function _Y5(e){return{...e,requestProperties:{clientId:sOl(e.requestProperties.clientId),clientSecret:sOl(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?sOl(e.requestProperties.scopes):void 0},responseProperties:{accessToken:_Ti(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?_Ti(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?_Ti(e.responseProperties.refreshToken):void 0}}}function hY5(e){return{...e,requestProperties:{refreshToken:sOl(e.requestProperties.refreshToken)},responseProperties:{accessToken:_Ti(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?_Ti(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?_Ti(e.responseProperties.refreshToken):void 0}}}function nNo(e){return{...e,valueType:T9(e.valueType)}}function T9(e){return st.V45.types.TypeReference._visit(e,{container:t=>st.V44.types.TypeReference.container(iWE(t)),primitive:t=>t.v1==="BIG_INTEGER"?st.V44.types.TypeReference.primitive(st.V44.types.PrimitiveType.String):st.V44.types.TypeReference.primitive(t.v1),named:st.V44.types.TypeReference.named,unknown:st.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function iWE(e){return st.V45.types.ContainerType._visit(e,{list:t=>st.V44.types.ContainerType.list(T9(t)),optional:t=>st.V44.types.ContainerType.optional(T9(t)),set:t=>st.V44.types.ContainerType.set(T9(t)),map:({keyType:t,valueType:r})=>st.V44.types.ContainerType.map({keyType:T9(t),valueType:T9(r)}),literal:st.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function yY5(e){return{...e,shape:vY5(e.shape)}}function vY5(e){return st.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:T9(t.type)}),noProperties:st.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function bY5(e){return st.V45.types.ResolvedTypeReference._visit(e,{container:t=>st.V44.types.ResolvedTypeReference.container(iWE(t)),named:st.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?st.V44.types.ResolvedTypeReference.primitive(st.V44.types.PrimitiveType.String):st.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:st.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function gY5(e){return{members:e.members.map(t=>({...t,type:T9(t.type)}))}}function mY5(e){return{...e,pathParameters:e.pathParameters.map(t=>l3u(t)),headers:e.headers.map(t=>nNo(t)),endpoints:e.endpoints.map(t=>AY5(t))}}function l3u(e){return{...e,valueType:T9(e.valueType)}}function OY5(e){return{...e,type:T9(e.type)}}function AY5(e){return{...e,pagination:e.pagination!=null?SY5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>l3u(t)),pathParameters:e.pathParameters.map(t=>l3u(t)),sdkRequest:e.sdkRequest!=null?MY5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?qY5(e.requestBody):void 0,response:e.response!=null?PY5(e.response):void 0,headers:e.headers.map(t=>nNo(t)),queryParameters:e.queryParameters.map(t=>f3u(t))}}function PY5(e){return{...e,body:e.body!=null?wY5(e.body):void 0}}function wY5(e){switch(e.type){case"json":return st.V44.http.HttpResponseBody.json(jY5(e.value));case"fileDownload":return st.V44.http.HttpResponseBody.fileDownload(e);case"text":return st.V44.http.HttpResponseBody.text(e);case"streaming":return st.V44.http.HttpResponseBody.streaming(EY5(e.value))}}function jY5(e){switch(e.type){case"response":return st.V44.http.JsonResponse.response({...e,responseBodyType:T9(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:T9(e.responseBodyType),responseProperty:e.responseProperty!=null?ZL_(e.responseProperty):void 0})}}function EY5(e){switch(e.type){case"json":return st.V44.http.StreamingResponse.json({...e,payload:T9(e.payload)});case"text":return st.V44.http.StreamingResponse.text(e);case"sse":return st.V44.http.StreamingResponse.sse({...e,payload:T9(e.payload)})}}function SY5(e){switch(e.type){case"cursor":return st.V44.http.Pagination.cursor(DY5(e));case"offset":return st.V44.http.Pagination.offset(CY5(e))}}function DY5(e){return{...e,page:f3u(e.page),next:_Ti(e.next),results:_Ti(e.results)}}function CY5(e){return{...e,page:f3u(e.page),results:_Ti(e.results)}}function sOl(e){return{...e,property:IY5(e.property)}}function IY5(e){switch(e.type){case"query":return st.V44.RequestPropertyValue.query(f3u(e));case"body":return st.V44.RequestPropertyValue.body(ZL_(e))}}function _Ti(e){return{...e,property:ZL_(e.property)}}function ZL_(e){return{...e,valueType:T9(e.valueType)}}function f3u(e){return{...e,valueType:T9(e.valueType)}}function MY5(e){return{...e,shape:BY5(e.shape)}}function BY5(e){return st.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V44.http.SdkRequestShape.justRequestBody(TY5(t)),wrapper:st.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function TY5(e){switch(e.type){case"bytes":return st.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:T9(e.requestBodyType)})}}function qY5(e){return st.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:T9(r.valueType)}))}),reference:t=>st.V44.http.HttpRequestBody.reference({...t,requestBodyType:T9(t.requestBodyType)}),fileUpload:t=>st.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:T9(r.valueType)});case"file":return st.V44.http.FileUploadRequestProperty.file(RY5(r.value))}})}),bytes:t=>st.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function RY5(e){switch(e.type){case"file":return st.V44.http.FileProperty.file(e);case"fileArray":return st.V44.http.FileProperty.fileArray(e)}}function NY5(e){return{...e,type:e.type!=null?T9(e.type):void 0}}var oWE={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.21.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.21.0",[ge.TYPESCRIPT_EXPRESS]:"0.16.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"0.9.0",[ge.JAVA_SDK]:"0.10.0",[ge.JAVA_SPRING]:"0.9.0",[ge.PYTHON_FASTAPI]:"0.10.1",[ge.PYTHON_PYDANTIC]:"0.9.1",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"2.9.9",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:FY5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>({...n,examples:xY5(n.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:zY5(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(n=>({...n,shape:bre(n.shape)}))}]))})};function bre(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.list(r.map(n=>bre(n)))),set:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.set(r.map(n=>bre(n)))),map:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.map(r.map(n=>({key:bre(n.key),value:bre(n.value)})))),optional:r=>st.V45.ExampleTypeReferenceShape.container(st.V45.ExampleContainer.optional(r!=null?bre(r):void 0)),literal:r=>st.V45.ExampleTypeReferenceShape.primitive(r._visit({string:n=>st.V45.ExamplePrimitive.string(n),integer:n=>st.V45.ExamplePrimitive.integer(n),double:n=>st.V45.ExamplePrimitive.double(n),long:n=>st.V45.ExamplePrimitive.long(n),boolean:n=>st.V45.ExamplePrimitive.boolean(n),datetime:n=>st.V45.ExamplePrimitive.datetime(n),date:n=>st.V45.ExamplePrimitive.date(n),uuid:n=>st.V45.ExamplePrimitive.uuid(n),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}})}),named:t=>({...e,shape:st.V45.ExampleTypeReferenceShape.named({...t,shape:uWE(t.shape)})}),primitive:t=>({...e,shape:st.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>st.V45.ExamplePrimitive.string(r),integer:r=>st.V45.ExamplePrimitive.integer(r),double:r=>st.V45.ExamplePrimitive.double(r),long:r=>st.V45.ExamplePrimitive.long(r),boolean:r=>st.V45.ExamplePrimitive.boolean(r),datetime:r=>st.V45.ExamplePrimitive.datetime(r),date:r=>st.V45.ExamplePrimitive.date(r),uuid:r=>st.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:st.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function aWE(e){return{...e,properties:e.properties.map(t=>({...t,value:bre(t.value)}))}}function uWE(e){return e.type==="alias"?st.V45.ExampleTypeShape.alias({value:bre(e.value)}):e.type==="object"?st.V45.ExampleTypeShape.object(aWE(e)):e.type==="union"?st.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>st.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:aWE(t.object)}),singleProperty:t=>st.V45.ExampleSingleUnionTypeProperties.singleProperty(bre(t)),noProperties:()=>st.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?st.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:bre(e.singleUnionType)}):st.V45.ExampleTypeShape.enum(e)}function FY5(e){return e.map(t=>({...t,shape:uWE(t.shape)}))}function cOl(e){return e.map(t=>({...t,value:bre(t.value)}))}function kL_(e){return e.map(t=>({...t,value:bre(t.value)}))}function sWE(e){return e.map(t=>({...t,value:bre(t.value)}))}function xY5(e){return e.map(t=>{let r={...t,rootPathParameters:cOl(t.rootPathParameters),servicePathParameters:cOl(t.servicePathParameters),endpointPathParameters:cOl(t.endpointPathParameters),serviceHeaders:kL_(t.serviceHeaders),endpointHeaders:kL_(t.endpointHeaders),queryParameters:sWE(t.queryParameters),request:t.request?._visit({inlinedRequestBody:n=>st.V45.ExampleRequestBody.inlinedRequestBody({...n,properties:n.properties.map(i=>({...i,value:bre(i.value)}))}),reference:n=>st.V45.ExampleRequestBody.reference(bre(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}}),response:t.response._visit({ok:n=>st.V45.ExampleResponse.ok(n._visit({body:i=>st.V45.ExampleEndpointSuccessResponse.body(i!=null?bre(i):void 0),stream:i=>st.V45.ExampleEndpointSuccessResponse.stream(i.map(bre)),sse:i=>st.V45.ExampleEndpointSuccessResponse.sse(i.map(a=>({...a,data:bre(a.data)}))),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),error:n=>st.V45.ExampleResponse.error({...n,body:n.body!=null?bre(n.body):void 0}),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})};return t._visit({userProvided:()=>st.V45.HttpEndpointExample.userProvided(r),generated:()=>st.V45.HttpEndpointExample.generated(r),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})})}function zY5(e){return e.map(t=>({...t,pathParameters:cOl(t.pathParameters),headers:kL_(t.headers),queryParameters:sWE(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:n=>st.V45.ExampleWebSocketMessageBody.inlinedBody({...n,properties:n.properties.map(i=>({...i,value:bre(i.value)}))}),reference:n=>st.V45.ExampleWebSocketMessageBody.reference(bre(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})}))}))}var cWE={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V46.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>{let n=r.endpoints.map(i=>{let{autogeneratedExamples:a,userSpecifiedExamples:o,...c}=i;return{...c,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...i.userSpecifiedExamples.map(s=>{if(s.example!=null)return st.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(ij),...i.autogeneratedExamples.map(s=>st.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:n}]}))})};var lWE={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.29.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.29.0",[ge.TYPESCRIPT_EXPRESS]:"0.17.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V47.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,n])=>{let i=n.endpoints.map(a=>({...a,pagination:a.pagination!=null?LY5(a.pagination):void 0}));return[r,{...n,endpoints:i}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:QY5(t)},services:t}}};function QY5(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function LY5(e){switch(e.type){case"cursor":{let t=UY5(e);return t!=null?st.V47.Pagination.cursor(t):void 0}case"offset":{let t=VY5(e);return t!=null?st.V47.Pagination.offset(t):void 0}default:ks(e)}}function UY5(e){let t=fWE(e.page);if(t!=null)return{...e,page:t}}function VY5(e){if(e.step!=null)return;let t=fWE(e.page);if(t!=null)return{...e,page:t}}function fWE(e){switch(e.property.type){case"query":return e.property}}var dWE={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:"0.11.0-rc0",[ge.PYTHON_PYDANTIC]:"0.10.0-rc0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:"2.11.0-rc0",[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:$n,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V48.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,n])=>{let i=n.endpoints.flatMap(a=>{let o;return a.response?.body!=null&&(o=a.response.body?._visit({json:d=>st.V48.HttpResponseBody.json({...d}),fileDownload:d=>st.V48.HttpResponseBody.fileDownload({...d}),text:d=>st.V48.HttpResponseBody.text({...d}),streaming:d=>st.V48.HttpResponseBody.streaming({...d}),streamParameter:()=>{},_other:()=>{}}),o==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:o}}});return[r,{...n,endpoints:i}]}));return{...e,services:t}}};var pWE={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.34.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:"0.34.0",[ge.TYPESCRIPT_EXPRESS]:"0.17.2",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:"0.0.0",[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Pg(e.types,r=>({...r,shape:st.V50.types.Type._visit(r.shape,{union:n=>st.V49.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:q9(i.valueType)})),types:n.types.map(i=>tX5(i))}),enum:st.V49.types.Type.enum,object:n=>st.V49.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:q9(i.valueType)}))}),alias:n=>st.V49.types.Type.alias({aliasOf:q9(n.aliasOf),resolvedType:nX5(n.resolvedType)}),undiscriminatedUnion:n=>st.V49.types.Type.undiscriminatedUnion(iX5(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:YY5(e.auth),headers:e.headers.map(r=>iNo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>iNo(r)),types:t,services:Pg(e.services,r=>aX5(r)),errors:Pg(e.errors,r=>OX5(r)),webhookGroups:Pg(e.webhookGroups,r=>JY5(r)),websocketChannels:Pg(e.websocketChannels,r=>WY5(r)),pathParameters:e.pathParameters.map(r=>d3u(r)),variables:e.variables.map(r=>oX5(r))}}};function WY5(e){return{...e,headers:e.headers.map(t=>iNo(t)),queryParameters:e.queryParameters.map(t=>tU_(t)),pathParameters:e.pathParameters.map(t=>d3u(t)),messages:e.messages.map(t=>HY5(t))}}function HY5(e){return{...e,body:GY5(e.body)}}function GY5(e){switch(e.type){case"inlinedBody":return st.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:q9(t.valueType)}))});case"reference":return st.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:q9(e.bodyType)})}}function JY5(e){return e.map(t=>KY5(t))}function KY5(e){return{...e,headers:e.headers.map(t=>iNo(t)),payload:$Y5(e.payload)}}function $Y5(e){switch(e.type){case"reference":return st.V49.webhooks.WebhookPayload.reference({...e,payloadType:q9(e.payloadType)});case"inlinedPayload":return st.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:q9(t.valueType)}))})}}function YY5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V49.auth.AuthScheme.basic(t);case"bearer":return st.V49.auth.AuthScheme.bearer(t);case"header":return st.V49.auth.AuthScheme.header(XY5(t));case"oauth":return st.V49.auth.AuthScheme.oauth(ZY5(t))}})}}function XY5(e){return{...e,valueType:q9(e.valueType)}}function ZY5(e){return{...e,configuration:st.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:kY5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?eX5(e.configuration.refreshEndpoint):void 0})}}function kY5(e){return{...e,requestProperties:{clientId:Tki(e.requestProperties.clientId),clientSecret:Tki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Tki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:hTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?hTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?hTi(e.responseProperties.refreshToken):void 0}}}function eX5(e){return{...e,requestProperties:{refreshToken:Tki(e.requestProperties.refreshToken)},responseProperties:{accessToken:hTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?hTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?hTi(e.responseProperties.refreshToken):void 0}}}function iNo(e){return{...e,valueType:q9(e.valueType)}}function q9(e){return st.V50.types.TypeReference._visit(e,{container:t=>st.V49.types.TypeReference.container(_WE(t)),primitive:t=>t.v2?.type==="integer"?st.V49.types.TypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?st.V49.types.TypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?st.V49.types.TypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.string(t.v2)}):st.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:st.V49.types.TypeReference.named,unknown:st.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function _WE(e){return st.V50.types.ContainerType._visit(e,{list:t=>st.V49.types.ContainerType.list(q9(t)),optional:t=>st.V49.types.ContainerType.optional(q9(t)),set:t=>st.V49.types.ContainerType.set(q9(t)),map:({keyType:t,valueType:r})=>st.V49.types.ContainerType.map({keyType:q9(t),valueType:q9(r)}),literal:st.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function tX5(e){return{...e,shape:rX5(e.shape)}}function rX5(e){return st.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:q9(t.type)}),noProperties:st.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function nX5(e){return st.V50.types.ResolvedTypeReference._visit(e,{container:t=>st.V49.types.ResolvedTypeReference.container(_WE(t)),named:st.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:st.V49.types.PrimitiveTypeV2.string(t.v2)}):st.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:st.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function iX5(e){return{members:e.members.map(t=>({...t,type:q9(t.type)}))}}function aX5(e){return{...e,pathParameters:e.pathParameters.map(t=>d3u(t)),headers:e.headers.map(t=>iNo(t)),endpoints:e.endpoints.map(t=>uX5(t))}}function d3u(e){return{...e,valueType:q9(e.valueType)}}function oX5(e){return{...e,type:q9(e.type)}}function uX5(e){return{...e,pagination:e.pagination!=null?dX5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>d3u(t)),pathParameters:e.pathParameters.map(t=>d3u(t)),sdkRequest:e.sdkRequest!=null?yX5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?gX5(e.requestBody):void 0,response:e.response!=null?sX5(e.response):void 0,headers:e.headers.map(t=>iNo(t)),queryParameters:e.queryParameters.map(t=>tU_(t))}}function sX5(e){return{...e,body:e.body!=null?cX5(e.body):void 0}}function cX5(e){switch(e.type){case"json":return st.V49.http.HttpResponseBody.json(hWE(e.value));case"fileDownload":return st.V49.http.HttpResponseBody.fileDownload(e);case"text":return st.V49.http.HttpResponseBody.text(e);case"streaming":return st.V49.http.HttpResponseBody.streaming(yWE(e.value));case"streamParameter":return st.V49.http.HttpResponseBody.streamParameter(fX5(e))}}function hWE(e){switch(e.type){case"response":return st.V49.http.JsonResponse.response({...e,responseBodyType:q9(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:q9(e.responseBodyType),responseProperty:e.responseProperty!=null?eU_(e.responseProperty):void 0})}}function yWE(e){switch(e.type){case"json":return st.V49.http.StreamingResponse.json({...e,payload:q9(e.payload)});case"text":return st.V49.http.StreamingResponse.text(e);case"sse":return st.V49.http.StreamingResponse.sse({...e,payload:q9(e.payload)})}}function lX5(e){switch(e.type){case"json":return st.V49.http.NonStreamHttpResponseBody.json(hWE(e.value));case"text":return st.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function fX5(e){return{nonStreamResponse:lX5(e.nonStreamResponse),streamResponse:yWE(e.streamResponse)}}function dX5(e){switch(e.type){case"cursor":return st.V49.http.Pagination.cursor(pX5(e));case"offset":return st.V49.http.Pagination.offset(_X5(e))}}function pX5(e){return{...e,page:Tki(e.page),next:hTi(e.next),results:hTi(e.results)}}function _X5(e){return{...e,page:Tki(e.page),results:hTi(e.results),step:e.step!=null?Tki(e.step):void 0}}function Tki(e){return{...e,property:hX5(e.property)}}function hX5(e){switch(e.type){case"query":return st.V49.RequestPropertyValue.query(tU_(e));case"body":return st.V49.RequestPropertyValue.body(eU_(e))}}function hTi(e){return{...e,property:eU_(e.property)}}function eU_(e){return{...e,valueType:q9(e.valueType)}}function tU_(e){return{...e,valueType:q9(e.valueType)}}function yX5(e){return{...e,streamParameter:e.streamParameter!=null?Tki(e.streamParameter):void 0,shape:vX5(e.shape)}}function vX5(e){return st.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V49.http.SdkRequestShape.justRequestBody(bX5(t)),wrapper:st.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function bX5(e){switch(e.type){case"bytes":return st.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:q9(e.requestBodyType)})}}function gX5(e){return st.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:q9(r.valueType)}))}),reference:t=>st.V49.http.HttpRequestBody.reference({...t,requestBodyType:q9(t.requestBodyType)}),fileUpload:t=>st.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:q9(r.valueType)});case"file":return st.V49.http.FileUploadRequestProperty.file(mX5(r.value))}})}),bytes:t=>st.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function mX5(e){switch(e.type){case"file":return st.V49.http.FileProperty.file(e);case"fileArray":return st.V49.http.FileProperty.fileArray(e)}}function OX5(e){return{...e,type:e.type!=null?q9(e.type):void 0}}var gWE={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"0.1.2",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Pg(e.types,r=>{let n=r.autogeneratedExamples.map(a=>vWE(a)),i=r.userProvidedExamples.map(a=>vWE(a));return{...r,examples:[...n,...i]}});return{...e,types:t,services:Pg(e.services,r=>BX5(r)),errors:Pg(e.errors,r=>FX5(r)),webhookGroups:Pg(e.webhookGroups,r=>jX5(r)),websocketChannels:Pg(e.websocketChannels,r=>AX5(r))}}};function AX5(e){return{...e,examples:e.examples.map(t=>PX5(t))}}function PX5(e){return{...e,pathParameters:e.pathParameters.map(t=>lOl(t)),headers:e.headers.map(t=>rU_(t)),queryParameters:e.queryParameters.map(t=>mWE(t)),messages:e.messages.map(t=>({...t,body:wX5(t.body)}))}}function mWE(e){return{...e,value:Hce(e.value)}}function rU_(e){return{...e,value:Hce(e.value)}}function lOl(e){return{...e,value:Hce(e.value)}}function wX5(e){switch(e.type){case"inlinedBody":return st.V50.ExampleWebSocketMessageBody.inlinedBody(OWE(e));case"reference":return st.V50.ExampleWebSocketMessageBody.reference(Hce(e))}}function OWE(e){return{...e,properties:e.properties.map(t=>({...t,value:Hce(t.value)}))}}function jX5(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:Hce(r.payload)}))}))}function vWE(e){return{...e,shape:AWE(e.shape)}}function nU_(e){switch(e.type){case"primitive":return st.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return st.V50.ExampleTypeReferenceShape.container(EX5(e));case"unknown":return st.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:AWE(e.shape)})}}function EX5(e){switch(e.container.type){case"list":return st.V50.ExampleContainer.list(e.container.list.map(t=>Hce(t)));case"set":return st.V50.ExampleContainer.set(e.container.set.map(t=>Hce(t)));case"optional":return st.V50.ExampleContainer.optional(e.container.optional!=null?Hce(e.container.optional):void 0);case"map":return st.V50.ExampleContainer.map(e.container.map.map(t=>({key:Hce(t.key),value:Hce(t.value)})));case"literal":return st.V50.ExampleContainer.literal(e.container.literal)}}function Hce(e){return{...e,shape:nU_(e.shape)}}function AWE(e){switch(e.type){case"object":return st.V50.ExampleTypeShape.object({properties:e.properties.map(t=>PWE(t))});case"alias":return st.V50.ExampleTypeShape.alias({value:{...Hce(e.value)}});case"enum":return st.V50.ExampleTypeShape.enum(e);case"union":return st.V50.ExampleTypeShape.union(DX5(e));case"undiscriminatedUnion":return st.V50.ExampleTypeShape.undiscriminatedUnion(SX5(e))}}function SX5(e){return{...e,singleUnionType:Hce(e.singleUnionType)}}function DX5(e){return{...e,singleUnionType:CX5(e.singleUnionType)}}function CX5(e){return{...e,shape:IX5(e.shape)}}function IX5(e){switch(e.type){case"samePropertiesAsObject":return st.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:MX5(e.object)});case"singleProperty":return st.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:nU_(e.shape)});case"noProperties":return st.V50.ExampleSingleUnionTypeProperties.noProperties()}}function MX5(e){return{...e,properties:e.properties.map(t=>PWE(t))}}function PWE(e){return{...e,value:{...e.value,shape:nU_(e.value.shape)}}}function BX5(e){return{...e,endpoints:e.endpoints.map(t=>TX5(t))}}function TX5(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:bWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?bWE(t.example):void 0}))}}function bWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>lOl(t)),servicePathParameters:e.servicePathParameters.map(t=>lOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>lOl(t)),serviceHeaders:e.serviceHeaders.map(t=>rU_(t)),endpointHeaders:e.endpointHeaders.map(t=>rU_(t)),queryParameters:e.queryParameters.map(t=>mWE(t)),request:e.request!=null?NX5(e.request):void 0,response:qX5(e.response)}}function qX5(e){switch(e.type){case"error":return st.V50.ExampleResponse.error({...e,body:e.body!=null?Hce(e.body):void 0});case"ok":return st.V50.ExampleResponse.ok(RX5(e))}}function RX5(e){switch(e.value.type){case"body":return st.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?Hce(e.value.value):void 0);case"stream":return st.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Hce(t)));case"sse":return st.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Hce(t.data)})))}}function NX5(e){switch(e.type){case"inlinedRequestBody":return st.V50.ExampleRequestBody.inlinedRequestBody(OWE(e));case"reference":return st.V50.ExampleRequestBody.reference(Hce(e))}}function FX5(e){return{...e,examples:e.examples.map(t=>({...t,shape:Hce(t.shape)}))}}var EWE={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:$n,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?zX5(e.apiVersion):void 0,auth:JX5(e.auth),headers:e.headers.map(t=>MQa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>MQa(t)),types:xX5(e.types),services:Pg(e.services,t=>iZ5(t)),webhookGroups:Pg(e.webhookGroups,t=>VX5(t)),websocketChannels:Pg(e.websocketChannels,t=>QX5(t)),errors:Pg(e.errors,t=>mZ5(t)),pathParameters:e.pathParameters.map(t=>p3u(t)),variables:e.variables.map(t=>aZ5(t))})};function xX5(e){return Pg(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>wWE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>wWE(r)),shape:st.V52.types.Type._visit(t.shape,{union:r=>st.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:b6(n.valueType)})),types:r.types.map(n=>eZ5(n))}),enum:st.V51.types.Type.enum,object:r=>st.V51.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:b6(n.valueType)}))}),alias:r=>st.V51.types.Type.alias({aliasOf:b6(r.aliasOf),resolvedType:rZ5(r.resolvedType)}),undiscriminatedUnion:r=>st.V51.types.Type.undiscriminatedUnion(nZ5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function zX5(e){return st.V51.ApiVersionScheme.header({...e,header:MQa(e.header)})}function QX5(e){return{...e,headers:e.headers.map(t=>MQa(t)),queryParameters:e.queryParameters.map(t=>oU_(t)),pathParameters:e.pathParameters.map(t=>p3u(t)),messages:e.messages.map(t=>LX5(t)),examples:e.examples.map(t=>OZ5(t))}}function LX5(e){return{...e,body:UX5(e.body)}}function UX5(e){switch(e.type){case"inlinedBody":return st.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:b6(t.valueType)}))});case"reference":return st.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:b6(e.bodyType)})}}function VX5(e){return e.map(t=>WX5(t))}function WX5(e){return{...e,headers:e.headers.map(t=>MQa(t)),payload:HX5(e.payload),examples:e.examples!=null?e.examples.map(t=>GX5(t)):void 0}}function HX5(e){switch(e.type){case"reference":return st.V51.webhooks.WebhookPayload.reference({...e,payloadType:b6(e.payloadType)});case"inlinedPayload":return st.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:b6(t.valueType)}))})}}function GX5(e){return{...e,payload:Gce(e.payload)}}function JX5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V51.auth.AuthScheme.basic(t);case"bearer":return st.V51.auth.AuthScheme.bearer(t);case"header":return st.V51.auth.AuthScheme.header(KX5(t));case"oauth":return st.V51.auth.AuthScheme.oauth($X5(t))}})}}function KX5(e){return{...e,valueType:b6(e.valueType)}}function $X5(e){return{...e,configuration:st.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:YX5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?XX5(e.configuration.refreshEndpoint):void 0})}}function YX5(e){return{...e,requestProperties:{clientId:qki(e.requestProperties.clientId),clientSecret:qki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?qki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:yTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?yTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?yTi(e.responseProperties.refreshToken):void 0}}}function XX5(e){return{...e,requestProperties:{refreshToken:qki(e.requestProperties.refreshToken)},responseProperties:{accessToken:yTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?yTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?yTi(e.responseProperties.refreshToken):void 0}}}function MQa(e){return{...e,valueType:b6(e.valueType)}}function b6(e){return st.V52.types.TypeReference._visit(e,{container:t=>st.V51.types.TypeReference.container(DWE(t)),primitive:t=>st.V51.types.TypeReference.primitive(SWE(t)),named:st.V51.types.TypeReference.named,unknown:st.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function SWE(e){return{v1:ZX5(e.v1),v2:e.v2!=null?kX5(e.v2):void 0}}function ZX5(e){switch(e){case"UINT":return st.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return st.V51.types.PrimitiveTypeV1.Long}return e}function kX5(e){switch(e.type){case"integer":return st.V51.types.PrimitiveTypeV2.integer(e);case"double":return st.V51.types.PrimitiveTypeV2.double(e);case"string":return st.V51.types.PrimitiveTypeV2.string(e);case"boolean":return st.V51.types.PrimitiveTypeV2.boolean(e);case"long":return st.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return st.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:ks(e)}}function DWE(e){return st.V52.types.ContainerType._visit(e,{list:t=>st.V51.types.ContainerType.list(b6(t)),optional:t=>st.V51.types.ContainerType.optional(b6(t)),set:t=>st.V51.types.ContainerType.set(b6(t)),map:({keyType:t,valueType:r})=>st.V51.types.ContainerType.map({keyType:b6(t),valueType:b6(r)}),literal:st.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function eZ5(e){return{...e,shape:tZ5(e.shape)}}function tZ5(e){return st.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:b6(t.type)}),noProperties:st.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function rZ5(e){return st.V52.types.ResolvedTypeReference._visit(e,{container:t=>st.V51.types.ResolvedTypeReference.container(DWE(t)),named:st.V51.types.ResolvedTypeReference.named,primitive:t=>st.V51.types.ResolvedTypeReference.primitive(SWE(t)),unknown:st.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function nZ5(e){return{members:e.members.map(t=>({...t,type:b6(t.type)}))}}function iZ5(e){return{...e,pathParameters:e.pathParameters.map(t=>p3u(t)),headers:e.headers.map(t=>MQa(t)),endpoints:e.endpoints.map(t=>oZ5(t))}}function p3u(e){return{...e,valueType:b6(e.valueType)}}function aZ5(e){return{...e,type:b6(e.type)}}function oZ5(e){return{...e,pagination:e.pagination!=null?fZ5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>p3u(t)),pathParameters:e.pathParameters.map(t=>p3u(t)),sdkRequest:e.sdkRequest!=null?hZ5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?bZ5(e.requestBody):void 0,response:e.response!=null?uZ5(e.response):void 0,headers:e.headers.map(t=>MQa(t)),queryParameters:e.queryParameters.map(t=>oU_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:jWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?jWE(t.example):void 0}))}}function uZ5(e){return{...e,body:e.body!=null?sZ5(e.body):void 0}}function sZ5(e){switch(e.type){case"json":return st.V51.http.HttpResponseBody.json(CWE(e.value));case"fileDownload":return st.V51.http.HttpResponseBody.fileDownload(e);case"text":return st.V51.http.HttpResponseBody.text(e);case"streaming":return st.V51.http.HttpResponseBody.streaming(IWE(e.value));case"streamParameter":return st.V51.http.HttpResponseBody.streamParameter(lZ5(e))}}function CWE(e){switch(e.type){case"response":return st.V51.http.JsonResponse.response({...e,responseBodyType:b6(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:b6(e.responseBodyType),responseProperty:e.responseProperty!=null?aU_(e.responseProperty):void 0})}}function IWE(e){switch(e.type){case"json":return st.V51.http.StreamingResponse.json({...e,payload:b6(e.payload)});case"text":return st.V51.http.StreamingResponse.text(e);case"sse":return st.V51.http.StreamingResponse.sse({...e,payload:b6(e.payload)})}}function cZ5(e){switch(e.type){case"json":return st.V51.http.NonStreamHttpResponseBody.json(CWE(e.value));case"text":return st.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function lZ5(e){return{nonStreamResponse:cZ5(e.nonStreamResponse),streamResponse:IWE(e.streamResponse)}}function fZ5(e){switch(e.type){case"cursor":return st.V51.http.Pagination.cursor(dZ5(e));case"offset":return st.V51.http.Pagination.offset(pZ5(e))}}function dZ5(e){return{...e,page:qki(e.page),next:yTi(e.next),results:yTi(e.results)}}function pZ5(e){return{...e,page:qki(e.page),results:yTi(e.results),step:e.step!=null?qki(e.step):void 0}}function qki(e){return{...e,property:_Z5(e.property)}}function _Z5(e){switch(e.type){case"query":return st.V51.RequestPropertyValue.query(oU_(e));case"body":return st.V51.RequestPropertyValue.body(aU_(e))}}function yTi(e){return{...e,property:aU_(e.property)}}function aU_(e){return{...e,valueType:b6(e.valueType)}}function oU_(e){return{...e,valueType:b6(e.valueType)}}function hZ5(e){return{...e,streamParameter:e.streamParameter!=null?qki(e.streamParameter):void 0,shape:yZ5(e.shape)}}function yZ5(e){return st.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V51.http.SdkRequestShape.justRequestBody(vZ5(t)),wrapper:st.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function vZ5(e){switch(e.type){case"bytes":return st.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:b6(e.requestBodyType)})}}function bZ5(e){return st.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:b6(r.valueType)}))}),reference:t=>st.V51.http.HttpRequestBody.reference({...t,requestBodyType:b6(t.requestBodyType)}),fileUpload:t=>st.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:b6(r.valueType)});case"file":return st.V51.http.FileUploadRequestProperty.file(gZ5(r.value))}})}),bytes:t=>st.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function gZ5(e){switch(e.type){case"file":return st.V51.http.FileProperty.file(e);case"fileArray":return st.V51.http.FileProperty.fileArray(e)}}function mZ5(e){return{...e,type:e.type!=null?b6(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Gce(t.shape)}))}}function OZ5(e){return{...e,pathParameters:e.pathParameters.map(t=>fOl(t)),headers:e.headers.map(t=>iU_(t)),queryParameters:e.queryParameters.map(t=>MWE(t)),messages:e.messages.map(t=>({...t,body:AZ5(t.body)}))}}function MWE(e){return{...e,value:Gce(e.value)}}function iU_(e){return{...e,value:Gce(e.value)}}function fOl(e){return{...e,value:Gce(e.value)}}function AZ5(e){switch(e.type){case"inlinedBody":return st.V51.ExampleWebSocketMessageBody.inlinedBody(BWE(e));case"reference":return st.V51.ExampleWebSocketMessageBody.reference(Gce(e))}}function BWE(e){return{...e,properties:e.properties.map(t=>({...t,value:Gce(t.value)}))}}function wWE(e){return{...e,shape:qWE(e.shape)}}function uU_(e){switch(e.type){case"primitive":return st.V51.ExampleTypeReferenceShape.primitive(PZ5(e));case"container":return st.V51.ExampleTypeReferenceShape.container(wZ5(e));case"unknown":return st.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:qWE(e.shape)})}}function TWE(e){switch(e.type){case"integer":return st.V51.ExamplePrimitive.integer(e.integer);case"uint":return st.V51.ExamplePrimitive.integer(e.uint);case"uint64":return st.V51.ExamplePrimitive.integer(e.uint64);case"double":return st.V51.ExamplePrimitive.double(e.double);case"long":return st.V51.ExamplePrimitive.long(e.long);case"boolean":return st.V51.ExamplePrimitive.boolean(e.boolean);case"string":return st.V51.ExamplePrimitive.string(e.string);case"date":return st.V51.ExamplePrimitive.date(e.date);case"datetime":return st.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return st.V51.ExamplePrimitive.uuid(e.uuid)}}function PZ5(e){return TWE(e.primitive)}function wZ5(e){switch(e.container.type){case"list":return st.V51.ExampleContainer.list({list:e.container.list.map(t=>Gce(t)),itemType:b6(e.container.itemType)});case"set":return st.V51.ExampleContainer.set({set:e.container.set.map(t=>Gce(t)),itemType:b6(e.container.itemType)});case"optional":return st.V51.ExampleContainer.optional({optional:e.container.optional!=null?Gce(e.container.optional):void 0,valueType:b6(e.container.valueType)});case"map":return st.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:Gce(t.key),value:Gce(t.value)})),keyType:b6(e.container.keyType),valueType:b6(e.container.valueType)});case"literal":return st.V51.ExampleContainer.literal({literal:TWE(e.container.literal)})}}function Gce(e){return{...e,shape:uU_(e.shape)}}function qWE(e){switch(e.type){case"object":return st.V51.ExampleTypeShape.object({properties:e.properties.map(t=>RWE(t))});case"alias":return st.V51.ExampleTypeShape.alias({value:{...Gce(e.value)}});case"enum":return st.V51.ExampleTypeShape.enum(e);case"union":return st.V51.ExampleTypeShape.union(EZ5(e));case"undiscriminatedUnion":return st.V51.ExampleTypeShape.undiscriminatedUnion(jZ5(e))}}function jZ5(e){return{...e,singleUnionType:Gce(e.singleUnionType)}}function EZ5(e){return{...e,singleUnionType:SZ5(e.singleUnionType)}}function SZ5(e){return{...e,shape:DZ5(e.shape)}}function DZ5(e){switch(e.type){case"samePropertiesAsObject":return st.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:CZ5(e.object)});case"singleProperty":return st.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:uU_(e.shape)});case"noProperties":return st.V51.ExampleSingleUnionTypeProperties.noProperties()}}function CZ5(e){return{...e,properties:e.properties.map(t=>RWE(t))}}function RWE(e){return{...e,value:{...e.value,shape:uU_(e.value.shape)}}}function jWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>fOl(t)),servicePathParameters:e.servicePathParameters.map(t=>fOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>fOl(t)),serviceHeaders:e.serviceHeaders.map(t=>iU_(t)),endpointHeaders:e.endpointHeaders.map(t=>iU_(t)),queryParameters:e.queryParameters.map(t=>MWE(t)),request:e.request!=null?BZ5(e.request):void 0,response:IZ5(e.response)}}function IZ5(e){switch(e.type){case"error":return st.V51.ExampleResponse.error({...e,body:e.body!=null?Gce(e.body):void 0});case"ok":return st.V51.ExampleResponse.ok(MZ5(e))}}function MZ5(e){switch(e.value.type){case"body":return st.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?Gce(e.value.value):void 0);case"stream":return st.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Gce(t)));case"sse":return st.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Gce(t.data)})))}}function BZ5(e){switch(e.type){case"inlinedRequestBody":return st.V51.ExampleRequestBody.inlinedRequestBody(BWE(e));case"reference":return st.V51.ExampleRequestBody.reference(Gce(e))}}var xWE={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[ge.TYPESCRIPT]:"0.38.0-rc0",[ge.TYPESCRIPT_SDK]:"0.38.0-rc0",[ge.TYPESCRIPT_EXPRESS]:"0.17.3",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.3.0",[ge.JAVA_SDK]:"2.5.0",[ge.JAVA_SPRING]:"1.3.0",[ge.PYTHON_FASTAPI]:"1.1.0-rc0",[ge.PYTHON_PYDANTIC]:"1.1.0-rc0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:"0.1.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:"0.2.0",[ge.PYTHON_SDK]:"3.3.0-rc0",[ge.GO_FIBER]:"0.23.5",[ge.GO_MODEL]:"0.23.5",[ge.GO_SDK]:"0.28.3",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"0.5.0",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:"0.1.0",[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?qZ5(e.apiVersion):void 0,auth:UZ5(e.auth),headers:e.headers.map(t=>BQa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>BQa(t)),types:TZ5(e.types),services:Pg(e.services,t=>kZ5(t)),webhookGroups:Pg(e.webhookGroups,t=>xZ5(t)),websocketChannels:Pg(e.websocketChannels,t=>RZ5(t)),errors:Pg(e.errors,t=>hk5(t)),pathParameters:e.pathParameters.map(t=>_3u(t)),variables:e.variables.map(t=>ek5(t))})};function TZ5(e){return Pg(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>NWE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>NWE(r)),shape:st.V53.types.Type._visit(t.shape,{union:r=>st.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:g6(n.valueType)})),types:r.types.map(n=>$Z5(n))}),enum:st.V52.types.Type.enum,object:r=>st.V52.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:g6(n.valueType)}))}),alias:r=>st.V52.types.Type.alias({aliasOf:g6(r.aliasOf),resolvedType:XZ5(r.resolvedType)}),undiscriminatedUnion:r=>st.V52.types.Type.undiscriminatedUnion(ZZ5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function qZ5(e){return st.V52.ApiVersionScheme.header({...e,header:BQa(e.header)})}function RZ5(e){return{...e,headers:e.headers.map(t=>BQa(t)),queryParameters:e.queryParameters.map(t=>lU_(t)),pathParameters:e.pathParameters.map(t=>_3u(t)),messages:e.messages.map(t=>NZ5(t)),examples:e.examples.map(t=>yk5(t))}}function NZ5(e){return{...e,body:FZ5(e.body)}}function FZ5(e){switch(e.type){case"inlinedBody":return st.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:g6(t.valueType)}))});case"reference":return st.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:g6(e.bodyType)})}}function xZ5(e){return e.map(t=>zZ5(t))}function zZ5(e){return{...e,headers:e.headers.map(t=>BQa(t)),payload:QZ5(e.payload),examples:e.examples!=null?e.examples.map(t=>LZ5(t)):void 0}}function QZ5(e){switch(e.type){case"reference":return st.V52.webhooks.WebhookPayload.reference({...e,payloadType:g6(e.payloadType)});case"inlinedPayload":return st.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:g6(t.valueType)}))})}}function LZ5(e){return{...e,payload:Jce(e.payload)}}function UZ5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V52.auth.AuthScheme.basic(t);case"bearer":return st.V52.auth.AuthScheme.bearer(t);case"header":return st.V52.auth.AuthScheme.header(VZ5(t));case"oauth":return st.V52.auth.AuthScheme.oauth(WZ5(t))}})}}function VZ5(e){return{...e,valueType:g6(e.valueType)}}function WZ5(e){return{...e,configuration:st.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:HZ5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?GZ5(e.configuration.refreshEndpoint):void 0})}}function HZ5(e){return{...e,requestProperties:{clientId:Rki(e.requestProperties.clientId),clientSecret:Rki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Rki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:vTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?vTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?vTi(e.responseProperties.refreshToken):void 0}}}function GZ5(e){return{...e,requestProperties:{refreshToken:Rki(e.requestProperties.refreshToken)},responseProperties:{accessToken:vTi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?vTi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?vTi(e.responseProperties.refreshToken):void 0}}}function BQa(e){return{...e,valueType:g6(e.valueType)}}function g6(e){return st.V53.types.TypeReference._visit(e,{container:t=>st.V52.types.TypeReference.container(QWE(t)),primitive:t=>st.V52.types.TypeReference.primitive(zWE(t)),named:st.V52.types.TypeReference.named,unknown:st.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function zWE(e){return{v1:JZ5(e.v1),v2:e.v2!=null?KZ5(e.v2):void 0}}function JZ5(e){switch(e){case"FLOAT":return st.V52.types.PrimitiveTypeV1.Double}return e}function KZ5(e){switch(e.type){case"integer":return st.V52.types.PrimitiveTypeV2.integer(e);case"double":return st.V52.types.PrimitiveTypeV2.double(e);case"string":return st.V52.types.PrimitiveTypeV2.string(e);case"boolean":return st.V52.types.PrimitiveTypeV2.boolean(e);case"long":return st.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return st.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return st.V52.types.PrimitiveTypeV2.uint();case"uint64":return st.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:ks(e)}}function QWE(e){return st.V53.types.ContainerType._visit(e,{list:t=>st.V52.types.ContainerType.list(g6(t)),optional:t=>st.V52.types.ContainerType.optional(g6(t)),set:t=>st.V52.types.ContainerType.set(g6(t)),map:({keyType:t,valueType:r})=>st.V52.types.ContainerType.map({keyType:g6(t),valueType:g6(r)}),literal:st.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function $Z5(e){return{...e,shape:YZ5(e.shape)}}function YZ5(e){return st.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:g6(t.type)}),noProperties:st.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function XZ5(e){return st.V53.types.ResolvedTypeReference._visit(e,{container:t=>st.V52.types.ResolvedTypeReference.container(QWE(t)),named:st.V52.types.ResolvedTypeReference.named,primitive:t=>st.V52.types.ResolvedTypeReference.primitive(zWE(t)),unknown:st.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function ZZ5(e){return{members:e.members.map(t=>({...t,type:g6(t.type)}))}}function kZ5(e){return{...e,pathParameters:e.pathParameters.map(t=>_3u(t)),headers:e.headers.map(t=>BQa(t)),endpoints:e.endpoints.map(t=>tk5(t))}}function _3u(e){return{...e,valueType:g6(e.valueType)}}function ek5(e){return{...e,type:g6(e.type)}}function tk5(e){return{...e,pagination:e.pagination!=null?ok5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>_3u(t)),pathParameters:e.pathParameters.map(t=>_3u(t)),sdkRequest:e.sdkRequest!=null?lk5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?pk5(e.requestBody):void 0,response:e.response!=null?rk5(e.response):void 0,headers:e.headers.map(t=>BQa(t)),queryParameters:e.queryParameters.map(t=>lU_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:FWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?FWE(t.example):void 0}))}}function rk5(e){return{...e,body:e.body!=null?nk5(e.body):void 0}}function nk5(e){switch(e.type){case"json":return st.V52.http.HttpResponseBody.json(LWE(e.value));case"fileDownload":return st.V52.http.HttpResponseBody.fileDownload(e);case"text":return st.V52.http.HttpResponseBody.text(e);case"streaming":return st.V52.http.HttpResponseBody.streaming(UWE(e.value));case"streamParameter":return st.V52.http.HttpResponseBody.streamParameter(ak5(e))}}function LWE(e){switch(e.type){case"response":return st.V52.http.JsonResponse.response({...e,responseBodyType:g6(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:g6(e.responseBodyType),responseProperty:e.responseProperty!=null?cU_(e.responseProperty):void 0})}}function UWE(e){switch(e.type){case"json":return st.V52.http.StreamingResponse.json({...e,payload:g6(e.payload)});case"text":return st.V52.http.StreamingResponse.text(e);case"sse":return st.V52.http.StreamingResponse.sse({...e,payload:g6(e.payload)})}}function ik5(e){switch(e.type){case"json":return st.V52.http.NonStreamHttpResponseBody.json(LWE(e.value));case"text":return st.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function ak5(e){return{nonStreamResponse:ik5(e.nonStreamResponse),streamResponse:UWE(e.streamResponse)}}function ok5(e){switch(e.type){case"cursor":return st.V52.http.Pagination.cursor(uk5(e));case"offset":return st.V52.http.Pagination.offset(sk5(e))}}function uk5(e){return{...e,page:Rki(e.page),next:vTi(e.next),results:vTi(e.results)}}function sk5(e){return{...e,page:Rki(e.page),results:vTi(e.results),step:e.step!=null?Rki(e.step):void 0}}function Rki(e){return{...e,property:ck5(e.property)}}function ck5(e){switch(e.type){case"query":return st.V52.RequestPropertyValue.query(lU_(e));case"body":return st.V52.RequestPropertyValue.body(cU_(e))}}function vTi(e){return{...e,property:cU_(e.property)}}function cU_(e){return{...e,valueType:g6(e.valueType)}}function lU_(e){return{...e,valueType:g6(e.valueType)}}function lk5(e){return{...e,streamParameter:e.streamParameter!=null?Rki(e.streamParameter):void 0,shape:fk5(e.shape)}}function fk5(e){return st.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V52.http.SdkRequestShape.justRequestBody(dk5(t)),wrapper:st.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function dk5(e){switch(e.type){case"bytes":return st.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:g6(e.requestBodyType)})}}function pk5(e){return st.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:g6(r.valueType)}))}),reference:t=>st.V52.http.HttpRequestBody.reference({...t,requestBodyType:g6(t.requestBodyType)}),fileUpload:t=>st.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:g6(r.valueType)});case"file":return st.V52.http.FileUploadRequestProperty.file(_k5(r.value))}})}),bytes:t=>st.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function _k5(e){switch(e.type){case"file":return st.V52.http.FileProperty.file(e);case"fileArray":return st.V52.http.FileProperty.fileArray(e)}}function hk5(e){return{...e,type:e.type!=null?g6(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Jce(t.shape)}))}}function yk5(e){return{...e,pathParameters:e.pathParameters.map(t=>dOl(t)),headers:e.headers.map(t=>sU_(t)),queryParameters:e.queryParameters.map(t=>VWE(t)),messages:e.messages.map(t=>({...t,body:vk5(t.body)}))}}function VWE(e){return{...e,value:Jce(e.value)}}function sU_(e){return{...e,value:Jce(e.value)}}function dOl(e){return{...e,value:Jce(e.value)}}function vk5(e){switch(e.type){case"inlinedBody":return st.V52.ExampleWebSocketMessageBody.inlinedBody(WWE(e));case"reference":return st.V52.ExampleWebSocketMessageBody.reference(Jce(e))}}function WWE(e){return{...e,properties:e.properties.map(t=>({...t,value:Jce(t.value)}))}}function NWE(e){return{...e,shape:GWE(e.shape)}}function fU_(e){switch(e.type){case"primitive":return st.V52.ExampleTypeReferenceShape.primitive(bk5(e));case"container":return st.V52.ExampleTypeReferenceShape.container(gk5(e));case"unknown":return st.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:GWE(e.shape)})}}function HWE(e){switch(e.type){case"integer":return st.V52.ExamplePrimitive.integer(e.integer);case"uint":return st.V52.ExamplePrimitive.integer(e.uint);case"uint64":return st.V52.ExamplePrimitive.integer(e.uint64);case"float":return st.V52.ExamplePrimitive.double(e.float);case"double":return st.V52.ExamplePrimitive.double(e.double);case"long":return st.V52.ExamplePrimitive.long(e.long);case"boolean":return st.V52.ExamplePrimitive.boolean(e.boolean);case"string":return st.V52.ExamplePrimitive.string(e.string);case"date":return st.V52.ExamplePrimitive.date(e.date);case"datetime":return st.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return st.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return st.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return st.V52.ExamplePrimitive.string({original:e.bigInteger})}}function bk5(e){return HWE(e.primitive)}function gk5(e){switch(e.container.type){case"list":return st.V52.ExampleContainer.list({list:e.container.list.map(t=>Jce(t)),itemType:g6(e.container.itemType)});case"set":return st.V52.ExampleContainer.set({set:e.container.set.map(t=>Jce(t)),itemType:g6(e.container.itemType)});case"optional":return st.V52.ExampleContainer.optional({optional:e.container.optional!=null?Jce(e.container.optional):void 0,valueType:g6(e.container.valueType)});case"map":return st.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:Jce(t.key),value:Jce(t.value)})),keyType:g6(e.container.keyType),valueType:g6(e.container.valueType)});case"literal":return st.V52.ExampleContainer.literal({literal:HWE(e.container.literal)})}}function Jce(e){return{...e,shape:fU_(e.shape)}}function GWE(e){switch(e.type){case"object":return st.V52.ExampleTypeShape.object({properties:e.properties.map(t=>JWE(t))});case"alias":return st.V52.ExampleTypeShape.alias({value:{...Jce(e.value)}});case"enum":return st.V52.ExampleTypeShape.enum(e);case"union":return st.V52.ExampleTypeShape.union(Ok5(e));case"undiscriminatedUnion":return st.V52.ExampleTypeShape.undiscriminatedUnion(mk5(e))}}function mk5(e){return{...e,singleUnionType:Jce(e.singleUnionType)}}function Ok5(e){return{...e,singleUnionType:Ak5(e.singleUnionType)}}function Ak5(e){return{...e,shape:Pk5(e.shape)}}function Pk5(e){switch(e.type){case"samePropertiesAsObject":return st.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:wk5(e.object)});case"singleProperty":return st.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:fU_(e.shape)});case"noProperties":return st.V52.ExampleSingleUnionTypeProperties.noProperties()}}function wk5(e){return{...e,properties:e.properties.map(t=>JWE(t))}}function JWE(e){return{...e,value:{...e.value,shape:fU_(e.value.shape)}}}function FWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>dOl(t)),servicePathParameters:e.servicePathParameters.map(t=>dOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>dOl(t)),serviceHeaders:e.serviceHeaders.map(t=>sU_(t)),endpointHeaders:e.endpointHeaders.map(t=>sU_(t)),queryParameters:e.queryParameters.map(t=>VWE(t)),request:e.request!=null?Sk5(e.request):void 0,response:jk5(e.response)}}function jk5(e){switch(e.type){case"error":return st.V52.ExampleResponse.error({...e,body:e.body!=null?Jce(e.body):void 0});case"ok":return st.V52.ExampleResponse.ok(Ek5(e))}}function Ek5(e){switch(e.value.type){case"body":return st.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?Jce(e.value.value):void 0);case"stream":return st.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Jce(t)));case"sse":return st.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Jce(t.data)})))}}function Sk5(e){switch(e.type){case"inlinedRequestBody":return st.V52.ExampleRequestBody.inlinedRequestBody(WWE(e));case"reference":return st.V52.ExampleRequestBody.reference(Jce(e))}}var KWE={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Pg(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:Dk5(r.response)}))}))})};function Dk5(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?st.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var XWE={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.47.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[ge.TYPESCRIPT]:"0.47.0",[ge.TYPESCRIPT_SDK]:"0.47.0",[ge.TYPESCRIPT_EXPRESS]:"0.17.7",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.7.0",[ge.JAVA_SDK]:"2.16.0",[ge.JAVA_SPRING]:"1.5.0",[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"1.10.1",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:"0.3.2",[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Ik5(e.apiVersion):void 0,auth:xk5(e.auth),headers:e.headers.map(t=>TQa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>TQa(t)),types:Ck5(e.types),services:Pg(e.services,t=>Jk5(t)),webhookGroups:Pg(e.webhookGroups,t=>qk5(t)),websocketChannels:Pg(e.websocketChannels,t=>Mk5(t)),errors:Pg(e.errors,t=>ce9(t)),pathParameters:e.pathParameters.map(t=>h3u(t)),variables:e.variables.map(t=>Kk5(t)),dynamic:e.dynamic!=null?Ae9(e.dynamic):void 0})};function Ck5(e){return Pg(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>$WE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>$WE(r)),shape:st.V55.types.Type._visit(t.shape,{union:r=>st.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:Aq(n.valueType)})),types:r.types.map(n=>Vk5(n))}),enum:st.V54.types.Type.enum,object:r=>st.V54.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:Aq(n.valueType)})),extendedProperties:r.extendedProperties?.map(n=>({...n,valueType:Aq(n.valueType)}))}),alias:r=>st.V54.types.Type.alias({aliasOf:Aq(r.aliasOf),resolvedType:Hk5(r.resolvedType)}),undiscriminatedUnion:r=>st.V54.types.Type.undiscriminatedUnion(Gk5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Ik5(e){return st.V54.ApiVersionScheme.header({...e,header:TQa(e.header)})}function Mk5(e){return{...e,headers:e.headers.map(t=>TQa(t)),queryParameters:e.queryParameters.map(t=>_U_(t)),pathParameters:e.pathParameters.map(t=>h3u(t)),messages:e.messages.map(t=>Bk5(t)),examples:e.examples.map(t=>le9(t))}}function Bk5(e){return{...e,body:Tk5(e.body)}}function Tk5(e){switch(e.type){case"inlinedBody":return st.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Aq(t.valueType)}))});case"reference":return st.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:Aq(e.bodyType)})}}function qk5(e){return e.map(t=>Rk5(t))}function Rk5(e){return{...e,headers:e.headers.map(t=>TQa(t)),payload:Nk5(e.payload),examples:e.examples!=null?e.examples.map(t=>Fk5(t)):void 0}}function Nk5(e){switch(e.type){case"reference":return st.V54.webhooks.WebhookPayload.reference({...e,payloadType:Aq(e.payloadType)});case"inlinedPayload":return st.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Aq(t.valueType)}))})}}function Fk5(e){return{...e,payload:Zae(e.payload)}}function xk5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return st.V54.auth.AuthScheme.basic(t);case"bearer":return st.V54.auth.AuthScheme.bearer(t);case"header":return st.V54.auth.AuthScheme.header(zk5(t));case"oauth":return st.V54.auth.AuthScheme.oauth(Qk5(t))}})}}function zk5(e){return{...e,valueType:Aq(e.valueType)}}function Qk5(e){return{...e,configuration:st.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:Lk5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?Uk5(e.configuration.refreshEndpoint):void 0})}}function Lk5(e){return{...e,requestProperties:{clientId:Nki(e.requestProperties.clientId),clientSecret:Nki(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Nki(e.requestProperties.scopes):void 0},responseProperties:{accessToken:bvi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?bvi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?bvi(e.responseProperties.refreshToken):void 0}}}function Uk5(e){return{...e,requestProperties:{refreshToken:Nki(e.requestProperties.refreshToken)},responseProperties:{accessToken:bvi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?bvi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?bvi(e.responseProperties.refreshToken):void 0}}}function TQa(e){return{...e,valueType:Aq(e.valueType)}}function Aq(e){return e.type==="container"&&e.container.type==="nullable"?Re9(e.container.nullable):e.type==="container"&&e.container.type==="optional"?qe9(e.container.optional):st.V55.types.TypeReference._visit(e,{container:t=>st.V54.types.TypeReference.container(kWE(t)),primitive:t=>st.V54.types.TypeReference.primitive(ZWE(t)),named:st.V54.types.TypeReference.named,unknown:st.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function ZWE(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function kWE(e){return st.V55.types.ContainerType._visit(e,{list:t=>st.V54.types.ContainerType.list(Aq(t)),optional:t=>st.V54.types.ContainerType.optional(Aq(t)),nullable:t=>st.V54.types.ContainerType.optional(Aq(t)),set:t=>st.V54.types.ContainerType.set(Aq(t)),map:({keyType:t,valueType:r})=>st.V54.types.ContainerType.map({keyType:Aq(t),valueType:Aq(r)}),literal:st.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function Vk5(e){return{...e,shape:Wk5(e.shape)}}function Wk5(e){return st.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>st.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>st.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:Aq(t.type)}),noProperties:st.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function Hk5(e){return st.V55.types.ResolvedTypeReference._visit(e,{container:t=>st.V54.types.ResolvedTypeReference.container(kWE(t)),named:st.V54.types.ResolvedTypeReference.named,primitive:t=>st.V54.types.ResolvedTypeReference.primitive(ZWE(t)),unknown:st.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function Gk5(e){return{members:e.members.map(t=>({...t,type:Aq(t.type)}))}}function Jk5(e){return{...e,pathParameters:e.pathParameters.map(t=>h3u(t)),headers:e.headers.map(t=>TQa(t)),endpoints:e.endpoints.map(t=>$k5(t))}}function h3u(e){return{...e,valueType:Aq(e.valueType)}}function Kk5(e){return{...e,type:Aq(e.type)}}function $k5(e){return{...e,pagination:e.pagination!=null?ee9(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>h3u(t)),pathParameters:e.pathParameters.map(t=>h3u(t)),sdkRequest:e.sdkRequest!=null?ie9(e.sdkRequest):void 0,requestBody:e.requestBody!=null?ue9(e.requestBody):void 0,response:e.response!=null?Yk5(e.response):void 0,headers:e.headers.map(t=>TQa(t)),queryParameters:e.queryParameters.map(t=>_U_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:YWE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?YWE(t.example):void 0}))}}function Yk5(e){return{...e,body:e.body!=null?Xk5(e.body):void 0}}function Xk5(e){switch(e.type){case"json":return st.V54.http.HttpResponseBody.json(eHE(e.value));case"fileDownload":return st.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return st.V54.http.HttpResponseBody.bytes(e);case"text":return st.V54.http.HttpResponseBody.text(e);case"streaming":return st.V54.http.HttpResponseBody.streaming(tHE(e.value));case"streamParameter":return st.V54.http.HttpResponseBody.streamParameter(kk5(e));default:ks(e)}}function eHE(e){switch(e.type){case"response":return st.V54.http.JsonResponse.response({...e,responseBodyType:Aq(e.responseBodyType)});case"nestedPropertyAsResponse":return st.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Aq(e.responseBodyType),responseProperty:e.responseProperty!=null?pU_(e.responseProperty):void 0})}}function tHE(e){switch(e.type){case"json":return st.V54.http.StreamingResponse.json({...e,payload:Aq(e.payload)});case"text":return st.V54.http.StreamingResponse.text(e);case"sse":return st.V54.http.StreamingResponse.sse({...e,payload:Aq(e.payload)})}}function Zk5(e){switch(e.type){case"json":return st.V54.http.NonStreamHttpResponseBody.json(eHE(e.value));case"bytes":return st.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return st.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return st.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:ks(e)}}function kk5(e){return{nonStreamResponse:Zk5(e.nonStreamResponse),streamResponse:tHE(e.streamResponse)}}function ee9(e){switch(e.type){case"cursor":return st.V54.http.Pagination.cursor(te9(e));case"offset":return st.V54.http.Pagination.offset(re9(e))}}function te9(e){return{...e,page:Nki(e.page),next:bvi(e.next),results:bvi(e.results)}}function re9(e){return{...e,page:Nki(e.page),results:bvi(e.results),step:e.step!=null?Nki(e.step):void 0,hasNextPage:e.hasNextPage!=null?bvi(e.hasNextPage):void 0}}function Nki(e){return{...e,property:ne9(e.property)}}function ne9(e){switch(e.type){case"query":return st.V54.RequestPropertyValue.query(_U_(e));case"body":return st.V54.RequestPropertyValue.body(pU_(e))}}function bvi(e){return{...e,property:pU_(e.property)}}function pU_(e){return{...e,valueType:Aq(e.valueType)}}function _U_(e){return{...e,valueType:Aq(e.valueType)}}function ie9(e){return{...e,streamParameter:e.streamParameter!=null?Nki(e.streamParameter):void 0,shape:ae9(e.shape)}}function ae9(e){return st.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>st.V54.http.SdkRequestShape.justRequestBody(oe9(t)),wrapper:st.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function oe9(e){switch(e.type){case"bytes":return st.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return st.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Aq(e.requestBodyType)})}}function ue9(e){return st.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>st.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Aq(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:Aq(r.valueType)}))}),reference:t=>st.V54.http.HttpRequestBody.reference({...t,requestBodyType:Aq(t.requestBodyType)}),fileUpload:t=>st.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return st.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Aq(r.valueType)});case"file":return st.V54.http.FileUploadRequestProperty.file(se9(r.value))}})}),bytes:t=>st.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function se9(e){switch(e.type){case"file":return st.V54.http.FileProperty.file(e);case"fileArray":return st.V54.http.FileProperty.fileArray(e)}}function ce9(e){return{...e,type:e.type!=null?Aq(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Zae(t.shape)}))}}function le9(e){return{...e,pathParameters:e.pathParameters.map(t=>pOl(t)),headers:e.headers.map(t=>dU_(t)),queryParameters:e.queryParameters.map(t=>rHE(t)),messages:e.messages.map(t=>({...t,body:fe9(t.body)}))}}function rHE(e){return{...e,value:Zae(e.value)}}function dU_(e){return{...e,value:Zae(e.value)}}function pOl(e){return{...e,value:Zae(e.value)}}function fe9(e){switch(e.type){case"inlinedBody":return st.V54.ExampleWebSocketMessageBody.inlinedBody(nHE(e));case"reference":return st.V54.ExampleWebSocketMessageBody.reference(Zae(e))}}function nHE(e){return{...e,properties:e.properties.map(t=>({...t,value:Zae(t.value)}))}}function $WE(e){return{...e,shape:iHE(e.shape)}}function hU_(e){switch(e.type){case"primitive":return st.V54.ExampleTypeReferenceShape.primitive(de9(e));case"container":return st.V54.ExampleTypeReferenceShape.container(pe9(e));case"unknown":return st.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return st.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:iHE(e.shape)})}}function de9(e){return e.primitive}function pe9(e){switch(e.container.type){case"list":return st.V54.ExampleContainer.list({list:e.container.list.map(t=>Zae(t)),itemType:Aq(e.container.itemType)});case"set":return st.V54.ExampleContainer.set({set:e.container.set.map(t=>Zae(t)),itemType:Aq(e.container.itemType)});case"optional":return st.V54.ExampleContainer.optional({optional:e.container.optional!=null?Zae(e.container.optional):void 0,valueType:Aq(e.container.valueType)});case"nullable":return st.V54.ExampleContainer.optional({optional:e.container.nullable!=null?Zae(e.container.nullable):void 0,valueType:Aq(e.container.valueType)});case"map":return st.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:Zae(t.key),value:Zae(t.value)})),keyType:Aq(e.container.keyType),valueType:Aq(e.container.valueType)});case"literal":return st.V54.ExampleContainer.literal({literal:e.container.literal})}}function Zae(e){return{...e,shape:hU_(e.shape)}}function iHE(e){switch(e.type){case"object":return st.V54.ExampleTypeShape.object({properties:e.properties.map(t=>aHE(t))});case"alias":return st.V54.ExampleTypeShape.alias({value:{...Zae(e.value)}});case"enum":return st.V54.ExampleTypeShape.enum(e);case"union":return st.V54.ExampleTypeShape.union(he9(e));case"undiscriminatedUnion":return st.V54.ExampleTypeShape.undiscriminatedUnion(_e9(e))}}function _e9(e){return{...e,singleUnionType:Zae(e.singleUnionType)}}function he9(e){return{...e,singleUnionType:ye9(e.singleUnionType)}}function ye9(e){return{...e,shape:ve9(e.shape)}}function ve9(e){switch(e.type){case"samePropertiesAsObject":return st.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:be9(e.object)});case"singleProperty":return st.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:hU_(e.shape)});case"noProperties":return st.V54.ExampleSingleUnionTypeProperties.noProperties()}}function be9(e){return{...e,properties:e.properties.map(t=>aHE(t))}}function aHE(e){return{...e,value:{...e.value,shape:hU_(e.value.shape)}}}function YWE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>pOl(t)),servicePathParameters:e.servicePathParameters.map(t=>pOl(t)),endpointPathParameters:e.endpointPathParameters.map(t=>pOl(t)),serviceHeaders:e.serviceHeaders.map(t=>dU_(t)),endpointHeaders:e.endpointHeaders.map(t=>dU_(t)),queryParameters:e.queryParameters.map(t=>rHE(t)),request:e.request!=null?Oe9(e.request):void 0,response:ge9(e.response)}}function ge9(e){switch(e.type){case"error":return st.V54.ExampleResponse.error({...e,body:e.body!=null?Zae(e.body):void 0});case"ok":return st.V54.ExampleResponse.ok(me9(e))}}function me9(e){switch(e.value.type){case"body":return st.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?Zae(e.value.value):void 0);case"stream":return st.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Zae(t)));case"sse":return st.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Zae(t.data)})))}}function Oe9(e){switch(e.type){case"inlinedRequestBody":return st.V54.ExampleRequestBody.inlinedRequestBody(nHE(e));case"reference":return st.V54.ExampleRequestBody.reference(Zae(e))}}function Ae9(e){return{...e,types:Pg(e.types,t=>Pe9(t)),endpoints:Pg(e.endpoints,t=>we9(t)),headers:e.headers?.map(t=>BDr(t))}}function Pe9(e){switch(e.type){case"alias":return st.V54.dynamic.NamedType.alias({...e,typeReference:qct(e.typeReference)});case"enum":return st.V54.dynamic.NamedType.enum(e);case"object":return st.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>BDr(t))});case"discriminatedUnion":return st.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Ee9(r)]))});case"undiscriminatedUnion":return st.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>qct(t))});default:ks(e)}}function we9(e){return{...e,auth:e.auth!=null?je9(e.auth):void 0,request:Se9(e.request)}}function je9(e){switch(e.type){case"basic":return st.V54.dynamic.Auth.basic(e);case"bearer":return st.V54.dynamic.Auth.bearer(e);case"header":return st.V54.dynamic.Auth.header({header:BDr(e.header)})}}function qct(e){switch(e.type){case"list":return st.V54.dynamic.TypeReference.list(qct(e.value));case"optional":return Fe9(e.value);case"nullable":return Ne9(e.value);case"map":return st.V54.dynamic.TypeReference.map({...e,key:qct(e.key),value:qct(e.value)});case"literal":return st.V54.dynamic.TypeReference.literal(e.value);case"named":return st.V54.dynamic.TypeReference.named(e.value);case"primitive":return st.V54.dynamic.TypeReference.primitive(e.value);case"set":return st.V54.dynamic.TypeReference.set(qct(e.value));case"unknown":return st.V54.dynamic.TypeReference.unknown();default:ks(e)}}function Ee9(e){switch(e.type){case"samePropertiesAsObject":return st.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>BDr(t))});case"singleProperty":return st.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:qct(e.typeReference),properties:e.properties?.map(t=>BDr(t))});case"noProperties":return st.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>BDr(t))});default:ks(e)}}function BDr(e){return{...e,typeReference:qct(e.typeReference)}}function Se9(e){switch(e.type){case"body":return st.V54.dynamic.Request.body(De9(e));case"inlined":return st.V54.dynamic.Request.inlined(Ce9(e));default:ks(e)}}function De9(e){return{pathParameters:e.pathParameters?.map(t=>BDr(t)),body:e.body!=null?oHE(e.body):void 0}}function Ce9(e){return{...e,pathParameters:e.pathParameters?.map(t=>BDr(t)),queryParameters:e.queryParameters?.map(t=>BDr(t)),headers:e.headers?.map(t=>BDr(t)),body:e.body!=null?Ie9(e.body):void 0}}function Ie9(e){switch(e.type){case"properties":return st.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>BDr(t)));case"referenced":return st.V54.dynamic.InlinedRequestBody.referenced(Me9(e));case"fileUpload":return st.V54.dynamic.InlinedRequestBody.fileUpload(Be9(e));default:ks(e)}}function Me9(e){return{...e,bodyType:oHE(e.bodyType)}}function oHE(e){switch(e.type){case"bytes":return st.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return st.V54.dynamic.ReferencedRequestBodyType.typeReference(qct(e.value));default:ks(e)}}function Be9(e){return{properties:e.properties.map(t=>Te9(t))}}function Te9(e){switch(e.type){case"file":return st.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return st.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return st.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(BDr(e));default:ks(e)}}function qe9(e){return e.type==="container"&&e.container.type==="nullable"?st.V54.types.TypeReference.container(st.V54.types.ContainerType.optional(Aq(e.container.nullable))):st.V54.types.TypeReference.container(st.V54.types.ContainerType.optional(Aq(e)))}function Re9(e){return e.type==="container"&&e.container.type==="optional"?Aq(e):st.V54.types.TypeReference.container(st.V54.types.ContainerType.optional(Aq(e)))}function Ne9(e){return e.type==="optional"?qct(e):st.V54.dynamic.TypeReference.optional(qct(e))}function Fe9(e){return e.type==="nullable"?st.V54.dynamic.TypeReference.optional(qct(e.value)):st.V54.dynamic.TypeReference.optional(qct(e))}var uHE={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:Qt,[ge.TYPESCRIPT_BROWSER_SDK]:Qt,[ge.TYPESCRIPT]:Qt,[ge.TYPESCRIPT_SDK]:Qt,[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.PYTHON_SDK]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:"0.0.2",[ge.CSHARP_SDK]:"1.12.0-rc0",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Pg(e.services,t=>xe9(t))})};function xe9(e){return{...e,endpoints:e.endpoints.map(t=>ze9(t))}}function ze9(e){return{...e,pagination:Qe9(e.pagination)}}function Qe9(e){if(e!=null)switch(e.type){case"cursor":return st.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return st.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:ks(e)}}var sHE={laterVersion:"v57",earlierVersion:"v56",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"0.49.0",[ge.TYPESCRIPT_BROWSER_SDK]:"0.49.0",[ge.TYPESCRIPT]:"0.49.0",[ge.TYPESCRIPT_SDK]:"0.49.0",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.8.0",[ge.JAVA_SDK]:"2.34.0",[ge.JAVA_SPRING]:"1.6.0",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.6.3",[ge.PYTHON_PYDANTIC]:"1.4.8",[ge.PYTHON_SDK]:"4.3.19",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:"0.23.6",[ge.GO_MODEL]:"0.23.6",[ge.GO_SDK]:"0.37.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"1.12.0-rc11",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:$n,[ge.PHP_MODEL]:$n,[ge.PHP_SDK]:"0.14.1",[ge.RUST_MODEL]:$n,[ge.RUST_SDK]:$n},jsonifyEarlierVersion:e=>Cm.V56.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?Le9(e.dynamic):void 0})};function Le9(e){return{...e,endpoints:Ue9(e.endpoints)}}function Ue9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Ve9(r)]).filter(([t,r])=>r!=null))}function Ve9(e){return{...e,auth:e.auth!=null?Ge9(e.auth):void 0,examples:e.examples!=null?We9(e.examples):void 0}}function We9(e){return e.map(t=>He9(t)).filter(t=>t!=null)}function He9(e){return{...e,auth:e.auth!=null?Je9(e.auth):void 0}}function Ge9(e){switch(e.type){case"basic":return st.V56.dynamic.Auth.basic(e);case"bearer":return st.V56.dynamic.Auth.bearer(e);case"header":return st.V56.dynamic.Auth.header(e);case"oauth":return;default:ks(e)}}function Je9(e){switch(e.type){case"basic":return st.V56.dynamic.AuthValues.basic(e);case"bearer":return st.V56.dynamic.AuthValues.bearer(e);case"header":return st.V56.dynamic.AuthValues.header(e);case"oauth":return;default:ks(e)}}var lHE={laterVersion:"v58",earlierVersion:"v57",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"1.2.0",[ge.TYPESCRIPT_BROWSER_SDK]:"1.2.0",[ge.TYPESCRIPT]:"1.2.0",[ge.TYPESCRIPT_SDK]:"1.2.0",[ge.TYPESCRIPT_EXPRESS]:"0.18.0",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:"2.36.5",[ge.JAVA_SPRING]:"1.6.1",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.7.0",[ge.PYTHON_PYDANTIC]:"1.5.0",[ge.PYTHON_SDK]:"4.21.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:"1.1.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:"1.17.5",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:"0.1.0",[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:"1.15.1",[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:"0.0.0"},jsonifyEarlierVersion:e=>Cm.V57.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,publishConfig:e.publishConfig!=null?nt9(e.publishConfig):void 0,services:Ke9(e.services),dynamic:e.dynamic!=null?Ze9(e.dynamic):void 0})};function Ke9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,$e9(r)]))}function $e9(e){return{...e,endpoints:Ye9(e.endpoints)}}function Ye9(e){return e.map(Xe9).filter(t=>t!=null)}function Xe9(e){if(e.method!=="HEAD")return{...e,method:e.method}}function Ze9(e){return{...e,endpoints:ke9(e.endpoints)}}function ke9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,et9(r)]).filter(([t,r])=>r!=null))}function et9(e){let t=e.location.method;if(t!=="HEAD")return{...e,examples:e.examples!=null?tt9(e.examples):void 0,location:{...e.location,method:t}}}function tt9(e){return e.map(t=>rt9(t)).filter(t=>t!=null)}function rt9(e){let t=e.endpoint.method;if(t!=="HEAD")return{...e,endpoint:{...e.endpoint,method:t}}}function nt9(e){switch(e.type){case"github":{let t=cHE(e.target);return t==null?void 0:st.V57.publish.PublishingConfig.github({...e,target:t})}case"direct":{let t=cHE(e.target);return t==null?void 0:st.V57.publish.PublishingConfig.direct({target:t})}case"filesystem":return;default:ks(e)}}function cHE(e){switch(e.type){case"postman":return st.V57.publish.PublishTarget.postman(e);case"npm":return st.V57.publish.PublishTarget.npm(e);case"maven":return st.V57.publish.PublishTarget.maven(e);case"pypi":return;default:ks(e)}}var fHE={laterVersion:"v59",earlierVersion:"v58",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"2.6.8",[ge.TYPESCRIPT_BROWSER_SDK]:"2.6.8",[ge.TYPESCRIPT]:"2.6.8",[ge.TYPESCRIPT_SDK]:"2.6.8",[ge.TYPESCRIPT_EXPRESS]:Qt,[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.8.1",[ge.JAVA_SDK]:"2.43.0",[ge.JAVA_SPRING]:"1.8.2",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.8.0",[ge.PYTHON_PYDANTIC]:"1.6.0",[ge.PYTHON_SDK]:"4.26.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:"0.23.7",[ge.GO_MODEL]:"0.23.7",[ge.GO_SDK]:"1.7.0",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:"1.0.0-rc26",[ge.CSHARP_MODEL]:"0.0.3",[ge.CSHARP_SDK]:"2.2.0",[ge.SWIFT_MODEL]:"0.0.1",[ge.SWIFT_SDK]:"0.16.0",[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:"1.17.0",[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:"0.1.1"},jsonifyEarlierVersion:e=>Cm.V58.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?at9(e.dynamic):void 0,auth:e.auth!=null?it9(e.auth):void 0})};function it9(e){return{...e,schemes:e.schemes.filter(t=>t.type!=="inferred")}}function at9(e){return{...e,endpoints:ot9(e.endpoints)}}function ot9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ut9(r)]).filter(([t,r])=>r!=null))}function ut9(e){return{...e,examples:e.examples!=null?ct9(e.examples):void 0,auth:st9(e.auth)}}function st9(e){return e==null?e:e._visit({basic:t=>st.V58.dynamic.Auth.basic(t),bearer:t=>st.V58.dynamic.Auth.bearer(t),header:t=>st.V58.dynamic.Auth.header(t),oauth:t=>st.V58.dynamic.Auth.oauth(t),inferred:()=>{},_other:()=>{}})}function ct9(e){return e.map(t=>lt9(t)).filter(t=>t!=null)}function lt9(e){return{...e,auth:ft9(e.auth)}}function ft9(e){if(e==null)return e;if(e.type!=="inferred")return e}var dHE={laterVersion:"v60",earlierVersion:"v59",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"2.11.2",[ge.TYPESCRIPT_BROWSER_SDK]:"2.11.2",[ge.TYPESCRIPT]:"2.11.2",[ge.TYPESCRIPT_SDK]:"2.11.2",[ge.TYPESCRIPT_EXPRESS]:"0.18.6",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:"1.8.2",[ge.JAVA_SDK]:"3.5.10",[ge.JAVA_SPRING]:"1.8.3",[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:"1.9.0",[ge.PYTHON_PYDANTIC]:"1.7.0",[ge.PYTHON_SDK]:"4.30.0",[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:"0.23.8",[ge.GO_MODEL]:"0.23.8",[ge.GO_SDK]:"1.12.4",[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:Qt,[ge.CSHARP_SDK]:Qt,[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:Qt,[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:Qt},jsonifyEarlierVersion:e=>Cm.V59.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:_t9(e.services),auth:dt9(e.auth)})};function dt9(e){return{...e,schemes:pt9(e.schemes)}}function pt9(e){return e.map(t=>{switch(t.type){case"bearer":return st.V59.AuthScheme.bearer({...t});case"basic":return st.V59.AuthScheme.basic({...t});case"header":return st.V59.AuthScheme.header({...t});case"oauth":switch(t.configuration.type){case"clientCredentials":return st.V59.AuthScheme.oauth({...t,configuration:st.V59.OAuthConfiguration.clientCredentials({...t.configuration,refreshEndpoint:t.configuration.refreshEndpoint?{...t.configuration.refreshEndpoint,responseProperties:{accessToken:qQa(t.configuration.refreshEndpoint.responseProperties.accessToken),expiresIn:aNo(t.configuration.refreshEndpoint.responseProperties.expiresIn),refreshToken:aNo(t.configuration.refreshEndpoint.responseProperties.refreshToken)},requestProperties:{refreshToken:oNo(t.configuration.refreshEndpoint.requestProperties.refreshToken)}}:void 0,tokenEndpoint:{...t.configuration.tokenEndpoint,responseProperties:{accessToken:qQa(t.configuration.tokenEndpoint.responseProperties.accessToken),expiresIn:aNo(t.configuration.tokenEndpoint.responseProperties.expiresIn),refreshToken:aNo(t.configuration.tokenEndpoint.responseProperties.refreshToken)},requestProperties:{clientId:oNo(t.configuration.tokenEndpoint.requestProperties.clientId),clientSecret:oNo(t.configuration.tokenEndpoint.requestProperties.clientSecret),scopes:yU_(t.configuration.tokenEndpoint.requestProperties.scopes),customProperties:t.configuration.tokenEndpoint.requestProperties.customProperties?.map(oNo)}}})});default:ks(t.configuration.type)}break;case"inferred":return st.V59.AuthScheme.inferred({...t,tokenEndpoint:{...t.tokenEndpoint,expiryProperty:aNo(t.tokenEndpoint.expiryProperty),authenticatedRequestHeaders:t.tokenEndpoint.authenticatedRequestHeaders.map(r=>({...r,responseProperty:qQa(r.responseProperty)}))}});default:ks(t)}})}function _t9(e){return Object.entries(e).reduce((t,[r,n])=>(t[r]={...n,endpoints:ht9(n.endpoints)},t),{})}function ht9(e){return e.map(t=>({...t,pagination:yt9(t.pagination),sdkRequest:vt9(t.sdkRequest)}))}function yt9(e){if(!e)return e;switch(e.type){case"cursor":return st.V59.Pagination.cursor({next:qQa(e.next),results:qQa(e.results),page:oNo(e.page)});case"offset":return st.V59.Pagination.offset({hasNextPage:aNo(e.hasNextPage),results:qQa(e.results),page:oNo(e.page),step:yU_(e.step)});case"custom":return st.V59.Pagination.custom({results:qQa(e.results)});default:ks(e)}}function yU_(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function oNo(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function aNo(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function qQa(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function vt9(e){return e&&{...e,streamParameter:yU_(e.streamParameter)}}var pHE={laterVersion:"v61",earlierVersion:"v60",firstGeneratorVersionToConsumeNewIR:{[ge.TYPESCRIPT_NODE_SDK]:"3.7.2",[ge.TYPESCRIPT_BROWSER_SDK]:"3.7.2",[ge.TYPESCRIPT]:"3.7.2",[ge.TYPESCRIPT_SDK]:"3.7.2",[ge.TYPESCRIPT_EXPRESS]:"3.7.2",[ge.JAVA]:Qt,[ge.JAVA_MODEL]:Qt,[ge.JAVA_SDK]:Qt,[ge.JAVA_SPRING]:Qt,[ge.OPENAPI_PYTHON_CLIENT]:Qt,[ge.OPENAPI]:Qt,[ge.PYTHON_FASTAPI]:Qt,[ge.PYTHON_PYDANTIC]:Qt,[ge.PYTHON_SDK]:Qt,[ge.STOPLIGHT]:Qt,[ge.POSTMAN]:Qt,[ge.GO_FIBER]:Qt,[ge.GO_MODEL]:Qt,[ge.GO_SDK]:Qt,[ge.RUBY_MODEL]:Qt,[ge.RUBY_SDK]:Qt,[ge.CSHARP_MODEL]:"0.0.4",[ge.CSHARP_SDK]:"2.4.0",[ge.SWIFT_MODEL]:Qt,[ge.SWIFT_SDK]:Qt,[ge.PHP_MODEL]:Qt,[ge.PHP_SDK]:Qt,[ge.RUST_MODEL]:Qt,[ge.RUST_SDK]:"0.7.2"},jsonifyEarlierVersion:e=>Cm.V60.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?gt9(e.dynamic):void 0,publishConfig:e.publishConfig!=null?bt9(e.publishConfig):void 0})};function bt9(e){return st.V61.PublishingConfig._visit(e,{github:t=>{let r=vU_(t.target);return r!=null?st.V60.PublishingConfig.github({...t,target:r}):void 0},direct:t=>{let r=vU_(t.target);return r!=null?st.V60.PublishingConfig.direct({target:r}):void 0},filesystem:t=>{let r=t.publishTarget!=null?vU_(t.publishTarget):void 0;return st.V60.PublishingConfig.filesystem({generateFullProject:t.generateFullProject,publishTarget:r})},_other:()=>{}})}function vU_(e){return st.V61.PublishTarget._visit(e,{postman:st.V60.PublishTarget.postman,npm:st.V60.PublishTarget.npm,maven:st.V60.PublishTarget.maven,pypi:st.V60.PublishTarget.pypi,crates:t=>st.V60.PublishTarget.pypi({version:t.version,packageName:t.packageName}),_other:()=>{}})}function gt9(e){return{...e,endpoints:Pt9(e.endpoints),generatorConfig:e.generatorConfig!=null?mt9(e.generatorConfig):void 0}}function mt9(e){return{...e,outputConfig:Ot9(e.outputConfig)}}function Ot9(e){return st.V61.dynamic.GeneratorOutputConfig._visit(e,{publish:t=>{let r=At9(t);return r!=null?st.V60.dynamic.GeneratorOutputConfig.publish(r):st.V60.dynamic.GeneratorOutputConfig.local()},local:st.V60.dynamic.GeneratorOutputConfig.local,_other:st.V60.dynamic.GeneratorOutputConfig.local})}function At9(e){return st.V61.dynamic.PublishInfo._visit(e,{go:st.V60.dynamic.PublishInfo.go,swift:()=>{},maven:st.V60.dynamic.PublishInfo.maven,npm:st.V60.dynamic.PublishInfo.npm,nuget:st.V60.dynamic.PublishInfo.nuget,pypi:st.V60.dynamic.PublishInfo.pypi,rubygems:st.V60.dynamic.PublishInfo.rubygems,crates:()=>{},_other:()=>{}})}function Pt9(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,wt9(r)]).filter(([t,r])=>r!=null))}function wt9(e){return{...e,response:jt9(e.response)}}function jt9(e){return st.V61.dynamic.Response._visit(e,{json:st.V60.dynamic.Response.json,streaming:st.V60.dynamic.Response.json,streamParameter:st.V60.dynamic.Response.json,fileDownload:st.V60.dynamic.Response.json,text:st.V60.dynamic.Response.json,bytes:st.V60.dynamic.Response.json,_other:st.V60.dynamic.Response.json})}function y3u(){return St9}var _Ol=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new bU_([...this.migrations,t])}},bU_=class extends _Ol{build(){return new gU_(this.migrations)}},gU_=class{migrations;constructor(t){this.migrations=t}migrateForGenerator({intermediateRepresentation:t,context:r,targetGenerator:n}){return this.migrate({intermediateRepresentation:t,shouldMigrate:i=>this.shouldRunMigration({migration:i,targetGenerator:n}),context:r,targetGenerator:n})}migrateThroughMigration({migration:t,intermediateRepresentation:r,context:n,targetGenerator:i}){return this.migrateThroughVersion({version:t.earlierVersion,intermediateRepresentation:r,context:n,targetGenerator:i})}migrateThroughVersion({version:t,intermediateRepresentation:r,context:n,targetGenerator:i}){let a=!1;if(this.migrations[0]?.laterVersion===t)return{ir:r,jsonify:()=>Promise.resolve().then(()=>F0.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let c=this.migrate({intermediateRepresentation:r,shouldMigrate:d=>{let s=d.earlierVersion===t;return a||=s,s||!a},context:n,targetGenerator:i});return a||n.failAndThrow(`IR ${t} does not exist`),c}migrate({intermediateRepresentation:t,shouldMigrate:r,context:n,targetGenerator:i}){let a=t,o=async()=>F0.IntermediateRepresentation.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"});for(let c of this.migrations){if(!r(c))break;n.logger.debug(`Migrating IR from ${c.laterVersion} to ${c.earlierVersion}`),a=c.migrateBackwards(a,{taskContext:n,targetGenerator:i}),o=()=>Promise.resolve().then(()=>c.jsonifyEarlierVersion(a))}return{ir:a,jsonify:o}}shouldRunMigration({migration:t,targetGenerator:r}){let n=t.firstGeneratorVersionToConsumeNewIR[r.name];if(n==null)throw new Error(`Cannot migrate intermediate representation. Unrecognized generator: ${r.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`);switch(n){case Qt:return!0;case $n:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return A3e(n,r.version)}getIRVersionForGenerator({targetGenerator:t}){let r=this.migrations[0]?.laterVersion;for(let n of this.migrations)if(this.shouldRunMigration({migration:n,targetGenerator:t}))r=n.earlierVersion;else break;return r}},Et9={Builder:new _Ol([])},St9=Et9.Builder.withMigration(pHE).withMigration(dHE).withMigration(fHE).withMigration(lHE).withMigration(sHE).withMigration(uHE).withMigration(XWE).withMigration(KWE).withMigration(xWE).withMigration(EWE).withMigration(gWE).withMigration(pWE).withMigration(dWE).withMigration(lWE).withMigration(cWE).withMigration(oWE).withMigration(nWE).withMigration(rWE).withMigration(eWE).withMigration(kVE).withMigration(ZVE).withMigration(XVE).withMigration(YVE).withMigration($VE).withMigration(KVE).withMigration(JVE).withMigration(GVE).withMigration(HVE).withMigration(WVE).withMigration(UVE).withMigration(QVE).withMigration(zVE).withMigration(xVE).withMigration(MVE).withMigration(IVE).withMigration(CVE).withMigration(SVE).withMigration(EVE).withMigration(fjw).withMigration(sjw).withMigration(ujw).withMigration(ijw).withMigration(rjw).withMigration(ejw).withMigration(kww).withMigration(Zww).withMigration($ww).withMigration(Gww).withMigration(Hww).withMigration(Www).withMigration(Uww).withMigration(Lww).withMigration(Qww).withMigration(Nww).withMigration(Tww).withMigration(Bww).withMigration(Mww).withMigration(vww).withMigration(_ww).withMigration(Adb).build();function v3u({intermediateRepresentation:e,context:t,targetGenerator:r}){return y3u().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function mU_({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:n}){return y3u().migrateThroughVersion({version:n,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function b3u({intermediateRepresentation:e,context:t,version:r}){return y3u().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function _HE({workspace:e,audiences:t,generatorInvocation:r,context:n,irVersionOverride:i,version:a,packageName:o,sourceConfig:c,includeOptionalRequestPropertyExamples:d,ir:s}){let u=s??iG({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:d,disabled:r.disableExamples},readme:r.readme,version:a,packageName:o,context:n,sourceResolver:new eG(n,e)});c!=null&&(u.sourceConfig=c),n.logger.debug("Generated IR");let l=await Lsa(r).then(P=>P==null?void 0:"v"+P.toString()),m=i??l,A=m!=null?await b3u({intermediateRepresentation:u,context:n,version:m}):await v3u({intermediateRepresentation:u,context:n,targetGenerator:{name:r.name,version:r.version}});return{latest:u,migrated:A}}var hHE=pa(HJs(),1),Hke=require("fs/promises"),yHE=pa(bCe(),1),hOl=class{context;absolutePathToTmpOutputDirectory;absolutePathToTmpSnippetJSON;absolutePathToTmpSnippetTemplatesJSON;absolutePathToLocalSnippetTemplateJSON;absolutePathToLocalOutput;absolutePathToLocalSnippetJSON;constructor({context:t,absolutePathToTmpOutputDirectory:r,absolutePathToTmpSnippetJSON:n,absolutePathToLocalSnippetTemplateJSON:i,absolutePathToLocalOutput:a,absolutePathToLocalSnippetJSON:o,absolutePathToTmpSnippetTemplatesJSON:c}){this.context=t,this.absolutePathToLocalOutput=a,this.absolutePathToTmpOutputDirectory=r,this.absolutePathToTmpSnippetJSON=n,this.absolutePathToLocalSnippetJSON=o,this.absolutePathToLocalSnippetTemplateJSON=i,this.absolutePathToTmpSnippetTemplatesJSON=c}async copyGeneratedFiles(){await this.isFernIgnorePresent()?await this.copyGeneratedFilesWithFernIgnore():await this.copyGeneratedFilesNoFernIgnore(),this.absolutePathToTmpSnippetJSON!=null&&this.absolutePathToLocalSnippetJSON!=null&&await Rv(this.absolutePathToTmpSnippetJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetJSON}),this.absolutePathToTmpSnippetTemplatesJSON!=null&&this.absolutePathToLocalSnippetTemplateJSON!=null&&await Rv(this.absolutePathToTmpSnippetTemplatesJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetTemplatesJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetTemplateJSON})}async isFernIgnorePresent(){let t=z_.of(Xl(this.absolutePathToLocalOutput,ds.of(pis)));return await Rv(t)}async copyGeneratedFilesWithFernIgnore(){let t=z_.of((await yHE.default.dir({})).path),r=z_.of(Xl(this.absolutePathToLocalOutput,ds.of(pis))),n=await Ct9({absolutePathToFernignore:r});await(0,Hke.cp)(this.absolutePathToLocalOutput,t,{recursive:!0}),await this.runGitCommand(["init"],t),await this.runGitCommand(["add","."],t),(await this.runGitCommand(["config","--list"],t)).includes("user.name")||(await this.runGitCommand(["config","user.name","fern-api"],t),await this.runGitCommand(["config","user.email","info@buildwithfern.com"],t)),await this.runGitCommand(["commit","--allow-empty","-m",'"init"'],t),await this.runGitCommand(["rm","-rf","."],t),await this.copyGeneratedFilesToDirectory(t),await this.runGitCommand(["reset","--",...n],t),await this.runGitCommand(["restore","."],t),await(0,Hke.rm)(Xl(t,ds.of(".git")),{recursive:!0}),await(0,Hke.rm)(this.absolutePathToLocalOutput,{recursive:!0}),await(0,Hke.cp)(t,this.absolutePathToLocalOutput,{recursive:!0})}async copyGeneratedFilesNoFernIgnore(){this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`),await(0,Hke.rm)(this.absolutePathToLocalOutput,{force:!0,recursive:!0}),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesToDirectory(t){let[r,...n]=await(0,Hke.readdir)(this.absolutePathToTmpOutputDirectory);if(r!=null)if(this.context.logger.debug(`Copying generated files to ${t}`),r.endsWith(".zip")){await(0,hHE.default)(Xl(this.absolutePathToTmpOutputDirectory,ds.of(r)),t);for(let i of n)await(0,Hke.cp)(Xl(this.absolutePathToTmpOutputDirectory,ds.of(i)),Xl(t,ds.of(i)),{recursive:!0})}else await(0,Hke.cp)(this.absolutePathToTmpOutputDirectory,t,{recursive:!0})}async copySnippetJSON({absolutePathToTmpSnippetJSON:t,absolutePathToLocalSnippetJSON:r}){this.context.logger.debug(`Copying generated snippets to ${r}`),await(0,Hke.cp)(t,r)}async runGitCommand(t,r){return(await kH(this.context.logger,"git",t,{cwd:r,doNotPipeOutput:!0})).stdout}},Dt9=/\r?\n/;async function Ct9({absolutePathToFernignore:e}){let t=(await(0,Hke.readFile)(e)).toString();return[pis,...t.trim().split(Dt9).map(r=>{let n=r.indexOf("#");return n!==-1?r.slice(0,n).trim():r.trim()}).filter(r=>r.length>0)]}function It9(e,t){let r=CZf(e);if(r?.type==="custom"){let n=r.value,i=t?sNo.dirname(t):process.cwd(),a=sNo.isAbsolute(n)?n:sNo.resolve(i,n);return z_.of(a)}}async function gHE({organization:e,absolutePathToFernConfig:t,workspace:r,generatorInvocation:n,absolutePathToLocalOutput:i,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:o,audiences:c,version:d,workspaceTempDir:s,keepDocker:u,context:l,irVersionOverride:m,outputVersionOverride:A,writeUnitTests:P,generateOauthClients:C,generatePaginatedClients:M,includeOptionalRequestPropertyExamples:T,inspect:z,executionEnvironment:U,runner:R,ir:V}){let{latest:Y,migrated:re}=await _HE({workspace:r,audiences:c,generatorInvocation:n,context:l,irVersionOverride:m,packageName:LP.getPackageName({generatorInvocation:n}),version:d??A,sourceConfig:Bt9(r),includeOptionalRequestPropertyExamples:T,ir:V}),Z=await Mt9({workspaceTempDir:s,filename:oXf,context:l,ir:re});l.logger.debug("Wrote IR to: "+Z);let ee=(0,uNo.join)(s.path,aXf),ne=z_.of(ee);await(0,RQa.writeFile)(ee,""),l.logger.debug("Will write config.json to: "+ne);let me=(0,uNo.join)(s.path,iXf),be=z_.of(me);await(0,RQa.mkdir)(me,{recursive:!0}),l.logger.debug("Will write output to: "+be);let Ae;if(a!=null){let Ie=(0,uNo.join)(s.path,"snippet.json");Ae=z_.of(Ie),await(0,RQa.writeFile)(Ie,""),l.logger.debug("Will write snippet.json to: "+Ae)}let ye;if(o!=null){let Ie=(0,uNo.join)(s.path,o_h);ye=z_.of(Ie),await(0,RQa.writeFile)(Ie,""),l.logger.debug("Will write snippet-templates.json to: "+ye)}let Me=U??new You({dockerImage:`${n.name}:${n.version}`,keepDocker:u}),Ee=Me instanceof You?{outputDirectory:z_.of(t$s),irPath:z_.of(r$s),configPath:z_.of($ou),snippetPath:z_.of(n$s),snippetTemplatePath:z_.of(i$s)}:{outputDirectory:be,configPath:ne,irPath:Z,snippetPath:Ae,snippetTemplatePath:ye},St=Odb({generatorInvocation:n,customConfig:n.config,workspaceName:r.definition.rootApiFile.contents.name,outputVersion:A,organization:e,absolutePathToSnippet:Ae,absolutePathToSnippetTemplates:ye,absolutePathToFernConfig:t,writeUnitTests:P,generateOauthClients:C,generatePaginatedClients:M,paths:Ee});await(0,RQa.writeFile)(ne,JSON.stringify(await vHE.GeneratorConfig.jsonOrThrow(St),void 0,4));let vt=It9(n,t);return await Me.execute({generatorName:n.name,irPath:Z,configPath:ne,outputPath:be,snippetPath:Ae,snippetTemplatePath:ye,licenseFilePath:vt,context:l,inspect:z,runner:R}),await new hOl({context:l,absolutePathToLocalOutput:i,absolutePathToTmpOutputDirectory:be,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:o,absolutePathToTmpSnippetJSON:Ae,absolutePathToTmpSnippetTemplatesJSON:ye}).copyGeneratedFiles(),{ir:Y,generatorConfig:St}}async function Mt9({ir:e,workspaceTempDir:t,filename:r,context:n}){n.logger.debug("Migrated IR");let i;if(r)i=z_.of((0,uNo.join)(t.path,r));else{let a=await bHE.default.file({tmpdir:t.path});i=z_.of(a.path)}return await vCe(i,e,{pretty:!1}),n.logger.debug(`Wrote IR to ${i}`),i}function Bt9(e){return{sources:e.getSources().map(t=>t.type==="protobuf"?Exe.proto({id:t.id,protoRootUrl:`file:///${Tt9(t)}`}):Exe.openapi())}}function Tt9(e){return`${Uab}/${e.id}`}var OU_=pa(require("os"),1),mHE=pa(require("path"),1),OHE=pa(bCe(),1);async function AHE({token:e,projectConfig:t,workspace:r,generatorGroup:n,version:i,keepDocker:a,inspect:o,context:c,runner:d}){(await Promise.all(n.generators.map(async u=>c.runInteractiveTask({name:u.name},async l=>{u=(Y=>M3i(Y,{onError:re=>l.failAndThrow(re)}))(u);let A=await r.toFernWorkspace({context:c},eoo(u)),P=iG({workspace:A,audiences:n.audiences,generationLanguage:u.language,keywords:u.keywords,smartCasing:u.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:!1,disabled:u.disableExamples},readme:u.readme,version:i,packageName:LP.getPackageName({generatorInvocation:u}),context:c,sourceResolver:new eG(c,A)}),C=zCe({token:e?.value});if(u.absolutePathToLocalOutput==null&&(e=await cZa(),e==null)){l.failWithoutThrowing("Please provide a FERN_TOKEN in your environment.");return}let M=await C.organization.get(PR.OrganizationId(t.organization));if(u.absolutePathToLocalOutput==null&&!M.ok){l.failWithoutThrowing(`Failed to load details for organization ${t.organization}.`);return}M.ok&&(M.body.selfHostedSdKs&&(P.selfHosted=!0),M.body.isWhitelabled&&(P.readmeConfig==null&&(P.readmeConfig=zt9),P.readmeConfig.whiteLabel=!0));let T=qt9(u),z=Nt9({generatorInvocation:u,org:M.ok?M.body:void 0,version:i,packageName:T,context:l});z!=null&&(P.publishConfig=z);let U=u.absolutePathToLocalOutput??Xl(r.absoluteFilePath,ds.of("sdks"),ds.of(u.language??u.name)),R=u.raw?.snippets?.path!=null?z_.of(Xl(r.absoluteFilePath,ds.of(u.raw.snippets.path))):void 0,V=await Rt9();await gHE({organization:t.organization,absolutePathToFernConfig:t._absolutePath,workspace:A,generatorInvocation:u,absolutePathToLocalOutput:U,absolutePathToLocalSnippetJSON:R,absolutePathToLocalSnippetTemplateJSON:void 0,version:i,audiences:n.audiences,workspaceTempDir:V,keepDocker:a,context:l,irVersionOverride:u.irVersionOverride,outputVersionOverride:void 0,writeUnitTests:M.ok?M?.body.snippetUnitTestsEnabled??!1:!1,generateOauthClients:M.ok?M?.body.oauthClientEnabled??!1:!1,generatePaginatedClients:M.ok?M?.body.paginationEnabled??!1:!1,includeOptionalRequestPropertyExamples:!1,inspect:o,executionEnvironment:void 0,ir:P,runner:d}),l.logger.info(nd.green("Wrote files to "+U))})))).some(u=>!u)&&c.failAndThrow()}function qt9(e){return typeof e.raw?.config=="object"&&e.raw?.config!==null?e.raw.config.package_name:void 0}async function Rt9(){return OHE.default.dir({tmpdir:OU_.default.platform()==="darwin"?mHE.default.join("/private",OU_.default.tmpdir()):void 0,prefix:"fern"})}function Nt9({generatorInvocation:e,org:t,version:r,packageName:n,context:i}){if(e.raw?.github!=null&&xt9(e.raw.github)){let[a,o]=e.raw.github.uri.split("/");return a==null||o==null?i.failAndThrow(`Invalid GitHub repository URI: ${e.raw.github.uri}. Expected format: owner/repo`):Zd.PublishingConfig.github({owner:a,repo:o,uri:e.raw.github.uri,token:e.raw.github.token,mode:e.raw.github.mode,target:Ft9({outputSchema:e.raw.output,version:r,packageName:n})})}if(e.raw?.output?.location==="local-file-system"){let a;if(e.language==="python")a=Cee.pypi({version:r,packageName:n}),i.logger.debug(`Created PyPiPublishTarget: version ${r} package name: ${n}`);else if(e.language==="rust")a=Cee.crates({version:r,packageName:n}),i.logger.debug(`Created CratesPublishTarget: version ${r} package name: ${n}`);else if(e.language==="java"){let o=e.raw?.config,c=(()=>{if(!o||typeof o!="object"||o===null)return;let s=o;if(typeof s.group=="string"&&typeof s.artifact=="string")return{groupId:s.group,artifactId:s.artifact};if(typeof s["package-prefix"]=="string"&&n)return{groupId:s["package-prefix"],artifactId:n};typeof s["package-prefix"]=="string"&&!n&&i.logger.warn("Java generator has package-prefix configured but packageName is missing")})(),d=c?`${c.groupId}:${c.artifactId}`:void 0;if(d){let s=r??"0.0.0";a=Cee.maven({coordinate:d,version:s,usernameEnvironmentVariable:"MAVEN_USERNAME",passwordEnvironmentVariable:"MAVEN_PASSWORD",mavenUrlEnvironmentVariable:"MAVEN_PUBLISH_REGISTRY_URL"}),i.logger.debug(`Created MavenPublishTarget: coordinate ${d} version ${s}`)}else o&&typeof o=="object"&&i.logger.debug("Java generator config provided but could not construct Maven coordinate. Expected either 'group' and 'artifact' or 'package-prefix' with packageName.")}return Zd.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:a})}return e.outputMode._visit({downloadFiles:()=>Zd.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:void 0}),github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:()=>{},_other:()=>{}})}function Ft9({outputSchema:e,version:t,packageName:r}){let n=Zd.PublishTarget.postman({apiKey:"",workspaceId:"",collectionId:void 0});if(e==null)return n;if(e.location==="npm"){let i=(e.token||"${NPM_TOKEN}").trim(),a=i==="<USE_OIDC>"||i==="OIDC";return Cee.npm({packageName:e["package-name"],version:t??"0.0.0",tokenEnvironmentVariable:a?"<USE_OIDC>":i.startsWith("${")&&i.endsWith("}")?i.slice(2,-1).trim():""})}else return e.location==="maven"?Cee.maven({version:t??"0.0.0",coordinate:e.coordinate,usernameEnvironmentVariable:e.username||"MAVEN_USERNAME",passwordEnvironmentVariable:e.password||"MAVEN_PASSWORD",mavenUrlEnvironmentVariable:e.url||"MAVEN_PUBLISH_REGISTRY_URL"}):e.location==="pypi"?Cee.pypi({version:t,packageName:r}):n}function xt9(e){return e==null?!1:"uri"in e&&"token"in e}var zt9={defaultEndpoint:void 0,bannerLink:void 0,introduction:void 0,apiReferenceLink:void 0,apiName:void 0,disabledFeatures:void 0,whiteLabel:void 0,customSections:void 0,features:void 0,exampleStyle:void 0};var POl=pa(d6i(),1);var PHE=require("fs"),yOl=require("fs/promises"),wHE=require("stream/promises");async function jHE({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await Qt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(nd.green(`Downloaded to ${t}`))}catch{r.logger.debug(nd.yellow("Failed to download snippet.json from output."))}}async function Qt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await OZ.get(e,{responseType:"stream"});await Rv(t)&&await(0,yOl.rm)(t,{recursive:!0}),await(0,yOl.mkdir)(Rg(t),{recursive:!0}),await(0,wHE.pipeline)(r.data,(0,PHE.createWriteStream)(t))}var wU_=pa(Nnt(),1);var cNo=pa(d6i(),1);var EHE=pa(jSs(),1),Gke=require("fs/promises");var SHE=require("path"),DHE=pa(rQs(),1),CHE=pa(bCe(),1);_I();async function IHE({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:n,generatorInvocation:i,version:a,context:o,shouldLogS3Url:c,token:d,whitelabel:s,irVersionOverride:u,absolutePathToPreview:l}){let m=await Lt9({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:a,context:o,shouldLogS3Url:c,token:d,whitelabel:s,absolutePathToPreview:l});return await Ut9({intermediateRepresentation:n,job:m,context:o,generatorInvocation:i,irVersionOverride:u}),m}async function Lt9({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:i,context:a,shouldLogS3Url:o,token:c,whitelabel:d,absolutePathToPreview:s}){let u=zAi({token:c.value}),l={id:n.name,version:n.version,outputMode:n.outputMode,customConfig:n.config,publishMetadata:n.publishMetadata},m;if(n.outputMode.type.startsWith("github"))try{let P=await CHE.default.dir(),C=z_.of(P.path);a.logger.debug(`Writing mock fern definition to ${C}`);let M=Xl(C,ds.of(Wve)),T=Xl(M,ds.of(kne));await(0,Gke.mkdir)(T,{recursive:!0});let z=Xl(T,ds.of(vee));await(0,Gke.writeFile)(z,Jg.dump(t.definition.rootApiFile.contents)),await MHE({absolutePathToDefinitionDirectory:T,definition:t.definition});let U=Xl(M,ds.of(NFe));await(0,Gke.writeFile)(U,JSON.stringify(e.rawConfig,void 0,2));try{let Y=t.getSources();for(let re of Y){let Z=await(0,Gke.readFile)(re.absoluteFilePath),ee=(0,SHE.relative)(t.absoluteFilePath,re.absoluteFilePath),ne=Xl(M,ds.of(ee));await(0,Gke.mkdir)(Rg(ne),{recursive:!0}),await(0,Gke.writeFile)(ne,new Uint8Array(Z))}}catch(Y){a.logger.debug(`Failed to write source files to disk, continuing: ${Y}`)}let R=Xl(C,ds.of("definition.tgz"));await(0,DHE.create)({file:R,cwd:M},["."]),a.logger.debug("Getting upload URL for Fern definition.");let V=await u.remoteGen.getDefinitionUploadUrl({apiName:t.definition.rootApiFile.contents.name,organizationName:r,version:i});V.ok?(a.logger.debug("Uploading definition..."),await OZ.put(V.body.s3Url,await(0,Gke.readFile)(R)),m={definitionS3DownloadUrl:V.body.s3Url,outputPath:".mock",cliVersion:e.version}):V.error.content.reason==="status-code"?a.logger.debug(`Failed with status-code to get upload URL with status code ${V.error.content.statusCode}, continuing: ${V.error.content.body}`):V.error.content.reason==="non-json"?a.logger.debug(`Failed with non-json to get upload URL with status code ${V.error.content.statusCode}, continuing: ${V.error.content.rawBody}`):V.error.content.reason==="unknown"&&a.logger.debug(`Failed to get upload URL as unknown error occurred continuing: ${V.error.content.errorMessage}`)}catch(P){a.logger.debug(`Failed to upload definition to S3, continuing: ${P}`)}let A=await u.remoteGen.createJobV3({apiName:t.definition.rootApiFile.contents.name,version:i,organizationName:r,generators:[l],uploadToS3:Wt9({outputMode:n.outputMode,generatorInvocation:n,absolutePathToPreview:s,shouldLogS3Url:o}),whitelabel:d,fernDefinitionMetadata:m,preview:s!=null});return A.ok?A.body:Vt9(A.error)._visit({illegalApiNameError:()=>a.failAndThrow("API name is invalid: "+t.definition.rootApiFile.contents.name),illegalApiVersionError:()=>a.failAndThrow("API version is invalid: "+i),cannotPublishToNpmScope:({validScope:P,invalidScope:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${P})`),cannotPublishToMavenGroup:({validGroup:P,invalidGroup:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${P})`),cannotPublishPypiPackage:({validPrefix:P,invalidPackageName:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${P})`),generatorsDoNotExistError:P=>a.failAndThrow("Generators do not exist: "+P.nonExistentGenerators.map(C=>`${C.id}@${C.version}`).join(", ")),insufficientPermissions:()=>a.failAndThrow(`You do not have permission to run this generator. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
3039
3039
|
|
|
3040
3040
|
If you believe this is an error, please contact support@buildwithfern.com`),orgNotConfiguredForWhitelabel:()=>a.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com."),_other:P=>(a.logger.debug(`Failed to create job: ${JSON.stringify(P)}`),a.failAndThrow("Failed to create job. Please try again or contact support@buildwithfern.com for assistance."))})}async function MHE({absolutePathToDefinitionDirectory:e,definition:t}){for(let[r,n]of Object.entries(t.namedDefinitionFiles)){let i=Xl(e,ds.of(r));await(0,Gke.mkdir)(Rg(i),{recursive:!0}),await(0,Gke.writeFile)(i,Jg.dump(n.contents))}for(let[r,n]of Object.entries(t.packageMarkers))if(n.contents.export==null){let i=Xl(e,ds.of(r));await(0,Gke.mkdir)(Rg(i),{recursive:!0}),await(0,Gke.writeFile)(i,Jg.dump(n.contents))}for(let[r,n]of Object.entries(t.importedDefinitions))await MHE({absolutePathToDefinitionDirectory:Xl(e,ds.of(r)),definition:n.definition})}async function Ut9({intermediateRepresentation:e,generatorInvocation:t,job:r,context:n,irVersionOverride:i}){let a=await Lsa(t).then(l=>l==null?void 0:"v"+l.toString()),o=i??a,c=o==null?await v3u({intermediateRepresentation:e,context:n,targetGenerator:{name:t.name,version:t.version}}):await mU_({intermediateRepresentation:e,context:n,irVersion:o,targetGenerator:{name:t.name,version:t.version}}),d=new EHE.default,s=await stf(c,{onWrite:l=>{n.logger.debug("Wrote IR to disk: "+l)}});d.append("file",s);let u=TD(Cff(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await OZ.post(u,d,{headers:d.getHeaders(),maxBodyLength:1/0})}catch(l){let m=l instanceof oEy?l.response?.data:l;n.logger.debug(`POST ${u} failed with ${JSON.stringify(l)}`),n.failAndThrow("Failed to start job",m)}}function Vt9(e){if(e?.reason==="status-code"){let t=e.body;switch(t?._error){case"IllegalApiNameError":return cNo.FernFiddle.remoteGen.createJobV3.Error.illegalApiNameError();case"GeneratorsDoNotExistError":return cNo.FernFiddle.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.body);case"CannotPublishToNpmScope":return cNo.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.body);case"CannotPublishToMavenScope":return cNo.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.body);case"InsufficientPermissions":return cNo.FernFiddle.remoteGen.createJobV3.Error.insufficientPermissions(t.body)}}return e}function Wt9({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:n}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||n}function vOl({apiName:e,organization:t,generatorInvocation:r}){let n=Ht9(r);return{apiName:e,organization:t,customConfig:r.config,outputConfig:n??Zl.GeneratorOutputConfig.local()}}function Ht9(e){let t=e.outputMode;switch(t.type){case"downloadFiles":return Zl.GeneratorOutputConfig.local();case"publishV2":return Gt9({publish:t.publishV2,version:e.version});case"githubV2":return Jt9({github:t.githubV2,language:e.language,version:e.version});case"publish":case"github":return;default:ks(t)}}function Gt9({publish:e,version:t}){switch(e.type){case"npmOverride":{let r=e.npmOverride;return r==null?void 0:Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.npm({version:t,packageName:r.packageName,repoUrl:void 0}))}case"mavenOverride":{let r=e.mavenOverride;return r==null?void 0:Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.maven({version:t,coordinate:r.coordinate,repoUrl:void 0}))}case"pypiOverride":{let r=e.pypiOverride;return r==null?void 0:Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.pypi({version:t,packageName:r.coordinate,repoUrl:void 0}))}case"rubyGemsOverride":{let r=e.rubyGemsOverride;return r==null?void 0:Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.rubygems({version:t,packageName:r.packageName,repoUrl:void 0}))}case"nugetOverride":{let r=e.nugetOverride;return r==null?void 0:Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.nuget({version:t,packageName:r.packageName,repoUrl:void 0}))}case"cratesOverride":{let r=e.cratesOverride;return r==null?void 0:Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.crates({version:t,packageName:r.packageName,repoUrl:void 0}))}case"postman":return;default:ks(e)}}function Jt9({github:e,version:t,language:r}){let n=Kt9({owner:e.owner,repo:e.repo});if(r===LP.GenerationLanguage.GO)return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.go({version:t,repoUrl:n}));if(r===LP.GenerationLanguage.SWIFT)return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.swift({version:t,repoUrl:n}));let i=e.publishInfo;if(i!=null)switch(i.type){case"maven":return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.maven({version:t,coordinate:i.coordinate,repoUrl:n}));case"npm":return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.npm({version:t,packageName:i.packageName,repoUrl:n}));case"pypi":return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.pypi({version:t,packageName:i.packageName,repoUrl:n}));case"rubygems":return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.rubygems({version:t,packageName:i.packageName,repoUrl:n}));case"nuget":return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.nuget({version:t,packageName:i.packageName,repoUrl:n}));case"crates":return Zl.GeneratorOutputConfig.publish(Zl.PublishInfo.crates({version:t,packageName:i.packageName,repoUrl:n}));case"postman":return;default:ks(i)}}function Kt9({owner:e,repo:t}){return`https://github.com/${e}/${t}`}var BHE=zAi();var $t9=3;function THE({job:e,taskId:t,taskHandler:r,context:n}){let i=0,a=async()=>{let o=await BHE.remoteGen.getJobStatus(e.jobId);if(o.ok)return o.body[t];n.logger.debug("Failed to get job status.",JSON.stringify(o.error.content))};return new Promise((o,c)=>{d();async function d(){try{let s=await a();if(s==null)i++,i===$t9&&n.failAndThrow(`Failed to get job status after ${i} attempts.`),setTimeout(d,2e3+1e3*i);else{i=0;let u=await r.processUpdate(s);r.isFinished?o(u):setTimeout(d,2e3)}}catch(s){c(s)}}})}var FHE=pa(HJs(),1),xHE=require("fs"),mOl=require("fs/promises"),PU_=pa(require("path"),1),zHE=require("stream/promises");var bOl=pa(NHE(),1);function bTi(e,t,{target:r="stdout",...n}={}){return bOl.default[r]?sio.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}bTi.isSupported=bOl.default.stdout;bTi.stderr=(e,t,r={})=>bTi(e,t,{target:"stderr",...r});bTi.stderr.isSupported=bOl.default.stderr;var QHE=pa(bCe(),1),gOl=class{context;generatorInvocation;absolutePathToPreview;lengthOfLastLogs=0;constructor({interactiveTaskContext:t,generatorInvocation:r,absolutePathToPreview:n}){this.context=t,this.generatorInvocation=r,this.absolutePathToPreview=n}async processUpdate(t){t==null&&this.context.failAndThrow("Task is missing on job status");let r=t.packages.map(i=>i.coordinate._visit({npm:a=>`${a.name}@${a.version}`,maven:a=>`${a.group}:${a.artifact}:${a.version}`,pypi:a=>`${a.name} ${a.version}`,ruby:a=>`${a.name}:${a.version}`,nuget:a=>`${a.name} ${a.version}`,crates:a=>`${a.name} ${a.version}`,_other:()=>"<unknown package>"}));this.absolutePathToPreview==null&&this.context.setSubtitle(r.length>0?r.map(i=>`\u25E6 ${i}`).join(`
|
|
3041
3041
|
`):void 0);for(let i of t.logs.slice(this.lengthOfLastLogs))this.context.logger.log(kt9(i.level),i.message);this.lengthOfLastLogs=t.logs.length;let n=i=>{this.context.logger.debug(`Generated files. ${bTi("View here",i,{fallback:(a,o)=>`${a}: ${o}`})}`)};return await t.status._visit({notStarted:Hc,running:Hc,failed:({message:i,s3PreSignedReadUrl:a})=>{a!=null&&n(a),this.context.failAndThrow(i)},finished:async i=>{if(i.s3PreSignedReadUrlV2!=null){n(i.s3PreSignedReadUrlV2);let a=this.getAbsolutePathToLocalOutput();a!=null&&await Xt9({s3PreSignedReadUrl:i.s3PreSignedReadUrlV2,absolutePathToLocalOutput:a,context:this.context})}if(this.absolutePathToPreview==null)for(let a of r)this.context.logger.info(`Published ${a}`);this.#e=!0,this.#t=i.createdSnippets!=null?i.createdSnippets:!1,this.#r=i.snippetsS3PreSignedReadUrl},_other:()=>{this.context.logger.warn("Received unknown update type: "+t.status.type)}}),this.#e?{createdSnippets:this.#t,snippetsS3PreSignedReadUrl:this.#r}:void 0}getAbsolutePathToLocalOutput(){return this.absolutePathToPreview!=null?Xl(this.absolutePathToPreview,ds.of(PU_.default.basename(this.generatorInvocation.name))):this.generatorInvocation.absolutePathToLocalOutput}#e=!1;get isFinished(){return this.#e}#t=!1;get createdSnippets(){return this.#t}#r=void 0;get snippetsS3PreSignedReadUrl(){return this.#r}};async function Xt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{await Zt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(nd.green(`Downloaded to ${t}`))}catch(n){r.failAndThrow("Failed to download files",n)}}async function Zt9({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await OZ.get(e,{responseType:"stream"}),n=await QHE.default.dir({prefix:"fern",unsafeCleanup:!0}),i=PU_.default.join(n.path,"output.zip");await(0,zHE.pipeline)(r.data,(0,xHE.createWriteStream)(i)),await Rv(t)&&await(0,mOl.rm)(t,{recursive:!0}),await(0,mOl.mkdir)(t,{recursive:!0}),await(0,FHE.default)(i,t)}function kt9(e){switch(e){case"DEBUG":return Y1.Debug;case"INFO":return Y1.Info;case"WARN":return Y1.Warn;case"ERROR":return Y1.Error;default:return Y1.Info}}var AOl=require("fs/promises"),LHE=pa(bCe(),1),er9="proto.zip",OOl=class{sourceTypes;context;sources;constructor(t,r){this.context=t,this.sources=Object.fromEntries(r.map(n=>[n.id,n])),this.sourceTypes=new Set(Object.values(this.sources).map(n=>n.type))}async uploadSources(t){for(let[r,n]of Object.entries(t)){let i=this.getSourceOrThrow(r);await this.uploadSource(i,n.uploadUrl)}return this.convertFdrSourceUploadsToSourceConfig(t)}async uploadSource(t,r){let n=await this.getUploadCommand(t),i=await(0,AOl.readFile)(n.absoluteFilePath),a=await fetch(r,{method:"PUT",body:i,headers:{"Content-Type":"application/octet-stream"}});await n.cleanup(),a.ok||this.context.failAndThrow(`Failed to upload source file: ${t.absoluteFilePath}. Status: ${a.status}, ${a.statusText}`)}async getUploadCommand(t){if(t.type==="protobuf"){let r=await this.zipSource(t.absoluteFilePath);return{absoluteFilePath:r,cleanup:async()=>{this.context.logger.debug(`Removing ${r}`),await(0,AOl.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await LHE.default.dir(),n=Xl(z_.of(r.path),ds.of(er9));return this.context.logger.debug(`Zipping source ${t} into ${n}`),await kH(this.context.logger,"zip",["-r",n,"."],{cwd:t,doNotPipeOutput:!0}),n}convertFdrSourceUploadsToSourceConfig(t){let r=[];for(let[n,i]of Object.entries(t))switch(this.getSourceOrThrow(n).type){case"protobuf":r.push(Exe.proto({id:n,protoRootUrl:i.downloadUrl}));continue;case"openapi":r.push(Exe.openapi());continue;case"asyncapi":continue}return{sources:r}}getSourceOrThrow(t){let r=this.sources[t];return r==null&&this.context.failAndThrow(`Internal error; server responded with source id "${t}" which does not exist in the workspace.`),r}};async function UHE({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:n,generatorInvocation:i,version:a,audiences:o,shouldLogS3Url:c,token:d,whitelabel:s,irVersionOverride:u,absolutePathToPreview:l,readme:m}){let A=Qsa({token:d.value}),P=LP.getPackageName({generatorInvocation:i}),C=l!=null,M=Me=>M3i(Me,{onError:Be=>n.failAndThrow(Be)},{substituteAsEmpty:C}),T=M(i),z=vOl({apiName:r.definition.rootApiFile.contents.name,organization:t,generatorInvocation:T}),U=iG({workspace:r,generationLanguage:i.language,keywords:i.keywords,smartCasing:i.smartCasing,exampleGeneration:{disabled:i.disableExamples,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!1},audiences:o,readme:m,packageName:P,version:a??await rr9({fdr:A,packageName:P,generatorInvocation:i}),context:n,sourceResolver:new eG(n,r),dynamicGeneratorConfig:z}),V=await zCe({token:d.value}).organization.get(PR.OrganizationId(e.organization));V.ok&&V.body.isWhitelabled&&(U.readmeConfig==null&&(U.readmeConfig=ir9),U.readmeConfig.whiteLabel=!0);let Y=r.getSources(),re=EIe({ir:U,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},context:n}),Z=await A.api.v1.register.registerApiDefinition({orgId:wU_.FernRegistry.OrgId(t),apiId:wU_.FernRegistry.ApiId(U.apiName.originalName),definition:re,sources:Y.length>0?nr9(Y):void 0}),ee,ne;Z.ok&&(ee=Z.body.apiDefinitionId,ne=Z.body.sources);let me=new OOl(n,Y);if(ne==null&&me.sourceTypes.has("protobuf")&&(Z.ok||n.failAndThrow(`Failed to register API definition: ${JSON.stringify(Z.error.content)}`),n.failAndThrow("Did not successfully upload Protobuf source files.")),ne!=null){n.logger.debug("Uploading source files ...");let Me=await me.uploadSources(ne);n.logger.debug("Setting IR source configuration ..."),U.sourceConfig=Me}let be=await IHE({projectConfig:e,workspace:r,organization:t,generatorInvocation:T,context:n,version:a,intermediateRepresentation:{...U,fdrApiDefinitionId:ee,publishConfig:tr9({generatorInvocation:T})},shouldLogS3Url:c,token:d,whitelabel:s!=null?M(s):void 0,irVersionOverride:u,absolutePathToPreview:l});n.logger.debug(`Job ID: ${be.jobId}`);let Ae=be.taskIds[0];if(Ae==null){n.failAndThrow("Did not receive a task ID.");return}n.logger.debug(`Task ID: ${Ae}`);let ye=new gOl({job:be,taskId:Ae,generatorInvocation:i,interactiveTaskContext:n,absolutePathToPreview:l});return await THE({job:be,taskHandler:ye,taskId:Ae,context:n})}function tr9({generatorInvocation:e}){return e.outputMode._visit({downloadFiles:()=>{},github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:t=>t._visit({mavenOverride:()=>{},pypiOverride:()=>{},nugetOverride:()=>{},npmOverride:()=>{},rubyGemsOverride:()=>{},cratesOverride:()=>{},postman:r=>{let n;return e.raw?.output?.location==="postman"&&(n=e.raw.output?.["collection-id"]),Zd.PublishingConfig.direct({target:Zd.PublishTarget.postman({apiKey:r.apiKey,workspaceId:r.workspaceId,collectionId:n})})},_other:()=>{}}),_other:()=>{}})}async function rr9({fdr:e,packageName:t,generatorInvocation:r}){if(r.language==null)return;let n;switch(r.language){case"csharp":n="Csharp";break;case"go":n="Go";break;case"java":n="Java";break;case"python":n="Python";break;case"ruby":n="Ruby";break;case"typescript":n="TypeScript";break;case"php":n="Php";break;case"swift":n="Swift";break;default:return}if(t==null)return;let i=await e.sdks.versions.computeSemanticVersion({githubRepository:r.outputMode.type==="githubV2"?`${r.outputMode.githubV2.owner}/${r.outputMode.githubV2.repo}`:void 0,language:n,package:t});if(i.ok)return i.body.version}function nr9(e){return Object.fromEntries(Object.values(e).map(t=>[t.id,{type:t.type==="protobuf"?"proto":t.type}]))}var ir9={defaultEndpoint:void 0,bannerLink:void 0,introduction:void 0,apiReferenceLink:void 0,apiName:void 0,disabledFeatures:void 0,whiteLabel:void 0,customSections:void 0,features:void 0,exampleStyle:void 0};async function jU_({projectConfig:e,organization:t,workspace:r,context:n,generatorGroup:i,version:a,shouldLogS3Url:o,token:c,whitelabel:d,absolutePathToPreview:s,mode:u}){if(i.generators.length===0)return n.logger.warn("No generators specified."),null;let l=[],m=[];return l.push(...i.generators.map(P=>n.runInteractiveTask({name:P.name},async C=>{let M=eoo(P),T=await r.toFernWorkspace({context:n},M),z=await UHE({projectConfig:e,organization:t,workspace:T,interactiveTaskContext:C,generatorInvocation:{...P,outputMode:P.outputMode._visit({downloadFiles:()=>P.outputMode,github:U=>POl.FernFiddle.OutputMode.github({...U,makePr:u==="pull-request"}),githubV2:U=>u==="pull-request"?POl.FernFiddle.OutputMode.githubV2(POl.FernFiddle.GithubOutputModeV2.pullRequest(U)):P.outputMode,publish:()=>P.outputMode,publishV2:()=>P.outputMode,_other:()=>P.outputMode})},version:a,audiences:i.audiences,shouldLogS3Url:o,token:c,whitelabel:d,readme:P.readme,irVersionOverride:P.irVersionOverride,absolutePathToPreview:s});z!=null&&z.createdSnippets&&(m.push(P),P.absolutePathToLocalSnippets!=null&&z.snippetsS3PreSignedReadUrl!=null&&await jHE({snippetsS3PreSignedReadUrl:z.snippetsS3PreSignedReadUrl,absolutePathToLocalSnippetJSON:P.absolutePathToLocalSnippets,context:C}))}))),(await Promise.all(l)).some(P=>!P)&&n.failAndThrow(),{snippetsProducedBy:m}}var mvi=pa(Nnt(),1);var tJE=require("fs/promises");var rV_=pa(wXa(),1);var fNo=(e,t,r)=>JSON.stringify(e,t,r);function g3u(e,t){return JSON.parse(e,t)}var Vp=class e extends Error{constructor({message:t,statusCode:r,body:n,rawResponse:i}){super(ar9({message:t,statusCode:r,body:n})),Object.setPrototypeOf(this,e.prototype),this.statusCode=r,this.body=n,this.rawResponse=i}};function ar9({message:e,statusCode:t,body:r}){let n=[];return e!=null&&n.push(e),t!=null&&n.push(`Status code: ${t.toString()}`),r!=null&&n.push(`Body: ${fNo(r,void 0,2)}`),n.join(`
|