fern-api 0.78.1 → 0.78.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.cjs +3 -3
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -2163,7 +2163,7 @@ ${lzh.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&WLl(th
2163
2163
  `+SGi.default.red(">> ")+t),this.screen.render(r,n)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?SGi.default.cyan(gzh(t,this.opt.mask)):SGi.default.italic(SGi.default.dim("[hidden]")):this.opt.mask?gzh(t,this.opt.mask):SGi.default.italic(SGi.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 $ns=Xi(Yae(),1),H2h=Xi(W2h(),1),G2h=Xi(fet(),1);var Fxo=class extends Xae{_run(t){this.done=t,this.editorResult=new G2h.Subject;let r=sye(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"?$ns.default.dim("Received"):$ns.default.dim("Press <enter> to launch your preferred editor."),t&&(r=$ns.default.red(">> ")+t),this.screen.render(n,r)}startExternalEditor(){this.rl.pause(),(0,H2h.editAsync)(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 X2h=require("stream");var $2h=Xi(require("readline"),1),Y2h=Xi(K2h(),1),qGi=class{constructor(t){this.rl||=$2h.default.createInterface(e7S(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 e7S(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 Y2h.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var zxo=class extends qGi{constructor(t={}){super(t),this.log=new X2h.Writable({write:(r,n,i)=>{this.writeLog(r),i()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return mxo(this.rl,this.bottomBar.split(`
2164
2164
  `).length),this}updateBottomBar(t){return mxo(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&&Pns(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var O4=Xi(fet(),1),e7h=Xi(Lqo(),1);var Yns=Xi(fet(),1),Z2h=Xi(Lqo(),1),Xns=function(e,t,r){return typeof e[t]!="function"?(0,Yns.of)(e):(0,Yns.from)((0,Z2h.default)(e[t])(r).then(n=>(e[t]=n,e)))};var k2h={set:(e,t="",r)=>{let n=e;t.split(".").forEach((i,a,u)=>{i==="__proto__"||i==="constructor"||(a===u.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((u,c)=>u!=null?u[c]:u,e),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===e?r:i}},Tza=class extends qGi{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,O4.from)(t):(0,O4.isObservable)(t)?n=t:Object.values(t).every(i=>typeof i=="object"&&!Array.isArray(i)&&i!=null)?n=(0,O4.from)(Object.entries(t).map(([i,a])=>({name:i,...a}))):n=(0,O4.from)([t]),this.process=n.pipe((0,O4.concatMap)(this.processQuestion.bind(this)),(0,O4.publish)()),this.process.connect(),this.process.pipe((0,O4.reduce)((i,a)=>(k2h.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,O4.defer)(()=>(0,O4.of)(t).pipe((0,O4.concatMap)(this.setDefaultType.bind(this)),(0,O4.concatMap)(this.filterIfRunnable.bind(this)),(0,O4.concatMap)(()=>Xns(t,"message",this.answers)),(0,O4.concatMap)(()=>Xns(t,"default",this.answers)),(0,O4.concatMap)(()=>Xns(t,"choices",this.answers)),(0,O4.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,O4.defer)(()=>(0,O4.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,O4.defer)(()=>(0,O4.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&k2h.get(this.answers,t.name)!==void 0)return O4.EMPTY;if(t.when===!1)return O4.EMPTY;if(typeof t.when!="function")return(0,O4.of)(t);let{answers:r}=this;return(0,O4.defer)(()=>(0,O4.from)((0,e7h.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,O4.filter)(n=>n!=null)))}};function t7h(e){let t=function(r,n){let i;try{i=new Tza(t.prompts,e)}catch(u){return Promise.reject(u)}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",Axo),this.registerPrompt("input",EGi),this.registerPrompt("number",Pxo),this.registerPrompt("confirm",wxo),this.registerPrompt("rawlist",jxo),this.registerPrompt("expand",Exo),this.registerPrompt("checkbox",Sxo),this.registerPrompt("password",Dxo),this.registerPrompt("editor",Fxo)},t.restoreDefaultPrompts(),t}var RUl=t7h();function r7S(e,t){RUl.registerPrompt(e,t)}function n7S(){RUl.restoreDefaultPrompts()}var i7S={prompt:RUl,ui:{BottomBar:zxo,Prompt:Tza},createPromptModule:t7h,registerPrompt:r7S,restoreDefaultPrompts:n7S,Separator:Qxe},Zns=i7S;var Gza=require("path"),U8h=require("fs"),V8h=require("readline"),p8h="posthog-node";function W5S(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[Ois.POSTHOG_ID_TAG];if(c===void 0)return a;let p=e.options.host??"https://us.i.posthog.com",s=new URL(`/project/${e.apiKey}/person/${c}`,p).toString();a.tags["PostHog Person URL"]=s;let o=a.exception?.values||[],l=o.map(A=>({...A,stacktrace:A.stacktrace?{...A.stacktrace,type:"raw",frames:(A.stacktrace.frames||[]).map(E=>({...E,platform:"node:javascript"}))}:void 0})),O={$exception_message:o[0]?.value||a.message,$exception_type:o[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:o[0]?.value||a.message,$sentry_exception_type:o[0]?.type,$sentry_tags:a.tags};return t&&r&&(O.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+a.event_id),e.capture({event:"$exception",distinctId:c,properties:O}),a}}var Ois=class{constructor(t,r,n,i){this.name=p8h,this.name=p8h,this.setupOnce=function(a,u){let c=u()?.getClient()?.getDsn()?.projectId;a(W5S(t,{organization:r,projectId:c,prefix:n,severityAllowList:i}))}}};Ois.POSTHOG_ID_TAG="posthog_distinct_id";var yis="0123456789abcdef",Ais=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+=yis.charAt(this.bytes[r]>>>4),t+=yis.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+=yis.charAt(this.bytes[r]>>>4),t+=yis.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}},jVl=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??H5S()}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 Ais.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,Ais.ofInner(t)}},H5S=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),_8h,EVl=()=>G5S().toString(),G5S=()=>(_8h||(_8h=new jVl)).generate();function J5S(e,t){let r=!1;return Object.assign(n=>{let a=global.process.listeners("uncaughtException").filter(u=>u.name!=="domainUncaughtExceptionClear"&&u._posthogErrorHandler!==!0).length===0;e(n,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t())},{_posthogErrorHandler:!0})}function K5S(e,t){global.process.on("uncaughtException",J5S(e,t))}function $5S(e){global.process.on("unhandledRejection",t=>{e(t,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var vis,h8h,bis;function Y5S(e){let t=globalThis._posthogChunkIds;if(!t)return console.error("No chunk id map found"),{};let r=Object.keys(t);return bis&&r.length===h8h||(h8h=r.length,bis=r.reduce((n,i)=>{vis||(vis={});let a=vis[i];if(a)n[a[0]]=a[1];else{let u=e(i);for(let c=u.length-1;c>=0;c--){let s=u[c]?.filename,o=t[i];if(s&&o){n[s]=o,vis[i]=[s,o];break}}}return n},{})),bis}function X5S(e){return typeof Event<"u"&&W8h(e,Event)}function Z5S(e){return H8h(e,"Object")}function qVl(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return W8h(e,Error)}}function W8h(e,t){try{return e instanceof t}catch{return!1}}function k5S(e){return H8h(e,"ErrorEvent")}function H8h(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}async function eQS(e,t,r,n){let a=n&&n.mechanism||{handled:!0,type:"generic"},u=G8h(a,r,n);return{$exception_list:await Promise.all(u.map(async s=>{let o=await uQS(e,t,s);return o.value=o.value||"",o.type=o.type||"Error",o.mechanism=a,o}))}}function G8h(e,t,r){let n=tQS(e,t,r);return n.cause?[n,...G8h(e,n.cause,r)]:[n]}function tQS(e,t,r){if(qVl(t))return t;if(e.synthetic=!0,Z5S(t)){let i=rQS(t);if(i)return i;let a=nQS(t),u=r?.syntheticException||new Error(a);return u.message=a,u}let n=r?.syntheticException||new Error(t);return n.message=`${t}`,n}function rQS(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(qVl(r))return r}}function nQS(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=aQS(e);if(k5S(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=iQS(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function iQS(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function aQS(e,t=40){let r=Object.keys(oQS(e));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=t)return y8h(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:y8h(a,t)}return""}function y8h(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function oQS(e){return qVl(e)?{message:e.message,name:e.name,stack:e.stack,...v8h(e)}:X5S(e)?{type:e.type,target:b8h(e.target),currentTarget:b8h(e.currentTarget),...v8h(e)}:e}function v8h(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 b8h(e){try{return Object.prototype.toString.call(e)}catch{return"<unknown>"}}async function uQS(e,t,r){let n={type:r.name||r.constructor.name,value:r.message},i=sQS(e,r);for(let a of t)i=await a(i);return i.length&&(n.stacktrace={frames:i,type:"raw"}),n}function sQS(e,t){return cQS(e(t.stack||"",1),e)}function cQS(e,t){let r=Y5S(t);return e.forEach(n=>{n.filename&&(n.chunk_id=r[n.filename])}),e}var lQS=2e3,Vza=class e{static async captureException(t,r,n,i,a){let u={...a};i||(u.$process_person_profile=!1);let c=await eQS(this.stackParser,this.frameModifiers,r,n);t.capture({event:"$exception",distinctId:i||EVl(),properties:{...c,...u}})}constructor(t,r){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this.startAutocaptureIfEnabled()}startAutocaptureIfEnabled(){this.isEnabled()&&(K5S(this.onException.bind(this),this.onFatalError.bind(this)),$5S(this.onException.bind(this)))}onException(t,r){e.captureException(this.client,t,r)}async onFatalError(){await this.client.shutdown(lQS)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}};function fQS(e=process.argv[1]?(0,Gza.dirname)(process.argv[1]):process.cwd(),t=Gza.sep==="\\"){let r=t?g8h(e):e;return n=>{if(!n)return;let i=t?g8h(n):n,{dir:a,base:u,ext:c}=Gza.posix.parse(i);(c===".js"||c===".mjs"||c===".cjs")&&(u=u.slice(0,c.length*-1));let p=decodeURIComponent(u);a||(a=".");let s=a.lastIndexOf("/node_modules");if(s>-1)return`${a.slice(s+14).replace(/\//g,".")}:${p}`;if(a.startsWith(r)){let o=a.slice(r.length+1).replace(/\//g,".");return o?`${o}:${p}`:p}return p}}function g8h(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var Pis=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)}}},mis=new Pis(25),J8h=new Pis(20),xVl=7,dQS=1e3,pQS=1e4;async function _QS(e){let t={};for(let i=e.length-1;i>=0;i--){let a=e[i],u=a?.filename;if(!a||typeof u!="string"||typeof a.lineno!="number"||bQS(u)||gQS(a))continue;t[u]||(t[u]=[]),t[u].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let n=[];for(let i of r){if(J8h.get(i))continue;let a=t[i];if(!a)continue;a.sort((p,s)=>p-s);let u=OQS(a);if(u.every(p=>mQS(i,p)))continue;let c=AQS(mis,i,{});n.push(hQS(i,u,c))}return await Promise.all(n).catch(()=>{}),e&&e.length>0&&yQS(e,mis),mis.reduce(),e}function hQS(e,t,r){return new Promise(n=>{let i=(0,U8h.createReadStream)(e),a=(0,V8h.createInterface)({input:i});function u(){i.destroy(),n()}let c=0,p=0,s=t[p];if(s===void 0){u();return}let o=s[0],l=s[1];function O(){J8h.set(e,1),a.close(),a.removeAllListeners(),u()}i.on("error",O),a.on("error",O),a.on("close",u),a.on("line",A=>{if(c++,!(c<o)&&(r[c]=PQS(A,0),c>=l)){if(p===t.length-1){a.close(),a.removeAllListeners();return}p++;let E=t[p];if(E===void 0){a.close(),a.removeAllListeners();return}o=E[0],l=E[1]}})})}function yQS(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;vQS(r.lineno,r,n)}}function vQS(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=K8h(e);i<e;i++){let a=r[i];if(a===void 0){m8h(t);return}t.pre_context.push(a)}if(r[e]===void 0){m8h(t);return}t.context_line=r[e];let n=$8h(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 m8h(e){delete e.pre_context,delete e.context_line,delete e.post_context}function bQS(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function gQS(e){return e.lineno!==void 0&&e.lineno>pQS||e.colno!==void 0&&e.colno>dQS}function mQS(e,t){let r=mis.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 OQS(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=O8h(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+xVl:(i.push(n),n=O8h(a)),t++}return i}function O8h(e){return[K8h(e),$8h(e)]}function K8h(e){return Math.max(1,e-xVl)}function $8h(e){return e+xVl}function AQS(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function PQS(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 wQS="4.18.0",Gxe;(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"})(Gxe||(Gxe={}));var A8h;(function(e){e.Left="left",e.Right="right",e.Center="center"})(A8h||(A8h={}));var P8h;(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})(P8h||(P8h={}));var w8h;(function(e){e.Popover="popover",e.API="api",e.Widget="widget"})(w8h||(w8h={}));var j8h;(function(e){e.Html="html",e.Text="text"})(j8h||(j8h={}));var E8h;(function(e){e.Number="number",e.Emoji="emoji"})(E8h||(E8h={}));var S8h;(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"})(S8h||(S8h={}));var D8h;(function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"})(D8h||(D8h={}));var C8h;(function(e){e.Regex="regex",e.NotRegex="not_regex",e.Exact="exact",e.IsNot="is_not",e.Icontains="icontains",e.NotIcontains="not_icontains"})(C8h||(C8h={}));var I8h;(function(e){e.Contains="contains",e.Exact="exact",e.Regex="regex"})(I8h||(I8h={}));var jQS=e=>{if("flags"in e){let t=SQS(e.flags),r=DQS(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}else{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,a])=>[i,Y8h(a)])),n=Object.fromEntries(Object.entries(t).map(([i,a])=>[i,EQS(i,a,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function EQS(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 SQS=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,NVl(r)]).filter(([,t])=>t!==void 0)),DQS=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?Y8h(n):void 0]}))},NVl=e=>e===void 0?void 0:e.variant??e.enabled,Y8h=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},CQS=1,IQS=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"]),MQS="utf8";function BQS(e,t){if(!e||typeof e!="string"||TQS(e))throw new Error(t)}function TQS(e){return e.trim().length===0}function qQS(e){return e?.replace(/\/+$/,"")}async function xQS(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 M8h(){return new Date().getTime()}function PVl(){return new Date().toISOString()}function wis(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}function NQS(){return typeof fetch<"u"?fetch:typeof globalThis.fetch<"u"?globalThis.fetch:void 0}function RQS(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 FQS(e,t=0,r){let n=RQS(e);return r?.has(n)?!1:parseInt(n,16)/4294967295<t}function B8h(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var $xo=String.fromCharCode,T8h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",gis={};function zQS(e,t){if(!gis[e]){gis[e]={};for(let r=0;r<e.length;r++)gis[e][e.charAt(r)]=r}return gis[e][t]}var Lza={compressToBase64:function(e){if(e==null)return"";let t=Lza._compress(e,6,function(r){return T8h.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:Lza._decompress(e.length,32,function(t){return zQS(T8h,e.charAt(t))})},compress:function(e){return Lza._compress(e,16,function(t){return $xo(t)})},_compress:function(e,t,r){if(e==null)return"";let n={},i={},a=[],u,c,p="",s="",o="",l=2,O=3,A=2,E=0,C=0,M;for(M=0;M<e.length;M+=1)if(p=e.charAt(M),Object.prototype.hasOwnProperty.call(n,p)||(n[p]=O++,i[p]=!0),s=o+p,Object.prototype.hasOwnProperty.call(n,s))o=s;else{if(Object.prototype.hasOwnProperty.call(i,o)){if(o.charCodeAt(0)<256){for(u=0;u<A;u++)E=E<<1,C==t-1?(C=0,a.push(r(E)),E=0):C++;for(c=o.charCodeAt(0),u=0;u<8;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1}else{for(c=1,u=0;u<A;u++)E=E<<1|c,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=0;for(c=o.charCodeAt(0),u=0;u<16;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1}l--,l==0&&(l=Math.pow(2,A),A++),delete i[o]}else for(c=n[o],u=0;u<A;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1;l--,l==0&&(l=Math.pow(2,A),A++),n[s]=O++,o=String(p)}if(o!==""){if(Object.prototype.hasOwnProperty.call(i,o)){if(o.charCodeAt(0)<256){for(u=0;u<A;u++)E=E<<1,C==t-1?(C=0,a.push(r(E)),E=0):C++;for(c=o.charCodeAt(0),u=0;u<8;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1}else{for(c=1,u=0;u<A;u++)E=E<<1|c,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=0;for(c=o.charCodeAt(0),u=0;u<16;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1}l--,l==0&&(l=Math.pow(2,A),A++),delete i[o]}else for(c=n[o],u=0;u<A;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1;l--,l==0&&(l=Math.pow(2,A),A++)}for(c=2,u=0;u<A;u++)E=E<<1|c&1,C==t-1?(C=0,a.push(r(E)),E=0):C++,c=c>>1;for(;;)if(E=E<<1,C==t-1){a.push(r(E));break}else C++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:Lza._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},u=4,c=4,p=3,s="",o,l,O,A,E,C,M;for(o=0;o<3;o+=1)n[o]=o;for(O=0,E=Math.pow(2,2),C=1;C!=E;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),O|=(A>0?1:0)*C,C<<=1;switch(O){case 0:for(O=0,E=Math.pow(2,8),C=1;C!=E;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),O|=(A>0?1:0)*C,C<<=1;M=$xo(O);break;case 1:for(O=0,E=Math.pow(2,16),C=1;C!=E;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),O|=(A>0?1:0)*C,C<<=1;M=$xo(O);break;case 2:return""}for(n[3]=M,l=M,i.push(M);;){if(a.index>e)return"";for(O=0,E=Math.pow(2,p),C=1;C!=E;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),O|=(A>0?1:0)*C,C<<=1;switch(M=O){case 0:for(O=0,E=Math.pow(2,8),C=1;C!=E;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),O|=(A>0?1:0)*C,C<<=1;n[c++]=$xo(O),M=c-1,u--;break;case 1:for(O=0,E=Math.pow(2,16),C=1;C!=E;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),O|=(A>0?1:0)*C,C<<=1;n[c++]=$xo(O),M=c-1,u--;break;case 2:return i.join("")}if(u==0&&(u=Math.pow(2,p),p++),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),u--,l=s,u==0&&(u=Math.pow(2,p),p++)}}},SVl=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)}},Wza=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()}},Yxo=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function q8h(e){if(e instanceof Wza){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 wVl(e){return typeof e=="object"&&(e instanceof Wza||e instanceof Yxo)}function x8h(e){return typeof e=="object"&&e instanceof Wza&&e.status===413}var DVl;(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(DVl||(DVl={}));var CVl=class{constructor(t,r){this.flushPromise=null,this.shutdownPromise=null,this.pendingPromises={},this._events=new SVl,this._isInitialized=!1,BQS(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=qQS(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:wVl},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(Gxe.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(Gxe.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(Gxe.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=EVl();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,u){this.wrap(()=>{let c=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...u||{}}});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=FQS(this.apiKey,CQS,IQS)?`${this.host}/flags/?v=2`:`${this.host}/decide/?v=4`,p={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,p,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(s=>s.json()).then(s=>jQS(s)).catch(s=>{this._events.emit("error",s)})}async getFeatureFlagStateless(t,r,n={},i={},a={},u){await this._initPromise;let c=await this.getFeatureFlagDetailStateless(t,r,n,i,a,u);if(c===void 0)return{response:void 0,requestId:void 0};let p=NVl(c.response);return p===void 0&&(p=!1),{response:p,requestId:c.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},a={},u){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(r,n,i,a,u,[t]);return c===void 0?void 0:{response:c.flags[t],requestId:c.requestId}}async getFeatureFlagPayloadStateless(t,r,n={},i={},a={},u){await this._initPromise;let c=await this.getFeatureFlagPayloadsStateless(r,n,i,a,u,[t]);if(!c)return;let p=c[t];return p===void 0?null:p}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},a,u){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,a,u)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},a,u){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,a,u)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},a,u){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(t,r,n,i,a,u);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,u){await this._initPromise;let c={};(a??this.disableGeoip)&&(c.geoip_disable=!0),u&&(c.flag_keys_to_evaluate=u);let p=await this.getDecide(t,r,n,i,c);if(p!==void 0)return p.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"),p.quotaLimited?.includes(DVl.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:p?.requestId}):p}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 u=`Surveys API could not be loaded: ${a.status}`,c=new Error(u);this.logMsgIfDebug(()=>console.error(c)),this._events.emit("error",new Error(u));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(Gxe.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(Gxe.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(Gxe.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(Gxe.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(Gxe.Queue,a),this._events.emit(t,i),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=wis(()=>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:PVl()};this.historicalMigration&&(i.historical_migration=!0);let a=JSON.stringify(i),u=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${M8h()}&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(Lza.compressToBase64(a))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:a};try{await this.fetchWithRetry(u,c)}catch(p){this._events.emit("error",p)}}prepareMessage(t,r,n){let i={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:n?.timestamp?n?.timestamp:PVl(),uuid:n?.uuid?n.uuid:EVl()};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 q8h(t)})}async flush(){let t=B8h([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),B8h([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(Gxe.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(O=>O.message),u=()=>{let A=(this.getPersistedProperty(Gxe.Queue)||[]).slice(i.length);this.setPersistedProperty(Gxe.Queue,A),t=A},c={api_key:this.apiKey,batch:a,sent_at:PVl()};this.historicalMigration&&(c.historical_migration=!0);let p=JSON.stringify(c),s=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${M8h()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,o=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(Lza.compressToBase64(p))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:p},l={retryCheck:O=>x8h(O)?!1:wVl(O)};try{await this.fetchWithRetry(s,o,l)}catch(O){if(x8h(O)&&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 O instanceof Yxo||u(),this._events.emit("error",O),O}u(),r.push(...a)}this._events.emit("flush",r)}async fetchWithRetry(t,r,n,i){var a;(a=AbortSignal).timeout??(a.timeout=function(s){let o=new AbortController;return setTimeout(()=>o.abort(),s),o.signal});let u=r.body?r.body:"",c=-1;try{c=Buffer.byteLength(u,MQS)}catch{c=new TextEncoder().encode(u).length}return await xQS(async()=>{let p=null;try{p=await this.fetch(t,{signal:AbortSignal.timeout(i??this.requestTimeout),...r})}catch(o){throw new Yxo(o)}if(!(r.mode==="no-cors")&&(p.status<200||p.status>=400))throw new Wza(p,c);return p},{...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(Gxe.Queue)||[]).length===0||(await this.flush(),r)););}catch(i){if(!wVl(i))throw i;await q8h(i)}};return Promise.race([new Promise((i,a)=>{wis(()=>{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}},IVl=NQS();if(!IVl){let e=d8h();IVl=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 X8h=IVl,jis=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()}},Z8h=new jis(async()=>{try{return await import("crypto")}catch{return}});async function QQS(){return await Z8h.getValue()}var LQS=new jis(async()=>{if(typeof globalThis.crypto?.subtle<"u")return globalThis.crypto.subtle;try{let e=await Z8h.getValue();if(e?.webcrypto?.subtle)return e.webcrypto.subtle}catch{}});async function UQS(){return await LQS.getValue()}async function VQS(e){let t=await QQS();if(t)return t.createHash("sha1").update(e).digest("hex");let r=await UQS();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 WQS=60*1e3,HQS=1152921504606847e3,GQS=["is_not"],Uza=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},Zae=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},MVl=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:a,customHeaders:u,...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||X8h,this.onError=c.onError,this.customHeaders=u,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 u,c;if(!this.loadedSuccessfullyOnce)return u;for(let p of this.featureFlags)if(t===p.key){c=p;break}if(c!==void 0)try{u=await this.computeFlagLocally(c,r,n,i,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${u}`))}catch(p){p instanceof Zae?this.logMsgIfDebug(()=>console.debug(`InconclusiveMatchError when computing flag locally: ${t}: ${p}`)):p instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${p}`))}return u}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={},u={},c=this.featureFlags.length==0;return await Promise.all(this.featureFlags.map(async p=>{try{let s=await this.computeFlagLocally(p,t,r,n,i);a[p.key]=s;let o=await this.computeFeatureFlagPayloadLocally(p.key,s);o&&(u[p.key]=o)}catch(s){s instanceof Zae||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${p.key}: ${s}`)),c=!0}})),{response:a,payloads:u,fallbackToDecide:c}}async computeFlagLocally(t,r,n={},i={},a={}){if(t.ensure_experience_continuity)throw new Zae("Flag has experience continuity enabled");if(!t.active)return!1;let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let p=this.groupTypeMapping[String(c)];if(!p)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Zae("Flag has unknown group type index");if(!(p 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[p];return await this.matchFeatureFlagProperties(t,n[p],s)}else return await this.matchFeatureFlagProperties(t,r,i)}async matchFeatureFlagProperties(t,r,n){let i=t.filters||{},a=i.groups||[],u=!1,c,p=[...a].sort((s,o)=>{let l=!!s.variant,O=!!o.variant;return l&&O?0:l?-1:O?1:0});for(let s of p)try{if(await this.isConditionMatch(t,r,s,n)){let o=s.variant,l=i.multivariate?.variants||[];o&&l.some(O=>O.key===o)?c=o:c=await this.getMatchingVariant(t,r)||!0;break}}catch(o){if(o instanceof Zae)u=!0;else throw o}if(c!==void 0)return c;if(u)throw new Zae("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,u=c=>{this.logMsgIfDebug(()=>console.warn(c))};if((n.properties||[]).length>0){for(let c of n.properties){let p=c.type,s=!1;if(p==="cohort"?s=e5h(c,i,this.cohorts,this.debugMode):s=k8h(c,i,u),!s)return!1}if(a==null)return!0}return!(a!=null&&await N8h(t.key,r)>a/100)}async getMatchingVariant(t,r){let n=await N8h(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(WQS,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 Uza(`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 Uza(`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 Uza(`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 Uza&&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=wis(()=>{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=wis(()=>{a.abort()},this.timeout),n.signal=a.signal}try{return this.fetch(r,n)}finally{clearTimeout(i)}}};async function N8h(e,t,r=""){let n=await VQS(`${e}.${t}${r}`);return parseInt(n.slice(0,15),16)/HQS}function k8h(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 Zae("Operator is_not_set is not supported")}else throw new Zae(`Property ${n} not found in propertyValues`);let u=t[n];if(u==null&&!GQS.includes(a))return r&&r(`Property ${n} cannot have a value of null/undefined with the ${a} operator`),!1;function c(s,o){return Array.isArray(s)?s.map(l=>String(l).toLowerCase()).includes(String(o).toLowerCase()):String(s).toLowerCase()===String(o).toLowerCase()}function p(s,o,l){if(l==="gt")return s>o;if(l==="gte")return s>=o;if(l==="lt")return s<o;if(l==="lte")return s<=o;throw new Error(`Invalid operator: ${l}`)}switch(a){case"exact":return c(i,u);case"is_not":return!c(i,u);case"is_set":return n in t;case"icontains":return String(u).toLowerCase().includes(String(i).toLowerCase());case"not_icontains":return!String(u).toLowerCase().includes(String(i).toLowerCase());case"regex":return R8h(String(i))&&String(u).match(String(i))!==null;case"not_regex":return R8h(String(i))&&String(u).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&&u!=null?typeof u=="string"?p(u,String(i),a):p(u,s,a):p(String(u),String(i),a)}case"is_date_after":case"is_date_before":{let s=JQS(String(i));if(s==null&&(s=F8h(i)),s==null)throw new Zae(`Invalid date: ${i}`);let o=F8h(u);return["is_date_before"].includes(a)?o<s:o>s}default:throw new Zae(`Unknown operator: ${a}`)}}function e5h(e,t,r,n=!1){let i=String(e.value);if(!(i in r))throw new Zae("can't match cohort without a given cohort property value");let a=r[i];return t5h(a,t,r,n)}function t5h(e,t,r,n=!1){if(!e)return!0;let i=e.type,a=e.values;if(!a||a.length===0)return!0;let u=!1;if("values"in a[0]){for(let c of a)try{let p=t5h(c,t,r,n);if(i==="AND"){if(!p)return!1}else if(p)return!0}catch(p){if(p instanceof Zae)n&&console.debug(`Failed to compute property ${c} locally: ${p}`),u=!0;else throw p}if(u)throw new Zae("Can't match cohort without a given cohort property value");return i==="AND"}else{for(let c of a)try{let p;c.type==="cohort"?p=e5h(c,t,r,n):p=k8h(c,t);let s=c.negation||!1;if(i==="AND"){if(!p&&!s||p&&s)return!1}else if(p&&!s||!p&&s)return!0}catch(p){if(p instanceof Zae)n&&console.debug(`Failed to compute property ${c} locally: ${p}`),u=!0;else throw p}if(u)throw new Zae("can't match cohort without a given cohort property value");return i==="AND"}}function R8h(e){try{return new RegExp(e),!0}catch{return!1}}function F8h(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 Zae(`${e} is in an invalid date format`)}else throw new Zae(`The date provided ${e} must be a string, number, or date object`)}function JQS(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 BVl=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},KQS=100,z8h=30*1e3,$QS=50*1e3,TVl=class extends CVl{constructor(t,r={}){if(super(t,r),this._memoryStorage=new BVl,this.options=r,this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,KQS):z8h,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 MVl({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 Vza(this,r),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||$QS}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):X8h(t,r)}getLibraryVersion(){return wQS}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:u,timestamp:c,disableGeoip:p,uuid:s}=t,o=A=>{super.captureStateless(r,n,A,{timestamp:c,disableGeoip:p,uuid:s})},l=async(A,E,C)=>(await super.getFeatureFlagsStateless(A,E,void 0,void 0,C)).flags,O=Promise.resolve().then(async()=>{if(u)return await l(r,a,p);if(n==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let A={};for(let[E,C]of Object.entries(a||{}))A[E]=String(C);return await this.getAllFlags(r,{groups:A,disableGeoip:p,onlyEvaluateLocally:!0})}return{}}).then(A=>{let E={};if(A)for(let[M,q]of Object.entries(A))E[`$feature/${M}`]=q;let C=Object.keys(A||{}).filter(M=>A?.[M]!==!1).sort();return C.length>0&&(E.$active_feature_flags=C),E}).catch(()=>({})).then(A=>{o({...A,...i,$groups:a})});this.addPendingPromise(O)}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:u,timestamp:c,disableGeoip:p,uuid:s}=t,o=A=>super.captureStatelessImmediate(r,n,A,{timestamp:c,disableGeoip:p,uuid:s}),l=async(A,E,C)=>(await super.getFeatureFlagsStateless(A,E,void 0,void 0,C)).flags;await Promise.resolve().then(async()=>{if(u)return await l(r,a,p);if(n==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let A={};for(let[E,C]of Object.entries(a||{}))A[E]=String(C);return await this.getAllFlags(r,{groups:A,disableGeoip:p,onlyEvaluateLocally:!0})}return{}}).then(A=>{let E={};if(A)for(let[M,q]of Object.entries(A))E[`$feature/${M}`]=q;let C=Object.keys(A||{}).filter(M=>A?.[M]!==!1).sort();return C.length>0&&(E.$active_feature_flags=C),E}).catch(()=>({})).then(A=>{o({...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=z8h){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:u,sendFeatureFlagEvents:c,personProperties:p,groupProperties:s}=n||{},o=this.addLocalPersonAndGroupProperties(r,i,p,s);p=o.allPersonProperties,s=o.allGroupProperties,u==null&&(u=!1),c==null&&(c=!0);let l=await this.featureFlagsPoller?.getFeatureFlag(t,r,i,p,s),O=l!==void 0,A,E;if(!O&&!u){let M=await super.getFeatureFlagDetailStateless(t,r,i,p,s,a);if(M===void 0)return;E=M.response,l=NVl(E),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:E?.metadata?.id,$feature_flag_version:E?.metadata?.version,$feature_flag_reason:E?.reason?.description??E?.reason?.code,locally_evaluated:O,[`$feature/${t}`]:l,$feature_flag_request_id:A},groups:i,disableGeoip:a})),l}async getFeatureFlagPayload(t,r,n,i){let{groups:a,disableGeoip:u}=i||{},{onlyEvaluateLocally:c,sendFeatureFlagEvents:p,personProperties:s,groupProperties:o}=i||{},l=this.addLocalPersonAndGroupProperties(r,a,s,o);s=l.allPersonProperties,o=l.allGroupProperties;let O;return this.featureFlagsPoller!==void 0&&(n||(n=await this.getFeatureFlag(t,r,{...i,onlyEvaluateLocally:!0,sendFeatureFlagEvents:!1})),n&&(O=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,n))),c==null&&(c=!1),p==null&&(p=!0),c==null&&(c=!1),!(O!==void 0)&&!c&&(O=await super.getFeatureFlagPayloadStateless(t,r,a,s,o,u)),O}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:u,groupProperties:c}=r||{},p=this.addLocalPersonAndGroupProperties(t,n,u,c);u=p.allPersonProperties,c=p.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,n,u,c),o={},l={},O=!0;if(s&&(o=s.response,l=s.payloads,O=s.fallbackToDecide),O&&!a){let A=await super.getFeatureFlagsAndPayloadsStateless(t,n,u,c,i);o={...o,...A.flags||{}},l={...l,...A.payloads||{}}}return{featureFlags:o,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||{}},u={};if(r)for(let c of Object.keys(r))u[c]={$group_key:r[c],...i?.[c]||{}};return{allPersonProperties:a,allGroupProperties:u}}captureException(t,r,n){let i=new Error("PostHog syntheticException");Vza.captureException(this,t,{syntheticException:i},r,n)}},Q8h=/\(error: (.*)\)/,r5h=50,n5h="?";function YQS(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return n=>{let i=n.match(r);if(i){let a,u,c,p,s;if(i[1]){c=i[1];let O=c.lastIndexOf(".");if(c[O-1]==="."&&O--,O>0){a=c.slice(0,O),u=c.slice(O+1);let A=a.indexOf(".Module");A>0&&(c=c.slice(A+1),a=a.slice(0,A))}p=void 0}u&&(p=a,s=u),u==="<anonymous>"&&(s=void 0,c=void 0),c===void 0&&(s=s||n5h,c=p?`${p}.${s}`:s);let o=i[2]?.startsWith("file://")?i[2].slice(7):i[2],l=i[5]==="native";return o?.match(/\/[A-Z]:/)&&(o=o.slice(1)),!o&&i[5]&&!l&&(o=i[5]),{filename:o?decodeURI(o):void 0,module:e?e(o):void 0,function:c,lineno:L8h(i[3]),colno:L8h(i[4]),in_app:XQS(o||"",l),platform:"node:javascript"}}if(n.match(t))return{filename:n,platform:"node:javascript"}}}function XQS(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 L8h(e){return parseInt(e||"",10)||void 0}function ZQS(e){return[90,YQS(e)]}function kQS(e){let r=[ZQS(e)].sort((n,i)=>n[0]-i[0]).map(n=>n[1]);return(n,i=0)=>{let a=[],u=n.split(`
2166
- `);for(let c=i;c<u.length;c++){let p=u[c];if(p.length>1024)continue;let s=Q8h.test(p)?p.replace(Q8h,"$1"):p;if(!s.match(/\S*Error: /)){for(let o of r){let l=o(s);if(l){a.push(l);break}}if(a.length>=r5h)break}}return e9S(a)}}function e9S(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,r5h).map(r=>({...r,filename:r.filename||t9S(t).filename,function:r.function||n5h}))}function t9S(e){return e[e.length-1]||{}}Vza.stackParser=kQS(fQS());Vza.frameModifiers=[_QS];var Hza=class extends TVl{getLibraryId(){return"posthog-node"}};var Eis=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Hza(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.78.1",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var Xxo=class{async sendEvent(){}async identify(){}async flush(){}};var Jza=require("fs/promises"),u5h=require("os"),s5h=require("path");var i5h=Xi(require("crypto")),Dis=new Uint8Array(256),Sis=Dis.length;function RVl(){return Sis>Dis.length-16&&(i5h.default.randomFillSync(Dis),Sis=0),Dis.slice(Sis,Sis+=16)}var fye=[];for(let e=0;e<256;++e)fye.push((e+256).toString(16).slice(1));function a5h(e,t=0){return fye[e[t+0]]+fye[e[t+1]]+fye[e[t+2]]+fye[e[t+3]]+"-"+fye[e[t+4]]+fye[e[t+5]]+"-"+fye[e[t+6]]+fye[e[t+7]]+"-"+fye[e[t+8]]+fye[e[t+9]]+"-"+fye[e[t+10]]+fye[e[t+11]]+fye[e[t+12]]+fye[e[t+13]]+fye[e[t+14]]+fye[e[t+15]]}var o5h=Xi(require("crypto")),FVl={randomUUID:o5h.default.randomUUID};function r9S(e,t,r){if(FVl.randomUUID&&!t&&!e)return FVl.randomUUID();e=e||{};let n=e.random||(e.rng||RVl)();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 a5h(n)}var Fft=r9S;var n9S="id",i9S=".fern",Zxo=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new Hza(r),this.userId=t==null?void 0:E7l(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.78.1",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Jl(D_.of((0,u5h.homedir)()),hs.of(i9S),hs.of(n9S));await _v(t)||(await(0,Jza.mkdir)((0,s5h.dirname)(t),{recursive:!0}),await(0,Jza.writeFile)(t,Fft())),this.persistedDistinctId=(await(0,Jza.readFile)(t)).toString()}return this.persistedDistinctId}};var zVl;async function Kza(){return zVl==null&&(zVl=await a9S()),zVl}async function a9S(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new Xxo;let r=await WXu();return r!=null?new Zxo({token:r,posthogApiKey:e}):await V4a()!=null?new Eis({posthogApiKey:e}):new Zxo({token:void 0,posthogApiKey:e})}catch{return new Xxo}}function kxo(e,t){return function(){return e.apply(t,arguments)}}var{toString:o9S}=Object.prototype,{getPrototypeOf:LVl}=Object,{iterator:Iis,toStringTag:l5h}=Symbol,Mis=(e=>t=>{let r=o9S.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),KDr=e=>(e=e.toLowerCase(),t=>Mis(t)===e),Bis=e=>t=>typeof t===e,{isArray:Yza}=Array,$za=Bis("undefined");function eNo(e){return e!==null&&!$za(e)&&e.constructor!==null&&!$za(e.constructor)&&Jxe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var f5h=KDr("ArrayBuffer");function u9S(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&f5h(e.buffer),t}var s9S=Bis("string"),Jxe=Bis("function"),d5h=Bis("number"),tNo=e=>e!==null&&typeof e=="object",c9S=e=>e===!0||e===!1,Cis=e=>{if(Mis(e)!=="object")return!1;let t=LVl(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(l5h in e)&&!(Iis in e)},l9S=e=>{if(!tNo(e)||eNo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},f9S=KDr("Date"),d9S=KDr("File"),p9S=KDr("Blob"),_9S=KDr("FileList"),h9S=e=>tNo(e)&&Jxe(e.pipe),y9S=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Jxe(e.append)&&((t=Mis(e))==="formdata"||t==="object"&&Jxe(e.toString)&&e.toString()==="[object FormData]"))},v9S=KDr("URLSearchParams"),[b9S,g9S,m9S,O9S]=["ReadableStream","Request","Response","Headers"].map(KDr),A9S=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rNo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Yza(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(eNo(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length,c;for(n=0;n<u;n++)c=a[n],t.call(null,e[c],c,e)}}function p5h(e,t){if(eNo(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 QGi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_5h=e=>!$za(e)&&e!==QGi;function QVl(){let{caseless:e,skipUndefined:t}=_5h(this)&&this||{},r={},n=(i,a)=>{let u=e&&p5h(r,a)||a;Cis(r[u])&&Cis(i)?r[u]=QVl(r[u],i):Cis(i)?r[u]=QVl({},i):Yza(i)?r[u]=i.slice():(!t||!$za(i))&&(r[u]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&rNo(arguments[i],n);return r}var P9S=(e,t,r,{allOwnKeys:n}={})=>(rNo(t,(i,a)=>{r&&Jxe(i)?e[a]=kxo(i,r):e[a]=i},{allOwnKeys:n}),e),w9S=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),j9S=(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)},E9S=(e,t,r,n)=>{let i,a,u,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)u=i[a],(!n||n(u,e,t))&&!c[u]&&(t[u]=e[u],c[u]=!0);e=r!==!1&&LVl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},S9S=(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},D9S=e=>{if(!e)return null;if(Yza(e))return e;let t=e.length;if(!d5h(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},C9S=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&LVl(Uint8Array)),I9S=(e,t)=>{let n=(e&&e[Iis]).call(e),i;for(;(i=n.next())&&!i.done;){let a=i.value;t.call(e,a[0],a[1])}},M9S=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},B9S=KDr("HTMLFormElement"),T9S=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),c5h=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),q9S=KDr("RegExp"),h5h=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};rNo(r,(i,a)=>{let u;(u=t(i,a,e))!==!1&&(n[a]=u||i)}),Object.defineProperties(e,n)},x9S=e=>{h5h(e,(t,r)=>{if(Jxe(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(Jxe(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+"'")})}})},N9S=(e,t)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Yza(e)?n(e):n(String(e).split(t)),r},R9S=()=>{},F9S=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function z9S(e){return!!(e&&Jxe(e.append)&&e[l5h]==="FormData"&&e[Iis])}var Q9S=e=>{let t=new Array(10),r=(n,i)=>{if(tNo(n)){if(t.indexOf(n)>=0)return;if(eNo(n))return n;if(!("toJSON"in n)){t[i]=n;let a=Yza(n)?[]:{};return rNo(n,(u,c)=>{let p=r(u,i+1);!$za(p)&&(a[c]=p)}),t[i]=void 0,a}}return n};return r(e,0)},L9S=KDr("AsyncFunction"),U9S=e=>e&&(tNo(e)||Jxe(e))&&Jxe(e.then)&&Jxe(e.catch),y5h=((e,t)=>e?setImmediate:t?((r,n)=>(QGi.addEventListener("message",({source:i,data:a})=>{i===QGi&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),QGi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Jxe(QGi.postMessage)),V9S=typeof queueMicrotask<"u"?queueMicrotask.bind(QGi):typeof process<"u"&&process.nextTick||y5h,W9S=e=>e!=null&&Jxe(e[Iis]),Hf={isArray:Yza,isArrayBuffer:f5h,isBuffer:eNo,isFormData:y9S,isArrayBufferView:u9S,isString:s9S,isNumber:d5h,isBoolean:c9S,isObject:tNo,isPlainObject:Cis,isEmptyObject:l9S,isReadableStream:b9S,isRequest:g9S,isResponse:m9S,isHeaders:O9S,isUndefined:$za,isDate:f9S,isFile:d9S,isBlob:p9S,isRegExp:q9S,isFunction:Jxe,isStream:h9S,isURLSearchParams:v9S,isTypedArray:C9S,isFileList:_9S,forEach:rNo,merge:QVl,extend:P9S,trim:A9S,stripBOM:w9S,inherits:j9S,toFlatObject:E9S,kindOf:Mis,kindOfTest:KDr,endsWith:S9S,toArray:D9S,forEachEntry:I9S,matchAll:M9S,isHTMLForm:B9S,hasOwnProperty:c5h,hasOwnProp:c5h,reduceDescriptors:h5h,freezeMethods:x9S,toObjectSet:N9S,toCamelCase:T9S,noop:R9S,toFiniteNumber:F9S,findKey:p5h,global:QGi,isContextDefined:_5h,isSpecCompliantForm:z9S,toJSONObject:Q9S,isAsyncFn:L9S,isThenable:U9S,setImmediate:y5h,asap:V9S,isIterable:W9S};function Xza(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)}Hf.inherits(Xza,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:Hf.toJSONObject(this.config),code:this.code,status:this.status}}});var v5h=Xza.prototype,b5h={};["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=>{b5h[e]={value:e}});Object.defineProperties(Xza,b5h);Object.defineProperty(v5h,"isAxiosError",{value:!0});Xza.from=(e,t,r,n,i,a)=>{let u=Object.create(v5h);Hf.toFlatObject(e,u,function(o){return o!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return Xza.call(u,c,p,r,n,i),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",a&&Object.assign(u,a),u};var B0=Xza;var g5h=Xi(tis(),1),Tis=g5h.default;function UVl(e){return Hf.isPlainObject(e)||Hf.isArray(e)}function O5h(e){return Hf.endsWith(e,"[]")?e.slice(0,-2):e}function m5h(e,t,r){return e?e.concat(t).map(function(i,a){return i=O5h(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function H9S(e){return Hf.isArray(e)&&!e.some(UVl)}var G9S=Hf.toFlatObject(Hf,{},null,function(t){return/^is[A-Z]/.test(t)});function J9S(e,t,r){if(!Hf.isObject(e))throw new TypeError("target must be an object");t=t||new(Tis||FormData),r=Hf.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,M){return!Hf.isUndefined(M[C])});let n=r.metaTokens,i=r.visitor||o,a=r.dots,u=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&Hf.isSpecCompliantForm(t);if(!Hf.isFunction(i))throw new TypeError("visitor must be a function");function s(E){if(E===null)return"";if(Hf.isDate(E))return E.toISOString();if(Hf.isBoolean(E))return E.toString();if(!p&&Hf.isBlob(E))throw new B0("Blob is not supported. Use a Buffer instead.");return Hf.isArrayBuffer(E)||Hf.isTypedArray(E)?p&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function o(E,C,M){let q=E;if(E&&!M&&typeof E=="object"){if(Hf.endsWith(C,"{}"))C=n?C:C.slice(0,-2),E=JSON.stringify(E);else if(Hf.isArray(E)&&H9S(E)||(Hf.isFileList(E)||Hf.endsWith(C,"[]"))&&(q=Hf.toArray(E)))return C=O5h(C),q.forEach(function(U,Q){!(Hf.isUndefined(U)||U===null)&&t.append(u===!0?m5h([C],Q,a):u===null?C:C+"[]",s(U))}),!1}return UVl(E)?!0:(t.append(m5h(M,C,a),s(E)),!1)}let l=[],O=Object.assign(G9S,{defaultVisitor:o,convertValue:s,isVisitable:UVl});function A(E,C){if(!Hf.isUndefined(E)){if(l.indexOf(E)!==-1)throw Error("Circular reference detected in "+C.join("."));l.push(E),Hf.forEach(E,function(q,L){(!(Hf.isUndefined(q)||q===null)&&i.call(t,q,Hf.isString(L)?L.trim():L,C,O))===!0&&A(q,C?C.concat(L):[L])}),l.pop()}}if(!Hf.isObject(e))throw new TypeError("data must be an object");return A(e),t}var $Ei=J9S;function A5h(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function P5h(e,t){this._pairs=[],e&&$Ei(e,this,t)}var w5h=P5h.prototype;w5h.append=function(t,r){this._pairs.push([t,r])};w5h.toString=function(t){let r=t?function(n){return t.call(this,n,A5h)}:A5h;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var j5h=P5h;function K9S(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function LGi(e,t,r){if(!t)return e;let n=r&&r.encode||K9S;Hf.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,a;if(i?a=i(t,r):a=Hf.isURLSearchParams(t)?t.toString():new j5h(t,r).toString(n),a){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var VVl=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){Hf.forEach(this.handlers,function(n){n!==null&&t(n)})}},WVl=VVl;var Zza={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var C5h=Xi(require("crypto"),1);var E5h=Xi(require("url"),1),S5h=E5h.default.URLSearchParams;var HVl="abcdefghijklmnopqrstuvwxyz",D5h="0123456789",I5h={DIGIT:D5h,ALPHA:HVl,ALPHA_DIGIT:HVl+HVl.toUpperCase()+D5h},$9S=(e=16,t=I5h.ALPHA_DIGIT)=>{let r="",{length:n}=t,i=new Uint32Array(e);C5h.default.randomFillSync(i);for(let a=0;a<e;a++)r+=t[i[a]%n];return r},M5h={isNode:!0,classes:{URLSearchParams:S5h,FormData:Tis,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:I5h,generateString:$9S,protocols:["http","https","file","data"]};var KVl={};ds(KVl,{hasBrowserEnv:()=>JVl,hasStandardBrowserEnv:()=>Y9S,hasStandardBrowserWebWorkerEnv:()=>X9S,navigator:()=>GVl,origin:()=>Z9S});var JVl=typeof window<"u"&&typeof document<"u",GVl=typeof navigator=="object"&&navigator||void 0,Y9S=JVl&&(!GVl||["ReactNative","NativeScript","NS"].indexOf(GVl.product)<0),X9S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Z9S=JVl&&window.location.href||"http://localhost";var bz={...KVl,...M5h};function $Vl(e,t){return $Ei(e,new bz.classes.URLSearchParams,{visitor:function(r,n,i,a){return bz.isNode&&Hf.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function k9S(e){return Hf.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function eLS(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 tLS(e){function t(r,n,i,a){let u=r[a++];if(u==="__proto__")return!0;let c=Number.isFinite(+u),p=a>=r.length;return u=!u&&Hf.isArray(i)?i.length:u,p?(Hf.hasOwnProp(i,u)?i[u]=[i[u],n]:i[u]=n,!c):((!i[u]||!Hf.isObject(i[u]))&&(i[u]=[]),t(r,n,i[u],a)&&Hf.isArray(i[u])&&(i[u]=eLS(i[u])),!c)}if(Hf.isFormData(e)&&Hf.isFunction(e.entries)){let r={};return Hf.forEachEntry(e,(n,i)=>{t(k9S(n),i,r,0)}),r}return null}var qis=tLS;function rLS(e,t,r){if(Hf.isString(e))try{return(t||JSON.parse)(e),Hf.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var YVl={transitional:Zza,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Hf.isObject(t);if(a&&Hf.isHTMLForm(t)&&(t=new FormData(t)),Hf.isFormData(t))return i?JSON.stringify(qis(t)):t;if(Hf.isArrayBuffer(t)||Hf.isBuffer(t)||Hf.isStream(t)||Hf.isFile(t)||Hf.isBlob(t)||Hf.isReadableStream(t))return t;if(Hf.isArrayBufferView(t))return t.buffer;if(Hf.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 $Vl(t,this.formSerializer).toString();if((c=Hf.isFileList(t))||n.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return $Ei(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),rLS(t)):t}],transformResponse:[function(t){let r=this.transitional||YVl.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(Hf.isResponse(t)||Hf.isReadableStream(t))return t;if(t&&Hf.isString(t)&&(n&&!this.responseType||i)){let u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(u)throw c.name==="SyntaxError"?B0.from(c,B0.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:bz.classes.FormData,Blob:bz.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Hf.forEach(["delete","get","head","post","put","patch"],e=>{YVl.headers[e]={}});var kza=YVl;var nLS=Hf.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"]),B5h=e=>{let t={},r,n,i;return e&&e.split(`
2166
+ `);for(let c=i;c<u.length;c++){let p=u[c];if(p.length>1024)continue;let s=Q8h.test(p)?p.replace(Q8h,"$1"):p;if(!s.match(/\S*Error: /)){for(let o of r){let l=o(s);if(l){a.push(l);break}}if(a.length>=r5h)break}}return e9S(a)}}function e9S(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,r5h).map(r=>({...r,filename:r.filename||t9S(t).filename,function:r.function||n5h}))}function t9S(e){return e[e.length-1]||{}}Vza.stackParser=kQS(fQS());Vza.frameModifiers=[_QS];var Hza=class extends TVl{getLibraryId(){return"posthog-node"}};var Eis=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Hza(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.78.2",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var Xxo=class{async sendEvent(){}async identify(){}async flush(){}};var Jza=require("fs/promises"),u5h=require("os"),s5h=require("path");var i5h=Xi(require("crypto")),Dis=new Uint8Array(256),Sis=Dis.length;function RVl(){return Sis>Dis.length-16&&(i5h.default.randomFillSync(Dis),Sis=0),Dis.slice(Sis,Sis+=16)}var fye=[];for(let e=0;e<256;++e)fye.push((e+256).toString(16).slice(1));function a5h(e,t=0){return fye[e[t+0]]+fye[e[t+1]]+fye[e[t+2]]+fye[e[t+3]]+"-"+fye[e[t+4]]+fye[e[t+5]]+"-"+fye[e[t+6]]+fye[e[t+7]]+"-"+fye[e[t+8]]+fye[e[t+9]]+"-"+fye[e[t+10]]+fye[e[t+11]]+fye[e[t+12]]+fye[e[t+13]]+fye[e[t+14]]+fye[e[t+15]]}var o5h=Xi(require("crypto")),FVl={randomUUID:o5h.default.randomUUID};function r9S(e,t,r){if(FVl.randomUUID&&!t&&!e)return FVl.randomUUID();e=e||{};let n=e.random||(e.rng||RVl)();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 a5h(n)}var Fft=r9S;var n9S="id",i9S=".fern",Zxo=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new Hza(r),this.userId=t==null?void 0:E7l(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.78.2",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Jl(D_.of((0,u5h.homedir)()),hs.of(i9S),hs.of(n9S));await _v(t)||(await(0,Jza.mkdir)((0,s5h.dirname)(t),{recursive:!0}),await(0,Jza.writeFile)(t,Fft())),this.persistedDistinctId=(await(0,Jza.readFile)(t)).toString()}return this.persistedDistinctId}};var zVl;async function Kza(){return zVl==null&&(zVl=await a9S()),zVl}async function a9S(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new Xxo;let r=await WXu();return r!=null?new Zxo({token:r,posthogApiKey:e}):await V4a()!=null?new Eis({posthogApiKey:e}):new Zxo({token:void 0,posthogApiKey:e})}catch{return new Xxo}}function kxo(e,t){return function(){return e.apply(t,arguments)}}var{toString:o9S}=Object.prototype,{getPrototypeOf:LVl}=Object,{iterator:Iis,toStringTag:l5h}=Symbol,Mis=(e=>t=>{let r=o9S.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),KDr=e=>(e=e.toLowerCase(),t=>Mis(t)===e),Bis=e=>t=>typeof t===e,{isArray:Yza}=Array,$za=Bis("undefined");function eNo(e){return e!==null&&!$za(e)&&e.constructor!==null&&!$za(e.constructor)&&Jxe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var f5h=KDr("ArrayBuffer");function u9S(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&f5h(e.buffer),t}var s9S=Bis("string"),Jxe=Bis("function"),d5h=Bis("number"),tNo=e=>e!==null&&typeof e=="object",c9S=e=>e===!0||e===!1,Cis=e=>{if(Mis(e)!=="object")return!1;let t=LVl(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(l5h in e)&&!(Iis in e)},l9S=e=>{if(!tNo(e)||eNo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},f9S=KDr("Date"),d9S=KDr("File"),p9S=KDr("Blob"),_9S=KDr("FileList"),h9S=e=>tNo(e)&&Jxe(e.pipe),y9S=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Jxe(e.append)&&((t=Mis(e))==="formdata"||t==="object"&&Jxe(e.toString)&&e.toString()==="[object FormData]"))},v9S=KDr("URLSearchParams"),[b9S,g9S,m9S,O9S]=["ReadableStream","Request","Response","Headers"].map(KDr),A9S=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rNo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Yza(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(eNo(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length,c;for(n=0;n<u;n++)c=a[n],t.call(null,e[c],c,e)}}function p5h(e,t){if(eNo(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 QGi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_5h=e=>!$za(e)&&e!==QGi;function QVl(){let{caseless:e,skipUndefined:t}=_5h(this)&&this||{},r={},n=(i,a)=>{let u=e&&p5h(r,a)||a;Cis(r[u])&&Cis(i)?r[u]=QVl(r[u],i):Cis(i)?r[u]=QVl({},i):Yza(i)?r[u]=i.slice():(!t||!$za(i))&&(r[u]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&rNo(arguments[i],n);return r}var P9S=(e,t,r,{allOwnKeys:n}={})=>(rNo(t,(i,a)=>{r&&Jxe(i)?e[a]=kxo(i,r):e[a]=i},{allOwnKeys:n}),e),w9S=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),j9S=(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)},E9S=(e,t,r,n)=>{let i,a,u,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)u=i[a],(!n||n(u,e,t))&&!c[u]&&(t[u]=e[u],c[u]=!0);e=r!==!1&&LVl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},S9S=(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},D9S=e=>{if(!e)return null;if(Yza(e))return e;let t=e.length;if(!d5h(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},C9S=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&LVl(Uint8Array)),I9S=(e,t)=>{let n=(e&&e[Iis]).call(e),i;for(;(i=n.next())&&!i.done;){let a=i.value;t.call(e,a[0],a[1])}},M9S=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},B9S=KDr("HTMLFormElement"),T9S=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),c5h=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),q9S=KDr("RegExp"),h5h=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};rNo(r,(i,a)=>{let u;(u=t(i,a,e))!==!1&&(n[a]=u||i)}),Object.defineProperties(e,n)},x9S=e=>{h5h(e,(t,r)=>{if(Jxe(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(Jxe(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+"'")})}})},N9S=(e,t)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Yza(e)?n(e):n(String(e).split(t)),r},R9S=()=>{},F9S=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function z9S(e){return!!(e&&Jxe(e.append)&&e[l5h]==="FormData"&&e[Iis])}var Q9S=e=>{let t=new Array(10),r=(n,i)=>{if(tNo(n)){if(t.indexOf(n)>=0)return;if(eNo(n))return n;if(!("toJSON"in n)){t[i]=n;let a=Yza(n)?[]:{};return rNo(n,(u,c)=>{let p=r(u,i+1);!$za(p)&&(a[c]=p)}),t[i]=void 0,a}}return n};return r(e,0)},L9S=KDr("AsyncFunction"),U9S=e=>e&&(tNo(e)||Jxe(e))&&Jxe(e.then)&&Jxe(e.catch),y5h=((e,t)=>e?setImmediate:t?((r,n)=>(QGi.addEventListener("message",({source:i,data:a})=>{i===QGi&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),QGi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Jxe(QGi.postMessage)),V9S=typeof queueMicrotask<"u"?queueMicrotask.bind(QGi):typeof process<"u"&&process.nextTick||y5h,W9S=e=>e!=null&&Jxe(e[Iis]),Hf={isArray:Yza,isArrayBuffer:f5h,isBuffer:eNo,isFormData:y9S,isArrayBufferView:u9S,isString:s9S,isNumber:d5h,isBoolean:c9S,isObject:tNo,isPlainObject:Cis,isEmptyObject:l9S,isReadableStream:b9S,isRequest:g9S,isResponse:m9S,isHeaders:O9S,isUndefined:$za,isDate:f9S,isFile:d9S,isBlob:p9S,isRegExp:q9S,isFunction:Jxe,isStream:h9S,isURLSearchParams:v9S,isTypedArray:C9S,isFileList:_9S,forEach:rNo,merge:QVl,extend:P9S,trim:A9S,stripBOM:w9S,inherits:j9S,toFlatObject:E9S,kindOf:Mis,kindOfTest:KDr,endsWith:S9S,toArray:D9S,forEachEntry:I9S,matchAll:M9S,isHTMLForm:B9S,hasOwnProperty:c5h,hasOwnProp:c5h,reduceDescriptors:h5h,freezeMethods:x9S,toObjectSet:N9S,toCamelCase:T9S,noop:R9S,toFiniteNumber:F9S,findKey:p5h,global:QGi,isContextDefined:_5h,isSpecCompliantForm:z9S,toJSONObject:Q9S,isAsyncFn:L9S,isThenable:U9S,setImmediate:y5h,asap:V9S,isIterable:W9S};function Xza(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)}Hf.inherits(Xza,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:Hf.toJSONObject(this.config),code:this.code,status:this.status}}});var v5h=Xza.prototype,b5h={};["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=>{b5h[e]={value:e}});Object.defineProperties(Xza,b5h);Object.defineProperty(v5h,"isAxiosError",{value:!0});Xza.from=(e,t,r,n,i,a)=>{let u=Object.create(v5h);Hf.toFlatObject(e,u,function(o){return o!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return Xza.call(u,c,p,r,n,i),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",a&&Object.assign(u,a),u};var B0=Xza;var g5h=Xi(tis(),1),Tis=g5h.default;function UVl(e){return Hf.isPlainObject(e)||Hf.isArray(e)}function O5h(e){return Hf.endsWith(e,"[]")?e.slice(0,-2):e}function m5h(e,t,r){return e?e.concat(t).map(function(i,a){return i=O5h(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function H9S(e){return Hf.isArray(e)&&!e.some(UVl)}var G9S=Hf.toFlatObject(Hf,{},null,function(t){return/^is[A-Z]/.test(t)});function J9S(e,t,r){if(!Hf.isObject(e))throw new TypeError("target must be an object");t=t||new(Tis||FormData),r=Hf.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,M){return!Hf.isUndefined(M[C])});let n=r.metaTokens,i=r.visitor||o,a=r.dots,u=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&Hf.isSpecCompliantForm(t);if(!Hf.isFunction(i))throw new TypeError("visitor must be a function");function s(E){if(E===null)return"";if(Hf.isDate(E))return E.toISOString();if(Hf.isBoolean(E))return E.toString();if(!p&&Hf.isBlob(E))throw new B0("Blob is not supported. Use a Buffer instead.");return Hf.isArrayBuffer(E)||Hf.isTypedArray(E)?p&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function o(E,C,M){let q=E;if(E&&!M&&typeof E=="object"){if(Hf.endsWith(C,"{}"))C=n?C:C.slice(0,-2),E=JSON.stringify(E);else if(Hf.isArray(E)&&H9S(E)||(Hf.isFileList(E)||Hf.endsWith(C,"[]"))&&(q=Hf.toArray(E)))return C=O5h(C),q.forEach(function(U,Q){!(Hf.isUndefined(U)||U===null)&&t.append(u===!0?m5h([C],Q,a):u===null?C:C+"[]",s(U))}),!1}return UVl(E)?!0:(t.append(m5h(M,C,a),s(E)),!1)}let l=[],O=Object.assign(G9S,{defaultVisitor:o,convertValue:s,isVisitable:UVl});function A(E,C){if(!Hf.isUndefined(E)){if(l.indexOf(E)!==-1)throw Error("Circular reference detected in "+C.join("."));l.push(E),Hf.forEach(E,function(q,L){(!(Hf.isUndefined(q)||q===null)&&i.call(t,q,Hf.isString(L)?L.trim():L,C,O))===!0&&A(q,C?C.concat(L):[L])}),l.pop()}}if(!Hf.isObject(e))throw new TypeError("data must be an object");return A(e),t}var $Ei=J9S;function A5h(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function P5h(e,t){this._pairs=[],e&&$Ei(e,this,t)}var w5h=P5h.prototype;w5h.append=function(t,r){this._pairs.push([t,r])};w5h.toString=function(t){let r=t?function(n){return t.call(this,n,A5h)}:A5h;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var j5h=P5h;function K9S(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function LGi(e,t,r){if(!t)return e;let n=r&&r.encode||K9S;Hf.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,a;if(i?a=i(t,r):a=Hf.isURLSearchParams(t)?t.toString():new j5h(t,r).toString(n),a){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var VVl=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){Hf.forEach(this.handlers,function(n){n!==null&&t(n)})}},WVl=VVl;var Zza={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var C5h=Xi(require("crypto"),1);var E5h=Xi(require("url"),1),S5h=E5h.default.URLSearchParams;var HVl="abcdefghijklmnopqrstuvwxyz",D5h="0123456789",I5h={DIGIT:D5h,ALPHA:HVl,ALPHA_DIGIT:HVl+HVl.toUpperCase()+D5h},$9S=(e=16,t=I5h.ALPHA_DIGIT)=>{let r="",{length:n}=t,i=new Uint32Array(e);C5h.default.randomFillSync(i);for(let a=0;a<e;a++)r+=t[i[a]%n];return r},M5h={isNode:!0,classes:{URLSearchParams:S5h,FormData:Tis,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:I5h,generateString:$9S,protocols:["http","https","file","data"]};var KVl={};ds(KVl,{hasBrowserEnv:()=>JVl,hasStandardBrowserEnv:()=>Y9S,hasStandardBrowserWebWorkerEnv:()=>X9S,navigator:()=>GVl,origin:()=>Z9S});var JVl=typeof window<"u"&&typeof document<"u",GVl=typeof navigator=="object"&&navigator||void 0,Y9S=JVl&&(!GVl||["ReactNative","NativeScript","NS"].indexOf(GVl.product)<0),X9S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Z9S=JVl&&window.location.href||"http://localhost";var bz={...KVl,...M5h};function $Vl(e,t){return $Ei(e,new bz.classes.URLSearchParams,{visitor:function(r,n,i,a){return bz.isNode&&Hf.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function k9S(e){return Hf.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function eLS(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 tLS(e){function t(r,n,i,a){let u=r[a++];if(u==="__proto__")return!0;let c=Number.isFinite(+u),p=a>=r.length;return u=!u&&Hf.isArray(i)?i.length:u,p?(Hf.hasOwnProp(i,u)?i[u]=[i[u],n]:i[u]=n,!c):((!i[u]||!Hf.isObject(i[u]))&&(i[u]=[]),t(r,n,i[u],a)&&Hf.isArray(i[u])&&(i[u]=eLS(i[u])),!c)}if(Hf.isFormData(e)&&Hf.isFunction(e.entries)){let r={};return Hf.forEachEntry(e,(n,i)=>{t(k9S(n),i,r,0)}),r}return null}var qis=tLS;function rLS(e,t,r){if(Hf.isString(e))try{return(t||JSON.parse)(e),Hf.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var YVl={transitional:Zza,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Hf.isObject(t);if(a&&Hf.isHTMLForm(t)&&(t=new FormData(t)),Hf.isFormData(t))return i?JSON.stringify(qis(t)):t;if(Hf.isArrayBuffer(t)||Hf.isBuffer(t)||Hf.isStream(t)||Hf.isFile(t)||Hf.isBlob(t)||Hf.isReadableStream(t))return t;if(Hf.isArrayBufferView(t))return t.buffer;if(Hf.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 $Vl(t,this.formSerializer).toString();if((c=Hf.isFileList(t))||n.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return $Ei(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),rLS(t)):t}],transformResponse:[function(t){let r=this.transitional||YVl.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(Hf.isResponse(t)||Hf.isReadableStream(t))return t;if(t&&Hf.isString(t)&&(n&&!this.responseType||i)){let u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(u)throw c.name==="SyntaxError"?B0.from(c,B0.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:bz.classes.FormData,Blob:bz.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Hf.forEach(["delete","get","head","post","put","patch"],e=>{YVl.headers[e]={}});var kza=YVl;var nLS=Hf.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"]),B5h=e=>{let t={},r,n,i;return e&&e.split(`
2167
2167
  `).forEach(function(u){i=u.indexOf(":"),r=u.substring(0,i).trim().toLowerCase(),n=u.substring(i+1).trim(),!(!r||t[r]&&nLS[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var T5h=Symbol("internals");function nNo(e){return e&&String(e).trim().toLowerCase()}function xis(e){return e===!1||e==null?e:Hf.isArray(e)?e.map(xis):String(e)}function iLS(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 aLS=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function XVl(e,t,r,n,i){if(Hf.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!Hf.isString(t)){if(Hf.isString(n))return t.indexOf(n)!==-1;if(Hf.isRegExp(n))return n.test(t)}}function oLS(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function uLS(e,t){let r=Hf.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,u){return this[n].call(this,t,i,a,u)},configurable:!0})})}var e2a=class{constructor(t){t&&this.set(t)}set(t,r,n){let i=this;function a(c,p,s){let o=nNo(p);if(!o)throw new Error("header name must be a non-empty string");let l=Hf.findKey(i,o);(!l||i[l]===void 0||s===!0||s===void 0&&i[l]!==!1)&&(i[l||p]=xis(c))}let u=(c,p)=>Hf.forEach(c,(s,o)=>a(s,o,p));if(Hf.isPlainObject(t)||t instanceof this.constructor)u(t,r);else if(Hf.isString(t)&&(t=t.trim())&&!aLS(t))u(B5h(t),r);else if(Hf.isObject(t)&&Hf.isIterable(t)){let c={},p,s;for(let o of t){if(!Hf.isArray(o))throw TypeError("Object iterator must return a key-value pair");c[s=o[0]]=(p=c[s])?Hf.isArray(p)?[...p,o[1]]:[p,o[1]]:o[1]}u(c,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=nNo(t),t){let n=Hf.findKey(this,t);if(n){let i=this[n];if(!r)return i;if(r===!0)return iLS(i);if(Hf.isFunction(r))return r.call(this,i,n);if(Hf.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=nNo(t),t){let n=Hf.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||XVl(this,this[n],n,r)))}return!1}delete(t,r){let n=this,i=!1;function a(u){if(u=nNo(u),u){let c=Hf.findKey(n,u);c&&(!r||XVl(n,n[c],c,r))&&(delete n[c],i=!0)}}return Hf.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||XVl(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){let r=this,n={};return Hf.forEach(this,(i,a)=>{let u=Hf.findKey(n,a);if(u){r[u]=xis(i),delete r[a];return}let c=t?oLS(a):String(a).trim();c!==a&&delete r[a],r[c]=xis(i),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return Hf.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&Hf.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[T5h]=this[T5h]={accessors:{}}).accessors,i=this.prototype;function a(u){let c=nNo(u);n[c]||(uLS(i,u),n[c]=!0)}return Hf.isArray(t)?t.forEach(a):a(t),this}};e2a.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Hf.reduceDescriptors(e2a.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Hf.freezeMethods(e2a);var jJ=e2a;function iNo(e,t){let r=this||kza,n=t||r,i=jJ.from(n.headers),a=n.data;return Hf.forEach(e,function(c){a=c.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function aNo(e){return!!(e&&e.__CANCEL__)}function q5h(e,t,r){B0.call(this,e??"canceled",B0.ERR_CANCELED,t,r),this.name="CanceledError"}Hf.inherits(q5h,B0,{__CANCEL__:!0});var pet=q5h;function x7r(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B0("Request failed with status code "+r.status,[B0.ERR_BAD_REQUEST,B0.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ZVl(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function kVl(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function UGi(e,t,r){let n=!ZVl(t);return e&&(n||r==!1)?kVl(e,t):t}var Y5h=Xi(ris(),1),X5h=Xi(require("http"),1),Z5h=Xi(require("https"),1),k5h=Xi(require("util"),1),eQh=Xi(eVl(),1),ksi=Xi(require("zlib"),1);var VGi="1.12.0";function oNo(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var sLS=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function eWl(e,t,r){let n=r&&r.Blob||bz.classes.Blob,i=oNo(e);if(t===void 0&&n&&(t=!0),i==="data"){e=i.length?e.slice(i.length+1):e;let a=sLS.exec(e);if(!a)throw new B0("Invalid URL",B0.ERR_INVALID_URL);let u=a[1],c=a[2],p=a[3],s=Buffer.from(decodeURIComponent(p),c?"base64":"utf8");if(t){if(!n)throw new B0("Blob is not supported",B0.ERR_NOT_SUPPORT);return new n([s],{type:u})}return s}throw new B0("Unsupported protocol "+i,B0.ERR_NOT_SUPPORT)}var HGi=Xi(require("stream"),1);var x5h=Xi(require("stream"),1);var tWl=Symbol("internals"),rWl=class extends x5h.default.Transform{constructor(t){t=Hf.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,i)=>!Hf.isUndefined(i[n])),super({readableHighWaterMark:t.chunkSize});let r=this[tWl]={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[tWl];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let i=this[tWl],a=i.maxRate,u=this.readableHighWaterMark,c=i.timeWindow,p=1e3/c,s=a/p,o=i.minChunkSize!==!1?Math.max(i.minChunkSize,s*.01):0,l=(A,E)=>{let C=Buffer.byteLength(A);i.bytesSeen+=C,i.bytes+=C,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(A)?process.nextTick(E):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(E)}},O=(A,E)=>{let C=Buffer.byteLength(A),M=null,q=u,L,U=0;if(a){let Q=Date.now();(!i.ts||(U=Q-i.ts)>=c)&&(i.ts=Q,L=s-i.bytes,i.bytes=L<0?-L:0,U=0),L=s-i.bytes}if(a){if(L<=0)return setTimeout(()=>{E(null,A)},c-U);L<q&&(q=L)}q&&C>q&&C-q>o&&(M=A.subarray(q),A=A.subarray(0,q)),l(A,M?()=>{process.nextTick(E,null,M)}:E)};O(t,function A(E,C){if(E)return n(E);C?O(C,A):n(null)})}},nWl=rWl;var tQh=require("events");var R5h=Xi(require("util"),1),F5h=require("stream");var{asyncIterator:N5h}=Symbol,cLS=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[N5h]?yield*e[N5h]():yield e},Nis=cLS;var lLS=bz.ALPHABET.ALPHA_DIGIT+"-_",uNo=typeof TextEncoder=="function"?new TextEncoder:new R5h.default.TextEncoder,WGi=`\r
2169
2169
  `,fLS=uNo.encode(WGi),dLS=2,iWl=class{constructor(t,r){let{escapeName:n}=this.constructor,i=Hf.isString(r),a=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${WGi}`;i?r=uNo.encode(String(r).replace(/\r?\n|\r\n?/g,WGi)):a+=`Content-Type: ${r.type||"application/octet-stream"}${WGi}`,this.headers=uNo.encode(a+WGi),this.contentLength=i?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+dLS,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;Hf.isTypedArray(t)?yield t:yield*Nis(t),yield fLS}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},pLS=(e,t,r)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+bz.generateString(i,lLS)}=r||{};if(!Hf.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let u=uNo.encode("--"+a+WGi),c=uNo.encode("--"+a+"--"+WGi),p=c.byteLength,s=Array.from(e.entries()).map(([l,O])=>{let A=new iWl(l,O);return p+=A.size,A});p+=u.byteLength*s.length,p=Hf.toFiniteNumber(p);let o={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(p)&&(o["Content-Length"]=p),t&&t(o),F5h.Readable.from((async function*(){for(let l of s)yield u,yield*l.encode();yield c})())},z5h=pLS;var Q5h=Xi(require("stream"),1),aWl=class extends Q5h.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)}},L5h=aWl;var _LS=(e,t)=>Hf.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,U5h=_LS;function hLS(e,t){e=e||10;let r=new Array(e),n=new Array(e),i=0,a=0,u;return t=t!==void 0?t:1e3,function(p){let s=Date.now(),o=n[a];u||(u=s),r[i]=p,n[i]=s;let l=a,O=0;for(;l!==i;)O+=r[l++],l=l%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),s-u<t)return;let A=o&&s-o;return A?Math.round(O*1e3/A):void 0}}var V5h=hLS;function yLS(e,t){let r=0,n=1e3/t,i,a,u=(s,o=Date.now())=>{r=o,i=null,a&&(clearTimeout(a),a=null),e(...s)};return[(...s)=>{let o=Date.now(),l=o-r;l>=n?u(s,o):(i=s,a||(a=setTimeout(()=>{a=null,u(i)},n-l)))},()=>i&&u(i)]}var W5h=yLS;var Zsi=(e,t,r=3)=>{let n=0,i=V5h(50,250);return W5h(a=>{let u=a.loaded,c=a.lengthComputable?a.total:void 0,p=u-n,s=i(p),o=u<=c;n=u;let l={loaded:u,total:c,progress:c?u/c:void 0,bytes:p,rate:s||void 0,estimated:s&&c&&o?(c-u)/s:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(l)},r)},t2a=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},r2a=e=>(...t)=>Hf.asap(()=>e(...t));function oWl(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,u=n.length;for(let O=0;O<u;O++)if(n.charCodeAt(O)===37&&O+2<u){let A=n.charCodeAt(O+1),E=n.charCodeAt(O+2);(A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102)&&(E>=48&&E<=57||E>=65&&E<=70||E>=97&&E<=102)&&(a-=2,O+=2)}let c=0,p=u-1,s=O=>O>=2&&n.charCodeAt(O-2)===37&&n.charCodeAt(O-1)===51&&(n.charCodeAt(O)===68||n.charCodeAt(O)===100);p>=0&&(n.charCodeAt(p)===61?(c++,p--):s(p)&&(c++,p-=3)),c===1&&p>=0&&(n.charCodeAt(p)===61||s(p))&&c++;let l=Math.floor(a/4)*3-(c||0);return l>0?l:0}return Buffer.byteLength(n,"utf8")}var H5h={flush:ksi.default.constants.Z_SYNC_FLUSH,finishFlush:ksi.default.constants.Z_SYNC_FLUSH},vLS={flush:ksi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:ksi.default.constants.BROTLI_OPERATION_FLUSH},G5h=Hf.isFunction(ksi.default.createBrotliDecompress),{http:bLS,https:gLS}=eQh.default,mLS=/https:?/,J5h=bz.protocols.map(e=>e+":"),K5h=(e,[t,r])=>(e.on("end",r).on("error",r),t);function OLS(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function rQh(e,t,r){let n=t;if(!n&&n!==!1){let i=Y5h.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){rQh(a,t,a.href)}}var ALS=typeof process<"u"&&Hf.kindOf(process)==="process",PLS=e=>new Promise((t,r)=>{let n,i,a=(p,s)=>{i||(i=!0,n&&n(p,s))},u=p=>{a(p),t(p)},c=p=>{a(p,!0),r(p)};e(u,c,p=>n=p).catch(c)}),wLS=({address:e,family:t})=>{if(!Hf.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},$5h=(e,t)=>wLS(Hf.isObject(e)?e:{address:e,family:t}),nQh=ALS&&function(t){return PLS(async function(n,i,a){let{data:u,lookup:c,family:p}=t,{responseType:s,responseEncoding:o}=t,l=t.method.toUpperCase(),O,A=!1,E;if(c){let Be=U5h(c,Bt=>Hf.isArray(Bt)?Bt:[Bt]);c=(Bt,Qt,Ke)=>{Be(Bt,Qt,(ze,Dr,ut)=>{if(ze)return Ke(ze);let br=Hf.isArray(Dr)?Dr.map(Xt=>$5h(Xt)):[$5h(Dr,ut)];Qt.all?Ke(ze,br):Ke(ze,br[0].address,br[0].family)})}}let C=new tQh.EventEmitter,M=()=>{t.cancelToken&&t.cancelToken.unsubscribe(q),t.signal&&t.signal.removeEventListener("abort",q),C.removeAllListeners()};a((Be,Bt)=>{O=!0,Bt&&(A=!0,M())});function q(Be){C.emit("abort",!Be||Be.type?new pet(null,t,E):Be)}C.once("abort",i),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(q),t.signal&&(t.signal.aborted?q():t.signal.addEventListener("abort",q)));let L=UGi(t.baseURL,t.url,t.allowAbsoluteUrls),U=new URL(L,bz.hasBrowserEnv?bz.origin:void 0),Q=U.protocol||J5h[0];if(Q==="data:"){if(t.maxContentLength>-1){let Bt=String(t.url||L||"");if(oWl(Bt)>t.maxContentLength)return i(new B0("maxContentLength size of "+t.maxContentLength+" exceeded",B0.ERR_BAD_RESPONSE,t))}let Be;if(l!=="GET")return x7r(n,i,{status:405,statusText:"method not allowed",headers:{},config:t});try{Be=eWl(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(Bt){throw B0.from(Bt,B0.ERR_BAD_REQUEST,t)}return s==="text"?(Be=Be.toString(o),(!o||o==="utf8")&&(Be=Hf.stripBOM(Be))):s==="stream"&&(Be=HGi.default.Readable.from(Be)),x7r(n,i,{data:Be,status:200,statusText:"OK",headers:new jJ,config:t})}if(J5h.indexOf(Q)===-1)return i(new B0("Unsupported protocol "+Q,B0.ERR_BAD_REQUEST,t));let K=jJ.from(t.headers).normalize();K.set("User-Agent","axios/"+VGi,!1);let{onUploadProgress:X,onDownloadProgress:te}=t,ee=t.maxRate,re,ue;if(Hf.isSpecCompliantForm(u)){let Be=K.getContentType(/boundary=([-_\w\d]{10,70})/i);u=z5h(u,Bt=>{K.set(Bt)},{tag:`axios-${VGi}-boundary`,boundary:Be&&Be[1]||void 0})}else if(Hf.isFormData(u)&&Hf.isFunction(u.getHeaders)){if(K.set(u.getHeaders()),!K.hasContentLength())try{let Be=await k5h.default.promisify(u.getLength).call(u);Number.isFinite(Be)&&Be>=0&&K.setContentLength(Be)}catch{}}else if(Hf.isBlob(u)||Hf.isFile(u))u.size&&K.setContentType(u.type||"application/octet-stream"),K.setContentLength(u.size||0),u=HGi.default.Readable.from(Nis(u));else if(u&&!Hf.isStream(u)){if(!Buffer.isBuffer(u))if(Hf.isArrayBuffer(u))u=Buffer.from(new Uint8Array(u));else if(Hf.isString(u))u=Buffer.from(u,"utf-8");else return i(new B0("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",B0.ERR_BAD_REQUEST,t));if(K.setContentLength(u.length,!1),t.maxBodyLength>-1&&u.length>t.maxBodyLength)return i(new B0("Request body larger than maxBodyLength limit",B0.ERR_BAD_REQUEST,t))}let me=Hf.toFiniteNumber(K.getContentLength());Hf.isArray(ee)?(re=ee[0],ue=ee[1]):re=ue=ee,u&&(X||re)&&(Hf.isStream(u)||(u=HGi.default.Readable.from(u,{objectMode:!1})),u=HGi.default.pipeline([u,new nWl({maxRate:Hf.toFiniteNumber(re)})],Hf.noop),X&&u.on("progress",K5h(u,t2a(me,Zsi(r2a(X),!1,3)))));let Oe;if(t.auth){let Be=t.auth.username||"",Bt=t.auth.password||"";Oe=Be+":"+Bt}if(!Oe&&U.username){let Be=U.username,Bt=U.password;Oe=Be+":"+Bt}Oe&&K.delete("authorization");let Ee;try{Ee=LGi(U.pathname+U.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(Be){let Bt=new Error(Be.message);return Bt.config=t,Bt.url=t.url,Bt.exists=!0,i(Bt)}K.set("Accept-Encoding","gzip, compress, deflate"+(G5h?", br":""),!1);let Pe={path:Ee,method:l,headers:K.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:Oe,protocol:Q,family:p,beforeRedirect:OLS,beforeRedirects:{}};!Hf.isUndefined(c)&&(Pe.lookup=c),t.socketPath?Pe.socketPath=t.socketPath:(Pe.hostname=U.hostname.startsWith("[")?U.hostname.slice(1,-1):U.hostname,Pe.port=U.port,rQh(Pe,t.proxy,Q+"//"+U.hostname+(U.port?":"+U.port:"")+Pe.path));let Ce,Ue=mLS.test(Pe.protocol);if(Pe.agent=Ue?t.httpsAgent:t.httpAgent,t.transport?Ce=t.transport:t.maxRedirects===0?Ce=Ue?Z5h.default:X5h.default:(t.maxRedirects&&(Pe.maxRedirects=t.maxRedirects),t.beforeRedirect&&(Pe.beforeRedirects.config=t.beforeRedirect),Ce=Ue?gLS:bLS),t.maxBodyLength>-1?Pe.maxBodyLength=t.maxBodyLength:Pe.maxBodyLength=1/0,t.insecureHTTPParser&&(Pe.insecureHTTPParser=t.insecureHTTPParser),E=Ce.request(Pe,function(Bt){if(E.destroyed)return;let Qt=[Bt],Ke=+Bt.headers["content-length"];if(te||ue){let Xt=new nWl({maxRate:Hf.toFiniteNumber(ue)});te&&Xt.on("progress",K5h(Xt,t2a(Ke,Zsi(r2a(te),!0,3)))),Qt.push(Xt)}let ze=Bt,Dr=Bt.req||E;if(t.decompress!==!1&&Bt.headers["content-encoding"])switch((l==="HEAD"||Bt.statusCode===204)&&delete Bt.headers["content-encoding"],(Bt.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Qt.push(ksi.default.createUnzip(H5h)),delete Bt.headers["content-encoding"];break;case"deflate":Qt.push(new L5h),Qt.push(ksi.default.createUnzip(H5h)),delete Bt.headers["content-encoding"];break;case"br":G5h&&(Qt.push(ksi.default.createBrotliDecompress(vLS)),delete Bt.headers["content-encoding"])}ze=Qt.length>1?HGi.default.pipeline(Qt,Hf.noop):Qt[0];let ut=HGi.default.finished(ze,()=>{ut(),M()}),br={status:Bt.statusCode,statusText:Bt.statusMessage,headers:new jJ(Bt.headers),config:t,request:Dr};if(s==="stream")br.data=ze,x7r(n,i,br);else{let Xt=[],Ze=0;ze.on("data",function(wr){Xt.push(wr),Ze+=wr.length,t.maxContentLength>-1&&Ze>t.maxContentLength&&(A=!0,ze.destroy(),i(new B0("maxContentLength size of "+t.maxContentLength+" exceeded",B0.ERR_BAD_RESPONSE,t,Dr)))}),ze.on("aborted",function(){if(A)return;let wr=new B0("stream has been aborted",B0.ERR_BAD_RESPONSE,t,Dr);ze.destroy(wr),i(wr)}),ze.on("error",function(wr){E.destroyed||i(B0.from(wr,null,t,Dr))}),ze.on("end",function(){try{let wr=Xt.length===1?Xt[0]:Buffer.concat(Xt);s!=="arraybuffer"&&(wr=wr.toString(o),(!o||o==="utf8")&&(wr=Hf.stripBOM(wr))),br.data=wr}catch(wr){return i(B0.from(wr,null,t,br.request,br))}x7r(n,i,br)})}C.once("abort",Xt=>{ze.destroyed||(ze.emit("error",Xt),ze.destroy())})}),C.once("abort",Be=>{i(Be),E.destroy(Be)}),E.on("error",function(Bt){i(B0.from(Bt,null,t,E))}),E.on("socket",function(Bt){Bt.setKeepAlive(!0,1e3*60)}),t.timeout){let Be=parseInt(t.timeout,10);if(Number.isNaN(Be)){i(new B0("error trying to parse `config.timeout` to int",B0.ERR_BAD_OPTION_VALUE,t,E));return}E.setTimeout(Be,function(){if(O)return;let Qt=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",Ke=t.transitional||Zza;t.timeoutErrorMessage&&(Qt=t.timeoutErrorMessage),i(new B0(Qt,Ke.clarifyTimeoutError?B0.ETIMEDOUT:B0.ECONNABORTED,t,E)),q()})}if(Hf.isStream(u)){let Be=!1,Bt=!1;u.on("end",()=>{Be=!0}),u.once("error",Qt=>{Bt=!0,E.destroy(Qt)}),u.on("close",()=>{!Be&&!Bt&&q(new pet("Request stream has been aborted",t,E))}),u.pipe(E)}else E.end(u)})};var iQh=bz.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,bz.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(bz.origin),bz.navigator&&/(msie|trident)/i.test(bz.navigator.userAgent)):()=>!0;var aQh=bz.hasStandardBrowserEnv?{write(e,t,r,n,i,a){let u=[e+"="+encodeURIComponent(t)];Hf.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),Hf.isString(n)&&u.push("path="+n),Hf.isString(i)&&u.push("domain="+i),a===!0&&u.push("secure"),document.cookie=u.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 oQh=e=>e instanceof jJ?{...e}:e;function $Dr(e,t){t=t||{};let r={};function n(s,o,l,O){return Hf.isPlainObject(s)&&Hf.isPlainObject(o)?Hf.merge.call({caseless:O},s,o):Hf.isPlainObject(o)?Hf.merge({},o):Hf.isArray(o)?o.slice():o}function i(s,o,l,O){if(Hf.isUndefined(o)){if(!Hf.isUndefined(s))return n(void 0,s,l,O)}else return n(s,o,l,O)}function a(s,o){if(!Hf.isUndefined(o))return n(void 0,o)}function u(s,o){if(Hf.isUndefined(o)){if(!Hf.isUndefined(s))return n(void 0,s)}else return n(void 0,o)}function c(s,o,l){if(l in t)return n(s,o);if(l in e)return n(void 0,s)}let p={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c,headers:(s,o,l)=>i(oQh(s),oQh(o),l,!0)};return Hf.forEach(Object.keys({...e,...t}),function(o){let l=p[o]||i,O=l(e[o],t[o],o);Hf.isUndefined(O)&&l!==c||(r[o]=O)}),r}var Ris=e=>{let t=$Dr({},e),{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:u,auth:c}=t;if(t.headers=u=jJ.from(u),t.url=LGi(UGi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Hf.isFormData(r)){if(bz.hasStandardBrowserEnv||bz.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(Hf.isFunction(r.getHeaders)){let p=r.getHeaders(),s=["content-type","content-length"];Object.entries(p).forEach(([o,l])=>{s.includes(o.toLowerCase())&&u.set(o,l)})}}if(bz.hasStandardBrowserEnv&&(n&&Hf.isFunction(n)&&(n=n(t)),n||n!==!1&&iQh(t.url))){let p=i&&a&&aQh.read(a);p&&u.set(i,p)}return t};var jLS=typeof XMLHttpRequest<"u",uQh=jLS&&function(e){return new Promise(function(r,n){let i=Ris(e),a=i.data,u=jJ.from(i.headers).normalize(),{responseType:c,onUploadProgress:p,onDownloadProgress:s}=i,o,l,O,A,E;function C(){A&&A(),E&&E(),i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let M=new XMLHttpRequest;M.open(i.method.toUpperCase(),i.url,!0),M.timeout=i.timeout;function q(){if(!M)return;let U=jJ.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),K={data:!c||c==="text"||c==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:U,config:e,request:M};x7r(function(te){r(te),C()},function(te){n(te),C()},K),M=null}"onloadend"in M?M.onloadend=q:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(q)},M.onabort=function(){M&&(n(new B0("Request aborted",B0.ECONNABORTED,e,M)),M=null)},M.onerror=function(Q){let K=Q&&Q.message?Q.message:"Network Error",X=new B0(K,B0.ERR_NETWORK,e,M);X.event=Q||null,n(X),M=null},M.ontimeout=function(){let Q=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",K=i.transitional||Zza;i.timeoutErrorMessage&&(Q=i.timeoutErrorMessage),n(new B0(Q,K.clarifyTimeoutError?B0.ETIMEDOUT:B0.ECONNABORTED,e,M)),M=null},a===void 0&&u.setContentType(null),"setRequestHeader"in M&&Hf.forEach(u.toJSON(),function(Q,K){M.setRequestHeader(K,Q)}),Hf.isUndefined(i.withCredentials)||(M.withCredentials=!!i.withCredentials),c&&c!=="json"&&(M.responseType=i.responseType),s&&([O,E]=Zsi(s,!0),M.addEventListener("progress",O)),p&&M.upload&&([l,A]=Zsi(p),M.upload.addEventListener("progress",l),M.upload.addEventListener("loadend",A)),(i.cancelToken||i.signal)&&(o=U=>{M&&(n(!U||U.type?new pet(null,e,M):U),M.abort(),M=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));let L=oNo(i.url);if(L&&bz.protocols.indexOf(L)===-1){n(new B0("Unsupported protocol "+L+":",B0.ERR_BAD_REQUEST,e));return}M.send(a||null)})};var ELS=(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 o=s instanceof Error?s:this.reason;n.abort(o instanceof B0?o:new pet(o instanceof Error?o.message:o))}},u=t&&setTimeout(()=>{u=null,a(new B0(`timeout ${t} of ms exceeded`,B0.ETIMEDOUT))},t),c=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(a):s.removeEventListener("abort",a)}),e=null)};e.forEach(s=>s.addEventListener("abort",a));let{signal:p}=n;return p.unsubscribe=()=>Hf.asap(c),p}},sQh=ELS;var SLS=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},DLS=async function*(e,t){for await(let r of CLS(e))yield*SLS(r,t)},CLS=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()}},uWl=(e,t,r,n)=>{let i=DLS(e,t),a=0,u,c=p=>{u||(u=!0,n&&n(p))};return new ReadableStream({async pull(p){try{let{done:s,value:o}=await i.next();if(s){c(),p.close();return}let l=o.byteLength;if(r){let O=a+=l;r(O)}p.enqueue(new Uint8Array(o))}catch(s){throw c(s),s}},cancel(p){return c(p),i.return()}},{highWaterMark:2})};var cQh=64*1024,{isFunction:Fis}=Hf,pQh=(({fetch:e,Request:t,Response:r})=>({fetch:e,Request:t,Response:r}))(Hf.global),{ReadableStream:lQh,TextEncoder:fQh}=Hf.global,dQh=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ILS=e=>{let{fetch:t,Request:r,Response:n}=Object.assign({},pQh,e),i=Fis(t),a=Fis(r),u=Fis(n);if(!i)return!1;let c=i&&Fis(lQh),p=i&&(typeof fQh=="function"?(E=>C=>E.encode(C))(new fQh):async E=>new Uint8Array(await new r(E).arrayBuffer())),s=a&&c&&dQh(()=>{let E=!1,C=new r(bz.origin,{body:new lQh,method:"POST",get duplex(){return E=!0,"half"}}).headers.has("Content-Type");return E&&!C}),o=u&&c&&dQh(()=>Hf.isReadableStream(new n("").body)),l={stream:o&&(E=>E.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(E=>{!l[E]&&(l[E]=(C,M)=>{let q=C&&C[E];if(q)return q.call(C);throw new B0(`Response type '${E}' is not supported`,B0.ERR_NOT_SUPPORT,M)})});let O=async E=>{if(E==null)return 0;if(Hf.isBlob(E))return E.size;if(Hf.isSpecCompliantForm(E))return(await new r(bz.origin,{method:"POST",body:E}).arrayBuffer()).byteLength;if(Hf.isArrayBufferView(E)||Hf.isArrayBuffer(E))return E.byteLength;if(Hf.isURLSearchParams(E)&&(E=E+""),Hf.isString(E))return(await p(E)).byteLength},A=async(E,C)=>{let M=Hf.toFiniteNumber(E.getContentLength());return M??O(C)};return async E=>{let{url:C,method:M,data:q,signal:L,cancelToken:U,timeout:Q,onDownloadProgress:K,onUploadProgress:X,responseType:te,headers:ee,withCredentials:re="same-origin",fetchOptions:ue}=Ris(E);te=te?(te+"").toLowerCase():"text";let me=sQh([L,U&&U.toAbortSignal()],Q),Oe=null,Ee=me&&me.unsubscribe&&(()=>{me.unsubscribe()}),Pe;try{if(X&&s&&M!=="get"&&M!=="head"&&(Pe=await A(ee,q))!==0){let Ke=new r(C,{method:"POST",body:q,duplex:"half"}),ze;if(Hf.isFormData(q)&&(ze=Ke.headers.get("content-type"))&&ee.setContentType(ze),Ke.body){let[Dr,ut]=t2a(Pe,Zsi(r2a(X)));q=uWl(Ke.body,cQh,Dr,ut)}}Hf.isString(re)||(re=re?"include":"omit");let Ce=a&&"credentials"in r.prototype,Ue={...ue,signal:me,method:M.toUpperCase(),headers:ee.normalize().toJSON(),body:q,duplex:"half",credentials:Ce?re:void 0};Oe=a&&new r(C,Ue);let Be=await(a?t(Oe,ue):t(C,Ue)),Bt=o&&(te==="stream"||te==="response");if(o&&(K||Bt&&Ee)){let Ke={};["status","statusText","headers"].forEach(br=>{Ke[br]=Be[br]});let ze=Hf.toFiniteNumber(Be.headers.get("content-length")),[Dr,ut]=K&&t2a(ze,Zsi(r2a(K),!0))||[];Be=new n(uWl(Be.body,cQh,Dr,()=>{ut&&ut(),Ee&&Ee()}),Ke)}te=te||"text";let Qt=await l[Hf.findKey(l,te)||"text"](Be,E);return!Bt&&Ee&&Ee(),await new Promise((Ke,ze)=>{x7r(Ke,ze,{data:Qt,headers:jJ.from(Be.headers),status:Be.status,statusText:Be.statusText,config:E,request:Oe})})}catch(Ce){throw Ee&&Ee(),Ce&&Ce.name==="TypeError"&&/Load failed|fetch/i.test(Ce.message)?Object.assign(new B0("Network Error",B0.ERR_NETWORK,E,Oe),{cause:Ce.cause||Ce}):B0.from(Ce,Ce&&Ce.code,E,Oe)}}},MLS=new Map,sWl=e=>{let t=Hf.merge.call({skipUndefined:!0},pQh,e?e.env:null),{fetch:r,Request:n,Response:i}=t,a=[n,i,r],u=a.length,c=u,p,s,o=MLS;for(;c--;)p=a[c],s=o.get(p),s===void 0&&o.set(p,s=c?new Map:ILS(t)),o=s;return s},QQQ=sWl();var cWl={http:nQh,xhr:uQh,fetch:{get:sWl}};Hf.forEach(cWl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var _Qh=e=>`- ${e}`,TLS=e=>Hf.isFunction(e)||e===null||e===!1,zis={getAdapter:(e,t)=>{e=Hf.isArray(e)?e:[e];let{length:r}=e,n,i,a={};for(let u=0;u<r;u++){n=e[u];let c;if(i=n,!TLS(n)&&(i=cWl[(c=String(n)).toLowerCase()],i===void 0))throw new B0(`Unknown adapter '${c}'`);if(i&&(Hf.isFunction(i)||(i=i.get(t))))break;a[c||"#"+u]=i}if(!i){let u=Object.entries(a).map(([p,s])=>`adapter ${p} `+(s===!1?"is not supported by the environment":"is not available in the build")),c=r?u.length>1?`since :
@@ -2404,7 +2404,7 @@ ${Q}${L}${K}${uhy.default.cursorHide}`});function M_s({message:e,error:t,logger:
2404
2404
  Run ${yd.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
2405
2405
  Run ${yd.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),i2a(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function xof({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!Ihy(e))return;let i=t??"",a=e.filter(c=>c.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let u=a.sort((c,p)=>c.generatorName.localeCompare(p.generatorName)||c.currentVersion.localeCompare(p.currentVersion));for(let c of u)i+=`
2406
2406
  ${await GCD(c.generatorName)} (${c.apiName!=null?"API: "+c.apiName+", ":""}Group: ${c.generatorGroup}) `+yd.dim(c.currentVersion)+yd.reset(" \u2192 ")+yd.green(c.latestVersion);return i+=`
2407
- `,n?i2a(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function GCD(e){let r=await new Chy.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 JCD({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await Bhy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(p,s,o,l)=>{c.versions[s]==null&&(c.versions[s]={});let O=Qji(o.name,l),A=await Dzr({generatorName:O,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:i,includeMajor:a,context:l});A!=null&&(c.versions[s][o.name]={previousVersion:o.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),c}let u={type:"multiApi",versions:{}};return await Bhy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,p,s,o)=>{if(c==null)return;u.versions[c]==null&&(u.versions[c]={}),u.versions[c][p]==null&&(u.versions[c][p]={});let l=Qji(s.name,o),O=await Dzr({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:i,includeMajor:a,context:o});O!=null&&(u.versions[c][p][s.name]={previousVersion:s.version,latestVersion:O})},generatorFilter:r,groupFilter:n}),u}async function Bhy({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let c=await jDr({absolutePathToWorkspace:a.absoluteFilePath,context:u});if(!(c==null||c.groups==null)){for(let p of c.groups)if(!(i!=null&&p.groupName!==i))for(let s of p.generators)n!=null&&s.name!==n||await r(a.workspaceName,p.groupName,s,u)}})}))}function Thy(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[u,c]of Object.entries(a)){r.debug(`Checking if ${u} in group ${i} has an upgrade available...`);let p=fNe(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(p?"Upgrade available.":"No upgrade available.")),n.push({generatorName:u,generatorGroup:i,apiName:t,isUpgradeAvailable:p,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return n}async function x_s({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let u=[];if(e!=null){let c=await JCD({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(c.type==="multiApi")for(let[p,s]of Object.entries(c.versions))u.push(...Thy(s,p,t.logger));else u.push(...Thy(c.versions,void 0,t.logger))}return u}var i4o=class extends Error{response;request;options;constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${i} ${a}`.trim(),c=u?`status code ${u}`:"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 X5a=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var Nof=(()=>{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})(),qhy=typeof globalThis.AbortController=="function",xhy=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nhy=typeof globalThis.ReadableStream=="function",Rhy=typeof globalThis.FormData=="function",N_s=["get","post","put","patch","head","delete"],KCD=()=>{};KCD();var Fhy={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},R_s=2147483647,zhy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,F_s=Symbol("stop"),Qhy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Lhy={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,dispatcher:!0,duplex:!0,priority:!0};var $CD=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=zhy,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},Uhy=(e,t)=>{let r=Number(e.headers.get("content-length"))||0,n=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(i){let a=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function u(){let{done:c,value:p}=await a.read();if(c){i.close();return}if(t){n+=p.byteLength;let s=r===0?0:n/r;t({percent:s,transferredBytes:n,totalBytes:r},p)}i.enqueue(p),await u()}await u()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Vhy=(e,t,r)=>{let n=$CD(r??e.body),i=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(a){let u=e.body instanceof ReadableStream?e.body.getReader():new Response("").body.getReader();async function c(){let{done:p,value:s}=await u.read();if(p){t&&t({percent:1,transferredBytes:i,totalBytes:Math.max(n,i)},new Uint8Array),a.close();return}i+=s.byteLength;let o=n===0?0:i/n;(n<i||o===1)&&(o=.99),t&&t({percent:Number(o.toFixed(2)),transferredBytes:i,totalBytes:n},s),a.enqueue(s),await c()}await c()}})})};var Z5a=e=>e!==null&&typeof e=="object";var a4o=(...e)=>{for(let t of e)if((!Z5a(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return zof({},...e)},Rof=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[a,u]of i.entries())n&&u==="undefined"||u===void 0?r.delete(a):r.set(a,u);return r};function z_s(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:zof(e[r]??[],t[r]??[])}var Fof=(e={},t={})=>({beforeRequest:z_s(e,t,"beforeRequest"),beforeRetry:z_s(e,t,"beforeRetry"),afterResponse:z_s(e,t,"afterResponse"),beforeError:z_s(e,t,"beforeError")}),zof=(...e)=>{let t={},r={},n={};for(let i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(Z5a(i)){for(let[a,u]of Object.entries(i))Z5a(u)&&a in t&&(u=zof(t[a],u)),t={...t,[a]:u};Z5a(i.hooks)&&(n=Fof(n,i.hooks),t.hooks=n),Z5a(i.headers)&&(r=Rof(r,i.headers),t.headers=r)}return t};var Hhy=e=>N_s.includes(e)?e.toUpperCase():e,YCD=["get","put","head","delete","options","trace"],XCD=[408,413,429,500,502,503,504],ZCD=[413,429,503],Why={limit:2,methods:YCD,statusCodes:XCD,afterStatusCodes:ZCD,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Ghy=(e={})=>{if(typeof e=="number")return{...Why,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{...Why,...e}};async function Qof(e,t,r,n){return new Promise((i,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new X5a(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(u)})})}async function Lof(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 Jhy=(e,t)=>{let r={};for(let n in t)!(n in Lhy)&&!(n in Qhy)&&!(n in e)&&(r[n]=t[n]);return r},Khy=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;var o4o=class e{static create(t,r){let n=new e(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>R_s)throw new RangeError(`The \`timeout\` option cannot be greater than ${R_s}`);await Promise.resolve();let c=await n._fetch();for(let p of n._options.hooks.afterResponse){let s=await p(n.request,n._options,n._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(n._decorateResponse(c),!c.ok&&n._options.throwHttpErrors){let p=new i4o(c,n.request,n._options);for(let s of n._options.hooks.beforeError)p=await s(p);throw p}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nhy)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Uhy(c.clone(),n._options.onDownloadProgress)}return c},u=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{n.request.bodyUsed||await n.request.body?.cancel()});for(let[c,p]of Object.entries(Fhy))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(u[c]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||p);let s=await u;if(c==="json"){if(s.status===204||(await s.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await s.text())}return s[c]()});return u}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:Rof(this._input.headers,r.headers),hooks:Fof({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Hhy(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Ghy(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(qhy&&xhy){let n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(Nof&&(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")),this.request=new globalThis.Request(this._input,this._options),Khy(this._options.searchParams)){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Rhy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...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(!Nof)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Vhy(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof X5a)throw t;if(t instanceof i4o){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),R_s);if(this._retryCount<1)throw r;await Lof(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===F_s)return;return this._retry(t)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let t=Jhy(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):Qof(r,t,this.abortController,this._options)}};var Uof=e=>{let t=(r,n)=>o4o.create(r,a4o(e,n));for(let r of N_s)t[r]=(n,i)=>o4o.create(n,a4o(e,i,{method:r}));return t.create=r=>Uof(a4o(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Uof(a4o(e,r))),t.stop=F_s,t},kCD=Uof(),$hy=kCD;var byy=Xi(vyy(),1);function Jof(e){let t=(0,byy.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var dvy=Xi(fvy(),1),pvy=Xi(j4r(),1),ouf=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},uuf=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function suf(e,t={}){let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??Jof(i),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,dvy.default)(a.toString(),{recursive:!0}),p={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete p.accept,c&&(p.authorization=`${c.type} ${c.token}`);let s;try{s=await $hy(u,{headers:p,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new ouf(e):l}if(t.allVersions)return s;let o=new uuf(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,E]of Object.entries(s.versions))E.deprecated&&delete s.versions[A];if(!l){let A=Object.keys(s.versions);if(r=pvy.default.maxSatisfying(A,r),!r)throw o}let{time:O}=s;if(s=s.versions[r],s.time=O,!s)throw o}return s}async function d4o(e,t){let{version:r}=await suf(e.toLowerCase(),t);return r}async function ADi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:d4o(e.packageName,{version:t?"prerelease":"latest"})}var _vy=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],X_s=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=zj.Info;isLocal;constructor(t,r,{isLocal:n}){this.ttyAwareLogger=new q_s(t,r),this.isLocal=n??!1;let i=this.getPackageName(),a=this.getPackageVersion(),u=this.getCliName();(i==null||a==null||u==null)&&this.exitProgram(),this.environment={packageName:i,packageVersion:a,cliName:u}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.78.1"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${yd.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new Tae}failWithoutThrowing(t,r){this.didSucceed=!1,M_s({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await Kza()).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 Mhy({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
2407
+ `,n?i2a(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function GCD(e){let r=await new Chy.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 JCD({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await Bhy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(p,s,o,l)=>{c.versions[s]==null&&(c.versions[s]={});let O=Qji(o.name,l),A=await Dzr({generatorName:O,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:i,includeMajor:a,context:l});A!=null&&(c.versions[s][o.name]={previousVersion:o.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),c}let u={type:"multiApi",versions:{}};return await Bhy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,p,s,o)=>{if(c==null)return;u.versions[c]==null&&(u.versions[c]={}),u.versions[c][p]==null&&(u.versions[c][p]={});let l=Qji(s.name,o),O=await Dzr({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:i,includeMajor:a,context:o});O!=null&&(u.versions[c][p][s.name]={previousVersion:s.version,latestVersion:O})},generatorFilter:r,groupFilter:n}),u}async function Bhy({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let c=await jDr({absolutePathToWorkspace:a.absoluteFilePath,context:u});if(!(c==null||c.groups==null)){for(let p of c.groups)if(!(i!=null&&p.groupName!==i))for(let s of p.generators)n!=null&&s.name!==n||await r(a.workspaceName,p.groupName,s,u)}})}))}function Thy(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[u,c]of Object.entries(a)){r.debug(`Checking if ${u} in group ${i} has an upgrade available...`);let p=fNe(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(p?"Upgrade available.":"No upgrade available.")),n.push({generatorName:u,generatorGroup:i,apiName:t,isUpgradeAvailable:p,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return n}async function x_s({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let u=[];if(e!=null){let c=await JCD({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(c.type==="multiApi")for(let[p,s]of Object.entries(c.versions))u.push(...Thy(s,p,t.logger));else u.push(...Thy(c.versions,void 0,t.logger))}return u}var i4o=class extends Error{response;request;options;constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${i} ${a}`.trim(),c=u?`status code ${u}`:"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 X5a=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var Nof=(()=>{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})(),qhy=typeof globalThis.AbortController=="function",xhy=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nhy=typeof globalThis.ReadableStream=="function",Rhy=typeof globalThis.FormData=="function",N_s=["get","post","put","patch","head","delete"],KCD=()=>{};KCD();var Fhy={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},R_s=2147483647,zhy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,F_s=Symbol("stop"),Qhy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Lhy={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,dispatcher:!0,duplex:!0,priority:!0};var $CD=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=zhy,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},Uhy=(e,t)=>{let r=Number(e.headers.get("content-length"))||0,n=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(i){let a=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function u(){let{done:c,value:p}=await a.read();if(c){i.close();return}if(t){n+=p.byteLength;let s=r===0?0:n/r;t({percent:s,transferredBytes:n,totalBytes:r},p)}i.enqueue(p),await u()}await u()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Vhy=(e,t,r)=>{let n=$CD(r??e.body),i=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(a){let u=e.body instanceof ReadableStream?e.body.getReader():new Response("").body.getReader();async function c(){let{done:p,value:s}=await u.read();if(p){t&&t({percent:1,transferredBytes:i,totalBytes:Math.max(n,i)},new Uint8Array),a.close();return}i+=s.byteLength;let o=n===0?0:i/n;(n<i||o===1)&&(o=.99),t&&t({percent:Number(o.toFixed(2)),transferredBytes:i,totalBytes:n},s),a.enqueue(s),await c()}await c()}})})};var Z5a=e=>e!==null&&typeof e=="object";var a4o=(...e)=>{for(let t of e)if((!Z5a(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return zof({},...e)},Rof=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[a,u]of i.entries())n&&u==="undefined"||u===void 0?r.delete(a):r.set(a,u);return r};function z_s(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:zof(e[r]??[],t[r]??[])}var Fof=(e={},t={})=>({beforeRequest:z_s(e,t,"beforeRequest"),beforeRetry:z_s(e,t,"beforeRetry"),afterResponse:z_s(e,t,"afterResponse"),beforeError:z_s(e,t,"beforeError")}),zof=(...e)=>{let t={},r={},n={};for(let i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(Z5a(i)){for(let[a,u]of Object.entries(i))Z5a(u)&&a in t&&(u=zof(t[a],u)),t={...t,[a]:u};Z5a(i.hooks)&&(n=Fof(n,i.hooks),t.hooks=n),Z5a(i.headers)&&(r=Rof(r,i.headers),t.headers=r)}return t};var Hhy=e=>N_s.includes(e)?e.toUpperCase():e,YCD=["get","put","head","delete","options","trace"],XCD=[408,413,429,500,502,503,504],ZCD=[413,429,503],Why={limit:2,methods:YCD,statusCodes:XCD,afterStatusCodes:ZCD,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Ghy=(e={})=>{if(typeof e=="number")return{...Why,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{...Why,...e}};async function Qof(e,t,r,n){return new Promise((i,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new X5a(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(u)})})}async function Lof(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 Jhy=(e,t)=>{let r={};for(let n in t)!(n in Lhy)&&!(n in Qhy)&&!(n in e)&&(r[n]=t[n]);return r},Khy=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;var o4o=class e{static create(t,r){let n=new e(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>R_s)throw new RangeError(`The \`timeout\` option cannot be greater than ${R_s}`);await Promise.resolve();let c=await n._fetch();for(let p of n._options.hooks.afterResponse){let s=await p(n.request,n._options,n._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(n._decorateResponse(c),!c.ok&&n._options.throwHttpErrors){let p=new i4o(c,n.request,n._options);for(let s of n._options.hooks.beforeError)p=await s(p);throw p}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nhy)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Uhy(c.clone(),n._options.onDownloadProgress)}return c},u=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{n.request.bodyUsed||await n.request.body?.cancel()});for(let[c,p]of Object.entries(Fhy))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(u[c]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||p);let s=await u;if(c==="json"){if(s.status===204||(await s.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await s.text())}return s[c]()});return u}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:Rof(this._input.headers,r.headers),hooks:Fof({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Hhy(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Ghy(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(qhy&&xhy){let n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(Nof&&(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")),this.request=new globalThis.Request(this._input,this._options),Khy(this._options.searchParams)){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Rhy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...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(!Nof)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Vhy(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof X5a)throw t;if(t instanceof i4o){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),R_s);if(this._retryCount<1)throw r;await Lof(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===F_s)return;return this._retry(t)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let t=Jhy(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):Qof(r,t,this.abortController,this._options)}};var Uof=e=>{let t=(r,n)=>o4o.create(r,a4o(e,n));for(let r of N_s)t[r]=(n,i)=>o4o.create(n,a4o(e,i,{method:r}));return t.create=r=>Uof(a4o(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Uof(a4o(e,r))),t.stop=F_s,t},kCD=Uof(),$hy=kCD;var byy=Xi(vyy(),1);function Jof(e){let t=(0,byy.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var dvy=Xi(fvy(),1),pvy=Xi(j4r(),1),ouf=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},uuf=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function suf(e,t={}){let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??Jof(i),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,dvy.default)(a.toString(),{recursive:!0}),p={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete p.accept,c&&(p.authorization=`${c.type} ${c.token}`);let s;try{s=await $hy(u,{headers:p,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new ouf(e):l}if(t.allVersions)return s;let o=new uuf(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,E]of Object.entries(s.versions))E.deprecated&&delete s.versions[A];if(!l){let A=Object.keys(s.versions);if(r=pvy.default.maxSatisfying(A,r),!r)throw o}let{time:O}=s;if(s=s.versions[r],s.time=O,!s)throw o}return s}async function d4o(e,t){let{version:r}=await suf(e.toLowerCase(),t);return r}async function ADi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:d4o(e.packageName,{version:t?"prerelease":"latest"})}var _vy=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],X_s=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=zj.Info;isLocal;constructor(t,r,{isLocal:n}){this.ttyAwareLogger=new q_s(t,r),this.isLocal=n??!1;let i=this.getPackageName(),a=this.getPackageVersion(),u=this.getCliName();(i==null||a==null||u==null)&&this.exitProgram(),this.environment={packageName:i,packageVersion:a,cliName:u}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.78.2"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${yd.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new Tae}failWithoutThrowing(t,r){this.didSucceed=!1,M_s({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await Kza()).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 Mhy({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
2408
2408
  `)||(r+=`
2409
2409
  `),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=nCl(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 Z3o(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 Tae}finally{n.finish()}return i}async instrumentPostHogEvent(t){this.isLocal||(await Kza()).sendEvent(t)}logger=V4r((t,...r)=>this.log(t,...r));stderr=V4r((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=hvy(t.type==="docs"?"docs":t.workspaceName??"api"),n=1+(this.longestWorkspaceName!=null?hvy(this.longestWorkspaceName):r).length,i=r.padEnd(n),a=_vy[this.numTasks++%_vy.length],u=yd.hex(a)(i);return{...this.constructTaskInit(),logPrefix:u}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===CL.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=>Zwi.indexOf(i.level)>=Zwi.indexOf(this.logLevel));this.ttyAwareLogger.log(n,{includeDebugInfo:this.logLevel===zj.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 ADi({cliEnvironment:this.environment,includePreReleases:t}),n=fNe(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(n?"Upgrade available.":"No upgrade available."));let i={isUpgradeAvailable:n,latestVersion:r},a=await x_s({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:i,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){return await mof({message:t,default:r})}async getInput(t){return await Oof({message:t.message,default:t.default})}};function hvy(e){return`[${e}]:`}var mCr=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 Let=class extends mCr{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 kci={enableUniqueErrorsPerEndpoint:!1,detectGlobalHeaders:!0,objectQueryParameters:!1,respectReadonlySchemas:!1,respectNullableSchemas:!1,onlyIncludeReferencedSchemas:!1,inlinePathParameters:!1,useBytesForBinaryResponse:!1,respectForwardCompatibleEnums:!1};function p4o({options:e,overrides:t}){return{enableUniqueErrorsPerEndpoint:t?.enableUniqueErrorsPerEndpoint??e?.enableUniqueErrorsPerEndpoint??kci.enableUniqueErrorsPerEndpoint,detectGlobalHeaders:t?.detectGlobalHeaders??e?.detectGlobalHeaders??kci.detectGlobalHeaders,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??kci.objectQueryParameters,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??kci.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??kci.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??kci.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??kci.inlinePathParameters,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??kci.useBytesForBinaryResponse,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??kci.respectForwardCompatibleEnums}}var HOe={openapi:e=>({...e,type:"openapi",_visit:function(t){return HOe._visit(this,t)}}),protobuf:e=>({...e,type:"protobuf",_visit:function(t){return HOe._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 aQa={protobuf:e=>({...e,type:"protobuf",_visit:function(t){return aQa._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var Vle={basic:e=>({...e,type:"basic",_visit:function(t){return Vle._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return Vle._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return Vle._visit(this,t)}}),query:e=>({...e,type:"query",_visit:function(t){return Vle._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return Vle._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 RS={primitive:e=>({value:e,type:"primitive",_visit:function(t){return RS._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return RS._visit(this,t)}}),array:e=>({value:e,type:"array",_visit:function(t){return RS._visit(this,t)}}),map:e=>({value:e,type:"map",_visit:function(t){return RS._visit(this,t)}}),enum:e=>({value:e,type:"enum",_visit:function(t){return RS._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return RS._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return RS._visit(this,t)}}),unknown:e=>({value:e,type:"unknown",_visit:function(t){return RS._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"unknown":return t.unknown(e.value);default:return t._other(e)}}};var Im={int:e=>({value:e,type:"int",_visit:function(t){return Im._visit(this,t)}}),int64:e=>({value:e,type:"int64",_visit:function(t){return Im._visit(this,t)}}),uint:e=>({value:e,type:"uint",_visit:function(t){return Im._visit(this,t)}}),uint64:e=>({value:e,type:"uint64",_visit:function(t){return Im._visit(this,t)}}),float:e=>({value:e,type:"float",_visit:function(t){return Im._visit(this,t)}}),double:e=>({value:e,type:"double",_visit:function(t){return Im._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Im._visit(this,t)}}),datetime:e=>({value:e,type:"datetime",_visit:function(t){return Im._visit(this,t)}}),date:e=>({value:e,type:"date",_visit:function(t){return Im._visit(this,t)}}),base64:e=>({value:e,type:"base64",_visit:function(t){return Im._visit(this,t)}}),boolean:e=>({value:e,type:"boolean",_visit:function(t){return Im._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 PDi={boolean:e=>({value:e,type:"boolean",_visit:function(t){return PDi._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return PDi._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 wDi={discriminated:e=>({value:e,type:"discriminated",_visit:function(t){return wDi._visit(this,t)}}),undiscriminated:e=>({value:e,type:"undiscriminated",_visit:function(t){return wDi._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 Z_s={};ds(Z_s,{Availability:()=>Wle,CustomCodeSample:()=>q8r,EndpointExample:()=>Mdt,EndpointResponseExample:()=>Bdt,HttpMethod:()=>Gle,LiteralSchemaValue:()=>JL,MultipartRequestPropertyEncoding:()=>fuf,MultipartSchema:()=>x8r,OneOfSchema:()=>N8r,Pagination:()=>Uet,PrimitiveSchemaValue:()=>iT,Request:()=>OCr,Response:()=>gye,RetriesConfiguration:()=>_4o,Schema:()=>$P,SupportedSdkLanguage:()=>Hle,WebhookHttpMethod:()=>luf,WebsocketMessageOrigin:()=>cuf});var cuf={Client:"client",Server:"server",_visit:(e,t)=>{switch(e){case cuf.Client:return t.client();case cuf.Server:return t.server();default:return t._other()}}};var luf={Get:"GET",Post:"POST",_visit:(e,t)=>{switch(e){case luf.Get:return t.get();case luf.Post:return t.post();default:return t._other()}}};var Wle={GenerallyAvailable:"GenerallyAvailable",Beta:"Beta",Deprecated:"Deprecated",_visit:(e,t)=>{switch(e){case Wle.GenerallyAvailable:return t.generallyAvailable();case Wle.Beta:return t.beta();case Wle.Deprecated:return t.deprecated();default:return t._other()}}};var _4o={disabled:e=>({value:e,type:"disabled",_visit:function(t){return _4o._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"disabled":return t.disabled(e.value);default:return t._other(e)}}};var Uet={cursor:e=>({...e,type:"cursor",_visit:function(t){return Uet._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return Uet._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return Uet._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 q8r={language:e=>({...e,type:"language",_visit:function(t){return q8r._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return q8r._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 Hle={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 Hle.Curl:return t.curl();case Hle.Python:return t.python();case Hle.Javascript:return t.javascript();case Hle.Typescript:return t.typescript();case Hle.Go:return t.go();case Hle.Ruby:return t.ruby();case Hle.Csharp:return t.csharp();case Hle.Java:return t.java();case Hle.Js:return t.js();case Hle.Node:return t.node();case Hle.Ts:return t.ts();case Hle.Nodets:return t.nodets();case Hle.Golang:return t.golang();case Hle.Dotnet:return t.dotnet();case Hle.Jvm:return t.jvm();default:return t._other()}}};var Mdt={unknown:e=>({value:e,type:"unknown",_visit:function(t){return Mdt._visit(this,t)}}),full:e=>({...e,type:"full",_visit:function(t){return Mdt._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 Bdt={withStreaming:e=>({...e,type:"withStreaming",_visit:function(t){return Bdt._visit(this,t)}}),withoutStreaming:e=>({value:e,type:"withoutStreaming",_visit:function(t){return Bdt._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 Gle={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",Options:"OPTIONS",Trace:"TRACE",_visit:(e,t)=>{switch(e){case Gle.Get:return t.get();case Gle.Post:return t.post();case Gle.Put:return t.put();case Gle.Patch:return t.patch();case Gle.Delete:return t.delete();case Gle.Head:return t.head();case Gle.Options:return t.options();case Gle.Trace:return t.trace();default:return t._other()}}};var OCr={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return OCr._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return OCr._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return OCr._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return OCr._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 fuf={Json:"json",Form:"form",_visit:(e,t)=>{switch(e){case fuf.Json:return t.json();case fuf.Form:return t.form();default:return t._other()}}};var x8r={file:e=>({...e,type:"file",_visit:function(t){return x8r._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return x8r._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 gye={file:e=>({...e,type:"file",_visit:function(t){return gye._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return gye._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return gye._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return gye._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return gye._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return gye._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return gye._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 $P={primitive:e=>({...e,type:"primitive",_visit:function(t){return $P._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return $P._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return $P._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return $P._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return $P._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return $P._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return $P._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return $P._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return $P._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return $P._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return $P._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 iT={int:e=>({...e,type:"int",_visit:function(t){return iT._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return iT._visit(this,t)}}),uint:()=>({type:"uint",_visit:function(e){return iT._visit(this,e)}}),uint64:()=>({type:"uint64",_visit:function(e){return iT._visit(this,e)}}),float:()=>({type:"float",_visit:function(e){return iT._visit(this,e)}}),double:e=>({...e,type:"double",_visit:function(t){return iT._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return iT._visit(this,t)}}),datetime:()=>({type:"datetime",_visit:function(e){return iT._visit(this,e)}}),date:()=>({type:"date",_visit:function(e){return iT._visit(this,e)}}),base64:()=>({type:"base64",_visit:function(e){return iT._visit(this,e)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return iT._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 JL={boolean:e=>({value:e,type:"boolean",_visit:function(t){return JL._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return JL._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 N8r={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return N8r._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return N8r._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 ASe={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return ASe._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return ASe._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return ASe._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return ASe._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 _Q={file:e=>({...e,type:"file",_visit:function(t){return _Q._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return _Q._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return _Q._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return _Q._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return _Q._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return _Q._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return _Q._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 Uh={primitive:e=>({...e,type:"primitive",_visit:function(t){return Uh._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Uh._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return Uh._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Uh._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Uh._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Uh._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return Uh._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Uh._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return Uh._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Uh._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return Uh._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 PSe={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return PSe._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return PSe._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 Zg={int:e=>({...e,type:"int",_visit:function(t){return Zg._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return Zg._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return Zg._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return Zg._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return Zg._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return Zg._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Zg._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return Zg._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return Zg._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return Zg._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Zg._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 Aw={};ds(Aw,{AllOfPropertyConflict:()=>CQa,ArraySchema:()=>hys,ArraySchemaWithExample:()=>Gys,Availability:()=>shs,Base64WithExample:()=>Lys,BasicSecurityScheme:()=>fhs,BearerSecurityScheme:()=>dhs,BooleanSchema:()=>cys,BooleanWithExample:()=>Uys,BytesResponse:()=>gQa,CasingOverrides:()=>hhs,CommonProperty:()=>Pys,CommonPropertyWithExample:()=>tvs,CursorPagination:()=>Ghs,CustomCodeSample:()=>Whs,CustomCodeSampleLanguage:()=>Lhs,CustomCodeSampleSdk:()=>Vhs,CustomPagination:()=>Khs,DateWithExample:()=>Qys,DatetimeWithExample:()=>zys,DiscriminatedOneOfSchema:()=>Oys,DiscriminatedOneOfSchemaWithExample:()=>kys,DoubleSchema:()=>uys,DoubleWithExample:()=>Rys,Encoding:()=>uhs,Endpoint:()=>$hs,EndpointExample:()=>PQa,EndpointResponseExample:()=>Qhs,EndpointSdkName:()=>z8r,EndpointWithExample:()=>Hvy,EnumSchema:()=>cQa,EnumSchemaWithExample:()=>Wys,EnumValue:()=>SDi,ErrorExample:()=>xhs,FernExample:()=>Rhs,FileResponse:()=>vQa,FileSchema:()=>Shs,FloatWithExample:()=>Nys,FormUrlEncodedRequest:()=>Bhs,FullEndpointExample:()=>Hhs,FullExample:()=>z7,FullObjectExample:()=>Ahs,FullOneOfExample:()=>whs,GlobalHeader:()=>fys,Header:()=>CDi,HeaderExample:()=>AQa,HeaderSecurityScheme:()=>phs,HeaderWithExample:()=>BDi,HttpEndpointServer:()=>mQa,HttpError:()=>Nhs,HttpErrorWithExample:()=>Mys,HttpMethod:()=>dQa,IdempotencyHeader:()=>dys,Int64WithExample:()=>Tys,IntSchema:()=>ays,IntWithExample:()=>Bys,JsonRequest:()=>Mhs,JsonRequestWithExample:()=>Sys,JsonResponse:()=>bQa,JsonResponseWithExample:()=>BQa,KeyValuePair:()=>Phs,LiteralExample:()=>Ohs,LiteralSchema:()=>DQa,LiteralSchemaValue:()=>pys,LongSchema:()=>oys,MapSchema:()=>yys,MapSchemaWithExample:()=>Jys,MultipartRequest:()=>yQa,MultipartRequestProperty:()=>Ihs,MultipartRequestPropertyEncoding:()=>Chs,MultipartSchema:()=>Dhs,NamedFullExample:()=>qdt,Namespace:()=>yhs,NamespaceId:()=>mhs,NullableSchema:()=>bys,NullableSchemaWithExample:()=>$ys,OauthSecurityScheme:()=>bhs,ObjectProperty:()=>mys,ObjectPropertyConflictInfo:()=>IQa,ObjectPropertyWithExample:()=>Zys,ObjectSchema:()=>_ys,ObjectSchemaWithExample:()=>Yys,OctetStreamRequest:()=>hQa,OffsetPagination:()=>Jhs,OneOfSchema:()=>gys,OneOfSchemaWithExample:()=>Xys,OpenApiIntermediateRepresentation:()=>Vvy,OpenApiSource:()=>nhs,OptionalSchema:()=>vys,OptionalSchemaWithExample:()=>Kys,Pagination:()=>wQa,ParseFormUrlEncodedRequest:()=>Dys,ParseMultipartRequest:()=>Eys,ParseOctetStreamRequest:()=>jys,PathParameter:()=>pQa,PathParameterExample:()=>Fhs,PathParameterWithExample:()=>wys,PrimitiveExample:()=>fQa,PrimitiveSchema:()=>MDi,PrimitiveSchemaValue:()=>lys,PrimitiveSchemaValueWithExample:()=>Vys,PrimitiveSchemaWithExample:()=>TQa,PropertyKey:()=>lQa,ProtobufEncoding:()=>ohs,ProtobufSource:()=>ihs,QueryParameter:()=>_Qa,QueryParameterExample:()=>OQa,QueryParameterWithExample:()=>MQa,QuerySecurityScheme:()=>_hs,ReferencedSchema:()=>Q8r,Request:()=>Ths,RequestWithExample:()=>Cys,Response:()=>qhs,ResponseWithExample:()=>Iys,RetriesConfiguration:()=>jQa,Schema:()=>fC,SchemaId:()=>wSe,SchemaWithExample:()=>j4,Schemas:()=>iys,SdkGroup:()=>vhs,SdkGroupInfo:()=>jhs,SdkGroupName:()=>DDi,SecurityScheme:()=>ghs,SecuritySchemeId:()=>lhs,Server:()=>b4o,Source:()=>ahs,StatusCode:()=>R8r,StreamingResponseExample:()=>zhs,StringSchema:()=>sys,StringSchemaWithExample:()=>Fys,SupportedSdkLanguage:()=>Uhs,Tag:()=>chs,TagId:()=>jSe,Tags:()=>Ehs,TextResponse:()=>IDi,Uint64WithExample:()=>xys,UintWithExample:()=>qys,UnDiscriminatedOneOfSchema:()=>Ays,UnDiscriminatedOneOfSchemaWithExample:()=>evs,UnknownSchemaWithExample:()=>Hys,Webhook:()=>Yhs,WebhookExampleCall:()=>SQa,WebhookHttpMethod:()=>EQa,WebhookWithExample:()=>Gvy,WebsocketChannel:()=>nys,WebsocketHandshake:()=>Xhs,WebsocketHandshakeWithExample:()=>Wvy,WebsocketMessageExample:()=>tys,WebsocketMessageOrigin:()=>Zhs,WebsocketMessageSchema:()=>khs,WebsocketServer:()=>eys,WebsocketSessionExample:()=>rys,WithAvailability:()=>qA,WithDescription:()=>By,WithEncoding:()=>_Ne,WithInline:()=>w4,WithName:()=>YE,WithNamespace:()=>lE,WithSdkGroupName:()=>aI,WithSdkMethodName:()=>F8r,WithSource:()=>tA,WithStatusCode:()=>Tdt,WithTitle:()=>iI,commons:()=>yuf,example:()=>vuf,finalIr:()=>buf,parseIr:()=>guf});var yuf={};ds(yuf,{BasicSecurityScheme:()=>fhs,BearerSecurityScheme:()=>dhs,Encoding:()=>uhs,HeaderSecurityScheme:()=>phs,Namespace:()=>yhs,NamespaceId:()=>mhs,OauthSecurityScheme:()=>bhs,OpenApiSource:()=>nhs,ProtobufEncoding:()=>ohs,ProtobufSource:()=>ihs,QuerySecurityScheme:()=>_hs,SchemaId:()=>wSe,SdkGroup:()=>vhs,SdkGroupName:()=>DDi,SecurityScheme:()=>ghs,SecuritySchemeId:()=>lhs,Server:()=>b4o,Source:()=>ahs,StatusCode:()=>R8r,Tag:()=>chs,TagId:()=>jSe,WithAvailability:()=>qA,WithDescription:()=>By,WithEncoding:()=>_Ne,WithInline:()=>w4,WithName:()=>YE,WithNamespace:()=>lE,WithSdkGroupName:()=>aI,WithSdkMethodName:()=>F8r,WithSource:()=>tA,WithStatusCode:()=>Tdt,WithTitle:()=>iI});var Wr={};ds(Wr,{JsonError:()=>oQa,ParseError:()=>uQa,any:()=>Ivy,bigint:()=>vvy,boolean:()=>Mvy,booleanLiteral:()=>Cvy,date:()=>bvy,discriminant:()=>Qvy,enum_:()=>ehs,getObjectLikeUtils:()=>ACr,getObjectUtils:()=>c$i,getSchemaUtils:()=>F7,isProperty:()=>EDi,lazy:()=>gvy,lazyObject:()=>Evy,list:()=>rhs,number:()=>Bvy,object:()=>ths,objectWithoutOptionalProperties:()=>jvy,optional:()=>duf,property:()=>Ovy,record:()=>Nvy,set:()=>Rvy,string:()=>Tvy,stringLiteral:()=>Dvy,transform:()=>puf,undiscriminatedUnion:()=>zvy,union:()=>Uvy,unknown:()=>qvy,withParsedProperties:()=>huf});var aT={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 Pz(e,t){return`Expected ${t}. Received ${aMD(e)}.`}function aMD(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 Jle(e){return{...e,json:yvy(e.json),parse:yvy(e.parse)}}function yvy(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 k_s(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var oQa=class e extends Error{errors;constructor(t){super(t.map(k_s).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var uQa=class e extends Error{errors;constructor(t){super(t.map(k_s).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function F7(e){return{optional:()=>duf(e),transform:t=>puf(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new uQa(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new oQa(n.errors)}}}function duf(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:()=>aT.OPTIONAL};return{...t,...F7(t)}}function puf(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,...F7(r)}}function vvy(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Pz(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:Pz(t,"bigint")}]},getType:()=>aT.BIGINT};return{...Jle(e),...F7(e)}}var oMD=/^([+-]?\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 bvy(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Pz(t,"string")}]}:oMD.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:Pz(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:Pz(t,"Date object")}]},getType:()=>aT.DATE};return{...Jle(e),...F7(e)}}function GOe(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...Jle(r),...F7(r)}}}function ehs(e){let t=new Set(e);return GOe(aT.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:a,message:Pz(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:a,message:Pz(n,"enum")}]}:{ok:!0,value:n})()}function gvy(e){let t=_uf(e);return{...t,...F7(t)}}function _uf(e){return{parse:(t,r)=>sQa(e).parse(t,r),json:(t,r)=>sQa(e).json(t,r),getType:()=>sQa(e).getType()}}function sQa(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function h4o(e){return Object.entries(e)}function y4o(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,a])=>(r.has(i)&&(n[i]=a),n),{})}function jDi(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 v4o(e){return Object.keys(e)}function mvy(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function ACr(e){return{withParsedProperties:t=>huf(e,t)}}function huf(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);if(!a.ok)return a;let u=Object.entries(t).reduce((c,[p,s])=>({...c,[p]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(n,i)=>{if(!jDi(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:Pz(n,"object")}]};let a=new Set(Object.keys(t)),u=y4o(n,Object.keys(n).filter(c=>!a.has(c)));return e.json(u,i)},getType:()=>e.getType()};return{...r,...F7(r),...ACr(r)}}function Ovy(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function EDi(e){return e.isProperty}function ths(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>EDi(n)?n.rawKey:r),_getParsedProperties:()=>v4o(e),parse:(r,n)=>{let i={},a=[];for(let[u,c]of h4o(e)){let p=EDi(c)?c.rawKey:u,s=EDi(c)?c.valueSchema:c,o={rawKey:p,parsedKey:u,valueSchema:s};i[p]=o,wvy(s)&&a.push(p)}return Avy({value:r,requiredKeys:a,getProperty:u=>{let c=i[u];if(c!=null)return{transformedKey:c.parsedKey,transform:p=>c.valueSchema.parse(p,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:(r,n)=>{let i=[];for(let[a,u]of h4o(e)){let c=EDi(u)?u.valueSchema:u;wvy(c)&&i.push(a)}return Avy({value:r,requiredKeys:i,getProperty:a=>{let u=e[a];if(u!=null)return EDi(u)?{transformedKey:u.rawKey,transform:c=>u.valueSchema.json(c,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:c=>u.json(c,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:()=>aT.OBJECT};return{...Jle(t),...F7(t),...ACr(t),...c$i(t)}}function Avy({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:a=[]}){if(!jDi(e))return{ok:!1,errors:[{path:a,message:Pz(e,"object")}]};let u=new Set(t),c=[],p={};for(let[s,o]of Object.entries(e)){let l=r(s);if(l!=null){u.delete(s);let O=l.transform(o);O.ok?p[l.transformedKey]=O.value:(p[s]=o,c.push(...O.errors))}else switch(n){case"fail":c.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":p[s]=o;break}}return c.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),c.length===0||i?{ok:!0,value:p}:{ok:!1,errors:c}}function c$i(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>Pvy({extensionKeys:t._getRawProperties(),value:n,transformBase:a=>e.parse(a,i),transformExtension:a=>t.parse(a,i)}),json:(n,i)=>Pvy({extensionKeys:t._getParsedProperties(),value:n,transformBase:a=>e.json(a,i),transformExtension:a=>t.json(a,i)}),getType:()=>aT.OBJECT};return{...r,...F7(r),...ACr(r),...c$i(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:()=>aT.OBJECT};return{...t,...F7(t),...ACr(t),...c$i(t)}}}}function Pvy({extensionKeys:e,value:t,transformBase:r,transformExtension:n}){let i=new Set(e),[a,u]=mvy(v4o(t),s=>i.has(s)),c=r(y4o(t,u)),p=n(y4o(t,a));return c.ok&&p.ok?{ok:!0,value:{...c.value,...p.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...p.ok?[]:p.errors]}}function wvy(e){return!uMD(e)}function uMD(e){switch(e.getType()){case aT.ANY:case aT.UNKNOWN:case aT.OPTIONAL:return!0;default:return!1}}function jvy(e){return ths(e)}function Evy(e){let t={..._uf(e),_getRawProperties:()=>sQa(e)._getRawProperties(),_getParsedProperties:()=>sQa(e)._getParsedProperties()};return{...t,...F7(t),...ACr(t),...c$i(t)}}function rhs(e){let t={parse:(r,n)=>Svy(r,(i,a)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,n)=>Svy(r,(i,a)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>aT.LIST};return{...Jle(t),...F7(t)}}function Svy(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:Pz(e,"list"),path:[]}]}}function Dvy(e){return GOe(aT.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Pz(r,`"${e}"`)}]})()}function Cvy(e){return GOe(aT.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Pz(r,`${e.toString()}`)}]})()}var Ivy=GOe(aT.ANY,e=>({ok:!0,value:e}));var Mvy=GOe(aT.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Pz(e,"boolean")}]});var Bvy=GOe(aT.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Pz(e,"number")}]});var Tvy=GOe(aT.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Pz(e,"string")}]});var qvy=GOe(aT.UNKNOWN,e=>({ok:!0,value:e}));function Nvy(e,t){let r={parse:(n,i)=>xvy({value:n,isKeyNumeric:e.getType()===aT.NUMBER,transformKey:a=>e.parse(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>xvy({value:n,isKeyNumeric:e.getType()===aT.NUMBER,transformKey:a=>e.json(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>aT.RECORD};return{...Jle(r),...F7(r)}}function xvy({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return jDi(e)?h4o(e).reduce((a,[u,c])=>{if(c==null)return a;let p=a,s=u;if(t){let A=u.length>0?Number(u):NaN;isNaN(A)||(s=A)}let o=r(s),l=n(c,s);if(p.ok&&o.ok&&l.ok)return{ok:!0,value:{...p.value,[o.value]:l.value}};let O=[];return p.ok||O.push(...p.errors),o.ok||O.push(...o.errors),l.ok||O.push(...l.errors),{ok:!1,errors:O}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:Pz(e,"object")}]}}function Rvy(e){let t=rhs(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:Pz(n,"Set")}]},getType:()=>aT.SET};return{...Jle(r),...F7(r)}}function zvy(e){let t={parse:(r,n)=>Fvy((i,a)=>i.parse(r,a),e,n),json:(r,n)=>Fvy((i,a)=>i.json(r,a),e,n),getType:()=>aT.UNDISCRIMINATED_UNION};return{...Jle(t),...F7(t)}}function Fvy(e,t,r){let n=[];for(let[i,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let c of u.errors)n.push({path:c.path,message:`[Variant ${i}] ${c.message}`})}return{ok:!1,errors:n}}function Qvy(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function Uvy(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=ehs(v4o(t)),a={parse:(u,c)=>Lvy({value:u,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:p=>i.parse(p,{allowUnrecognizedEnumValues:c?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...c?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:p=>t[p],allowUnrecognizedUnionMembers:c?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(p,s)=>s.parse(p,c),breadcrumbsPrefix:c?.breadcrumbsPrefix}),json:(u,c)=>Lvy({value:u,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:p=>i.json(p,{allowUnrecognizedEnumValues:c?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...c?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:p=>t[p],allowUnrecognizedUnionMembers:c?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(p,s)=>s.json(p,c),breadcrumbsPrefix:c?.breadcrumbsPrefix}),getType:()=>aT.UNION};return{...Jle(a),...F7(a),...ACr(a)}}function Lvy({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:c=[]}){if(!jDi(e))return{ok:!1,errors:[{path:c,message:Pz(e,"object")}]};let{[t]:p,...s}=e;if(p==null)return{ok:!1,errors:[{path:c,message:`Missing discriminant ("${t}")`}]};let o=n(p);if(!o.ok)return{ok:!1,errors:o.errors};let l=i(o.value);if(l==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...c,t],message:"Unexpected discriminant value"}]};let O=u(s,l);return O.ok?{ok:!0,value:{[r]:p,...O.value}}:O}var iI=Wr.objectWithoutOptionalProperties({title:Wr.string().optional()});var nhs=Wr.objectWithoutOptionalProperties({file:Wr.string()});var ihs=Wr.objectWithoutOptionalProperties({file:Wr.string()});var ahs=Wr.union("type",{openapi:nhs,protobuf:ihs}).transform({transform:e=>{switch(e.type){case"openapi":return HOe.openapi(e);case"protobuf":return HOe.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var tA=Wr.objectWithoutOptionalProperties({source:ahs.optional()});var ohs=Wr.objectWithoutOptionalProperties({typeName:Wr.string()});var uhs=Wr.union("type",{protobuf:ohs}).transform({transform:e=>{switch(e.type){case"protobuf":return aQa.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var _Ne=Wr.objectWithoutOptionalProperties({encoding:uhs.optional()});var By=Wr.objectWithoutOptionalProperties({description:Wr.string().optional()});var shs=Wr.enum_(["GenerallyAvailable","Beta","Deprecated"]);var qA=Wr.objectWithoutOptionalProperties({availability:shs.optional()});var R8r=Wr.number();var Tdt=Wr.objectWithoutOptionalProperties({statusCode:R8r.optional()});var YE=Wr.objectWithoutOptionalProperties({nameOverride:Wr.string().optional(),generatedName:Wr.string()});var w4=Wr.objectWithoutOptionalProperties({inline:Wr.boolean().optional()});var wSe=Wr.string();var jSe=Wr.string();var chs=Wr.objectWithoutOptionalProperties({id:jSe}).extend(By);var lhs=Wr.string();var fhs=Wr.objectWithoutOptionalProperties({usernameVariableName:Wr.string().optional(),usernameEnvVar:Wr.string().optional(),passwordVariableName:Wr.string().optional(),passwordEnvVar:Wr.string().optional()});var dhs=Wr.objectWithoutOptionalProperties({tokenVariableName:Wr.string().optional(),tokenEnvVar:Wr.string().optional()});var phs=Wr.objectWithoutOptionalProperties({headerName:Wr.string(),prefix:Wr.string().optional(),headerVariableName:Wr.string().optional(),headerEnvVar:Wr.string().optional()});var _hs=Wr.objectWithoutOptionalProperties({queryParameterName:Wr.string()});var hhs=Wr.objectWithoutOptionalProperties({snake:Wr.string().optional(),camel:Wr.string().optional(),screamingSnake:Wr.string().optional(),pascal:Wr.string().optional()});var SDi=Wr.objectWithoutOptionalProperties({nameOverride:Wr.string().optional(),generatedName:Wr.string(),value:Wr.string(),casing:hhs.optional()}).extend(By).extend(qA);var yhs=Wr.objectWithoutOptionalProperties({type:Wr.stringLiteral("namespace"),name:Wr.string()});var vhs=Wr.undiscriminatedUnion([Wr.string(),yhs]);var DDi=Wr.list(vhs);var aI=Wr.objectWithoutOptionalProperties({groupName:DDi.optional()});var lE=Wr.objectWithoutOptionalProperties({namespace:Wr.string().optional()});var cQa=Wr.objectWithoutOptionalProperties({default:SDi.optional(),values:Wr.list(SDi)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(tA).extend(iI).extend(w4);var bhs=Wr.objectWithoutOptionalProperties({scopesEnum:cQa.optional()});var ghs=Wr.union("type",{basic:fhs,bearer:dhs,header:phs,query:_hs,oauth:bhs}).transform({transform:e=>{switch(e.type){case"basic":return Vle.basic(e);case"bearer":return Vle.bearer(e);case"header":return Vle.header(e);case"query":return Vle.query(e);case"oauth":return Vle.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var b4o=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),url:Wr.string(),audiences:Wr.list(Wr.string()).optional()}).extend(By);var mhs=Wr.string();var F8r=Wr.objectWithoutOptionalProperties({sdkMethodName:Wr.string().optional()});var vuf={};ds(vuf,{FullExample:()=>z7,FullObjectExample:()=>Ahs,FullOneOfExample:()=>whs,KeyValuePair:()=>Phs,LiteralExample:()=>Ohs,PrimitiveExample:()=>fQa,PropertyKey:()=>lQa});var lQa=Wr.string();var fQa=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 Im.int(e.value);case"int64":return Im.int64(e.value);case"uint":return Im.uint(e.value);case"uint64":return Im.uint64(e.value);case"float":return Im.float(e.value);case"double":return Im.double(e.value);case"string":return Im.string(e.value);case"datetime":return Im.datetime(e.value);case"date":return Im.date(e.value);case"base64":return Im.base64(e.value);case"boolean":return Im.boolean(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Ohs=Wr.union("type",{boolean:Wr.object({value:Wr.boolean()}),string:Wr.object({value:Wr.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return PDi.boolean(e.value);case"string":return PDi.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var z7=Wr.union("type",{primitive:Wr.object({value:fQa}),object:Wr.lazyObject(()=>Ahs),array:Wr.object({value:Wr.list(Wr.lazy(()=>z7))}),map:Wr.object({value:Wr.list(Wr.lazyObject(()=>Phs))}),enum:Wr.object({value:Wr.string()}),literal:Wr.object({value:Ohs}),oneOf:Wr.object({value:Wr.lazy(()=>whs)}),unknown:Wr.object({value:Wr.lazy(()=>z7)})}).transform({transform:e=>{switch(e.type){case"primitive":return RS.primitive(e.value);case"object":return RS.object(e);case"array":return RS.array(e.value);case"map":return RS.map(e.value);case"enum":return RS.enum(e.value);case"literal":return RS.literal(e.value);case"oneOf":return RS.oneOf(e.value);case"unknown":return RS.unknown(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Ahs=Wr.objectWithoutOptionalProperties({properties:Wr.record(lQa,Wr.lazy(()=>z7))});var Phs=Wr.objectWithoutOptionalProperties({key:fQa,value:Wr.lazy(()=>z7)});var whs=Wr.union("type",{discriminated:Wr.object({value:Wr.record(lQa,Wr.lazy(()=>z7))}),undiscriminated:Wr.object({value:Wr.lazy(()=>z7)})}).transform({transform:e=>{switch(e.type){case"discriminated":return wDi.discriminated(e.value);case"undiscriminated":return wDi.undiscriminated(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var buf={};ds(buf,{AllOfPropertyConflict:()=>CQa,ArraySchema:()=>hys,Availability:()=>shs,BooleanSchema:()=>cys,BytesResponse:()=>gQa,CasingOverrides:()=>hhs,CommonProperty:()=>Pys,CursorPagination:()=>Ghs,CustomCodeSample:()=>Whs,CustomCodeSampleLanguage:()=>Lhs,CustomCodeSampleSdk:()=>Vhs,CustomPagination:()=>Khs,DiscriminatedOneOfSchema:()=>Oys,DoubleSchema:()=>uys,Endpoint:()=>$hs,EndpointExample:()=>PQa,EndpointResponseExample:()=>Qhs,EndpointSdkName:()=>z8r,EnumSchema:()=>cQa,EnumValue:()=>SDi,ErrorExample:()=>xhs,FernExample:()=>Rhs,FileResponse:()=>vQa,FileSchema:()=>Shs,FormUrlEncodedRequest:()=>Bhs,FullEndpointExample:()=>Hhs,GlobalHeader:()=>fys,Header:()=>CDi,HeaderExample:()=>AQa,HttpEndpointServer:()=>mQa,HttpError:()=>Nhs,HttpMethod:()=>dQa,IdempotencyHeader:()=>dys,IntSchema:()=>ays,JsonRequest:()=>Mhs,JsonResponse:()=>bQa,LiteralSchema:()=>DQa,LiteralSchemaValue:()=>pys,LongSchema:()=>oys,MapSchema:()=>yys,MultipartRequest:()=>yQa,MultipartRequestProperty:()=>Ihs,MultipartRequestPropertyEncoding:()=>Chs,MultipartSchema:()=>Dhs,NullableSchema:()=>bys,ObjectProperty:()=>mys,ObjectPropertyConflictInfo:()=>IQa,ObjectSchema:()=>_ys,OctetStreamRequest:()=>hQa,OffsetPagination:()=>Jhs,OneOfSchema:()=>gys,OpenApiIntermediateRepresentation:()=>Vvy,OptionalSchema:()=>vys,Pagination:()=>wQa,PathParameter:()=>pQa,PathParameterExample:()=>Fhs,PrimitiveSchema:()=>MDi,PrimitiveSchemaValue:()=>lys,QueryParameter:()=>_Qa,QueryParameterExample:()=>OQa,ReferencedSchema:()=>Q8r,Request:()=>Ths,Response:()=>qhs,RetriesConfiguration:()=>jQa,Schema:()=>fC,Schemas:()=>iys,SdkGroupInfo:()=>jhs,StreamingResponseExample:()=>zhs,StringSchema:()=>sys,SupportedSdkLanguage:()=>Uhs,Tags:()=>Ehs,TextResponse:()=>IDi,UnDiscriminatedOneOfSchema:()=>Ays,Webhook:()=>Yhs,WebhookExampleCall:()=>SQa,WebhookHttpMethod:()=>EQa,WebsocketChannel:()=>nys,WebsocketHandshake:()=>Xhs,WebsocketMessageExample:()=>tys,WebsocketMessageOrigin:()=>Zhs,WebsocketMessageSchema:()=>khs,WebsocketServer:()=>eys,WebsocketSessionExample:()=>rys});var jhs=Wr.objectWithoutOptionalProperties({summary:Wr.string().optional(),description:Wr.string().optional()});var Ehs=Wr.objectWithoutOptionalProperties({tagsById:Wr.record(jSe,chs),orderedTagIds:Wr.list(jSe).optional()});var dQa=Wr.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","TRACE"]);var pQa=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>fC),variableReference:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(By).extend(qA).extend(tA);var _Qa=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>fC),parameterNameOverride:Wr.string().optional()}).extend(By).extend(qA).extend(tA);var CDi=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>fC),env:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(By).extend(qA).extend(tA);var z8r=Wr.objectWithoutOptionalProperties({groupName:DDi,methodName:Wr.string()});var hQa=Wr.objectWithoutOptionalProperties({contentType:Wr.string().optional()}).extend(By).extend(tA);var Shs=Wr.objectWithoutOptionalProperties({isOptional:Wr.boolean(),isArray:Wr.boolean()}).extend(By);var Dhs=Wr.union("type",{file:Shs,json:Wr.object({value:Wr.lazy(()=>fC)})}).transform({transform:e=>{switch(e.type){case"file":return x8r.file(e);case"json":return x8r.json(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Chs=Wr.enum_(["json","form"]);var Ihs=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Dhs,contentType:Wr.string().optional(),exploded:Wr.boolean().optional(),encoding:Chs.optional()}).extend(By);var yQa=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),properties:Wr.list(Ihs)}).extend(By).extend(tA);var Mhs=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>fC),contentType:Wr.string().optional(),additionalProperties:Wr.boolean()}).extend(By).extend(tA);var Bhs=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>fC),contentType:Wr.string().optional(),additionalProperties:Wr.boolean()}).extend(By).extend(tA);var Ths=Wr.union("type",{octetStream:hQa,multipart:yQa,json:Mhs,formUrlEncoded:Bhs}).transform({transform:e=>{switch(e.type){case"octetStream":return OCr.octetStream(e);case"multipart":return OCr.multipart(e);case"json":return OCr.json(e);case"formUrlEncoded":return OCr.formUrlEncoded(e);default:return e}},untransform:({_visit:e,...t})=>t});var vQa=Wr.objectWithoutOptionalProperties({}).extend(By).extend(tA).extend(Tdt);var bQa=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>fC),responseProperty:Wr.string().optional()}).extend(By).extend(tA).extend(Tdt);var IDi=Wr.objectWithoutOptionalProperties({}).extend(By).extend(tA).extend(Tdt);var gQa=Wr.objectWithoutOptionalProperties({}).extend(By).extend(tA).extend(Tdt);var qhs=Wr.union("type",{file:vQa,json:bQa,text:IDi,bytes:gQa,streamingSse:bQa,streamingText:IDi,streamingJson:bQa}).transform({transform:e=>{switch(e.type){case"file":return gye.file(e);case"json":return gye.json(e);case"text":return gye.text(e);case"bytes":return gye.bytes(e);case"streamingSse":return gye.streamingSse(e);case"streamingText":return gye.streamingText(e);case"streamingJson":return gye.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var xhs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),description:Wr.string().optional(),example:Wr.lazy(()=>z7)});var Nhs=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>fC).optional(),examples:Wr.list(xhs).optional()}).extend(By).extend(YE).extend(tA);var mQa=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),url:Wr.string().optional(),audiences:Wr.list(Wr.string()).optional()});var Rhs=Wr.unknown();var Fhs=Wr.objectWithoutOptionalProperties({name:Wr.string(),parameterNameOverride:Wr.string().optional(),value:Wr.lazy(()=>z7)});var OQa=Wr.objectWithoutOptionalProperties({name:Wr.string(),value:Wr.lazy(()=>z7)});var AQa=Wr.objectWithoutOptionalProperties({name:Wr.string(),value:Wr.lazy(()=>z7)});var zhs=Wr.objectWithoutOptionalProperties({sse:Wr.boolean(),events:Wr.list(Wr.lazy(()=>z7))});var Qhs=Wr.union("type",{withStreaming:zhs,withoutStreaming:Wr.object({value:Wr.lazy(()=>z7)})}).transform({transform:e=>{switch(e.type){case"withStreaming":return Bdt.withStreaming(e);case"withoutStreaming":return Bdt.withoutStreaming(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Lhs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),language:Wr.string(),code:Wr.string(),install:Wr.string().optional()}).extend(By);var Uhs=Wr.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","dotnet","jvm"]);var Vhs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),sdk:Uhs,code:Wr.string()}).extend(By);var Whs=Wr.union("type",{language:Lhs,sdk:Vhs}).transform({transform:e=>{switch(e.type){case"language":return q8r.language(e);case"sdk":return q8r.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var Hhs=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),pathParameters:Wr.list(Fhs).optional(),queryParameters:Wr.list(OQa).optional(),headers:Wr.list(AQa).optional(),request:Wr.lazy(()=>z7).optional(),response:Qhs.optional(),codeSamples:Wr.list(Whs)}).extend(By);var PQa=Wr.union("type",{unknown:Wr.object({value:Rhs}),full:Hhs}).transform({transform:e=>{switch(e.type){case"unknown":return Mdt.unknown(e.value);case"full":return Mdt.full(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ghs=Wr.objectWithoutOptionalProperties({cursor:Wr.string(),nextCursor:Wr.property("next_cursor",Wr.string()),results:Wr.string()});var Jhs=Wr.objectWithoutOptionalProperties({offset:Wr.string(),results:Wr.string(),step:Wr.string().optional(),hasNextPage:Wr.string().optional()});var Khs=Wr.objectWithoutOptionalProperties({results:Wr.string()});var wQa=Wr.union("type",{cursor:Ghs,offset:Jhs,custom:Khs}).transform({transform:e=>{switch(e.type){case"cursor":return Uet.cursor(e);case"offset":return Uet.offset(e);case"custom":return Uet.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var jQa=Wr.union("type",{disabled:Wr.object({value:Wr.boolean().optional()})}).transform({transform:e=>{switch(e.type){case"disabled":return _4o.disabled(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var $hs=Wr.objectWithoutOptionalProperties({authed:Wr.boolean(),internal:Wr.boolean().optional(),idempotent:Wr.boolean().optional(),method:dQa,audiences:Wr.list(Wr.string()),path:Wr.string(),summary:Wr.string().optional(),operationId:Wr.string().optional(),tags:Wr.list(jSe),pathParameters:Wr.list(pQa),queryParameters:Wr.list(_Qa),headers:Wr.list(CDi),sdkName:z8r.optional(),generatedRequestName:Wr.string(),requestNameOverride:Wr.string().optional(),request:Ths.optional(),response:qhs.optional(),errors:Wr.record(R8r,Nhs),servers:Wr.list(mQa),examples:Wr.list(PQa),pagination:wQa.optional(),retries:jQa.optional()}).extend(By).extend(qA).extend(tA).extend(lE);var EQa=Wr.enum_(["GET","POST"]);var SQa=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),payload:Wr.lazy(()=>z7)}).extend(By);var Yhs=Wr.objectWithoutOptionalProperties({audiences:Wr.list(Wr.string()),sdkName:z8r.optional(),method:EQa,summary:Wr.string().optional(),operationId:Wr.string(),tags:Wr.list(jSe),headers:Wr.list(CDi),generatedPayloadName:Wr.string(),payload:Wr.lazy(()=>fC),examples:Wr.list(SQa)}).extend(By).extend(tA).extend(lE);var Xhs=Wr.objectWithoutOptionalProperties({queryParameters:Wr.list(_Qa),headers:Wr.list(CDi),pathParameters:Wr.list(pQa)});var Zhs=Wr.enum_(["client","server"]);var khs=Wr.objectWithoutOptionalProperties({name:Wr.string(),origin:Zhs,body:Wr.lazy(()=>fC)});var eys=Wr.objectWithoutOptionalProperties({name:Wr.string(),url:Wr.string()});var tys=Wr.objectWithoutOptionalProperties({messageType:Wr.string(),payload:Wr.lazy(()=>z7)}).extend(By);var rys=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),queryParameters:Wr.list(OQa).optional(),headers:Wr.list(AQa).optional(),messages:Wr.list(tys)}).extend(By);var nys=Wr.objectWithoutOptionalProperties({audiences:Wr.list(Wr.string()),path:Wr.string(),groupName:DDi,summary:Wr.string().optional(),handshake:Xhs,messages:Wr.list(khs),servers:Wr.list(eys),examples:Wr.list(rys)}).extend(By).extend(tA);var iys=Wr.objectWithoutOptionalProperties({rootSchemas:Wr.record(wSe,Wr.lazy(()=>fC)),namespacedSchemas:Wr.record(mhs,Wr.record(wSe,Wr.lazy(()=>fC)))});var ays=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 oys=Wr.objectWithoutOptionalProperties({default:Wr.number().optional()});var uys=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 sys=Wr.objectWithoutOptionalProperties({default:Wr.string().optional(),pattern:Wr.string().optional(),format:Wr.string().optional(),minLength:Wr.number().optional(),maxLength:Wr.number().optional()});var cys=Wr.objectWithoutOptionalProperties({default:Wr.boolean().optional()});var lys=Wr.union("type",{int:ays,int64:oys,uint:Wr.object({}),uint64:Wr.object({}),float:Wr.object({}),double:uys,string:sys,datetime:Wr.object({}),date:Wr.object({}),base64:Wr.object({}),boolean:cys}).transform({transform:e=>{switch(e.type){case"int":return iT.int(e);case"int64":return iT.int64(e);case"uint":return iT.uint();case"uint64":return iT.uint64();case"float":return iT.float();case"double":return iT.double(e);case"string":return iT.string(e);case"datetime":return iT.datetime();case"date":return iT.date();case"base64":return iT.base64();case"boolean":return iT.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var MDi=Wr.objectWithoutOptionalProperties({schema:lys}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI);var fys=Wr.objectWithoutOptionalProperties({header:Wr.string(),name:Wr.string().optional(),optional:Wr.boolean().optional(),env:Wr.string().optional(),schema:Wr.lazy(()=>fC).optional()});var dys=Wr.objectWithoutOptionalProperties({header:Wr.string(),name:Wr.string().optional(),env:Wr.string().optional(),schema:Wr.lazy(()=>fC).optional()});var Vvy=Wr.objectWithoutOptionalProperties({apiVersion:Wr.unknown().optional(),title:Wr.string().optional(),description:Wr.string().optional(),basePath:Wr.string().optional(),servers:Wr.list(b4o),websocketServers:Wr.list(b4o),groups:Wr.record(Wr.string(),jhs),tags:Ehs,hasEndpointsMarkedInternal:Wr.boolean(),endpoints:Wr.list($hs),webhooks:Wr.list(Yhs),channels:Wr.record(Wr.string(),nys),groupedSchemas:iys,variables:Wr.record(Wr.string(),MDi),nonRequestReferencedSchemas:Wr.set(wSe),securitySchemes:Wr.record(lhs,ghs),globalHeaders:Wr.list(fys).optional(),idempotencyHeaders:Wr.list(dys).optional()});var Q8r=Wr.objectWithoutOptionalProperties({schema:wSe}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(tA).extend(iI);var pys=Wr.union("type",{boolean:Wr.object({value:Wr.boolean()}),string:Wr.object({value:Wr.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return JL.boolean(e.value);case"string":return JL.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var DQa=Wr.objectWithoutOptionalProperties({value:pys}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI);var fC=Wr.union("type",{primitive:MDi,object:Wr.lazyObject(()=>_ys),array:Wr.lazyObject(()=>hys),map:Wr.lazyObject(()=>yys),optional:Wr.lazyObject(()=>vys),enum:cQa,reference:Q8r,literal:DQa,oneOf:Wr.object({value:Wr.lazy(()=>gys)}),nullable:Wr.lazyObject(()=>bys),unknown:YE}).transform({transform:e=>{switch(e.type){case"primitive":return $P.primitive(e);case"object":return $P.object(e);case"array":return $P.array(e);case"map":return $P.map(e);case"optional":return $P.optional(e);case"enum":return $P.enum(e);case"reference":return $P.reference(e);case"literal":return $P.literal(e);case"oneOf":return $P.oneOf(e.value);case"nullable":return $P.nullable(e);case"unknown":return $P.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var CQa=Wr.objectWithoutOptionalProperties({propertyKey:Wr.string(),allOfSchemaIds:Wr.list(wSe),conflictingTypeSignatures:Wr.boolean()});var _ys=Wr.objectWithoutOptionalProperties({allOf:Wr.list(Q8r),properties:Wr.list(Wr.lazyObject(()=>mys)),allOfPropertyConflicts:Wr.list(CQa),additionalProperties:Wr.boolean()}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(tA).extend(iI).extend(w4);var IQa=Wr.objectWithoutOptionalProperties({differentSchema:Wr.boolean()});var mys=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>fC),readonly:Wr.boolean().optional(),writeonly:Wr.boolean().optional(),conflict:Wr.record(wSe,IQa),generatedName:Wr.string(),nameOverride:Wr.string().optional(),audiences:Wr.list(Wr.string())}).extend(qA);var hys=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>fC)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI).extend(w4);var yys=Wr.objectWithoutOptionalProperties({key:MDi,value:Wr.lazy(()=>fC)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(_Ne).extend(iI).extend(w4);var vys=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>fC)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI).extend(w4);var bys=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>fC)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI).extend(w4);var gys=Wr.union("type",{discriminated:Wr.lazyObject(()=>Oys),undiscriminated:Wr.lazyObject(()=>Ays)}).transform({transform:e=>{switch(e.type){case"discriminated":return N8r.discriminated(e);case"undiscriminated":return N8r.undiscriminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var Oys=Wr.objectWithoutOptionalProperties({discriminantProperty:Wr.string(),commonProperties:Wr.list(Wr.lazyObject(()=>Pys)),schemas:Wr.record(Wr.string(),Wr.lazy(()=>fC))}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(_Ne).extend(tA).extend(iI).extend(w4);var Pys=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>fC)});var Ays=Wr.objectWithoutOptionalProperties({schemas:Wr.list(Wr.lazy(()=>fC))}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(_Ne).extend(tA).extend(iI).extend(w4);var guf={};ds(guf,{ArraySchemaWithExample:()=>Gys,Base64WithExample:()=>Lys,BooleanWithExample:()=>Uys,CommonPropertyWithExample:()=>tvs,DateWithExample:()=>Qys,DatetimeWithExample:()=>zys,DiscriminatedOneOfSchemaWithExample:()=>kys,DoubleWithExample:()=>Rys,EndpointWithExample:()=>Hvy,EnumSchemaWithExample:()=>Wys,FloatWithExample:()=>Nys,HeaderWithExample:()=>BDi,HttpErrorWithExample:()=>Mys,Int64WithExample:()=>Tys,IntWithExample:()=>Bys,JsonRequestWithExample:()=>Sys,JsonResponseWithExample:()=>BQa,MapSchemaWithExample:()=>Jys,NamedFullExample:()=>qdt,NullableSchemaWithExample:()=>$ys,ObjectPropertyWithExample:()=>Zys,ObjectSchemaWithExample:()=>Yys,OneOfSchemaWithExample:()=>Xys,OptionalSchemaWithExample:()=>Kys,ParseFormUrlEncodedRequest:()=>Dys,ParseMultipartRequest:()=>Eys,ParseOctetStreamRequest:()=>jys,PathParameterWithExample:()=>wys,PrimitiveSchemaValueWithExample:()=>Vys,PrimitiveSchemaWithExample:()=>TQa,QueryParameterWithExample:()=>MQa,RequestWithExample:()=>Cys,ResponseWithExample:()=>Iys,SchemaWithExample:()=>j4,StringSchemaWithExample:()=>Fys,Uint64WithExample:()=>xys,UintWithExample:()=>qys,UnDiscriminatedOneOfSchemaWithExample:()=>evs,UnknownSchemaWithExample:()=>Hys,WebhookWithExample:()=>Gvy,WebsocketHandshakeWithExample:()=>Wvy});var qdt=Wr.objectWithoutOptionalProperties({name:Wr.string().optional(),value:Wr.unknown()}).extend(By);var MQa=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>j4),parameterNameOverride:Wr.string().optional()}).extend(By).extend(qA).extend(tA);var BDi=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>j4),env:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(By).extend(qA).extend(tA);var Wvy=Wr.objectWithoutOptionalProperties({queryParameters:Wr.list(MQa),headers:Wr.list(BDi)});var wys=Wr.objectWithoutOptionalProperties({name:Wr.string(),schema:Wr.lazy(()=>j4),variableReference:Wr.string().optional(),parameterNameOverride:Wr.string().optional()}).extend(By).extend(qA).extend(tA);var jys=Wr.objectWithoutOptionalProperties({}).extend(hQa).extend(F8r);var Eys=Wr.objectWithoutOptionalProperties({}).extend(yQa).extend(F8r);var Sys=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>j4),contentType:Wr.string().optional(),fullExamples:Wr.list(qdt).optional(),additionalProperties:Wr.boolean()}).extend(By).extend(tA).extend(F8r);var Dys=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>j4),contentType:Wr.string().optional(),fullExamples:Wr.list(qdt).optional(),additionalProperties:Wr.boolean()}).extend(By).extend(tA).extend(F8r);var Cys=Wr.union("type",{octetStream:jys,multipart:Eys,json:Sys,formUrlEncoded:Dys}).transform({transform:e=>{switch(e.type){case"octetStream":return ASe.octetStream(e);case"multipart":return ASe.multipart(e);case"json":return ASe.json(e);case"formUrlEncoded":return ASe.formUrlEncoded(e);default:return e}},untransform:({_visit:e,...t})=>t});var BQa=Wr.objectWithoutOptionalProperties({schema:Wr.lazy(()=>j4),responseProperty:Wr.string().optional(),fullExamples:Wr.list(qdt).optional()}).extend(By).extend(tA).extend(Tdt);var Iys=Wr.union("type",{file:vQa,json:BQa,text:IDi,bytes:gQa,streamingSse:BQa,streamingText:IDi,streamingJson:BQa}).transform({transform:e=>{switch(e.type){case"file":return _Q.file(e);case"json":return _Q.json(e);case"text":return _Q.text(e);case"bytes":return _Q.bytes(e);case"streamingSse":return _Q.streamingSse(e);case"streamingText":return _Q.streamingText(e);case"streamingJson":return _Q.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var Mys=Wr.objectWithoutOptionalProperties({statusCode:R8r,schema:Wr.lazy(()=>j4),fullExamples:Wr.list(qdt).optional()}).extend(By).extend(YE).extend(tA);var Hvy=Wr.objectWithoutOptionalProperties({authed:Wr.boolean(),internal:Wr.boolean().optional(),idempotent:Wr.boolean().optional(),method:dQa,audiences:Wr.list(Wr.string()),path:Wr.string(),summary:Wr.string().optional(),operationId:Wr.string().optional(),tags:Wr.list(jSe),pathParameters:Wr.list(wys),queryParameters:Wr.list(MQa),headers:Wr.list(BDi),sdkName:z8r.optional(),generatedRequestName:Wr.string(),requestNameOverride:Wr.string().optional(),request:Cys.optional(),response:Iys.optional(),errors:Wr.record(R8r,Mys),servers:Wr.list(mQa),examples:Wr.list(PQa),pagination:wQa.optional(),retries:jQa.optional()}).extend(By).extend(qA).extend(tA).extend(lE);var Gvy=Wr.objectWithoutOptionalProperties({audiences:Wr.list(Wr.string()),sdkName:z8r.optional(),method:EQa,summary:Wr.string().optional(),operationId:Wr.string(),tags:Wr.list(jSe),headers:Wr.list(BDi),generatedPayloadName:Wr.string(),payload:Wr.lazy(()=>j4),examples:Wr.list(SQa)}).extend(By).extend(tA).extend(lE);var Bys=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 Tys=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),example:Wr.number().optional()});var qys=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),example:Wr.number().optional()});var xys=Wr.objectWithoutOptionalProperties({default:Wr.number().optional(),example:Wr.number().optional()});var Nys=Wr.objectWithoutOptionalProperties({example:Wr.number().optional()});var Rys=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 Fys=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 zys=Wr.objectWithoutOptionalProperties({example:Wr.string().optional()});var Qys=Wr.objectWithoutOptionalProperties({example:Wr.string().optional()});var Lys=Wr.objectWithoutOptionalProperties({example:Wr.string().optional()});var Uys=Wr.objectWithoutOptionalProperties({default:Wr.boolean().optional(),example:Wr.boolean().optional()});var Vys=Wr.union("type",{int:Bys,int64:Tys,uint:qys,uint64:xys,float:Nys,double:Rys,string:Fys,datetime:zys,date:Qys,base64:Lys,boolean:Uys}).transform({transform:e=>{switch(e.type){case"int":return Zg.int(e);case"int64":return Zg.int64(e);case"uint":return Zg.uint(e);case"uint64":return Zg.uint64(e);case"float":return Zg.float(e);case"double":return Zg.double(e);case"string":return Zg.string(e);case"datetime":return Zg.datetime(e);case"date":return Zg.date(e);case"base64":return Zg.base64(e);case"boolean":return Zg.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var TQa=Wr.objectWithoutOptionalProperties({schema:Vys}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI);var Wys=Wr.objectWithoutOptionalProperties({default:SDi.optional(),values:Wr.list(SDi),example:Wr.string().optional()}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(tA).extend(iI).extend(w4);var Hys=Wr.objectWithoutOptionalProperties({example:Wr.unknown()}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI);var j4=Wr.union("type",{primitive:TQa,object:Wr.lazyObject(()=>Yys),array:Wr.lazyObject(()=>Gys),map:Wr.lazyObject(()=>Jys),optional:Wr.lazyObject(()=>Kys),enum:Wys,reference:Q8r,literal:DQa,oneOf:Wr.object({value:Wr.lazy(()=>Xys)}),nullable:Wr.lazyObject(()=>$ys),unknown:Hys}).transform({transform:e=>{switch(e.type){case"primitive":return Uh.primitive(e);case"object":return Uh.object(e);case"array":return Uh.array(e);case"map":return Uh.map(e);case"optional":return Uh.optional(e);case"enum":return Uh.enum(e);case"reference":return Uh.reference(e);case"literal":return Uh.literal(e);case"oneOf":return Uh.oneOf(e.value);case"nullable":return Uh.nullable(e);case"unknown":return Uh.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var Gys=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>j4),example:Wr.list(Wr.unknown()).optional()}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI).extend(w4);var Jys=Wr.objectWithoutOptionalProperties({key:TQa,value:Wr.lazy(()=>j4),example:Wr.unknown().optional()}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(_Ne).extend(iI).extend(w4);var Kys=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>j4)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI).extend(w4);var $ys=Wr.objectWithoutOptionalProperties({value:Wr.lazy(()=>j4)}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(iI).extend(w4);var Yys=Wr.objectWithoutOptionalProperties({allOf:Wr.list(Q8r),properties:Wr.list(Wr.lazyObject(()=>Zys)),allOfPropertyConflicts:Wr.list(CQa),fullExamples:Wr.list(qdt).optional(),additionalProperties:Wr.boolean()}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(tA).extend(iI).extend(w4);var Zys=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>j4),readonly:Wr.boolean().optional(),writeonly:Wr.boolean().optional(),audiences:Wr.list(Wr.string()),conflict:Wr.record(wSe,IQa),nameOverride:Wr.string().optional(),generatedName:Wr.string()}).extend(qA);var Xys=Wr.union("type",{discriminated:Wr.lazyObject(()=>kys),undiscriminated:Wr.lazyObject(()=>evs)}).transform({transform:e=>{switch(e.type){case"discriminated":return PSe.discriminated(e);case"undiscriminated":return PSe.undiscriminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var kys=Wr.objectWithoutOptionalProperties({discriminantProperty:Wr.string(),commonProperties:Wr.list(Wr.lazyObject(()=>tvs)),schemas:Wr.record(Wr.string(),Wr.lazy(()=>j4))}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(_Ne).extend(tA).extend(iI).extend(w4);var tvs=Wr.objectWithoutOptionalProperties({key:Wr.string(),schema:Wr.lazy(()=>j4)});var evs=Wr.objectWithoutOptionalProperties({schemas:Wr.list(Wr.lazy(()=>j4))}).extend(aI).extend(lE).extend(YE).extend(By).extend(qA).extend(_Ne).extend(tA).extend(iI).extend(w4);var Jvy=/^(\d+)/,qQa=/^[a-zA-Z][a-zA-Z0-9_]*$/,Kvy={"<":"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 TDi(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 u=Math.floor(e/10),c=e%10;return c===0?n[u]:`${n[u]}_${t[c]}`}if(e<1e3){let u=Math.floor(e/100),c=e%100;return c===0?`${t[u]}_hundred`:`${t[u]}_hundred_${TDi(c)}`}let i=Math.floor(e/1e3),a=e%1e3;return a===0?`${t[i]}_thousand`:`${t[i]}_thousand_${TDi(a)}`}function g4o(e){let t=e.match(Jvy);if(t&&t[0]!=null){let r=t[0],n=e.substring(r.length),i=parseFloat(r);if(!isNaN(i)&&isFinite(i)){let a=TDi(i);return n.length>0?`${a}_${n}`:a}}}function xQa(e){let t=g4o(e),r=Kvy[e];return t!=null?g9(IO(t)):r??(e.toLowerCase()==="n/a"?"NOT_APPLICABLE":g9(IO(e)))}function hNe(e,t){return e.type==="primitive"&&t.type==="primitive"?$vy(e.schema,t.schema):e.type==="enum"&&t.type==="enum"?sMD(e.values,t.values):e.type==="array"&&t.type==="array"?hNe(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"?hNe(e.value,t.value):e.type==="oneOf"&&t.type==="oneOf"?cMD(e.value,t.value):e.type==="object"&&t.type==="object"?lMD(e,t):e.type==="map"&&t.type==="map"?$vy(e.key.schema,t.key.schema)&&hNe(e.value,t.value):e.type==="literal"&&t.type==="literal"?e.value===t.value:!1}function $vy(e,t){return e.type===t.type}function sMD(e,t){let r=new Set(...e.map(i=>i.value)),n=new Set(...t.map(i=>i.value));return Bae(r,n)}function cMD(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:hNe(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:hNe(r,i)}):!1}function lMD(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:hNe(a,i.schema)})}function RH(e){switch(e){case Wle.Deprecated:return"deprecated";case Wle.Beta:return"pre-release";case Wle.GenerallyAvailable:return"generally-available";default:return}}function fMD(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 Yvy(e){let t=e?fMD(e):void 0;if(t==null||t.length===0)return SVi;let r=[];for(let[n,i]of t.entries())if(typeof i=="string")r.push(IO(i));else if(typeof i=="object")switch(i.type){case"namespace":{n<t.length-1?r.push(IO(i.name)):r.push(i.name,SVi);break}default:cc(i.type)}else cc(i);return r.join("/")}function qDi(e){return iP.of(`${Yvy(e)}.yml`)}function muf({sdkName:e,namespaceOverride:t}){let r;return e==null||e.groupName.length===0&&t==null?SVi:(t!=null?r=[{type:"namespace",name:t},...e.groupName.filter(n=>typeof n=="string"||n.type!=="namespace")]:r=e.groupName,Yvy(r))}function Xvy({sdkName:e,namespaceOverride:t}){return iP.of(`${muf({sdkName:e,namespaceOverride:t})}.yml`)}function Zvy({location:e,namespaceOverride:t}){return t!=null?Q$(iP.of(t),e):e}function rvs(e){switch(e.type){case"protobuf":return{proto:{type:e.typeName}};default:cc(e.type)}}function NQa(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:cc(e)}}function wz(e){return typeof e=="string"?e:e.type}function RQa(e){if(typeof e!="string")return e.docs}function m4o(e){if(typeof e!="string")return e.default}function Ouf(e){if(typeof e!="string")return e.validation}var dMD=-2147483648,pMD=2147483647,_MD=-17976931348623157e292,hMD=17976931348623157e292;function FS({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 nvs(e);case"array":return wuf({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"map":return juf({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"reference":return Puf({schema:e,fileContainingReference:t,context:n,namespace:i});case"unknown":return Suf();case"optional":return ivs({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"nullable":return Euf({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"enum":return wMD({schema:e,fileContainingReference:t,context:n,declarationFile:r,declarationDepth:a});case"literal":return e.value,Duf(e);case"object":return jMD({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});case"oneOf":return EMD({schema:e.value,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});default:cc(e)}}function nvs(e){switch(e.schema.type){case"string":return bMD({description:e.description,schema:e.schema});case"int":return gMD({description:e.description,schema:e.schema});case"float":return mMD({description:e.description,schema:e.schema});case"double":return OMD({description:e.description,schema:e.schema});case"boolean":return yMD({description:e.description,schema:e.schema});case"int64":return vMD({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:RH(e.availability)}:{}}}function yMD({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 vMD({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 bMD({description:e,schema:t}){let r="string",n=AMD(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 gMD({description:e,schema:t}){let r="integer",n=eby(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 mMD({description:e,schema:t}){let r="float";if(e==null)return r;let n={type:r};return e!=null&&(n.docs=e),n}function OMD({description:e,schema:t}){let r="double",n=eby(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 AMD(e){if(e==null)return;let{format:t,pattern:r,minLength:n,maxLength:i}=e,a=PMD(t);if(!(a==null&&r==null&&n==null&&i==null))return{format:a,pattern:r,minLength:n,maxLength:i}}function PMD(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 eby(e,t){if(e==null)return;let{minimum:r,maximum:n,multipleOf:i}=e,{exclusiveMinimum:a,exclusiveMaximum:u}=e;if(r=Auf(r,t),n=Auf(n,t),i=Auf(i,t),!(r==null&&n==null&&a==null&&u==null&&i==null))return{min:r,max:n,exclusiveMin:a,exclusiveMax:u,multipleOf:i}}function Auf(e,t){if(e===void 0)return;let[r,n]=t==="integer"?[dMD,pMD]:[_MD,hMD];return e<r||e>n?void 0:e}function Puf({schema:e,fileContainingReference:t,context:r,namespace:n}){let i=r.getSchema(e.schema,n);if(i==null)return"unknown";let a=SMD(i)??e.schema,u=NQa(i),c=DMD(i),p=avs({context:r,fileContainingReference:t,declarationFile:qDi(u),type:a}),s=i.type==="nullable"?`optional<${p}>`:p;return e.description==null&&c==null?s:{type:i.type==="nullable"?`optional<${p}>`:p,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:RH(e.availability)}:{}}}function wuf({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let u=FS({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=`list<${wz(u)}>`;return e.description==null&&e.title==null?c:{...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:RH(e.availability)}:{},type:c}}function juf({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let u=nvs(e.key),c=FS({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),p=e.encoding!=null?rvs(e.encoding):void 0,s=`map<${wz(u)}, ${wz(c)}>`;if(e.description==null&&p==null&&e.title==null)return s;let o={type:s};return e.description!=null&&(o.docs=e.description),e.encoding!=null&&(o.encoding=p),e.availability!=null&&(o.availability=RH(e.availability)),o}function Euf({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){if(!n.respectNullableSchemas)return ivs({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i,declarationDepth:a});let u=FS({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=wz(u),p=RQa(u),s=m4o(u),o=Ouf(u),l=c.startsWith("nullable<")?c:`nullable<${c}>`;if(e.availability==null&&e.description==null&&p==null&&s==null&&o==null&&e.title==null)return kvy({typeReference:l,itemType:c});let O={type:l};return(e.description!=null||p!=null)&&(O.docs=e.description??p),s!=null&&(O.default=s),o!=null&&(O.validation=o),e.availability!=null&&(O.availability=RH(e.availability)),kvy({typeReference:O,itemType:c})}function ivs({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let u=FS({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=wz(u),p=RQa(u),s=m4o(u),o=Ouf(u),l=c.startsWith("optional<")?c:`optional<${c}>`;if(e.availability==null&&e.description==null&&p==null&&s==null&&o==null&&e.title==null)return l;let O={type:l};return(e.description!=null||p!=null)&&(O.docs=e.description??p),s!=null&&(O.default=s),o!=null&&(O.validation=o),e.availability!=null&&(O.availability=RH(e.availability)),O}function Suf(){return"unknown"}function Duf(e){let t;switch(e.value.type){case"boolean":{t=`literal<${e.value.value}>`;break}case"string":{t=`literal<"${e.value.value}">`;break}default:cc(e.value)}return e.description==null&&e.title==null?t:{type:t,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:RH(e.availability)}:{}}}function wMD({schema:e,fileContainingReference:t,declarationFile:r,context:n,declarationDepth:i}){let a=O4o(e,i),u=e.nameOverride??e.generatedName;n.builder.addType(r,{name:u,schema:a.schema});let c=avs({type:u,fileContainingReference:t,declarationFile:r,context:n});if(e.description==null&&e.default==null&&e.title==null)return c;let p={type:c};return e.description!=null&&(p.docs=e.description),e.default!=null&&(p.default=e.default.value),e.availability!=null&&(p.availability=RH(e.availability)),p}function jMD({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let u=Cuf({schema:e,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=e.nameOverride??e.generatedName;n.builder.addType(r,{name:c,schema:u.schema});let p=avs({type:c,fileContainingReference:t,declarationFile:r,context:n});return e.description==null&&e.title==null?p:{type:p,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:RH(e.availability)}:{}}}function EMD({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i,declarationDepth:a}){let u=Iuf({schema:e,declarationFile:r,context:n,namespace:i,declarationDepth:a}),c=e.nameOverride??e.generatedName;n.builder.addType(r,{name:c,schema:u.schema});let p=avs({type:c,fileContainingReference:t,declarationFile:r,context:n});return e.description==null&&e.title==null?p:{...e.title!=null?{"display-name":e.title}:{},type:p,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:RH(e.availability)}:{}}}function avs({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 SMD(e){return $P._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 DMD(e){return $P._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:()=>{}})}function kvy({typeReference:e,itemType:t}){return t.startsWith("optional<")?e:typeof e=="string"?`optional<${e}>`:{...e,type:`optional<${e.type}>`}}var loe;(function(e){e[e.Channel=0]="Channel",e[e.Endpoint=1]="Endpoint",e[e.Request=2]="Request",e[e.Webhook=3]="Webhook"})(loe||(loe={}));function eli(e){switch(e.type){case"openapi":return{openapi:e.file};case"protobuf":return{proto:e.file};default:cc(e)}}function rby({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){let a;switch(e.type){case"primitive":a=MMD(e);break;case"array":a=CMD({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"map":a=IMD({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"reference":a=BMD({schema:e,context:t,declarationFile:r,namespace:n});break;case"unknown":a=qMD(e.nameOverride,e.generatedName);break;case"optional":a=nby({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"nullable":a=TMD({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"enum":a=O4o(e,i);break;case"literal":a=xMD(e,e.nameOverride,e.generatedName);break;case"object":a=Cuf({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;case"oneOf":a=Iuf({schema:e.value,context:t,declarationFile:r,namespace:n,declarationDepth:i});break;default:cc(e)}return a}function Cuf({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){let a=t.isInState(loe.Request)&&t.respectReadonlySchemas&&(t.getEndpointMethod()==="POST"||t.getEndpointMethod()==="PUT"||t.getEndpointMethod()==="PATCH"),u=!1,c={},p=new Set;for(let A of e.properties){if(A.readonly&&(u=!0),a&&A.readonly)continue;if(Object.keys(A.conflict).length>0){if(Object.entries(A.conflict).every(([Q,K])=>!K.differentSchema))continue;Object.entries(A.conflict).forEach(([Q])=>{Muf({property:A.key,schemaId:Q,context:t,namespace:n}).forEach(X=>{p.add(X)})})}let E=FS({schema:A.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1}),C=A.audiences,M=A.nameOverride,q=RH(A.availability),L=zMD(A);c[A.key]=FMD({typeReference:E,audiences:C,name:M,availability:q,propertyAccess:L})}let s=new Set;for(let A of e.allOfPropertyConflicts)A.allOfSchemaIds.forEach(E=>p.add(E)),A.conflictingTypeSignatures&&s.add(A.propertyKey);let o=[];for(let A of e.allOf){let E=iby({schema:A.schema,context:t,namespace:n});if(E==null||p.has(A.schema)||p.has(E))continue;let C=FS({schema:$P.reference(A),context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1});o.push(wz(C))}for(let A of p){let E=Buf(t,A,n);for(let C of E.properties)c[C.key]==null&&(s.has(C.key)&&(c[C.key]="unknown"),c[C.key]=FS({schema:C.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1}));for(let C of E.allOf){if(p.has(C.schema))continue;let M=FS({schema:$P.reference(C),context:t,fileContainingReference:r,namespace:n,declarationDepth:i+1});o.push(wz(M))}}let l={docs:e.description??void 0,properties:Object.fromEntries(Object.entries(c).map(([A,E])=>RMD(A)?[A,typeof E=="string"?{type:E,name:`_${A}`}:{...E,name:`_${A}`}]:[A,E]))};o.length>0&&(l.extends=o),e.additionalProperties&&(l["extra-properties"]=!0),e.availability!=null&&(l.availability=RH(e.availability)),e.source!=null&&(l.source=eli(e.source)),l.inline=Tuf(e,i);let O=e.nameOverride??e.generatedName;return{name:u&&t.respectReadonlySchemas&&!a?`${O}Read`:O,schema:l}}function Muf({property:e,schemaId:t,context:r,namespace:n}){let i=r.getSchema(t,n);if(i==null)return[];if(i.type==="reference")return Muf({property:e,schemaId:i.schema,context:r,namespace:n});if(i.type==="object"){let{properties:a,allOf:u}=Buf(r,t,n),c=a.some(s=>s.key===e),p=[...u.flatMap(s=>Muf({property:e,context:r,schemaId:s.schema,namespace:n}))];if(c||p.length>0)return[t,...p]}return[]}function Buf(e,t,r){let n=e.getSchema(t,r);if(n==null)return{properties:[],allOf:[]};if(n.type==="object")return{properties:n.properties,allOf:n.allOf};if(n.type==="reference")return Buf(e,n.schema,r);throw new Error(`Cannot getAllProperties for a non-object schema. schemaId=${t}, type=${n.type}`)}function CMD({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return{name:e.nameOverride??e.generatedName,schema:wuf({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:n,declarationDepth:i})}}function IMD({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return{name:e.nameOverride??e.generatedName,schema:juf({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:n,declarationDepth:i})}}function MMD(e){let t=nvs(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 tby(e){return e.camel==null&&e.pascal==null&&e.screamingSnake==null&&e.snake==null}function O4o(e,t){let r={enum:e.values.map(a=>{let u=a.nameOverride??a.generatedName,c=a.value;if(u===c&&a.description==null&&(a.casing==null||tby(a.casing)))return u;let p={value:a.value};if(u!==c&&(p.name=u),a.description!=null&&(p.docs=a.description),a.casing!=null&&!tby(a.casing)){let s={},o=!1;a.casing.camel!=null&&(s.camel=a.casing.camel,o=!0),a.casing.screamingSnake!=null&&(s["screaming-snake"]=a.casing.screamingSnake,o=!0),a.casing.snake!=null&&(s.snake=a.casing.snake,o=!0),a.casing.pascal!=null&&(s.pascal=a.casing.pascal,o=!0),o&&(p.casing=s)}return p})};e.description!=null&&(r.docs=e.description),e.default!=null&&(r.default=e.default.value),r.inline=Tuf(e,t);let n=new Set,i={...r,enum:[],source:e.source!=null?eli(e.source):void 0};for(let a of r.enum){let u=typeof a=="string"?a:a.name??a.value;n.has(u.toLowerCase())||(i.enum.push(a),n.add(u.toLowerCase()))}return{name:e.nameOverride??e.generatedName,schema:i}}function BMD({schema:e,context:t,declarationFile:r,namespace:n}){return{name:e.nameOverride??e.generatedName,schema:Puf({schema:e,context:t,fileContainingReference:r,namespace:n})}}function TMD({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return t.respectNullableSchemas?{name:e.nameOverride??e.generatedName,schema:Euf({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:n,declarationDepth:i})}:nby({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i})}function nby({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){return{name:e.nameOverride??e.generatedName,schema:ivs({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:n,declarationDepth:i})}}function qMD(e,t){return{name:e??t,schema:Suf()}}function xMD(e,t,r){return{name:t??r,schema:Duf(e)}}function Iuf({schema:e,context:t,declarationFile:r,namespace:n,declarationDepth:i}){let a=e.encoding!=null?rvs(e.encoding):void 0;if(e.type==="discriminated"){let c={};for(let s of e.commonProperties)c[s.key]=FS({schema:s.schema,fileContainingReference:r,context:t,namespace:n,declarationDepth:i+1});let p={};for(let[s,o]of Object.entries(e.schemas))p[s]=FS({schema:o,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?RH(e.availability):void 0,union:p,encoding:a,source:e.source!=null?eli(e.source):void 0}}}let u=[];for(let c of e.schemas)u.push(FS({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:u,encoding:a,source:e.source!=null?eli(e.source):void 0,inline:Tuf(e,i)}}}var NMD=/^[0-9]/;function RMD(e){return NMD.test(e)}function iby({schema:e,context:t,namespace:r}){let n=t.getSchema(e,r);if(n!=null)return n.type==="reference"?iby({context:t,schema:n.schema,namespace:r}):e}function FMD({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 Tuf(e,t){return e.inline===!0||t>0?!0:void 0}function zMD(e){if(!(e.readonly&&e.writeonly)){if(e.readonly)return G$.ObjectPropertyAccess.ReadOnly;if(e.writeonly)return G$.ObjectPropertyAccess.WriteOnly}}function aby(e){let t=e.replace(/^x-|^X-/,"");return IO(t)}var oby="BasicAuthScheme",ovs="BearerAuthScheme";function uby(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:oby,schema:i}),t||(e.builder.setAuth(oby),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:ovs,schema:i}),t||(e.builder.setAuth(ovs),t=!0)}else if(n.type==="header")if(t)e.builder.addGlobalHeader({name:n.headerName,schema:{type:"string",name:n.headerVariableName??aby(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:ovs,schema:i}),t||(e.builder.setAuth(ovs),t=!0),n.scopesEnum!=null&&n.scopesEnum.values.length>0&&e.builder.addType(iP.of("__package__.yml"),{name:"OauthScope",schema:O4o(n.scopesEnum,0).schema})}}function L8r({header:e,context:t,fileContainingReference:r,namespace:n}){let i=FS({schema:e.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),a=wz(i),u=e.name.replace(/^x-|^X-/,""),c=e.parameterNameOverride!=null?e.parameterNameOverride:IO(u);if(e.description==null&&e.name===c&&e.env==null&&e.availability==null)return a;let p={type:a};return c!==e.name&&(p.name=c),e.description!=null&&(p.docs=e.description),e.env!=null&&(p.env=e.env),e.availability!=null&&(p.availability=RH(e.availability)),p}function uvs({pathParameter:e,context:t,fileContainingReference:r,namespace:n}){let i=FS({schema:e.schema,context:t,fileContainingReference:r,namespace:n,declarationDepth:0});if(e.variableReference==null&&e.description==null&&e.availability==null)return wz(i);let a=e.variableReference!=null?{variable:`$${e.variableReference}`}:{type:wz(i)};return e.description!=null&&(a.docs=e.description),e.availability!=null&&(a.availability=RH(e.availability)),a}function cvs({queryParameter:e,context:t,fileContainingReference:r,namespace:n}){let i=quf({schema:e.schema,context:t,fileContainingReference:r,namespace:n});if(i==null)return;let a=wz(i.value),u=m4o(i.value);a==="unknown"?a="string":a==="optional<unknown>"&&(a="optional<string>");let c={type:a};return u!=null&&(c.default=u),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=RH(e.availability)),QMD(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 quf({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:FS({schema:$P.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:iP.of(Jx),fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0};if(i.type==="oneOf"&&i.value.type==="undiscriminated"){let a=[],u=!1;for(let[c,p]of Object.entries(i.value.schemas))p.type==="primitive"&&p.schema.type==="string"&&(u=!0),p.type==="literal"&&p.value.type==="string"&&(qQa.test(p.value.value)?a.push(p.value.value):a.push({value:p.value.value,name:xQa(p.value.value)}));if(a.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:a}}),u&&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,p]=i.value.schemas;if(c!=null&&p!=null&&svs({array:c,primitive:p}))return{value:FS({schema:$P.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:p,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&&p!=null&&svs({array:c,primitive:p}))return{value:FS({schema:$P.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,p]of Object.entries(i.value.schemas))return quf({schema:p,context:t,fileContainingReference:r,namespace:n})}else if(t.objectQueryParameters)return{value:FS({schema:e,context:t,fileContainingReference:r,declarationFile:iP.of(Jx),namespace:n,declarationDepth:0}),allowMultiple:!1}}if(e.type==="optional"||e.type==="nullable"){if(e.value.type==="reference"){let i=t.getSchema(e.value.schema,n);if(i==null)return;if(i.type==="array")return{value:FS({schema:$P.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:e.inline}),context:t,fileContainingReference:r,declarationFile:iP.of(Jx),namespace:n,declarationDepth:0}),allowMultiple:!0};if(t.objectQueryParameters)return{value:FS({schema:e,context:t,fileContainingReference:r,declarationFile:iP.of(Jx),namespace:n,declarationDepth:0}),allowMultiple:!1}}if(e.value.type==="array")return{value:FS({schema:$P.optional({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 i=[],a=!1;for(let[u,c]of Object.entries(e.value.value.schemas))c.type==="primitive"&&c.schema.type==="string"&&(a=!0),c.type==="literal"&&c.value.type==="string"&&(qQa.test(c.value.value)?i.push(c.value.value):i.push({value:c.value.value,name:xQa(c.value.value)}));if(i.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:i}}),a&&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[u,c]=e.value.value.schemas;if(u!=null&&c!=null&&svs({array:u,primitive:c}))return{value:FS({schema:$P.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:e.inline}),context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!0};if(u!=null&&c!=null&&svs({array:c,primitive:u}))return{value:FS({schema:$P.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:u,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:FS({schema:e,context:t,fileContainingReference:r,declarationFile:iP.of(Jx),namespace:n,declarationDepth:0}),allowMultiple:!1};for(let[u,c]of Object.entries(e.value.value.schemas))return quf({schema:$P.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:c,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:FS({schema:e,context:t,fileContainingReference:r,declarationFile:iP.of(Jx),namespace:n,declarationDepth:0}),allowMultiple:!1}:void 0;return{value:FS({schema:e,context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!1}}return e.type==="array"?{value:FS({schema:$P.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:FS({schema:e,context:t,fileContainingReference:r,namespace:n,declarationDepth:0}),allowMultiple:!1}}function svs({array:e,primitive:t}){return e?.type==="array"&&e.value.type==="primitive"&&t?.type==="primitive"&&e.value.schema.type===t.schema.type}function QMD(e){return e.type!=null}function sby({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"]=LMD(e.queryParameters)),e.headers!=null&&e.headers.length>0&&(r.headers=UMD({context:t,namedFullExamples:e.headers}));for(let n of e.messages){let i=xDi(n.payload);i!=null&&r.messages.push({type:n.messageType,body:i})}return r}function LMD(e){let t={};return e.forEach(r=>{let n=xDi(r.value);Array.isArray(n)?t[r.name]=n[0]:n!=null&&(t[r.name]=n)}),t}function UMD({context:e,namedFullExamples:t}){let r=e.builder.getGlobalHeaderNames(),n={};return t.forEach(i=>{let a=xDi(i.value);r.has(i.name)||a!=null&&(n[i.name]=a)}),n}function xDi(e){switch(e.type){case"primitive":return cby(e.value);case"object":return lby(e.properties);case"array":return VMD(e.value);case"map":return WMD(e.value);case"oneOf":return HMD(e.value);case"enum":return e.value;case"literal":return GMD(e.value);case"unknown":return xDi(e.value);default:cc(e)}}function cby(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:cc(e)}}function lby(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,xDi(r)]))}function VMD(e){return e.map(t=>xDi(t))}function WMD(e){return Object.fromEntries(e.map(t=>[cby(t.key),xDi(t.value)]))}function HMD(e){return e.type==="discriminated"?lby(e.value):xDi(e.value)}function GMD(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:cc(e)}}function tli(e){return e.find(t=>typeof t!="string"&&t.type==="namespace")?.name}function lvs(e,t){return t??(e?.groupName!=null?tli(e.groupName):void 0)}function fby({channel:e,context:t,declarationFile:r}){let n={path:e.path,url:e.servers[0]?.name,auth:!1};e.audiences!=null&&e.audiences.length>0&&(n.audiences=e.audiences),e.summary!=null&&(n["display-name"]=e.summary),e.description!=null&&(n.docs=e.description);let i=tli(e.groupName),a={};if(e.handshake.pathParameters.length>0)for(let p of e.handshake.pathParameters)a[p.name]=uvs({pathParameter:p,context:t,fileContainingReference:r,namespace:i});Object.keys(a).length>0&&(n["path-parameters"]=a);let u={};if(e.handshake.queryParameters.length>0)for(let p of e.handshake.queryParameters){let s=cvs({queryParameter:p,context:t,fileContainingReference:r,namespace:i});s!=null&&(u[p.name]=s)}Object.keys(u).length>0&&(n["query-parameters"]=u);let c={};if(e.handshake.headers.length>0)for(let p of e.handshake.headers){let s=L8r({header:p,context:t,fileContainingReference:r,namespace:i});c[p.name]=s}Object.keys(c).length>0&&(n.headers=c),t.builder.addChannel(r,{channel:n});for(let p of e.messages)t.builder.addChannelMessage(r,{messageId:p.name,message:{origin:p.origin,body:FS({schema:p.body,context:t,fileContainingReference:r,namespace:i,declarationDepth:0})}});for(let p of e.examples){let s=sby({context:t,websocketExample:p});t.builder.addChannelExample(r,{example:s})}}function dby(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="grouped"}var rli="Base",JMD="Default";function l$i(e){return Object.entries(e).reduce((t,[r,n])=>(ret(n)?Object.entries(n.urls).forEach(([i,a])=>{t[i]=a}):t[r]=typeof n=="string"?n:n.url,t),{})}function pby(e){if(e.environmentOverrides!=null){for(let[q,L]of Object.entries(e.environmentOverrides.environments??{}))e.builder.addEnvironment({name:q,schema:L});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(q=>dby(q)),i=e.ir.servers;for(let q of i)if(dby(q)){let L={urls:{}};for(let[U,Q]of Object.entries(q.urls))L.urls[U]=Q.url;q.name&&(t[q.name]=L)}else if("url"in q&&q.url){let L=q.audiences?{url:q.url,audiences:q.audiences}:q.url;if(q.name==null){r.push(L);continue}t[q.name]=L}let a={},u={},c=[];for(let q of e.ir.endpoints)for(let L of q.servers){if(L.url==null&&L.name!=null){a[L.name]||(a[L.name]=[]);continue}if(L.url==null)continue;let U=L.audiences?{url:L.url,audiences:L.audiences}:L.url;if(L.name==null){c.push(U);continue}a[L.name]||(a[L.name]=[]),a[L.name]?.push({url:L.url,audiences:L.audiences}),u[L.name]=U}let p={},s=[];for(let q of e.ir.websocketServers){let L=q.audiences?{url:q.url,audiences:q.audiences}:q.url;if(q.name==null){s.push(L);continue}p[q.name]=L}let o=Object.keys(t).length,l=o>0,O=Object.keys(u).length>0,A=Object.keys(a).some(q=>a[q]?.length===0),E=Object.keys(p).length>0;if(!l&&!O&&E&&e.ir.servers.length===0){for(let[q,L]of Object.entries(p))e.builder.addEnvironment({name:q,schema:L});e.builder.setDefaultEnvironment(Object.keys(p)[0]),e.builder.setDefaultUrl(rli);return}if(c.length>0&&e.logger.error(`Skipping endpoint level servers ${c.map(q=>typeof q=="string"?q:q.url).join(", ")} because x-fern-server-name was not provided.`),!l){let q=e.ir.servers[0]?.url,L=e.ir.servers[0]?.audiences;if(q!=null){let U=L?{url:q,audiences:L}:q;t[JMD]=U}}let C=Object.values(t).map(q=>typeof q=="string"?q:ret(q)?Object.values(q.urls)[0]:q.url),M=r.filter(q=>{let L=typeof q=="string"?q:q.url;return!C.includes(L)});if(M.length>0&&e.logger.error(`Skipping top level servers ${M.map(q=>typeof q=="string"?q:q.url).join(", ")} because x-fern-server-name was not provided.`),n){let q=!0;for(let[L,U]of Object.entries(t))if(e.builder.addEnvironment({name:L,schema:U}),q){if(e.builder.setDefaultEnvironment(L),ret(U)){let Q=Object.keys(U.urls)[0];Q&&e.builder.setDefaultUrl(Q)}q=!1}return}if(!O&&!A){let q=!0;for(let[L,U]of Object.entries(t))if(q){if(E){let Q=typeof U=="string"?U:ret(U)?Object.values(U.urls)[0]:U.url;e.builder.addEnvironment({name:L,schema:{urls:{[rli]:Q??"",...l$i(p)}}})}else e.builder.addEnvironment({name:L,schema:U});e.builder.setDefaultEnvironment(L),q=!1}else if(E){let Q=typeof U=="string"?U:ret(U)?Object.values(U.urls)[0]:U.url;e.builder.addEnvironment({name:L,schema:{urls:{[rli]:Q??"",...l$i(p)}}})}else e.builder.addEnvironment({name:L,schema:U});E&&e.builder.setDefaultUrl(rli)}else if(o===1){let q=Object.keys(t)[0],L=Object.values(t)[0],U=typeof L=="string"?L:ret(L)?Object.values(L.urls)[0]:L.url;e.builder.addEnvironment({name:q,schema:{urls:{[rli]:U??"",...l$i(u),...l$i(p)}}}),e.builder.setDefaultEnvironment(q),e.builder.setDefaultUrl(rli)}else{let q=new Map;for(let L of e.ir.endpoints)for(let U of L.servers)if(U.url!=null&&U.name!=null){q.has(U.name)||q.set(U.name,new Map);let Q=U.url.match(/[-]([a-z0-9]+)\./i)?.[1]?.toLowerCase()||"production",K=q.get(U.name);K&&K.set(Q,U.url)}if(q.size>0){let L=!0;for(let[U,Q]of Object.entries(t)){let K=typeof Q=="string"?Q:ret(Q)?Object.values(Q.urls)[0]:Q.url;if(!K)continue;let X=K.match(/[-]([a-z0-9]+)\./i)?.[1]?.toLowerCase()||"production",te={[rli]:K};for(let[ee,re]of q.entries()){let ue=re.get(X)||re.get("production")||re.values().next().value;ue&&(te[ee]=ue)}E&&Object.assign(te,l$i(p)),Object.keys(te).length>1?e.builder.addEnvironment({name:U,schema:{urls:te}}):e.builder.addEnvironment({name:U,schema:K}),L&&(e.builder.setDefaultEnvironment(U),L=!1)}q.size>0&&e.builder.setDefaultUrl(rli)}else{let L=!0;for(let[U,Q]of Object.entries(t)){if(E||Object.keys(u).length>0){let K=typeof Q=="string"?Q:ret(Q)?Object.values(Q.urls)[0]:Q.url;e.builder.addEnvironment({name:U,schema:{urls:{[rli]:K??"",...l$i(u),...l$i(p)}}})}else e.builder.addEnvironment({name:U,schema:Q});L&&(e.builder.setDefaultEnvironment(U),L=!1)}}}}function fvs(e){return wz(e).startsWith("optional")?e:typeof e=="string"?`optional<${e}>`:{...e,type:`optional<${e.type}>`}}var xuf=class{schema;count=0;constructor(t){this.schema=t}increment(){this.count+=1}},KMD=.75,$MD=new Set("authorization");function _by(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?NQa(n.schema):void 0,u=a!=null?tli(a):void 0,c=iP.of("api.yml");i={name:n.name,env:n.env,type:n.schema!=null?wz(FS({schema:n.schema,context:e,fileContainingReference:u?Q$(iP.of(IO(u)),c):c,namespace:u,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($MD.has(a.name.toLowerCase()))continue;let u=r[a.name];if(u==null){let c=t[a.name],p=L8r({header:{...a,schema:c?.schema??a.schema,name:c?.name??a.name},fileContainingReference:iP.of(rZ),context:e,namespace:void 0});u=new xuf(p),r[a.name]=u}u.increment()}let n=e.ir.endpoints.length*KMD;for(let[i,a]of Object.entries(r)){let u=t[i],c=a.count===e.ir.endpoints.length,p=a.count>=n;u==null&&(c?e.builder.addGlobalHeader({name:i,schema:a.schema}):p&&e.builder.addGlobalHeader({name:i,schema:fvs(a.schema)}))}}}function hby(e){for(let t of e.ir.idempotencyHeaders??[]){let r=t.schema?NQa(t.schema):void 0,n=r!=null?tli(r):void 0,i=L8r({header:{...t,schema:t.schema??$P.primitive({description:void 0,availability:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0,schema:iT.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:iP.of(rZ),context:e,namespace:n});e.builder.addIdempotencyHeader({name:t.header,schema:fvs(i)})}}function JOe(e){switch(e.type){case"primitive":return vby(e.value);case"object":return bby(e.properties);case"array":return gby(e.value);case"map":return XMD(e.value);case"oneOf":return ZMD(e.value);case"enum":return typeof e.value=="string"&&e.value.startsWith("$")?`\\${e.value}`:e.value;case"literal":return kMD(e.value);case"unknown":return JOe(e.value);default:cc(e)}}function yby(e){switch(e.type){case"withStreaming":return e.sse?{stream:YMD(e.events)}:{stream:gby(e.events)};case"withoutStreaming":return{body:JOe(e.value)};default:cc(e)}}function vby(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:cc(e)}}function bby(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,JOe(r)]))}function YMD(e){return e.map(t=>({event:"",data:JOe(t)}))}function gby(e){return e.map(t=>JOe(t))}function XMD(e){return Object.fromEntries(e.map(t=>[vby(t.key),JOe(t.value)]))}function ZMD(e){return e.type==="discriminated"?bby(e.value):JOe(e.value)}function kMD(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:cc(e)}}function mby({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"]=eBD(e.pathParameters)),e.queryParameters!=null&&e.queryParameters.length>0&&(r["query-parameters"]=tBD(e.queryParameters));let n=e.headers!=null&&e.headers.length>0,i=t.builder.getGlobalHeaders(),a=Object.keys(i).length>0,u=new Set(e.headers?.map(c=>c.name)??[]);if(n||a){let c=[];if(e.headers!=null)for(let p of e.headers)p.name!==t.builder.getAuthHeaderName()&&c.push(p);for(let[p,s]of Object.entries(i))if(!u.has(p))if(s!=null&&typeof s=="object"&&s.type!=null){let o=yZ({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}});o!=null&&c.push({name:p,value:RS.literal(PDi.string(o))})}else c.push({name:p,value:RS.primitive(Im.string(p))});r.headers=rBD({context:t,namedFullExamples:c})}return e.request!=null&&(r.request=JOe(e.request)),e.response!=null&&(r.response=yby(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(GP)),r}function eBD(e){let t={};return e.forEach(r=>{let n=JOe(r.value);n!=null&&(t[r.parameterNameOverride??r.name]=n)}),t}function tBD(e){let t={};return e.forEach(r=>{let n=JOe(r.value);Array.isArray(n)?t[r.name]=n[0]:n!=null&&(t[r.name]=n)}),t}function rBD({context:e,namedFullExamples:t}){let r={};return t.forEach(n=>{let i=JOe(n.value);i!=null&&(r[n.name]=i)}),r}function Oby(e){return Gle._visit(e,{get:()=>G$.HttpMethodSchema.Get,post:()=>G$.HttpMethodSchema.Post,put:()=>G$.HttpMethodSchema.Put,patch:()=>G$.HttpMethodSchema.Patch,delete:()=>G$.HttpMethodSchema.Delete,head:()=>G$.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 Aby(e){return e==="POST"||e==="PUT"||e==="PATCH"}function Pby({endpoint:e,declarationFile:t,context:r}){let{nonRequestReferencedSchemas:n}=r.ir,i=[],a=new Set,u=e.path,c=lvs(e.sdkName,e.namespace),p={};for(let M of e.pathParameters)M.parameterNameOverride&&(u=u.replace(M.name,M.parameterNameOverride)),p[M.parameterNameOverride??M.name]=uvs({pathParameter:M,context:r,fileContainingReference:t,namespace:c}),a.add(M.name);let s={};for(let M of e.queryParameters){let q=cvs({queryParameter:M,context:r,fileContainingReference:t,namespace:c});q!=null&&(s[M.name]=q,a.add(M.name))}let o;if(e.pagination!=null)switch(e.pagination.type){case"cursor":o={cursor:e.pagination.cursor,next_cursor:e.pagination.nextCursor,results:e.pagination.results};break;case"offset":o={offset:e.pagination.offset,step:e.pagination.step,results:e.pagination.results,"has-next-page":e.pagination.hasNextPage};break;case"custom":o={type:"custom",results:e.pagination.results};break;default:cc(e.pagination)}let l={path:u,method:Oby(e.method),auth:e.authed,docs:e.description??void 0,pagination:o,source:e.source!=null?eli(e.source):void 0};!oBD({context:r,request:e.request})&&Object.keys(p).length>0&&(l["path-parameters"]=p),e.summary!=null&&(l["display-name"]=e.summary);let O={},A=r.builder.getGlobalHeaderNames(),E=r.builder.getAuthHeaderName();E!=null&&A.add(E);let C=e.headers.filter(M=>!A.has(M.name));for(let M of C){let q=L8r({header:M,context:r,fileContainingReference:t,namespace:c});O[M.name]=q,a.add(typeof q=="string"?M.name:q.name??M.name)}if(e.request!=null){r.setInState(loe.Request);let M=aBD({endpoint:e,context:r,declarationFile:t,request:e.request,generatedRequestName:e.generatedRequestName,requestNameOverride:e.requestNameOverride??void 0,pathParameters:r.inlinePathParameters&&Object.keys(p).length>0?p:void 0,queryParameters:Object.keys(s).length>0?s:void 0,nonRequestReferencedSchemas:Array.from(n),headers:Object.keys(O).length>0?O:void 0,usedNames:a,namespace:c});l.request=M.value,i=[...i,...M.schemaIdsToExclude??[]],r.unsetInState(loe.Request)}else{let M=r.inlinePathParameters&&Object.keys(p).length>0,q=Object.keys(s).length>0,L=Object.keys(O).length>0,U={};(M||q||L)&&(U.name=e.requestNameOverride??e.generatedRequestName),M&&(U["path-parameters"]=p),q&&(U["query-parameters"]=s),L&&(U.headers=O),Object.keys(U).length>0&&(l.request=U)}if(e.response!=null&&e.response._visit({json:M=>{let q=FS({schema:M.schema,context:r,fileContainingReference:t,namespace:c,declarationDepth:0});l.response={docs:M.description??void 0,type:wz(q)},M.statusCode!=null&&(l.response["status-code"]=M.statusCode),M.responseProperty!=null&&(l.response.property=M.responseProperty)},streamingJson:M=>{let q=FS({schema:M.schema,context:r,fileContainingReference:t,namespace:c,declarationDepth:0});l["response-stream"]={docs:M.description??void 0,type:wz(q),format:"json"}},streamingSse:M=>{let q=FS({schema:M.schema,context:r,fileContainingReference:t,namespace:c,declarationDepth:0});l["response-stream"]={docs:M.description??void 0,type:wz(q),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(),q=e.servers[0];q==null?M!=null&&(l.url=M):l.url=q.name??void 0}return e.idempotent&&(l.idempotent=!0),e.availability!=null&&(l.availability=RH(e.availability)),Object.entries(e.errors).forEach(([M,q])=>{let L=q.generatedName,U=iP.of(Jx);r.builder.enableUniqueErrorsPerEndpoint&&(L=`${e.generatedRequestName}${q.generatedName}`,q.schema!=null&&(q.schema.type!=="reference"&&q.schema.type!=="oneOf"?q.schema.generatedName=`${e.generatedRequestName}${q.schema.generatedName}`:q.schema.type==="oneOf"&&(q.schema.value.generatedName=`${e.generatedRequestName}${q.schema.value.generatedName}`)));let Q={"status-code":parseInt(M)},K=Zvy({location:wby,namespaceOverride:c});if(q.schema!=null){let ee=FS({schema:q.schema,context:r,fileContainingReference:K,declarationFile:K,namespace:c,declarationDepth:0});Q.type=wz(ee),Q.docs=q.description}r.builder.addError(K,{name:L,schema:r.isErrorUnknownSchema(parseInt(M))?{...Q,type:"unknown"}:Q}),l.errors==null&&(l.errors=[]);let X=r.builder.addImport({file:t,fileToImport:K});l.errors.push(X!=null?`${X}.${L}`:L),Q.type!=null&&q.examples?.forEach(ee=>{let re={value:JOe(ee.example),name:ee.name,docs:ee.description};r.builder.addErrorExample(K,{name:L,example:re})})}),e.examples.length>0&&(l.examples=nBD({endpointExamples:e.examples,context:r})),e.retries!=null&&(l.retries=iBD({retries:e.retries})),r.ir.hasEndpointsMarkedInternal&&(e.internal==null||!e.internal)?l.audiences=[Nuf,...e.audiences]:e.audiences.length>0&&(l.audiences=e.audiences),{value:l,schemaIdsToExclude:i}}function nBD({endpointExamples:e,context:t}){return e.map(r=>{try{return mby({endpointExample:r,context:t})}catch(n){throw console.error(`Error building endpoint example: ${n}`),n}})}function iBD({retries:e}){if(e!=null)switch(e.type){case"disabled":return{disabled:e.value??void 0};default:cc(e)}}function aBD({endpoint:e,declarationFile:t,context:r,request:n,requestNameOverride:i,generatedRequestName:a,pathParameters:u,queryParameters:c,nonRequestReferencedSchemas:p,headers:s,usedNames:o,namespace:l}){if(n.type==="json"||n.type==="formUrlEncoded"){let O=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"||O!=null&&p.includes(O)){let L=FS({schema:n.schema,fileContainingReference:t,context:r,namespace:l,declarationDepth:0}),U={schemaIdsToExclude:[],value:{body:L}},Q=Object.keys(u??{}).length>0,K=Object.keys(c??{}).length>0,X=Object.keys(s??{}).length>0;return Q&&(U.value["path-parameters"]=u),K&&(U.value["query-parameters"]=c),X&&(U.value.headers=s),(Q||K||X)&&(U.value.name=i??a),n.contentType!=null&&(U.value["content-type"]=n.contentType),n.description!=null&&(U.value.docs=n.description),U}let E=Object.fromEntries(A.properties.filter(L=>L.readonly==null?!0:!(Aby(e.method)&&L.readonly)).map(L=>{let U=FS({schema:L.schema,fileContainingReference:t,context:r,namespace:l,declarationDepth:1}),Q=L.nameOverride??L.key,K=RH(L.availability);if(!o.has(Q)&&L.audiences.length<=0)return o.add(Q),L.nameOverride!=null?[L.key,{type:wz(U),docs:RQa(U),name:L.nameOverride,availability:K}]:[L.key,K?{...typeof U=="string"?{type:U}:U,availability:K}:U];let X={type:wz(U),docs:RQa(U)};return o.has(Q)&&(X.name=L.generatedName),L.audiences.length>0&&(X.audiences=L.audiences),K!=null&&(X.availability=K),o.add(Q),[L.key,X]})),C=A.allOf.map(L=>{let U=FS({schema:$P.reference(L),fileContainingReference:t,context:r,namespace:l,declarationDepth:0});return wz(U)}).filter(L=>L!=="unknown"),M={properties:E};C.length>0&&(M.extends=C),n.additionalProperties&&(M["extra-properties"]=!0);let q={name:i??A.nameOverride??A.generatedName,"path-parameters":u,"query-parameters":c,headers:s,body:M};return n.contentType!=null&&(q["content-type"]=n.contentType),n.description!=null&&(q.docs=n.description),{schemaIdsToExclude:O!=null?[O]:[],value:q}}else if(n.type==="octetStream"){let O={body:"bytes","content-type":n.contentType??l2.APPLICATION_OCTET_STREAM,"query-parameters":c};return c!=null&&(O.name=i??a),n.description!=null&&(O.docs=n.description),{schemaIdsToExclude:[],value:O}}else if(n.type==="multipart"){let O=Object.fromEntries(n.properties.map(A=>{if(A.schema.type==="file"){let E=A.schema.isArray?"list<file>":"file";if(E=A.schema.isOptional?`optional<${E}>`:E,A.description!=null||A.contentType!=null){let C={type:E};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,E]}else{let E=FS({schema:A.schema.value,fileContainingReference:t,context:r,namespace:l,declarationDepth:1});if(A.contentType||A.exploded||A.encoding){let C=typeof E=="string"?{type:E}:E;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"),E=C}return[A.key,E]}}));return{schemaIdsToExclude:n.name==null?[]:[n.name],value:{name:i??n.name??a,"path-parameters":u,"query-parameters":c,headers:s,body:{properties:O},"content-type":l2.MULTIPART_FORM_DATA,...n.description?{docs:n.description}:{}}}}else cc(n)}function oBD({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:cc(t)}}function uBD({location:e,namespaceOverride:t}){return t!=null?{...e,file:Q$(iP.of(t),e.file)}:e}function sBD(e){let t=e.namespace,r=e.tags.filter(p=>p!==t)[0],n=e.operationId;if(n==null)return r!=null?{file:iP.of(`${IO(r)}.yml`),endpointId:e.summary!=null?IO(e.summary):IO(`${e.method}_${e.path.split("/").join("_")}`)}:e.summary!=null?{file:iP.of(Jx),endpointId:IO(e.summary)}:{file:iP.of(Jx),endpointId:IO(`${e.method}_${e.path.split("/").join("_")}`)};if(r==null)return{file:iP.of(Jx),endpointId:n};let i=A4o(r),a=A4o(n);if(Bae(i,a))return{file:iP.of("__package__.yml"),endpointId:r};let u=fBD({operationId:n,tag:r,path:e.path,method:e.method});if(u!=null)return u;let c=[];for(let p=0;p<i.length;++p){let s=i[p];if(s!=null&&s===a[p])c.push(s);else{let o=IO(r);return{file:iP.of(`${o}.yml`),endpointId:n,tag:r}}}if(c.length>=a.length)throw new Error(`Cannot get file for endpoint ${JSON.stringify(e)}`);return{file:iP.of(IO(c.join("_"))+".yml"),endpointId:IO(a.slice(c.length).join("_")),tag:r}}function P4o(e){let t=e.tags[0];if(e.sdkName!=null){let r=muf({sdkName:e.sdkName,namespaceOverride:e.namespace}),n=`${r}.yml`,i=r.toLowerCase()===t?.toLowerCase().replaceAll(" ","");return{file:iP.of(n),endpointId:e.sdkName.methodName,tag:i?t:void 0}}return uBD({namespaceOverride:e.namespace,location:sBD(e)})}function A4o(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=Tct(t),t}var cBD=new RegExp("[^a-zA-Z0-9{}]+"),lBD=new RegExp("[{}]","g");function fBD({operationId:e,tag:t,path:r,method:n}){let a=`${r.split(cBD).join("_").replaceAll(lBD,"_")}_${n.toLowerCase()}`;if(e.endsWith(a))return{file:iP.of(IO(t)+".yml"),endpointId:IO(e.slice(0,-1*a.length)),tag:t}}function jby(e){let t=new Set,{endpoints:r,tags:n}=e.ir,i=[];for(let a of r){let{endpointId:u,file:c,tag:p}=P4o(a),s=c.split(".")[0];s!=null&&t.add(s);let o;if(a.sdkName!=null){let A=e.ir.groups;for(let E of a.sdkName.groupName){let C=typeof E=="string"?E:E.name,M=A[C];if(M==null)break;if(M.summary!=null||M.description!=null){o=A[C];break}}}let l=p==null?void 0:n.tagsById[p];e.setInState(loe.Endpoint),e.setEndpointMethod(a.method);let O=Pby({context:e,endpoint:a,declarationFile:c});e.unsetEndpointMethod(),e.unsetInState(loe.Endpoint),i=[...i,...O.schemaIdsToExclude],e.builder.addEndpoint(c,{name:u,schema:O.value,source:a.source!=null?eli(a.source):void 0}),(l?.id!=null||l?.description!=null)&&e.builder.setServiceInfo(c,{"display-name":o?.summary??l?.id,docs:o?.description??l?.description??void 0})}return{schemaIdsToExclude:i,sdkGroups:t}}function Eby(e){for(let[t,r]of Object.entries(e.ir.variables)){let n=r.groupName!=null?tli(r.groupName):void 0,i=FS({schema:$P.primitive(r),context:e,fileContainingReference:iP.of(Jx),namespace:n,declarationDepth:0});e.builder.addVariable({name:t,schema:{type:wz(i),docs:r.description??void 0}})}}function Sby(e){for(let t of e.ir.webhooks){let r=_BD({webhook:t,context:e});if(r==null)continue;let n=lvs(t.sdkName,t.namespace),i={};for(let u of t.headers)i[u.name]=L8r({header:u,context:e,fileContainingReference:r.file,namespace:n});let a={audiences:t.audiences,method:t.method,"display-name":t.summary??void 0,headers:i,payload:FS({schema:t.payload,context:e,fileContainingReference:r.file,namespace:n,declarationDepth:0}),examples:t.examples!=null?t.examples.map(u=>({docs:u.description,name:u.name,payload:JOe(u.payload)})):void 0};e.builder.addWebhook(r.file,{name:r.endpointId,schema:a}),t.description!=null&&(a.docs=t.description)}}function dBD({location:e,namespaceOverride:t}){if(e!=null)return t!=null?{...e,file:Q$(iP.of(t),e.file)}:e}function pBD({webhook:e,context:t}){let r=e.tags[0],n=e.operationId;if(r==null)return{file:iP.of(Jx),endpointId:n};let i=A4o(r),a=A4o(n);if(Bae(i,a))return{file:iP.of("__package__.yml"),endpointId:r};let u=[];for(let c=0;c<i.length;++c){let p=i[c];if(p!=null&&p===a[c])u.push(p);else{let s=IO(r);return{file:iP.of(`${s}.yml`),endpointId:n,tag:r}}}if(u.length>=a.length){t.logger.warn(`Skipping webhook ${e.operationId} because couldn't compute file location`);return}return{file:iP.of(IO(u.join("_"))+".yml"),endpointId:IO(a.slice(u.length).join("_")),tag:r}}function _BD({webhook:e,context:t}){return e.sdkName!=null?{file:Xvy({sdkName:e.sdkName,namespaceOverride:e.namespace}),endpointId:e.sdkName.methodName}:dBD({namespaceOverride:e.namespace,location:pBD({webhook:e,context:t})})}var hBD=iP.of(Jx);function Cby(e){switch(e.type){case"object":case"primitive":case"enum":case"array":case"map":case"reference":case"literal":case"optional":case"nullable":return Dby({namespace:e.namespace,groupName:e.groupName});case"oneOf":return Dby({namespace:e.value.namespace,groupName:e.value.groupName});case"unknown":return hBD;default:cc(e)}}function Dby({namespace:e,groupName:t}){return e!=null&&t!=null?qDi([{type:"namespace",name:e},...t]):e!=null?qDi([{type:"namespace",name:e}]):qDi(t)}var Nuf="external",wby=iP.of(Jx);function Iby({schemas:e,schemaIdsToExclude:t,namespace:r,context:n}){for(let[i,a]of Object.entries(e)){if(t.includes(i))continue;let u=Cby(a),c=rby({schema:a,context:n,declarationFile:u,namespace:r,declarationDepth:0});if(w1i(c.schema)){let p=wz(c.schema);if(p===(c.name??i)||p===`optional<${c.name??i}>`||p===`optional<nullable<${c.name??i}>>`)continue}n.builder.addType(u,{name:c.name??i,schema:c.schema})}}function Mby(e){e.ir.apiVersion!=null&&e.builder.setApiVersion(e.ir.apiVersion),pby(e),_by(e),hby(e),uby(e),Eby(e),e.ir.basePath!=null&&e.builder.setBasePath(e.ir.basePath),e.ir.hasEndpointsMarkedInternal&&e.builder.addAudience(Nuf);let t=jby(e),r=t.sdkGroups;e.setInState(loe.Webhook),Sby(e),e.unsetInState(loe.Webhook),e.setInState(loe.Channel);for(let i of Object.values(e.ir.channels)){let a=qDi(i.groupName);fby({channel:i,context:e,declarationFile:a})}e.unsetInState(loe.Channel);let n=yBD({context:e,schemaIdsToExcludeFromServices:t.schemaIdsToExclude});Iby({schemas:e.ir.groupedSchemas.rootSchemas,schemaIdsToExclude:n,namespace:void 0,context:e});for(let[i,a]of Object.entries(e.ir.groupedSchemas.namespacedSchemas))Iby({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 yBD({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 w4o=class{context;constructor(t){this.context=t}};var dvs=class e{files={};directories={};getAllFiles(){let t={},r=(n,i)=>{for(let[u,c]of Object.entries(n.files)){let p=i!=null?iP.of(`${i}${"/"}${u}`):iP.of(u);t[p]=c}let a=Object.keys(n.directories).sort();for(let u of a){let c=i!=null?`${i}${"/"}${u}`:u,p=n.directories[u];r(p,c)}};return r(this),t}getOrCreateFile(t){return this.getOrCreateFileRecursive(t.split("/"))}getOrCreateFileRecursive(t){if(t.length===1)return this.files[iP.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 f$i=class{enableUniqueErrorsPerEndpoint;root;rootApiFile;packageMarkerFile={};basePath=void 0;constructor(t){this.enableUniqueErrorsPerEndpoint=t,this.root=new dvs,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 u=this.getOrCreateFile(t);u.service==null&&(u.service={auth:!1,"base-path":"",endpoints:{}}),r!=null&&(u.service.auth=r),n!=null&&(u.service["base-path"]=n),i!=null&&(u.service["display-name"]=i),a!=null&&(u.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 Vzr(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"]))Bby(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(Bby(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??IO((Gct(r)+"/"+KVi(r,{stripExtension:!0})).replaceAll("__package__","root"));if(t===iP.of(rZ))return this.rootApiFile.imports==null&&(this.rootApiFile.imports={}),this.rootApiFile.imports[i]=H7u(Gct(iRa.of(`/${t}`)),iRa.of(`/${r}`)),i;let a=this.getOrCreateFile(t);return a.imports==null&&(a.imports={}),a.imports[i]=H7u(Gct(iRa.of(`/${t}`)),iRa.of(`/${r}`)),i}addType(t,{name:r,schema:n}){if(t===iP.of(rZ))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=>Bae(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=Q$(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:Q$(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,u])=>[a,{...u,path:Q$(r,u.path)}]))})}return{rootApiFile:this.rootApiFile,packageMarkerFile:this.packageMarkerFile,definitionFiles:t}}getOrCreateFile(t){return t===Jx?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 Bby(e){return e?.header!=null}var pvs=class{logger;taskContext;ir;builder;environmentOverrides;authOverrides;globalHeaderOverrides;detectGlobalHeaders;objectQueryParameters;respectReadonlySchemas;respectNullableSchemas;onlyIncludeReferencedSchemas;inlinePathParameters;useBytesForBinaryResponse;respectForwardCompatibleEnums;enableUniqueErrorsPerEndpoint;defaultServerName=void 0;unknownSchema=new Set;referencedSchemaIds;endpointMethod;state=new Set;constructor({taskContext:t,ir:r,options:n,environmentOverrides:i,globalHeaderOverrides:a,authOverrides:u}){this.logger=t.logger,this.taskContext=t,this.ir=r,this.environmentOverrides=i,this.authOverrides=u,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.builder=new f$i(this.enableUniqueErrorsPerEndpoint),r.title!=null&&this.builder.setDisplayName({displayName:r.title});let c={};if(!this.enableUniqueErrorsPerEndpoint)for(let p of r.endpoints)for(let[s,o]of Object.entries(p.errors)){let l=parseInt(s),O=c[l];O==null&&o.schema!=null?c[l]=o.schema:O!=null&&o.schema!=null&&hNe(O,o.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}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(loe.Channel,loe.Endpoint,loe.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:cc(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:cc(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 Ruf(e){let t=new pvs(e);return Mby(t)}var _vs=class{args;constructor(t){this.args=t}convert({context:t,ir:r,settings:n,absoluteFilePath:i}){let a=Ruf({taskContext:t,ir:r,options:p4o({overrides:{...n,respectReadonlySchemas:n?.respectReadonlySchemas??this.args.respectReadonlySchemas,respectNullableSchemas:n?.respectNullableSchemas??this.args.respectNullableSchemas,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}}),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:lg.dump(a.rootApiFile)},namedDefinitionFiles:{...Rb(a.definitionFiles,u=>({absoluteFilepath:i??this.args.absoluteFilePath,rawContents:lg.dump(u),contents:u})),[iP.of(Jx)]:{absoluteFilepath:i??this.args.absoluteFilePath,rawContents:lg.dump(a.packageMarkerFile),contents:a.packageMarkerFile}},packageMarkers:{},importedDefinitions:{}}}};var j4o=class extends mCr{inlinePathParameters;objectQueryParameters;onlyIncludeReferencedSchemas;respectReadonlySchemas;respectNullableSchemas;exampleGeneration;useBytesForBinaryResponse;respectForwardCompatibleEnums;inlineAllOfSchemas;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.exampleGeneration=t.exampleGeneration,this.useBytesForBinaryResponse=t.useBytesForBinaryResponse,this.respectForwardCompatibleEnums=t.respectForwardCompatibleEnums,this.inlineAllOfSchemas=t.inlineAllOfSchemas,this.converter=new _vs(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 Let({absoluteFilePath:this.absoluteFilePath,workspaceName:this.workspaceName,generatorsConfiguration:this.generatorsConfiguration,dependenciesConfiguration:{dependencies:{}},definition:n,cliVersion:this.cliVersion})}};var mye={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 FQa={of(e){return e}};var Tby={properties:{"stream-condition":{type:"string"},response:"Schema","response-stream":"Schema"},required:["stream-condition","response","response-stream"],extensionsPrefix:"x-"},Fuf={id:"",typeExtension:{oas3:e=>({...e,XFernStreaming:Tby,Operation:{...e.Operation,properties:{...e.Operation?.properties,"x-fern-streaming":"XFernStreaming"}}})}},Gv={SOURCE:FQa.of("source"),SDK_NAMESPACE:FQa.of("x-fern-sdk-namespace"),SDK_METHOD_NAME:FQa.of("x-fern-sdk-method-name"),SDK_GROUP_NAME:FQa.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:FQa.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 BJ={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,groupMultiApiEnvironments:!1};function xdt({options:e,overrides:t}){return{disableExamples:t?.disableExamples??BJ.disableExamples,discriminatedUnionV2:t?.discriminatedUnionV2??e?.discriminatedUnionV2??BJ.discriminatedUnionV2,useTitlesAsName:t?.useTitlesAsName??e?.useTitlesAsName??BJ.useTitlesAsName,audiences:t?.audiences??e?.audiences??BJ.audiences,optionalAdditionalProperties:t?.optionalAdditionalProperties??e?.optionalAdditionalProperties??BJ.optionalAdditionalProperties,coerceEnumsToLiterals:t?.coerceEnumsToLiterals??e?.coerceEnumsToLiterals??BJ.coerceEnumsToLiterals,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??BJ.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??BJ.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??BJ.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??BJ.inlinePathParameters,preserveSchemaIds:t?.preserveSchemaIds??BJ.preserveSchemaIds,shouldUseUndiscriminatedUnionsWithLiterals:t?.shouldUseUndiscriminatedUnionsWithLiterals??e?.shouldUseUndiscriminatedUnionsWithLiterals??BJ.shouldUseUndiscriminatedUnionsWithLiterals,shouldUseIdiomaticRequestNames:t?.shouldUseIdiomaticRequestNames??e?.shouldUseIdiomaticRequestNames??BJ.shouldUseIdiomaticRequestNames,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??BJ.objectQueryParameters,filter:t?.filter??e?.filter??BJ.filter,asyncApiNaming:t?.asyncApiNaming??e?.asyncApiNaming??BJ.asyncApiNaming,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??BJ.useBytesForBinaryResponse,exampleGeneration:t?.exampleGeneration??e?.exampleGeneration??void 0,defaultFormParameterEncoding:t?.defaultFormParameterEncoding??e?.defaultFormParameterEncoding??void 0,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??BJ.respectForwardCompatibleEnums,additionalPropertiesDefaultsTo:t?.additionalPropertiesDefaultsTo??e?.additionalPropertiesDefaultsTo??BJ.additionalPropertiesDefaultsTo,typeDatesAsStrings:t?.typeDatesAsStrings??e?.typeDatesAsStrings??BJ.typeDatesAsStrings,preserveSingleSchemaOneOf:t?.preserveSingleSchemaOneOf??e?.preserveSingleSchemaOneOf??BJ.preserveSingleSchemaOneOf,inlineAllOfSchemas:t?.inlineAllOfSchemas??e?.inlineAllOfSchemas??BJ.inlineAllOfSchemas,groupMultiApiEnvironments:t?.groupMultiApiEnvironments??e?.groupMultiApiEnvironments??BJ.groupMultiApiEnvironments}}var qby={naming:"v1"};function wy(e,t){let r=Array.isArray(t)?t:[t];for(let n of r){let i=e[n];if(i!=null)return i}}function E4o(e,t,r,n,i=[]){try{let a=wy(e,t);if(a!=null)return r.parse(a)}catch{let u=Tct(i).join(" -> ");n.error(`${u.length>0?`${u}: `:""}Failed to parse ${t}`)}}function d$i(e){let t=wy(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 xby({schema:e,logger:t}){return wy(e,Gv.ENCODING)??void 0}function Nby(e){return wy(e,Gv.FERN_ENUM)}function Rby({nameOverride:e,generatedName:t,title:r,schema:n,description:i,availability:a}){let u=wy(n,Gv.SDK_NAMESPACE),c=wy(n,Gv.SDK_GROUP_NAME),p=wy(n,Gv.TYPE_DEFINITION);if(p!=null)return S4o({fernType:p,nameOverride:e,generatedName:t,title:r,description:i,availability:a,namespace:u,groupName:typeof c=="string"?[c]:c})}function S4o({fernType:e,nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c}){return yZ({type:e,_default:void 0,validation:void 0,visitor:{primitive:p=>{switch(p.v1){case"BASE_64":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.base64({example:void 0})});case"BOOLEAN":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.boolean({default:void 0,example:void 0})});case"DATE":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.date({example:void 0})});case"DATE_TIME":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.datetime({example:void 0})});case"FLOAT":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.float({example:void 0})});case"DOUBLE":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.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 Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.uint({default:void 0,example:void 0})});case"INTEGER":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.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 Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.uint64({default:void 0,example:void 0})});case"LONG":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.int64({default:void 0,example:void 0})});case"STRING":case"UUID":case"BIG_INTEGER":return Uh.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,schema:Zg.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})});default:cc(p.v1)}},unknown:()=>Uh.unknown({nameOverride:t,generatedName:r,title:n,example:void 0,description:i,availability:a,namespace:u,groupName:c}),map:({keyType:p,valueType:s})=>p?.type==="primitive"&&s!=null?Uh.map({nameOverride:t,generatedName:r,title:n,key:p,value:s,description:i,availability:a,namespace:u,groupName:c,encoding:void 0,example:void 0,inline:void 0}):void 0,list:p=>p!=null?Uh.array({nameOverride:t,generatedName:r,title:n,value:p,description:i,availability:a,namespace:u,groupName:c,example:void 0,inline:void 0}):void 0,optional:p=>p!=null?Uh.optional({nameOverride:t,generatedName:r,title:n,value:p,description:i,availability:a,namespace:u,groupName:c,inline:void 0}):void 0,nullable:p=>p!=null?Uh.nullable({nameOverride:t,generatedName:r,title:n,value:p,description:i,availability:a,namespace:u,groupName:c,inline:void 0}):void 0,set:p=>p!=null?Uh.array({nameOverride:t,generatedName:r,title:n,value:p,description:i,availability:a,namespace:u,groupName:c,example:void 0,inline:void 0}):void 0,literal:p=>Uh.literal({nameOverride:t,generatedName:r,title:n,value:p._visit({string:s=>JL.string(s),boolean:s=>JL.boolean(s),_other:()=>{throw new Error("Unexpected literal type")}}),description:i,availability:a,namespace:u,groupName:c}),named:p=>Uh.reference({schema:p,nameOverride:t,generatedName:r,title:n,description:i,availability:a,namespace:u,groupName:c,source:HOe.openapi({file:"<memory>"})})}})}function Fby(e){let t=wy(e,Gv.SOURCE);if(t!=null)return t.endsWith(".proto")?HOe.protobuf({file:t}):HOe.openapi({file:t})}function p$i(e){if(e!=null&&typeof e=="boolean")return e}function Ig(e){return e?.$ref!=null}function zby({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,additionalProperties:i,description:a,availability:u,wrapAsNullable:c,context:p,namespace:s,groupName:o,example:l,encoding:O,source:A}){return i===void 0&&(i=p.options.additionalPropertiesDefaultsTo),typeof i=="boolean"||zQa(i,p.options)?hvs({nameOverride:e,generatedName:t,title:r,wrapAsNullable:c,description:a,availability:u,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:Zg.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:Uh.unknown({nameOverride:void 0,generatedName:`${t}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,namespace:void 0,groupName:void 0}),namespace:s,groupName:o,example:l,encoding:O}):hvs({nameOverride:e,generatedName:t,title:r,wrapAsNullable:c,description:a,availability:u,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:Zg.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:Qby(E1(i,p.options.optionalAdditionalProperties?c:!1,p,[...n,"Value"],A,s,void 0,void 0,void 0)),namespace:s,groupName:o,example:l,encoding:O})}function Qby(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=Qby(e.value);break;case"oneOf":e.value.inline=!0;break;default:cc(e)}return e}function hvs({nameOverride:e,generatedName:t,title:r,keySchema:n,valueSchema:i,wrapAsNullable:a,description:u,availability:c,namespace:p,groupName:s,example:o,encoding:l}){return a?Uh.nullable({nameOverride:e,generatedName:t,title:r,value:Uh.map({nameOverride:e,generatedName:t,title:r,description:u,availability:n.availability,key:n,value:i,namespace:p,groupName:s,encoding:l,example:o,inline:void 0}),description:u,availability:c,namespace:p,groupName:s,inline:void 0}):Uh.map({nameOverride:e,generatedName:t,title:r,description:u,availability:c,key:n,value:i,namespace:p,groupName:s,encoding:l,example:o,inline:void 0})}function zQa(e,t){return e==null?t.additionalPropertiesDefaultsTo:typeof e=="boolean"?e:!Ig(e)&&Object.keys(e).length===0}function Lby({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,item:i,description:a,availability:u,wrapAsNullable:c,context:p,namespace:s,groupName:o,example:l,source:O}){let A=i==null?Uh.unknown({nameOverride:e,generatedName:t,title:r,description:void 0,availability:void 0,example:void 0,namespace:s,groupName:o}):E1(i,!1,p,[...n,"Item"],O,s);return vBD({nameOverride:e,generatedName:t,title:r,namespace:s,groupName:o,itemSchema:A,wrapAsNullable:c,description:a,availability:u,example:l})}function vBD({nameOverride:e,generatedName:t,title:r,itemSchema:n,wrapAsNullable:i,description:a,availability:u,namespace:c,groupName:p,example:s}){return i?Uh.nullable({nameOverride:e,generatedName:t,title:r,value:Uh.array({nameOverride:e,generatedName:t,title:r,value:n,description:a,availability:u,namespace:c,groupName:p,example:s,inline:void 0}),description:a,availability:u,namespace:c,groupName:p,inline:void 0}):Uh.array({nameOverride:e,generatedName:t,title:r,value:n,description:a,availability:u,namespace:c,groupName:p,example:s,inline:void 0})}function KOe(e){switch(wy(e,Gv.AVAILABILITY)){case"deprecated":return Wle.Deprecated;case"beta":return Wle.Beta;case"generally-available":return Wle.GenerallyAvailable;default:break}if(!Ig(e)&&e.deprecated)return Wle.Deprecated}function zuf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,availability:u,required:c,wrapAsNullable:p,discriminator:s,context:o,namespace:l,groupName:O,encoding:A,source:E}){let C=s.propertyName,M=Object.fromEntries(Object.entries(s.mapping??{}).map(([L,U])=>{let Q=nli({$ref:U},!1,o,[U],A,E,l);return o.markReferencedByDiscriminatedUnion({$ref:U},C,1),[L,Q]})),q=Object.entries(i).filter(([L])=>L!==C).map(([L,U])=>{let Q=c!=null&&c.includes(L),K=E1(U,!Q,o,[...n,L],E,l);return{key:L,schema:K}});return Uby({nameOverride:e,generatedName:t,title:r,wrapAsNullable:p,properties:q,description:a,availability:u,discriminant:C,subtypes:M,namespace:l,groupName:O,source:E})}function Quf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,availability:u,required:c,wrapAsNullable:p,discriminant:s,variants:o,context:l,namespace:O,groupName:A,encoding:E,source:C}){let M=Object.fromEntries(Object.entries(o).map(([L,U])=>{if(Ig(U)){let Q=nli(U,!1,l,[U.$ref],E,C,O);return l.markReferencedByDiscriminatedUnion(U,s,1),[L,Q]}else{let Q=QQa(U,!1,l,[...n,L],E,C,O,new Set([s]));return[L,Q]}})),q=Object.entries(i).filter(([L])=>L!==s).map(([L,U])=>{let Q=c!=null&&c.includes(L),K=E1(U,!Q,l,[...n,L],C,O);return{key:L,schema:K}});return Uby({nameOverride:e,generatedName:t,title:r,wrapAsNullable:p,properties:q,description:a,availability:u,discriminant:s,subtypes:M,namespace:O,groupName:A,source:C})}function Uby({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,properties:i,description:a,availability:u,discriminant:c,subtypes:p,namespace:s,groupName:o,source:l}){return n?Uh.nullable({nameOverride:e,generatedName:t,title:r,value:Uh.oneOf(PSe.discriminated({description:a,availability:u,discriminantProperty:c,nameOverride:e,generatedName:t,title:r,schemas:p,commonProperties:i,namespace:s,groupName:o,encoding:void 0,source:l,inline:void 0})),namespace:s,groupName:o,description:a,availability:u,inline:void 0}):Uh.oneOf(PSe.discriminated({description:a,availability:u,discriminantProperty:c,nameOverride:e,generatedName:t,title:r,schemas:p,commonProperties:i,namespace:s,groupName:o,encoding:void 0,source:l,inline:void 0}))}function Vby(e){if(e.proto!=null)return aQa.protobuf({typeName:e.proto.type})}function NDi({nameOverride:e,generatedName:t,title:r,fernEnum:n,enumVarNames:i,enumValues:a,_default:u,description:c,availability:p,wrapAsNullable:s,namespace:o,groupName:l,context:O,source:A,inline:E}){let C=gBD(i??[]),M=new Set(a),q=Array.from(M).map((U,Q)=>{let K=n?.[U],X=C[Q],te=qQa.test(U),ee=K?.name??X,re=te?U:xQa(U);return ee!=null&&!qQa.test(ee)&&(O?.logger.warn(`Enum name override ${ee} is not a valid name. Falling back on ${re}.`),ee=void 0),{nameOverride:ee,generatedName:re,value:U,description:K?.description,availability:p,casing:{snake:K?.casing?.snake??void 0,pascal:K?.casing?.pascal??void 0,screamingSnake:K?.casing?.screamingSnake??void 0,camel:K?.casing?.camel??void 0}}}),L=u!=null?q.find(U=>U.value===u):void 0;return bBD({wrapAsNullable:s,nameOverride:e,generatedName:t,title:r,values:q,_default:L,description:c,availability:p,namespace:o,groupName:l,source:A,inline:E})}function bBD({wrapAsNullable:e,nameOverride:t,generatedName:r,title:n,values:i,_default:a,description:u,availability:c,namespace:p,groupName:s,source:o,inline:l}){return e?Uh.nullable({nameOverride:t,generatedName:r,title:n,value:Uh.enum({nameOverride:t,generatedName:r,title:n,values:i,description:u,default:a,availability:c,example:void 0,namespace:p,groupName:s,source:o,inline:l}),description:u,availability:c,namespace:p,groupName:s,inline:l}):Uh.enum({nameOverride:t,generatedName:r,title:n,values:i,description:u,availability:c,default:a,example:void 0,namespace:p,groupName:s,source:o,inline:l})}function gBD(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 Wby({nameOverride:e,generatedName:t,title:r,format:n,_default:i,minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:p,multipleOf:s,description:o,availability:l,wrapAsNullable:O,example:A,namespace:E,groupName:C}){return n==="int64"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.int64({default:i,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="uint32"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.uint({default:i,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="uint64"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.uint64({default:i,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.int({default:i,minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:p,multipleOf:s,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C})}function Hby(e){return typeof e=="string"?JL.string(e):typeof e=="boolean"?JL.boolean(e):JL.string(`${e}`)}function Gby({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,value:i,description:a,availability:u,namespace:c,groupName:p}){return n?Uh.nullable({nameOverride:e,generatedName:t,title:r,value:Uh.literal({nameOverride:e,generatedName:t,title:r,value:Hby(i),description:a,availability:u,namespace:c,groupName:p}),description:a,availability:u,namespace:c,groupName:p,inline:void 0}):Uh.literal({nameOverride:e,generatedName:t,title:r,value:Hby(i),description:a,availability:u,namespace:c,groupName:p})}function Luf({nameOverride:e,generatedName:t,title:r,format:n,_default:i,minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:p,multipleOf:s,description:o,availability:l,wrapAsNullable:O,example:A,namespace:E,groupName:C}){return n==null||n==="double"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.double({default:i,minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:p,multipleOf:s,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="float"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.float({example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="int32"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.int({default:i,minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:p,multipleOf:s,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="int64"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.int64({default:i,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="uint32"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.uint({default:i,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="uint64"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.uint64({default:i,example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):n==="time-delta"?foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.float({example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C}):foe({nameOverride:e,generatedName:t,title:r,primitive:Zg.float({example:A}),wrapAsNullable:O,description:o,availability:l,namespace:E,groupName:C})}var mBD={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="schemas",applyStrategy:e=>{let t=[e[3]??""];return{refUnderProcessing:e.slice(4),newBreadcrumbs:t}}},OBD={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}}},ABD={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}}},PBD={isApplicable:e=>e[0]==="properties",applyStrategy:e=>{let t=[e[1]??""];return{refUnderProcessing:e.slice(2),newBreadcrumbs:t}}},wBD={isApplicable:e=>e[0]==="items",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},jBD={isApplicable:e=>e[0]==="allOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},EBD={isApplicable:e=>e[0]==="anyOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},SBD={isApplicable:e=>e[0]==="oneOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})};function yvs(e){let t=e.split("/").map(a=>a.replace(/~1/g,"/")),r=[],n=[mBD,OBD,ABD,PBD,wBD,jBD,EBD,SBD],i;do{i=t;for(let a of n)if(a.isApplicable(t)){let{refUnderProcessing:u,newBreadcrumbs:c}=a.applyStrategy(t);t=u,r=[...r,...c]}}while(t.join("")!==i.join(""));return r}function doe(e,t){let n=e.map(i=>/^[^a-zA-Z0-9]+$/.test(i)?i:g9(IO(i))).join("");return/^\d/.test(n)?g4o(n)??n:n}function Uuf(e){let t=e.join("_");return IO(t)}function b6(e){switch(e.type){case"object":return $P.object({allOf:e.allOf,properties:e.properties.map(t=>CBD(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 $P.array({description:e.description,availability:e.availability,value:b6(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"enum":return $P.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 $P.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 $P.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:b6(e.value),namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"optional":return $P.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:b6(e.value),namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"primitive":return $P.primitive({description:e.description,availability:e.availability,schema:Jby(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"map":return $P.map({description:e.description,availability:e.availability,key:$P.primitive({description:e.key.description,availability:e.key.availability,schema:Jby(e.key.schema),generatedName:e.key.generatedName,title:e.key.title,nameOverride:e.key.nameOverride,namespace:e.namespace,groupName:e.groupName}),value:b6(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 $P.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 $P.oneOf(DBD(e.value));case"unknown":return $P.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName});default:cc(e)}}function DBD(e){switch(e.type){case"discriminated":return N8r.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:b6(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,b6(r)])),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:e.inline});case"undiscriminated":return N8r.undiscriminated({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schemas:e.schemas.map(t=>b6(t)),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:e.inline});default:cc(e)}}function Jby(e){switch(e.type){case"string":return iT.string(e);case"base64":return iT.base64();case"boolean":return iT.boolean(e);case"date":return iT.date();case"datetime":return iT.datetime();case"double":return iT.double(e);case"float":return iT.float();case"int":return iT.int(e);case"int64":return iT.int64(e);case"uint":return iT.uint();case"uint64":return iT.uint64();default:cc(e)}}function CBD(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:b6(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability,readonly:e.readonly,writeonly:e.writeonly}}function vvs(e,t){return hNe(b6(e),b6(t))}function Kby({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,required:u,wrapAsNullable:c,allOf:p,context:s,propertiesToExclude:o,namespace:l,groupName:O,fullExamples:A,additionalProperties:E,availability:C,source:M}){let q=[...u??[]],L={...i},U=[],Q=[];for(let re of p)if(!s.options.inlineAllOfSchemas&&Ig(re)){let ue=s.resolveSchemaReference(re);if(ue.discriminator!=null&&ue.discriminator.mapping!=null)continue;if(ue.oneOf!=null||ue.anyOf!=null){let Oe=ue.oneOf??ue.anyOf;if(Oe!=null){for(let Ee of Oe){let Pe=Ig(Ee)?s.resolveSchemaReference(Ee):Ee,Ce=E1(Pe,!1,s.DUMMY,n,M,l);Ce.type==="object"&&U.push(...Ce.properties.map(Ue=>Ue.schema.type!=="optional"&&Ue.schema.type!=="nullable"?{...Ue,schema:Uh.optional({nameOverride:void 0,generatedName:"",title:void 0,value:Ue.schema,description:void 0,availability:Ue.availability,namespace:void 0,groupName:void 0,inline:void 0})}:Ue))}continue}}let me=RDi(re);if(me==null)continue;Q.push({schemaId:me,convertedSchema:Vuf(re,[me],M,s.options.preserveSchemaIds),properties:$by({schema:re,context:s,breadcrumbs:n,source:M,namespace:l})}),s.markSchemaAsReferencedByNonRequest(me)}else if(Ig(re)){let ue=s.resolveSchemaReference(re),me=E1(ue,!1,s,n,M,l);me.type==="object"&&U.push(...me.properties)}else{let ue=re.required??[];U=U.map(Oe=>(Oe.schema.type==="optional"||Oe.schema.type==="nullable")&&ue.includes(Oe.key)?{...Oe,schema:Oe.schema.value}:Oe);let me=E1(re,!1,s,n,M,l);me.type==="object"&&U.push(...me.properties)}let K={};for(let re of Q)for(let[ue,me]of Object.entries(re.properties)){let Oe=K[ue];Oe!=null?(Oe.schemaIds.push(re.schemaId),Oe.schemas.some(Pe=>vvs(Pe,me))||Oe.schemas.push(me)):K[ue]={schemaIds:[re.schemaId],schemas:[me]}}let X=[];for(let[re,ue]of Object.entries(K))ue.schemaIds.length>1&&X.push({propertyKey:re,allOfSchemaIds:ue.schemaIds,conflictingTypeSignatures:ue.schemas.length>1});let te=Object.fromEntries(Object.entries(L).filter(([re,ue])=>!(!Ig(ue)&&ue.type==="null"))),ee=Object.entries(te).map(([re,ue])=>{let me=wy(ue,Gv.AUDIENCES)??[],Oe=KOe(ue),Ee=Ig(ue)?!1:ue.readOnly,Pe=Ig(ue)?!1:ue.writeOnly,Ce=q.includes(re)&&!Ee,Ue=wy(ue,Gv.FERN_PROPERTY_NAME),Be=[...n,re],Bt=Uuf(Be),Qt=Ce?E1(ue,!1,s,Be,M,l):Uh.optional({nameOverride:e,generatedName:Bt,title:r,description:void 0,availability:Oe,value:E1(ue,!1,s,Be,M,l),namespace:l,groupName:O,inline:void 0}),Ke={};for(let ze of Q){let Dr=ze.properties[re];Dr!=null&&!vvs(Qt,Dr)?Ke[ze.schemaId]={differentSchema:!0}:Dr!=null&&(Ke[ze.schemaId]={differentSchema:!1})}return{key:re,schema:Qt,nameOverride:Ue,audiences:me,conflict:Ke,generatedName:Uuf([...n,re]),availability:Oe,readonly:Ee,writeonly:Pe}});return ee.push(...U.map(re=>{let ue=re.conflict;for(let me of Q){let Oe=me.properties[re.key];Oe!=null&&!vvs(re.schema,Oe)?ue[me.schemaId]={differentSchema:!0}:Oe!=null&&(ue[me.schemaId]={differentSchema:!1})}return{...re,conflict:ue}})),IBD({nameOverride:e,generatedName:t,title:r,wrapAsNullable:c,properties:ee.filter(re=>!o.has(re.key)),description:a,allOf:Q.map(re=>re.convertedSchema),allOfPropertyConflicts:X,namespace:l,groupName:O,fullExamples:A,additionalProperties:E,availability:C,source:M,context:s})}function IBD({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,properties:i,description:a,allOf:u,allOfPropertyConflicts:c,namespace:p,groupName:s,fullExamples:o,additionalProperties:l,availability:O,source:A,context:E}){return n?Uh.nullable({nameOverride:e,generatedName:t,title:r,value:Uh.object({description:a,properties:i,nameOverride:e,generatedName:t,title:r,allOf:u,allOfPropertyConflicts:c,namespace:p,groupName:s,fullExamples:o,additionalProperties:zQa(l,E.options),availability:void 0,source:A,inline:void 0}),description:a,availability:O,namespace:p,groupName:s,inline:void 0}):Uh.object({description:a,properties:i,nameOverride:e,generatedName:t,title:r,allOf:u,allOfPropertyConflicts:c,namespace:p,groupName:s,fullExamples:o,additionalProperties:zQa(l,E.options),availability:O,source:A,inline:void 0})}function $by({schema:e,context:t,breadcrumbs:r,source:n,namespace:i}){let a={},[u,c]=Ig(e)?[t.resolveSchemaReference(e),yvs(e.$ref)]:[e,r];for(let p of u.allOf??[])a={...a,...$by({schema:p,context:t,breadcrumbs:c,source:n,namespace:i})};for(let[p,s]of Object.entries(u.properties??{})){let o=E1(s,!1,t,[...c,p],n,i);a[p]=o}return a}function FDi({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,description:i,availability:a,wrapAsNullable:u,context:c,subtypes:p,namespace:s,groupName:o,encoding:l,source:O,subtypePrefixOverrides:A}){let E=TBD({schemas:p}),C=p.flatMap((q,L)=>{if(!Ig(q)&&q.enum!=null&&c.options.coerceEnumsToLiterals&&q.type==="string")return q.enum.map(Q=>Uh.literal({nameOverride:void 0,generatedName:doe([t,Q],c.options.preserveSchemaIds),title:void 0,value:JL.string(String(Q)),namespace:s,groupName:void 0,description:void 0,availability:Q.availability}));let U=E[L];if(A!=null){let Q=A[L];Q!=null&&"name"in Q&&(U=Q.name)}return[E1(q,!1,c,[...n,U??`${L}`],O,s)]}),M=MBD(C);return BBD({uniqueSubtypes:M,nameOverride:e,generatedName:t,title:r,wrapAsNullable:u,description:i,availability:a,namespace:s,groupName:o,context:c,encoding:l,source:O})}function MBD(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 u=e[a];if(n!=null&&u!=null&&hNe(n,u)){i=!0;break}}n!=null&&!i&&t.push(n)}return t}function BBD({uniqueSubtypes:e,nameOverride:t,generatedName:r,title:n,wrapAsNullable:i,description:a,availability:u,namespace:c,groupName:p,context:s,encoding:o,source:l}){if(Object.entries(e).every(([A,E])=>E.type==="literal")){let A={},E=[];return Object.entries(e).forEach(([C,M])=>{M.type==="literal"&&M.value.type==="string"&&(E.push(M.value.value),M.description!=null&&(A[M.value.value]={description:M.description}))}),NDi({nameOverride:t,generatedName:r,title:n,wrapAsNullable:i,description:a,availability:u,fernEnum:A,enumVarNames:void 0,enumValues:E,_default:void 0,namespace:c,groupName:p,context:s,source:l,inline:void 0})}return e.length===1&&e[0]!=null&&!s.options.preserveSingleSchemaOneOf?e[0]:Yby({nameOverride:t,generatedName:r,title:n,wrapAsNullable:i,description:a,availability:u,subtypes:e,namespace:c,groupName:p,encoding:o,source:l})}function Wuf({nameOverride:e,generatedName:t,title:r,description:n,availability:i,wrapAsNullable:a,context:u,namespace:c,groupName:p,discriminator:s,encoding:o,source:l}){let O=Object.entries(s.mapping??{}).map(([C,M],q)=>{let L={$ref:M},U=nli(L,!1,u,[M],o,l,c);return u.markSchemaWithDiscriminantValue(L,s.propertyName,C),U.type==="object"&&(U.properties={[s.propertyName]:Uh.literal({nameOverride:void 0,generatedName:doe([t,C],u.options.preserveSchemaIds),title:void 0,value:JL.string(C),namespace:void 0,groupName:void 0,description:void 0,availability:void 0}),...U.properties.filter(Q=>Q.key!==s.propertyName)}),U}),A=[];for(let C=0;C<O.length;++C){let M=O[C],q=!1;for(let L=C+1;L<O.length;++L){let U=O[L];if(M!=null&&U!=null&&hNe(M,U)){q=!0;break}}M!=null&&!q&&A.push(M)}if(Object.entries(A).every(([C,M])=>M.type==="literal")){let C={},M=[];return Object.entries(A).forEach(([q,L])=>{L.type==="literal"&&L.value.type==="string"&&(M.push(L.value.value),L.description!=null&&(C[L.value.value]={description:L.description}))}),NDi({nameOverride:e,generatedName:t,title:r,wrapAsNullable:a,description:n,availability:i,fernEnum:C,enumVarNames:void 0,enumValues:M,_default:void 0,namespace:c,groupName:p,context:u,source:l,inline:void 0})}return A.length===1&&A[0]!=null&&!u.options.preserveSingleSchemaOneOf?A[0]:Yby({nameOverride:e,generatedName:t,title:r,wrapAsNullable:a,description:n,availability:i,subtypes:A,namespace:c,groupName:p,encoding:o,source:l})}function TBD({schemas:e}){let t={},r=0;for(let a of e){if(!Ig(a)){if(a.properties!=null&&Object.entries(a.properties).length>0){let u=Object.keys(a.properties),c={},p=u;for(let[s,o]of Object.entries(t)){let l=G4u(o,u);p=G4u(p,o),c[s]=l}c[r]=p,t=c}}r++}let n=[],i=0;for(let a of e){let u=t[i];if(u!=null&&u.length>0){let c=u.sort();if(c[0]!=null){n.push(c[0]),++i;continue}}Ig(a)?n.push(TDi(i)??`${i}`):a.type==="array"||a.type==="boolean"||a.type==="integer"||a.type==="number"||a.type==="string"?n.push(""):n.push(TDi(i)??`${i}`),++i}return n}function Yby({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,description:i,availability:a,subtypes:u,namespace:c,groupName:p,encoding:s,source:o}){return n?Uh.nullable({nameOverride:e,generatedName:t,title:r,value:Uh.oneOf(PSe.undiscriminated({description:i,availability:a,nameOverride:e,generatedName:t,title:r,schemas:u,namespace:c,groupName:p,encoding:s,source:o,inline:void 0})),description:i,availability:a,namespace:c,groupName:p,inline:void 0}):Uh.oneOf(PSe.undiscriminated({description:i,availability:a,nameOverride:e,generatedName:t,title:r,schemas:u,namespace:c,groupName:p,encoding:s,source:o,inline:void 0}))}function LQa(e){if(e.default!=null&&typeof e.default=="string")return e.default}function bvs({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="number")return e.example;let n=d$i(e);for(let i of n??[])if(typeof i=="number")return i;if(r&&typeof r=="number")return r}function Xby({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="boolean")return e.example;let n=d$i(e);for(let i of n??[])if(typeof i=="boolean")return i;if(r&&typeof r=="boolean")return r}function U8r({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="string")return e.example;let n=d$i(e);for(let i of n??[])if(typeof i=="string")return i;if(r&&typeof r=="string")return r}function Zby({schema:e,logger:t,fallback:r}){if(e.example!=null&&Array.isArray(e.example))return e.example;let n=d$i(e);for(let i of n??[])if(Array.isArray(i))return i;if(r&&Array.isArray(r))return r}var _$i="#/components/schemas/";function E1(e,t,r,n,i,a,u=!1,c=new Set,p){let s=Fby(e)??i,o=LBD({schema:e,logger:r.logger});if(Ig(e)){let l=RDi(e);return l!=null?(u?r.markSchemaAsReferencedByRequest(l):r.markSchemaAsReferencedByNonRequest(l),nli(e,t,r,n,o,s,a)):QQa(r.resolveSchemaReference(e),t,r,yvs(e.$ref),o,s,a,c,u,p)}return QQa(e,t,r,n,o,s,a,c,u,p)}function nli(e,t,r,n,i,a,u){let c=e.$ref.includes("properties")?QQa(r.resolveSchemaReference(e),t,r,n,i,a,u,new Set):Uh.reference(Vuf(e,n,a,r.options.preserveSchemaIds));return t?Uh.nullable({title:void 0,nameOverride:void 0,generatedName:doe(n,r.options.preserveSchemaIds),value:c,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,inline:void 0}):c}function qBD(e){if(e!=null&&!e.includes(" ")&&/^[a-zA-Z]+$/.test(e))return e}function QQa(e,t,r,n,i,a,u,c=new Set,p=!1,s){typeof e=="string"&&(e={type:e});let o=wy(e,Gv.TYPE_NAME)??(r.options.useTitlesAsName?qBD(e.title):void 0),l=wy(e,Gv.SDK_GROUP_NAME)??wy(e,mye.TAGS)?.[0],O=(typeof l=="string"?[l]:l)??[];O=r.resolveGroupName(O);let A=doe(n,r.options.preserveSchemaIds),E=e.title,C=e.description,M=KOe(e),q=[];e.example!=null&&q.push({name:void 0,value:e.example,description:void 0});let L=wy(e,mye.EXAMPLES);L!=null&&Object.keys(L).length>0&&q.push(...Object.entries(L).map(([K,X])=>({name:X?.summary??K,value:X.value,description:X.description})));let U=d$i(e);U!=null&&Object.keys(U).length>0&&q.push(...U.map(K=>({name:void 0,value:K,description:void 0})));let Q=Rby({schema:e,description:C,title:E,nameOverride:o,generatedName:A,availability:M});if(Q!=null)return Q;try{if(Array.isArray(e.type)){let X=e.type.indexOf("null"),te=X!==-1;if(e.type.length===1)e.type=e.type[0];else if(e.type.length===2&&te)e.type.splice(X,1),e.type=e.type[0],e.nullable=!0;else if(te&&(e.type.splice(X,1),e.nullable=!0),e.oneOf==null)e.oneOf=[...new Set(e.type)];else{let ee=new Set([...e.oneOf,...e.type]);e.oneOf=[...ee]}}if(!t&&e.nullable===!0)return QQa(e,!0,r,n,i,a,u,c,p,s);if("const"in e&&(e.enum=[e.const]),e.enum!=null&&(e.type==="string"||e.type==null||e.type==="enum")){if(!Ovs(e.enum))return foe({nameOverride:o,generatedName:A,title:E,primitive:Zg.string({default:LQa(e),minLength:e.minLength,maxLength:e.maxLength,pattern:e.pattern,format:e.format,example:U8r({schema:e,logger:r.logger,fallback:s})}),namespace:u,groupName:O,wrapAsNullable:t,description:C,availability:M});let X=Nby(e);return e.enum.length===1&&e.enum[0]!=null&&X==null?Gby({nameOverride:o,generatedName:A,title:E,wrapAsNullable:t,value:e.enum[0],description:C,availability:M,namespace:u,groupName:O}):NDi({nameOverride:o,generatedName:A,title:E,fernEnum:X,enumVarNames:wy(e,[mye.ENUM_VAR_NAMES]),enumValues:e.enum,_default:e.default,description:C,availability:M,wrapAsNullable:t,namespace:u,groupName:O,context:r,source:a,inline:void 0})}if(Ovs(e.type)&&e.type.length>1){let X=e.type.includes("null"),te=e.type.filter(ee=>ee!=="null").map(ee=>({type:ee,nullable:X}));return FDi({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,wrapAsNullable:t,context:r,subtypes:te,namespace:u,groupName:O,encoding:i,source:a})}if(e.type==="boolean"){let X=wy(e,Gv.BOOLEAN_LITERAL);return X!=null?kby({nameOverride:o,generatedName:A,title:E,literal:JL.boolean(X),wrapAsNullable:t,description:C,availability:M,namespace:u,groupName:O}):foe({nameOverride:o,generatedName:A,title:E,primitive:Zg.boolean({default:xBD(e.default),example:Xby({schema:e,logger:r.logger,fallback:s})}),wrapAsNullable:t,description:C,availability:M,namespace:u,groupName:O})}if(e.type==="number")return Luf({nameOverride:o,generatedName:A,title:E,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:p$i(e.exclusiveMinimum),exclusiveMaximum:p$i(e.exclusiveMaximum),multipleOf:e.multipleOf,description:C,availability:M,wrapAsNullable:t,example:bvs({schema:e,logger:r.logger,fallback:s}),namespace:u,groupName:O});if(e.type==="integer")return Wby({nameOverride:o,generatedName:A,title:E,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:p$i(e.exclusiveMinimum),exclusiveMaximum:p$i(e.exclusiveMaximum),multipleOf:e.multipleOf,description:C,availability:M,wrapAsNullable:t,example:bvs({schema:e,logger:r.logger,fallback:s}),namespace:u,groupName:O});if(e.type==="float")return Luf({nameOverride:o,generatedName:A,title:E,format:"float",_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:p$i(e.exclusiveMinimum),exclusiveMaximum:p$i(e.exclusiveMaximum),multipleOf:e.multipleOf,description:C,availability:M,wrapAsNullable:t,example:bvs({schema:e,logger:r.logger,fallback:s}),namespace:u,groupName:O});if(e.type==="string"){if(e.format==="date-time")return foe({nameOverride:o,generatedName:A,title:E,primitive:Zg.datetime({example:U8r({schema:e,logger:r.logger,fallback:s})}),wrapAsNullable:t,description:C,availability:M,namespace:u,groupName:O});if(e.format==="date"&&r.options.typeDatesAsStrings===!1)return foe({nameOverride:o,generatedName:A,title:E,primitive:Zg.date({example:U8r({schema:e,logger:r.logger,fallback:s})}),wrapAsNullable:t,description:C,availability:M,namespace:u,groupName:O});if(e.format==="json-string")return Uh.unknown({nameOverride:o,generatedName:A,title:E,description:C,availability:M,namespace:u,groupName:O,example:void 0});let X=rgy(e,"const");return X!=null?kby({nameOverride:o,generatedName:A,title:E,literal:JL.string(X),wrapAsNullable:t,description:C,availability:M,namespace:u,groupName:O}):foe({nameOverride:o,generatedName:A,title:E,primitive:Zg.string({default:LQa(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:U8r({schema:e,logger:r.logger,fallback:s})}),namespace:u,groupName:O,wrapAsNullable:t,description:C,availability:M})}if(e.type==="array")return Lby({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,item:e.items,description:C,availability:M,wrapAsNullable:t,context:r,namespace:u,groupName:O,example:Zby({schema:e,logger:r.logger,fallback:s}),source:a});if(e.additionalProperties!=null&&e.additionalProperties!==!1&&gvs(e))return zby({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,additionalProperties:e.additionalProperties,description:C,availability:M,wrapAsNullable:t,context:r,namespace:u,groupName:O,encoding:i,example:e.example,source:a});if(e.oneOf!=null&&e.oneOf.length>0&&wy(e,Gv.IS_DISCRIMINATED)===!1)return FDi({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,wrapAsNullable:t,context:r,subtypes:e.oneOf,namespace:u,groupName:O,encoding:i,source:a});if(e.type==="object"&&e.discriminator!=null&&e.discriminator.mapping!=null)return r.options.discriminatedUnionV2?Wuf({nameOverride:o,generatedName:A,title:E,description:C,availability:M,wrapAsNullable:t,context:r,namespace:u,groupName:O,discriminator:e.discriminator,encoding:i,source:a}):zuf({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsNullable:t,context:r,namespace:u,groupName:O,encoding:i,source:a});if(e.oneOf!=null&&e.oneOf.length>0){let X=wy(e,Gv.IS_UNDISCRIMINATED);if(e.discriminator!=null&&e.discriminator.mapping!=null&&Object.keys(e.discriminator.mapping).length>0)return r.options.discriminatedUnionV2||X?Wuf({nameOverride:o,generatedName:A,title:E,description:C,availability:M,wrapAsNullable:t,context:r,namespace:u,groupName:O,discriminator:e.discriminator,encoding:i,source:a}):zuf({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsNullable:t,context:r,namespace:u,groupName:O,encoding:i,source:a});if(e.oneOf.length===1&&e.oneOf[0]!=null){if(r.options.preserveSingleSchemaOneOf)return FDi({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,wrapAsNullable:t,context:r,subtypes:e.oneOf.filter(ee=>Ig(ee)||ee.type!=="null"),encoding:i,namespace:u,groupName:O,source:a});let te=E1(e.oneOf[0],t,r,n,a,u,p);return UQa(te,C,u,O)}else if(e.oneOf.length>1){if(e.oneOf.length===2&&e.oneOf[0]!=null&&e.oneOf[1]!=null){let ue=e.oneOf[0],me=e.oneOf[1];if(!Ig(ue)&&ue.type==="null")return E1(me,!0,r,n,a,u);if(!Ig(me)&&me.type==="null")return E1(ue,!0,r,n,a,u)}let te=FBD({schemas:e.oneOf});if(te!=null)return NDi({nameOverride:o,generatedName:A,title:E,fernEnum:void 0,enumVarNames:void 0,enumValues:te,_default:e.default,description:C,availability:M,wrapAsNullable:t,namespace:u,groupName:O,context:r,source:a,inline:void 0});let ee=egy({schemas:e.oneOf,context:r});if(ee!=null&&!r.options.discriminatedUnionV2&&!X)return Quf({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,properties:e.properties??{},required:e.required,description:C,availability:M,wrapAsNullable:t,discriminant:ee.discriminant,variants:ee.schemas,context:r,namespace:u,groupName:O,encoding:i,source:a});let re=e.oneOf.filter(ue=>!Ig(ue)&&ue.type==="null").length>0;return FDi({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,wrapAsNullable:t||re,context:r,subtypes:e.oneOf.filter(ue=>Ig(ue)||ue.type!=="null"),encoding:i,namespace:u,groupName:O,source:a})}}if(e.anyOf!=null&&e.anyOf.length>0){if(e.anyOf.length===1&&e.anyOf[0]!=null){let ee=E1(e.anyOf[0],t,r,n,a,u,p);return UQa(ee,C,u,O)}if(e.anyOf.length===2){let[ee,re]=e.anyOf;if(ee!=null&&re!=null){if(!Ig(ee)&&ee.type==="null"){let ue=E1(re,!0,r,n,a,u);return UQa(ue,C,u,O)}else if(!Ig(re)&&re.type==="null"){let ue=E1(ee,!0,r,n,a,u);return UQa(ue,C,u,O)}}}let X=egy({schemas:e.anyOf,context:r});if(X!=null&&!r.options.discriminatedUnionV2)return Quf({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,properties:e.properties??{},required:e.required,description:C,availability:M,wrapAsNullable:t,discriminant:X.discriminant,variants:X.schemas,context:r,namespace:u,groupName:O,encoding:i,source:a});let te=e.anyOf.filter(ee=>!Ig(ee)&&ee.type==="null").length>0;return FDi({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,description:C,availability:M,wrapAsNullable:t||te,context:r,subtypes:e.anyOf.filter(ee=>Ig(ee)||ee.type!=="null"),encoding:i,namespace:u,groupName:O,source:a})}if(e.allOf!=null||e.properties!=null){let X=[];for(let ee of e.allOf??[])(Ig(ee)||Object.keys(ee).length>0)&&X.push(ee);if((e.properties==null||gvs(e))&&X.length===1&&X[0]!=null){let ee=E1(X[0],t,r,n,a,u,p);return UQa(ee,C,u,O)}let te=X.filter(ee=>{let re=mvs(ee);return re||r.logger.warn(`Skipping non-object allOf element: ${JSON.stringify(ee)}`),re});if((e.properties==null||gvs(e))&&te.length===1&&te[0]!=null){let ee=E1(te[0],t,r,n,a,u,p);return UQa(ee,C,u,O)}return Kby({nameOverride:o,generatedName:A,title:E,breadcrumbs:n,properties:e.properties??{},description:C,required:e.required,wrapAsNullable:t,allOf:te,context:r,propertiesToExclude:c,namespace:u,groupName:O,fullExamples:q,additionalProperties:e.additionalProperties,availability:M,encoding:i,source:a})}if(e.type==="object"&&NBD(e)&&RBD(e)&&gvs(e))return hvs({nameOverride:o,generatedName:A,title:E,description:C,availability:M,wrapAsNullable:t,keySchema:{nameOverride:void 0,generatedName:`${A}Key`,title:void 0,description:void 0,availability:void 0,schema:Zg.string({default:LQa(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:U8r({schema:e,logger:r.logger,fallback:s})}),namespace:u,groupName:O},valueSchema:Uh.unknown({nameOverride:void 0,generatedName:`${A}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,namespace:u,groupName:O}),namespace:u,groupName:O,encoding:i,example:e.example});e.type!=null&&r.logger.warn(`Failed to parse an OpenAPI schema at the following location: ${n.join("->")}. Coercing to unknown.`);let K=e.example??e.default;return Uh.unknown({nameOverride:o,generatedName:A,title:E,description:C,availability:M,namespace:u,groupName:O,example:K})}catch(K){return r.logger.debug(`Error converting schema: ${K.message}
@@ -2834,7 +2834,7 @@ More information: https://mdxjs.com/docs/troubleshooting-mdx`);return i.stack=""
2834
2834
  `)}function _BC(e){return e.some(t=>t.severity==="fatal")?"fatal":e.some(t=>t.severity==="error")?"error":"warning"}function hBC(e){switch(e){case"fatal":return zj.Error;case"error":return zj.Error;case"warning":return zj.Warn;default:cc(e)}}function yBC({stats:e,context:t,logWarnings:r,elapsedMillis:n=0}){let{numFatal:i,numErrors:a,numWarnings:u}=e,c=n>0?` in ${(n/1e3).toFixed(3)} seconds.`:".",p=`Found ${i+a} errors and ${u} warnings`+c;!r&&u>0&&(p+=" Run fern check --warnings to print out the warnings not shown."),i+a>0?t.logger.error(p):u>0?t.logger.warn(p):t.logger.info(yd.green("\u2713 All checks passed"))}function vBC(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:cc(i.severity)}return{numFatal:t,numErrors:r,numWarnings:n}}async function IVa({workspace:e,apiWorkspaces:t,ossWorkspaces:r,context:n,logWarnings:i,errorOnBrokenLinks:a,logSummary:u=!0,excludeRules:c}){let p=performance.now(),s=await L8o(e,n,t,r,!1,c),o=performance.now()-p,{hasErrors:l}=CVa({violations:s,context:n,logWarnings:i,logSummary:u,logBreadcrumbs:!1,elapsedMillis:o});return a&&(l=l||s.some(O=>O.name==="valid-markdown-links")),{hasErrors:l}}async function qCs({workspace:e,apiWorkspaces:t,ossWorkspaces:r,context:n,logWarnings:i,errorOnBrokenLinks:a,excludeRules:u}){let{hasErrors:c}=await IVa({workspace:e,context:n,logWarnings:i,apiWorkspaces:t,ossWorkspaces:r,errorOnBrokenLinks:a,excludeRules:u});c&&n.failAndThrow()}async function lav({loadProject:e,cliContext:t,port:r,bundlePath:n,brokenLinks:i,legacyPreview:a,backendPort:u}){let c=await e(),p=c.docsWorkspaces;p!=null&&(a&&(await t.instrumentPostHogEvent({orgId:c.config.organization,command:"fern docs dev --legacy"}),await t.runTaskForWorkspace(p,async s=>{s.logger.info(`Starting server on port ${r}`),await Zjf({initialProject:c,reloadProject:e,validateProject:async o=>{let l=o.docsWorkspaces;if(l==null)return;let O=i?[]:["valid-markdown-links"],A=l.config.experimental?.openapiParserV3;A==null||A?await IVa({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:[],ossWorkspaces:await Nye(o),excludeRules:O}):await IVa({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:o.apiWorkspaces,ossWorkspaces:await Nye(o),excludeRules:O})},context:s,port:r,bundlePath:n})})),await t.instrumentPostHogEvent({orgId:c.config.organization,command:"fern docs dev --beta"}),await t.runTaskForWorkspace(p,async s=>{s.logger.info(`Starting server on port ${r}`),await Yjf({initialProject:c,reloadProject:e,validateProject:async o=>{let l=o.docsWorkspaces;if(l==null)return;let O=i?[]:["valid-markdown-links"],A=l.config.experimental?.openapiParserV3;A==null||A?await IVa({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:[],ossWorkspaces:await Nye(o),excludeRules:O}):await IVa({workspace:l,context:s,logWarnings:!0,logSummary:!1,apiWorkspaces:o.apiWorkspaces,ossWorkspaces:await Nye(o),excludeRules:O})},context:s,port:r,bundlePath:n,backendPort:u})}))}var zCs=require("fs/promises");var zXi=Xi(jPs(),1);function fav(e,t){let r=e.shape,n=e.docs??void 0;return{openApiSchema:j1._visit(r,{alias:a=>bBC({aliasTypeDeclaration:a,docs:n}),enum:a=>gBC({enumTypeDeclaration:a,docs:n}),object:a=>{let u=e.userProvidedExamples[0],c=u==null?wBC(t,e.name):void 0,p=u==null&&c==null?jBC(t,e.name):void 0;return NCs({properties:a.properties.map(s=>{let o;return u!=null&&u.shape.type==="object"?o=u.shape.properties.find(l=>l.name.wireValue===s.name.wireValue):c!=null?c.type==="reference"&&c.shape.type==="named"&&c.shape.shape.type==="object"&&(o=c.shape.shape.properties.find(l=>l.name.wireValue===s.name.wireValue)):p!=null&&p.type==="body"&&p.value?.shape.type==="named"&&p.value.shape.shape.type==="object"&&(o=p.value.shape.shape.properties.find(l=>l.name.wireValue===s.name.wireValue)),{docs:s.docs??void 0,name:s.name,valueType:s.valueType,example:o}}),extensions:a.extends,docs:n})},union:a=>mBC({unionTypeDeclaration:a,docs:n}),undiscriminatedUnion:a=>OBC({undiscriminatedUnionDeclaration:a,docs:n}),_other:()=>{throw new Error("Encountered unknown type: "+r.type)}}),schemaName:dav(e.name)}}function bBC({aliasTypeDeclaration:e,docs:t}){return{...XZ(e.aliasOf),description:t}}function gBC({enumTypeDeclaration:e,docs:t}){return{type:"string",enum:e.values.map(r=>r.name.wireValue),description:t}}function mBC({unionTypeDeclaration:e,docs:t}){let n={oneOf:e.types.map(i=>{let a={[e.discriminant.wireValue]:{type:"string",enum:[i.discriminantValue.wireValue]}};return lle._visit(i.shape,{noProperties:()=>({type:"object",properties:a,required:[e.discriminant.wireValue]}),singleProperty:u=>({type:"object",properties:{...a,[u.name.wireValue]:XZ(u.type)},required:[e.discriminant.wireValue]}),samePropertiesAsObject:u=>({type:"object",allOf:[{type:"object",properties:a},{$ref:xCs(u)}],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,...XZ(a.valueType)},a.valueType.type==="container"&&a.valueType.container.type==="optional"||(n.required=[...n.required??[],a.name.wireValue]),i),{})),n}function OBC({undiscriminatedUnionDeclaration:e,docs:t}){return{oneOf:e.members.map(r=>({description:r.docs??void 0,...XZ(r.type)})),description:t}}function XZ(e){return nh._visit(e,{container:t=>PBC(t),named:t=>({$ref:xCs(t)}),primitive:t=>ABC(t),unknown:()=>({}),_other:()=>{throw new Error("Encountered unknown typeReference: "+e.type)}})}function ABC(e){return e.v2==null?HA._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)}})??{}:bg._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 PBC(e){return EP._visit(e,{list:t=>({type:"array",items:XZ(t)}),set:t=>({type:"array",items:XZ(t)}),map:t=>t.keyType.type==="primitive"&&t.keyType.primitive.v1==="STRING"&&t.valueType.type==="unknown"?{type:"object",additionalProperties:!0}:{type:"object",additionalProperties:XZ(t.valueType)},optional:t=>({...XZ(t),nullable:!0}),nullable:t=>({...XZ(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 xCs(e){return`#/components/schemas/${dav(e)}`}function dav(e){return[...e.fernFilepath.packagePath.map(t=>t.originalName),e.name.originalName].join("")}function wBC(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"&&EBC(n.requestBody.requestBodyType,t))return n.userSpecifiedExamples[0]?.example?.request??void 0}function jBC(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 EBC(e,t){return Bae(e.fernFilepath,t.fernFilepath)&&Bae(e.name,t.name)}function NCs({docs:e,properties:t,extensions:r}){let n={},i=[];t.forEach(u=>{let c=XZ(u.valueType),p;(u.example!=null&&u.valueType.type==="primitive"||u.example!=null&&u.valueType.type==="container"&&u.valueType.container.type==="list"&&u.valueType.container.list.type==="primitive")&&(p=u.example.value.jsonExample),n[u.name.wireValue]={...c,description:u.docs??void 0,example:p},u.valueType.type==="container"&&u.valueType.container.type==="optional"||i.push(u.name.wireValue)});let a={type:"object",description:e,properties:n};return i.length>0&&(a.required=i),r.length>0&&(a.allOf=r.map(u=>({$ref:xCs(u)}))),a}function pav({ir:e,httpServices:t,typesByName:r,errorsByName:n,errorDiscriminationStrategy:i,security:a,environments:u,mode:c}){let p={};return t.forEach(s=>{s.endpoints.forEach(o=>{let{fullPath:l,convertedHttpMethod:O,operationObject:A}=SBC({ir:e,httpEndpoint:o,httpService:s,typesByName:r,errorsByName:n,errorDiscriminationStrategy:i,security:a,environments:u,mode:c}),E=p[l]??={};if(E[O]!=null)throw new Error(`Duplicate ${O} endpoint at ${l}`);E[O]=A})}),p}function SBC({httpEndpoint:e,httpService:t,typesByName:r,errorsByName:n,errorDiscriminationStrategy:i,security:a,environments:u,mode:c,ir:p}){let s=QS(p.basePath!=null?G1f(p.basePath):"",G1f(t.basePath),G1f(e.path));s=s.startsWith("/")?s:`/${s}`;let o=DBC(e.method),l=p.pathParameters.map(U=>H1f({pathParameter:U,examples:e.userSpecifiedExamples.map(Q=>Q.example).filter(GP)??[]})),O=t.pathParameters.map(U=>H1f({pathParameter:U,examples:e.userSpecifiedExamples.map(Q=>Q.example).filter(GP)??[]})),A=e.pathParameters.map(U=>H1f({pathParameter:U,examples:e.userSpecifiedExamples.map(Q=>Q.example).filter(GP)??[]})),E=e.queryParameters.map(U=>TBC({queryParameter:U,typesByName:r,examples:e.userSpecifiedExamples.map(Q=>Q.example).filter(GP)??[]})),C=e.headers.map(U=>qBC({httpHeader:U,typesByName:r,examples:e.userSpecifiedExamples.map(Q=>Q.example).filter(GP)??[]})),M=[...l,...O,...A,...E,...C],q=c==="stoplight"?t.displayName??t.name.fernFilepath.allParts.map(U=>U.originalName).join(" "):t.name.fernFilepath.allParts.map(U=>U.pascalCase.unsafeName).join(""),L={description:e.docs??void 0,operationId:[...t.name.fernFilepath.allParts.map(U=>U.camelCase.unsafeName),e.name.originalName].join("_"),tags:[q],parameters:M,responses:IBC({httpResponse:e.response,responseErrors:e.errors,errorsByName:n,errorDiscriminationStrategy:i,examples:e.userSpecifiedExamples.map(U=>U.example).filter(GP)??[]}),summary:e.displayName??void 0};if(e.baseUrl!=null){let U=e.baseUrl;if(u?.environments.type!=="multipleBaseUrls")throw new Error("baseUrl is defined environments are not multipleBaseUrls");L.servers=u.environments.environments.map(Q=>{let K=Q.urls[U];if(K==null)throw new Error("No URL defined for "+U);let X={url:K};return Q.docs!=null&&(X.description=Q.docs),X})}return e.auth&&(L.security=a),e.requestBody!=null&&(L.requestBody=CBC({httpRequest:e.requestBody,typesByName:r,examples:e.userSpecifiedExamples.map(U=>U.example).filter(GP)??[]})),{fullPath:s,convertedHttpMethod:o,operationObject:L}}function DBC(e){return j9._visit(e,{get:()=>zXi.OpenAPIV3.HttpMethods.GET,post:()=>zXi.OpenAPIV3.HttpMethods.POST,put:()=>zXi.OpenAPIV3.HttpMethods.PUT,patch:()=>zXi.OpenAPIV3.HttpMethods.PATCH,delete:()=>zXi.OpenAPIV3.HttpMethods.DELETE,head:()=>zXi.OpenAPIV3.HttpMethods.HEAD,_other:()=>{throw new Error("Encountered unknown http method: "+e)}})}function CBC({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${f2(n)+1}`]={value:i.request.jsonExample});return dz._visit(e,{inlinedRequestBody:i=>{let a={schema:NCs({docs:void 0,properties:i.properties.map(u=>{let c;return r.length>0&&r[0]?.request?.type==="inlinedRequestBody"&&(c=r[0]?.request.properties.find(p=>p.name.wireValue===u.name.wireValue)),{docs:u.docs??void 0,name:u.name,valueType:u.valueType,example:c}}),extensions:i.extends})};return f2(n)>0&&(a.examples=n),{required:!0,content:{"application/json":a}}},reference:i=>{let a={schema:XZ(i.requestBodyType)};return f2(n)>0&&(a.examples=n),{description:i.docs??void 0,required:RCs({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,u)=>(_re._visit(u,{file:c=>{a[c.key.wireValue]={type:"string",format:"binary"}},bodyProperty:c=>{a[c.name.wireValue]={description:c.docs??void 0,...XZ(c.valueType)}},_other:()=>{throw new Error("Unknown FileUploadRequestProperty: "+u.type)}}),{...a}),{})}}}}),bytes:()=>{throw new Error("bytes is not supported")},_other:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function IBC({httpResponse:e,responseErrors:t,errorsByName:r,errorDiscriminationStrategy:n,examples:i}){let a={};if(e?.body?.type==="json"){let u={schema:XZ(e.body.value.responseBodyType)},c={};for(let p of i)p.response.type==="ok"&&p.response.value.type==="body"&&p.response.value.value!=null&&(p.name&&p.name.originalName!==""?c[p.name.originalName]={value:p.response.value.value.jsonExample}:c[`Example${f2(c)+1}`]={value:p.response.value.value.jsonExample});f2(c)>0&&(u.examples=c),a[String(e.statusCode??200)]={description:e.body.value.docs??"",content:{"application/json":u}}}else a[204]={description:""};return eet._visit(n,{statusCode:()=>{for(let u of t){let c=r[FCs(u.error)];if(c==null)throw new Error("Encountered undefined error declaration: "+u.error.name.originalName);let p={description:u.docs??""};if(c.type!=null){let s={schema:XZ(c.type)},o={};for(let l of i)l.response.type==="error"&&l.response.body!=null&&Bae(u.error,l.response.error)&&(l.name&&l.name.originalName!==""?o[l.name.originalName]={value:l.response.body.jsonExample}:o[`Example${f2(o)+1}`]={value:l.response.body.jsonExample});f2(o)>0&&(s.examples=o),p.content={"application/json":s}}a[c.statusCode]=p}},property:u=>{let c=BBC({responseErrors:t,errorsByName:r});for(let p of Object.keys(c)){let s=c[p];if(s==null||s.length===0)continue;let o={schema:{oneOf:s.map(O=>MBC({errorInfo:O,property:u}))}},l={};for(let O of i)if(O.response.type==="error"&&O.response.body!=null){let A=O.response.error;s.some(E=>Bae(E.errorDeclaration.name,A))&&(O.name&&O.name.originalName!==""?l[O.name.originalName]={value:O.response.body.jsonExample}:l[`Example${f2(l)+1}`]={value:O.response.body.jsonExample})}f2(l)>0&&(o.examples=l),a[p]={description:"",content:{"application/json":o}}}},_other:()=>{throw new Error("Unknown error discrimination strategy: "+n.type)}}),a}function MBC({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]=XZ(e.errorDeclaration.type)),{type:"object",description:n,properties:i}}function BBC({responseErrors:e,errorsByName:t}){let r={};for(let n of e){let i=t[FCs(n.error)];if(i==null)throw new Error("Encountered undefined error declaration: "+n.error.name.originalName);let a=i.statusCode,u=r[a];u==null?r[a]=[{responseError:n,errorDeclaration:i}]:u.push({responseError:n,errorDeclaration:i})}return r}function H1f({pathParameter:e,examples:t}){let r={name:e.name.originalName,in:"path",description:e.docs??void 0,required:!0,schema:XZ(e.valueType)},n={};for(let i of t){let a=[...i.rootPathParameters,...i.servicePathParameters,...i.endpointPathParameters].find(u=>u.name.originalName===e.name.originalName);a!=null&&(i.name&&i.name.originalName!==""?n[i.name.originalName]={value:a.value.jsonExample}:n[`Example${f2(n)+1}`]={value:a.value.jsonExample},r.example==null&&(r.example=a.value.jsonExample))}return f2(n)>0&&(r.examples=n),r}function TBC({queryParameter:e,typesByName:t,examples:r}){let n={name:e.name.wireValue,in:"query",description:e.docs??void 0,required:RCs({typeReference:e.valueType,typesByName:t}),schema:e.allowMultiple?XZ(nh.container(EP.list(e.valueType))):XZ(e.valueType)},i={};for(let a of r){let u=a.queryParameters.find(c=>c.name.wireValue===e.name.wireValue);u!=null&&(a.name&&a.name.originalName!==""?i[a.name.originalName]={value:u.value.jsonExample}:i[`Example${f2(i)+1}`]={value:u.value.jsonExample},n.example==null&&(n.example=u.value.jsonExample))}return f2(i)>0&&(n.examples=i),n}function qBC({httpHeader:e,typesByName:t,examples:r}){let n={name:e.name.wireValue,in:"header",description:e.docs??void 0,required:RCs({typeReference:e.valueType,typesByName:t}),schema:XZ(e.valueType)},i={};for(let a of r){let u=[...a.serviceHeaders,...a.endpointHeaders].find(c=>c.name.wireValue===e.name.wireValue);u!=null&&(a.name&&a.name.originalName!==""?i[a.name.originalName]={value:u.value.jsonExample}:i[`Example${f2(i)+1}`]={value:u.value.jsonExample},n.example==null&&(n.example=u.value.jsonExample))}return f2(i)>0&&(n.examples=i),n}function G1f(e){let t=e.head;for(let r of e.parts)t+=`{${r.pathParameter}}${r.tail}`;return t}function RCs({typeReference:e,typesByName:t}){if(e.type==="container"&&e.container.type==="optional")return!1;if(e.type==="named"){let r=J1f(e),n=t[r];if(n==null)throw new Error("Encountered non-existent type: "+e.name.originalName);if(n.shape.type==="alias")return RCs({typeReference:n.shape.aliasOf,typesByName:t})}return!0}function _av(e){return cxe._visit(e.requirement,{all:()=>[e.schemes.reduce((t,r)=>({...t,[K1f(r)]:[]}),{})],any:()=>e.schemes.map(t=>({[K1f(t)]:[]})),_other:()=>{throw new Error("Unknown auth scheme requirement: "+e.requirement)}})}function hav(e){let t={};for(let r of e.schemes){let n=fz._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[K1f(r)]=n)}return t}function K1f(e){return fz._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 yav({apiName:e,ir:t,mode:r}){let n={},i={};Object.values(t.types).forEach(o=>{let l=fav(o,t);n[l.schemaName]={title:l.schemaName,...l.openApiSchema},i[J1f(o.name)]=o});let a={};Object.values(t.errors).forEach(o=>{a[FCs(o.name)]=o});let u=_av(t.auth),c=pav({ir:t,httpServices:Object.values(t.services),typesByName:i,errorsByName:a,errorDiscriminationStrategy:t.errorDiscriminationStrategy,security:u,environments:t.environments??void 0,mode:r}),p={title:t.apiDisplayName??e,version:""};t.apiDocs!=null&&(p.description=t.apiDocs);let s={openapi:"3.0.1",info:p,paths:c,components:{schemas:n,securitySchemes:hav(t.auth)}};return t.environments!=null&&t.environments.environments.type==="singleBaseUrl"&&(s.servers=t.environments.environments.environments.map(o=>({url:o.url,description:o.docs!=null?`${o.name.originalName} (${o.docs})`:o.name.originalName}))),s}function J1f(e){return[...e.fernFilepath.allParts.map(t=>t.originalName),e.name.originalName].join("-")}function FCs(e){return[...e.fernFilepath.allParts.map(t=>t.originalName),e.name.originalName].join("-")}async function vav({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}),u=UV({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 LV(i,a)}),c=yav({apiName:n.workspaceName??"api",ir:u,mode:"openapi"});await(0,zCs.mkdir)(cg(r),{recursive:!0}),await(0,zCs.writeFile)(r,r.endsWith(".json")?JSON.stringify(c,void 0,2):lg.dump(c))})}))}async function bav({project:e,cliContext:t,shouldFix:r}){await Promise.all(e.apiWorkspaces.map(async n=>{n instanceof qJ||await t.runTaskForWorkspace(n,async i=>{await KHl({workspace:await n.toFernWorkspace({context:i}),context:i,shouldFix:r})})}))}var gav="group";var mav=".preview",Oav="approved-output-directories",Aav=".fern";var Dav=require("fs/promises");var wav=require("fs/promises");var Pav=require("os");function U8o(){return Jl(D_.of((0,Pav.homedir)()),hs.of(Aav),hs.of(Oav))}async function jav(){let e=U8o();if(!await _v(e))return[];let r=await(0,wav.readFile)(e,{encoding:"utf-8"});return JSON.parse(r)}var QCs=require("fs/promises"),Eav=Xi(require("path"),1);async function Sav(e){await(0,QCs.mkdir)(Eav.default.dirname(U8o()),{recursive:!0}),await(0,QCs.writeFile)(U8o(),JSON.stringify(e,null,2))}async function Cav(e,t,r){if(!e||_Bl()||r)return{shouldProceed:!0};let n=await jav();return n?.includes(e)?{shouldProceed:!0}:await _v(e)?(await(0,Dav.readdir)(e)).length===0?{shouldProceed:!0}:await t.confirmPrompt(`Directory ${e} contains existing files that may be overwritten. Continue?`,!1)?(await Sav([...n??[],e]),{shouldProceed:!0}):{shouldProceed:!1}:{shouldProceed:!0}}var Iav=require("fs/promises"),Mav=Xi(TEe(),1);async function $1f({logger:e,imageName:t,args:r=[],binds:n=[],envVars:i={},ports:a={},writeLogsToFile:u=!0,removeAfterCompletion:c=!1,runner:p}){let s=()=>xBC({logger:e,imageName:t,args:r,binds:n,envVars:i,ports:a,removeAfterCompletion:c,writeLogsToFile:u,runner:p});try{await s()}catch(o){if(o instanceof Error&&o.message.includes("No such image"))await NBC(t),await s();else throw o}}async function xBC({logger:e,imageName:t,args:r,binds:n,envVars:i={},ports:a={},removeAfterCompletion:u,writeLogsToFile:c,runner:p}){let s=["run","--user","root",...n.flatMap(E=>["-v",E]),...Object.entries(i).flatMap(([E,C])=>["-e",`${E}="${C}"`]),...Object.entries(a).flatMap(([E,C])=>["-p",`${E}:${C}`]),u?"--rm":"",t,...r].filter(Boolean),{stdout:o,stderr:l,exitCode:O}=await QV(e,p??"docker",s,{reject:!1,all:!0,doNotPipeOutput:!0}),A=o+l;if(c){let E=await Mav.default.file();await(0,Iav.writeFile)(E.path,A),e.info(`Generator logs here: ${E.path}`)}if(O!==0)throw new Error(`Docker exited with code ${O}.
2835
2835
  ${o}
2836
2836
  ${l}`)}async function NBC(e){await QV(void 0,"docker",["pull",e],{all:!0,doNotPipeOutput:!0})}var eMi=Xi(require("path"),1),QXi="/fern",Y1f="output",X1f="config.json",Z1f="ir.json",RBC="snippet.json",FBC="snippet-templates.json",zBC="generators",QBC="sources",LCs=eMi.default.join(QXi,Y1f),V8o=eMi.default.join(QXi,X1f),UCs=eMi.default.join(QXi,Z1f),VCs=eMi.default.join(QXi,RBC),WCs=eMi.default.join(QXi,FBC),V1U=eMi.default.join(QXi,zBC),Bav=eMi.default.join(QXi,QBC),HCs="9229";var W8o=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:u,context:c,inspect:p,runner:s}){c.logger.info(`Executing generator ${t} using Docker image: ${this.dockerImage}`);let o=[`${n}:${V8o}:ro`,`${r}:${UCs}:ro`,`${i}:${LCs}`];a&&o.push(`${a}:${VCs}`),u&&o.push(`${u}:${WCs}`);let l={},O={};p&&(l.NODE_OPTIONS=`--inspect-brk=0.0.0.0:${HCs}`,O[HCs]=HCs),await $1f({logger:c.logger,imageName:this.dockerImage,args:[V8o],binds:o,envVars:l,ports:O,removeAfterCompletion:!this.keepDocker,runner:s})}};var lI1=Xi(rb(),1),iSa=require("fs/promises"),hvo=require("path"),fI1=Xi(TEe(),1);var Zfv=Xi(aC(),1),Kre=Xi($fv(),1),mtt=Xi(f5(),1),kfv=Xi(require("fs"),1),Bfi=Xi(require("path"),1),t6C="0.0.1";function r6C(e,t){if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let r=e.raw.github;if(r.license!=null){if(typeof r.license=="string"){if(r.license==="MIT"||r.license==="Apache-2.0")return Kre.FernGeneratorExec.LicenseConfig.basic({id:r.license==="MIT"?Kre.FernGeneratorExec.LicenseId.Mit:Kre.FernGeneratorExec.LicenseId.Apache2})}else if(typeof r.license=="object"&&"custom"in r.license)return Kre.FernGeneratorExec.LicenseConfig.custom({filename:Bfi.basename(r.license.custom)})}}if(e.raw?.metadata?.license!=null){let r=e.raw.metadata.license;if(typeof r=="string"){if(r==="MIT"||r==="Apache-2.0")return Kre.FernGeneratorExec.LicenseConfig.basic({id:r==="MIT"?Kre.FernGeneratorExec.LicenseId.Mit:Kre.FernGeneratorExec.LicenseId.Apache2})}else if(typeof r=="object"&&"custom"in r)return Kre.FernGeneratorExec.LicenseConfig.custom({filename:Bfi.basename(r.custom)})}}function Yfv(e){return e!=null?Zfv.GithubPublishInfo._visit(e,{npm:t=>Kre.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.token??"")}),maven:t=>Kre.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:t.registryUrl,coordinate:t.coordinate,usernameEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.credentials?.password??""),signature:t.signature!=null?{keyIdEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.signature.keyId??""),passwordEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.signature.password??""),secretKeyEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.signature.secretKey??"")}:void 0}),pypi:t=>Kre.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:t.registryUrl,packageName:t.packageName,usernameEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.credentials?.password??"")}),rubygems:t=>Kre.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.apiKey??"")}),postman:t=>Kre.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.apiKey??""),workspaceIdEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.workspaceId??"")}),nuget:t=>Kre.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,mtt.EnvironmentVariable)(t.apiKey??"")}),_other:()=>{}}):void 0}function edv({generatorInvocation:e,customConfig:t,workspaceName:r,organization:n,outputVersion:i=t6C,absolutePathToSnippet:a,absolutePathToSnippetTemplates:u,absolutePathToFernConfig:c,writeUnitTests:p,generateOauthClients:s,generatePaginatedClients:o,paths:l}){let O=t,A=r6C(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 Q=e.raw.github;if(Q.license!=null&&typeof Q.license=="object"&&"custom"in Q.license){let K=Q.license.custom;try{let X=c?Bfi.dirname(c):process.cwd(),te=Bfi.isAbsolute(K)?K:Bfi.resolve(X,K),re=kfv.readFileSync(te,"utf-8").split(`
2837
- `).find(ue=>ue.trim().length>0)||"Custom License";re=re.trim().replace(/^#+\s*/,""),re=re.replace(/[.:;]+$/,"").trim(),U=re}catch{}}}U!=null&&(O={...t,_fernLicenseName:U})}let{snippetPath:E,snippetTemplatePath:C,irPath:M,outputDirectory:q}=l,L=e.outputMode._visit({publish:U=>({...Xfv(i,U,e,l),snippetFilepath:E,publishingMetadata:e.publishMetadata}),publishV2:U=>({...Xfv(i,U,e,l),snippetFilepath:E,publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:Kre.FernGeneratorExec.OutputMode.downloadFiles(),path:q,snippetFilepath:E,publishingMetadata:e.publishMetadata}),github:U=>{let Q={mode:Kre.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${U.owner}/${U.repo}`,version:i,publishInfo:Yfv(U.publishInfo),installationToken:void 0}),path:q,publishingMetadata:e.publishMetadata};return a!==void 0&&(Q.snippetFilepath=E),u!==void 0&&(Q.snippetTemplateFilepath=C),Q},githubV2:U=>{let Q=U._visit({commitAndRelease:X=>`https://github.com/${X.owner}/${X.repo}`,push:X=>`https://github.com/${X.owner}/${X.repo}`,pullRequest:X=>`https://github.com/${X.owner}/${X.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),K={mode:Kre.FernGeneratorExec.OutputMode.github({repoUrl:Q,version:i,publishInfo:Yfv(U.publishInfo)}),path:q,publishingMetadata:e.publishMetadata};return a!==void 0&&(K.snippetFilepath=E),u!==void 0&&(K.snippetTemplateFilepath=C),K},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{irFilepath:M,output:L,publish:void 0,customConfig:O,workspaceName:r,organization:n,environment:Kre.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:!1,writeUnitTests:p,generateOauthClients:s,generatePaginatedClients:o,license:A}}function Xfv(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,_other:()=>{}}));let u="";return r.raw?.github!=null&&(LTo(r.raw.github)?u=r.raw.github.uri:u=r.raw?.github.repository),{mode:Kre.FernGeneratorExec.OutputMode.github({repoUrl:u,version:e}),path:i}}var xt=Symbol(),Qn=Symbol();var tdv={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.246",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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 ot={};ds(ot,{V1:()=>QZR,V10:()=>$ZR,V11:()=>YZR,V12:()=>XZR,V13:()=>ZZR,V14:()=>kZR,V15:()=>ekR,V16:()=>tkR,V17:()=>rkR,V18:()=>nkR,V19:()=>ikR,V2:()=>LZR,V20:()=>akR,V21:()=>okR,V22:()=>ukR,V23:()=>PtP.FernIrV23,V24:()=>wtP.FernIrV24,V25:()=>jtP.FernIrV25,V26:()=>EtP.FernIrV26,V27:()=>StP.FernIrV27,V28:()=>DtP.FernIrV28,V29:()=>CtP.FernIrV29,V3:()=>UZR,V30:()=>ItP.FernIrV30,V31:()=>MtP.FernIrV31,V32:()=>BtP.FernIrV32,V33:()=>TtP.FernIrV33,V34:()=>qtP.FernIrV34,V35:()=>xtP.FernIrV35,V36:()=>NtP.FernIrV36,V37:()=>RtP.FernIrV37,V38:()=>FtP.FernIrV38,V39:()=>ztP.FernIrV39,V4:()=>VZR,V40:()=>QtP.FernIrV40,V41:()=>LtP.FernIrV41,V42:()=>UtP.FernIrV42,V43:()=>VtP.FernIrV43,V44:()=>WtP.FernIrV44,V45:()=>HtP.FernIrV45,V46:()=>GtP.FernIrV46,V47:()=>JtP.FernIrV47,V48:()=>KtP.FernIrV48,V49:()=>$tP.FernIrV49,V5:()=>WZR,V50:()=>YtP.FernIrV50,V51:()=>XtP.FernIrV51,V52:()=>ZtP.FernIrV52,V53:()=>ktP.FernIrV53,V54:()=>erP.FernIrV54,V55:()=>trP.FernIrV55,V56:()=>rrP.FernIrV56,V57:()=>nrP.FernIrV57,V58:()=>irP.FernIrV58,V59:()=>arP.FernIrV59,V6:()=>HZR,V60:()=>tp,V7:()=>GZR,V8:()=>JZR,V9:()=>KZR});var QZR=Xi(Yvv(),1),LZR=Xi(HAv(),1),UZR=Xi(qDv(),1),VZR=Xi(Bxv(),1),WZR=Xi(v6v(),1),HZR=Xi(jQv(),1),GZR=Xi(THv(),1),JZR=Xi(LXv(),1),KZR=Xi(pib(),1),$ZR=Xi(qlb(),1),YZR=Xi(ivb(),1),XZR=Xi(tPb(),1),ZZR=Xi(ZDb(),1),kZR=Xi($xb(),1),ekR=Xi(Gzb(),1),tkR=Xi(iUb(),1),rkR=Xi(y$b(),1),nkR=Xi(Drg(),1),ikR=Xi(Vcg(),1),akR=Xi(gvg(),1),okR=Xi(ZPg(),1),ukR=Xi(MIg(),1),PtP=Xi(Yqg(),1),wtP=Xi(T3g(),1),jtP=Xi(m7g(),1),EtP=Xi(fLg(),1),StP=Xi(oGg(),1),DtP=Xi(rXg(),1),CtP=Xi(Zt0(),1),ItP=Xi(eu0(),1),MtP=Xi(rd0(),1),BtP=Xi(pv0(),1),TtP=Xi(CHf(),1),qtP=Xi(NE0(),1),xtP=Xi(MB0(),1),NtP=Xi(EF0(),1),RtP=Xi(P70(),1),FtP=Xi(PU0(),1),ztP=Xi(QK0(),1),QtP=Xi(ntm(),1),LtP=Xi(Aum(),1),UtP=Xi(Hpm(),1),VtP=Xi(y0m(),1),WtP=Xi(Ujm(),1),HtP=Xi(CMm(),1),GtP=Xi(AFm(),1),JtP=Xi(g8m(),1),KtP=Xi(yWm(),1),$tP=Xi(yXm(),1),YtP=Xi(jiO(),1),XtP=Xi(WfO(),1),ZtP=Xi(_gO(),1),ktP=Xi(UDO(),1),erP=Xi(w4O(),1),trP=Xi(dWO(),1),rrP=Xi(trA(),1),nrP=Xi(WOA(),1),irP=Xi(k6A(),1),arP=Xi(AtP(),1);function orP({inlinedRequest:e,allTypes:t}){let r=new Set,n=t.reduce((i,a)=>({...i,[Zwd(a.name)]:a}),{});for(let i of e.extends)urP({typeName:i,typeNameToDeclaration:n,referencedTypes:r});for(let i of e.properties)zYa({reference:i.valueType,typeNameToDeclaration:n,referencedTypes:r});return[...r].reduce((i,a)=>{let u=n[a];if(u==null)throw new Error("Cannot find declaration for ID: "+a);return[...i,u.name]},[])}function zYa({reference:e,typeNameToDeclaration:t,referencedTypes:r}){ot.V2.types.TypeReference._visit(e,{primitive:Hc,container:n=>{skR({container:n,typeNameToDeclaration:t,referencedTypes:r})},named:n=>{urP({typeName:n,typeNameToDeclaration:t,referencedTypes:r})},unknown:Hc,void:Hc,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function skR({container:e,typeNameToDeclaration:t,referencedTypes:r}){ot.V2.types.ContainerType._visit(e,{list:n=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r})},set:n=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r})},optional:n=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:n,valueType:i})=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r}),zYa({reference:i,typeNameToDeclaration:t,referencedTypes:r})},literal:Hc,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function urP({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let n=Zwd(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(Zwd(a))}function Zwd(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var srP={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.249",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.0.134-3-g97d4964",[ye.JAVA_SDK]:"0.0.134-3-g97d4964",[ye.JAVA_SPRING]:"0.0.134-3-g97d4964",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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=>ckR(r,n,e.types,i=>{t.push(i)}))}))}}}};function ckR(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:lkR(t,e,r,n),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function lkR(e,t,r,n){let i=e.requestBody;return i==null?{docs:void 0,type:ot.V2.types.TypeReference.void(),typeV2:void 0}:ot.V3.services.http.HttpRequestBody._visit(i,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let u={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=ot.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:u,shape:c,referencedTypes:orP({inlinedRequest:a,allTypes:r}),examples:[]});let p=ot.V2.types.TypeReference.named(u);return{docs:void 0,type:p,typeV2:p}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+i.type)}})}var frP={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:"0.0.11-4-g1c29f6c",[ye.POSTMAN]:"0.0.32-rc0",[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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=>drP(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=>hkR(n))}))}))}})};function drP(e){return ot.V4.types.ExampleTypeShape._visit(e,{object:t=>ot.V3.types.ExampleType.object(fkR(t)),union:t=>ot.V3.types.ExampleType.union(pkR(t)),alias:t=>ot.V3.types.ExampleType.alias(_kR(t)),enum:ot.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function fkR(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:KCe(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function KCe(e){return ot.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:ot.V3.types.ExampleTypeReference.primitive,container:t=>ot.V3.types.ExampleTypeReference.container(dkR(t)),named:t=>ot.V3.types.ExampleTypeReference.named(prP(t)),unknown:ot.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function dkR(e){return ot.V4.types.ExampleContainer._visit(e,{list:t=>ot.V3.types.ExampleContainer.list(t.map(KCe)),set:t=>ot.V3.types.ExampleContainer.set(t.map(KCe)),optional:t=>ot.V3.types.ExampleContainer.optional(t!=null?KCe(t):void 0),map:t=>ot.V3.types.ExampleContainer.map(t.map(r=>({key:KCe(r.key),value:KCe(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function prP(e){return{typeName:e.typeName,shape:drP(e.shape)}}function pkR(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:ot.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>ot.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(prP(t)),singleProperty:t=>ot.V3.types.ExampleSingleUnionTypeProperties.singleProperty(KCe(t)),noProperties:()=>ot.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function _kR(e){return{value:KCe(e.value)}}function hkR(e){return{servicePathParameters:e.servicePathParameters.map(t=>crP(t)),endpointPathParameters:e.servicePathParameters.map(t=>crP(t)),serviceHeaders:e.serviceHeaders.map(t=>lrP(t)),endpointHeaders:e.endpointHeaders.map(t=>lrP(t)),queryParameters:e.queryParameters.map(t=>ykR(t)),request:e.request!=null?vkR(e.request):void 0,response:gkR(e.response)}}function crP(e){return{key:e.key,value:KCe(e.value)}}function lrP(e){return{key:e.wireKey,value:KCe(e.value)}}function ykR(e){return{key:e.wireKey,value:KCe(e.value)}}function vkR(e){return ot.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>ot.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>bkR(r))}),reference:t=>ot.V3.services.http.ExampleRequestBody.reference(KCe(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function bkR(e){return{wireKey:e.wireKey,value:KCe(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function gkR(e){return ot.V4.services.http.ExampleResponse._visit(e,{ok:t=>ot.V3.services.http.ExampleResponse.ok({body:t.body!=null?KCe(t.body):void 0}),error:t=>ot.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?KCe(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function uBr(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function _nt(e){return{...uBr(e.name),wireValue:e.wireValue}}function Woe(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 Hoe(e){return{wireValue:e.wireValue,name:Woe(e.name)}}function QYa(e){return ot.V5.types.ContainerType._visit(e,{list:t=>ot.V4.types.ContainerType.list(sK(t)),set:t=>ot.V4.types.ContainerType.set(sK(t)),map:({keyType:t,valueType:r})=>ot.V4.types.ContainerType.map({keyType:sK(t),valueType:sK(r)}),optional:t=>ot.V4.types.ContainerType.optional(sK(t)),literal:t=>ot.V5.types.Literal._visit(t,{string:r=>ot.V4.types.ContainerType.literal(ot.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function npa(e){return e.map(t=>uBr(t))}function ipa(e){return e.map(t=>Woe(t))}function nde(e){return{fernFilepath:npa(e.fernFilepath),fernFilepathV2:ipa(e.fernFilepath),name:e.name.originalName,nameV2:uBr(e.name),nameV3:Woe(e.name)}}function sK(e){return ot.V5.types.TypeReference._visit(e,{named:t=>ot.V4.types.TypeReference.named(nde(t)),container:t=>ot.V4.types.TypeReference.container(QYa(t)),primitive:t=>ot.V4.types.TypeReference.primitive(t),unknown:ot.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function apa(e){return{name:_nt(e.name),nameV2:Hoe(e.name),valueType:sK(e.valueType),availability:e.availability,docs:e.docs}}function _rP(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>mkR(t))}}function mkR(e){return ot.V5.auth.AuthScheme._visit(e,{basic:ot.V4.auth.AuthScheme.basic,bearer:ot.V4.auth.AuthScheme.bearer,header:t=>ot.V4.auth.AuthScheme.header(apa(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function hrP(e){return{docs:e.docs,id:e.id,url:e.url,name:Woe(e.name)}}function yrP({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let n=e.type!=null?ot.V4.types.Type.alias({aliasOf:sK(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:uBr(e.name.name),nameV3:Woe(e.name.name),fernFilepath:npa(e.name.fernFilepath),fernFilepathV2:ipa(e.name.fernFilepath)},discriminantValueV2:Hoe(e.discriminantValue),discriminantValueV3:ot.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:ot.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:i=>ot.V4.errors.ErrorDeclarationDiscriminantValue.property(Hoe(i.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:Hoe(e.discriminantValue),type:n??ot.V4.types.Type.alias({aliasOf:ot.V4.types.TypeReference.void(),resolvedType:ot.V4.types.ResolvedTypeReference.void()}),typeV2:n,typeV3:e.type!=null?sK(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function $Ce(e){return{jsonExample:e.jsonExample,shape:vrP(e.shape)}}function vrP(e){return ot.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:ot.V4.types.ExampleTypeReferenceShape.primitive,container:t=>ot.V4.types.ExampleTypeReferenceShape.container(AkR(t)),unknown:ot.V4.types.ExampleTypeReferenceShape.unknown,named:t=>ot.V4.types.ExampleTypeReferenceShape.named(OkR(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function OkR(e){return{typeName:nde(e.typeName),shape:a5s(e.shape)}}function AkR(e){return ot.V5.types.ExampleContainer._visit(e,{list:t=>ot.V4.types.ExampleContainer.list(t.map(r=>$Ce(r))),set:t=>ot.V4.types.ExampleContainer.set(t.map(r=>$Ce(r))),optional:t=>ot.V4.types.ExampleContainer.optional(t!=null?$Ce(t):void 0),map:t=>ot.V4.types.ExampleContainer.map(t.map(r=>({key:$Ce(r.key),value:$Ce(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function a5s(e){return ot.V5.types.ExampleTypeShape._visit(e,{alias:t=>ot.V4.types.ExampleTypeShape.alias({value:$Ce(t.value)}),object:t=>ot.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:$Ce(r.value),originalTypeDeclaration:nde(r.originalTypeDeclaration)}))}),union:t=>ot.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:ot.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>ot.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:nde(r.typeName),shape:a5s(r.shape)}),singleProperty:r=>ot.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:vrP(r.shape)}),noProperties:ot.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>ot.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function mrP({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:PkR(e.name),basePath:wkR(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>jkR({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>apa(r)),pathParameters:e.pathParameters.map(r=>OrP(r))}}function PkR(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:npa(e.fernFilepath),fernFilepathV2:ipa(e.fernFilepath)}}function wkR(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function jkR({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:uBr(e.name),nameV2:Woe(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>apa(r)),path:e.path,pathParameters:e.pathParameters.map(r=>OrP(r)),queryParameters:e.queryParameters.map(r=>EkR(r)),requestBody:e.requestBody!=null?SkR(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?DkR(e.sdkRequest):void 0,response:CkR(e.response),errors:e.errors.map(r=>IkR(r)),errorsV2:MkR({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>qkR(r))}}function OrP(e){return{docs:e.docs,availability:e.availability,name:uBr(e.name),nameV2:Woe(e.name),valueType:sK(e.valueType)}}function EkR(e){return{docs:e.docs,availability:e.availability,name:_nt(e.name),nameV2:Hoe(e.name),valueType:sK(e.valueType),allowMultiple:e.allowMultiple}}function SkR(e){return ot.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V4.services.http.HttpRequestBody.inlinedRequestBody({name:Woe(t.name),extends:t.extends.map(r=>nde(r)),properties:t.properties.map(r=>({docs:r.docs,name:Hoe(r.name),valueType:sK(r.valueType)}))}),reference:t=>ot.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:sK(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function DkR(e){return{requestParameterName:Woe(e.requestParameterName),shape:ot.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>ot.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:sK(t.requestBodyType)}),wrapper:t=>ot.V4.services.http.SdkRequestShape.wrapper({wrapperName:Woe(t.wrapperName),bodyKey:Woe(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function CkR(e){let t=e.type!=null?sK(e.type):void 0;return{docs:e.docs,type:t??ot.V4.types.TypeReference.void(),typeV2:t}}function IkR(e){return{docs:e.docs,error:kwd(e.error)}}function MkR({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>BkR({responseError:r,errorResolver:t}))}}function BkR({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:_nt(r.discriminantValue),shape:TkR({responseError:e,declaration:r})}}function TkR({responseError:e,declaration:t}){return t.type==null?ot.V4.services.commons.ResponseErrorShape.noProperties():ot.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:kwd(e.error)})}function kwd(e){return{name:e.name.originalName,nameV2:uBr(e.name),nameV3:Woe(e.name),fernFilepath:npa(e.fernFilepath),fernFilepathV2:ipa(e.fernFilepath)}}function qkR(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>brP(t)),endpointPathParameters:e.endpointPathParameters.map(t=>brP(t)),serviceHeaders:e.serviceHeaders.map(t=>grP(t)),endpointHeaders:e.endpointHeaders.map(t=>grP(t)),queryParameters:e.queryParameters.map(t=>xkR(t)),request:e.request!=null?NkR(e.request):void 0,response:FkR(e.response)}}function brP(e){return{key:e.key,value:$Ce(e.value)}}function grP(e){return{wireKey:e.wireKey,value:$Ce(e.value)}}function xkR(e){return{wireKey:e.wireKey,value:$Ce(e.value)}}function NkR(e){return ot.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>ot.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>RkR(r))}),reference:t=>ot.V4.services.http.ExampleRequestBody.reference($Ce(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function RkR(e){return{wireKey:e.wireKey,value:$Ce(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?nde(e.originalTypeDeclaration):void 0}}function FkR(e){return ot.V5.http.ExampleResponse._visit(e,{ok:t=>ot.V4.services.http.ExampleResponse.ok({body:t.body!=null?$Ce(t.body):void 0}),error:t=>ot.V4.services.http.ExampleResponse.error({error:kwd(t.error),body:t.body!=null?$Ce(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function ArP(e){return{docs:e.docs,availability:e.availability,name:nde(e.name),shape:zkR(e.shape),examples:e.examples.map(t=>QkR(t)),referencedTypes:e.referencedTypes.map(t=>nde(t))}}function zkR(e){return ot.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>ot.V4.types.Type.alias({aliasOf:sK(t),resolvedType:LkR(r)}),enum:t=>ot.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:_nt(r.name),nameV2:Hoe(r.name),value:r.name.wireValue}))}),object:t=>ot.V4.types.Type.object({extends:t.extends.map(r=>nde(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:_nt(r.name),nameV2:Hoe(r.name),valueType:sK(r.valueType)}))}),union:t=>ot.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:_nt(t.discriminant),discriminantV3:Hoe(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:_nt(r.discriminantValue),discriminantValueV2:Hoe(r.discriminantValue),valueType:ot.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>ot.V4.types.TypeReference.named(nde(n)),singleProperty:n=>sK(n.type),noProperties:ot.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:ot.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>ot.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(nde(n)),singleProperty:n=>ot.V4.types.SingleUnionTypeProperties.singleProperty({name:_nt(n.name),nameV2:Hoe(n.name),type:sK(n.type)}),noProperties:ot.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function QkR(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:a5s(e.shape)}}function LkR(e){return ot.V5.types.ResolvedTypeReference._visit(e,{named:t=>ot.V4.types.ResolvedTypeReference.named({name:nde(t.name),shape:UkR(t.shape)}),container:t=>ot.V4.types.ResolvedTypeReference.container(QYa(t)),primitive:ot.V4.types.ResolvedTypeReference.primitive,unknown:ot.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function UkR(e){return ot.V5.types.ShapeType._visit(e,{enum:()=>ot.V5.types.ShapeType.Enum,object:()=>ot.V5.types.ShapeType.Object,union:()=>ot.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var o5s=class{errors;constructor(t){this.errors=t.errors.reduce((r,n)=>({...r,[PrP(n.name)]:n}),{})}getDeclaration(t){let r=PrP(t),n=this.errors[r];if(n==null)throw new Error("Error does not exist: "+r);return n}};function PrP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}var u5s=class{types;constructor(t){this.types=t.types.reduce((r,n)=>({...r,[wrP(n.name)]:n}),{})}resolveTypeReference(t){return ot.V5.types.TypeReference._visit(t,{container:r=>ot.V4.types.ResolvedTypeReference.container(QYa(r)),named:r=>{let n=this.getTypeDeclaration(r);return n.shape._type==="alias"?this.resolveTypeReference(n.shape.aliasOf):ot.V4.types.ResolvedTypeReference.named({name:nde(r),shape:VkR(n.shape._type)})},primitive:ot.V4.types.ResolvedTypeReference.primitive,unknown:ot.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=wrP(t),n=this.types[r];if(n==null)throw new Error("Type does not exist: "+n);return n}};function wrP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function VkR(e){switch(e){case"object":return ot.V4.types.ShapeType.Object;case"union":return ot.V4.types.ShapeType.Union;case"enum":return ot.V4.types.ShapeType.Enum;default:cc(e)}}var jrP={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[ye.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new u5s(e),r=new o5s(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:_rP(e.auth),headers:e.headers.map(n=>apa(n)),types:e.types.map(n=>ArP(n)),services:{http:e.services.map(n=>mrP({service:n,errorResolver:r})),websocket:[]},errors:e.errors.map(n=>yrP({errorDeclaration:n,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:_nt(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:Hoe(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=>hrP(n)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?Woe(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:ot.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:ot.V4.ir.ErrorDiscriminationStrategy.statusCode,property:n=>ot.V4.ir.ErrorDiscriminationStrategy.property({discriminant:Hoe(n.discriminant),contentProperty:Hoe(n.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var ErP={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[ye.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[ye.OPENAPI]:"0.0.16-1-ga2c0ada",[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?ot.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 SrP={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.268",[ye.TYPESCRIPT_EXPRESS]:"0.0.268",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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",u=a.toUpperCase(),c=g9(i);return{...t,name:{name:{originalName:n,camelCase:{safeName:i,unsafeName:i},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:u,unsafeName:u},pascalCase:{safeName:c,unsafeName:c}},fernFilepath:t.name.fernFilepath}}})})};var IrP={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[ye.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[ye.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[ye.OPENAPI_PYTHON_CLIENT]:"0.0.0",[ye.OPENAPI]:"0.0.20-1-gbbeb9bd",[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:WkR(e.auth),headers:e.headers.map(t=>s5s(t)),types:e.types.map(t=>HkR(t)),errors:e.errors.map(t=>ZkR(t)),services:e.services.map(t=>kkR(t))})};function ejd(e){return e.allParts}function WkR(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:ot.V7.auth.AuthScheme.header(s5s(t)))}}function s5s(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:IPe(e.valueType)}}function IPe(e){return ot.V8.types.TypeReference._visit(e,{container:t=>ot.V7.types.TypeReference.container(MrP(t)),named:t=>ot.V7.types.TypeReference.named(sBr(t)),primitive:ot.V7.types.TypeReference.primitive,unknown:ot.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function MrP(e){return ot.V8.types.ContainerType._visit(e,{list:t=>ot.V7.types.ContainerType.list(IPe(t)),optional:t=>ot.V7.types.ContainerType.optional(IPe(t)),set:t=>ot.V7.types.ContainerType.set(IPe(t)),map:({keyType:t,valueType:r})=>ot.V7.types.ContainerType.map({keyType:IPe(t),valueType:IPe(r)}),literal:ot.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function sBr(e){return{name:e.name,fernFilepath:ejd(e.fernFilepath)}}function HkR(e){return{docs:e.docs,availability:e.availability,name:sBr(e.name),shape:GkR(e.shape),examples:e.examples.map(t=>YkR(t)),referencedTypes:e.referencedTypes.map(t=>sBr(t))}}function GkR(e){return ot.V8.types.Type._visit(e,{alias:t=>ot.V7.types.Type.alias({aliasOf:IPe(t.aliasOf),resolvedType:JkR(t.resolvedType)}),enum:ot.V7.types.Type.enum,object:t=>ot.V7.types.Type.object({extends:t.extends.map(r=>sBr(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:IPe(r.valueType)}))}),union:t=>ot.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>KkR(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function JkR(e){return ot.V8.types.ResolvedTypeReference._visit(e,{container:t=>ot.V7.types.ResolvedTypeReference.container(MrP(t)),named:t=>ot.V7.types.ResolvedTypeReference.named({name:sBr(t.name),shape:t.shape}),primitive:ot.V7.types.ResolvedTypeReference.primitive,unknown:ot.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function KkR(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:$kR(e.shape)}}function $kR(e){return ot.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(sBr(t)),singleProperty:t=>ot.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:IPe(t.type)}),noProperties:ot.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function YkR(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:tjd(e.shape)}}function tjd(e){return ot.V8.types.ExampleTypeShape._visit(e,{alias:t=>ot.V7.types.ExampleTypeShape.alias({value:h3e(t.value)}),enum:ot.V7.types.ExampleTypeShape.enum,object:t=>ot.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:h3e(r.value),originalTypeDeclaration:sBr(r.originalTypeDeclaration)}))}),union:t=>ot.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:XkR(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function h3e(e){return{jsonExample:e.jsonExample,shape:BrP(e.shape)}}function BrP(e){return ot.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>ot.V7.types.ExampleTypeReferenceShape.named({typeName:sBr(t.typeName),shape:tjd(t.shape)}),container:t=>ot.V7.types.ExampleTypeReferenceShape.container(ot.V8.types.ExampleContainer._visit(t,{list:r=>ot.V7.types.ExampleContainer.list(r.map(n=>h3e(n))),set:r=>ot.V7.types.ExampleContainer.set(r.map(n=>h3e(n))),optional:r=>ot.V7.types.ExampleContainer.optional(r!=null?h3e(r):void 0),map:r=>ot.V7.types.ExampleContainer.map(r.map(n=>({key:h3e(n.key),value:h3e(n.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:ot.V7.types.ExampleTypeReferenceShape.primitive,unknown:ot.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function XkR(e){return ot.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:sBr(t.typeName),shape:tjd(t.shape)}),singleProperty:t=>ot.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:BrP(t.shape)}),noProperties:ot.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function ZkR(e){return{docs:e.docs,name:rjd(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?IPe(e.type):void 0,statusCode:e.statusCode}}function rjd(e){return{name:e.name,fernFilepath:ejd(e.fernFilepath)}}function kkR(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:ejd(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>TrP(t)),headers:e.headers.map(t=>s5s(t)),endpoints:e.endpoints.map(t=>eeF(t))}}function TrP(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:IPe(e.valueType)}}function eeF(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>teF(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>TrP(t)),sdkRequest:e.sdkRequest!=null?neF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?aeF(e.requestBody):void 0,response:oeF(e.response),headers:e.headers.map(t=>s5s(t)),queryParameters:e.queryParameters.map(t=>reF(t)),examples:e.examples.map(t=>ueF(t))}}function teF(e){return{docs:e.docs,error:rjd(e.error)}}function reF(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:IPe(e.valueType),allowMultiple:e.allowMultiple}}function neF(e){return{requestParameterName:e.requestParameterName,shape:ieF(e.shape)}}function ieF(e){return ot.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:IPe(t.requestBodyType)}),wrapper:ot.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function aeF(e){return ot.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>sBr(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:IPe(r.valueType)}))}),reference:t=>ot.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:IPe(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function oeF(e){return{docs:e.docs,type:e.type!=null?IPe(e.type):void 0}}function ueF(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>DrP(t)),endpointPathParameters:e.endpointPathParameters.map(t=>DrP(t)),queryParameters:e.queryParameters.map(t=>seF(t)),serviceHeaders:e.serviceHeaders.map(t=>CrP(t)),endpointHeaders:e.endpointHeaders.map(t=>CrP(t)),request:e.request!=null?ceF(e.request):void 0,response:leF(e.response)}}function DrP(e){return{key:e.key,value:h3e(e.value)}}function seF(e){return{wireKey:e.wireKey,value:h3e(e.value)}}function CrP(e){return{wireKey:e.wireKey,value:h3e(e.value)}}function ceF(e){return ot.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>ot.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:h3e(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?sBr(r.originalTypeDeclaration):void 0}))}),reference:t=>ot.V7.http.ExampleRequestBody.reference(h3e(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function leF(e){return ot.V8.http.ExampleResponse._visit(e,{ok:t=>ot.V7.http.ExampleResponse.ok({body:t.body!=null?h3e(t.body):void 0}),error:t=>ot.V7.http.ExampleResponse.error({error:rjd(t.error),body:t.body!=null?h3e(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var qrP={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[ye.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[ye.JAVA_SDK]:"0.0.134-4-gef1ec4f",[ye.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[ye.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[ye.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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()===CL.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var xrP={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.STOPLIGHT]:Qn,[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Rb(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 NrP={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[ye.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.0.134-15-ge1ac358",[ye.JAVA_SDK]:"0.0.134-15-ge1ac358",[ye.JAVA_SPRING]:"0.0.134-15-ge1ac358",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.STOPLIGHT]:Qn,[ye.OPENAPI]:xt,[ye.POSTMAN]:"0.0.40-1-g9aa2117",[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:feF(e.auth,t)})};function feF(e,t){return{...e,schemes:e.schemes.map(r=>deF(r,t))}}function deF(e,{taskContext:t,targetGenerator:r}){return ot.V11.auth.AuthScheme._visit(e,{bearer:ot.V10.auth.AuthScheme.bearer,basic:ot.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."):ot.V10.auth.AuthScheme.header({docs:n.docs,availability:{status:ot.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 FrP={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[ye.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.1.0-1-gdb5c636",[ye.JAVA_SDK]:"0.1.0-1-gdb5c636",[ye.JAVA_SPRING]:"0.1.0-1-gdb5c636",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.STOPLIGHT]:"0.0.23-8-g479c860",[ye.OPENAPI]:"0.0.22-1-g1c86b58",[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let n=Rb(e.types,i=>({...i,shape:ot.V12.types.Type._visit(i.shape,{union:ot.V11.types.Type.union,enum:ot.V11.types.Type.enum,object:ot.V11.types.Type.object,alias:a=>ot.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:ot.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:ot.V11.types.ResolvedTypeReference.container,primitive:ot.V11.types.ResolvedTypeReference.primitive,named:u=>u.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(RrP({taskContext:t,targetGenerator:r})):ot.V11.types.ResolvedTypeReference.named({shape:u.shape,name:u.name}),unknown:ot.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(RrP({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:n,services:Rb(e.services,i=>peF(i,{taskContext:t,targetGenerator:r}))}}};function RrP(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 peF(e,t){return{...e,endpoints:e.endpoints.map(r=>_eF(r,t))}}function _eF(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?ot.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:ot.V11.http.HttpRequestBody.inlinedRequestBody,reference:ot.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 zrP={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:Rb(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:ot.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 QrP={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V14.types.Type._visit(r.shape,{union:n=>ot.V13.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:jk(i.valueType)})),types:n.types.map(i=>veF(i))}),enum:ot.V13.types.Type.enum,object:n=>ot.V13.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:jk(i.valueType)}))}),alias:n=>ot.V13.types.Type.alias({aliasOf:jk(n.aliasOf),resolvedType:geF(n.resolvedType)}),undiscriminatedUnion:n=>ot.V13.types.Type.undiscriminatedUnion(meF(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:heF(e.auth),headers:e.headers.map(r=>ajd(r)),types:t,services:Rb(e.services,r=>OeF(r)),errors:Rb(e.errors,r=>DeF(r))}}};function heF(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:ot.V13.auth.AuthScheme.header(yeF(t)))}}function yeF(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:jk(e.valueType)}}function ajd(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:jk(e.valueType)}}function jk(e){return ot.V14.types.TypeReference._visit(e,{container:t=>ot.V13.types.TypeReference.container(LrP(t)),primitive:t=>t==="DATE"?ot.V13.types.TypeReference.primitive(ot.V13.types.PrimitiveType.String):ot.V13.types.TypeReference.primitive(t),named:ot.V13.types.TypeReference.named,unknown:ot.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function LrP(e){return ot.V14.types.ContainerType._visit(e,{list:t=>ot.V13.types.ContainerType.list(jk(t)),optional:t=>ot.V13.types.ContainerType.optional(jk(t)),set:t=>ot.V13.types.ContainerType.set(jk(t)),map:({keyType:t,valueType:r})=>ot.V13.types.ContainerType.map({keyType:jk(t),valueType:jk(r)}),literal:ot.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function veF(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:beF(e.shape)}}function beF(e){return ot.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:jk(t.type)}),noProperties:ot.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function geF(e){return ot.V14.types.ResolvedTypeReference._visit(e,{container:t=>ot.V13.types.ResolvedTypeReference.container(LrP(t)),named:ot.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?ot.V13.types.ResolvedTypeReference.primitive(ot.V13.types.PrimitiveType.String):ot.V13.types.ResolvedTypeReference.primitive(t),unknown:ot.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function meF(e){return{members:e.members.map(t=>({...t,type:jk(t.type)}))}}function OeF(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>UrP(t)),headers:e.headers.map(t=>ajd(t)),endpoints:e.endpoints.map(t=>AeF(t))}}function UrP(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:jk(e.valueType)}}function AeF(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=>UrP(t)),sdkRequest:e.sdkRequest!=null?weF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?EeF(e.requestBody):void 0,response:e.response!=null?njd(e.response):void 0,headers:e.headers.map(t=>ajd(t)),queryParameters:e.queryParameters.map(t=>PeF(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?ijd(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?SeF(e.sdkResponse):void 0}}function PeF(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:jk(e.valueType),allowMultiple:e.allowMultiple}}function weF(e){return{requestParameterName:e.requestParameterName,shape:jeF(e.shape)}}function jeF(e){return ot.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:jk(t.requestBodyType)}),wrapper:ot.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function EeF(e){return ot.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:jk(r.valueType)}))}),reference:t=>ot.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:jk(t.requestBodyType)}),fileUpload:t=>ot.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:jk(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function njd(e){return{docs:e.docs,responseBodyType:jk(e.responseBodyType)}}function ijd(e){return{dataEventType:jk(e.dataEventType),terminator:e.terminator}}function SeF(e){return ot.V14.http.SdkResponse._visit(e,{streaming:t=>ot.V13.http.SdkResponse.streaming(ijd(t)),nonStreaming:t=>ot.V13.http.SdkResponse.nonStreaming(njd(t)),maybeStreaming:t=>ot.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:njd(t.nonStreaming),streaming:ijd(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function DeF(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?jk(e.type):void 0,statusCode:e.statusCode}}var VrP={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[ye.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.0.52-3-gd9df38df",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V15.types.Type._visit(r.shape,{union:n=>ot.V14.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:Ek(i.valueType)})),types:n.types.map(i=>MeF(i))}),enum:ot.V14.types.Type.enum,object:n=>ot.V14.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:Ek(i.valueType)}))}),alias:n=>ot.V14.types.Type.alias({aliasOf:Ek(n.aliasOf),resolvedType:TeF(n.resolvedType)}),undiscriminatedUnion:n=>ot.V14.types.Type.undiscriminatedUnion(qeF(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:CeF(e.auth),headers:e.headers.map(r=>sjd(r)),types:t,services:Rb(e.services,r=>xeF(r)),errors:Rb(e.errors,r=>UeF(r))}}};function CeF(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:ot.V14.auth.AuthScheme.header(IeF(t)))}}function IeF(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:Ek(e.valueType)}}function sjd(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:Ek(e.valueType)}}function Ek(e){return ot.V15.types.TypeReference._visit(e,{container:t=>ot.V14.types.TypeReference.container(WrP(t)),primitive:t=>t==="BASE_64"?ot.V14.types.TypeReference.primitive(ot.V14.types.PrimitiveType.String):ot.V14.types.TypeReference.primitive(t),named:ot.V14.types.TypeReference.named,unknown:ot.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function WrP(e){return ot.V15.types.ContainerType._visit(e,{list:t=>ot.V14.types.ContainerType.list(Ek(t)),optional:t=>ot.V14.types.ContainerType.optional(Ek(t)),set:t=>ot.V14.types.ContainerType.set(Ek(t)),map:({keyType:t,valueType:r})=>ot.V14.types.ContainerType.map({keyType:Ek(t),valueType:Ek(r)}),literal:ot.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function MeF(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:BeF(e.shape)}}function BeF(e){return ot.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:Ek(t.type)}),noProperties:ot.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function TeF(e){return ot.V15.types.ResolvedTypeReference._visit(e,{container:t=>ot.V14.types.ResolvedTypeReference.container(WrP(t)),named:ot.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?ot.V14.types.ResolvedTypeReference.primitive(ot.V14.types.PrimitiveType.String):ot.V14.types.ResolvedTypeReference.primitive(t),unknown:ot.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function qeF(e){return{members:e.members.map(t=>({...t,type:Ek(t.type)}))}}function xeF(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>HrP(t)),headers:e.headers.map(t=>sjd(t)),endpoints:e.endpoints.map(t=>NeF(t))}}function HrP(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ek(e.valueType)}}function NeF(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=>HrP(t)),sdkRequest:e.sdkRequest!=null?FeF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?QeF(e.requestBody):void 0,response:e.response!=null?ojd(e.response):void 0,headers:e.headers.map(t=>sjd(t)),queryParameters:e.queryParameters.map(t=>ReF(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?ujd(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?LeF(e.sdkResponse):void 0}}function ReF(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ek(e.valueType),allowMultiple:e.allowMultiple}}function FeF(e){return{requestParameterName:e.requestParameterName,shape:zeF(e.shape)}}function zeF(e){return ot.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:Ek(t.requestBodyType)}),wrapper:ot.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function QeF(e){return ot.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:Ek(r.valueType)}))}),reference:t=>ot.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:Ek(t.requestBodyType)}),fileUpload:t=>ot.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:Ek(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function ojd(e){return{docs:e.docs,responseBodyType:Ek(e.responseBodyType)}}function ujd(e){return{dataEventType:Ek(e.dataEventType),terminator:e.terminator}}function LeF(e){return ot.V15.http.SdkResponse._visit(e,{streaming:t=>ot.V14.http.SdkResponse.streaming(ujd(t)),nonStreaming:t=>ot.V14.http.SdkResponse.nonStreaming(ojd(t)),maybeStreaming:t=>ot.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:ojd(t.nonStreaming),streaming:ujd(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function UeF(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?Ek(e.type):void 0,statusCode:e.statusCode}}var GrP={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[ye.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[ye.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[ye.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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:Rb(e.services,n=>({...n,pathParameters:cjd(n.pathParameters),endpoints:n.endpoints.map(i=>({...i,allPathParameters:cjd(i.allPathParameters),pathParameters:cjd(i.pathParameters)}))}))}};function cjd(e){return e.map(t=>VeF(t))}function VeF(e){return{...e,availability:{status:ot.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var JrP={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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 KrP={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[ye.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[ye.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.3.0-3-ge125e311",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:Rb(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 YrP={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[ye.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[ye.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:"0.0.44-1-gbf4b0f3",[ye.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Rb(e.services,r=>WeF(r,t)),types:Rb(e.types,r=>YeF(r,t))})};function WeF(e,t){return{...e,endpoints:e.endpoints.map(r=>HeF(r,t))}}function HeF(e,t){return{...e,examples:e.examples.map(r=>GeF(r,t))}}function GeF(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>ljd(r,t)),servicePathParameters:e.servicePathParameters.map(r=>ljd(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>ljd(r,t)),serviceHeaders:e.serviceHeaders.map(r=>$rP(r,t)),endpointHeaders:e.endpointHeaders.map(r=>$rP(r,t)),queryParameters:e.queryParameters.map(r=>JeF(r,t)),request:e.request!=null?KeF(e.request,t):void 0,response:$eF(e.response,t)}}function ljd(e,t){return{key:e.key,value:y3e(e.value,t)}}function $rP(e,t){return{wireKey:e.wireKey,value:y3e(e.value,t)}}function JeF(e,t){return{wireKey:e.wireKey,value:y3e(e.value,t)}}function KeF(e,t){return ot.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>ot.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(n=>({wireKey:n.wireKey,value:y3e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),reference:r=>ot.V18.http.ExampleRequestBody.reference(y3e(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function $eF(e,t){return ot.V19.http.ExampleResponse._visit(e,{ok:r=>ot.V18.http.ExampleResponse.ok({body:r.body!=null?y3e(r.body,t):void 0}),error:r=>ot.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?y3e(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function YeF(e,t){return{...e,examples:e.examples.map(r=>XeF(r,t))}}function XeF(e,t){return{...e,shape:fjd(e.shape,t)}}function fjd(e,t){return ot.V19.types.ExampleTypeShape._visit(e,{alias:r=>ot.V18.types.ExampleTypeShape.alias({value:y3e(r.value,t)}),object:r=>ot.V18.types.ExampleTypeShape.object({properties:r.properties.map(n=>({wireKey:n.wireKey,value:y3e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),union:r=>ot.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:ot.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:n=>ot.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:n.jsonExample,shape:XrP(n.shape,t)}),samePropertiesAsObject:n=>ot.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:n.typeName,shape:fjd(n.shape,t)}),noProperties:ot.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:ot.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function y3e(e,t){return{jsonExample:e.jsonExample,shape:XrP(e.shape,t)}}function XrP(e,t){return ot.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>ot.V18.types.ExampleTypeReferenceShape.primitive(ZeF(r,t)),named:r=>ot.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:fjd(r.shape,t)}),container:r=>ot.V18.types.ExampleTypeReferenceShape.container(ot.V19.types.ExampleContainer._visit(r,{list:n=>ot.V18.types.ExampleContainer.list(n.map(i=>y3e(i,t))),set:n=>ot.V18.types.ExampleContainer.set(n.map(i=>y3e(i,t))),optional:n=>ot.V18.types.ExampleContainer.optional(n!=null?y3e(n,t):void 0),map:n=>ot.V18.types.ExampleContainer.map(n.map(i=>({key:y3e(i.key,t),value:y3e(i.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:ot.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function ZeF(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 ZrP={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[ye.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.26-rc0-3-gdfabd674",[ye.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[ye.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[ye.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[ye.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[ye.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:"0.0.0",[ye.GO_SDK]:"0.0.0",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Rb(e.services,r=>keF(r,t))})};function keF(e,t){return{...e,endpoints:e.endpoints.map(r=>etF(r,t))}}function etF(e,t){return{...e,response:e.response!=null?krP(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?ttF(e.sdkResponse,t):void 0}}function krP(e,t){return ot.V20.http.HttpResponse._visit(e,{fileDownload:()=>enP(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function ttF(e,t){return ot.V20.http.SdkResponse._visit(e,{fileDownload:()=>enP(t),streaming:ot.V19.http.SdkResponse.streaming,maybeStreaming:r=>ot.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:krP(r.nonStreaming,t)}),json:ot.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function enP({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 tnP={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Rb(e.services,r=>rtF(r,t))})};function rtF(e,t){return{...e,endpoints:e.endpoints.map(r=>ntF(r,t))}}function ntF(e,t){return{...e,streamingResponse:e.streamingResponse!=null?djd(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?itF(e.sdkResponse,t):void 0}}function djd(e,{taskContext:t,targetGenerator:r}){return{dataEventType:ot.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 itF(e,t){return ot.V21.http.SdkResponse._visit(e,{fileDownload:ot.V20.http.SdkResponse.fileDownload,streaming:r=>ot.V20.http.SdkResponse.streaming(djd(r,t)),maybeStreaming:r=>ot.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:djd(r.streaming,t),nonStreaming:r.nonStreaming}),json:ot.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var rnP={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.5.0-3-gac7ce7c",[ye.GO_MODEL]:"0.0.14-8-g2fa39f7",[ye.GO_SDK]:"0.0.14-8-g2fa39f7",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:Rb(e.services,t=>atF(t))})};function atF(e){return{...e,endpoints:e.endpoints.map(t=>otF(t))}}function otF(e){return{...e,...e.response!=null?ot.V22.http.HttpResponse._visit(e.response,{json:t=>({response:ot.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:ot.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:ot.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:ot.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:ot.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var anP={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[ye.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.7.4-rc3-4-g6cf92f81",[ye.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:"0.0.28-3-g112d3dd",[ye.STOPLIGHT]:"0.0.28-3-g112d3dd",[ye.POSTMAN]:"0.0.44-4-gddab2ae",[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],n={};for(let[i,a]of Object.entries(e.services)){let u=[];for(let c of a.endpoints){let p=utF(c);p==null?r.push(c):u.push(p)}n[i]={...a,endpoints:u,headers:a.headers.map(c=>_jd(c)),pathParameters:a.pathParameters.map(c=>c5s(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=>ctF(i))},headers:e.headers.map(i=>_jd(i)),types:Rb(e.types,i=>ltF(i)),services:n,errors:Rb(e.errors,i=>ytF(i)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(i=>c5s(i)),variables:e.variables.map(i=>vtF(i))}}};function utF(e){let t;if(!(e.requestBody!=null&&(t=stF(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>_jd(r)),pathParameters:e.pathParameters.map(r=>c5s(r)),allPathParameters:e.allPathParameters.map(r=>c5s(r)),queryParameters:e.queryParameters.map(r=>btF(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:gtF(e.sdkRequest.shape)}:void 0,response:e.response!=null?mtF(e.response):void 0,examples:e.examples.map(r=>OtF(r))}}function stF(e){switch(e.type){case"bytes":return;case"fileUpload":return ot.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>PtF(t))});case"inlinedRequestBody":return ot.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>wtF(t))});case"reference":return ot.V22.http.HttpRequestBody.reference({...e,requestBodyType:Sk(e.requestBodyType)});default:cc(e)}}function _jd(e){return{...e,valueType:Sk(e.valueType)}}function ctF(e){return e._visit({bearer:ot.V22.auth.AuthScheme.bearer,basic:ot.V22.auth.AuthScheme.basic,header:t=>ot.V22.auth.AuthScheme.header({...t,valueType:Sk(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function ltF(e){return{...e,shape:ftF(e.shape),examples:e.examples.map(t=>dtF(t))}}function ftF(e){return e._visit({alias:t=>ot.V22.types.Type.alias({...t,aliasOf:Sk(t.aliasOf),resolvedType:_tF(t.resolvedType)}),enum:ot.V22.types.Type.enum,object:t=>ot.V22.types.Type.object({...t,properties:t.properties.map(r=>nnP(r))}),union:t=>ot.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>nnP(r)),types:t.types.map(r=>({...r,shape:htF(r.shape)}))}),undiscriminatedUnion:t=>ot.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:Sk(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function dtF(e){return{...e,shape:hjd(e.shape)}}function hjd(e){return e._visit({alias:t=>ot.V22.types.ExampleTypeShape.alias({...t,value:hnt(t.value)}),enum:ot.V22.types.ExampleTypeShape.enum,object:t=>ot.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:hnt(r.value)}))}),union:t=>ot.V22.types.ExampleTypeShape.union({...t,properties:ptF(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function hnt(e){return{...e,shape:yjd(e.shape)}}function yjd(e){return e._visit({primitive:t=>ot.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:ot.V22.types.ExamplePrimitive.integer,double:ot.V22.types.ExamplePrimitive.double,string:ot.V22.types.ExamplePrimitive.string,boolean:ot.V22.types.ExamplePrimitive.boolean,long:ot.V22.types.ExamplePrimitive.long,datetime:r=>ot.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:ot.V22.types.ExamplePrimitive.date,uuid:ot.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>ot.V22.types.ExampleTypeReferenceShape.named({...t,shape:hjd(t.shape)}),container:t=>ot.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>ot.V22.types.ExampleContainer.list(r.map(n=>hnt(n))),set:r=>ot.V22.types.ExampleContainer.set(r.map(n=>hnt(n))),optional:r=>ot.V22.types.ExampleContainer.optional(r!=null?hnt(r):void 0),map:r=>ot.V22.types.ExampleContainer.map(r.map(n=>({key:hnt(n.key),value:hnt(n.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:ot.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function ptF(e){return e._visit({singleProperty:t=>ot.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:yjd(t.shape)}),noProperties:ot.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>ot.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:hjd(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function Sk(e){return e._visit({container:t=>ot.V22.types.TypeReference.container(onP(t)),primitive:ot.V22.types.TypeReference.primitive,named:ot.V22.types.TypeReference.named,unknown:ot.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function onP(e){return e._visit({list:t=>ot.V22.types.ContainerType.list(Sk(t)),set:t=>ot.V22.types.ContainerType.set(Sk(t)),optional:t=>ot.V22.types.ContainerType.optional(Sk(t)),map:t=>ot.V22.types.ContainerType.map({keyType:Sk(t.keyType),valueType:Sk(t.valueType)}),literal:ot.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function _tF(e){return e._visit({container:t=>ot.V22.types.ResolvedTypeReference.container(onP(t)),primitive:ot.V22.types.ResolvedTypeReference.primitive,named:ot.V22.types.ResolvedTypeReference.named,unknown:ot.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function nnP(e){return{...e,valueType:Sk(e.valueType)}}function htF(e){return e._visit({noProperties:ot.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>ot.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:Sk(t.type)}),samePropertiesAsObject:ot.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function ytF(e){return{...e,type:e.type!=null?Sk(e.type):void 0}}function vtF(e){return{...e,type:Sk(e.type)}}function c5s(e){return{...e,valueType:Sk(e.valueType)}}function btF(e){return{...e,valueType:Sk(e.valueType)}}function gtF(e){return e._visit({justRequestBody:t=>ot.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:Sk(t.requestBodyType)}),wrapper:ot.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function mtF(e){return e._visit({json:t=>ot.V22.http.HttpResponse.json({...t,responseBodyType:Sk(t.responseBodyType)}),fileDownload:ot.V22.http.HttpResponse.fileDownload,streaming:t=>ot.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>ot.V22.http.StreamingResponseChunkType.json(Sk(r)),text:ot.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 OtF(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>pjd(t)),servicePathParameters:e.servicePathParameters.map(t=>pjd(t)),endpointPathParameters:e.endpointPathParameters.map(t=>pjd(t)),serviceHeaders:e.serviceHeaders.map(t=>inP(t)),endpointHeaders:e.endpointHeaders.map(t=>inP(t)),queryParameters:e.queryParameters.map(t=>AtF(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>ot.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:hnt(r.value)}))}),reference:t=>ot.V22.http.ExampleRequestBody.reference({...t,shape:yjd(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>ot.V22.http.ExampleResponse.ok({...t,body:t.body!=null?hnt(t.body):void 0}),error:t=>ot.V22.http.ExampleResponse.error({...t,body:t.body!=null?hnt(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function pjd(e){return{...e,value:hnt(e.value)}}function AtF(e){return{...e,value:hnt(e.value)}}function inP(e){return{...e,value:hnt(e.value)}}function PtF(e){return e._visit({file:ot.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>ot.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:Sk(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function wtF(e){return{...e,valueType:Sk(e.valueType)}}var $0={};ds($0,{V23:()=>au8,V24:()=>ou8,V25:()=>uu8,V26:()=>su8,V27:()=>cu8,V28:()=>lu8,V29:()=>fu8,V30:()=>du8,V31:()=>pu8,V32:()=>_u8,V33:()=>hu8,V34:()=>yu8,V35:()=>vu8,V36:()=>bu8,V37:()=>gu8,V38:()=>mu8,V39:()=>Ou8,V40:()=>Au8,V41:()=>Pu8,V42:()=>wu8,V43:()=>ju8,V44:()=>Eu8,V45:()=>Su8,V46:()=>Du8,V47:()=>Cu8,V48:()=>Iu8,V49:()=>Mu8,V50:()=>Bu8,V51:()=>Tu8,V52:()=>qu8,V53:()=>xu8,V54:()=>Nu8,V55:()=>Ru8,V56:()=>Fu8,V57:()=>zu8,V58:()=>Qu8,V59:()=>Lu8,V60:()=>y0});var au8=Xi(Fc(),1),ou8=Xi(fc(),1),uu8=Xi(ec(),1),su8=Xi(Vs(),1),cu8=Xi(Ts(),1),lu8=Xi(qs(),1),fu8=Xi(xs(),1),du8=Xi(ws(),1),pu8=Xi(Os(),1),_u8=Xi(is(),1),hu8=Xi(_u(),1),yu8=Xi(su(),1),vu8=Xi(Ko(),1),bu8=Xi($o(),1),gu8=Xi(Go(),1),mu8=Xi(Lo(),1),Ou8=Xi(yo(),1),Au8=Xi(vo(),1),Pu8=Xi(fo(),1),wu8=Xi(oo(),1),ju8=Xi(ao(),1),Eu8=Xi(no(),1),Su8=Xi(Xa(),1),Du8=Xi(Va(),1),Cu8=Xi(La(),1),Iu8=Xi(Fa(),1),Mu8=Xi(Ba(),1),Bu8=Xi(Ia(),1),Tu8=Xi(Oa(),1),qu8=Xi(va(),1),xu8=Xi(Pn(),1),Nu8=Xi(zP(),1),Ru8=Xi(gP(),1),Fu8=Xi(mP(),1),zu8=Xi($A(),1),Qu8=Xi(YA(),1),Lu8=Xi(XA(),1);var OD1={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var AD1={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.4.9-1-ge0997b3",[ye.JAVA_SDK]:"0.4.9-1-ge0997b3",[ye.JAVA_SPRING]:"0.4.9-1-ge0997b3",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],n=[],i={};for(let[a,u]of Object.entries(e.services)){let c=[];for(let p of u.endpoints){let s;if(p.sdkRequest!=null&&(s=Uu8(p.sdkRequest),s==null)){r.push(p);continue}if(p.response!=null){let o=p.response._visit({fileDownload:l=>ot.V24.HttpResponse.fileDownload(l),json:l=>ot.V24.HttpResponse.json(l),streaming:l=>ot.V24.HttpResponse.streaming(l),text:()=>(n.push(p),ot.V24.HttpResponse.json({docs:void 0,responseBodyType:ot.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});c.push({...p,sdkRequest:s,response:o})}else c.push({...p,sdkRequest:s,response:void 0})}i[a]={...u,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 Uu8(e){let t=e.shape;if(t.type==="wrapper")return{shape:ot.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:ot.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var wD1={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[ye.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Ju8(r)])),headers:e.headers.map(t=>mGc(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(n=>Vu8(n))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,Wu8(r)]))})};function Vu8(e){return{...e,headers:e.headers.map(t=>mGc(t)),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Wu8(e){return{...e,endpoints:e.endpoints.map(t=>Hu8(t)),headers:e.headers.map(t=>mGc(t)),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Hu8(e){return{...e,headers:e.headers.map(t=>mGc(t)),queryParameters:e.queryParameters.map(t=>Gu8(t)),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function mGc(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Gu8(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Ju8(e){return{...e,shape:e.shape._visit({union:t=>ot.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>PD1(r))}),object:t=>ot.V25.Type.object({...t,properties:t.properties.map(r=>PD1(r))}),enum:t=>ot.V25.Type.enum({...t,values:t.values.map(r=>Ku8(r))}),alias:t=>ot.V25.Type.alias(t),undiscriminatedUnion:t=>ot.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function PD1(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Ku8(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var jD1={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.6.1-3-g94ee67a",[ye.GO_MODEL]:"0.6.1-3-g94ee67a",[ye.GO_SDK]:"0.6.1-3-g94ee67a",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,$u8(r)]))})};function $u8(e){return{...e,endpoints:e.endpoints.map(t=>Yu8(t))}}function Yu8(e){return{...e,response:e.response!=null?Xu8(e.response):void 0}}function Xu8(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?ot.V26.HttpResponse.json(t):ot.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var ED1={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[ye.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.8.1-1-g0f40bf18",[ye.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.9.0-2-g6b0be0e",[ye.GO_MODEL]:"0.9.0-2-g6b0be0e",[ye.GO_SDK]:"0.9.0-2-g6b0be0e",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:Es8(e.auth),headers:AGc(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Ms8(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,us8(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,ts8(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,es8(r)])),pathParameters:OGc(e.pathParameters),variables:Zu8(e.variables)})};function Zu8(e){return e.map(t=>ku8(t))}function ku8(e){return{...e,type:CY(e.type)}}function es8(e){return{...e,type:e.type!=null?CY(e.type):void 0}}function ts8(e){return e.map(t=>rs8(t))}function rs8(e){return{...e,headers:AGc(e.headers),payload:ns8(e.payload)}}function ns8(e){switch(e.type){case"inlinedPayload":return ot.V27.WebhookPayload.inlinedPayload(is8(e));case"reference":return ot.V27.WebhookPayload.reference({...e,payloadType:CY(e.payloadType)})}}function is8(e){return{...e,properties:as8(e.properties)}}function as8(e){return e.map(t=>os8(t))}function os8(e){return{...e,valueType:CY(e.valueType)}}function us8(e){return{...e,endpoints:ss8(e.endpoints),headers:AGc(e.headers),pathParameters:OGc(e.pathParameters)}}function ss8(e){return e.map(t=>cs8(t))}function cs8(e){return{...e,headers:AGc(e.headers),pathParameters:OGc(e.pathParameters),allPathParameters:OGc(e.allPathParameters),queryParameters:ws8(e.queryParameters),requestBody:e.requestBody!=null?vs8(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?_s8(e.sdkRequest):void 0,response:e.response!=null?ls8(e.response):void 0}}function ls8(e){switch(e.type){case"json":return ot.V27.HttpResponse.json(ps8(e.value));case"fileDownload":return ot.V27.HttpResponse.fileDownload(e);case"text":return ot.V27.HttpResponse.text(e);case"streaming":return ot.V27.HttpResponse.streaming(fs8(e));default:cc(e)}}function fs8(e){return{...e,dataEventType:ds8(e.dataEventType)}}function ds8(e){switch(e.type){case"json":return ot.V27.StreamingResponseChunkType.json(CY(e.json));case"text":return ot.V27.StreamingResponseChunkType.text();default:cc(e)}}function ps8(e){switch(e.type){case"response":return ot.V27.JsonResponse.response({...e,responseBodyType:CY(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:CY(e.responseBodyType),responseProperty:e.responseProperty!=null?ID1(e.responseProperty):void 0});default:cc(e)}}function _s8(e){return{...e,shape:hs8(e.shape)}}function hs8(e){switch(e.type){case"justRequestBody":return ot.V27.SdkRequestShape.justRequestBody(ys8(e.value));case"wrapper":return ot.V27.SdkRequestShape.wrapper(e);default:cc(e)}}function ys8(e){switch(e.type){case"typeReference":return ot.V27.SdkRequestBodyType.typeReference(SD1(e));case"bytes":return ot.V27.SdkRequestBodyType.bytes(e);default:cc(e)}}function vs8(e){switch(e.type){case"inlinedRequestBody":return ot.V27.HttpRequestBody.inlinedRequestBody(Os8(e));case"reference":return ot.V27.HttpRequestBody.reference(SD1(e));case"fileUpload":return ot.V27.HttpRequestBody.fileUpload(bs8(e));case"bytes":return ot.V27.HttpRequestBody.bytes(e);default:cc(e)}}function bs8(e){return{...e,properties:gs8(e.properties)}}function gs8(e){return e.map(t=>ms8(t))}function ms8(e){switch(e.type){case"file":return ot.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return ot.V27.FileUploadRequestProperty.bodyProperty(DD1(e));default:cc(e)}}function SD1(e){return{...e,requestBodyType:CY(e.requestBodyType)}}function Os8(e){return{...e,properties:As8(e.properties)}}function As8(e){return e.map(t=>DD1(t))}function DD1(e){return{...e,valueType:CY(e.valueType)}}function OGc(e){return e.map(t=>Ps8(t))}function Ps8(e){return{...e,valueType:CY(e.valueType)}}function ws8(e){return e.map(t=>js8(t))}function js8(e){return{...e,valueType:CY(e.valueType)}}function Es8(e){return{...e,schemes:Ss8(e.schemes)}}function Ss8(e){return e.map(t=>Ds8(t))}function Ds8(e){switch(e.type){case"basic":return ot.V27.AuthScheme.basic(e);case"bearer":return ot.V27.AuthScheme.bearer(e);case"header":return Cs8(e);default:cc(e)}}function Cs8(e){return ot.V27.AuthScheme.header({...e,valueType:CY(e.valueType)})}function AGc(e){return e.map(t=>Is8(t))}function Is8(e){return{...e,valueType:CY(e.valueType)}}function Ms8(e){return{...e,shape:Bs8(e.shape)}}function Bs8(e){switch(e.type){case"alias":return ot.V27.Type.alias(Ts8(e));case"enum":return ot.V27.Type.enum(e);case"object":return ot.V27.Type.object(qs8(e));case"union":return ot.V27.Type.union(xs8(e));case"undiscriminatedUnion":return ot.V27.Type.undiscriminatedUnion(Ns8(e));default:cc(e)}}function Ts8(e){return{aliasOf:CY(e.aliasOf),resolvedType:Qs8(e.resolvedType)}}function qs8(e){return{...e,properties:CD1(e.properties)}}function xs8(e){return{...e,types:Rs8(e.types),baseProperties:CD1(e.baseProperties)}}function Ns8(e){return{members:zs8(e.members)}}function CD1(e){return e.map(t=>ID1(t))}function ID1(e){return{...e,valueType:CY(e.valueType)}}function Rs8(e){return e.map(t=>({...t,shape:Fs8(t.shape)}))}function Fs8(e){switch(e.propertiesType){case"samePropertiesAsObject":return ot.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return ot.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:CY(e.type)});case"noProperties":return ot.V27.SingleUnionTypeProperties.noProperties();default:cc(e)}}function zs8(e){return e.map(t=>({...t,type:CY(t.type)}))}function Qs8(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?ot.V27.ResolvedTypeReference.primitive(ot.V27.PrimitiveType.Boolean):ot.V27.ResolvedTypeReference.container(ot.V27.ContainerType.literal(ot.V27.Literal.string(e.container.literal.string))):ot.V27.ResolvedTypeReference.container(MD1(e.container));case"named":return ot.V27.ResolvedTypeReference.named(e);case"primitive":return ot.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return ot.V27.ResolvedTypeReference.unknown();default:cc(e)}}function CY(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?ot.V27.TypeReference.primitive(ot.V27.PrimitiveType.Boolean):ot.V27.TypeReference.container(ot.V27.ContainerType.literal(ot.V27.Literal.string(e.container.literal.string))):ot.V27.TypeReference.container(MD1(e.container));case"named":return ot.V27.TypeReference.named(e);case"primitive":return ot.V27.TypeReference.primitive(e.primitive);case"unknown":return ot.V27.TypeReference.unknown();default:cc(e)}}function MD1(e){switch(e.type){case"list":return ot.V27.ContainerType.list(CY(e.list));case"map":return ot.V27.ContainerType.map({keyType:CY(e.keyType),valueType:CY(e.valueType)});case"optional":return ot.V27.ContainerType.optional(CY(e.optional));case"set":return ot.V27.ContainerType.set(CY(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return ot.V27.ContainerType.literal(ot.V27.Literal.string(e.literal.string));default:cc(e)}}var TD1={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[ye.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.8.6-1-g3d8d8591",[ye.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[ye.JAVA_SDK]:"0.5.14-1-ge4bcd98",[ye.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,Ls8({typeId:t,allTypes:e.types})]))})};function Ls8({typeId:e,allTypes:t}){let r=BD1({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=BD1({typeId:n,allTypes:t});return{typeId:n,fernFilepath:i.name.fernFilepath,name:i.name.name}})}}function BD1({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 qD1={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[ye.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new yc_(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},yc_=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 ot.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return ot.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:cc(t)}}convertExampleResponse(t){switch(t.type){case"ok":return ot.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return ot.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:cc(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 ot.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return ot.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return ot.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return ot.V29.ExampleTypeReferenceShape.unknown(t);default:cc(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return ot.V29.ExamplePrimitive.integer(t.integer);case"double":return ot.V29.ExamplePrimitive.double(t.double);case"string":return ot.V29.ExamplePrimitive.string(t.string.original);case"boolean":return ot.V29.ExamplePrimitive.boolean(t.boolean);case"long":return ot.V29.ExamplePrimitive.long(t.long);case"datetime":return ot.V29.ExamplePrimitive.datetime(t.datetime);case"date":return ot.V29.ExamplePrimitive.date(t.date);case"uuid":return ot.V29.ExamplePrimitive.uuid(t.uuid);default:cc(t)}}convertExampleContainer(t){switch(t.type){case"list":return ot.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return ot.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return ot.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return ot.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:cc(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 ot.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return ot.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return ot.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return ot.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:cc(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 ot.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(ot.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return ot.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return ot.V29.ExampleSingleUnionTypeProperties.noProperties();default:cc(t)}}};var xD1={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.8.8",[ye.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.8.8",[ye.TYPESCRIPT_EXPRESS]:"0.8.8",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.7.0-rc0",[ye.JAVA_SDK]:"0.7.0-rc0",[ye.JAVA_SPRING]:"0.7.0-rc0",[ye.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[ye.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.7.5-1-gb54fb677",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 RD1={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.9.4-2-g139cf36",[ye.GO_MODEL]:"0.9.4-2-g139cf36",[ye.GO_SDK]:"0.9.4-2-g139cf36",[ye.RUBY_MODEL]:"0.0.0",[ye.RUBY_SDK]:"0.0.0",[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:Js8(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(Us8)}]))})};function kEa({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function Us8(e){return{...e,examples:kEa({examples:e.examples,convert:Vs8})}}function Vs8(e){let t;if(e.request!=null&&(t=Ws8(e.request),t==null))return;let r=Hs8(e.response);if(r!=null)return{...e,rootPathParameters:kEa({examples:e.rootPathParameters,convert:vc_}),endpointPathParameters:kEa({examples:e.endpointPathParameters,convert:vc_}),servicePathParameters:kEa({examples:e.servicePathParameters,convert:vc_}),endpointHeaders:kEa({examples:e.endpointHeaders,convert:ND1}),serviceHeaders:kEa({examples:e.serviceHeaders,convert:ND1}),queryParameters:kEa({examples:e.queryParameters,convert:Gs8}),request:t,response:r}}function Ws8(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let n=cYe(r.value);n!=null&&t.push({...r,value:n})}return ot.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=bc_(e.shape);return t==null?void 0:ot.V31.ExampleRequestBody.reference({...e,shape:t})}default:cc(e)}}function Hs8(e){switch(e.type){case"ok":{if(e.body==null)return ot.V31.ExampleResponse.ok({body:void 0});let t=cYe(e.body);return t==null?void 0:ot.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return ot.V31.ExampleResponse.error({...e,body:void 0});let t=cYe(e.body);return t==null?void 0:ot.V31.ExampleResponse.error({...e,body:t})}}}function vc_(e){let t=cYe(e.value);if(t!=null)return{...e,value:t}}function ND1(e){let t=cYe(e.value);if(t!=null)return{...e,value:t}}function Gs8(e){let t=cYe(e.value);if(t!=null)return{...e,value:t}}function Js8(e){let t=[];for(let r of e){let n=Ks8(r);n!=null&&t.push(n)}return t}function Ks8(e){let t=FD1(e.shape);if(t!=null)return{...e,shape:t}}function FD1(e){switch(e.type){case"enum":return ot.V31.ExampleTypeShape.enum(e);case"alias":{let t=cYe(e.value);return t==null?void 0:ot.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let n=cYe(r.value);n!=null&&t.push({...r,value:n})}return ot.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=$s8(e.singleUnionType);return t==null?void 0:ot.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:cc(e)}}function cYe(e){let t=bc_(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function $s8(e){let t=Ys8(e.shape);if(t!=null)return{...e,shape:t}}function Ys8(e){switch(e.type){case"noProperties":return ot.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=bc_(e.shape);return t==null?void 0:ot.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let n=cYe(r.value);n!=null&&t.push({...r,value:n})}return ot.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:cc(e)}}function bc_(e){switch(e.type){case"container":{let t=Xs8(e.container);return t==null?void 0:ot.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=FD1(e.shape);return t==null?void 0:ot.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return ot.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return ot.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:cc(e)}}function Xs8(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let n=cYe(r);n!=null&&t.push(n)}return ot.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let n=cYe(r);n!=null&&t.push(n)}return ot.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let n=cYe(r.key),i=cYe(r.value);n!=null&&i!=null&&t.push({key:n,value:i})}return ot.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return ot.V31.ExampleContainer.optional();let t=cYe(e.optional);return t==null?ot.V31.ExampleContainer.optional():ot.V31.ExampleContainer.optional(t)}default:cc(e)}}var zD1={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.12.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.12.0",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.13.0-3-g8c56a41",[ye.GO_MODEL]:"0.13.0-3-g8c56a41",[ye.GO_SDK]:"0.13.0-3-g8c56a41",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:"0.0.0",[ye.CSHARP_SDK]:"0.0.0",[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new gc_(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>t.convertEndpoint(i))}]))}}},gc_=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:ot.V33.TypeReference.container(ot.V33.ContainerType.optional(ot.V33.TypeReference.primitive("STRING")))}:r),examples:Zs8({examples:t.examples,convert:ks8})}}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:cc(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:cc(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:cc(r.shape)}}};function Zs8({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function ks8(e){return{...e,queryParameters:e.queryParameters.filter(t=>!mc_(t.value))}}function mc_(e){switch(e.shape.type){case"container":return ec8(e.shape.container);case"named":return tc8(e.shape);case"primitive":return!1;case"unknown":return!0;default:cc(e.shape)}}function ec8(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&mc_(e.optional);default:cc(e)}}function tc8(e){switch(e.shape.type){case"alias":return mc_(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:cc(e.shape)}}var lvo=Xi(CHf(),1);var QD1={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.10.4",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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=>lvo.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>lvo.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>lvo.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(u=>(u.type==="file"&&u.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}!`),u.type==="file"?lvo.FernIrV33.FileUploadRequestProperty.file({...u.value}):u))}),bytes:a=>lvo.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var LD1={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.18.0",[ye.GO_MODEL]:"0.18.0",[ye.GO_SDK]:"0.18.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 UD1={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.11.6",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var VD1={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.13.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.13.0",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.12.0",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 WD1={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.15.0-rc0",[ye.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.9.0-rc0",[ye.PYTHON_PYDANTIC]:"0.9.0-rc0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"1.2.0-rc0",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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=>ot.V37.HttpResponse.fileDownload(a),json:a=>ot.V37.HttpResponse.json(a),streaming:a=>a._visit({json:u=>ot.V37.HttpResponse.streaming({dataEventType:ot.V37.StreamingResponseChunkType.json(u.payload),docs:u.docs,terminator:u.terminator}),sse:()=>{},text:u=>ot.V37.HttpResponse.streaming({dataEventType:ot.V37.StreamingResponseChunkType.text(),docs:u.docs,terminator:void 0}),_other:()=>{}}),text:a=>ot.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var HD1={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.9.0-rc1",[ye.PYTHON_PYDANTIC]:"0.9.0-rc1",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"1.4.0-rc1",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:"0.7.0-rc0",[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>rc8(r))}})};function rc8(e){switch(e.type){case"basic":return ot.V38.AuthScheme.basic(e);case"bearer":return ot.V38.AuthScheme.bearer(e);case"header":return ot.V38.AuthScheme.header(e);case"oauth":return ot.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:cc(e)}}var GD1={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.20.0",[ye.GO_MODEL]:"0.20.0",[ye.GO_SDK]:"0.20.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var JD1={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 KD1={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.8.0-rc0",[ye.JAVA_SDK]:"0.9.0-rc0",[ye.JAVA_SPRING]:"0.8.0-rc0",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>nc8(r))}})};function nc8(e){switch(e.type){case"basic":return ot.V41.AuthScheme.basic(e);case"bearer":return ot.V41.AuthScheme.bearer(e);case"header":return ot.V41.AuthScheme.header(e);case"oauth":return ot.V41.AuthScheme.oauth(ic8(e));default:cc(e)}}function ic8(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:ot.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:cc(e.configuration.type)}}var $D1={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.17.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.17.0",[ye.TYPESCRIPT_EXPRESS]:"0.13.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 XD1={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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=>ac8({example:a})).filter(GP)}))}]))})};function ac8({example:e}){return e._visit({userProvided:t=>ot.V43.HttpEndpointExample.userProvided(YD1({example:t})),generated:t=>ot.V43.HttpEndpointExample.generated(YD1({example:t})),_other:()=>{}})}function YD1({example:e}){return{...e,response:oc8({example:e.response})}}function oc8({example:e}){switch(e.type){case"ok":return uc8({example:e.value});case"error":return ot.V43.ExampleResponse.error(e);default:cc(e)}}function uc8({example:e}){switch(e.type){case"body":return ot.V43.ExampleResponse.ok({body:e.value});case"sse":return ot.V43.ExampleResponse.ok({body:void 0});case"stream":return ot.V43.ExampleResponse.ok({body:void 0});default:cc(e)}}var ZD1={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V45.types.Type._visit(r.shape,{union:n=>ot.V44.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:m5(i.valueType)})),types:n.types.map(i=>gc8(i))}),enum:ot.V44.types.Type.enum,object:n=>ot.V44.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:m5(i.valueType)}))}),alias:n=>ot.V44.types.Type.alias({aliasOf:m5(n.aliasOf),resolvedType:Oc8(n.resolvedType)}),undiscriminatedUnion:n=>ot.V44.types.Type.undiscriminatedUnion(Ac8(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:_c8(e.auth),headers:e.headers.map(r=>fvo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>fvo(r)),types:t,services:Rb(e.services,r=>Pc8(r)),errors:Rb(e.errors,r=>zc8(r)),webhookGroups:Rb(e.webhookGroups,r=>fc8(r)),websocketChannels:Rb(e.websocketChannels,r=>sc8(r)),pathParameters:e.pathParameters.map(r=>Kyu(r)),variables:e.variables.map(r=>wc8(r))}}};function sc8(e){return{...e,headers:e.headers.map(t=>fvo(t)),queryParameters:e.queryParameters.map(t=>$yu(t)),pathParameters:e.pathParameters.map(t=>Kyu(t)),messages:e.messages.map(t=>cc8(t))}}function cc8(e){return{...e,body:lc8(e.body)}}function lc8(e){switch(e.type){case"inlinedBody":return ot.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:m5(t.valueType)}))});case"reference":return ot.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:m5(e.bodyType)})}}function fc8(e){return e.map(t=>dc8(t))}function dc8(e){return{...e,headers:e.headers.map(t=>fvo(t)),payload:pc8(e.payload)}}function pc8(e){switch(e.type){case"reference":return ot.V44.webhooks.WebhookPayload.reference({...e,payloadType:m5(e.payloadType)});case"inlinedPayload":return ot.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:m5(t.valueType)}))})}}function _c8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V44.auth.AuthScheme.basic(t);case"bearer":return ot.V44.auth.AuthScheme.bearer(t);case"header":return ot.V44.auth.AuthScheme.header(hc8(t));case"oauth":return ot.V44.auth.AuthScheme.oauth(yc8(t))}})}}function hc8(e){return{...e,valueType:m5(e.valueType)}}function yc8(e){return{...e,configuration:ot.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:vc8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?bc8(e.configuration.refreshEndpoint):void 0})}}function vc8(e){return{...e,requestProperties:{clientId:PGc(e.requestProperties.clientId),clientSecret:PGc(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?PGc(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Zbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Zbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Zbi(e.responseProperties.refreshToken):void 0}}}function bc8(e){return{...e,requestProperties:{refreshToken:PGc(e.requestProperties.refreshToken)},responseProperties:{accessToken:Zbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Zbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Zbi(e.responseProperties.refreshToken):void 0}}}function fvo(e){return{...e,valueType:m5(e.valueType)}}function m5(e){return ot.V45.types.TypeReference._visit(e,{container:t=>ot.V44.types.TypeReference.container(kD1(t)),primitive:t=>t.v1==="BIG_INTEGER"?ot.V44.types.TypeReference.primitive(ot.V44.types.PrimitiveType.String):ot.V44.types.TypeReference.primitive(t.v1),named:ot.V44.types.TypeReference.named,unknown:ot.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function kD1(e){return ot.V45.types.ContainerType._visit(e,{list:t=>ot.V44.types.ContainerType.list(m5(t)),optional:t=>ot.V44.types.ContainerType.optional(m5(t)),set:t=>ot.V44.types.ContainerType.set(m5(t)),map:({keyType:t,valueType:r})=>ot.V44.types.ContainerType.map({keyType:m5(t),valueType:m5(r)}),literal:ot.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function gc8(e){return{...e,shape:mc8(e.shape)}}function mc8(e){return ot.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:m5(t.type)}),noProperties:ot.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function Oc8(e){return ot.V45.types.ResolvedTypeReference._visit(e,{container:t=>ot.V44.types.ResolvedTypeReference.container(kD1(t)),named:ot.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?ot.V44.types.ResolvedTypeReference.primitive(ot.V44.types.PrimitiveType.String):ot.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:ot.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function Ac8(e){return{members:e.members.map(t=>({...t,type:m5(t.type)}))}}function Pc8(e){return{...e,pathParameters:e.pathParameters.map(t=>Kyu(t)),headers:e.headers.map(t=>fvo(t)),endpoints:e.endpoints.map(t=>jc8(t))}}function Kyu(e){return{...e,valueType:m5(e.valueType)}}function wc8(e){return{...e,type:m5(e.type)}}function jc8(e){return{...e,pagination:e.pagination!=null?Ic8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Kyu(t)),pathParameters:e.pathParameters.map(t=>Kyu(t)),sdkRequest:e.sdkRequest!=null?qc8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?Rc8(e.requestBody):void 0,response:e.response!=null?Ec8(e.response):void 0,headers:e.headers.map(t=>fvo(t)),queryParameters:e.queryParameters.map(t=>$yu(t))}}function Ec8(e){return{...e,body:e.body!=null?Sc8(e.body):void 0}}function Sc8(e){switch(e.type){case"json":return ot.V44.http.HttpResponseBody.json(Dc8(e.value));case"fileDownload":return ot.V44.http.HttpResponseBody.fileDownload(e);case"text":return ot.V44.http.HttpResponseBody.text(e);case"streaming":return ot.V44.http.HttpResponseBody.streaming(Cc8(e.value))}}function Dc8(e){switch(e.type){case"response":return ot.V44.http.JsonResponse.response({...e,responseBodyType:m5(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:m5(e.responseBodyType),responseProperty:e.responseProperty!=null?Oc_(e.responseProperty):void 0})}}function Cc8(e){switch(e.type){case"json":return ot.V44.http.StreamingResponse.json({...e,payload:m5(e.payload)});case"text":return ot.V44.http.StreamingResponse.text(e);case"sse":return ot.V44.http.StreamingResponse.sse({...e,payload:m5(e.payload)})}}function Ic8(e){switch(e.type){case"cursor":return ot.V44.http.Pagination.cursor(Mc8(e));case"offset":return ot.V44.http.Pagination.offset(Bc8(e))}}function Mc8(e){return{...e,page:$yu(e.page),next:Zbi(e.next),results:Zbi(e.results)}}function Bc8(e){return{...e,page:$yu(e.page),results:Zbi(e.results)}}function PGc(e){return{...e,property:Tc8(e.property)}}function Tc8(e){switch(e.type){case"query":return ot.V44.RequestPropertyValue.query($yu(e));case"body":return ot.V44.RequestPropertyValue.body(Oc_(e))}}function Zbi(e){return{...e,property:Oc_(e.property)}}function Oc_(e){return{...e,valueType:m5(e.valueType)}}function $yu(e){return{...e,valueType:m5(e.valueType)}}function qc8(e){return{...e,shape:xc8(e.shape)}}function xc8(e){return ot.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V44.http.SdkRequestShape.justRequestBody(Nc8(t)),wrapper:ot.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Nc8(e){switch(e.type){case"bytes":return ot.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:m5(e.requestBodyType)})}}function Rc8(e){return ot.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:m5(r.valueType)}))}),reference:t=>ot.V44.http.HttpRequestBody.reference({...t,requestBodyType:m5(t.requestBodyType)}),fileUpload:t=>ot.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:m5(r.valueType)});case"file":return ot.V44.http.FileUploadRequestProperty.file(Fc8(r.value))}})}),bytes:t=>ot.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Fc8(e){switch(e.type){case"file":return ot.V44.http.FileProperty.file(e);case"fileArray":return ot.V44.http.FileProperty.fileArray(e)}}function zc8(e){return{...e,type:e.type!=null?m5(e.type):void 0}}var tC1={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.21.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.21.0",[ye.TYPESCRIPT_EXPRESS]:"0.16.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.9.0",[ye.JAVA_SDK]:"0.10.0",[ye.JAVA_SPRING]:"0.9.0",[ye.PYTHON_FASTAPI]:"0.10.1",[ye.PYTHON_PYDANTIC]:"0.9.1",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"2.9.9",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:Qc8(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>({...n,examples:Lc8(n.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:Uc8(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(n=>({...n,shape:tee(n.shape)}))}]))})};function tee(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.list(r.map(n=>tee(n)))),set:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.set(r.map(n=>tee(n)))),map:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.map(r.map(n=>({key:tee(n.key),value:tee(n.value)})))),optional:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.optional(r!=null?tee(r):void 0)),literal:r=>ot.V45.ExampleTypeReferenceShape.primitive(r._visit({string:n=>ot.V45.ExamplePrimitive.string(n),integer:n=>ot.V45.ExamplePrimitive.integer(n),double:n=>ot.V45.ExamplePrimitive.double(n),long:n=>ot.V45.ExamplePrimitive.long(n),boolean:n=>ot.V45.ExamplePrimitive.boolean(n),datetime:n=>ot.V45.ExamplePrimitive.datetime(n),date:n=>ot.V45.ExamplePrimitive.date(n),uuid:n=>ot.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:ot.V45.ExampleTypeReferenceShape.named({...t,shape:rC1(t.shape)})}),primitive:t=>({...e,shape:ot.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>ot.V45.ExamplePrimitive.string(r),integer:r=>ot.V45.ExamplePrimitive.integer(r),double:r=>ot.V45.ExamplePrimitive.double(r),long:r=>ot.V45.ExamplePrimitive.long(r),boolean:r=>ot.V45.ExamplePrimitive.boolean(r),datetime:r=>ot.V45.ExamplePrimitive.datetime(r),date:r=>ot.V45.ExamplePrimitive.date(r),uuid:r=>ot.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:ot.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function eC1(e){return{...e,properties:e.properties.map(t=>({...t,value:tee(t.value)}))}}function rC1(e){return e.type==="alias"?ot.V45.ExampleTypeShape.alias({value:tee(e.value)}):e.type==="object"?ot.V45.ExampleTypeShape.object(eC1(e)):e.type==="union"?ot.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>ot.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:eC1(t.object)}),singleProperty:t=>ot.V45.ExampleSingleUnionTypeProperties.singleProperty(tee(t)),noProperties:()=>ot.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?ot.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:tee(e.singleUnionType)}):ot.V45.ExampleTypeShape.enum(e)}function Qc8(e){return e.map(t=>({...t,shape:rC1(t.shape)}))}function wGc(e){return e.map(t=>({...t,value:tee(t.value)}))}function Ac_(e){return e.map(t=>({...t,value:tee(t.value)}))}function nC1(e){return e.map(t=>({...t,value:tee(t.value)}))}function Lc8(e){return e.map(t=>{let r={...t,rootPathParameters:wGc(t.rootPathParameters),servicePathParameters:wGc(t.servicePathParameters),endpointPathParameters:wGc(t.endpointPathParameters),serviceHeaders:Ac_(t.serviceHeaders),endpointHeaders:Ac_(t.endpointHeaders),queryParameters:nC1(t.queryParameters),request:t.request?._visit({inlinedRequestBody:n=>ot.V45.ExampleRequestBody.inlinedRequestBody({...n,properties:n.properties.map(i=>({...i,value:tee(i.value)}))}),reference:n=>ot.V45.ExampleRequestBody.reference(tee(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}}),response:t.response._visit({ok:n=>ot.V45.ExampleResponse.ok(n._visit({body:i=>ot.V45.ExampleEndpointSuccessResponse.body(i!=null?tee(i):void 0),stream:i=>ot.V45.ExampleEndpointSuccessResponse.stream(i.map(tee)),sse:i=>ot.V45.ExampleEndpointSuccessResponse.sse(i.map(a=>({...a,data:tee(a.data)}))),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),error:n=>ot.V45.ExampleResponse.error({...n,body:n.body!=null?tee(n.body):void 0}),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})};return t._visit({userProvided:()=>ot.V45.HttpEndpointExample.userProvided(r),generated:()=>ot.V45.HttpEndpointExample.generated(r),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})})}function Uc8(e){return e.map(t=>({...t,pathParameters:wGc(t.pathParameters),headers:Ac_(t.headers),queryParameters:nC1(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:n=>ot.V45.ExampleWebSocketMessageBody.inlinedBody({...n,properties:n.properties.map(i=>({...i,value:tee(i.value)}))}),reference:n=>ot.V45.ExampleWebSocketMessageBody.reference(tee(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})}))}))}var iC1={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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:u,...c}=i;return{...c,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...i.userSpecifiedExamples.map(s=>{if(s.example!=null)return ot.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(GP),...i.autogeneratedExamples.map(s=>ot.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:n}]}))})};var aC1={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.29.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.29.0",[ye.TYPESCRIPT_EXPRESS]:"0.17.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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?Wc8(a.pagination):void 0}));return[r,{...n,endpoints:i}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:Vc8(t)},services:t}}};function Vc8(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function Wc8(e){switch(e.type){case"cursor":{let t=Hc8(e);return t!=null?ot.V47.Pagination.cursor(t):void 0}case"offset":{let t=Gc8(e);return t!=null?ot.V47.Pagination.offset(t):void 0}default:cc(e)}}function Hc8(e){let t=oC1(e.page);if(t!=null)return{...e,page:t}}function Gc8(e){if(e.step!=null)return;let t=oC1(e.page);if(t!=null)return{...e,page:t}}function oC1(e){switch(e.property.type){case"query":return e.property}}var uC1={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.11.0-rc0",[ye.PYTHON_PYDANTIC]:"0.10.0-rc0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"2.11.0-rc0",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 u;return a.response?.body!=null&&(u=a.response.body?._visit({json:p=>ot.V48.HttpResponseBody.json({...p}),fileDownload:p=>ot.V48.HttpResponseBody.fileDownload({...p}),text:p=>ot.V48.HttpResponseBody.text({...p}),streaming:p=>ot.V48.HttpResponseBody.streaming({...p}),streamParameter:()=>{},_other:()=>{}}),u==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:u}}});return[r,{...n,endpoints:i}]}));return{...e,services:t}}};var sC1={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.34.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.34.0",[ye.TYPESCRIPT_EXPRESS]:"0.17.2",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:"0.0.0",[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V50.types.Type._visit(r.shape,{union:n=>ot.V49.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:O5(i.valueType)})),types:n.types.map(i=>il8(i))}),enum:ot.V49.types.Type.enum,object:n=>ot.V49.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:O5(i.valueType)}))}),alias:n=>ot.V49.types.Type.alias({aliasOf:O5(n.aliasOf),resolvedType:ol8(n.resolvedType)}),undiscriminatedUnion:n=>ot.V49.types.Type.undiscriminatedUnion(ul8(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:kc8(e.auth),headers:e.headers.map(r=>dvo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>dvo(r)),types:t,services:Rb(e.services,r=>sl8(r)),errors:Rb(e.errors,r=>wl8(r)),webhookGroups:Rb(e.webhookGroups,r=>Yc8(r)),websocketChannels:Rb(e.websocketChannels,r=>Jc8(r)),pathParameters:e.pathParameters.map(r=>Yyu(r)),variables:e.variables.map(r=>cl8(r))}}};function Jc8(e){return{...e,headers:e.headers.map(t=>dvo(t)),queryParameters:e.queryParameters.map(t=>wc_(t)),pathParameters:e.pathParameters.map(t=>Yyu(t)),messages:e.messages.map(t=>Kc8(t))}}function Kc8(e){return{...e,body:$c8(e.body)}}function $c8(e){switch(e.type){case"inlinedBody":return ot.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:O5(t.valueType)}))});case"reference":return ot.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:O5(e.bodyType)})}}function Yc8(e){return e.map(t=>Xc8(t))}function Xc8(e){return{...e,headers:e.headers.map(t=>dvo(t)),payload:Zc8(e.payload)}}function Zc8(e){switch(e.type){case"reference":return ot.V49.webhooks.WebhookPayload.reference({...e,payloadType:O5(e.payloadType)});case"inlinedPayload":return ot.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:O5(t.valueType)}))})}}function kc8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V49.auth.AuthScheme.basic(t);case"bearer":return ot.V49.auth.AuthScheme.bearer(t);case"header":return ot.V49.auth.AuthScheme.header(el8(t));case"oauth":return ot.V49.auth.AuthScheme.oauth(tl8(t))}})}}function el8(e){return{...e,valueType:O5(e.valueType)}}function tl8(e){return{...e,configuration:ot.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:rl8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?nl8(e.configuration.refreshEndpoint):void 0})}}function rl8(e){return{...e,requestProperties:{clientId:V7i(e.requestProperties.clientId),clientSecret:V7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?V7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:kbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?kbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?kbi(e.responseProperties.refreshToken):void 0}}}function nl8(e){return{...e,requestProperties:{refreshToken:V7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:kbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?kbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?kbi(e.responseProperties.refreshToken):void 0}}}function dvo(e){return{...e,valueType:O5(e.valueType)}}function O5(e){return ot.V50.types.TypeReference._visit(e,{container:t=>ot.V49.types.TypeReference.container(cC1(t)),primitive:t=>t.v2?.type==="integer"?ot.V49.types.TypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?ot.V49.types.TypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?ot.V49.types.TypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.string(t.v2)}):ot.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:ot.V49.types.TypeReference.named,unknown:ot.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function cC1(e){return ot.V50.types.ContainerType._visit(e,{list:t=>ot.V49.types.ContainerType.list(O5(t)),optional:t=>ot.V49.types.ContainerType.optional(O5(t)),set:t=>ot.V49.types.ContainerType.set(O5(t)),map:({keyType:t,valueType:r})=>ot.V49.types.ContainerType.map({keyType:O5(t),valueType:O5(r)}),literal:ot.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function il8(e){return{...e,shape:al8(e.shape)}}function al8(e){return ot.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:O5(t.type)}),noProperties:ot.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function ol8(e){return ot.V50.types.ResolvedTypeReference._visit(e,{container:t=>ot.V49.types.ResolvedTypeReference.container(cC1(t)),named:ot.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.string(t.v2)}):ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:ot.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function ul8(e){return{members:e.members.map(t=>({...t,type:O5(t.type)}))}}function sl8(e){return{...e,pathParameters:e.pathParameters.map(t=>Yyu(t)),headers:e.headers.map(t=>dvo(t)),endpoints:e.endpoints.map(t=>ll8(t))}}function Yyu(e){return{...e,valueType:O5(e.valueType)}}function cl8(e){return{...e,type:O5(e.type)}}function ll8(e){return{...e,pagination:e.pagination!=null?hl8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Yyu(t)),pathParameters:e.pathParameters.map(t=>Yyu(t)),sdkRequest:e.sdkRequest!=null?gl8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?Al8(e.requestBody):void 0,response:e.response!=null?fl8(e.response):void 0,headers:e.headers.map(t=>dvo(t)),queryParameters:e.queryParameters.map(t=>wc_(t))}}function fl8(e){return{...e,body:e.body!=null?dl8(e.body):void 0}}function dl8(e){switch(e.type){case"json":return ot.V49.http.HttpResponseBody.json(lC1(e.value));case"fileDownload":return ot.V49.http.HttpResponseBody.fileDownload(e);case"text":return ot.V49.http.HttpResponseBody.text(e);case"streaming":return ot.V49.http.HttpResponseBody.streaming(fC1(e.value));case"streamParameter":return ot.V49.http.HttpResponseBody.streamParameter(_l8(e))}}function lC1(e){switch(e.type){case"response":return ot.V49.http.JsonResponse.response({...e,responseBodyType:O5(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:O5(e.responseBodyType),responseProperty:e.responseProperty!=null?Pc_(e.responseProperty):void 0})}}function fC1(e){switch(e.type){case"json":return ot.V49.http.StreamingResponse.json({...e,payload:O5(e.payload)});case"text":return ot.V49.http.StreamingResponse.text(e);case"sse":return ot.V49.http.StreamingResponse.sse({...e,payload:O5(e.payload)})}}function pl8(e){switch(e.type){case"json":return ot.V49.http.NonStreamHttpResponseBody.json(lC1(e.value));case"text":return ot.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function _l8(e){return{nonStreamResponse:pl8(e.nonStreamResponse),streamResponse:fC1(e.streamResponse)}}function hl8(e){switch(e.type){case"cursor":return ot.V49.http.Pagination.cursor(yl8(e));case"offset":return ot.V49.http.Pagination.offset(vl8(e))}}function yl8(e){return{...e,page:V7i(e.page),next:kbi(e.next),results:kbi(e.results)}}function vl8(e){return{...e,page:V7i(e.page),results:kbi(e.results),step:e.step!=null?V7i(e.step):void 0}}function V7i(e){return{...e,property:bl8(e.property)}}function bl8(e){switch(e.type){case"query":return ot.V49.RequestPropertyValue.query(wc_(e));case"body":return ot.V49.RequestPropertyValue.body(Pc_(e))}}function kbi(e){return{...e,property:Pc_(e.property)}}function Pc_(e){return{...e,valueType:O5(e.valueType)}}function wc_(e){return{...e,valueType:O5(e.valueType)}}function gl8(e){return{...e,streamParameter:e.streamParameter!=null?V7i(e.streamParameter):void 0,shape:ml8(e.shape)}}function ml8(e){return ot.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V49.http.SdkRequestShape.justRequestBody(Ol8(t)),wrapper:ot.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Ol8(e){switch(e.type){case"bytes":return ot.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:O5(e.requestBodyType)})}}function Al8(e){return ot.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:O5(r.valueType)}))}),reference:t=>ot.V49.http.HttpRequestBody.reference({...t,requestBodyType:O5(t.requestBodyType)}),fileUpload:t=>ot.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:O5(r.valueType)});case"file":return ot.V49.http.FileUploadRequestProperty.file(Pl8(r.value))}})}),bytes:t=>ot.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Pl8(e){switch(e.type){case"file":return ot.V49.http.FileProperty.file(e);case"fileArray":return ot.V49.http.FileProperty.fileArray(e)}}function wl8(e){return{...e,type:e.type!=null?O5(e.type):void 0}}var _C1={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"0.1.2",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Rb(e.types,r=>{let n=r.autogeneratedExamples.map(a=>dC1(a)),i=r.userProvidedExamples.map(a=>dC1(a));return{...r,examples:[...n,...i]}});return{...e,types:t,services:Rb(e.services,r=>xl8(r)),errors:Rb(e.errors,r=>Ql8(r)),webhookGroups:Rb(e.webhookGroups,r=>Dl8(r)),websocketChannels:Rb(e.websocketChannels,r=>jl8(r))}}};function jl8(e){return{...e,examples:e.examples.map(t=>El8(t))}}function El8(e){return{...e,pathParameters:e.pathParameters.map(t=>jGc(t)),headers:e.headers.map(t=>jc_(t)),queryParameters:e.queryParameters.map(t=>hC1(t)),messages:e.messages.map(t=>({...t,body:Sl8(t.body)}))}}function hC1(e){return{...e,value:Vue(e.value)}}function jc_(e){return{...e,value:Vue(e.value)}}function jGc(e){return{...e,value:Vue(e.value)}}function Sl8(e){switch(e.type){case"inlinedBody":return ot.V50.ExampleWebSocketMessageBody.inlinedBody(yC1(e));case"reference":return ot.V50.ExampleWebSocketMessageBody.reference(Vue(e))}}function yC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Vue(t.value)}))}}function Dl8(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:Vue(r.payload)}))}))}function dC1(e){return{...e,shape:vC1(e.shape)}}function Ec_(e){switch(e.type){case"primitive":return ot.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return ot.V50.ExampleTypeReferenceShape.container(Cl8(e));case"unknown":return ot.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:vC1(e.shape)})}}function Cl8(e){switch(e.container.type){case"list":return ot.V50.ExampleContainer.list(e.container.list.map(t=>Vue(t)));case"set":return ot.V50.ExampleContainer.set(e.container.set.map(t=>Vue(t)));case"optional":return ot.V50.ExampleContainer.optional(e.container.optional!=null?Vue(e.container.optional):void 0);case"map":return ot.V50.ExampleContainer.map(e.container.map.map(t=>({key:Vue(t.key),value:Vue(t.value)})));case"literal":return ot.V50.ExampleContainer.literal(e.container.literal)}}function Vue(e){return{...e,shape:Ec_(e.shape)}}function vC1(e){switch(e.type){case"object":return ot.V50.ExampleTypeShape.object({properties:e.properties.map(t=>bC1(t))});case"alias":return ot.V50.ExampleTypeShape.alias({value:{...Vue(e.value)}});case"enum":return ot.V50.ExampleTypeShape.enum(e);case"union":return ot.V50.ExampleTypeShape.union(Ml8(e));case"undiscriminatedUnion":return ot.V50.ExampleTypeShape.undiscriminatedUnion(Il8(e))}}function Il8(e){return{...e,singleUnionType:Vue(e.singleUnionType)}}function Ml8(e){return{...e,singleUnionType:Bl8(e.singleUnionType)}}function Bl8(e){return{...e,shape:Tl8(e.shape)}}function Tl8(e){switch(e.type){case"samePropertiesAsObject":return ot.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:ql8(e.object)});case"singleProperty":return ot.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Ec_(e.shape)});case"noProperties":return ot.V50.ExampleSingleUnionTypeProperties.noProperties()}}function ql8(e){return{...e,properties:e.properties.map(t=>bC1(t))}}function bC1(e){return{...e,value:{...e.value,shape:Ec_(e.value.shape)}}}function xl8(e){return{...e,endpoints:e.endpoints.map(t=>Nl8(t))}}function Nl8(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:pC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?pC1(t.example):void 0}))}}function pC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>jGc(t)),servicePathParameters:e.servicePathParameters.map(t=>jGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>jGc(t)),serviceHeaders:e.serviceHeaders.map(t=>jc_(t)),endpointHeaders:e.endpointHeaders.map(t=>jc_(t)),queryParameters:e.queryParameters.map(t=>hC1(t)),request:e.request!=null?zl8(e.request):void 0,response:Rl8(e.response)}}function Rl8(e){switch(e.type){case"error":return ot.V50.ExampleResponse.error({...e,body:e.body!=null?Vue(e.body):void 0});case"ok":return ot.V50.ExampleResponse.ok(Fl8(e))}}function Fl8(e){switch(e.value.type){case"body":return ot.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?Vue(e.value.value):void 0);case"stream":return ot.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Vue(t)));case"sse":return ot.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Vue(t.data)})))}}function zl8(e){switch(e.type){case"inlinedRequestBody":return ot.V50.ExampleRequestBody.inlinedRequestBody(yC1(e));case"reference":return ot.V50.ExampleRequestBody.reference(Vue(e))}}function Ql8(e){return{...e,examples:e.examples.map(t=>({...t,shape:Vue(t.shape)}))}}var OC1={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Ul8(e.apiVersion):void 0,auth:Yl8(e.auth),headers:e.headers.map(t=>eSa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>eSa(t)),types:Ll8(e.types),services:Rb(e.services,t=>uf8(t)),webhookGroups:Rb(e.webhookGroups,t=>Gl8(t)),websocketChannels:Rb(e.websocketChannels,t=>Vl8(t)),errors:Rb(e.errors,t=>Pf8(t)),pathParameters:e.pathParameters.map(t=>Xyu(t)),variables:e.variables.map(t=>sf8(t))})};function Ll8(e){return Rb(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>gC1(r)),userProvidedExamples:t.userProvidedExamples.map(r=>gC1(r)),shape:ot.V52.types.Type._visit(t.shape,{union:r=>ot.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:L4(n.valueType)})),types:r.types.map(n=>nf8(n))}),enum:ot.V51.types.Type.enum,object:r=>ot.V51.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:L4(n.valueType)}))}),alias:r=>ot.V51.types.Type.alias({aliasOf:L4(r.aliasOf),resolvedType:af8(r.resolvedType)}),undiscriminatedUnion:r=>ot.V51.types.Type.undiscriminatedUnion(of8(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Ul8(e){return ot.V51.ApiVersionScheme.header({...e,header:eSa(e.header)})}function Vl8(e){return{...e,headers:e.headers.map(t=>eSa(t)),queryParameters:e.queryParameters.map(t=>Cc_(t)),pathParameters:e.pathParameters.map(t=>Xyu(t)),messages:e.messages.map(t=>Wl8(t)),examples:e.examples.map(t=>wf8(t))}}function Wl8(e){return{...e,body:Hl8(e.body)}}function Hl8(e){switch(e.type){case"inlinedBody":return ot.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:L4(t.valueType)}))});case"reference":return ot.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:L4(e.bodyType)})}}function Gl8(e){return e.map(t=>Jl8(t))}function Jl8(e){return{...e,headers:e.headers.map(t=>eSa(t)),payload:Kl8(e.payload),examples:e.examples!=null?e.examples.map(t=>$l8(t)):void 0}}function Kl8(e){switch(e.type){case"reference":return ot.V51.webhooks.WebhookPayload.reference({...e,payloadType:L4(e.payloadType)});case"inlinedPayload":return ot.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:L4(t.valueType)}))})}}function $l8(e){return{...e,payload:Wue(e.payload)}}function Yl8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V51.auth.AuthScheme.basic(t);case"bearer":return ot.V51.auth.AuthScheme.bearer(t);case"header":return ot.V51.auth.AuthScheme.header(Xl8(t));case"oauth":return ot.V51.auth.AuthScheme.oauth(Zl8(t))}})}}function Xl8(e){return{...e,valueType:L4(e.valueType)}}function Zl8(e){return{...e,configuration:ot.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:kl8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?ef8(e.configuration.refreshEndpoint):void 0})}}function kl8(e){return{...e,requestProperties:{clientId:W7i(e.requestProperties.clientId),clientSecret:W7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?W7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:egi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?egi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?egi(e.responseProperties.refreshToken):void 0}}}function ef8(e){return{...e,requestProperties:{refreshToken:W7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:egi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?egi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?egi(e.responseProperties.refreshToken):void 0}}}function eSa(e){return{...e,valueType:L4(e.valueType)}}function L4(e){return ot.V52.types.TypeReference._visit(e,{container:t=>ot.V51.types.TypeReference.container(PC1(t)),primitive:t=>ot.V51.types.TypeReference.primitive(AC1(t)),named:ot.V51.types.TypeReference.named,unknown:ot.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function AC1(e){return{v1:tf8(e.v1),v2:e.v2!=null?rf8(e.v2):void 0}}function tf8(e){switch(e){case"UINT":return ot.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return ot.V51.types.PrimitiveTypeV1.Long}return e}function rf8(e){switch(e.type){case"integer":return ot.V51.types.PrimitiveTypeV2.integer(e);case"double":return ot.V51.types.PrimitiveTypeV2.double(e);case"string":return ot.V51.types.PrimitiveTypeV2.string(e);case"boolean":return ot.V51.types.PrimitiveTypeV2.boolean(e);case"long":return ot.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return ot.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:cc(e)}}function PC1(e){return ot.V52.types.ContainerType._visit(e,{list:t=>ot.V51.types.ContainerType.list(L4(t)),optional:t=>ot.V51.types.ContainerType.optional(L4(t)),set:t=>ot.V51.types.ContainerType.set(L4(t)),map:({keyType:t,valueType:r})=>ot.V51.types.ContainerType.map({keyType:L4(t),valueType:L4(r)}),literal:ot.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function nf8(e){return{...e,shape:if8(e.shape)}}function if8(e){return ot.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:L4(t.type)}),noProperties:ot.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function af8(e){return ot.V52.types.ResolvedTypeReference._visit(e,{container:t=>ot.V51.types.ResolvedTypeReference.container(PC1(t)),named:ot.V51.types.ResolvedTypeReference.named,primitive:t=>ot.V51.types.ResolvedTypeReference.primitive(AC1(t)),unknown:ot.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function of8(e){return{members:e.members.map(t=>({...t,type:L4(t.type)}))}}function uf8(e){return{...e,pathParameters:e.pathParameters.map(t=>Xyu(t)),headers:e.headers.map(t=>eSa(t)),endpoints:e.endpoints.map(t=>cf8(t))}}function Xyu(e){return{...e,valueType:L4(e.valueType)}}function sf8(e){return{...e,type:L4(e.type)}}function cf8(e){return{...e,pagination:e.pagination!=null?_f8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Xyu(t)),pathParameters:e.pathParameters.map(t=>Xyu(t)),sdkRequest:e.sdkRequest!=null?bf8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?Of8(e.requestBody):void 0,response:e.response!=null?lf8(e.response):void 0,headers:e.headers.map(t=>eSa(t)),queryParameters:e.queryParameters.map(t=>Cc_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:mC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?mC1(t.example):void 0}))}}function lf8(e){return{...e,body:e.body!=null?ff8(e.body):void 0}}function ff8(e){switch(e.type){case"json":return ot.V51.http.HttpResponseBody.json(wC1(e.value));case"fileDownload":return ot.V51.http.HttpResponseBody.fileDownload(e);case"text":return ot.V51.http.HttpResponseBody.text(e);case"streaming":return ot.V51.http.HttpResponseBody.streaming(jC1(e.value));case"streamParameter":return ot.V51.http.HttpResponseBody.streamParameter(pf8(e))}}function wC1(e){switch(e.type){case"response":return ot.V51.http.JsonResponse.response({...e,responseBodyType:L4(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:L4(e.responseBodyType),responseProperty:e.responseProperty!=null?Dc_(e.responseProperty):void 0})}}function jC1(e){switch(e.type){case"json":return ot.V51.http.StreamingResponse.json({...e,payload:L4(e.payload)});case"text":return ot.V51.http.StreamingResponse.text(e);case"sse":return ot.V51.http.StreamingResponse.sse({...e,payload:L4(e.payload)})}}function df8(e){switch(e.type){case"json":return ot.V51.http.NonStreamHttpResponseBody.json(wC1(e.value));case"text":return ot.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function pf8(e){return{nonStreamResponse:df8(e.nonStreamResponse),streamResponse:jC1(e.streamResponse)}}function _f8(e){switch(e.type){case"cursor":return ot.V51.http.Pagination.cursor(hf8(e));case"offset":return ot.V51.http.Pagination.offset(yf8(e))}}function hf8(e){return{...e,page:W7i(e.page),next:egi(e.next),results:egi(e.results)}}function yf8(e){return{...e,page:W7i(e.page),results:egi(e.results),step:e.step!=null?W7i(e.step):void 0}}function W7i(e){return{...e,property:vf8(e.property)}}function vf8(e){switch(e.type){case"query":return ot.V51.RequestPropertyValue.query(Cc_(e));case"body":return ot.V51.RequestPropertyValue.body(Dc_(e))}}function egi(e){return{...e,property:Dc_(e.property)}}function Dc_(e){return{...e,valueType:L4(e.valueType)}}function Cc_(e){return{...e,valueType:L4(e.valueType)}}function bf8(e){return{...e,streamParameter:e.streamParameter!=null?W7i(e.streamParameter):void 0,shape:gf8(e.shape)}}function gf8(e){return ot.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V51.http.SdkRequestShape.justRequestBody(mf8(t)),wrapper:ot.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function mf8(e){switch(e.type){case"bytes":return ot.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:L4(e.requestBodyType)})}}function Of8(e){return ot.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:L4(r.valueType)}))}),reference:t=>ot.V51.http.HttpRequestBody.reference({...t,requestBodyType:L4(t.requestBodyType)}),fileUpload:t=>ot.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:L4(r.valueType)});case"file":return ot.V51.http.FileUploadRequestProperty.file(Af8(r.value))}})}),bytes:t=>ot.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Af8(e){switch(e.type){case"file":return ot.V51.http.FileProperty.file(e);case"fileArray":return ot.V51.http.FileProperty.fileArray(e)}}function Pf8(e){return{...e,type:e.type!=null?L4(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Wue(t.shape)}))}}function wf8(e){return{...e,pathParameters:e.pathParameters.map(t=>EGc(t)),headers:e.headers.map(t=>Sc_(t)),queryParameters:e.queryParameters.map(t=>EC1(t)),messages:e.messages.map(t=>({...t,body:jf8(t.body)}))}}function EC1(e){return{...e,value:Wue(e.value)}}function Sc_(e){return{...e,value:Wue(e.value)}}function EGc(e){return{...e,value:Wue(e.value)}}function jf8(e){switch(e.type){case"inlinedBody":return ot.V51.ExampleWebSocketMessageBody.inlinedBody(SC1(e));case"reference":return ot.V51.ExampleWebSocketMessageBody.reference(Wue(e))}}function SC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Wue(t.value)}))}}function gC1(e){return{...e,shape:CC1(e.shape)}}function Ic_(e){switch(e.type){case"primitive":return ot.V51.ExampleTypeReferenceShape.primitive(Ef8(e));case"container":return ot.V51.ExampleTypeReferenceShape.container(Sf8(e));case"unknown":return ot.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:CC1(e.shape)})}}function DC1(e){switch(e.type){case"integer":return ot.V51.ExamplePrimitive.integer(e.integer);case"uint":return ot.V51.ExamplePrimitive.integer(e.uint);case"uint64":return ot.V51.ExamplePrimitive.integer(e.uint64);case"double":return ot.V51.ExamplePrimitive.double(e.double);case"long":return ot.V51.ExamplePrimitive.long(e.long);case"boolean":return ot.V51.ExamplePrimitive.boolean(e.boolean);case"string":return ot.V51.ExamplePrimitive.string(e.string);case"date":return ot.V51.ExamplePrimitive.date(e.date);case"datetime":return ot.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return ot.V51.ExamplePrimitive.uuid(e.uuid)}}function Ef8(e){return DC1(e.primitive)}function Sf8(e){switch(e.container.type){case"list":return ot.V51.ExampleContainer.list({list:e.container.list.map(t=>Wue(t)),itemType:L4(e.container.itemType)});case"set":return ot.V51.ExampleContainer.set({set:e.container.set.map(t=>Wue(t)),itemType:L4(e.container.itemType)});case"optional":return ot.V51.ExampleContainer.optional({optional:e.container.optional!=null?Wue(e.container.optional):void 0,valueType:L4(e.container.valueType)});case"map":return ot.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:Wue(t.key),value:Wue(t.value)})),keyType:L4(e.container.keyType),valueType:L4(e.container.valueType)});case"literal":return ot.V51.ExampleContainer.literal({literal:DC1(e.container.literal)})}}function Wue(e){return{...e,shape:Ic_(e.shape)}}function CC1(e){switch(e.type){case"object":return ot.V51.ExampleTypeShape.object({properties:e.properties.map(t=>IC1(t))});case"alias":return ot.V51.ExampleTypeShape.alias({value:{...Wue(e.value)}});case"enum":return ot.V51.ExampleTypeShape.enum(e);case"union":return ot.V51.ExampleTypeShape.union(Cf8(e));case"undiscriminatedUnion":return ot.V51.ExampleTypeShape.undiscriminatedUnion(Df8(e))}}function Df8(e){return{...e,singleUnionType:Wue(e.singleUnionType)}}function Cf8(e){return{...e,singleUnionType:If8(e.singleUnionType)}}function If8(e){return{...e,shape:Mf8(e.shape)}}function Mf8(e){switch(e.type){case"samePropertiesAsObject":return ot.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Bf8(e.object)});case"singleProperty":return ot.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Ic_(e.shape)});case"noProperties":return ot.V51.ExampleSingleUnionTypeProperties.noProperties()}}function Bf8(e){return{...e,properties:e.properties.map(t=>IC1(t))}}function IC1(e){return{...e,value:{...e.value,shape:Ic_(e.value.shape)}}}function mC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>EGc(t)),servicePathParameters:e.servicePathParameters.map(t=>EGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>EGc(t)),serviceHeaders:e.serviceHeaders.map(t=>Sc_(t)),endpointHeaders:e.endpointHeaders.map(t=>Sc_(t)),queryParameters:e.queryParameters.map(t=>EC1(t)),request:e.request!=null?xf8(e.request):void 0,response:Tf8(e.response)}}function Tf8(e){switch(e.type){case"error":return ot.V51.ExampleResponse.error({...e,body:e.body!=null?Wue(e.body):void 0});case"ok":return ot.V51.ExampleResponse.ok(qf8(e))}}function qf8(e){switch(e.value.type){case"body":return ot.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?Wue(e.value.value):void 0);case"stream":return ot.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Wue(t)));case"sse":return ot.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Wue(t.data)})))}}function xf8(e){switch(e.type){case"inlinedRequestBody":return ot.V51.ExampleRequestBody.inlinedRequestBody(SC1(e));case"reference":return ot.V51.ExampleRequestBody.reference(Wue(e))}}var TC1={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[ye.TYPESCRIPT]:"0.38.0-rc0",[ye.TYPESCRIPT_SDK]:"0.38.0-rc0",[ye.TYPESCRIPT_EXPRESS]:"0.17.3",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.3.0",[ye.JAVA_SDK]:"2.5.0",[ye.JAVA_SPRING]:"1.3.0",[ye.PYTHON_FASTAPI]:"1.1.0-rc0",[ye.PYTHON_PYDANTIC]:"1.1.0-rc0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:"0.1.0",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:"0.2.0",[ye.PYTHON_SDK]:"3.3.0-rc0",[ye.GO_FIBER]:"0.23.5",[ye.GO_MODEL]:"0.23.5",[ye.GO_SDK]:"0.28.3",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"0.5.0",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:"0.1.0",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Rf8(e.apiVersion):void 0,auth:Hf8(e.auth),headers:e.headers.map(t=>tSa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>tSa(t)),types:Nf8(e.types),services:Rb(e.services,t=>rd8(t)),webhookGroups:Rb(e.webhookGroups,t=>Lf8(t)),websocketChannels:Rb(e.websocketChannels,t=>Ff8(t)),errors:Rb(e.errors,t=>bd8(t)),pathParameters:e.pathParameters.map(t=>Zyu(t)),variables:e.variables.map(t=>nd8(t))})};function Nf8(e){return Rb(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>MC1(r)),userProvidedExamples:t.userProvidedExamples.map(r=>MC1(r)),shape:ot.V53.types.Type._visit(t.shape,{union:r=>ot.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:U4(n.valueType)})),types:r.types.map(n=>Zf8(n))}),enum:ot.V52.types.Type.enum,object:r=>ot.V52.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:U4(n.valueType)}))}),alias:r=>ot.V52.types.Type.alias({aliasOf:U4(r.aliasOf),resolvedType:ed8(r.resolvedType)}),undiscriminatedUnion:r=>ot.V52.types.Type.undiscriminatedUnion(td8(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Rf8(e){return ot.V52.ApiVersionScheme.header({...e,header:tSa(e.header)})}function Ff8(e){return{...e,headers:e.headers.map(t=>tSa(t)),queryParameters:e.queryParameters.map(t=>Tc_(t)),pathParameters:e.pathParameters.map(t=>Zyu(t)),messages:e.messages.map(t=>zf8(t)),examples:e.examples.map(t=>gd8(t))}}function zf8(e){return{...e,body:Qf8(e.body)}}function Qf8(e){switch(e.type){case"inlinedBody":return ot.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:U4(t.valueType)}))});case"reference":return ot.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:U4(e.bodyType)})}}function Lf8(e){return e.map(t=>Uf8(t))}function Uf8(e){return{...e,headers:e.headers.map(t=>tSa(t)),payload:Vf8(e.payload),examples:e.examples!=null?e.examples.map(t=>Wf8(t)):void 0}}function Vf8(e){switch(e.type){case"reference":return ot.V52.webhooks.WebhookPayload.reference({...e,payloadType:U4(e.payloadType)});case"inlinedPayload":return ot.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:U4(t.valueType)}))})}}function Wf8(e){return{...e,payload:Hue(e.payload)}}function Hf8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V52.auth.AuthScheme.basic(t);case"bearer":return ot.V52.auth.AuthScheme.bearer(t);case"header":return ot.V52.auth.AuthScheme.header(Gf8(t));case"oauth":return ot.V52.auth.AuthScheme.oauth(Jf8(t))}})}}function Gf8(e){return{...e,valueType:U4(e.valueType)}}function Jf8(e){return{...e,configuration:ot.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:Kf8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?$f8(e.configuration.refreshEndpoint):void 0})}}function Kf8(e){return{...e,requestProperties:{clientId:H7i(e.requestProperties.clientId),clientSecret:H7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?H7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:tgi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?tgi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?tgi(e.responseProperties.refreshToken):void 0}}}function $f8(e){return{...e,requestProperties:{refreshToken:H7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:tgi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?tgi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?tgi(e.responseProperties.refreshToken):void 0}}}function tSa(e){return{...e,valueType:U4(e.valueType)}}function U4(e){return ot.V53.types.TypeReference._visit(e,{container:t=>ot.V52.types.TypeReference.container(xC1(t)),primitive:t=>ot.V52.types.TypeReference.primitive(qC1(t)),named:ot.V52.types.TypeReference.named,unknown:ot.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function qC1(e){return{v1:Yf8(e.v1),v2:e.v2!=null?Xf8(e.v2):void 0}}function Yf8(e){switch(e){case"FLOAT":return ot.V52.types.PrimitiveTypeV1.Double}return e}function Xf8(e){switch(e.type){case"integer":return ot.V52.types.PrimitiveTypeV2.integer(e);case"double":return ot.V52.types.PrimitiveTypeV2.double(e);case"string":return ot.V52.types.PrimitiveTypeV2.string(e);case"boolean":return ot.V52.types.PrimitiveTypeV2.boolean(e);case"long":return ot.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return ot.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return ot.V52.types.PrimitiveTypeV2.uint();case"uint64":return ot.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:cc(e)}}function xC1(e){return ot.V53.types.ContainerType._visit(e,{list:t=>ot.V52.types.ContainerType.list(U4(t)),optional:t=>ot.V52.types.ContainerType.optional(U4(t)),set:t=>ot.V52.types.ContainerType.set(U4(t)),map:({keyType:t,valueType:r})=>ot.V52.types.ContainerType.map({keyType:U4(t),valueType:U4(r)}),literal:ot.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function Zf8(e){return{...e,shape:kf8(e.shape)}}function kf8(e){return ot.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:U4(t.type)}),noProperties:ot.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function ed8(e){return ot.V53.types.ResolvedTypeReference._visit(e,{container:t=>ot.V52.types.ResolvedTypeReference.container(xC1(t)),named:ot.V52.types.ResolvedTypeReference.named,primitive:t=>ot.V52.types.ResolvedTypeReference.primitive(qC1(t)),unknown:ot.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function td8(e){return{members:e.members.map(t=>({...t,type:U4(t.type)}))}}function rd8(e){return{...e,pathParameters:e.pathParameters.map(t=>Zyu(t)),headers:e.headers.map(t=>tSa(t)),endpoints:e.endpoints.map(t=>id8(t))}}function Zyu(e){return{...e,valueType:U4(e.valueType)}}function nd8(e){return{...e,type:U4(e.type)}}function id8(e){return{...e,pagination:e.pagination!=null?cd8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Zyu(t)),pathParameters:e.pathParameters.map(t=>Zyu(t)),sdkRequest:e.sdkRequest!=null?pd8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?yd8(e.requestBody):void 0,response:e.response!=null?ad8(e.response):void 0,headers:e.headers.map(t=>tSa(t)),queryParameters:e.queryParameters.map(t=>Tc_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:BC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?BC1(t.example):void 0}))}}function ad8(e){return{...e,body:e.body!=null?od8(e.body):void 0}}function od8(e){switch(e.type){case"json":return ot.V52.http.HttpResponseBody.json(NC1(e.value));case"fileDownload":return ot.V52.http.HttpResponseBody.fileDownload(e);case"text":return ot.V52.http.HttpResponseBody.text(e);case"streaming":return ot.V52.http.HttpResponseBody.streaming(RC1(e.value));case"streamParameter":return ot.V52.http.HttpResponseBody.streamParameter(sd8(e))}}function NC1(e){switch(e.type){case"response":return ot.V52.http.JsonResponse.response({...e,responseBodyType:U4(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:U4(e.responseBodyType),responseProperty:e.responseProperty!=null?Bc_(e.responseProperty):void 0})}}function RC1(e){switch(e.type){case"json":return ot.V52.http.StreamingResponse.json({...e,payload:U4(e.payload)});case"text":return ot.V52.http.StreamingResponse.text(e);case"sse":return ot.V52.http.StreamingResponse.sse({...e,payload:U4(e.payload)})}}function ud8(e){switch(e.type){case"json":return ot.V52.http.NonStreamHttpResponseBody.json(NC1(e.value));case"text":return ot.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function sd8(e){return{nonStreamResponse:ud8(e.nonStreamResponse),streamResponse:RC1(e.streamResponse)}}function cd8(e){switch(e.type){case"cursor":return ot.V52.http.Pagination.cursor(ld8(e));case"offset":return ot.V52.http.Pagination.offset(fd8(e))}}function ld8(e){return{...e,page:H7i(e.page),next:tgi(e.next),results:tgi(e.results)}}function fd8(e){return{...e,page:H7i(e.page),results:tgi(e.results),step:e.step!=null?H7i(e.step):void 0}}function H7i(e){return{...e,property:dd8(e.property)}}function dd8(e){switch(e.type){case"query":return ot.V52.RequestPropertyValue.query(Tc_(e));case"body":return ot.V52.RequestPropertyValue.body(Bc_(e))}}function tgi(e){return{...e,property:Bc_(e.property)}}function Bc_(e){return{...e,valueType:U4(e.valueType)}}function Tc_(e){return{...e,valueType:U4(e.valueType)}}function pd8(e){return{...e,streamParameter:e.streamParameter!=null?H7i(e.streamParameter):void 0,shape:_d8(e.shape)}}function _d8(e){return ot.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V52.http.SdkRequestShape.justRequestBody(hd8(t)),wrapper:ot.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function hd8(e){switch(e.type){case"bytes":return ot.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:U4(e.requestBodyType)})}}function yd8(e){return ot.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:U4(r.valueType)}))}),reference:t=>ot.V52.http.HttpRequestBody.reference({...t,requestBodyType:U4(t.requestBodyType)}),fileUpload:t=>ot.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:U4(r.valueType)});case"file":return ot.V52.http.FileUploadRequestProperty.file(vd8(r.value))}})}),bytes:t=>ot.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function vd8(e){switch(e.type){case"file":return ot.V52.http.FileProperty.file(e);case"fileArray":return ot.V52.http.FileProperty.fileArray(e)}}function bd8(e){return{...e,type:e.type!=null?U4(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Hue(t.shape)}))}}function gd8(e){return{...e,pathParameters:e.pathParameters.map(t=>SGc(t)),headers:e.headers.map(t=>Mc_(t)),queryParameters:e.queryParameters.map(t=>FC1(t)),messages:e.messages.map(t=>({...t,body:md8(t.body)}))}}function FC1(e){return{...e,value:Hue(e.value)}}function Mc_(e){return{...e,value:Hue(e.value)}}function SGc(e){return{...e,value:Hue(e.value)}}function md8(e){switch(e.type){case"inlinedBody":return ot.V52.ExampleWebSocketMessageBody.inlinedBody(zC1(e));case"reference":return ot.V52.ExampleWebSocketMessageBody.reference(Hue(e))}}function zC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Hue(t.value)}))}}function MC1(e){return{...e,shape:LC1(e.shape)}}function qc_(e){switch(e.type){case"primitive":return ot.V52.ExampleTypeReferenceShape.primitive(Od8(e));case"container":return ot.V52.ExampleTypeReferenceShape.container(Ad8(e));case"unknown":return ot.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:LC1(e.shape)})}}function QC1(e){switch(e.type){case"integer":return ot.V52.ExamplePrimitive.integer(e.integer);case"uint":return ot.V52.ExamplePrimitive.integer(e.uint);case"uint64":return ot.V52.ExamplePrimitive.integer(e.uint64);case"float":return ot.V52.ExamplePrimitive.double(e.float);case"double":return ot.V52.ExamplePrimitive.double(e.double);case"long":return ot.V52.ExamplePrimitive.long(e.long);case"boolean":return ot.V52.ExamplePrimitive.boolean(e.boolean);case"string":return ot.V52.ExamplePrimitive.string(e.string);case"date":return ot.V52.ExamplePrimitive.date(e.date);case"datetime":return ot.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return ot.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return ot.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return ot.V52.ExamplePrimitive.string({original:e.bigInteger})}}function Od8(e){return QC1(e.primitive)}function Ad8(e){switch(e.container.type){case"list":return ot.V52.ExampleContainer.list({list:e.container.list.map(t=>Hue(t)),itemType:U4(e.container.itemType)});case"set":return ot.V52.ExampleContainer.set({set:e.container.set.map(t=>Hue(t)),itemType:U4(e.container.itemType)});case"optional":return ot.V52.ExampleContainer.optional({optional:e.container.optional!=null?Hue(e.container.optional):void 0,valueType:U4(e.container.valueType)});case"map":return ot.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:Hue(t.key),value:Hue(t.value)})),keyType:U4(e.container.keyType),valueType:U4(e.container.valueType)});case"literal":return ot.V52.ExampleContainer.literal({literal:QC1(e.container.literal)})}}function Hue(e){return{...e,shape:qc_(e.shape)}}function LC1(e){switch(e.type){case"object":return ot.V52.ExampleTypeShape.object({properties:e.properties.map(t=>UC1(t))});case"alias":return ot.V52.ExampleTypeShape.alias({value:{...Hue(e.value)}});case"enum":return ot.V52.ExampleTypeShape.enum(e);case"union":return ot.V52.ExampleTypeShape.union(wd8(e));case"undiscriminatedUnion":return ot.V52.ExampleTypeShape.undiscriminatedUnion(Pd8(e))}}function Pd8(e){return{...e,singleUnionType:Hue(e.singleUnionType)}}function wd8(e){return{...e,singleUnionType:jd8(e.singleUnionType)}}function jd8(e){return{...e,shape:Ed8(e.shape)}}function Ed8(e){switch(e.type){case"samePropertiesAsObject":return ot.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Sd8(e.object)});case"singleProperty":return ot.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:qc_(e.shape)});case"noProperties":return ot.V52.ExampleSingleUnionTypeProperties.noProperties()}}function Sd8(e){return{...e,properties:e.properties.map(t=>UC1(t))}}function UC1(e){return{...e,value:{...e.value,shape:qc_(e.value.shape)}}}function BC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>SGc(t)),servicePathParameters:e.servicePathParameters.map(t=>SGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>SGc(t)),serviceHeaders:e.serviceHeaders.map(t=>Mc_(t)),endpointHeaders:e.endpointHeaders.map(t=>Mc_(t)),queryParameters:e.queryParameters.map(t=>FC1(t)),request:e.request!=null?Id8(e.request):void 0,response:Dd8(e.response)}}function Dd8(e){switch(e.type){case"error":return ot.V52.ExampleResponse.error({...e,body:e.body!=null?Hue(e.body):void 0});case"ok":return ot.V52.ExampleResponse.ok(Cd8(e))}}function Cd8(e){switch(e.value.type){case"body":return ot.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?Hue(e.value.value):void 0);case"stream":return ot.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Hue(t)));case"sse":return ot.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Hue(t.data)})))}}function Id8(e){switch(e.type){case"inlinedRequestBody":return ot.V52.ExampleRequestBody.inlinedRequestBody(zC1(e));case"reference":return ot.V52.ExampleRequestBody.reference(Hue(e))}}var VC1={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:xt,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Rb(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:Md8(r.response)}))}))})};function Md8(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?ot.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var GC1={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.47.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[ye.TYPESCRIPT]:"0.47.0",[ye.TYPESCRIPT_SDK]:"0.47.0",[ye.TYPESCRIPT_EXPRESS]:"0.17.7",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.7.0",[ye.JAVA_SDK]:"2.16.0",[ye.JAVA_SPRING]:"1.5.0",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"1.10.1",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:"0.3.2",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Td8(e.apiVersion):void 0,auth:Ld8(e.auth),headers:e.headers.map(t=>rSa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>rSa(t)),types:Bd8(e.types),services:Rb(e.services,t=>Yd8(t)),webhookGroups:Rb(e.webhookGroups,t=>Rd8(t)),websocketChannels:Rb(e.websocketChannels,t=>qd8(t)),errors:Rb(e.errors,t=>dp8(t)),pathParameters:e.pathParameters.map(t=>kyu(t)),variables:e.variables.map(t=>Xd8(t)),dynamic:e.dynamic!=null?jp8(e.dynamic):void 0})};function Bd8(e){return Rb(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>WC1(r)),userProvidedExamples:t.userProvidedExamples.map(r=>WC1(r)),shape:ot.V55.types.Type._visit(t.shape,{union:r=>ot.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:NB(n.valueType)})),types:r.types.map(n=>Gd8(n))}),enum:ot.V54.types.Type.enum,object:r=>ot.V54.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:NB(n.valueType)})),extendedProperties:r.extendedProperties?.map(n=>({...n,valueType:NB(n.valueType)}))}),alias:r=>ot.V54.types.Type.alias({aliasOf:NB(r.aliasOf),resolvedType:Kd8(r.resolvedType)}),undiscriminatedUnion:r=>ot.V54.types.Type.undiscriminatedUnion($d8(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Td8(e){return ot.V54.ApiVersionScheme.header({...e,header:rSa(e.header)})}function qd8(e){return{...e,headers:e.headers.map(t=>rSa(t)),queryParameters:e.queryParameters.map(t=>Rc_(t)),pathParameters:e.pathParameters.map(t=>kyu(t)),messages:e.messages.map(t=>xd8(t)),examples:e.examples.map(t=>pp8(t))}}function xd8(e){return{...e,body:Nd8(e.body)}}function Nd8(e){switch(e.type){case"inlinedBody":return ot.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:NB(t.valueType)}))});case"reference":return ot.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:NB(e.bodyType)})}}function Rd8(e){return e.map(t=>Fd8(t))}function Fd8(e){return{...e,headers:e.headers.map(t=>rSa(t)),payload:zd8(e.payload),examples:e.examples!=null?e.examples.map(t=>Qd8(t)):void 0}}function zd8(e){switch(e.type){case"reference":return ot.V54.webhooks.WebhookPayload.reference({...e,payloadType:NB(e.payloadType)});case"inlinedPayload":return ot.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:NB(t.valueType)}))})}}function Qd8(e){return{...e,payload:Yne(e.payload)}}function Ld8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V54.auth.AuthScheme.basic(t);case"bearer":return ot.V54.auth.AuthScheme.bearer(t);case"header":return ot.V54.auth.AuthScheme.header(Ud8(t));case"oauth":return ot.V54.auth.AuthScheme.oauth(Vd8(t))}})}}function Ud8(e){return{...e,valueType:NB(e.valueType)}}function Vd8(e){return{...e,configuration:ot.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:Wd8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?Hd8(e.configuration.refreshEndpoint):void 0})}}function Wd8(e){return{...e,requestProperties:{clientId:G7i(e.requestProperties.clientId),clientSecret:G7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?G7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:gri(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?gri(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?gri(e.responseProperties.refreshToken):void 0}}}function Hd8(e){return{...e,requestProperties:{refreshToken:G7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:gri(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?gri(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?gri(e.responseProperties.refreshToken):void 0}}}function rSa(e){return{...e,valueType:NB(e.valueType)}}function NB(e){return e.type==="container"&&e.container.type==="nullable"?Fp8(e.container.nullable):e.type==="container"&&e.container.type==="optional"?Rp8(e.container.optional):ot.V55.types.TypeReference._visit(e,{container:t=>ot.V54.types.TypeReference.container(KC1(t)),primitive:t=>ot.V54.types.TypeReference.primitive(JC1(t)),named:ot.V54.types.TypeReference.named,unknown:ot.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function JC1(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function KC1(e){return ot.V55.types.ContainerType._visit(e,{list:t=>ot.V54.types.ContainerType.list(NB(t)),optional:t=>ot.V54.types.ContainerType.optional(NB(t)),nullable:t=>ot.V54.types.ContainerType.optional(NB(t)),set:t=>ot.V54.types.ContainerType.set(NB(t)),map:({keyType:t,valueType:r})=>ot.V54.types.ContainerType.map({keyType:NB(t),valueType:NB(r)}),literal:ot.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function Gd8(e){return{...e,shape:Jd8(e.shape)}}function Jd8(e){return ot.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:NB(t.type)}),noProperties:ot.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function Kd8(e){return ot.V55.types.ResolvedTypeReference._visit(e,{container:t=>ot.V54.types.ResolvedTypeReference.container(KC1(t)),named:ot.V54.types.ResolvedTypeReference.named,primitive:t=>ot.V54.types.ResolvedTypeReference.primitive(JC1(t)),unknown:ot.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function $d8(e){return{members:e.members.map(t=>({...t,type:NB(t.type)}))}}function Yd8(e){return{...e,pathParameters:e.pathParameters.map(t=>kyu(t)),headers:e.headers.map(t=>rSa(t)),endpoints:e.endpoints.map(t=>Zd8(t))}}function kyu(e){return{...e,valueType:NB(e.valueType)}}function Xd8(e){return{...e,type:NB(e.type)}}function Zd8(e){return{...e,pagination:e.pagination!=null?np8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>kyu(t)),pathParameters:e.pathParameters.map(t=>kyu(t)),sdkRequest:e.sdkRequest!=null?up8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?lp8(e.requestBody):void 0,response:e.response!=null?kd8(e.response):void 0,headers:e.headers.map(t=>rSa(t)),queryParameters:e.queryParameters.map(t=>Rc_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:HC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?HC1(t.example):void 0}))}}function kd8(e){return{...e,body:e.body!=null?ep8(e.body):void 0}}function ep8(e){switch(e.type){case"json":return ot.V54.http.HttpResponseBody.json($C1(e.value));case"fileDownload":return ot.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return ot.V54.http.HttpResponseBody.bytes(e);case"text":return ot.V54.http.HttpResponseBody.text(e);case"streaming":return ot.V54.http.HttpResponseBody.streaming(YC1(e.value));case"streamParameter":return ot.V54.http.HttpResponseBody.streamParameter(rp8(e));default:cc(e)}}function $C1(e){switch(e.type){case"response":return ot.V54.http.JsonResponse.response({...e,responseBodyType:NB(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:NB(e.responseBodyType),responseProperty:e.responseProperty!=null?Nc_(e.responseProperty):void 0})}}function YC1(e){switch(e.type){case"json":return ot.V54.http.StreamingResponse.json({...e,payload:NB(e.payload)});case"text":return ot.V54.http.StreamingResponse.text(e);case"sse":return ot.V54.http.StreamingResponse.sse({...e,payload:NB(e.payload)})}}function tp8(e){switch(e.type){case"json":return ot.V54.http.NonStreamHttpResponseBody.json($C1(e.value));case"bytes":return ot.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return ot.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:cc(e)}}function rp8(e){return{nonStreamResponse:tp8(e.nonStreamResponse),streamResponse:YC1(e.streamResponse)}}function np8(e){switch(e.type){case"cursor":return ot.V54.http.Pagination.cursor(ip8(e));case"offset":return ot.V54.http.Pagination.offset(ap8(e))}}function ip8(e){return{...e,page:G7i(e.page),next:gri(e.next),results:gri(e.results)}}function ap8(e){return{...e,page:G7i(e.page),results:gri(e.results),step:e.step!=null?G7i(e.step):void 0,hasNextPage:e.hasNextPage!=null?gri(e.hasNextPage):void 0}}function G7i(e){return{...e,property:op8(e.property)}}function op8(e){switch(e.type){case"query":return ot.V54.RequestPropertyValue.query(Rc_(e));case"body":return ot.V54.RequestPropertyValue.body(Nc_(e))}}function gri(e){return{...e,property:Nc_(e.property)}}function Nc_(e){return{...e,valueType:NB(e.valueType)}}function Rc_(e){return{...e,valueType:NB(e.valueType)}}function up8(e){return{...e,streamParameter:e.streamParameter!=null?G7i(e.streamParameter):void 0,shape:sp8(e.shape)}}function sp8(e){return ot.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V54.http.SdkRequestShape.justRequestBody(cp8(t)),wrapper:ot.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function cp8(e){switch(e.type){case"bytes":return ot.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:NB(e.requestBodyType)})}}function lp8(e){return ot.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:NB(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:NB(r.valueType)}))}),reference:t=>ot.V54.http.HttpRequestBody.reference({...t,requestBodyType:NB(t.requestBodyType)}),fileUpload:t=>ot.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:NB(r.valueType)});case"file":return ot.V54.http.FileUploadRequestProperty.file(fp8(r.value))}})}),bytes:t=>ot.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function fp8(e){switch(e.type){case"file":return ot.V54.http.FileProperty.file(e);case"fileArray":return ot.V54.http.FileProperty.fileArray(e)}}function dp8(e){return{...e,type:e.type!=null?NB(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Yne(t.shape)}))}}function pp8(e){return{...e,pathParameters:e.pathParameters.map(t=>DGc(t)),headers:e.headers.map(t=>xc_(t)),queryParameters:e.queryParameters.map(t=>XC1(t)),messages:e.messages.map(t=>({...t,body:_p8(t.body)}))}}function XC1(e){return{...e,value:Yne(e.value)}}function xc_(e){return{...e,value:Yne(e.value)}}function DGc(e){return{...e,value:Yne(e.value)}}function _p8(e){switch(e.type){case"inlinedBody":return ot.V54.ExampleWebSocketMessageBody.inlinedBody(ZC1(e));case"reference":return ot.V54.ExampleWebSocketMessageBody.reference(Yne(e))}}function ZC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Yne(t.value)}))}}function WC1(e){return{...e,shape:kC1(e.shape)}}function Fc_(e){switch(e.type){case"primitive":return ot.V54.ExampleTypeReferenceShape.primitive(hp8(e));case"container":return ot.V54.ExampleTypeReferenceShape.container(yp8(e));case"unknown":return ot.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:kC1(e.shape)})}}function hp8(e){return e.primitive}function yp8(e){switch(e.container.type){case"list":return ot.V54.ExampleContainer.list({list:e.container.list.map(t=>Yne(t)),itemType:NB(e.container.itemType)});case"set":return ot.V54.ExampleContainer.set({set:e.container.set.map(t=>Yne(t)),itemType:NB(e.container.itemType)});case"optional":return ot.V54.ExampleContainer.optional({optional:e.container.optional!=null?Yne(e.container.optional):void 0,valueType:NB(e.container.valueType)});case"nullable":return ot.V54.ExampleContainer.optional({optional:e.container.nullable!=null?Yne(e.container.nullable):void 0,valueType:NB(e.container.valueType)});case"map":return ot.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:Yne(t.key),value:Yne(t.value)})),keyType:NB(e.container.keyType),valueType:NB(e.container.valueType)});case"literal":return ot.V54.ExampleContainer.literal({literal:e.container.literal})}}function Yne(e){return{...e,shape:Fc_(e.shape)}}function kC1(e){switch(e.type){case"object":return ot.V54.ExampleTypeShape.object({properties:e.properties.map(t=>eI1(t))});case"alias":return ot.V54.ExampleTypeShape.alias({value:{...Yne(e.value)}});case"enum":return ot.V54.ExampleTypeShape.enum(e);case"union":return ot.V54.ExampleTypeShape.union(bp8(e));case"undiscriminatedUnion":return ot.V54.ExampleTypeShape.undiscriminatedUnion(vp8(e))}}function vp8(e){return{...e,singleUnionType:Yne(e.singleUnionType)}}function bp8(e){return{...e,singleUnionType:gp8(e.singleUnionType)}}function gp8(e){return{...e,shape:mp8(e.shape)}}function mp8(e){switch(e.type){case"samePropertiesAsObject":return ot.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Op8(e.object)});case"singleProperty":return ot.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Fc_(e.shape)});case"noProperties":return ot.V54.ExampleSingleUnionTypeProperties.noProperties()}}function Op8(e){return{...e,properties:e.properties.map(t=>eI1(t))}}function eI1(e){return{...e,value:{...e.value,shape:Fc_(e.value.shape)}}}function HC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>DGc(t)),servicePathParameters:e.servicePathParameters.map(t=>DGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>DGc(t)),serviceHeaders:e.serviceHeaders.map(t=>xc_(t)),endpointHeaders:e.endpointHeaders.map(t=>xc_(t)),queryParameters:e.queryParameters.map(t=>XC1(t)),request:e.request!=null?wp8(e.request):void 0,response:Ap8(e.response)}}function Ap8(e){switch(e.type){case"error":return ot.V54.ExampleResponse.error({...e,body:e.body!=null?Yne(e.body):void 0});case"ok":return ot.V54.ExampleResponse.ok(Pp8(e))}}function Pp8(e){switch(e.value.type){case"body":return ot.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?Yne(e.value.value):void 0);case"stream":return ot.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Yne(t)));case"sse":return ot.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Yne(t.data)})))}}function wp8(e){switch(e.type){case"inlinedRequestBody":return ot.V54.ExampleRequestBody.inlinedRequestBody(ZC1(e));case"reference":return ot.V54.ExampleRequestBody.reference(Yne(e))}}function jp8(e){return{...e,types:Rb(e.types,t=>Ep8(t)),endpoints:Rb(e.endpoints,t=>Sp8(t)),headers:e.headers?.map(t=>HPr(t))}}function Ep8(e){switch(e.type){case"alias":return ot.V54.dynamic.NamedType.alias({...e,typeReference:Tat(e.typeReference)});case"enum":return ot.V54.dynamic.NamedType.enum(e);case"object":return ot.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>HPr(t))});case"discriminatedUnion":return ot.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Cp8(r)]))});case"undiscriminatedUnion":return ot.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>Tat(t))});default:cc(e)}}function Sp8(e){return{...e,auth:e.auth!=null?Dp8(e.auth):void 0,request:Ip8(e.request)}}function Dp8(e){switch(e.type){case"basic":return ot.V54.dynamic.Auth.basic(e);case"bearer":return ot.V54.dynamic.Auth.bearer(e);case"header":return ot.V54.dynamic.Auth.header({header:HPr(e.header)})}}function Tat(e){switch(e.type){case"list":return ot.V54.dynamic.TypeReference.list(Tat(e.value));case"optional":return Qp8(e.value);case"nullable":return zp8(e.value);case"map":return ot.V54.dynamic.TypeReference.map({...e,key:Tat(e.key),value:Tat(e.value)});case"literal":return ot.V54.dynamic.TypeReference.literal(e.value);case"named":return ot.V54.dynamic.TypeReference.named(e.value);case"primitive":return ot.V54.dynamic.TypeReference.primitive(e.value);case"set":return ot.V54.dynamic.TypeReference.set(Tat(e.value));case"unknown":return ot.V54.dynamic.TypeReference.unknown();default:cc(e)}}function Cp8(e){switch(e.type){case"samePropertiesAsObject":return ot.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>HPr(t))});case"singleProperty":return ot.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:Tat(e.typeReference),properties:e.properties?.map(t=>HPr(t))});case"noProperties":return ot.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>HPr(t))});default:cc(e)}}function HPr(e){return{...e,typeReference:Tat(e.typeReference)}}function Ip8(e){switch(e.type){case"body":return ot.V54.dynamic.Request.body(Mp8(e));case"inlined":return ot.V54.dynamic.Request.inlined(Bp8(e));default:cc(e)}}function Mp8(e){return{pathParameters:e.pathParameters?.map(t=>HPr(t)),body:e.body!=null?tI1(e.body):void 0}}function Bp8(e){return{...e,pathParameters:e.pathParameters?.map(t=>HPr(t)),queryParameters:e.queryParameters?.map(t=>HPr(t)),headers:e.headers?.map(t=>HPr(t)),body:e.body!=null?Tp8(e.body):void 0}}function Tp8(e){switch(e.type){case"properties":return ot.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>HPr(t)));case"referenced":return ot.V54.dynamic.InlinedRequestBody.referenced(qp8(e));case"fileUpload":return ot.V54.dynamic.InlinedRequestBody.fileUpload(xp8(e));default:cc(e)}}function qp8(e){return{...e,bodyType:tI1(e.bodyType)}}function tI1(e){switch(e.type){case"bytes":return ot.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return ot.V54.dynamic.ReferencedRequestBodyType.typeReference(Tat(e.value));default:cc(e)}}function xp8(e){return{properties:e.properties.map(t=>Np8(t))}}function Np8(e){switch(e.type){case"file":return ot.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return ot.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return ot.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(HPr(e));default:cc(e)}}function Rp8(e){return e.type==="container"&&e.container.type==="nullable"?ot.V54.types.TypeReference.container(ot.V54.types.ContainerType.optional(NB(e.container.nullable))):ot.V54.types.TypeReference.container(ot.V54.types.ContainerType.optional(NB(e)))}function Fp8(e){return e.type==="container"&&e.container.type==="optional"?NB(e):ot.V54.types.TypeReference.container(ot.V54.types.ContainerType.optional(NB(e)))}function zp8(e){return e.type==="optional"?Tat(e):ot.V54.dynamic.TypeReference.optional(Tat(e))}function Qp8(e){return e.type==="nullable"?ot.V54.dynamic.TypeReference.optional(Tat(e.value)):ot.V54.dynamic.TypeReference.optional(Tat(e))}var rI1={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:"0.0.2",[ye.CSHARP_SDK]:"1.12.0-rc0",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:xt,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Rb(e.services,t=>Lp8(t))})};function Lp8(e){return{...e,endpoints:e.endpoints.map(t=>Up8(t))}}function Up8(e){return{...e,pagination:Vp8(e.pagination)}}function Vp8(e){if(e!=null)switch(e.type){case"cursor":return ot.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return ot.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:cc(e)}}var nI1={laterVersion:"v57",earlierVersion:"v56",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.49.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.49.0",[ye.TYPESCRIPT]:"0.49.0",[ye.TYPESCRIPT_SDK]:"0.49.0",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.8.0",[ye.JAVA_SDK]:"2.34.0",[ye.JAVA_SPRING]:"1.6.0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:"1.6.3",[ye.PYTHON_PYDANTIC]:"1.4.8",[ye.PYTHON_SDK]:"4.3.19",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:"0.23.6",[ye.GO_MODEL]:"0.23.6",[ye.GO_SDK]:"0.37.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"1.12.0-rc11",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:"0.14.1",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V56.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?Wp8(e.dynamic):void 0})};function Wp8(e){return{...e,endpoints:Hp8(e.endpoints)}}function Hp8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Gp8(r)]).filter(([t,r])=>r!=null))}function Gp8(e){return{...e,auth:e.auth!=null?$p8(e.auth):void 0,examples:e.examples!=null?Jp8(e.examples):void 0}}function Jp8(e){return e.map(t=>Kp8(t)).filter(t=>t!=null)}function Kp8(e){return{...e,auth:e.auth!=null?Yp8(e.auth):void 0}}function $p8(e){switch(e.type){case"basic":return ot.V56.dynamic.Auth.basic(e);case"bearer":return ot.V56.dynamic.Auth.bearer(e);case"header":return ot.V56.dynamic.Auth.header(e);case"oauth":return;default:cc(e)}}function Yp8(e){switch(e.type){case"basic":return ot.V56.dynamic.AuthValues.basic(e);case"bearer":return ot.V56.dynamic.AuthValues.bearer(e);case"header":return ot.V56.dynamic.AuthValues.header(e);case"oauth":return;default:cc(e)}}var iI1={laterVersion:"v58",earlierVersion:"v57",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"1.2.0",[ye.TYPESCRIPT_BROWSER_SDK]:"1.2.0",[ye.TYPESCRIPT]:"1.2.0",[ye.TYPESCRIPT_SDK]:"1.2.0",[ye.TYPESCRIPT_EXPRESS]:"0.18.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:"2.36.5",[ye.JAVA_SPRING]:"1.6.1",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:"1.7.0",[ye.PYTHON_PYDANTIC]:"1.5.0",[ye.PYTHON_SDK]:"4.21.0",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:"1.1.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"1.17.5",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:"0.1.0",[ye.PHP_MODEL]:xt,[ye.PHP_SDK]:"1.15.1",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:"0.0.0"},jsonifyEarlierVersion:e=>$0.V57.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:e.services!=null?Xp8(e.services):void 0,dynamic:e.dynamic!=null?t_8(e.dynamic):void 0})};function Xp8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Zp8(r)]))}function Zp8(e){return{...e,endpoints:kp8(e.endpoints)}}function kp8(e){return e.map(e_8).filter(t=>t!=null)}function e_8(e){if(e.method!=="HEAD")return{...e,method:e.method}}function t_8(e){return{...e,endpoints:r_8(e.endpoints)}}function r_8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,n_8(r)]).filter(([t,r])=>r!=null))}function n_8(e){let t=e.location.method;if(t!=="HEAD")return{...e,examples:e.examples!=null?i_8(e.examples):void 0,location:{...e.location,method:t}}}function i_8(e){return e.map(t=>a_8(t)).filter(t=>t!=null)}function a_8(e){let t=e.endpoint.method;if(t!=="HEAD")return{...e,endpoint:{...e.endpoint,method:t}}}var aI1={laterVersion:"v59",earlierVersion:"v58",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"2.6.8",[ye.TYPESCRIPT_BROWSER_SDK]:"2.6.8",[ye.TYPESCRIPT]:"2.6.8",[ye.TYPESCRIPT_SDK]:"2.6.8",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.8.1",[ye.JAVA_SDK]:"2.43.0",[ye.JAVA_SPRING]:"1.8.2",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:"1.8.0",[ye.PYTHON_PYDANTIC]:"1.6.0",[ye.PYTHON_SDK]:"4.26.0",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:"0.23.7",[ye.GO_MODEL]:"0.23.7",[ye.GO_SDK]:"1.7.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:"0.0.3",[ye.CSHARP_SDK]:"2.2.0",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:"0.6.0",[ye.PHP_MODEL]:xt,[ye.PHP_SDK]:"1.17.0",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:xt},jsonifyEarlierVersion:e=>$0.V58.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?u_8(e.dynamic):void 0,auth:e.auth!=null?o_8(e.auth):void 0})};function o_8(e){return{...e,schemes:e.schemes.filter(t=>t.type!=="inferred")}}function u_8(e){return{...e,endpoints:s_8(e.endpoints)}}function s_8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,c_8(r)]).filter(([t,r])=>r!=null))}function c_8(e){return{...e,examples:e.examples!=null?f_8(e.examples):void 0,auth:l_8(e.auth)}}function l_8(e){return e==null?e:e._visit({basic:t=>ot.V58.dynamic.Auth.basic(t),bearer:t=>ot.V58.dynamic.Auth.bearer(t),header:t=>ot.V58.dynamic.Auth.header(t),oauth:t=>ot.V58.dynamic.Auth.oauth(t),inferred:()=>{},_other:()=>{}})}function f_8(e){return e.map(t=>d_8(t)).filter(t=>t!=null)}function d_8(e){return{...e,auth:p_8(e.auth)}}function p_8(e){if(e==null)return e;if(e.type!=="inferred")return e}var oI1={laterVersion:"v60",earlierVersion:"v59",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"2.11.2",[ye.TYPESCRIPT_BROWSER_SDK]:"2.11.2",[ye.TYPESCRIPT]:"2.11.2",[ye.TYPESCRIPT_SDK]:"2.11.2",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.PYTHON_SDK]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:xt,[ye.PHP_MODEL]:xt,[ye.PHP_SDK]:xt,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:xt},jsonifyEarlierVersion:e=>$0.V59.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:y_8(e.services),auth:__8(e.auth)})};function __8(e){return{...e,schemes:h_8(e.schemes)}}function h_8(e){return e.map(t=>{switch(t.type){case"bearer":return ot.V59.AuthScheme.bearer({...t});case"basic":return ot.V59.AuthScheme.basic({...t});case"header":return ot.V59.AuthScheme.header({...t});case"oauth":switch(t.configuration.type){case"clientCredentials":return ot.V59.AuthScheme.oauth({...t,configuration:ot.V59.OAuthConfiguration.clientCredentials({...t.configuration,refreshEndpoint:t.configuration.refreshEndpoint?{...t.configuration.refreshEndpoint,responseProperties:{accessToken:nSa(t.configuration.refreshEndpoint.responseProperties.accessToken),expiresIn:pvo(t.configuration.refreshEndpoint.responseProperties.expiresIn),refreshToken:pvo(t.configuration.refreshEndpoint.responseProperties.refreshToken)},requestProperties:{refreshToken:_vo(t.configuration.refreshEndpoint.requestProperties.refreshToken)}}:void 0,tokenEndpoint:{...t.configuration.tokenEndpoint,responseProperties:{accessToken:nSa(t.configuration.tokenEndpoint.responseProperties.accessToken),expiresIn:pvo(t.configuration.tokenEndpoint.responseProperties.expiresIn),refreshToken:pvo(t.configuration.tokenEndpoint.responseProperties.refreshToken)},requestProperties:{clientId:_vo(t.configuration.tokenEndpoint.requestProperties.clientId),clientSecret:_vo(t.configuration.tokenEndpoint.requestProperties.clientSecret),scopes:zc_(t.configuration.tokenEndpoint.requestProperties.scopes),customProperties:t.configuration.tokenEndpoint.requestProperties.customProperties?.map(_vo)}}})});default:cc(t.configuration.type)}break;case"inferred":return ot.V59.AuthScheme.inferred({...t,tokenEndpoint:{...t.tokenEndpoint,expiryProperty:pvo(t.tokenEndpoint.expiryProperty),authenticatedRequestHeaders:t.tokenEndpoint.authenticatedRequestHeaders.map(r=>({...r,responseProperty:nSa(r.responseProperty)}))}});default:cc(t)}})}function y_8(e){return Object.entries(e).reduce((t,[r,n])=>(t[r]={...n,endpoints:v_8(n.endpoints)},t),{})}function v_8(e){return e.map(t=>({...t,pagination:b_8(t.pagination),sdkRequest:g_8(t.sdkRequest)}))}function b_8(e){if(!e)return e;switch(e.type){case"cursor":return ot.V59.Pagination.cursor({next:nSa(e.next),results:nSa(e.results),page:_vo(e.page)});case"offset":return ot.V59.Pagination.offset({hasNextPage:pvo(e.hasNextPage),results:nSa(e.results),page:_vo(e.page),step:zc_(e.step)});case"custom":return ot.V59.Pagination.custom({results:nSa(e.results)});default:cc(e)}}function zc_(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function _vo(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function pvo(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function nSa(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function g_8(e){return e&&{...e,streamParameter:zc_(e.streamParameter)}}function evu(){return O_8}var CGc=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new Qc_([...this.migrations,t])}},Qc_=class extends CGc{build(){return new Lc_(this.migrations)}},Lc_=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(()=>y0.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let c=this.migrate({intermediateRepresentation:r,shouldMigrate:p=>{let s=p.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,u=async()=>y0.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}),u=()=>Promise.resolve().then(()=>c.jsonifyEarlierVersion(a))}return{ir:a,jsonify:u}}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 xt:return!0;case Qn:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return fNe(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}},m_8={Builder:new CGc([])},O_8=m_8.Builder.withMigration(oI1).withMigration(aI1).withMigration(iI1).withMigration(nI1).withMigration(rI1).withMigration(GC1).withMigration(VC1).withMigration(TC1).withMigration(OC1).withMigration(_C1).withMigration(sC1).withMigration(uC1).withMigration(aC1).withMigration(iC1).withMigration(tC1).withMigration(ZD1).withMigration(XD1).withMigration($D1).withMigration(KD1).withMigration(JD1).withMigration(GD1).withMigration(HD1).withMigration(WD1).withMigration(VD1).withMigration(UD1).withMigration(LD1).withMigration(QD1).withMigration(zD1).withMigration(RD1).withMigration(xD1).withMigration(qD1).withMigration(TD1).withMigration(ED1).withMigration(jD1).withMigration(wD1).withMigration(AD1).withMigration(OD1).withMigration(anP).withMigration(rnP).withMigration(tnP).withMigration(ZrP).withMigration(YrP).withMigration(KrP).withMigration(JrP).withMigration(GrP).withMigration(VrP).withMigration(QrP).withMigration(zrP).withMigration(FrP).withMigration(NrP).withMigration(xrP).withMigration(qrP).withMigration(IrP).withMigration(SrP).withMigration(ErP).withMigration(jrP).withMigration(frP).withMigration(srP).withMigration(tdv).build();function tvu({intermediateRepresentation:e,context:t,targetGenerator:r}){return evu().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function Uc_({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:n}){return evu().migrateThroughVersion({version:n,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function rvu({intermediateRepresentation:e,context:t,version:r}){return evu().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function uI1({workspace:e,audiences:t,generatorInvocation:r,context:n,irVersionOverride:i,version:a,packageName:u,sourceConfig:c,includeOptionalRequestPropertyExamples:p,ir:s}){let o=s??UV({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:p,disabled:r.disableExamples},readme:r.readme,version:a,packageName:u,context:n,sourceResolver:new LV(n,e)});c!=null&&(o.sourceConfig=c),n.logger.debug("Generated IR");let l=i!=null?await rvu({intermediateRepresentation:o,context:n,version:i}):await tvu({intermediateRepresentation:o,context:n,targetGenerator:{name:r.name,version:r.version}});return{latest:o,migrated:l}}var sI1=Xi(MDs(),1),lYe=require("fs/promises"),cI1=Xi(TEe(),1),IGc=class{context;absolutePathToTmpOutputDirectory;absolutePathToTmpSnippetJSON;absolutePathToTmpSnippetTemplatesJSON;absolutePathToLocalSnippetTemplateJSON;absolutePathToLocalOutput;absolutePathToLocalSnippetJSON;constructor({context:t,absolutePathToTmpOutputDirectory:r,absolutePathToTmpSnippetJSON:n,absolutePathToLocalSnippetTemplateJSON:i,absolutePathToLocalOutput:a,absolutePathToLocalSnippetJSON:u,absolutePathToTmpSnippetTemplatesJSON:c}){this.context=t,this.absolutePathToLocalOutput=a,this.absolutePathToTmpOutputDirectory=r,this.absolutePathToTmpSnippetJSON=n,this.absolutePathToLocalSnippetJSON=u,this.absolutePathToLocalSnippetTemplateJSON=i,this.absolutePathToTmpSnippetTemplatesJSON=c}async copyGeneratedFiles(){await this.isFernIgnorePresent()?await this.copyGeneratedFilesWithFernIgnore():await this.copyGeneratedFilesNoFernIgnore(),this.absolutePathToTmpSnippetJSON!=null&&this.absolutePathToLocalSnippetJSON!=null&&await _v(this.absolutePathToTmpSnippetJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetJSON}),this.absolutePathToTmpSnippetTemplatesJSON!=null&&this.absolutePathToLocalSnippetTemplateJSON!=null&&await _v(this.absolutePathToTmpSnippetTemplatesJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetTemplatesJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetTemplateJSON})}async isFernIgnorePresent(){let t=D_.of(Jl(this.absolutePathToLocalOutput,hs.of(H6u)));return await _v(t)}async copyGeneratedFilesWithFernIgnore(){let t=D_.of((await cI1.default.dir({})).path),r=D_.of(Jl(this.absolutePathToLocalOutput,hs.of(H6u))),n=await P_8({absolutePathToFernignore:r});await(0,lYe.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,lYe.rm)(Jl(t,hs.of(".git")),{recursive:!0}),await(0,lYe.rm)(this.absolutePathToLocalOutput,{recursive:!0}),await(0,lYe.cp)(t,this.absolutePathToLocalOutput,{recursive:!0})}async copyGeneratedFilesNoFernIgnore(){this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`),await(0,lYe.rm)(this.absolutePathToLocalOutput,{force:!0,recursive:!0}),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesToDirectory(t){let[r,...n]=await(0,lYe.readdir)(this.absolutePathToTmpOutputDirectory);if(r!=null)if(this.context.logger.debug(`Copying generated files to ${t}`),r.endsWith(".zip")){await(0,sI1.default)(Jl(this.absolutePathToTmpOutputDirectory,hs.of(r)),t);for(let i of n)await(0,lYe.cp)(Jl(this.absolutePathToTmpOutputDirectory,hs.of(i)),Jl(t,hs.of(i)),{recursive:!0})}else await(0,lYe.cp)(this.absolutePathToTmpOutputDirectory,t,{recursive:!0})}async copySnippetJSON({absolutePathToTmpSnippetJSON:t,absolutePathToLocalSnippetJSON:r}){this.context.logger.debug(`Copying generated snippets to ${r}`),await(0,lYe.cp)(t,r)}async runGitCommand(t,r){return(await QV(this.context.logger,"git",t,{cwd:r,doNotPipeOutput:!0})).stdout}},A_8=/\r?\n/;async function P_8({absolutePathToFernignore:e}){let t=(await(0,lYe.readFile)(e)).toString();return[H6u,...t.trim().split(A_8).map(r=>{let n=r.indexOf("#");return n!==-1?r.slice(0,n).trim():r.trim()}).filter(r=>r.length>0)]}async function dI1({organization:e,absolutePathToFernConfig:t,workspace:r,generatorInvocation:n,absolutePathToLocalOutput:i,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:u,audiences:c,version:p,workspaceTempDir:s,keepDocker:o,context:l,irVersionOverride:O,outputVersionOverride:A,writeUnitTests:E,generateOauthClients:C,generatePaginatedClients:M,includeOptionalRequestPropertyExamples:q,inspect:L,executionEnvironment:U,runner:Q,ir:K}){let{latest:X,migrated:te}=await uI1({workspace:r,audiences:c,generatorInvocation:n,context:l,irVersionOverride:O,packageName:WA.getPackageName({generatorInvocation:n}),version:p??A,sourceConfig:j_8(r),includeOptionalRequestPropertyExamples:q,ir:K}),ee=await w_8({workspaceTempDir:s,filename:Z1f,context:l,ir:te});l.logger.debug("Wrote IR to: "+ee);let re=(0,hvo.join)(s.path,X1f),ue=D_.of(re);await(0,iSa.writeFile)(re,""),l.logger.debug("Will write config.json to: "+ue);let me=(0,hvo.join)(s.path,Y1f),Oe=D_.of(me);await(0,iSa.mkdir)(me,{recursive:!0}),l.logger.debug("Will write output to: "+Oe);let Ee;if(a!=null){let Ke=(0,hvo.join)(s.path,"snippet.json");Ee=D_.of(Ke),await(0,iSa.writeFile)(Ke,""),l.logger.debug("Will write snippet.json to: "+Ee)}let Pe;if(u!=null){let Ke=(0,hvo.join)(s.path,gT_);Pe=D_.of(Ke),await(0,iSa.writeFile)(Ke,""),l.logger.debug("Will write snippet-templates.json to: "+Pe)}let Ce=U??new W8o({dockerImage:`${n.name}:${n.version}`,keepDocker:o}),Be=Ce instanceof W8o?{outputDirectory:D_.of(LCs),irPath:D_.of(UCs),configPath:D_.of(V8o),snippetPath:D_.of(VCs),snippetTemplatePath:D_.of(WCs)}:{outputDirectory:Oe,configPath:ue,irPath:ee,snippetPath:Ee,snippetTemplatePath:Pe},Bt=edv({generatorInvocation:n,customConfig:n.config,workspaceName:r.definition.rootApiFile.contents.name,outputVersion:A,organization:e,absolutePathToSnippet:Ee,absolutePathToSnippetTemplates:Pe,absolutePathToFernConfig:t,writeUnitTests:E,generateOauthClients:C,generatePaginatedClients:M,paths:Be});return await(0,iSa.writeFile)(ue,JSON.stringify(await lI1.GeneratorConfig.jsonOrThrow(Bt),void 0,4)),await Ce.execute({generatorName:n.name,irPath:ee,configPath:ue,outputPath:Oe,snippetPath:Ee,snippetTemplatePath:Pe,context:l,inspect:L,runner:Q}),await new IGc({context:l,absolutePathToLocalOutput:i,absolutePathToTmpOutputDirectory:Oe,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:u,absolutePathToTmpSnippetJSON:Ee,absolutePathToTmpSnippetTemplatesJSON:Pe}).copyGeneratedFiles(),{ir:X,generatorConfig:Bt}}async function w_8({ir:e,workspaceTempDir:t,filename:r,context:n}){n.logger.debug("Migrated IR");let i;if(r)i=D_.of((0,hvo.join)(t.path,r));else{let a=await fI1.default.file({tmpdir:t.path});i=D_.of(a.path)}return await BEe(i,e,{pretty:!1}),n.logger.debug(`Wrote IR to ${i}`),i}function j_8(e){return{sources:e.getSources().map(t=>t.type==="protobuf"?dxe.proto({id:t.id,protoRootUrl:`file:///${E_8(t)}`}):dxe.openapi())}}function E_8(e){return`${Bav}/${e.id}`}var Vc_=Xi(require("os"),1),pI1=Xi(require("path"),1),_I1=Xi(TEe(),1);async function hI1({token:e,projectConfig:t,workspace:r,generatorGroup:n,version:i,keepDocker:a,inspect:u,context:c,runner:p}){let s=await D_8();(await Promise.all(n.generators.map(async l=>c.runInteractiveTask({name:l.name},async O=>{l=(X=>bwi(X,{onError:te=>O.failAndThrow(te)}))(l);let E=await r.toFernWorkspace({context:c},U9a(l)),C=UV({workspace:E,audiences:n.audiences,generationLanguage:l.language,keywords:l.keywords,smartCasing:l.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:!1,disabled:l.disableExamples},readme:l.readme,version:i,packageName:WA.getPackageName({generatorInvocation:l}),context:c,sourceResolver:new LV(c,E)}),M=uet({token:e?.value});if(l.absolutePathToLocalOutput==null&&(e=await V4a(),e==null)){O.failWithoutThrowing("Please provide a FERN_TOKEN in your environment.");return}let q=await M.organization.get(Yx.OrganizationId(t.organization));if(l.absolutePathToLocalOutput==null&&!q.ok){O.failWithoutThrowing(`Failed to load details for organization ${t.organization}.`);return}q.ok&&(q.body.selfHostedSdKs&&(C.selfHosted=!0),q.body.isWhitelabled&&(C.readmeConfig==null&&(C.readmeConfig=M_8),C.readmeConfig.whiteLabel=!0));let L=S_8(l),U=C_8({generatorInvocation:l,org:q.ok?q.body:void 0,version:i,packageName:L,context:O});U!=null&&(C.publishConfig=U);let Q=l.absolutePathToLocalOutput??Jl(r.absoluteFilePath,hs.of("sdks"),hs.of(l.language??l.name)),K=l.raw?.snippets?.path!=null?D_.of(Jl(r.absoluteFilePath,hs.of(l.raw.snippets.path))):void 0;await dI1({organization:t.organization,absolutePathToFernConfig:t._absolutePath,workspace:E,generatorInvocation:l,absolutePathToLocalOutput:Q,absolutePathToLocalSnippetJSON:K,absolutePathToLocalSnippetTemplateJSON:void 0,version:i,audiences:n.audiences,workspaceTempDir:s,keepDocker:a,context:O,irVersionOverride:l.irVersionOverride,outputVersionOverride:void 0,writeUnitTests:q.ok?q?.body.snippetUnitTestsEnabled??!1:!1,generateOauthClients:q.ok?q?.body.oauthClientEnabled??!1:!1,generatePaginatedClients:q.ok?q?.body.paginationEnabled??!1:!1,includeOptionalRequestPropertyExamples:!1,inspect:u,executionEnvironment:void 0,ir:C,runner:p}),O.logger.info(yd.green("Wrote files to "+Q))})))).some(l=>!l)&&c.failAndThrow()}function S_8(e){return typeof e.raw?.config=="object"&&e.raw?.config!==null?e.raw.config.package_name:void 0}async function D_8(){return _I1.default.dir({tmpdir:Vc_.default.platform()==="darwin"?pI1.default.join("/private",Vc_.default.tmpdir()):void 0,prefix:"fern"})}function C_8({generatorInvocation:e,org:t,version:r,packageName:n,context:i}){if(e.raw?.github!=null&&I_8(e.raw.github))return tp.PublishingConfig.github({owner:"",repo:"",uri:e.raw.github.uri,token:e.raw.github.token,target:tp.PublishTarget.postman({apiKey:"",workspaceId:"",collectionId:void 0})});if(e.raw?.output?.location==="local-file-system"){let a;if(e.language==="python")a=HEe.pypi({version:r,packageName:n}),i.logger.debug(`Created PyPiPublishTarget: version ${r} package name: ${n}`);else if(e.language==="java"){let u=e.raw?.config,c=(()=>{if(!u||typeof u!="object"||u===null)return;let s=u;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")})(),p=c?`${c.groupId}:${c.artifactId}`:void 0;if(p){let s=r??"0.0.0";a=HEe.maven({coordinate:p,version:s,usernameEnvironmentVariable:"MAVEN_USERNAME",passwordEnvironmentVariable:"MAVEN_PASSWORD",mavenUrlEnvironmentVariable:"MAVEN_PUBLISH_REGISTRY_URL"}),i.logger.debug(`Created MavenPublishTarget: coordinate ${p} version ${s}`)}else u&&typeof u=="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 tp.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:a})}return e.outputMode._visit({downloadFiles:()=>tp.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:void 0}),github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:()=>{},_other:()=>{}})}function I_8(e){return e==null?!1:"uri"in e&&"token"in e}var M_8={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};var FGc=Xi(G1i(),1);var yI1=require("fs"),MGc=require("fs/promises"),vI1=require("stream/promises");async function bI1({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await B_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(yd.green(`Downloaded to ${t}`))}catch{r.logger.debug(yd.yellow("Failed to download snippet.json from output."))}}async function B_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await eY.get(e,{responseType:"stream"});await _v(t)&&await(0,MGc.rm)(t,{recursive:!0}),await(0,MGc.mkdir)(cg(t),{recursive:!0}),await(0,vI1.pipeline)(r.data,(0,yI1.createWriteStream)(t))}var Gc_=Xi(Yke(),1);var yvo=Xi(G1i(),1);var gI1=Xi(tis(),1),fYe=require("fs/promises");var mI1=require("path"),OI1=Xi(fAs(),1),AI1=Xi(TEe(),1);async function PI1({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:n,generatorInvocation:i,version:a,context:u,shouldLogS3Url:c,token:p,whitelabel:s,irVersionOverride:o,absolutePathToPreview:l}){let O=await T_8({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:a,context:u,shouldLogS3Url:c,token:p,whitelabel:s,absolutePathToPreview:l});return await q_8({intermediateRepresentation:n,job:O,context:u,generatorInvocation:i,irVersionOverride:o}),O}async function T_8({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:i,context:a,shouldLogS3Url:u,token:c,whitelabel:p,absolutePathToPreview:s}){let o=qsi({token:c.value}),l={id:n.name,version:n.version,outputMode:n.outputMode,customConfig:n.config,publishMetadata:n.publishMetadata},O;if(n.outputMode.type.startsWith("github"))try{let E=await AI1.default.dir(),C=D_.of(E.path);a.logger.debug(`Writing mock fern definition to ${C}`);let M=Jl(C,hs.of(Dhe)),q=Jl(M,hs.of(Gce));await(0,fYe.mkdir)(q,{recursive:!0});let L=Jl(q,hs.of(rZ));await(0,fYe.writeFile)(L,lg.dump(t.definition.rootApiFile.contents)),await wI1({absolutePathToDefinitionDirectory:q,definition:t.definition});let U=Jl(M,hs.of(gqe));await(0,fYe.writeFile)(U,JSON.stringify(e.rawConfig,void 0,2));try{let X=t.getSources();for(let te of X){let ee=await(0,fYe.readFile)(te.absoluteFilePath),re=(0,mI1.relative)(t.absoluteFilePath,te.absoluteFilePath),ue=Jl(M,hs.of(re));await(0,fYe.mkdir)(cg(ue),{recursive:!0}),await(0,fYe.writeFile)(ue,new Uint8Array(ee))}}catch(X){a.logger.debug(`Failed to write source files to disk, continuing: ${X}`)}let Q=Jl(C,hs.of("definition.tgz"));await(0,OI1.create)({file:Q,cwd:M},["."]),a.logger.debug("Getting upload URL for Fern definition.");let K=await o.remoteGen.getDefinitionUploadUrl({apiName:t.definition.rootApiFile.contents.name,organizationName:r,version:i});K.ok?(a.logger.debug("Uploading definition..."),await eY.put(K.body.s3Url,await(0,fYe.readFile)(Q)),O={definitionS3DownloadUrl:K.body.s3Url,outputPath:".mock",cliVersion:e.version}):K.error.content.reason==="status-code"?a.logger.debug(`Failed with status-code to get upload URL with status code ${K.error.content.statusCode}, continuing: ${K.error.content.body}`):K.error.content.reason==="non-json"?a.logger.debug(`Failed with non-json to get upload URL with status code ${K.error.content.statusCode}, continuing: ${K.error.content.rawBody}`):K.error.content.reason==="unknown"&&a.logger.debug(`Failed to get upload URL as unknown error occurred continuing: ${K.error.content.errorMessage}`)}catch(E){a.logger.debug(`Failed to upload definition to S3, continuing: ${E}`)}let A=await o.remoteGen.createJobV3({apiName:t.definition.rootApiFile.contents.name,version:i,organizationName:r,generators:[l],uploadToS3:N_8({outputMode:n.outputMode,generatorInvocation:n,absolutePathToPreview:s,shouldLogS3Url:u}),whitelabel:p,fernDefinitionMetadata:O,preview:s!=null});return A.ok?A.body:x_8(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:E,invalidScope:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${E})`),cannotPublishToMavenGroup:({validGroup:E,invalidGroup:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${E})`),cannotPublishPypiPackage:({validPrefix:E,invalidPackageName:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${E})`),generatorsDoNotExistError:E=>a.failAndThrow("Generators do not exist: "+E.nonExistentGenerators.map(C=>`${C.id}@${C.version}`).join(", ")),insufficientPermissions:()=>a.failAndThrow("Insufficient permissions."),orgNotConfiguredForWhitelabel:()=>a.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com."),_other:E=>a.failAndThrow("Failed to create job",E)})}async function wI1({absolutePathToDefinitionDirectory:e,definition:t}){for(let[r,n]of Object.entries(t.namedDefinitionFiles)){let i=Jl(e,hs.of(r));await(0,fYe.mkdir)(cg(i),{recursive:!0}),await(0,fYe.writeFile)(i,lg.dump(n.contents))}for(let[r,n]of Object.entries(t.packageMarkers))if(n.contents.export==null){let i=Jl(e,hs.of(r));await(0,fYe.mkdir)(cg(i),{recursive:!0}),await(0,fYe.writeFile)(i,lg.dump(n.contents))}for(let[r,n]of Object.entries(t.importedDefinitions))await wI1({absolutePathToDefinitionDirectory:Jl(e,hs.of(r)),definition:n.definition})}async function q_8({intermediateRepresentation:e,generatorInvocation:t,job:r,context:n,irVersionOverride:i}){let a=i==null?await tvu({intermediateRepresentation:e,context:n,targetGenerator:{name:t.name,version:t.version}}):await Uc_({intermediateRepresentation:e,context:n,irVersion:i,targetGenerator:{name:t.name,version:t.version}}),u=new gI1.default,c=await WBl(a,{onWrite:s=>{n.logger.debug("Wrote IR to disk: "+s)}});u.append("file",c);let p=QS(l2l(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await eY.post(p,u,{headers:u.getHeaders(),maxBodyLength:1/0})}catch(s){let o=s instanceof gQh?s.response?.data:s;n.logger.debug(`POST ${p} failed with ${JSON.stringify(s)}`),n.failAndThrow("Failed to start job",o)}}function x_8(e){if(e?.reason==="status-code"){let t=e.body;switch(t?._error){case"IllegalApiNameError":return yvo.FernFiddle.remoteGen.createJobV3.Error.illegalApiNameError();case"GeneratorsDoNotExistError":return yvo.FernFiddle.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.body);case"CannotPublishToNpmScope":return yvo.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.body);case"CannotPublishToMavenScope":return yvo.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.body);case"InsufficientPermissions":return yvo.FernFiddle.remoteGen.createJobV3.Error.insufficientPermissions(t.body)}}return e}function N_8({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:n}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||n}function BGc({apiName:e,organization:t,generatorInvocation:r}){let n=R_8(r);return{apiName:e,organization:t,customConfig:r.config,outputConfig:n??nd.GeneratorOutputConfig.local()}}function R_8(e){let t=e.outputMode;switch(t.type){case"downloadFiles":return nd.GeneratorOutputConfig.local();case"publishV2":return F_8({publish:t.publishV2,version:e.version});case"githubV2":return z_8({github:t.githubV2,language:e.language,version:e.version});case"publish":case"github":return;default:cc(t)}}function F_8({publish:e,version:t}){switch(e.type){case"npmOverride":{let r=e.npmOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.npm({version:t,packageName:r.packageName,repoUrl:void 0}))}case"mavenOverride":{let r=e.mavenOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.maven({version:t,coordinate:r.coordinate,repoUrl:void 0}))}case"pypiOverride":{let r=e.pypiOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.pypi({version:t,packageName:r.coordinate,repoUrl:void 0}))}case"rubyGemsOverride":{let r=e.rubyGemsOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.rubygems({version:t,packageName:r.packageName,repoUrl:void 0}))}case"nugetOverride":{let r=e.nugetOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.nuget({version:t,packageName:r.packageName,repoUrl:void 0}))}case"postman":return;default:cc(e)}}function z_8({github:e,version:t,language:r}){let n=Q_8({owner:e.owner,repo:e.repo});if(r===WA.GenerationLanguage.GO)return nd.GeneratorOutputConfig.publish(nd.PublishInfo.go({version:t,repoUrl:n}));let i=e.publishInfo;if(i!=null)switch(i.type){case"maven":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.maven({version:t,coordinate:i.coordinate,repoUrl:n}));case"npm":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.npm({version:t,packageName:i.packageName,repoUrl:n}));case"pypi":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.pypi({version:t,packageName:i.packageName,repoUrl:n}));case"rubygems":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.rubygems({version:t,packageName:i.packageName,repoUrl:n}));case"nuget":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.nuget({version:t,packageName:i.packageName,repoUrl:n}));case"postman":return;default:cc(i)}}function Q_8({owner:e,repo:t}){return`https://github.com/${e}/${t}`}var jI1=qsi();var L_8=3;function EI1({job:e,taskId:t,taskHandler:r,context:n}){let i=0,a=async()=>{let u=await jI1.remoteGen.getJobStatus(e.jobId);if(u.ok)return u.body[t];n.logger.debug("Failed to get job status.",JSON.stringify(u.error.content))};return new Promise((u,c)=>{p();async function p(){try{let s=await a();if(s==null)i++,i===L_8&&n.failAndThrow(`Failed to get job status after ${i} attempts.`),setTimeout(p,2e3+1e3*i);else{i=0;let o=await r.processUpdate(s);r.isFinished?u(o):setTimeout(p,2e3)}}catch(s){c(s)}}})}var II1=Xi(MDs(),1),MI1=require("fs"),xGc=require("fs/promises"),Hc_=Xi(require("path"),1),BI1=require("stream/promises");var TGc=Xi(CI1(),1);function rgi(e,t,{target:r="stdout",...n}={}){return TGc.default[r]?$5a.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}rgi.isSupported=TGc.default.stdout;rgi.stderr=(e,t,r={})=>rgi(e,t,{target:"stderr",...r});rgi.stderr.isSupported=TGc.default.stderr;var TI1=Xi(TEe(),1),qGc=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}`,_other:()=>"<unknown package>"}));this.absolutePathToPreview==null&&this.context.setSubtitle(r.length>0?r.map(i=>`\u25E6 ${i}`).join(`
2837
+ `).find(ue=>ue.trim().length>0)||"Custom License";re=re.trim().replace(/^#+\s*/,""),re=re.replace(/[.:;]+$/,"").trim(),U=re}catch{}}}U!=null&&(O={...t,_fernLicenseName:U})}let{snippetPath:E,snippetTemplatePath:C,irPath:M,outputDirectory:q}=l,L=e.outputMode._visit({publish:U=>({...Xfv(i,U,e,l),snippetFilepath:E,publishingMetadata:e.publishMetadata}),publishV2:U=>({...Xfv(i,U,e,l),snippetFilepath:E,publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:Kre.FernGeneratorExec.OutputMode.downloadFiles(),path:q,snippetFilepath:E,publishingMetadata:e.publishMetadata}),github:U=>{let Q={mode:Kre.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${U.owner}/${U.repo}`,version:i,publishInfo:Yfv(U.publishInfo),installationToken:void 0}),path:q,publishingMetadata:e.publishMetadata};return a!==void 0&&(Q.snippetFilepath=E),u!==void 0&&(Q.snippetTemplateFilepath=C),Q},githubV2:U=>{let Q=U._visit({commitAndRelease:X=>`https://github.com/${X.owner}/${X.repo}`,push:X=>`https://github.com/${X.owner}/${X.repo}`,pullRequest:X=>`https://github.com/${X.owner}/${X.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),K={mode:Kre.FernGeneratorExec.OutputMode.github({repoUrl:Q,version:i,publishInfo:Yfv(U.publishInfo)}),path:q,publishingMetadata:e.publishMetadata};return a!==void 0&&(K.snippetFilepath=E),u!==void 0&&(K.snippetTemplateFilepath=C),K},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{irFilepath:M,output:L,publish:void 0,customConfig:O,workspaceName:r,organization:n,environment:Kre.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:!1,writeUnitTests:p,generateOauthClients:s,generatePaginatedClients:o,license:A}}function Xfv(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,_other:()=>{}}));let u="";return r.raw?.github!=null&&(LTo(r.raw.github)?u=r.raw.github.uri:u=r.raw?.github.repository),{mode:Kre.FernGeneratorExec.OutputMode.github({repoUrl:u,version:e}),path:i}}var xt=Symbol(),Qn=Symbol();var tdv={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.246",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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 ot={};ds(ot,{V1:()=>QZR,V10:()=>$ZR,V11:()=>YZR,V12:()=>XZR,V13:()=>ZZR,V14:()=>kZR,V15:()=>ekR,V16:()=>tkR,V17:()=>rkR,V18:()=>nkR,V19:()=>ikR,V2:()=>LZR,V20:()=>akR,V21:()=>okR,V22:()=>ukR,V23:()=>PtP.FernIrV23,V24:()=>wtP.FernIrV24,V25:()=>jtP.FernIrV25,V26:()=>EtP.FernIrV26,V27:()=>StP.FernIrV27,V28:()=>DtP.FernIrV28,V29:()=>CtP.FernIrV29,V3:()=>UZR,V30:()=>ItP.FernIrV30,V31:()=>MtP.FernIrV31,V32:()=>BtP.FernIrV32,V33:()=>TtP.FernIrV33,V34:()=>qtP.FernIrV34,V35:()=>xtP.FernIrV35,V36:()=>NtP.FernIrV36,V37:()=>RtP.FernIrV37,V38:()=>FtP.FernIrV38,V39:()=>ztP.FernIrV39,V4:()=>VZR,V40:()=>QtP.FernIrV40,V41:()=>LtP.FernIrV41,V42:()=>UtP.FernIrV42,V43:()=>VtP.FernIrV43,V44:()=>WtP.FernIrV44,V45:()=>HtP.FernIrV45,V46:()=>GtP.FernIrV46,V47:()=>JtP.FernIrV47,V48:()=>KtP.FernIrV48,V49:()=>$tP.FernIrV49,V5:()=>WZR,V50:()=>YtP.FernIrV50,V51:()=>XtP.FernIrV51,V52:()=>ZtP.FernIrV52,V53:()=>ktP.FernIrV53,V54:()=>erP.FernIrV54,V55:()=>trP.FernIrV55,V56:()=>rrP.FernIrV56,V57:()=>nrP.FernIrV57,V58:()=>irP.FernIrV58,V59:()=>arP.FernIrV59,V6:()=>HZR,V60:()=>tp,V7:()=>GZR,V8:()=>JZR,V9:()=>KZR});var QZR=Xi(Yvv(),1),LZR=Xi(HAv(),1),UZR=Xi(qDv(),1),VZR=Xi(Bxv(),1),WZR=Xi(v6v(),1),HZR=Xi(jQv(),1),GZR=Xi(THv(),1),JZR=Xi(LXv(),1),KZR=Xi(pib(),1),$ZR=Xi(qlb(),1),YZR=Xi(ivb(),1),XZR=Xi(tPb(),1),ZZR=Xi(ZDb(),1),kZR=Xi($xb(),1),ekR=Xi(Gzb(),1),tkR=Xi(iUb(),1),rkR=Xi(y$b(),1),nkR=Xi(Drg(),1),ikR=Xi(Vcg(),1),akR=Xi(gvg(),1),okR=Xi(ZPg(),1),ukR=Xi(MIg(),1),PtP=Xi(Yqg(),1),wtP=Xi(T3g(),1),jtP=Xi(m7g(),1),EtP=Xi(fLg(),1),StP=Xi(oGg(),1),DtP=Xi(rXg(),1),CtP=Xi(Zt0(),1),ItP=Xi(eu0(),1),MtP=Xi(rd0(),1),BtP=Xi(pv0(),1),TtP=Xi(CHf(),1),qtP=Xi(NE0(),1),xtP=Xi(MB0(),1),NtP=Xi(EF0(),1),RtP=Xi(P70(),1),FtP=Xi(PU0(),1),ztP=Xi(QK0(),1),QtP=Xi(ntm(),1),LtP=Xi(Aum(),1),UtP=Xi(Hpm(),1),VtP=Xi(y0m(),1),WtP=Xi(Ujm(),1),HtP=Xi(CMm(),1),GtP=Xi(AFm(),1),JtP=Xi(g8m(),1),KtP=Xi(yWm(),1),$tP=Xi(yXm(),1),YtP=Xi(jiO(),1),XtP=Xi(WfO(),1),ZtP=Xi(_gO(),1),ktP=Xi(UDO(),1),erP=Xi(w4O(),1),trP=Xi(dWO(),1),rrP=Xi(trA(),1),nrP=Xi(WOA(),1),irP=Xi(k6A(),1),arP=Xi(AtP(),1);function orP({inlinedRequest:e,allTypes:t}){let r=new Set,n=t.reduce((i,a)=>({...i,[Zwd(a.name)]:a}),{});for(let i of e.extends)urP({typeName:i,typeNameToDeclaration:n,referencedTypes:r});for(let i of e.properties)zYa({reference:i.valueType,typeNameToDeclaration:n,referencedTypes:r});return[...r].reduce((i,a)=>{let u=n[a];if(u==null)throw new Error("Cannot find declaration for ID: "+a);return[...i,u.name]},[])}function zYa({reference:e,typeNameToDeclaration:t,referencedTypes:r}){ot.V2.types.TypeReference._visit(e,{primitive:Hc,container:n=>{skR({container:n,typeNameToDeclaration:t,referencedTypes:r})},named:n=>{urP({typeName:n,typeNameToDeclaration:t,referencedTypes:r})},unknown:Hc,void:Hc,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function skR({container:e,typeNameToDeclaration:t,referencedTypes:r}){ot.V2.types.ContainerType._visit(e,{list:n=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r})},set:n=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r})},optional:n=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:n,valueType:i})=>{zYa({reference:n,typeNameToDeclaration:t,referencedTypes:r}),zYa({reference:i,typeNameToDeclaration:t,referencedTypes:r})},literal:Hc,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function urP({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let n=Zwd(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(Zwd(a))}function Zwd(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var srP={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.249",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.0.134-3-g97d4964",[ye.JAVA_SDK]:"0.0.134-3-g97d4964",[ye.JAVA_SPRING]:"0.0.134-3-g97d4964",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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=>ckR(r,n,e.types,i=>{t.push(i)}))}))}}}};function ckR(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:lkR(t,e,r,n),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function lkR(e,t,r,n){let i=e.requestBody;return i==null?{docs:void 0,type:ot.V2.types.TypeReference.void(),typeV2:void 0}:ot.V3.services.http.HttpRequestBody._visit(i,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let u={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=ot.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:u,shape:c,referencedTypes:orP({inlinedRequest:a,allTypes:r}),examples:[]});let p=ot.V2.types.TypeReference.named(u);return{docs:void 0,type:p,typeV2:p}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+i.type)}})}var frP={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:"0.0.11-4-g1c29f6c",[ye.POSTMAN]:"0.0.32-rc0",[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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=>drP(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=>hkR(n))}))}))}})};function drP(e){return ot.V4.types.ExampleTypeShape._visit(e,{object:t=>ot.V3.types.ExampleType.object(fkR(t)),union:t=>ot.V3.types.ExampleType.union(pkR(t)),alias:t=>ot.V3.types.ExampleType.alias(_kR(t)),enum:ot.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function fkR(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:KCe(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function KCe(e){return ot.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:ot.V3.types.ExampleTypeReference.primitive,container:t=>ot.V3.types.ExampleTypeReference.container(dkR(t)),named:t=>ot.V3.types.ExampleTypeReference.named(prP(t)),unknown:ot.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function dkR(e){return ot.V4.types.ExampleContainer._visit(e,{list:t=>ot.V3.types.ExampleContainer.list(t.map(KCe)),set:t=>ot.V3.types.ExampleContainer.set(t.map(KCe)),optional:t=>ot.V3.types.ExampleContainer.optional(t!=null?KCe(t):void 0),map:t=>ot.V3.types.ExampleContainer.map(t.map(r=>({key:KCe(r.key),value:KCe(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function prP(e){return{typeName:e.typeName,shape:drP(e.shape)}}function pkR(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:ot.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>ot.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(prP(t)),singleProperty:t=>ot.V3.types.ExampleSingleUnionTypeProperties.singleProperty(KCe(t)),noProperties:()=>ot.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function _kR(e){return{value:KCe(e.value)}}function hkR(e){return{servicePathParameters:e.servicePathParameters.map(t=>crP(t)),endpointPathParameters:e.servicePathParameters.map(t=>crP(t)),serviceHeaders:e.serviceHeaders.map(t=>lrP(t)),endpointHeaders:e.endpointHeaders.map(t=>lrP(t)),queryParameters:e.queryParameters.map(t=>ykR(t)),request:e.request!=null?vkR(e.request):void 0,response:gkR(e.response)}}function crP(e){return{key:e.key,value:KCe(e.value)}}function lrP(e){return{key:e.wireKey,value:KCe(e.value)}}function ykR(e){return{key:e.wireKey,value:KCe(e.value)}}function vkR(e){return ot.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>ot.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>bkR(r))}),reference:t=>ot.V3.services.http.ExampleRequestBody.reference(KCe(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function bkR(e){return{wireKey:e.wireKey,value:KCe(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function gkR(e){return ot.V4.services.http.ExampleResponse._visit(e,{ok:t=>ot.V3.services.http.ExampleResponse.ok({body:t.body!=null?KCe(t.body):void 0}),error:t=>ot.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?KCe(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function uBr(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function _nt(e){return{...uBr(e.name),wireValue:e.wireValue}}function Woe(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 Hoe(e){return{wireValue:e.wireValue,name:Woe(e.name)}}function QYa(e){return ot.V5.types.ContainerType._visit(e,{list:t=>ot.V4.types.ContainerType.list(sK(t)),set:t=>ot.V4.types.ContainerType.set(sK(t)),map:({keyType:t,valueType:r})=>ot.V4.types.ContainerType.map({keyType:sK(t),valueType:sK(r)}),optional:t=>ot.V4.types.ContainerType.optional(sK(t)),literal:t=>ot.V5.types.Literal._visit(t,{string:r=>ot.V4.types.ContainerType.literal(ot.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function npa(e){return e.map(t=>uBr(t))}function ipa(e){return e.map(t=>Woe(t))}function nde(e){return{fernFilepath:npa(e.fernFilepath),fernFilepathV2:ipa(e.fernFilepath),name:e.name.originalName,nameV2:uBr(e.name),nameV3:Woe(e.name)}}function sK(e){return ot.V5.types.TypeReference._visit(e,{named:t=>ot.V4.types.TypeReference.named(nde(t)),container:t=>ot.V4.types.TypeReference.container(QYa(t)),primitive:t=>ot.V4.types.TypeReference.primitive(t),unknown:ot.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function apa(e){return{name:_nt(e.name),nameV2:Hoe(e.name),valueType:sK(e.valueType),availability:e.availability,docs:e.docs}}function _rP(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>mkR(t))}}function mkR(e){return ot.V5.auth.AuthScheme._visit(e,{basic:ot.V4.auth.AuthScheme.basic,bearer:ot.V4.auth.AuthScheme.bearer,header:t=>ot.V4.auth.AuthScheme.header(apa(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function hrP(e){return{docs:e.docs,id:e.id,url:e.url,name:Woe(e.name)}}function yrP({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let n=e.type!=null?ot.V4.types.Type.alias({aliasOf:sK(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:uBr(e.name.name),nameV3:Woe(e.name.name),fernFilepath:npa(e.name.fernFilepath),fernFilepathV2:ipa(e.name.fernFilepath)},discriminantValueV2:Hoe(e.discriminantValue),discriminantValueV3:ot.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:ot.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:i=>ot.V4.errors.ErrorDeclarationDiscriminantValue.property(Hoe(i.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:Hoe(e.discriminantValue),type:n??ot.V4.types.Type.alias({aliasOf:ot.V4.types.TypeReference.void(),resolvedType:ot.V4.types.ResolvedTypeReference.void()}),typeV2:n,typeV3:e.type!=null?sK(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function $Ce(e){return{jsonExample:e.jsonExample,shape:vrP(e.shape)}}function vrP(e){return ot.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:ot.V4.types.ExampleTypeReferenceShape.primitive,container:t=>ot.V4.types.ExampleTypeReferenceShape.container(AkR(t)),unknown:ot.V4.types.ExampleTypeReferenceShape.unknown,named:t=>ot.V4.types.ExampleTypeReferenceShape.named(OkR(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function OkR(e){return{typeName:nde(e.typeName),shape:a5s(e.shape)}}function AkR(e){return ot.V5.types.ExampleContainer._visit(e,{list:t=>ot.V4.types.ExampleContainer.list(t.map(r=>$Ce(r))),set:t=>ot.V4.types.ExampleContainer.set(t.map(r=>$Ce(r))),optional:t=>ot.V4.types.ExampleContainer.optional(t!=null?$Ce(t):void 0),map:t=>ot.V4.types.ExampleContainer.map(t.map(r=>({key:$Ce(r.key),value:$Ce(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function a5s(e){return ot.V5.types.ExampleTypeShape._visit(e,{alias:t=>ot.V4.types.ExampleTypeShape.alias({value:$Ce(t.value)}),object:t=>ot.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:$Ce(r.value),originalTypeDeclaration:nde(r.originalTypeDeclaration)}))}),union:t=>ot.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:ot.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>ot.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:nde(r.typeName),shape:a5s(r.shape)}),singleProperty:r=>ot.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:vrP(r.shape)}),noProperties:ot.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>ot.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function mrP({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:PkR(e.name),basePath:wkR(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>jkR({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>apa(r)),pathParameters:e.pathParameters.map(r=>OrP(r))}}function PkR(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:npa(e.fernFilepath),fernFilepathV2:ipa(e.fernFilepath)}}function wkR(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function jkR({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:uBr(e.name),nameV2:Woe(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>apa(r)),path:e.path,pathParameters:e.pathParameters.map(r=>OrP(r)),queryParameters:e.queryParameters.map(r=>EkR(r)),requestBody:e.requestBody!=null?SkR(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?DkR(e.sdkRequest):void 0,response:CkR(e.response),errors:e.errors.map(r=>IkR(r)),errorsV2:MkR({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>qkR(r))}}function OrP(e){return{docs:e.docs,availability:e.availability,name:uBr(e.name),nameV2:Woe(e.name),valueType:sK(e.valueType)}}function EkR(e){return{docs:e.docs,availability:e.availability,name:_nt(e.name),nameV2:Hoe(e.name),valueType:sK(e.valueType),allowMultiple:e.allowMultiple}}function SkR(e){return ot.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V4.services.http.HttpRequestBody.inlinedRequestBody({name:Woe(t.name),extends:t.extends.map(r=>nde(r)),properties:t.properties.map(r=>({docs:r.docs,name:Hoe(r.name),valueType:sK(r.valueType)}))}),reference:t=>ot.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:sK(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function DkR(e){return{requestParameterName:Woe(e.requestParameterName),shape:ot.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>ot.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:sK(t.requestBodyType)}),wrapper:t=>ot.V4.services.http.SdkRequestShape.wrapper({wrapperName:Woe(t.wrapperName),bodyKey:Woe(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function CkR(e){let t=e.type!=null?sK(e.type):void 0;return{docs:e.docs,type:t??ot.V4.types.TypeReference.void(),typeV2:t}}function IkR(e){return{docs:e.docs,error:kwd(e.error)}}function MkR({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>BkR({responseError:r,errorResolver:t}))}}function BkR({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:_nt(r.discriminantValue),shape:TkR({responseError:e,declaration:r})}}function TkR({responseError:e,declaration:t}){return t.type==null?ot.V4.services.commons.ResponseErrorShape.noProperties():ot.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:kwd(e.error)})}function kwd(e){return{name:e.name.originalName,nameV2:uBr(e.name),nameV3:Woe(e.name),fernFilepath:npa(e.fernFilepath),fernFilepathV2:ipa(e.fernFilepath)}}function qkR(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>brP(t)),endpointPathParameters:e.endpointPathParameters.map(t=>brP(t)),serviceHeaders:e.serviceHeaders.map(t=>grP(t)),endpointHeaders:e.endpointHeaders.map(t=>grP(t)),queryParameters:e.queryParameters.map(t=>xkR(t)),request:e.request!=null?NkR(e.request):void 0,response:FkR(e.response)}}function brP(e){return{key:e.key,value:$Ce(e.value)}}function grP(e){return{wireKey:e.wireKey,value:$Ce(e.value)}}function xkR(e){return{wireKey:e.wireKey,value:$Ce(e.value)}}function NkR(e){return ot.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>ot.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>RkR(r))}),reference:t=>ot.V4.services.http.ExampleRequestBody.reference($Ce(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function RkR(e){return{wireKey:e.wireKey,value:$Ce(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?nde(e.originalTypeDeclaration):void 0}}function FkR(e){return ot.V5.http.ExampleResponse._visit(e,{ok:t=>ot.V4.services.http.ExampleResponse.ok({body:t.body!=null?$Ce(t.body):void 0}),error:t=>ot.V4.services.http.ExampleResponse.error({error:kwd(t.error),body:t.body!=null?$Ce(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function ArP(e){return{docs:e.docs,availability:e.availability,name:nde(e.name),shape:zkR(e.shape),examples:e.examples.map(t=>QkR(t)),referencedTypes:e.referencedTypes.map(t=>nde(t))}}function zkR(e){return ot.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>ot.V4.types.Type.alias({aliasOf:sK(t),resolvedType:LkR(r)}),enum:t=>ot.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:_nt(r.name),nameV2:Hoe(r.name),value:r.name.wireValue}))}),object:t=>ot.V4.types.Type.object({extends:t.extends.map(r=>nde(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:_nt(r.name),nameV2:Hoe(r.name),valueType:sK(r.valueType)}))}),union:t=>ot.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:_nt(t.discriminant),discriminantV3:Hoe(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:_nt(r.discriminantValue),discriminantValueV2:Hoe(r.discriminantValue),valueType:ot.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>ot.V4.types.TypeReference.named(nde(n)),singleProperty:n=>sK(n.type),noProperties:ot.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:ot.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:n=>ot.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(nde(n)),singleProperty:n=>ot.V4.types.SingleUnionTypeProperties.singleProperty({name:_nt(n.name),nameV2:Hoe(n.name),type:sK(n.type)}),noProperties:ot.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function QkR(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:a5s(e.shape)}}function LkR(e){return ot.V5.types.ResolvedTypeReference._visit(e,{named:t=>ot.V4.types.ResolvedTypeReference.named({name:nde(t.name),shape:UkR(t.shape)}),container:t=>ot.V4.types.ResolvedTypeReference.container(QYa(t)),primitive:ot.V4.types.ResolvedTypeReference.primitive,unknown:ot.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function UkR(e){return ot.V5.types.ShapeType._visit(e,{enum:()=>ot.V5.types.ShapeType.Enum,object:()=>ot.V5.types.ShapeType.Object,union:()=>ot.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var o5s=class{errors;constructor(t){this.errors=t.errors.reduce((r,n)=>({...r,[PrP(n.name)]:n}),{})}getDeclaration(t){let r=PrP(t),n=this.errors[r];if(n==null)throw new Error("Error does not exist: "+r);return n}};function PrP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}var u5s=class{types;constructor(t){this.types=t.types.reduce((r,n)=>({...r,[wrP(n.name)]:n}),{})}resolveTypeReference(t){return ot.V5.types.TypeReference._visit(t,{container:r=>ot.V4.types.ResolvedTypeReference.container(QYa(r)),named:r=>{let n=this.getTypeDeclaration(r);return n.shape._type==="alias"?this.resolveTypeReference(n.shape.aliasOf):ot.V4.types.ResolvedTypeReference.named({name:nde(r),shape:VkR(n.shape._type)})},primitive:ot.V4.types.ResolvedTypeReference.primitive,unknown:ot.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=wrP(t),n=this.types[r];if(n==null)throw new Error("Type does not exist: "+n);return n}};function wrP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function VkR(e){switch(e){case"object":return ot.V4.types.ShapeType.Object;case"union":return ot.V4.types.ShapeType.Union;case"enum":return ot.V4.types.ShapeType.Enum;default:cc(e)}}var jrP={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[ye.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.STOPLIGHT]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new u5s(e),r=new o5s(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:_rP(e.auth),headers:e.headers.map(n=>apa(n)),types:e.types.map(n=>ArP(n)),services:{http:e.services.map(n=>mrP({service:n,errorResolver:r})),websocket:[]},errors:e.errors.map(n=>yrP({errorDeclaration:n,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:_nt(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:Hoe(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=>hrP(n)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?Woe(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:ot.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:ot.V4.ir.ErrorDiscriminationStrategy.statusCode,property:n=>ot.V4.ir.ErrorDiscriminationStrategy.property({discriminant:Hoe(n.discriminant),contentProperty:Hoe(n.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var ErP={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[ye.TYPESCRIPT_EXPRESS]:"0.0.264",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[ye.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[ye.OPENAPI]:"0.0.16-1-ga2c0ada",[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?ot.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 SrP={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.268",[ye.TYPESCRIPT_EXPRESS]:"0.0.268",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.OPENAPI_PYTHON_CLIENT]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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",u=a.toUpperCase(),c=g9(i);return{...t,name:{name:{originalName:n,camelCase:{safeName:i,unsafeName:i},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:u,unsafeName:u},pascalCase:{safeName:c,unsafeName:c}},fernFilepath:t.name.fernFilepath}}})})};var IrP={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[ye.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[ye.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[ye.OPENAPI_PYTHON_CLIENT]:"0.0.0",[ye.OPENAPI]:"0.0.20-1-gbbeb9bd",[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:WkR(e.auth),headers:e.headers.map(t=>s5s(t)),types:e.types.map(t=>HkR(t)),errors:e.errors.map(t=>ZkR(t)),services:e.services.map(t=>kkR(t))})};function ejd(e){return e.allParts}function WkR(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:ot.V7.auth.AuthScheme.header(s5s(t)))}}function s5s(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:IPe(e.valueType)}}function IPe(e){return ot.V8.types.TypeReference._visit(e,{container:t=>ot.V7.types.TypeReference.container(MrP(t)),named:t=>ot.V7.types.TypeReference.named(sBr(t)),primitive:ot.V7.types.TypeReference.primitive,unknown:ot.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function MrP(e){return ot.V8.types.ContainerType._visit(e,{list:t=>ot.V7.types.ContainerType.list(IPe(t)),optional:t=>ot.V7.types.ContainerType.optional(IPe(t)),set:t=>ot.V7.types.ContainerType.set(IPe(t)),map:({keyType:t,valueType:r})=>ot.V7.types.ContainerType.map({keyType:IPe(t),valueType:IPe(r)}),literal:ot.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function sBr(e){return{name:e.name,fernFilepath:ejd(e.fernFilepath)}}function HkR(e){return{docs:e.docs,availability:e.availability,name:sBr(e.name),shape:GkR(e.shape),examples:e.examples.map(t=>YkR(t)),referencedTypes:e.referencedTypes.map(t=>sBr(t))}}function GkR(e){return ot.V8.types.Type._visit(e,{alias:t=>ot.V7.types.Type.alias({aliasOf:IPe(t.aliasOf),resolvedType:JkR(t.resolvedType)}),enum:ot.V7.types.Type.enum,object:t=>ot.V7.types.Type.object({extends:t.extends.map(r=>sBr(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:IPe(r.valueType)}))}),union:t=>ot.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>KkR(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function JkR(e){return ot.V8.types.ResolvedTypeReference._visit(e,{container:t=>ot.V7.types.ResolvedTypeReference.container(MrP(t)),named:t=>ot.V7.types.ResolvedTypeReference.named({name:sBr(t.name),shape:t.shape}),primitive:ot.V7.types.ResolvedTypeReference.primitive,unknown:ot.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function KkR(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:$kR(e.shape)}}function $kR(e){return ot.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(sBr(t)),singleProperty:t=>ot.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:IPe(t.type)}),noProperties:ot.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function YkR(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:tjd(e.shape)}}function tjd(e){return ot.V8.types.ExampleTypeShape._visit(e,{alias:t=>ot.V7.types.ExampleTypeShape.alias({value:h3e(t.value)}),enum:ot.V7.types.ExampleTypeShape.enum,object:t=>ot.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:h3e(r.value),originalTypeDeclaration:sBr(r.originalTypeDeclaration)}))}),union:t=>ot.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:XkR(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function h3e(e){return{jsonExample:e.jsonExample,shape:BrP(e.shape)}}function BrP(e){return ot.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>ot.V7.types.ExampleTypeReferenceShape.named({typeName:sBr(t.typeName),shape:tjd(t.shape)}),container:t=>ot.V7.types.ExampleTypeReferenceShape.container(ot.V8.types.ExampleContainer._visit(t,{list:r=>ot.V7.types.ExampleContainer.list(r.map(n=>h3e(n))),set:r=>ot.V7.types.ExampleContainer.set(r.map(n=>h3e(n))),optional:r=>ot.V7.types.ExampleContainer.optional(r!=null?h3e(r):void 0),map:r=>ot.V7.types.ExampleContainer.map(r.map(n=>({key:h3e(n.key),value:h3e(n.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:ot.V7.types.ExampleTypeReferenceShape.primitive,unknown:ot.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function XkR(e){return ot.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:sBr(t.typeName),shape:tjd(t.shape)}),singleProperty:t=>ot.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:BrP(t.shape)}),noProperties:ot.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function ZkR(e){return{docs:e.docs,name:rjd(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?IPe(e.type):void 0,statusCode:e.statusCode}}function rjd(e){return{name:e.name,fernFilepath:ejd(e.fernFilepath)}}function kkR(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:ejd(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>TrP(t)),headers:e.headers.map(t=>s5s(t)),endpoints:e.endpoints.map(t=>eeF(t))}}function TrP(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:IPe(e.valueType)}}function eeF(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>teF(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>TrP(t)),sdkRequest:e.sdkRequest!=null?neF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?aeF(e.requestBody):void 0,response:oeF(e.response),headers:e.headers.map(t=>s5s(t)),queryParameters:e.queryParameters.map(t=>reF(t)),examples:e.examples.map(t=>ueF(t))}}function teF(e){return{docs:e.docs,error:rjd(e.error)}}function reF(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:IPe(e.valueType),allowMultiple:e.allowMultiple}}function neF(e){return{requestParameterName:e.requestParameterName,shape:ieF(e.shape)}}function ieF(e){return ot.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:IPe(t.requestBodyType)}),wrapper:ot.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function aeF(e){return ot.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>sBr(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:IPe(r.valueType)}))}),reference:t=>ot.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:IPe(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function oeF(e){return{docs:e.docs,type:e.type!=null?IPe(e.type):void 0}}function ueF(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>DrP(t)),endpointPathParameters:e.endpointPathParameters.map(t=>DrP(t)),queryParameters:e.queryParameters.map(t=>seF(t)),serviceHeaders:e.serviceHeaders.map(t=>CrP(t)),endpointHeaders:e.endpointHeaders.map(t=>CrP(t)),request:e.request!=null?ceF(e.request):void 0,response:leF(e.response)}}function DrP(e){return{key:e.key,value:h3e(e.value)}}function seF(e){return{wireKey:e.wireKey,value:h3e(e.value)}}function CrP(e){return{wireKey:e.wireKey,value:h3e(e.value)}}function ceF(e){return ot.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>ot.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:h3e(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?sBr(r.originalTypeDeclaration):void 0}))}),reference:t=>ot.V7.http.ExampleRequestBody.reference(h3e(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function leF(e){return ot.V8.http.ExampleResponse._visit(e,{ok:t=>ot.V7.http.ExampleResponse.ok({body:t.body!=null?h3e(t.body):void 0}),error:t=>ot.V7.http.ExampleResponse.error({error:rjd(t.error),body:t.body!=null?h3e(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var qrP={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[ye.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[ye.JAVA_SDK]:"0.0.134-4-gef1ec4f",[ye.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[ye.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[ye.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:Qn,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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()===CL.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var xrP={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.STOPLIGHT]:Qn,[ye.OPENAPI]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Rb(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 NrP={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[ye.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.0.134-15-ge1ac358",[ye.JAVA_SDK]:"0.0.134-15-ge1ac358",[ye.JAVA_SPRING]:"0.0.134-15-ge1ac358",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.STOPLIGHT]:Qn,[ye.OPENAPI]:xt,[ye.POSTMAN]:"0.0.40-1-g9aa2117",[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:feF(e.auth,t)})};function feF(e,t){return{...e,schemes:e.schemes.map(r=>deF(r,t))}}function deF(e,{taskContext:t,targetGenerator:r}){return ot.V11.auth.AuthScheme._visit(e,{bearer:ot.V10.auth.AuthScheme.bearer,basic:ot.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."):ot.V10.auth.AuthScheme.header({docs:n.docs,availability:{status:ot.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 FrP={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[ye.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.1.0-1-gdb5c636",[ye.JAVA_SDK]:"0.1.0-1-gdb5c636",[ye.JAVA_SPRING]:"0.1.0-1-gdb5c636",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.STOPLIGHT]:"0.0.23-8-g479c860",[ye.OPENAPI]:"0.0.22-1-g1c86b58",[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let n=Rb(e.types,i=>({...i,shape:ot.V12.types.Type._visit(i.shape,{union:ot.V11.types.Type.union,enum:ot.V11.types.Type.enum,object:ot.V11.types.Type.object,alias:a=>ot.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:ot.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:ot.V11.types.ResolvedTypeReference.container,primitive:ot.V11.types.ResolvedTypeReference.primitive,named:u=>u.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(RrP({taskContext:t,targetGenerator:r})):ot.V11.types.ResolvedTypeReference.named({shape:u.shape,name:u.name}),unknown:ot.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(RrP({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:n,services:Rb(e.services,i=>peF(i,{taskContext:t,targetGenerator:r}))}}};function RrP(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 peF(e,t){return{...e,endpoints:e.endpoints.map(r=>_eF(r,t))}}function _eF(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?ot.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:ot.V11.http.HttpRequestBody.inlinedRequestBody,reference:ot.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 zrP={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:Rb(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:ot.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 QrP={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:Qn,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V14.types.Type._visit(r.shape,{union:n=>ot.V13.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:jk(i.valueType)})),types:n.types.map(i=>veF(i))}),enum:ot.V13.types.Type.enum,object:n=>ot.V13.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:jk(i.valueType)}))}),alias:n=>ot.V13.types.Type.alias({aliasOf:jk(n.aliasOf),resolvedType:geF(n.resolvedType)}),undiscriminatedUnion:n=>ot.V13.types.Type.undiscriminatedUnion(meF(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:heF(e.auth),headers:e.headers.map(r=>ajd(r)),types:t,services:Rb(e.services,r=>OeF(r)),errors:Rb(e.errors,r=>DeF(r))}}};function heF(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:ot.V13.auth.AuthScheme.header(yeF(t)))}}function yeF(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:jk(e.valueType)}}function ajd(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:jk(e.valueType)}}function jk(e){return ot.V14.types.TypeReference._visit(e,{container:t=>ot.V13.types.TypeReference.container(LrP(t)),primitive:t=>t==="DATE"?ot.V13.types.TypeReference.primitive(ot.V13.types.PrimitiveType.String):ot.V13.types.TypeReference.primitive(t),named:ot.V13.types.TypeReference.named,unknown:ot.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function LrP(e){return ot.V14.types.ContainerType._visit(e,{list:t=>ot.V13.types.ContainerType.list(jk(t)),optional:t=>ot.V13.types.ContainerType.optional(jk(t)),set:t=>ot.V13.types.ContainerType.set(jk(t)),map:({keyType:t,valueType:r})=>ot.V13.types.ContainerType.map({keyType:jk(t),valueType:jk(r)}),literal:ot.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function veF(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:beF(e.shape)}}function beF(e){return ot.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:jk(t.type)}),noProperties:ot.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function geF(e){return ot.V14.types.ResolvedTypeReference._visit(e,{container:t=>ot.V13.types.ResolvedTypeReference.container(LrP(t)),named:ot.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?ot.V13.types.ResolvedTypeReference.primitive(ot.V13.types.PrimitiveType.String):ot.V13.types.ResolvedTypeReference.primitive(t),unknown:ot.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function meF(e){return{members:e.members.map(t=>({...t,type:jk(t.type)}))}}function OeF(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>UrP(t)),headers:e.headers.map(t=>ajd(t)),endpoints:e.endpoints.map(t=>AeF(t))}}function UrP(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:jk(e.valueType)}}function AeF(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=>UrP(t)),sdkRequest:e.sdkRequest!=null?weF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?EeF(e.requestBody):void 0,response:e.response!=null?njd(e.response):void 0,headers:e.headers.map(t=>ajd(t)),queryParameters:e.queryParameters.map(t=>PeF(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?ijd(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?SeF(e.sdkResponse):void 0}}function PeF(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:jk(e.valueType),allowMultiple:e.allowMultiple}}function weF(e){return{requestParameterName:e.requestParameterName,shape:jeF(e.shape)}}function jeF(e){return ot.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:jk(t.requestBodyType)}),wrapper:ot.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function EeF(e){return ot.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:jk(r.valueType)}))}),reference:t=>ot.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:jk(t.requestBodyType)}),fileUpload:t=>ot.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:jk(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function njd(e){return{docs:e.docs,responseBodyType:jk(e.responseBodyType)}}function ijd(e){return{dataEventType:jk(e.dataEventType),terminator:e.terminator}}function SeF(e){return ot.V14.http.SdkResponse._visit(e,{streaming:t=>ot.V13.http.SdkResponse.streaming(ijd(t)),nonStreaming:t=>ot.V13.http.SdkResponse.nonStreaming(njd(t)),maybeStreaming:t=>ot.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:njd(t.nonStreaming),streaming:ijd(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function DeF(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?jk(e.type):void 0,statusCode:e.statusCode}}var VrP={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[ye.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.0.52-3-gd9df38df",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V15.types.Type._visit(r.shape,{union:n=>ot.V14.types.Type.union({discriminant:n.discriminant,baseProperties:n.baseProperties.map(i=>({...i,valueType:Ek(i.valueType)})),types:n.types.map(i=>MeF(i))}),enum:ot.V14.types.Type.enum,object:n=>ot.V14.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:Ek(i.valueType)}))}),alias:n=>ot.V14.types.Type.alias({aliasOf:Ek(n.aliasOf),resolvedType:TeF(n.resolvedType)}),undiscriminatedUnion:n=>ot.V14.types.Type.undiscriminatedUnion(qeF(n)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:CeF(e.auth),headers:e.headers.map(r=>sjd(r)),types:t,services:Rb(e.services,r=>xeF(r)),errors:Rb(e.errors,r=>UeF(r))}}};function CeF(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:ot.V14.auth.AuthScheme.header(IeF(t)))}}function IeF(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:Ek(e.valueType)}}function sjd(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:Ek(e.valueType)}}function Ek(e){return ot.V15.types.TypeReference._visit(e,{container:t=>ot.V14.types.TypeReference.container(WrP(t)),primitive:t=>t==="BASE_64"?ot.V14.types.TypeReference.primitive(ot.V14.types.PrimitiveType.String):ot.V14.types.TypeReference.primitive(t),named:ot.V14.types.TypeReference.named,unknown:ot.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function WrP(e){return ot.V15.types.ContainerType._visit(e,{list:t=>ot.V14.types.ContainerType.list(Ek(t)),optional:t=>ot.V14.types.ContainerType.optional(Ek(t)),set:t=>ot.V14.types.ContainerType.set(Ek(t)),map:({keyType:t,valueType:r})=>ot.V14.types.ContainerType.map({keyType:Ek(t),valueType:Ek(r)}),literal:ot.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function MeF(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:BeF(e.shape)}}function BeF(e){return ot.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:Ek(t.type)}),noProperties:ot.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function TeF(e){return ot.V15.types.ResolvedTypeReference._visit(e,{container:t=>ot.V14.types.ResolvedTypeReference.container(WrP(t)),named:ot.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?ot.V14.types.ResolvedTypeReference.primitive(ot.V14.types.PrimitiveType.String):ot.V14.types.ResolvedTypeReference.primitive(t),unknown:ot.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function qeF(e){return{members:e.members.map(t=>({...t,type:Ek(t.type)}))}}function xeF(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>HrP(t)),headers:e.headers.map(t=>sjd(t)),endpoints:e.endpoints.map(t=>NeF(t))}}function HrP(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ek(e.valueType)}}function NeF(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=>HrP(t)),sdkRequest:e.sdkRequest!=null?FeF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?QeF(e.requestBody):void 0,response:e.response!=null?ojd(e.response):void 0,headers:e.headers.map(t=>sjd(t)),queryParameters:e.queryParameters.map(t=>ReF(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?ujd(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?LeF(e.sdkResponse):void 0}}function ReF(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:Ek(e.valueType),allowMultiple:e.allowMultiple}}function FeF(e){return{requestParameterName:e.requestParameterName,shape:zeF(e.shape)}}function zeF(e){return ot.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:Ek(t.requestBodyType)}),wrapper:ot.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function QeF(e){return ot.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:Ek(r.valueType)}))}),reference:t=>ot.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:Ek(t.requestBodyType)}),fileUpload:t=>ot.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:Ek(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function ojd(e){return{docs:e.docs,responseBodyType:Ek(e.responseBodyType)}}function ujd(e){return{dataEventType:Ek(e.dataEventType),terminator:e.terminator}}function LeF(e){return ot.V15.http.SdkResponse._visit(e,{streaming:t=>ot.V14.http.SdkResponse.streaming(ujd(t)),nonStreaming:t=>ot.V14.http.SdkResponse.nonStreaming(ojd(t)),maybeStreaming:t=>ot.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:ojd(t.nonStreaming),streaming:ujd(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function UeF(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?Ek(e.type):void 0,statusCode:e.statusCode}}var GrP={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[ye.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[ye.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[ye.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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:Rb(e.services,n=>({...n,pathParameters:cjd(n.pathParameters),endpoints:n.endpoints.map(i=>({...i,allPathParameters:cjd(i.allPathParameters),pathParameters:cjd(i.pathParameters)}))}))}};function cjd(e){return e.map(t=>VeF(t))}function VeF(e){return{...e,availability:{status:ot.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var JrP={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},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 KrP={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[ye.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[ye.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.3.0-3-ge125e311",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:Rb(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 YrP={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:Qn,[ye.TYPESCRIPT_BROWSER_SDK]:Qn,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[ye.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[ye.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:"0.0.44-1-gbf4b0f3",[ye.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:Qn,[ye.GO_SDK]:Qn,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Rb(e.services,r=>WeF(r,t)),types:Rb(e.types,r=>YeF(r,t))})};function WeF(e,t){return{...e,endpoints:e.endpoints.map(r=>HeF(r,t))}}function HeF(e,t){return{...e,examples:e.examples.map(r=>GeF(r,t))}}function GeF(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>ljd(r,t)),servicePathParameters:e.servicePathParameters.map(r=>ljd(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>ljd(r,t)),serviceHeaders:e.serviceHeaders.map(r=>$rP(r,t)),endpointHeaders:e.endpointHeaders.map(r=>$rP(r,t)),queryParameters:e.queryParameters.map(r=>JeF(r,t)),request:e.request!=null?KeF(e.request,t):void 0,response:$eF(e.response,t)}}function ljd(e,t){return{key:e.key,value:y3e(e.value,t)}}function $rP(e,t){return{wireKey:e.wireKey,value:y3e(e.value,t)}}function JeF(e,t){return{wireKey:e.wireKey,value:y3e(e.value,t)}}function KeF(e,t){return ot.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>ot.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(n=>({wireKey:n.wireKey,value:y3e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),reference:r=>ot.V18.http.ExampleRequestBody.reference(y3e(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function $eF(e,t){return ot.V19.http.ExampleResponse._visit(e,{ok:r=>ot.V18.http.ExampleResponse.ok({body:r.body!=null?y3e(r.body,t):void 0}),error:r=>ot.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?y3e(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function YeF(e,t){return{...e,examples:e.examples.map(r=>XeF(r,t))}}function XeF(e,t){return{...e,shape:fjd(e.shape,t)}}function fjd(e,t){return ot.V19.types.ExampleTypeShape._visit(e,{alias:r=>ot.V18.types.ExampleTypeShape.alias({value:y3e(r.value,t)}),object:r=>ot.V18.types.ExampleTypeShape.object({properties:r.properties.map(n=>({wireKey:n.wireKey,value:y3e(n.value,t),originalTypeDeclaration:n.originalTypeDeclaration}))}),union:r=>ot.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:ot.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:n=>ot.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:n.jsonExample,shape:XrP(n.shape,t)}),samePropertiesAsObject:n=>ot.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:n.typeName,shape:fjd(n.shape,t)}),noProperties:ot.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:ot.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function y3e(e,t){return{jsonExample:e.jsonExample,shape:XrP(e.shape,t)}}function XrP(e,t){return ot.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>ot.V18.types.ExampleTypeReferenceShape.primitive(ZeF(r,t)),named:r=>ot.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:fjd(r.shape,t)}),container:r=>ot.V18.types.ExampleTypeReferenceShape.container(ot.V19.types.ExampleContainer._visit(r,{list:n=>ot.V18.types.ExampleContainer.list(n.map(i=>y3e(i,t))),set:n=>ot.V18.types.ExampleContainer.set(n.map(i=>y3e(i,t))),optional:n=>ot.V18.types.ExampleContainer.optional(n!=null?y3e(n,t):void 0),map:n=>ot.V18.types.ExampleContainer.map(n.map(i=>({key:y3e(i.key,t),value:y3e(i.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:ot.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function ZeF(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 ZrP={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[ye.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.5.26-rc0-3-gdfabd674",[ye.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[ye.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[ye.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[ye.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[ye.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:"0.0.0",[ye.GO_SDK]:"0.0.0",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Rb(e.services,r=>keF(r,t))})};function keF(e,t){return{...e,endpoints:e.endpoints.map(r=>etF(r,t))}}function etF(e,t){return{...e,response:e.response!=null?krP(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?ttF(e.sdkResponse,t):void 0}}function krP(e,t){return ot.V20.http.HttpResponse._visit(e,{fileDownload:()=>enP(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function ttF(e,t){return ot.V20.http.SdkResponse._visit(e,{fileDownload:()=>enP(t),streaming:ot.V19.http.SdkResponse.streaming,maybeStreaming:r=>ot.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:krP(r.nonStreaming,t)}),json:ot.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function enP({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 tnP={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:Qn,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:Rb(e.services,r=>rtF(r,t))})};function rtF(e,t){return{...e,endpoints:e.endpoints.map(r=>ntF(r,t))}}function ntF(e,t){return{...e,streamingResponse:e.streamingResponse!=null?djd(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?itF(e.sdkResponse,t):void 0}}function djd(e,{taskContext:t,targetGenerator:r}){return{dataEventType:ot.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 itF(e,t){return ot.V21.http.SdkResponse._visit(e,{fileDownload:ot.V20.http.SdkResponse.fileDownload,streaming:r=>ot.V20.http.SdkResponse.streaming(djd(r,t)),maybeStreaming:r=>ot.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:djd(r.streaming,t),nonStreaming:r.nonStreaming}),json:ot.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var rnP={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.5.0-3-gac7ce7c",[ye.GO_MODEL]:"0.0.14-8-g2fa39f7",[ye.GO_SDK]:"0.0.14-8-g2fa39f7",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:Rb(e.services,t=>atF(t))})};function atF(e){return{...e,endpoints:e.endpoints.map(t=>otF(t))}}function otF(e){return{...e,...e.response!=null?ot.V22.http.HttpResponse._visit(e.response,{json:t=>({response:ot.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:ot.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:ot.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:ot.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:ot.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var anP={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[ye.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.7.4-rc3-4-g6cf92f81",[ye.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:"0.0.28-3-g112d3dd",[ye.STOPLIGHT]:"0.0.28-3-g112d3dd",[ye.POSTMAN]:"0.0.44-4-gddab2ae",[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],n={};for(let[i,a]of Object.entries(e.services)){let u=[];for(let c of a.endpoints){let p=utF(c);p==null?r.push(c):u.push(p)}n[i]={...a,endpoints:u,headers:a.headers.map(c=>_jd(c)),pathParameters:a.pathParameters.map(c=>c5s(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=>ctF(i))},headers:e.headers.map(i=>_jd(i)),types:Rb(e.types,i=>ltF(i)),services:n,errors:Rb(e.errors,i=>ytF(i)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(i=>c5s(i)),variables:e.variables.map(i=>vtF(i))}}};function utF(e){let t;if(!(e.requestBody!=null&&(t=stF(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>_jd(r)),pathParameters:e.pathParameters.map(r=>c5s(r)),allPathParameters:e.allPathParameters.map(r=>c5s(r)),queryParameters:e.queryParameters.map(r=>btF(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:gtF(e.sdkRequest.shape)}:void 0,response:e.response!=null?mtF(e.response):void 0,examples:e.examples.map(r=>OtF(r))}}function stF(e){switch(e.type){case"bytes":return;case"fileUpload":return ot.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>PtF(t))});case"inlinedRequestBody":return ot.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>wtF(t))});case"reference":return ot.V22.http.HttpRequestBody.reference({...e,requestBodyType:Sk(e.requestBodyType)});default:cc(e)}}function _jd(e){return{...e,valueType:Sk(e.valueType)}}function ctF(e){return e._visit({bearer:ot.V22.auth.AuthScheme.bearer,basic:ot.V22.auth.AuthScheme.basic,header:t=>ot.V22.auth.AuthScheme.header({...t,valueType:Sk(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function ltF(e){return{...e,shape:ftF(e.shape),examples:e.examples.map(t=>dtF(t))}}function ftF(e){return e._visit({alias:t=>ot.V22.types.Type.alias({...t,aliasOf:Sk(t.aliasOf),resolvedType:_tF(t.resolvedType)}),enum:ot.V22.types.Type.enum,object:t=>ot.V22.types.Type.object({...t,properties:t.properties.map(r=>nnP(r))}),union:t=>ot.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>nnP(r)),types:t.types.map(r=>({...r,shape:htF(r.shape)}))}),undiscriminatedUnion:t=>ot.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:Sk(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function dtF(e){return{...e,shape:hjd(e.shape)}}function hjd(e){return e._visit({alias:t=>ot.V22.types.ExampleTypeShape.alias({...t,value:hnt(t.value)}),enum:ot.V22.types.ExampleTypeShape.enum,object:t=>ot.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:hnt(r.value)}))}),union:t=>ot.V22.types.ExampleTypeShape.union({...t,properties:ptF(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function hnt(e){return{...e,shape:yjd(e.shape)}}function yjd(e){return e._visit({primitive:t=>ot.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:ot.V22.types.ExamplePrimitive.integer,double:ot.V22.types.ExamplePrimitive.double,string:ot.V22.types.ExamplePrimitive.string,boolean:ot.V22.types.ExamplePrimitive.boolean,long:ot.V22.types.ExamplePrimitive.long,datetime:r=>ot.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:ot.V22.types.ExamplePrimitive.date,uuid:ot.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>ot.V22.types.ExampleTypeReferenceShape.named({...t,shape:hjd(t.shape)}),container:t=>ot.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>ot.V22.types.ExampleContainer.list(r.map(n=>hnt(n))),set:r=>ot.V22.types.ExampleContainer.set(r.map(n=>hnt(n))),optional:r=>ot.V22.types.ExampleContainer.optional(r!=null?hnt(r):void 0),map:r=>ot.V22.types.ExampleContainer.map(r.map(n=>({key:hnt(n.key),value:hnt(n.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:ot.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function ptF(e){return e._visit({singleProperty:t=>ot.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:yjd(t.shape)}),noProperties:ot.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>ot.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:hjd(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function Sk(e){return e._visit({container:t=>ot.V22.types.TypeReference.container(onP(t)),primitive:ot.V22.types.TypeReference.primitive,named:ot.V22.types.TypeReference.named,unknown:ot.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function onP(e){return e._visit({list:t=>ot.V22.types.ContainerType.list(Sk(t)),set:t=>ot.V22.types.ContainerType.set(Sk(t)),optional:t=>ot.V22.types.ContainerType.optional(Sk(t)),map:t=>ot.V22.types.ContainerType.map({keyType:Sk(t.keyType),valueType:Sk(t.valueType)}),literal:ot.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function _tF(e){return e._visit({container:t=>ot.V22.types.ResolvedTypeReference.container(onP(t)),primitive:ot.V22.types.ResolvedTypeReference.primitive,named:ot.V22.types.ResolvedTypeReference.named,unknown:ot.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function nnP(e){return{...e,valueType:Sk(e.valueType)}}function htF(e){return e._visit({noProperties:ot.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>ot.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:Sk(t.type)}),samePropertiesAsObject:ot.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function ytF(e){return{...e,type:e.type!=null?Sk(e.type):void 0}}function vtF(e){return{...e,type:Sk(e.type)}}function c5s(e){return{...e,valueType:Sk(e.valueType)}}function btF(e){return{...e,valueType:Sk(e.valueType)}}function gtF(e){return e._visit({justRequestBody:t=>ot.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:Sk(t.requestBodyType)}),wrapper:ot.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function mtF(e){return e._visit({json:t=>ot.V22.http.HttpResponse.json({...t,responseBodyType:Sk(t.responseBodyType)}),fileDownload:ot.V22.http.HttpResponse.fileDownload,streaming:t=>ot.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>ot.V22.http.StreamingResponseChunkType.json(Sk(r)),text:ot.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 OtF(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>pjd(t)),servicePathParameters:e.servicePathParameters.map(t=>pjd(t)),endpointPathParameters:e.endpointPathParameters.map(t=>pjd(t)),serviceHeaders:e.serviceHeaders.map(t=>inP(t)),endpointHeaders:e.endpointHeaders.map(t=>inP(t)),queryParameters:e.queryParameters.map(t=>AtF(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>ot.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:hnt(r.value)}))}),reference:t=>ot.V22.http.ExampleRequestBody.reference({...t,shape:yjd(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>ot.V22.http.ExampleResponse.ok({...t,body:t.body!=null?hnt(t.body):void 0}),error:t=>ot.V22.http.ExampleResponse.error({...t,body:t.body!=null?hnt(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function pjd(e){return{...e,value:hnt(e.value)}}function AtF(e){return{...e,value:hnt(e.value)}}function inP(e){return{...e,value:hnt(e.value)}}function PtF(e){return e._visit({file:ot.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>ot.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:Sk(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function wtF(e){return{...e,valueType:Sk(e.valueType)}}var $0={};ds($0,{V23:()=>au8,V24:()=>ou8,V25:()=>uu8,V26:()=>su8,V27:()=>cu8,V28:()=>lu8,V29:()=>fu8,V30:()=>du8,V31:()=>pu8,V32:()=>_u8,V33:()=>hu8,V34:()=>yu8,V35:()=>vu8,V36:()=>bu8,V37:()=>gu8,V38:()=>mu8,V39:()=>Ou8,V40:()=>Au8,V41:()=>Pu8,V42:()=>wu8,V43:()=>ju8,V44:()=>Eu8,V45:()=>Su8,V46:()=>Du8,V47:()=>Cu8,V48:()=>Iu8,V49:()=>Mu8,V50:()=>Bu8,V51:()=>Tu8,V52:()=>qu8,V53:()=>xu8,V54:()=>Nu8,V55:()=>Ru8,V56:()=>Fu8,V57:()=>zu8,V58:()=>Qu8,V59:()=>Lu8,V60:()=>y0});var au8=Xi(Fc(),1),ou8=Xi(fc(),1),uu8=Xi(ec(),1),su8=Xi(Vs(),1),cu8=Xi(Ts(),1),lu8=Xi(qs(),1),fu8=Xi(xs(),1),du8=Xi(ws(),1),pu8=Xi(Os(),1),_u8=Xi(is(),1),hu8=Xi(_u(),1),yu8=Xi(su(),1),vu8=Xi(Ko(),1),bu8=Xi($o(),1),gu8=Xi(Go(),1),mu8=Xi(Lo(),1),Ou8=Xi(yo(),1),Au8=Xi(vo(),1),Pu8=Xi(fo(),1),wu8=Xi(oo(),1),ju8=Xi(ao(),1),Eu8=Xi(no(),1),Su8=Xi(Xa(),1),Du8=Xi(Va(),1),Cu8=Xi(La(),1),Iu8=Xi(Fa(),1),Mu8=Xi(Ba(),1),Bu8=Xi(Ia(),1),Tu8=Xi(Oa(),1),qu8=Xi(va(),1),xu8=Xi(Pn(),1),Nu8=Xi(zP(),1),Ru8=Xi(gP(),1),Fu8=Xi(mP(),1),zu8=Xi($A(),1),Qu8=Xi(YA(),1),Lu8=Xi(XA(),1);var OD1={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var AD1={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.4.9-1-ge0997b3",[ye.JAVA_SDK]:"0.4.9-1-ge0997b3",[ye.JAVA_SPRING]:"0.4.9-1-ge0997b3",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],n=[],i={};for(let[a,u]of Object.entries(e.services)){let c=[];for(let p of u.endpoints){let s;if(p.sdkRequest!=null&&(s=Uu8(p.sdkRequest),s==null)){r.push(p);continue}if(p.response!=null){let o=p.response._visit({fileDownload:l=>ot.V24.HttpResponse.fileDownload(l),json:l=>ot.V24.HttpResponse.json(l),streaming:l=>ot.V24.HttpResponse.streaming(l),text:()=>(n.push(p),ot.V24.HttpResponse.json({docs:void 0,responseBodyType:ot.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});c.push({...p,sdkRequest:s,response:o})}else c.push({...p,sdkRequest:s,response:void 0})}i[a]={...u,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 Uu8(e){let t=e.shape;if(t.type==="wrapper")return{shape:ot.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:ot.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var wD1={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[ye.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Ju8(r)])),headers:e.headers.map(t=>mGc(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(n=>Vu8(n))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,Wu8(r)]))})};function Vu8(e){return{...e,headers:e.headers.map(t=>mGc(t)),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Wu8(e){return{...e,endpoints:e.endpoints.map(t=>Hu8(t)),headers:e.headers.map(t=>mGc(t)),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Hu8(e){return{...e,headers:e.headers.map(t=>mGc(t)),queryParameters:e.queryParameters.map(t=>Gu8(t)),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function mGc(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Gu8(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Ju8(e){return{...e,shape:e.shape._visit({union:t=>ot.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>PD1(r))}),object:t=>ot.V25.Type.object({...t,properties:t.properties.map(r=>PD1(r))}),enum:t=>ot.V25.Type.enum({...t,values:t.values.map(r=>Ku8(r))}),alias:t=>ot.V25.Type.alias(t),undiscriminatedUnion:t=>ot.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function PD1(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function Ku8(e){return{...e,availability:e.availability==null?{status:ot.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var jD1={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.6.1-3-g94ee67a",[ye.GO_MODEL]:"0.6.1-3-g94ee67a",[ye.GO_SDK]:"0.6.1-3-g94ee67a",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,$u8(r)]))})};function $u8(e){return{...e,endpoints:e.endpoints.map(t=>Yu8(t))}}function Yu8(e){return{...e,response:e.response!=null?Xu8(e.response):void 0}}function Xu8(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?ot.V26.HttpResponse.json(t):ot.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var ED1={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[ye.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.8.1-1-g0f40bf18",[ye.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.9.0-2-g6b0be0e",[ye.GO_MODEL]:"0.9.0-2-g6b0be0e",[ye.GO_SDK]:"0.9.0-2-g6b0be0e",[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:Es8(e.auth),headers:AGc(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Ms8(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,us8(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,ts8(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,es8(r)])),pathParameters:OGc(e.pathParameters),variables:Zu8(e.variables)})};function Zu8(e){return e.map(t=>ku8(t))}function ku8(e){return{...e,type:CY(e.type)}}function es8(e){return{...e,type:e.type!=null?CY(e.type):void 0}}function ts8(e){return e.map(t=>rs8(t))}function rs8(e){return{...e,headers:AGc(e.headers),payload:ns8(e.payload)}}function ns8(e){switch(e.type){case"inlinedPayload":return ot.V27.WebhookPayload.inlinedPayload(is8(e));case"reference":return ot.V27.WebhookPayload.reference({...e,payloadType:CY(e.payloadType)})}}function is8(e){return{...e,properties:as8(e.properties)}}function as8(e){return e.map(t=>os8(t))}function os8(e){return{...e,valueType:CY(e.valueType)}}function us8(e){return{...e,endpoints:ss8(e.endpoints),headers:AGc(e.headers),pathParameters:OGc(e.pathParameters)}}function ss8(e){return e.map(t=>cs8(t))}function cs8(e){return{...e,headers:AGc(e.headers),pathParameters:OGc(e.pathParameters),allPathParameters:OGc(e.allPathParameters),queryParameters:ws8(e.queryParameters),requestBody:e.requestBody!=null?vs8(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?_s8(e.sdkRequest):void 0,response:e.response!=null?ls8(e.response):void 0}}function ls8(e){switch(e.type){case"json":return ot.V27.HttpResponse.json(ps8(e.value));case"fileDownload":return ot.V27.HttpResponse.fileDownload(e);case"text":return ot.V27.HttpResponse.text(e);case"streaming":return ot.V27.HttpResponse.streaming(fs8(e));default:cc(e)}}function fs8(e){return{...e,dataEventType:ds8(e.dataEventType)}}function ds8(e){switch(e.type){case"json":return ot.V27.StreamingResponseChunkType.json(CY(e.json));case"text":return ot.V27.StreamingResponseChunkType.text();default:cc(e)}}function ps8(e){switch(e.type){case"response":return ot.V27.JsonResponse.response({...e,responseBodyType:CY(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:CY(e.responseBodyType),responseProperty:e.responseProperty!=null?ID1(e.responseProperty):void 0});default:cc(e)}}function _s8(e){return{...e,shape:hs8(e.shape)}}function hs8(e){switch(e.type){case"justRequestBody":return ot.V27.SdkRequestShape.justRequestBody(ys8(e.value));case"wrapper":return ot.V27.SdkRequestShape.wrapper(e);default:cc(e)}}function ys8(e){switch(e.type){case"typeReference":return ot.V27.SdkRequestBodyType.typeReference(SD1(e));case"bytes":return ot.V27.SdkRequestBodyType.bytes(e);default:cc(e)}}function vs8(e){switch(e.type){case"inlinedRequestBody":return ot.V27.HttpRequestBody.inlinedRequestBody(Os8(e));case"reference":return ot.V27.HttpRequestBody.reference(SD1(e));case"fileUpload":return ot.V27.HttpRequestBody.fileUpload(bs8(e));case"bytes":return ot.V27.HttpRequestBody.bytes(e);default:cc(e)}}function bs8(e){return{...e,properties:gs8(e.properties)}}function gs8(e){return e.map(t=>ms8(t))}function ms8(e){switch(e.type){case"file":return ot.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return ot.V27.FileUploadRequestProperty.bodyProperty(DD1(e));default:cc(e)}}function SD1(e){return{...e,requestBodyType:CY(e.requestBodyType)}}function Os8(e){return{...e,properties:As8(e.properties)}}function As8(e){return e.map(t=>DD1(t))}function DD1(e){return{...e,valueType:CY(e.valueType)}}function OGc(e){return e.map(t=>Ps8(t))}function Ps8(e){return{...e,valueType:CY(e.valueType)}}function ws8(e){return e.map(t=>js8(t))}function js8(e){return{...e,valueType:CY(e.valueType)}}function Es8(e){return{...e,schemes:Ss8(e.schemes)}}function Ss8(e){return e.map(t=>Ds8(t))}function Ds8(e){switch(e.type){case"basic":return ot.V27.AuthScheme.basic(e);case"bearer":return ot.V27.AuthScheme.bearer(e);case"header":return Cs8(e);default:cc(e)}}function Cs8(e){return ot.V27.AuthScheme.header({...e,valueType:CY(e.valueType)})}function AGc(e){return e.map(t=>Is8(t))}function Is8(e){return{...e,valueType:CY(e.valueType)}}function Ms8(e){return{...e,shape:Bs8(e.shape)}}function Bs8(e){switch(e.type){case"alias":return ot.V27.Type.alias(Ts8(e));case"enum":return ot.V27.Type.enum(e);case"object":return ot.V27.Type.object(qs8(e));case"union":return ot.V27.Type.union(xs8(e));case"undiscriminatedUnion":return ot.V27.Type.undiscriminatedUnion(Ns8(e));default:cc(e)}}function Ts8(e){return{aliasOf:CY(e.aliasOf),resolvedType:Qs8(e.resolvedType)}}function qs8(e){return{...e,properties:CD1(e.properties)}}function xs8(e){return{...e,types:Rs8(e.types),baseProperties:CD1(e.baseProperties)}}function Ns8(e){return{members:zs8(e.members)}}function CD1(e){return e.map(t=>ID1(t))}function ID1(e){return{...e,valueType:CY(e.valueType)}}function Rs8(e){return e.map(t=>({...t,shape:Fs8(t.shape)}))}function Fs8(e){switch(e.propertiesType){case"samePropertiesAsObject":return ot.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return ot.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:CY(e.type)});case"noProperties":return ot.V27.SingleUnionTypeProperties.noProperties();default:cc(e)}}function zs8(e){return e.map(t=>({...t,type:CY(t.type)}))}function Qs8(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?ot.V27.ResolvedTypeReference.primitive(ot.V27.PrimitiveType.Boolean):ot.V27.ResolvedTypeReference.container(ot.V27.ContainerType.literal(ot.V27.Literal.string(e.container.literal.string))):ot.V27.ResolvedTypeReference.container(MD1(e.container));case"named":return ot.V27.ResolvedTypeReference.named(e);case"primitive":return ot.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return ot.V27.ResolvedTypeReference.unknown();default:cc(e)}}function CY(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?ot.V27.TypeReference.primitive(ot.V27.PrimitiveType.Boolean):ot.V27.TypeReference.container(ot.V27.ContainerType.literal(ot.V27.Literal.string(e.container.literal.string))):ot.V27.TypeReference.container(MD1(e.container));case"named":return ot.V27.TypeReference.named(e);case"primitive":return ot.V27.TypeReference.primitive(e.primitive);case"unknown":return ot.V27.TypeReference.unknown();default:cc(e)}}function MD1(e){switch(e.type){case"list":return ot.V27.ContainerType.list(CY(e.list));case"map":return ot.V27.ContainerType.map({keyType:CY(e.keyType),valueType:CY(e.valueType)});case"optional":return ot.V27.ContainerType.optional(CY(e.optional));case"set":return ot.V27.ContainerType.set(CY(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return ot.V27.ContainerType.literal(ot.V27.Literal.string(e.literal.string));default:cc(e)}}var TD1={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[ye.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.8.6-1-g3d8d8591",[ye.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[ye.JAVA_SDK]:"0.5.14-1-ge4bcd98",[ye.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,Ls8({typeId:t,allTypes:e.types})]))})};function Ls8({typeId:e,allTypes:t}){let r=BD1({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=BD1({typeId:n,allTypes:t});return{typeId:n,fernFilepath:i.name.fernFilepath,name:i.name.name}})}}function BD1({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 qD1={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[ye.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new yc_(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},yc_=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 ot.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return ot.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:cc(t)}}convertExampleResponse(t){switch(t.type){case"ok":return ot.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return ot.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:cc(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 ot.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return ot.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return ot.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return ot.V29.ExampleTypeReferenceShape.unknown(t);default:cc(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return ot.V29.ExamplePrimitive.integer(t.integer);case"double":return ot.V29.ExamplePrimitive.double(t.double);case"string":return ot.V29.ExamplePrimitive.string(t.string.original);case"boolean":return ot.V29.ExamplePrimitive.boolean(t.boolean);case"long":return ot.V29.ExamplePrimitive.long(t.long);case"datetime":return ot.V29.ExamplePrimitive.datetime(t.datetime);case"date":return ot.V29.ExamplePrimitive.date(t.date);case"uuid":return ot.V29.ExamplePrimitive.uuid(t.uuid);default:cc(t)}}convertExampleContainer(t){switch(t.type){case"list":return ot.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return ot.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return ot.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return ot.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:cc(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 ot.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return ot.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return ot.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return ot.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:cc(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 ot.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(ot.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return ot.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return ot.V29.ExampleSingleUnionTypeProperties.noProperties();default:cc(t)}}};var xD1={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.8.8",[ye.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.8.8",[ye.TYPESCRIPT_EXPRESS]:"0.8.8",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.7.0-rc0",[ye.JAVA_SDK]:"0.7.0-rc0",[ye.JAVA_SPRING]:"0.7.0-rc0",[ye.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[ye.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.7.5-1-gb54fb677",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:Qn,[ye.RUBY_SDK]:Qn,[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 RD1={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.9.4-2-g139cf36",[ye.GO_MODEL]:"0.9.4-2-g139cf36",[ye.GO_SDK]:"0.9.4-2-g139cf36",[ye.RUBY_MODEL]:"0.0.0",[ye.RUBY_SDK]:"0.0.0",[ye.CSHARP_MODEL]:Qn,[ye.CSHARP_SDK]:Qn,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:Js8(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(Us8)}]))})};function kEa({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function Us8(e){return{...e,examples:kEa({examples:e.examples,convert:Vs8})}}function Vs8(e){let t;if(e.request!=null&&(t=Ws8(e.request),t==null))return;let r=Hs8(e.response);if(r!=null)return{...e,rootPathParameters:kEa({examples:e.rootPathParameters,convert:vc_}),endpointPathParameters:kEa({examples:e.endpointPathParameters,convert:vc_}),servicePathParameters:kEa({examples:e.servicePathParameters,convert:vc_}),endpointHeaders:kEa({examples:e.endpointHeaders,convert:ND1}),serviceHeaders:kEa({examples:e.serviceHeaders,convert:ND1}),queryParameters:kEa({examples:e.queryParameters,convert:Gs8}),request:t,response:r}}function Ws8(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let n=cYe(r.value);n!=null&&t.push({...r,value:n})}return ot.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=bc_(e.shape);return t==null?void 0:ot.V31.ExampleRequestBody.reference({...e,shape:t})}default:cc(e)}}function Hs8(e){switch(e.type){case"ok":{if(e.body==null)return ot.V31.ExampleResponse.ok({body:void 0});let t=cYe(e.body);return t==null?void 0:ot.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return ot.V31.ExampleResponse.error({...e,body:void 0});let t=cYe(e.body);return t==null?void 0:ot.V31.ExampleResponse.error({...e,body:t})}}}function vc_(e){let t=cYe(e.value);if(t!=null)return{...e,value:t}}function ND1(e){let t=cYe(e.value);if(t!=null)return{...e,value:t}}function Gs8(e){let t=cYe(e.value);if(t!=null)return{...e,value:t}}function Js8(e){let t=[];for(let r of e){let n=Ks8(r);n!=null&&t.push(n)}return t}function Ks8(e){let t=FD1(e.shape);if(t!=null)return{...e,shape:t}}function FD1(e){switch(e.type){case"enum":return ot.V31.ExampleTypeShape.enum(e);case"alias":{let t=cYe(e.value);return t==null?void 0:ot.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let n=cYe(r.value);n!=null&&t.push({...r,value:n})}return ot.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=$s8(e.singleUnionType);return t==null?void 0:ot.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:cc(e)}}function cYe(e){let t=bc_(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function $s8(e){let t=Ys8(e.shape);if(t!=null)return{...e,shape:t}}function Ys8(e){switch(e.type){case"noProperties":return ot.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=bc_(e.shape);return t==null?void 0:ot.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let n=cYe(r.value);n!=null&&t.push({...r,value:n})}return ot.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:cc(e)}}function bc_(e){switch(e.type){case"container":{let t=Xs8(e.container);return t==null?void 0:ot.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=FD1(e.shape);return t==null?void 0:ot.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return ot.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return ot.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:cc(e)}}function Xs8(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let n=cYe(r);n!=null&&t.push(n)}return ot.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let n=cYe(r);n!=null&&t.push(n)}return ot.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let n=cYe(r.key),i=cYe(r.value);n!=null&&i!=null&&t.push({key:n,value:i})}return ot.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return ot.V31.ExampleContainer.optional();let t=cYe(e.optional);return t==null?ot.V31.ExampleContainer.optional():ot.V31.ExampleContainer.optional(t)}default:cc(e)}}var zD1={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.12.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.12.0",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.13.0-3-g8c56a41",[ye.GO_MODEL]:"0.13.0-3-g8c56a41",[ye.GO_SDK]:"0.13.0-3-g8c56a41",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:"0.0.0",[ye.CSHARP_SDK]:"0.0.0",[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new gc_(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,n])=>[r,{...n,endpoints:n.endpoints.map(i=>t.convertEndpoint(i))}]))}}},gc_=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:ot.V33.TypeReference.container(ot.V33.ContainerType.optional(ot.V33.TypeReference.primitive("STRING")))}:r),examples:Zs8({examples:t.examples,convert:ks8})}}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:cc(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:cc(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:cc(r.shape)}}};function Zs8({examples:e,convert:t}){let r=[];for(let n of e){let i=t(n);i!=null&&r.push(i)}return r}function ks8(e){return{...e,queryParameters:e.queryParameters.filter(t=>!mc_(t.value))}}function mc_(e){switch(e.shape.type){case"container":return ec8(e.shape.container);case"named":return tc8(e.shape);case"primitive":return!1;case"unknown":return!0;default:cc(e.shape)}}function ec8(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&mc_(e.optional);default:cc(e)}}function tc8(e){switch(e.shape.type){case"alias":return mc_(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:cc(e.shape)}}var lvo=Xi(CHf(),1);var QD1={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.10.4",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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=>lvo.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>lvo.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>lvo.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(u=>(u.type==="file"&&u.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}!`),u.type==="file"?lvo.FernIrV33.FileUploadRequestProperty.file({...u.value}):u))}),bytes:a=>lvo.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var LD1={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.18.0",[ye.GO_MODEL]:"0.18.0",[ye.GO_SDK]:"0.18.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 UD1={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.11.6",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var VD1={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.13.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.13.0",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"0.12.0",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 WD1={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.15.0-rc0",[ye.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.9.0-rc0",[ye.PYTHON_PYDANTIC]:"0.9.0-rc0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"1.2.0-rc0",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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=>ot.V37.HttpResponse.fileDownload(a),json:a=>ot.V37.HttpResponse.json(a),streaming:a=>a._visit({json:u=>ot.V37.HttpResponse.streaming({dataEventType:ot.V37.StreamingResponseChunkType.json(u.payload),docs:u.docs,terminator:u.terminator}),sse:()=>{},text:u=>ot.V37.HttpResponse.streaming({dataEventType:ot.V37.StreamingResponseChunkType.text(),docs:u.docs,terminator:void 0}),_other:()=>{}}),text:a=>ot.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var HD1={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.9.0-rc1",[ye.PYTHON_PYDANTIC]:"0.9.0-rc1",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"1.4.0-rc1",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:"0.7.0-rc0",[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>rc8(r))}})};function rc8(e){switch(e.type){case"basic":return ot.V38.AuthScheme.basic(e);case"bearer":return ot.V38.AuthScheme.bearer(e);case"header":return ot.V38.AuthScheme.header(e);case"oauth":return ot.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:cc(e)}}var GD1={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:"0.20.0",[ye.GO_MODEL]:"0.20.0",[ye.GO_SDK]:"0.20.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var JD1={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 KD1={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.8.0-rc0",[ye.JAVA_SDK]:"0.9.0-rc0",[ye.JAVA_SPRING]:"0.8.0-rc0",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>nc8(r))}})};function nc8(e){switch(e.type){case"basic":return ot.V41.AuthScheme.basic(e);case"bearer":return ot.V41.AuthScheme.bearer(e);case"header":return ot.V41.AuthScheme.header(e);case"oauth":return ot.V41.AuthScheme.oauth(ic8(e));default:cc(e)}}function ic8(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:ot.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:cc(e.configuration.type)}}var $D1={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.17.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.17.0",[ye.TYPESCRIPT_EXPRESS]:"0.13.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 XD1={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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=>ac8({example:a})).filter(GP)}))}]))})};function ac8({example:e}){return e._visit({userProvided:t=>ot.V43.HttpEndpointExample.userProvided(YD1({example:t})),generated:t=>ot.V43.HttpEndpointExample.generated(YD1({example:t})),_other:()=>{}})}function YD1({example:e}){return{...e,response:oc8({example:e.response})}}function oc8({example:e}){switch(e.type){case"ok":return uc8({example:e.value});case"error":return ot.V43.ExampleResponse.error(e);default:cc(e)}}function uc8({example:e}){switch(e.type){case"body":return ot.V43.ExampleResponse.ok({body:e.value});case"sse":return ot.V43.ExampleResponse.ok({body:void 0});case"stream":return ot.V43.ExampleResponse.ok({body:void 0});default:cc(e)}}var ZD1={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V45.types.Type._visit(r.shape,{union:n=>ot.V44.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:m5(i.valueType)})),types:n.types.map(i=>gc8(i))}),enum:ot.V44.types.Type.enum,object:n=>ot.V44.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:m5(i.valueType)}))}),alias:n=>ot.V44.types.Type.alias({aliasOf:m5(n.aliasOf),resolvedType:Oc8(n.resolvedType)}),undiscriminatedUnion:n=>ot.V44.types.Type.undiscriminatedUnion(Ac8(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:_c8(e.auth),headers:e.headers.map(r=>fvo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>fvo(r)),types:t,services:Rb(e.services,r=>Pc8(r)),errors:Rb(e.errors,r=>zc8(r)),webhookGroups:Rb(e.webhookGroups,r=>fc8(r)),websocketChannels:Rb(e.websocketChannels,r=>sc8(r)),pathParameters:e.pathParameters.map(r=>Kyu(r)),variables:e.variables.map(r=>wc8(r))}}};function sc8(e){return{...e,headers:e.headers.map(t=>fvo(t)),queryParameters:e.queryParameters.map(t=>$yu(t)),pathParameters:e.pathParameters.map(t=>Kyu(t)),messages:e.messages.map(t=>cc8(t))}}function cc8(e){return{...e,body:lc8(e.body)}}function lc8(e){switch(e.type){case"inlinedBody":return ot.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:m5(t.valueType)}))});case"reference":return ot.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:m5(e.bodyType)})}}function fc8(e){return e.map(t=>dc8(t))}function dc8(e){return{...e,headers:e.headers.map(t=>fvo(t)),payload:pc8(e.payload)}}function pc8(e){switch(e.type){case"reference":return ot.V44.webhooks.WebhookPayload.reference({...e,payloadType:m5(e.payloadType)});case"inlinedPayload":return ot.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:m5(t.valueType)}))})}}function _c8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V44.auth.AuthScheme.basic(t);case"bearer":return ot.V44.auth.AuthScheme.bearer(t);case"header":return ot.V44.auth.AuthScheme.header(hc8(t));case"oauth":return ot.V44.auth.AuthScheme.oauth(yc8(t))}})}}function hc8(e){return{...e,valueType:m5(e.valueType)}}function yc8(e){return{...e,configuration:ot.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:vc8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?bc8(e.configuration.refreshEndpoint):void 0})}}function vc8(e){return{...e,requestProperties:{clientId:PGc(e.requestProperties.clientId),clientSecret:PGc(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?PGc(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Zbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Zbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Zbi(e.responseProperties.refreshToken):void 0}}}function bc8(e){return{...e,requestProperties:{refreshToken:PGc(e.requestProperties.refreshToken)},responseProperties:{accessToken:Zbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Zbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Zbi(e.responseProperties.refreshToken):void 0}}}function fvo(e){return{...e,valueType:m5(e.valueType)}}function m5(e){return ot.V45.types.TypeReference._visit(e,{container:t=>ot.V44.types.TypeReference.container(kD1(t)),primitive:t=>t.v1==="BIG_INTEGER"?ot.V44.types.TypeReference.primitive(ot.V44.types.PrimitiveType.String):ot.V44.types.TypeReference.primitive(t.v1),named:ot.V44.types.TypeReference.named,unknown:ot.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function kD1(e){return ot.V45.types.ContainerType._visit(e,{list:t=>ot.V44.types.ContainerType.list(m5(t)),optional:t=>ot.V44.types.ContainerType.optional(m5(t)),set:t=>ot.V44.types.ContainerType.set(m5(t)),map:({keyType:t,valueType:r})=>ot.V44.types.ContainerType.map({keyType:m5(t),valueType:m5(r)}),literal:ot.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function gc8(e){return{...e,shape:mc8(e.shape)}}function mc8(e){return ot.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:m5(t.type)}),noProperties:ot.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function Oc8(e){return ot.V45.types.ResolvedTypeReference._visit(e,{container:t=>ot.V44.types.ResolvedTypeReference.container(kD1(t)),named:ot.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?ot.V44.types.ResolvedTypeReference.primitive(ot.V44.types.PrimitiveType.String):ot.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:ot.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function Ac8(e){return{members:e.members.map(t=>({...t,type:m5(t.type)}))}}function Pc8(e){return{...e,pathParameters:e.pathParameters.map(t=>Kyu(t)),headers:e.headers.map(t=>fvo(t)),endpoints:e.endpoints.map(t=>jc8(t))}}function Kyu(e){return{...e,valueType:m5(e.valueType)}}function wc8(e){return{...e,type:m5(e.type)}}function jc8(e){return{...e,pagination:e.pagination!=null?Ic8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Kyu(t)),pathParameters:e.pathParameters.map(t=>Kyu(t)),sdkRequest:e.sdkRequest!=null?qc8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?Rc8(e.requestBody):void 0,response:e.response!=null?Ec8(e.response):void 0,headers:e.headers.map(t=>fvo(t)),queryParameters:e.queryParameters.map(t=>$yu(t))}}function Ec8(e){return{...e,body:e.body!=null?Sc8(e.body):void 0}}function Sc8(e){switch(e.type){case"json":return ot.V44.http.HttpResponseBody.json(Dc8(e.value));case"fileDownload":return ot.V44.http.HttpResponseBody.fileDownload(e);case"text":return ot.V44.http.HttpResponseBody.text(e);case"streaming":return ot.V44.http.HttpResponseBody.streaming(Cc8(e.value))}}function Dc8(e){switch(e.type){case"response":return ot.V44.http.JsonResponse.response({...e,responseBodyType:m5(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:m5(e.responseBodyType),responseProperty:e.responseProperty!=null?Oc_(e.responseProperty):void 0})}}function Cc8(e){switch(e.type){case"json":return ot.V44.http.StreamingResponse.json({...e,payload:m5(e.payload)});case"text":return ot.V44.http.StreamingResponse.text(e);case"sse":return ot.V44.http.StreamingResponse.sse({...e,payload:m5(e.payload)})}}function Ic8(e){switch(e.type){case"cursor":return ot.V44.http.Pagination.cursor(Mc8(e));case"offset":return ot.V44.http.Pagination.offset(Bc8(e))}}function Mc8(e){return{...e,page:$yu(e.page),next:Zbi(e.next),results:Zbi(e.results)}}function Bc8(e){return{...e,page:$yu(e.page),results:Zbi(e.results)}}function PGc(e){return{...e,property:Tc8(e.property)}}function Tc8(e){switch(e.type){case"query":return ot.V44.RequestPropertyValue.query($yu(e));case"body":return ot.V44.RequestPropertyValue.body(Oc_(e))}}function Zbi(e){return{...e,property:Oc_(e.property)}}function Oc_(e){return{...e,valueType:m5(e.valueType)}}function $yu(e){return{...e,valueType:m5(e.valueType)}}function qc8(e){return{...e,shape:xc8(e.shape)}}function xc8(e){return ot.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V44.http.SdkRequestShape.justRequestBody(Nc8(t)),wrapper:ot.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Nc8(e){switch(e.type){case"bytes":return ot.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:m5(e.requestBodyType)})}}function Rc8(e){return ot.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:m5(r.valueType)}))}),reference:t=>ot.V44.http.HttpRequestBody.reference({...t,requestBodyType:m5(t.requestBodyType)}),fileUpload:t=>ot.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:m5(r.valueType)});case"file":return ot.V44.http.FileUploadRequestProperty.file(Fc8(r.value))}})}),bytes:t=>ot.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Fc8(e){switch(e.type){case"file":return ot.V44.http.FileProperty.file(e);case"fileArray":return ot.V44.http.FileProperty.fileArray(e)}}function zc8(e){return{...e,type:e.type!=null?m5(e.type):void 0}}var tC1={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.21.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.21.0",[ye.TYPESCRIPT_EXPRESS]:"0.16.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"0.9.0",[ye.JAVA_SDK]:"0.10.0",[ye.JAVA_SPRING]:"0.9.0",[ye.PYTHON_FASTAPI]:"0.10.1",[ye.PYTHON_PYDANTIC]:"0.9.1",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"2.9.9",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:Qc8(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>({...n,examples:Lc8(n.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:Uc8(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(n=>({...n,shape:tee(n.shape)}))}]))})};function tee(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.list(r.map(n=>tee(n)))),set:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.set(r.map(n=>tee(n)))),map:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.map(r.map(n=>({key:tee(n.key),value:tee(n.value)})))),optional:r=>ot.V45.ExampleTypeReferenceShape.container(ot.V45.ExampleContainer.optional(r!=null?tee(r):void 0)),literal:r=>ot.V45.ExampleTypeReferenceShape.primitive(r._visit({string:n=>ot.V45.ExamplePrimitive.string(n),integer:n=>ot.V45.ExamplePrimitive.integer(n),double:n=>ot.V45.ExamplePrimitive.double(n),long:n=>ot.V45.ExamplePrimitive.long(n),boolean:n=>ot.V45.ExamplePrimitive.boolean(n),datetime:n=>ot.V45.ExamplePrimitive.datetime(n),date:n=>ot.V45.ExamplePrimitive.date(n),uuid:n=>ot.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:ot.V45.ExampleTypeReferenceShape.named({...t,shape:rC1(t.shape)})}),primitive:t=>({...e,shape:ot.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>ot.V45.ExamplePrimitive.string(r),integer:r=>ot.V45.ExamplePrimitive.integer(r),double:r=>ot.V45.ExamplePrimitive.double(r),long:r=>ot.V45.ExamplePrimitive.long(r),boolean:r=>ot.V45.ExamplePrimitive.boolean(r),datetime:r=>ot.V45.ExamplePrimitive.datetime(r),date:r=>ot.V45.ExamplePrimitive.date(r),uuid:r=>ot.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:ot.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function eC1(e){return{...e,properties:e.properties.map(t=>({...t,value:tee(t.value)}))}}function rC1(e){return e.type==="alias"?ot.V45.ExampleTypeShape.alias({value:tee(e.value)}):e.type==="object"?ot.V45.ExampleTypeShape.object(eC1(e)):e.type==="union"?ot.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>ot.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:eC1(t.object)}),singleProperty:t=>ot.V45.ExampleSingleUnionTypeProperties.singleProperty(tee(t)),noProperties:()=>ot.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?ot.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:tee(e.singleUnionType)}):ot.V45.ExampleTypeShape.enum(e)}function Qc8(e){return e.map(t=>({...t,shape:rC1(t.shape)}))}function wGc(e){return e.map(t=>({...t,value:tee(t.value)}))}function Ac_(e){return e.map(t=>({...t,value:tee(t.value)}))}function nC1(e){return e.map(t=>({...t,value:tee(t.value)}))}function Lc8(e){return e.map(t=>{let r={...t,rootPathParameters:wGc(t.rootPathParameters),servicePathParameters:wGc(t.servicePathParameters),endpointPathParameters:wGc(t.endpointPathParameters),serviceHeaders:Ac_(t.serviceHeaders),endpointHeaders:Ac_(t.endpointHeaders),queryParameters:nC1(t.queryParameters),request:t.request?._visit({inlinedRequestBody:n=>ot.V45.ExampleRequestBody.inlinedRequestBody({...n,properties:n.properties.map(i=>({...i,value:tee(i.value)}))}),reference:n=>ot.V45.ExampleRequestBody.reference(tee(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}}),response:t.response._visit({ok:n=>ot.V45.ExampleResponse.ok(n._visit({body:i=>ot.V45.ExampleEndpointSuccessResponse.body(i!=null?tee(i):void 0),stream:i=>ot.V45.ExampleEndpointSuccessResponse.stream(i.map(tee)),sse:i=>ot.V45.ExampleEndpointSuccessResponse.sse(i.map(a=>({...a,data:tee(a.data)}))),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),error:n=>ot.V45.ExampleResponse.error({...n,body:n.body!=null?tee(n.body):void 0}),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})};return t._visit({userProvided:()=>ot.V45.HttpEndpointExample.userProvided(r),generated:()=>ot.V45.HttpEndpointExample.generated(r),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})})}function Uc8(e){return e.map(t=>({...t,pathParameters:wGc(t.pathParameters),headers:Ac_(t.headers),queryParameters:nC1(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:n=>ot.V45.ExampleWebSocketMessageBody.inlinedBody({...n,properties:n.properties.map(i=>({...i,value:tee(i.value)}))}),reference:n=>ot.V45.ExampleWebSocketMessageBody.reference(tee(n)),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})}))}))}var iC1={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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:u,...c}=i;return{...c,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...i.userSpecifiedExamples.map(s=>{if(s.example!=null)return ot.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(GP),...i.autogeneratedExamples.map(s=>ot.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:n}]}))})};var aC1={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.29.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.29.0",[ye.TYPESCRIPT_EXPRESS]:"0.17.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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?Wc8(a.pagination):void 0}));return[r,{...n,endpoints:i}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:Vc8(t)},services:t}}};function Vc8(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function Wc8(e){switch(e.type){case"cursor":{let t=Hc8(e);return t!=null?ot.V47.Pagination.cursor(t):void 0}case"offset":{let t=Gc8(e);return t!=null?ot.V47.Pagination.offset(t):void 0}default:cc(e)}}function Hc8(e){let t=oC1(e.page);if(t!=null)return{...e,page:t}}function Gc8(e){if(e.step!=null)return;let t=oC1(e.page);if(t!=null)return{...e,page:t}}function oC1(e){switch(e.property.type){case"query":return e.property}}var uC1={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:"0.11.0-rc0",[ye.PYTHON_PYDANTIC]:"0.10.0-rc0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:"2.11.0-rc0",[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:Qn,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.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 u;return a.response?.body!=null&&(u=a.response.body?._visit({json:p=>ot.V48.HttpResponseBody.json({...p}),fileDownload:p=>ot.V48.HttpResponseBody.fileDownload({...p}),text:p=>ot.V48.HttpResponseBody.text({...p}),streaming:p=>ot.V48.HttpResponseBody.streaming({...p}),streamParameter:()=>{},_other:()=>{}}),u==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:u}}});return[r,{...n,endpoints:i}]}));return{...e,services:t}}};var sC1={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.34.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:"0.34.0",[ye.TYPESCRIPT_EXPRESS]:"0.17.2",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:"0.0.0",[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Rb(e.types,r=>({...r,shape:ot.V50.types.Type._visit(r.shape,{union:n=>ot.V49.types.Type.union({...n,baseProperties:n.baseProperties.map(i=>({...i,valueType:O5(i.valueType)})),types:n.types.map(i=>il8(i))}),enum:ot.V49.types.Type.enum,object:n=>ot.V49.types.Type.object({...n,properties:n.properties.map(i=>({...i,valueType:O5(i.valueType)}))}),alias:n=>ot.V49.types.Type.alias({aliasOf:O5(n.aliasOf),resolvedType:ol8(n.resolvedType)}),undiscriminatedUnion:n=>ot.V49.types.Type.undiscriminatedUnion(ul8(n)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:kc8(e.auth),headers:e.headers.map(r=>dvo(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>dvo(r)),types:t,services:Rb(e.services,r=>sl8(r)),errors:Rb(e.errors,r=>wl8(r)),webhookGroups:Rb(e.webhookGroups,r=>Yc8(r)),websocketChannels:Rb(e.websocketChannels,r=>Jc8(r)),pathParameters:e.pathParameters.map(r=>Yyu(r)),variables:e.variables.map(r=>cl8(r))}}};function Jc8(e){return{...e,headers:e.headers.map(t=>dvo(t)),queryParameters:e.queryParameters.map(t=>wc_(t)),pathParameters:e.pathParameters.map(t=>Yyu(t)),messages:e.messages.map(t=>Kc8(t))}}function Kc8(e){return{...e,body:$c8(e.body)}}function $c8(e){switch(e.type){case"inlinedBody":return ot.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:O5(t.valueType)}))});case"reference":return ot.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:O5(e.bodyType)})}}function Yc8(e){return e.map(t=>Xc8(t))}function Xc8(e){return{...e,headers:e.headers.map(t=>dvo(t)),payload:Zc8(e.payload)}}function Zc8(e){switch(e.type){case"reference":return ot.V49.webhooks.WebhookPayload.reference({...e,payloadType:O5(e.payloadType)});case"inlinedPayload":return ot.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:O5(t.valueType)}))})}}function kc8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V49.auth.AuthScheme.basic(t);case"bearer":return ot.V49.auth.AuthScheme.bearer(t);case"header":return ot.V49.auth.AuthScheme.header(el8(t));case"oauth":return ot.V49.auth.AuthScheme.oauth(tl8(t))}})}}function el8(e){return{...e,valueType:O5(e.valueType)}}function tl8(e){return{...e,configuration:ot.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:rl8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?nl8(e.configuration.refreshEndpoint):void 0})}}function rl8(e){return{...e,requestProperties:{clientId:V7i(e.requestProperties.clientId),clientSecret:V7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?V7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:kbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?kbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?kbi(e.responseProperties.refreshToken):void 0}}}function nl8(e){return{...e,requestProperties:{refreshToken:V7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:kbi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?kbi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?kbi(e.responseProperties.refreshToken):void 0}}}function dvo(e){return{...e,valueType:O5(e.valueType)}}function O5(e){return ot.V50.types.TypeReference._visit(e,{container:t=>ot.V49.types.TypeReference.container(cC1(t)),primitive:t=>t.v2?.type==="integer"?ot.V49.types.TypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?ot.V49.types.TypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?ot.V49.types.TypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.string(t.v2)}):ot.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:ot.V49.types.TypeReference.named,unknown:ot.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function cC1(e){return ot.V50.types.ContainerType._visit(e,{list:t=>ot.V49.types.ContainerType.list(O5(t)),optional:t=>ot.V49.types.ContainerType.optional(O5(t)),set:t=>ot.V49.types.ContainerType.set(O5(t)),map:({keyType:t,valueType:r})=>ot.V49.types.ContainerType.map({keyType:O5(t),valueType:O5(r)}),literal:ot.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function il8(e){return{...e,shape:al8(e.shape)}}function al8(e){return ot.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:O5(t.type)}),noProperties:ot.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function ol8(e){return ot.V50.types.ResolvedTypeReference._visit(e,{container:t=>ot.V49.types.ResolvedTypeReference.container(cC1(t)),named:ot.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:ot.V49.types.PrimitiveTypeV2.string(t.v2)}):ot.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:ot.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function ul8(e){return{members:e.members.map(t=>({...t,type:O5(t.type)}))}}function sl8(e){return{...e,pathParameters:e.pathParameters.map(t=>Yyu(t)),headers:e.headers.map(t=>dvo(t)),endpoints:e.endpoints.map(t=>ll8(t))}}function Yyu(e){return{...e,valueType:O5(e.valueType)}}function cl8(e){return{...e,type:O5(e.type)}}function ll8(e){return{...e,pagination:e.pagination!=null?hl8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Yyu(t)),pathParameters:e.pathParameters.map(t=>Yyu(t)),sdkRequest:e.sdkRequest!=null?gl8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?Al8(e.requestBody):void 0,response:e.response!=null?fl8(e.response):void 0,headers:e.headers.map(t=>dvo(t)),queryParameters:e.queryParameters.map(t=>wc_(t))}}function fl8(e){return{...e,body:e.body!=null?dl8(e.body):void 0}}function dl8(e){switch(e.type){case"json":return ot.V49.http.HttpResponseBody.json(lC1(e.value));case"fileDownload":return ot.V49.http.HttpResponseBody.fileDownload(e);case"text":return ot.V49.http.HttpResponseBody.text(e);case"streaming":return ot.V49.http.HttpResponseBody.streaming(fC1(e.value));case"streamParameter":return ot.V49.http.HttpResponseBody.streamParameter(_l8(e))}}function lC1(e){switch(e.type){case"response":return ot.V49.http.JsonResponse.response({...e,responseBodyType:O5(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:O5(e.responseBodyType),responseProperty:e.responseProperty!=null?Pc_(e.responseProperty):void 0})}}function fC1(e){switch(e.type){case"json":return ot.V49.http.StreamingResponse.json({...e,payload:O5(e.payload)});case"text":return ot.V49.http.StreamingResponse.text(e);case"sse":return ot.V49.http.StreamingResponse.sse({...e,payload:O5(e.payload)})}}function pl8(e){switch(e.type){case"json":return ot.V49.http.NonStreamHttpResponseBody.json(lC1(e.value));case"text":return ot.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function _l8(e){return{nonStreamResponse:pl8(e.nonStreamResponse),streamResponse:fC1(e.streamResponse)}}function hl8(e){switch(e.type){case"cursor":return ot.V49.http.Pagination.cursor(yl8(e));case"offset":return ot.V49.http.Pagination.offset(vl8(e))}}function yl8(e){return{...e,page:V7i(e.page),next:kbi(e.next),results:kbi(e.results)}}function vl8(e){return{...e,page:V7i(e.page),results:kbi(e.results),step:e.step!=null?V7i(e.step):void 0}}function V7i(e){return{...e,property:bl8(e.property)}}function bl8(e){switch(e.type){case"query":return ot.V49.RequestPropertyValue.query(wc_(e));case"body":return ot.V49.RequestPropertyValue.body(Pc_(e))}}function kbi(e){return{...e,property:Pc_(e.property)}}function Pc_(e){return{...e,valueType:O5(e.valueType)}}function wc_(e){return{...e,valueType:O5(e.valueType)}}function gl8(e){return{...e,streamParameter:e.streamParameter!=null?V7i(e.streamParameter):void 0,shape:ml8(e.shape)}}function ml8(e){return ot.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V49.http.SdkRequestShape.justRequestBody(Ol8(t)),wrapper:ot.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Ol8(e){switch(e.type){case"bytes":return ot.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:O5(e.requestBodyType)})}}function Al8(e){return ot.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:O5(r.valueType)}))}),reference:t=>ot.V49.http.HttpRequestBody.reference({...t,requestBodyType:O5(t.requestBodyType)}),fileUpload:t=>ot.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:O5(r.valueType)});case"file":return ot.V49.http.FileUploadRequestProperty.file(Pl8(r.value))}})}),bytes:t=>ot.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Pl8(e){switch(e.type){case"file":return ot.V49.http.FileProperty.file(e);case"fileArray":return ot.V49.http.FileProperty.fileArray(e)}}function wl8(e){return{...e,type:e.type!=null?O5(e.type):void 0}}var _C1={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"0.1.2",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Rb(e.types,r=>{let n=r.autogeneratedExamples.map(a=>dC1(a)),i=r.userProvidedExamples.map(a=>dC1(a));return{...r,examples:[...n,...i]}});return{...e,types:t,services:Rb(e.services,r=>xl8(r)),errors:Rb(e.errors,r=>Ql8(r)),webhookGroups:Rb(e.webhookGroups,r=>Dl8(r)),websocketChannels:Rb(e.websocketChannels,r=>jl8(r))}}};function jl8(e){return{...e,examples:e.examples.map(t=>El8(t))}}function El8(e){return{...e,pathParameters:e.pathParameters.map(t=>jGc(t)),headers:e.headers.map(t=>jc_(t)),queryParameters:e.queryParameters.map(t=>hC1(t)),messages:e.messages.map(t=>({...t,body:Sl8(t.body)}))}}function hC1(e){return{...e,value:Vue(e.value)}}function jc_(e){return{...e,value:Vue(e.value)}}function jGc(e){return{...e,value:Vue(e.value)}}function Sl8(e){switch(e.type){case"inlinedBody":return ot.V50.ExampleWebSocketMessageBody.inlinedBody(yC1(e));case"reference":return ot.V50.ExampleWebSocketMessageBody.reference(Vue(e))}}function yC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Vue(t.value)}))}}function Dl8(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:Vue(r.payload)}))}))}function dC1(e){return{...e,shape:vC1(e.shape)}}function Ec_(e){switch(e.type){case"primitive":return ot.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return ot.V50.ExampleTypeReferenceShape.container(Cl8(e));case"unknown":return ot.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:vC1(e.shape)})}}function Cl8(e){switch(e.container.type){case"list":return ot.V50.ExampleContainer.list(e.container.list.map(t=>Vue(t)));case"set":return ot.V50.ExampleContainer.set(e.container.set.map(t=>Vue(t)));case"optional":return ot.V50.ExampleContainer.optional(e.container.optional!=null?Vue(e.container.optional):void 0);case"map":return ot.V50.ExampleContainer.map(e.container.map.map(t=>({key:Vue(t.key),value:Vue(t.value)})));case"literal":return ot.V50.ExampleContainer.literal(e.container.literal)}}function Vue(e){return{...e,shape:Ec_(e.shape)}}function vC1(e){switch(e.type){case"object":return ot.V50.ExampleTypeShape.object({properties:e.properties.map(t=>bC1(t))});case"alias":return ot.V50.ExampleTypeShape.alias({value:{...Vue(e.value)}});case"enum":return ot.V50.ExampleTypeShape.enum(e);case"union":return ot.V50.ExampleTypeShape.union(Ml8(e));case"undiscriminatedUnion":return ot.V50.ExampleTypeShape.undiscriminatedUnion(Il8(e))}}function Il8(e){return{...e,singleUnionType:Vue(e.singleUnionType)}}function Ml8(e){return{...e,singleUnionType:Bl8(e.singleUnionType)}}function Bl8(e){return{...e,shape:Tl8(e.shape)}}function Tl8(e){switch(e.type){case"samePropertiesAsObject":return ot.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:ql8(e.object)});case"singleProperty":return ot.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Ec_(e.shape)});case"noProperties":return ot.V50.ExampleSingleUnionTypeProperties.noProperties()}}function ql8(e){return{...e,properties:e.properties.map(t=>bC1(t))}}function bC1(e){return{...e,value:{...e.value,shape:Ec_(e.value.shape)}}}function xl8(e){return{...e,endpoints:e.endpoints.map(t=>Nl8(t))}}function Nl8(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:pC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?pC1(t.example):void 0}))}}function pC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>jGc(t)),servicePathParameters:e.servicePathParameters.map(t=>jGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>jGc(t)),serviceHeaders:e.serviceHeaders.map(t=>jc_(t)),endpointHeaders:e.endpointHeaders.map(t=>jc_(t)),queryParameters:e.queryParameters.map(t=>hC1(t)),request:e.request!=null?zl8(e.request):void 0,response:Rl8(e.response)}}function Rl8(e){switch(e.type){case"error":return ot.V50.ExampleResponse.error({...e,body:e.body!=null?Vue(e.body):void 0});case"ok":return ot.V50.ExampleResponse.ok(Fl8(e))}}function Fl8(e){switch(e.value.type){case"body":return ot.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?Vue(e.value.value):void 0);case"stream":return ot.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Vue(t)));case"sse":return ot.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Vue(t.data)})))}}function zl8(e){switch(e.type){case"inlinedRequestBody":return ot.V50.ExampleRequestBody.inlinedRequestBody(yC1(e));case"reference":return ot.V50.ExampleRequestBody.reference(Vue(e))}}function Ql8(e){return{...e,examples:e.examples.map(t=>({...t,shape:Vue(t.shape)}))}}var OC1={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:Qn,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Ul8(e.apiVersion):void 0,auth:Yl8(e.auth),headers:e.headers.map(t=>eSa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>eSa(t)),types:Ll8(e.types),services:Rb(e.services,t=>uf8(t)),webhookGroups:Rb(e.webhookGroups,t=>Gl8(t)),websocketChannels:Rb(e.websocketChannels,t=>Vl8(t)),errors:Rb(e.errors,t=>Pf8(t)),pathParameters:e.pathParameters.map(t=>Xyu(t)),variables:e.variables.map(t=>sf8(t))})};function Ll8(e){return Rb(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>gC1(r)),userProvidedExamples:t.userProvidedExamples.map(r=>gC1(r)),shape:ot.V52.types.Type._visit(t.shape,{union:r=>ot.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:L4(n.valueType)})),types:r.types.map(n=>nf8(n))}),enum:ot.V51.types.Type.enum,object:r=>ot.V51.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:L4(n.valueType)}))}),alias:r=>ot.V51.types.Type.alias({aliasOf:L4(r.aliasOf),resolvedType:af8(r.resolvedType)}),undiscriminatedUnion:r=>ot.V51.types.Type.undiscriminatedUnion(of8(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Ul8(e){return ot.V51.ApiVersionScheme.header({...e,header:eSa(e.header)})}function Vl8(e){return{...e,headers:e.headers.map(t=>eSa(t)),queryParameters:e.queryParameters.map(t=>Cc_(t)),pathParameters:e.pathParameters.map(t=>Xyu(t)),messages:e.messages.map(t=>Wl8(t)),examples:e.examples.map(t=>wf8(t))}}function Wl8(e){return{...e,body:Hl8(e.body)}}function Hl8(e){switch(e.type){case"inlinedBody":return ot.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:L4(t.valueType)}))});case"reference":return ot.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:L4(e.bodyType)})}}function Gl8(e){return e.map(t=>Jl8(t))}function Jl8(e){return{...e,headers:e.headers.map(t=>eSa(t)),payload:Kl8(e.payload),examples:e.examples!=null?e.examples.map(t=>$l8(t)):void 0}}function Kl8(e){switch(e.type){case"reference":return ot.V51.webhooks.WebhookPayload.reference({...e,payloadType:L4(e.payloadType)});case"inlinedPayload":return ot.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:L4(t.valueType)}))})}}function $l8(e){return{...e,payload:Wue(e.payload)}}function Yl8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V51.auth.AuthScheme.basic(t);case"bearer":return ot.V51.auth.AuthScheme.bearer(t);case"header":return ot.V51.auth.AuthScheme.header(Xl8(t));case"oauth":return ot.V51.auth.AuthScheme.oauth(Zl8(t))}})}}function Xl8(e){return{...e,valueType:L4(e.valueType)}}function Zl8(e){return{...e,configuration:ot.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:kl8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?ef8(e.configuration.refreshEndpoint):void 0})}}function kl8(e){return{...e,requestProperties:{clientId:W7i(e.requestProperties.clientId),clientSecret:W7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?W7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:egi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?egi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?egi(e.responseProperties.refreshToken):void 0}}}function ef8(e){return{...e,requestProperties:{refreshToken:W7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:egi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?egi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?egi(e.responseProperties.refreshToken):void 0}}}function eSa(e){return{...e,valueType:L4(e.valueType)}}function L4(e){return ot.V52.types.TypeReference._visit(e,{container:t=>ot.V51.types.TypeReference.container(PC1(t)),primitive:t=>ot.V51.types.TypeReference.primitive(AC1(t)),named:ot.V51.types.TypeReference.named,unknown:ot.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function AC1(e){return{v1:tf8(e.v1),v2:e.v2!=null?rf8(e.v2):void 0}}function tf8(e){switch(e){case"UINT":return ot.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return ot.V51.types.PrimitiveTypeV1.Long}return e}function rf8(e){switch(e.type){case"integer":return ot.V51.types.PrimitiveTypeV2.integer(e);case"double":return ot.V51.types.PrimitiveTypeV2.double(e);case"string":return ot.V51.types.PrimitiveTypeV2.string(e);case"boolean":return ot.V51.types.PrimitiveTypeV2.boolean(e);case"long":return ot.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return ot.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:cc(e)}}function PC1(e){return ot.V52.types.ContainerType._visit(e,{list:t=>ot.V51.types.ContainerType.list(L4(t)),optional:t=>ot.V51.types.ContainerType.optional(L4(t)),set:t=>ot.V51.types.ContainerType.set(L4(t)),map:({keyType:t,valueType:r})=>ot.V51.types.ContainerType.map({keyType:L4(t),valueType:L4(r)}),literal:ot.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function nf8(e){return{...e,shape:if8(e.shape)}}function if8(e){return ot.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:L4(t.type)}),noProperties:ot.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function af8(e){return ot.V52.types.ResolvedTypeReference._visit(e,{container:t=>ot.V51.types.ResolvedTypeReference.container(PC1(t)),named:ot.V51.types.ResolvedTypeReference.named,primitive:t=>ot.V51.types.ResolvedTypeReference.primitive(AC1(t)),unknown:ot.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function of8(e){return{members:e.members.map(t=>({...t,type:L4(t.type)}))}}function uf8(e){return{...e,pathParameters:e.pathParameters.map(t=>Xyu(t)),headers:e.headers.map(t=>eSa(t)),endpoints:e.endpoints.map(t=>cf8(t))}}function Xyu(e){return{...e,valueType:L4(e.valueType)}}function sf8(e){return{...e,type:L4(e.type)}}function cf8(e){return{...e,pagination:e.pagination!=null?_f8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Xyu(t)),pathParameters:e.pathParameters.map(t=>Xyu(t)),sdkRequest:e.sdkRequest!=null?bf8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?Of8(e.requestBody):void 0,response:e.response!=null?lf8(e.response):void 0,headers:e.headers.map(t=>eSa(t)),queryParameters:e.queryParameters.map(t=>Cc_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:mC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?mC1(t.example):void 0}))}}function lf8(e){return{...e,body:e.body!=null?ff8(e.body):void 0}}function ff8(e){switch(e.type){case"json":return ot.V51.http.HttpResponseBody.json(wC1(e.value));case"fileDownload":return ot.V51.http.HttpResponseBody.fileDownload(e);case"text":return ot.V51.http.HttpResponseBody.text(e);case"streaming":return ot.V51.http.HttpResponseBody.streaming(jC1(e.value));case"streamParameter":return ot.V51.http.HttpResponseBody.streamParameter(pf8(e))}}function wC1(e){switch(e.type){case"response":return ot.V51.http.JsonResponse.response({...e,responseBodyType:L4(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:L4(e.responseBodyType),responseProperty:e.responseProperty!=null?Dc_(e.responseProperty):void 0})}}function jC1(e){switch(e.type){case"json":return ot.V51.http.StreamingResponse.json({...e,payload:L4(e.payload)});case"text":return ot.V51.http.StreamingResponse.text(e);case"sse":return ot.V51.http.StreamingResponse.sse({...e,payload:L4(e.payload)})}}function df8(e){switch(e.type){case"json":return ot.V51.http.NonStreamHttpResponseBody.json(wC1(e.value));case"text":return ot.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function pf8(e){return{nonStreamResponse:df8(e.nonStreamResponse),streamResponse:jC1(e.streamResponse)}}function _f8(e){switch(e.type){case"cursor":return ot.V51.http.Pagination.cursor(hf8(e));case"offset":return ot.V51.http.Pagination.offset(yf8(e))}}function hf8(e){return{...e,page:W7i(e.page),next:egi(e.next),results:egi(e.results)}}function yf8(e){return{...e,page:W7i(e.page),results:egi(e.results),step:e.step!=null?W7i(e.step):void 0}}function W7i(e){return{...e,property:vf8(e.property)}}function vf8(e){switch(e.type){case"query":return ot.V51.RequestPropertyValue.query(Cc_(e));case"body":return ot.V51.RequestPropertyValue.body(Dc_(e))}}function egi(e){return{...e,property:Dc_(e.property)}}function Dc_(e){return{...e,valueType:L4(e.valueType)}}function Cc_(e){return{...e,valueType:L4(e.valueType)}}function bf8(e){return{...e,streamParameter:e.streamParameter!=null?W7i(e.streamParameter):void 0,shape:gf8(e.shape)}}function gf8(e){return ot.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V51.http.SdkRequestShape.justRequestBody(mf8(t)),wrapper:ot.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function mf8(e){switch(e.type){case"bytes":return ot.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:L4(e.requestBodyType)})}}function Of8(e){return ot.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:L4(r.valueType)}))}),reference:t=>ot.V51.http.HttpRequestBody.reference({...t,requestBodyType:L4(t.requestBodyType)}),fileUpload:t=>ot.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:L4(r.valueType)});case"file":return ot.V51.http.FileUploadRequestProperty.file(Af8(r.value))}})}),bytes:t=>ot.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Af8(e){switch(e.type){case"file":return ot.V51.http.FileProperty.file(e);case"fileArray":return ot.V51.http.FileProperty.fileArray(e)}}function Pf8(e){return{...e,type:e.type!=null?L4(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Wue(t.shape)}))}}function wf8(e){return{...e,pathParameters:e.pathParameters.map(t=>EGc(t)),headers:e.headers.map(t=>Sc_(t)),queryParameters:e.queryParameters.map(t=>EC1(t)),messages:e.messages.map(t=>({...t,body:jf8(t.body)}))}}function EC1(e){return{...e,value:Wue(e.value)}}function Sc_(e){return{...e,value:Wue(e.value)}}function EGc(e){return{...e,value:Wue(e.value)}}function jf8(e){switch(e.type){case"inlinedBody":return ot.V51.ExampleWebSocketMessageBody.inlinedBody(SC1(e));case"reference":return ot.V51.ExampleWebSocketMessageBody.reference(Wue(e))}}function SC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Wue(t.value)}))}}function gC1(e){return{...e,shape:CC1(e.shape)}}function Ic_(e){switch(e.type){case"primitive":return ot.V51.ExampleTypeReferenceShape.primitive(Ef8(e));case"container":return ot.V51.ExampleTypeReferenceShape.container(Sf8(e));case"unknown":return ot.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:CC1(e.shape)})}}function DC1(e){switch(e.type){case"integer":return ot.V51.ExamplePrimitive.integer(e.integer);case"uint":return ot.V51.ExamplePrimitive.integer(e.uint);case"uint64":return ot.V51.ExamplePrimitive.integer(e.uint64);case"double":return ot.V51.ExamplePrimitive.double(e.double);case"long":return ot.V51.ExamplePrimitive.long(e.long);case"boolean":return ot.V51.ExamplePrimitive.boolean(e.boolean);case"string":return ot.V51.ExamplePrimitive.string(e.string);case"date":return ot.V51.ExamplePrimitive.date(e.date);case"datetime":return ot.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return ot.V51.ExamplePrimitive.uuid(e.uuid)}}function Ef8(e){return DC1(e.primitive)}function Sf8(e){switch(e.container.type){case"list":return ot.V51.ExampleContainer.list({list:e.container.list.map(t=>Wue(t)),itemType:L4(e.container.itemType)});case"set":return ot.V51.ExampleContainer.set({set:e.container.set.map(t=>Wue(t)),itemType:L4(e.container.itemType)});case"optional":return ot.V51.ExampleContainer.optional({optional:e.container.optional!=null?Wue(e.container.optional):void 0,valueType:L4(e.container.valueType)});case"map":return ot.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:Wue(t.key),value:Wue(t.value)})),keyType:L4(e.container.keyType),valueType:L4(e.container.valueType)});case"literal":return ot.V51.ExampleContainer.literal({literal:DC1(e.container.literal)})}}function Wue(e){return{...e,shape:Ic_(e.shape)}}function CC1(e){switch(e.type){case"object":return ot.V51.ExampleTypeShape.object({properties:e.properties.map(t=>IC1(t))});case"alias":return ot.V51.ExampleTypeShape.alias({value:{...Wue(e.value)}});case"enum":return ot.V51.ExampleTypeShape.enum(e);case"union":return ot.V51.ExampleTypeShape.union(Cf8(e));case"undiscriminatedUnion":return ot.V51.ExampleTypeShape.undiscriminatedUnion(Df8(e))}}function Df8(e){return{...e,singleUnionType:Wue(e.singleUnionType)}}function Cf8(e){return{...e,singleUnionType:If8(e.singleUnionType)}}function If8(e){return{...e,shape:Mf8(e.shape)}}function Mf8(e){switch(e.type){case"samePropertiesAsObject":return ot.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Bf8(e.object)});case"singleProperty":return ot.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Ic_(e.shape)});case"noProperties":return ot.V51.ExampleSingleUnionTypeProperties.noProperties()}}function Bf8(e){return{...e,properties:e.properties.map(t=>IC1(t))}}function IC1(e){return{...e,value:{...e.value,shape:Ic_(e.value.shape)}}}function mC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>EGc(t)),servicePathParameters:e.servicePathParameters.map(t=>EGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>EGc(t)),serviceHeaders:e.serviceHeaders.map(t=>Sc_(t)),endpointHeaders:e.endpointHeaders.map(t=>Sc_(t)),queryParameters:e.queryParameters.map(t=>EC1(t)),request:e.request!=null?xf8(e.request):void 0,response:Tf8(e.response)}}function Tf8(e){switch(e.type){case"error":return ot.V51.ExampleResponse.error({...e,body:e.body!=null?Wue(e.body):void 0});case"ok":return ot.V51.ExampleResponse.ok(qf8(e))}}function qf8(e){switch(e.value.type){case"body":return ot.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?Wue(e.value.value):void 0);case"stream":return ot.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Wue(t)));case"sse":return ot.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Wue(t.data)})))}}function xf8(e){switch(e.type){case"inlinedRequestBody":return ot.V51.ExampleRequestBody.inlinedRequestBody(SC1(e));case"reference":return ot.V51.ExampleRequestBody.reference(Wue(e))}}var TC1={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[ye.TYPESCRIPT]:"0.38.0-rc0",[ye.TYPESCRIPT_SDK]:"0.38.0-rc0",[ye.TYPESCRIPT_EXPRESS]:"0.17.3",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.3.0",[ye.JAVA_SDK]:"2.5.0",[ye.JAVA_SPRING]:"1.3.0",[ye.PYTHON_FASTAPI]:"1.1.0-rc0",[ye.PYTHON_PYDANTIC]:"1.1.0-rc0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:"0.1.0",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:"0.2.0",[ye.PYTHON_SDK]:"3.3.0-rc0",[ye.GO_FIBER]:"0.23.5",[ye.GO_MODEL]:"0.23.5",[ye.GO_SDK]:"0.28.3",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"0.5.0",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:"0.1.0",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Rf8(e.apiVersion):void 0,auth:Hf8(e.auth),headers:e.headers.map(t=>tSa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>tSa(t)),types:Nf8(e.types),services:Rb(e.services,t=>rd8(t)),webhookGroups:Rb(e.webhookGroups,t=>Lf8(t)),websocketChannels:Rb(e.websocketChannels,t=>Ff8(t)),errors:Rb(e.errors,t=>bd8(t)),pathParameters:e.pathParameters.map(t=>Zyu(t)),variables:e.variables.map(t=>nd8(t))})};function Nf8(e){return Rb(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>MC1(r)),userProvidedExamples:t.userProvidedExamples.map(r=>MC1(r)),shape:ot.V53.types.Type._visit(t.shape,{union:r=>ot.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:U4(n.valueType)})),types:r.types.map(n=>Zf8(n))}),enum:ot.V52.types.Type.enum,object:r=>ot.V52.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:U4(n.valueType)}))}),alias:r=>ot.V52.types.Type.alias({aliasOf:U4(r.aliasOf),resolvedType:ed8(r.resolvedType)}),undiscriminatedUnion:r=>ot.V52.types.Type.undiscriminatedUnion(td8(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Rf8(e){return ot.V52.ApiVersionScheme.header({...e,header:tSa(e.header)})}function Ff8(e){return{...e,headers:e.headers.map(t=>tSa(t)),queryParameters:e.queryParameters.map(t=>Tc_(t)),pathParameters:e.pathParameters.map(t=>Zyu(t)),messages:e.messages.map(t=>zf8(t)),examples:e.examples.map(t=>gd8(t))}}function zf8(e){return{...e,body:Qf8(e.body)}}function Qf8(e){switch(e.type){case"inlinedBody":return ot.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:U4(t.valueType)}))});case"reference":return ot.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:U4(e.bodyType)})}}function Lf8(e){return e.map(t=>Uf8(t))}function Uf8(e){return{...e,headers:e.headers.map(t=>tSa(t)),payload:Vf8(e.payload),examples:e.examples!=null?e.examples.map(t=>Wf8(t)):void 0}}function Vf8(e){switch(e.type){case"reference":return ot.V52.webhooks.WebhookPayload.reference({...e,payloadType:U4(e.payloadType)});case"inlinedPayload":return ot.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:U4(t.valueType)}))})}}function Wf8(e){return{...e,payload:Hue(e.payload)}}function Hf8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V52.auth.AuthScheme.basic(t);case"bearer":return ot.V52.auth.AuthScheme.bearer(t);case"header":return ot.V52.auth.AuthScheme.header(Gf8(t));case"oauth":return ot.V52.auth.AuthScheme.oauth(Jf8(t))}})}}function Gf8(e){return{...e,valueType:U4(e.valueType)}}function Jf8(e){return{...e,configuration:ot.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:Kf8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?$f8(e.configuration.refreshEndpoint):void 0})}}function Kf8(e){return{...e,requestProperties:{clientId:H7i(e.requestProperties.clientId),clientSecret:H7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?H7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:tgi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?tgi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?tgi(e.responseProperties.refreshToken):void 0}}}function $f8(e){return{...e,requestProperties:{refreshToken:H7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:tgi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?tgi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?tgi(e.responseProperties.refreshToken):void 0}}}function tSa(e){return{...e,valueType:U4(e.valueType)}}function U4(e){return ot.V53.types.TypeReference._visit(e,{container:t=>ot.V52.types.TypeReference.container(xC1(t)),primitive:t=>ot.V52.types.TypeReference.primitive(qC1(t)),named:ot.V52.types.TypeReference.named,unknown:ot.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function qC1(e){return{v1:Yf8(e.v1),v2:e.v2!=null?Xf8(e.v2):void 0}}function Yf8(e){switch(e){case"FLOAT":return ot.V52.types.PrimitiveTypeV1.Double}return e}function Xf8(e){switch(e.type){case"integer":return ot.V52.types.PrimitiveTypeV2.integer(e);case"double":return ot.V52.types.PrimitiveTypeV2.double(e);case"string":return ot.V52.types.PrimitiveTypeV2.string(e);case"boolean":return ot.V52.types.PrimitiveTypeV2.boolean(e);case"long":return ot.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return ot.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return ot.V52.types.PrimitiveTypeV2.uint();case"uint64":return ot.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:cc(e)}}function xC1(e){return ot.V53.types.ContainerType._visit(e,{list:t=>ot.V52.types.ContainerType.list(U4(t)),optional:t=>ot.V52.types.ContainerType.optional(U4(t)),set:t=>ot.V52.types.ContainerType.set(U4(t)),map:({keyType:t,valueType:r})=>ot.V52.types.ContainerType.map({keyType:U4(t),valueType:U4(r)}),literal:ot.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function Zf8(e){return{...e,shape:kf8(e.shape)}}function kf8(e){return ot.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:U4(t.type)}),noProperties:ot.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function ed8(e){return ot.V53.types.ResolvedTypeReference._visit(e,{container:t=>ot.V52.types.ResolvedTypeReference.container(xC1(t)),named:ot.V52.types.ResolvedTypeReference.named,primitive:t=>ot.V52.types.ResolvedTypeReference.primitive(qC1(t)),unknown:ot.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function td8(e){return{members:e.members.map(t=>({...t,type:U4(t.type)}))}}function rd8(e){return{...e,pathParameters:e.pathParameters.map(t=>Zyu(t)),headers:e.headers.map(t=>tSa(t)),endpoints:e.endpoints.map(t=>id8(t))}}function Zyu(e){return{...e,valueType:U4(e.valueType)}}function nd8(e){return{...e,type:U4(e.type)}}function id8(e){return{...e,pagination:e.pagination!=null?cd8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>Zyu(t)),pathParameters:e.pathParameters.map(t=>Zyu(t)),sdkRequest:e.sdkRequest!=null?pd8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?yd8(e.requestBody):void 0,response:e.response!=null?ad8(e.response):void 0,headers:e.headers.map(t=>tSa(t)),queryParameters:e.queryParameters.map(t=>Tc_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:BC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?BC1(t.example):void 0}))}}function ad8(e){return{...e,body:e.body!=null?od8(e.body):void 0}}function od8(e){switch(e.type){case"json":return ot.V52.http.HttpResponseBody.json(NC1(e.value));case"fileDownload":return ot.V52.http.HttpResponseBody.fileDownload(e);case"text":return ot.V52.http.HttpResponseBody.text(e);case"streaming":return ot.V52.http.HttpResponseBody.streaming(RC1(e.value));case"streamParameter":return ot.V52.http.HttpResponseBody.streamParameter(sd8(e))}}function NC1(e){switch(e.type){case"response":return ot.V52.http.JsonResponse.response({...e,responseBodyType:U4(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:U4(e.responseBodyType),responseProperty:e.responseProperty!=null?Bc_(e.responseProperty):void 0})}}function RC1(e){switch(e.type){case"json":return ot.V52.http.StreamingResponse.json({...e,payload:U4(e.payload)});case"text":return ot.V52.http.StreamingResponse.text(e);case"sse":return ot.V52.http.StreamingResponse.sse({...e,payload:U4(e.payload)})}}function ud8(e){switch(e.type){case"json":return ot.V52.http.NonStreamHttpResponseBody.json(NC1(e.value));case"text":return ot.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function sd8(e){return{nonStreamResponse:ud8(e.nonStreamResponse),streamResponse:RC1(e.streamResponse)}}function cd8(e){switch(e.type){case"cursor":return ot.V52.http.Pagination.cursor(ld8(e));case"offset":return ot.V52.http.Pagination.offset(fd8(e))}}function ld8(e){return{...e,page:H7i(e.page),next:tgi(e.next),results:tgi(e.results)}}function fd8(e){return{...e,page:H7i(e.page),results:tgi(e.results),step:e.step!=null?H7i(e.step):void 0}}function H7i(e){return{...e,property:dd8(e.property)}}function dd8(e){switch(e.type){case"query":return ot.V52.RequestPropertyValue.query(Tc_(e));case"body":return ot.V52.RequestPropertyValue.body(Bc_(e))}}function tgi(e){return{...e,property:Bc_(e.property)}}function Bc_(e){return{...e,valueType:U4(e.valueType)}}function Tc_(e){return{...e,valueType:U4(e.valueType)}}function pd8(e){return{...e,streamParameter:e.streamParameter!=null?H7i(e.streamParameter):void 0,shape:_d8(e.shape)}}function _d8(e){return ot.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V52.http.SdkRequestShape.justRequestBody(hd8(t)),wrapper:ot.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function hd8(e){switch(e.type){case"bytes":return ot.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:U4(e.requestBodyType)})}}function yd8(e){return ot.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:U4(r.valueType)}))}),reference:t=>ot.V52.http.HttpRequestBody.reference({...t,requestBodyType:U4(t.requestBodyType)}),fileUpload:t=>ot.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:U4(r.valueType)});case"file":return ot.V52.http.FileUploadRequestProperty.file(vd8(r.value))}})}),bytes:t=>ot.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function vd8(e){switch(e.type){case"file":return ot.V52.http.FileProperty.file(e);case"fileArray":return ot.V52.http.FileProperty.fileArray(e)}}function bd8(e){return{...e,type:e.type!=null?U4(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Hue(t.shape)}))}}function gd8(e){return{...e,pathParameters:e.pathParameters.map(t=>SGc(t)),headers:e.headers.map(t=>Mc_(t)),queryParameters:e.queryParameters.map(t=>FC1(t)),messages:e.messages.map(t=>({...t,body:md8(t.body)}))}}function FC1(e){return{...e,value:Hue(e.value)}}function Mc_(e){return{...e,value:Hue(e.value)}}function SGc(e){return{...e,value:Hue(e.value)}}function md8(e){switch(e.type){case"inlinedBody":return ot.V52.ExampleWebSocketMessageBody.inlinedBody(zC1(e));case"reference":return ot.V52.ExampleWebSocketMessageBody.reference(Hue(e))}}function zC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Hue(t.value)}))}}function MC1(e){return{...e,shape:LC1(e.shape)}}function qc_(e){switch(e.type){case"primitive":return ot.V52.ExampleTypeReferenceShape.primitive(Od8(e));case"container":return ot.V52.ExampleTypeReferenceShape.container(Ad8(e));case"unknown":return ot.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:LC1(e.shape)})}}function QC1(e){switch(e.type){case"integer":return ot.V52.ExamplePrimitive.integer(e.integer);case"uint":return ot.V52.ExamplePrimitive.integer(e.uint);case"uint64":return ot.V52.ExamplePrimitive.integer(e.uint64);case"float":return ot.V52.ExamplePrimitive.double(e.float);case"double":return ot.V52.ExamplePrimitive.double(e.double);case"long":return ot.V52.ExamplePrimitive.long(e.long);case"boolean":return ot.V52.ExamplePrimitive.boolean(e.boolean);case"string":return ot.V52.ExamplePrimitive.string(e.string);case"date":return ot.V52.ExamplePrimitive.date(e.date);case"datetime":return ot.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return ot.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return ot.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return ot.V52.ExamplePrimitive.string({original:e.bigInteger})}}function Od8(e){return QC1(e.primitive)}function Ad8(e){switch(e.container.type){case"list":return ot.V52.ExampleContainer.list({list:e.container.list.map(t=>Hue(t)),itemType:U4(e.container.itemType)});case"set":return ot.V52.ExampleContainer.set({set:e.container.set.map(t=>Hue(t)),itemType:U4(e.container.itemType)});case"optional":return ot.V52.ExampleContainer.optional({optional:e.container.optional!=null?Hue(e.container.optional):void 0,valueType:U4(e.container.valueType)});case"map":return ot.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:Hue(t.key),value:Hue(t.value)})),keyType:U4(e.container.keyType),valueType:U4(e.container.valueType)});case"literal":return ot.V52.ExampleContainer.literal({literal:QC1(e.container.literal)})}}function Hue(e){return{...e,shape:qc_(e.shape)}}function LC1(e){switch(e.type){case"object":return ot.V52.ExampleTypeShape.object({properties:e.properties.map(t=>UC1(t))});case"alias":return ot.V52.ExampleTypeShape.alias({value:{...Hue(e.value)}});case"enum":return ot.V52.ExampleTypeShape.enum(e);case"union":return ot.V52.ExampleTypeShape.union(wd8(e));case"undiscriminatedUnion":return ot.V52.ExampleTypeShape.undiscriminatedUnion(Pd8(e))}}function Pd8(e){return{...e,singleUnionType:Hue(e.singleUnionType)}}function wd8(e){return{...e,singleUnionType:jd8(e.singleUnionType)}}function jd8(e){return{...e,shape:Ed8(e.shape)}}function Ed8(e){switch(e.type){case"samePropertiesAsObject":return ot.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Sd8(e.object)});case"singleProperty":return ot.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:qc_(e.shape)});case"noProperties":return ot.V52.ExampleSingleUnionTypeProperties.noProperties()}}function Sd8(e){return{...e,properties:e.properties.map(t=>UC1(t))}}function UC1(e){return{...e,value:{...e.value,shape:qc_(e.value.shape)}}}function BC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>SGc(t)),servicePathParameters:e.servicePathParameters.map(t=>SGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>SGc(t)),serviceHeaders:e.serviceHeaders.map(t=>Mc_(t)),endpointHeaders:e.endpointHeaders.map(t=>Mc_(t)),queryParameters:e.queryParameters.map(t=>FC1(t)),request:e.request!=null?Id8(e.request):void 0,response:Dd8(e.response)}}function Dd8(e){switch(e.type){case"error":return ot.V52.ExampleResponse.error({...e,body:e.body!=null?Hue(e.body):void 0});case"ok":return ot.V52.ExampleResponse.ok(Cd8(e))}}function Cd8(e){switch(e.value.type){case"body":return ot.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?Hue(e.value.value):void 0);case"stream":return ot.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Hue(t)));case"sse":return ot.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Hue(t.data)})))}}function Id8(e){switch(e.type){case"inlinedRequestBody":return ot.V52.ExampleRequestBody.inlinedRequestBody(zC1(e));case"reference":return ot.V52.ExampleRequestBody.reference(Hue(e))}}var VC1={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:xt,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Rb(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:Md8(r.response)}))}))})};function Md8(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?ot.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var GC1={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.47.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[ye.TYPESCRIPT]:"0.47.0",[ye.TYPESCRIPT_SDK]:"0.47.0",[ye.TYPESCRIPT_EXPRESS]:"0.17.7",[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.7.0",[ye.JAVA_SDK]:"2.16.0",[ye.JAVA_SPRING]:"1.5.0",[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"1.10.1",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:"0.3.2",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?Td8(e.apiVersion):void 0,auth:Ld8(e.auth),headers:e.headers.map(t=>rSa(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>rSa(t)),types:Bd8(e.types),services:Rb(e.services,t=>Yd8(t)),webhookGroups:Rb(e.webhookGroups,t=>Rd8(t)),websocketChannels:Rb(e.websocketChannels,t=>qd8(t)),errors:Rb(e.errors,t=>dp8(t)),pathParameters:e.pathParameters.map(t=>kyu(t)),variables:e.variables.map(t=>Xd8(t)),dynamic:e.dynamic!=null?jp8(e.dynamic):void 0})};function Bd8(e){return Rb(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>WC1(r)),userProvidedExamples:t.userProvidedExamples.map(r=>WC1(r)),shape:ot.V55.types.Type._visit(t.shape,{union:r=>ot.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(n=>({...n,valueType:NB(n.valueType)})),types:r.types.map(n=>Gd8(n))}),enum:ot.V54.types.Type.enum,object:r=>ot.V54.types.Type.object({...r,properties:r.properties.map(n=>({...n,valueType:NB(n.valueType)})),extendedProperties:r.extendedProperties?.map(n=>({...n,valueType:NB(n.valueType)}))}),alias:r=>ot.V54.types.Type.alias({aliasOf:NB(r.aliasOf),resolvedType:Kd8(r.resolvedType)}),undiscriminatedUnion:r=>ot.V54.types.Type.undiscriminatedUnion($d8(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function Td8(e){return ot.V54.ApiVersionScheme.header({...e,header:rSa(e.header)})}function qd8(e){return{...e,headers:e.headers.map(t=>rSa(t)),queryParameters:e.queryParameters.map(t=>Rc_(t)),pathParameters:e.pathParameters.map(t=>kyu(t)),messages:e.messages.map(t=>xd8(t)),examples:e.examples.map(t=>pp8(t))}}function xd8(e){return{...e,body:Nd8(e.body)}}function Nd8(e){switch(e.type){case"inlinedBody":return ot.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:NB(t.valueType)}))});case"reference":return ot.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:NB(e.bodyType)})}}function Rd8(e){return e.map(t=>Fd8(t))}function Fd8(e){return{...e,headers:e.headers.map(t=>rSa(t)),payload:zd8(e.payload),examples:e.examples!=null?e.examples.map(t=>Qd8(t)):void 0}}function zd8(e){switch(e.type){case"reference":return ot.V54.webhooks.WebhookPayload.reference({...e,payloadType:NB(e.payloadType)});case"inlinedPayload":return ot.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:NB(t.valueType)}))})}}function Qd8(e){return{...e,payload:Yne(e.payload)}}function Ld8(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return ot.V54.auth.AuthScheme.basic(t);case"bearer":return ot.V54.auth.AuthScheme.bearer(t);case"header":return ot.V54.auth.AuthScheme.header(Ud8(t));case"oauth":return ot.V54.auth.AuthScheme.oauth(Vd8(t))}})}}function Ud8(e){return{...e,valueType:NB(e.valueType)}}function Vd8(e){return{...e,configuration:ot.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:Wd8(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?Hd8(e.configuration.refreshEndpoint):void 0})}}function Wd8(e){return{...e,requestProperties:{clientId:G7i(e.requestProperties.clientId),clientSecret:G7i(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?G7i(e.requestProperties.scopes):void 0},responseProperties:{accessToken:gri(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?gri(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?gri(e.responseProperties.refreshToken):void 0}}}function Hd8(e){return{...e,requestProperties:{refreshToken:G7i(e.requestProperties.refreshToken)},responseProperties:{accessToken:gri(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?gri(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?gri(e.responseProperties.refreshToken):void 0}}}function rSa(e){return{...e,valueType:NB(e.valueType)}}function NB(e){return e.type==="container"&&e.container.type==="nullable"?Fp8(e.container.nullable):e.type==="container"&&e.container.type==="optional"?Rp8(e.container.optional):ot.V55.types.TypeReference._visit(e,{container:t=>ot.V54.types.TypeReference.container(KC1(t)),primitive:t=>ot.V54.types.TypeReference.primitive(JC1(t)),named:ot.V54.types.TypeReference.named,unknown:ot.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function JC1(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function KC1(e){return ot.V55.types.ContainerType._visit(e,{list:t=>ot.V54.types.ContainerType.list(NB(t)),optional:t=>ot.V54.types.ContainerType.optional(NB(t)),nullable:t=>ot.V54.types.ContainerType.optional(NB(t)),set:t=>ot.V54.types.ContainerType.set(NB(t)),map:({keyType:t,valueType:r})=>ot.V54.types.ContainerType.map({keyType:NB(t),valueType:NB(r)}),literal:ot.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function Gd8(e){return{...e,shape:Jd8(e.shape)}}function Jd8(e){return ot.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>ot.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>ot.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:NB(t.type)}),noProperties:ot.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function Kd8(e){return ot.V55.types.ResolvedTypeReference._visit(e,{container:t=>ot.V54.types.ResolvedTypeReference.container(KC1(t)),named:ot.V54.types.ResolvedTypeReference.named,primitive:t=>ot.V54.types.ResolvedTypeReference.primitive(JC1(t)),unknown:ot.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function $d8(e){return{members:e.members.map(t=>({...t,type:NB(t.type)}))}}function Yd8(e){return{...e,pathParameters:e.pathParameters.map(t=>kyu(t)),headers:e.headers.map(t=>rSa(t)),endpoints:e.endpoints.map(t=>Zd8(t))}}function kyu(e){return{...e,valueType:NB(e.valueType)}}function Xd8(e){return{...e,type:NB(e.type)}}function Zd8(e){return{...e,pagination:e.pagination!=null?np8(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>kyu(t)),pathParameters:e.pathParameters.map(t=>kyu(t)),sdkRequest:e.sdkRequest!=null?up8(e.sdkRequest):void 0,requestBody:e.requestBody!=null?lp8(e.requestBody):void 0,response:e.response!=null?kd8(e.response):void 0,headers:e.headers.map(t=>rSa(t)),queryParameters:e.queryParameters.map(t=>Rc_(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:HC1(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?HC1(t.example):void 0}))}}function kd8(e){return{...e,body:e.body!=null?ep8(e.body):void 0}}function ep8(e){switch(e.type){case"json":return ot.V54.http.HttpResponseBody.json($C1(e.value));case"fileDownload":return ot.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return ot.V54.http.HttpResponseBody.bytes(e);case"text":return ot.V54.http.HttpResponseBody.text(e);case"streaming":return ot.V54.http.HttpResponseBody.streaming(YC1(e.value));case"streamParameter":return ot.V54.http.HttpResponseBody.streamParameter(rp8(e));default:cc(e)}}function $C1(e){switch(e.type){case"response":return ot.V54.http.JsonResponse.response({...e,responseBodyType:NB(e.responseBodyType)});case"nestedPropertyAsResponse":return ot.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:NB(e.responseBodyType),responseProperty:e.responseProperty!=null?Nc_(e.responseProperty):void 0})}}function YC1(e){switch(e.type){case"json":return ot.V54.http.StreamingResponse.json({...e,payload:NB(e.payload)});case"text":return ot.V54.http.StreamingResponse.text(e);case"sse":return ot.V54.http.StreamingResponse.sse({...e,payload:NB(e.payload)})}}function tp8(e){switch(e.type){case"json":return ot.V54.http.NonStreamHttpResponseBody.json($C1(e.value));case"bytes":return ot.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return ot.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return ot.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:cc(e)}}function rp8(e){return{nonStreamResponse:tp8(e.nonStreamResponse),streamResponse:YC1(e.streamResponse)}}function np8(e){switch(e.type){case"cursor":return ot.V54.http.Pagination.cursor(ip8(e));case"offset":return ot.V54.http.Pagination.offset(ap8(e))}}function ip8(e){return{...e,page:G7i(e.page),next:gri(e.next),results:gri(e.results)}}function ap8(e){return{...e,page:G7i(e.page),results:gri(e.results),step:e.step!=null?G7i(e.step):void 0,hasNextPage:e.hasNextPage!=null?gri(e.hasNextPage):void 0}}function G7i(e){return{...e,property:op8(e.property)}}function op8(e){switch(e.type){case"query":return ot.V54.RequestPropertyValue.query(Rc_(e));case"body":return ot.V54.RequestPropertyValue.body(Nc_(e))}}function gri(e){return{...e,property:Nc_(e.property)}}function Nc_(e){return{...e,valueType:NB(e.valueType)}}function Rc_(e){return{...e,valueType:NB(e.valueType)}}function up8(e){return{...e,streamParameter:e.streamParameter!=null?G7i(e.streamParameter):void 0,shape:sp8(e.shape)}}function sp8(e){return ot.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>ot.V54.http.SdkRequestShape.justRequestBody(cp8(t)),wrapper:ot.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function cp8(e){switch(e.type){case"bytes":return ot.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return ot.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:NB(e.requestBodyType)})}}function lp8(e){return ot.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>ot.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:NB(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:NB(r.valueType)}))}),reference:t=>ot.V54.http.HttpRequestBody.reference({...t,requestBodyType:NB(t.requestBodyType)}),fileUpload:t=>ot.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return ot.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:NB(r.valueType)});case"file":return ot.V54.http.FileUploadRequestProperty.file(fp8(r.value))}})}),bytes:t=>ot.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function fp8(e){switch(e.type){case"file":return ot.V54.http.FileProperty.file(e);case"fileArray":return ot.V54.http.FileProperty.fileArray(e)}}function dp8(e){return{...e,type:e.type!=null?NB(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Yne(t.shape)}))}}function pp8(e){return{...e,pathParameters:e.pathParameters.map(t=>DGc(t)),headers:e.headers.map(t=>xc_(t)),queryParameters:e.queryParameters.map(t=>XC1(t)),messages:e.messages.map(t=>({...t,body:_p8(t.body)}))}}function XC1(e){return{...e,value:Yne(e.value)}}function xc_(e){return{...e,value:Yne(e.value)}}function DGc(e){return{...e,value:Yne(e.value)}}function _p8(e){switch(e.type){case"inlinedBody":return ot.V54.ExampleWebSocketMessageBody.inlinedBody(ZC1(e));case"reference":return ot.V54.ExampleWebSocketMessageBody.reference(Yne(e))}}function ZC1(e){return{...e,properties:e.properties.map(t=>({...t,value:Yne(t.value)}))}}function WC1(e){return{...e,shape:kC1(e.shape)}}function Fc_(e){switch(e.type){case"primitive":return ot.V54.ExampleTypeReferenceShape.primitive(hp8(e));case"container":return ot.V54.ExampleTypeReferenceShape.container(yp8(e));case"unknown":return ot.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return ot.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:kC1(e.shape)})}}function hp8(e){return e.primitive}function yp8(e){switch(e.container.type){case"list":return ot.V54.ExampleContainer.list({list:e.container.list.map(t=>Yne(t)),itemType:NB(e.container.itemType)});case"set":return ot.V54.ExampleContainer.set({set:e.container.set.map(t=>Yne(t)),itemType:NB(e.container.itemType)});case"optional":return ot.V54.ExampleContainer.optional({optional:e.container.optional!=null?Yne(e.container.optional):void 0,valueType:NB(e.container.valueType)});case"nullable":return ot.V54.ExampleContainer.optional({optional:e.container.nullable!=null?Yne(e.container.nullable):void 0,valueType:NB(e.container.valueType)});case"map":return ot.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:Yne(t.key),value:Yne(t.value)})),keyType:NB(e.container.keyType),valueType:NB(e.container.valueType)});case"literal":return ot.V54.ExampleContainer.literal({literal:e.container.literal})}}function Yne(e){return{...e,shape:Fc_(e.shape)}}function kC1(e){switch(e.type){case"object":return ot.V54.ExampleTypeShape.object({properties:e.properties.map(t=>eI1(t))});case"alias":return ot.V54.ExampleTypeShape.alias({value:{...Yne(e.value)}});case"enum":return ot.V54.ExampleTypeShape.enum(e);case"union":return ot.V54.ExampleTypeShape.union(bp8(e));case"undiscriminatedUnion":return ot.V54.ExampleTypeShape.undiscriminatedUnion(vp8(e))}}function vp8(e){return{...e,singleUnionType:Yne(e.singleUnionType)}}function bp8(e){return{...e,singleUnionType:gp8(e.singleUnionType)}}function gp8(e){return{...e,shape:mp8(e.shape)}}function mp8(e){switch(e.type){case"samePropertiesAsObject":return ot.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Op8(e.object)});case"singleProperty":return ot.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Fc_(e.shape)});case"noProperties":return ot.V54.ExampleSingleUnionTypeProperties.noProperties()}}function Op8(e){return{...e,properties:e.properties.map(t=>eI1(t))}}function eI1(e){return{...e,value:{...e.value,shape:Fc_(e.value.shape)}}}function HC1(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>DGc(t)),servicePathParameters:e.servicePathParameters.map(t=>DGc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>DGc(t)),serviceHeaders:e.serviceHeaders.map(t=>xc_(t)),endpointHeaders:e.endpointHeaders.map(t=>xc_(t)),queryParameters:e.queryParameters.map(t=>XC1(t)),request:e.request!=null?wp8(e.request):void 0,response:Ap8(e.response)}}function Ap8(e){switch(e.type){case"error":return ot.V54.ExampleResponse.error({...e,body:e.body!=null?Yne(e.body):void 0});case"ok":return ot.V54.ExampleResponse.ok(Pp8(e))}}function Pp8(e){switch(e.value.type){case"body":return ot.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?Yne(e.value.value):void 0);case"stream":return ot.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Yne(t)));case"sse":return ot.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Yne(t.data)})))}}function wp8(e){switch(e.type){case"inlinedRequestBody":return ot.V54.ExampleRequestBody.inlinedRequestBody(ZC1(e));case"reference":return ot.V54.ExampleRequestBody.reference(Yne(e))}}function jp8(e){return{...e,types:Rb(e.types,t=>Ep8(t)),endpoints:Rb(e.endpoints,t=>Sp8(t)),headers:e.headers?.map(t=>HPr(t))}}function Ep8(e){switch(e.type){case"alias":return ot.V54.dynamic.NamedType.alias({...e,typeReference:Tat(e.typeReference)});case"enum":return ot.V54.dynamic.NamedType.enum(e);case"object":return ot.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>HPr(t))});case"discriminatedUnion":return ot.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Cp8(r)]))});case"undiscriminatedUnion":return ot.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>Tat(t))});default:cc(e)}}function Sp8(e){return{...e,auth:e.auth!=null?Dp8(e.auth):void 0,request:Ip8(e.request)}}function Dp8(e){switch(e.type){case"basic":return ot.V54.dynamic.Auth.basic(e);case"bearer":return ot.V54.dynamic.Auth.bearer(e);case"header":return ot.V54.dynamic.Auth.header({header:HPr(e.header)})}}function Tat(e){switch(e.type){case"list":return ot.V54.dynamic.TypeReference.list(Tat(e.value));case"optional":return Qp8(e.value);case"nullable":return zp8(e.value);case"map":return ot.V54.dynamic.TypeReference.map({...e,key:Tat(e.key),value:Tat(e.value)});case"literal":return ot.V54.dynamic.TypeReference.literal(e.value);case"named":return ot.V54.dynamic.TypeReference.named(e.value);case"primitive":return ot.V54.dynamic.TypeReference.primitive(e.value);case"set":return ot.V54.dynamic.TypeReference.set(Tat(e.value));case"unknown":return ot.V54.dynamic.TypeReference.unknown();default:cc(e)}}function Cp8(e){switch(e.type){case"samePropertiesAsObject":return ot.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>HPr(t))});case"singleProperty":return ot.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:Tat(e.typeReference),properties:e.properties?.map(t=>HPr(t))});case"noProperties":return ot.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>HPr(t))});default:cc(e)}}function HPr(e){return{...e,typeReference:Tat(e.typeReference)}}function Ip8(e){switch(e.type){case"body":return ot.V54.dynamic.Request.body(Mp8(e));case"inlined":return ot.V54.dynamic.Request.inlined(Bp8(e));default:cc(e)}}function Mp8(e){return{pathParameters:e.pathParameters?.map(t=>HPr(t)),body:e.body!=null?tI1(e.body):void 0}}function Bp8(e){return{...e,pathParameters:e.pathParameters?.map(t=>HPr(t)),queryParameters:e.queryParameters?.map(t=>HPr(t)),headers:e.headers?.map(t=>HPr(t)),body:e.body!=null?Tp8(e.body):void 0}}function Tp8(e){switch(e.type){case"properties":return ot.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>HPr(t)));case"referenced":return ot.V54.dynamic.InlinedRequestBody.referenced(qp8(e));case"fileUpload":return ot.V54.dynamic.InlinedRequestBody.fileUpload(xp8(e));default:cc(e)}}function qp8(e){return{...e,bodyType:tI1(e.bodyType)}}function tI1(e){switch(e.type){case"bytes":return ot.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return ot.V54.dynamic.ReferencedRequestBodyType.typeReference(Tat(e.value));default:cc(e)}}function xp8(e){return{properties:e.properties.map(t=>Np8(t))}}function Np8(e){switch(e.type){case"file":return ot.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return ot.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return ot.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(HPr(e));default:cc(e)}}function Rp8(e){return e.type==="container"&&e.container.type==="nullable"?ot.V54.types.TypeReference.container(ot.V54.types.ContainerType.optional(NB(e.container.nullable))):ot.V54.types.TypeReference.container(ot.V54.types.ContainerType.optional(NB(e)))}function Fp8(e){return e.type==="container"&&e.container.type==="optional"?NB(e):ot.V54.types.TypeReference.container(ot.V54.types.ContainerType.optional(NB(e)))}function zp8(e){return e.type==="optional"?Tat(e):ot.V54.dynamic.TypeReference.optional(Tat(e))}function Qp8(e){return e.type==="nullable"?ot.V54.dynamic.TypeReference.optional(Tat(e.value)):ot.V54.dynamic.TypeReference.optional(Tat(e))}var rI1={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:xt,[ye.TYPESCRIPT_BROWSER_SDK]:xt,[ye.TYPESCRIPT]:xt,[ye.TYPESCRIPT_SDK]:xt,[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.PYTHON_SDK]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:"0.0.2",[ye.CSHARP_SDK]:"1.12.0-rc0",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:xt,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Rb(e.services,t=>Lp8(t))})};function Lp8(e){return{...e,endpoints:e.endpoints.map(t=>Up8(t))}}function Up8(e){return{...e,pagination:Vp8(e.pagination)}}function Vp8(e){if(e!=null)switch(e.type){case"cursor":return ot.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return ot.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:cc(e)}}var nI1={laterVersion:"v57",earlierVersion:"v56",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"0.49.0",[ye.TYPESCRIPT_BROWSER_SDK]:"0.49.0",[ye.TYPESCRIPT]:"0.49.0",[ye.TYPESCRIPT_SDK]:"0.49.0",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.8.0",[ye.JAVA_SDK]:"2.34.0",[ye.JAVA_SPRING]:"1.6.0",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:"1.6.3",[ye.PYTHON_PYDANTIC]:"1.4.8",[ye.PYTHON_SDK]:"4.3.19",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:"0.23.6",[ye.GO_MODEL]:"0.23.6",[ye.GO_SDK]:"0.37.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"1.12.0-rc11",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:Qn,[ye.PHP_MODEL]:Qn,[ye.PHP_SDK]:"0.14.1",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:Qn},jsonifyEarlierVersion:e=>$0.V56.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?Wp8(e.dynamic):void 0})};function Wp8(e){return{...e,endpoints:Hp8(e.endpoints)}}function Hp8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Gp8(r)]).filter(([t,r])=>r!=null))}function Gp8(e){return{...e,auth:e.auth!=null?$p8(e.auth):void 0,examples:e.examples!=null?Jp8(e.examples):void 0}}function Jp8(e){return e.map(t=>Kp8(t)).filter(t=>t!=null)}function Kp8(e){return{...e,auth:e.auth!=null?Yp8(e.auth):void 0}}function $p8(e){switch(e.type){case"basic":return ot.V56.dynamic.Auth.basic(e);case"bearer":return ot.V56.dynamic.Auth.bearer(e);case"header":return ot.V56.dynamic.Auth.header(e);case"oauth":return;default:cc(e)}}function Yp8(e){switch(e.type){case"basic":return ot.V56.dynamic.AuthValues.basic(e);case"bearer":return ot.V56.dynamic.AuthValues.bearer(e);case"header":return ot.V56.dynamic.AuthValues.header(e);case"oauth":return;default:cc(e)}}var iI1={laterVersion:"v58",earlierVersion:"v57",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"1.2.0",[ye.TYPESCRIPT_BROWSER_SDK]:"1.2.0",[ye.TYPESCRIPT]:"1.2.0",[ye.TYPESCRIPT_SDK]:"1.2.0",[ye.TYPESCRIPT_EXPRESS]:"0.18.0",[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:"2.36.5",[ye.JAVA_SPRING]:"1.6.1",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:"1.7.0",[ye.PYTHON_PYDANTIC]:"1.5.0",[ye.PYTHON_SDK]:"4.21.0",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:"1.1.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:"1.17.5",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:"0.1.0",[ye.PHP_MODEL]:xt,[ye.PHP_SDK]:"1.15.1",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:"0.0.0"},jsonifyEarlierVersion:e=>$0.V57.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:e.services!=null?Xp8(e.services):void 0,dynamic:e.dynamic!=null?t_8(e.dynamic):void 0})};function Xp8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Zp8(r)]))}function Zp8(e){return{...e,endpoints:kp8(e.endpoints)}}function kp8(e){return e.map(e_8).filter(t=>t!=null)}function e_8(e){if(e.method!=="HEAD")return{...e,method:e.method}}function t_8(e){return{...e,endpoints:r_8(e.endpoints)}}function r_8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,n_8(r)]).filter(([t,r])=>r!=null))}function n_8(e){let t=e.location.method;if(t!=="HEAD")return{...e,examples:e.examples!=null?i_8(e.examples):void 0,location:{...e.location,method:t}}}function i_8(e){return e.map(t=>a_8(t)).filter(t=>t!=null)}function a_8(e){let t=e.endpoint.method;if(t!=="HEAD")return{...e,endpoint:{...e.endpoint,method:t}}}var aI1={laterVersion:"v59",earlierVersion:"v58",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"2.6.8",[ye.TYPESCRIPT_BROWSER_SDK]:"2.6.8",[ye.TYPESCRIPT]:"2.6.8",[ye.TYPESCRIPT_SDK]:"2.6.8",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:"1.8.1",[ye.JAVA_SDK]:"2.43.0",[ye.JAVA_SPRING]:"1.8.2",[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:"1.8.0",[ye.PYTHON_PYDANTIC]:"1.6.0",[ye.PYTHON_SDK]:"4.26.0",[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:"0.23.7",[ye.GO_MODEL]:"0.23.7",[ye.GO_SDK]:"1.7.0",[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:"1.0.0-rc26",[ye.CSHARP_MODEL]:"0.0.3",[ye.CSHARP_SDK]:"2.2.0",[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:"0.6.0",[ye.PHP_MODEL]:xt,[ye.PHP_SDK]:"1.17.0",[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:xt},jsonifyEarlierVersion:e=>$0.V58.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?u_8(e.dynamic):void 0,auth:e.auth!=null?o_8(e.auth):void 0})};function o_8(e){return{...e,schemes:e.schemes.filter(t=>t.type!=="inferred")}}function u_8(e){return{...e,endpoints:s_8(e.endpoints)}}function s_8(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,c_8(r)]).filter(([t,r])=>r!=null))}function c_8(e){return{...e,examples:e.examples!=null?f_8(e.examples):void 0,auth:l_8(e.auth)}}function l_8(e){return e==null?e:e._visit({basic:t=>ot.V58.dynamic.Auth.basic(t),bearer:t=>ot.V58.dynamic.Auth.bearer(t),header:t=>ot.V58.dynamic.Auth.header(t),oauth:t=>ot.V58.dynamic.Auth.oauth(t),inferred:()=>{},_other:()=>{}})}function f_8(e){return e.map(t=>d_8(t)).filter(t=>t!=null)}function d_8(e){return{...e,auth:p_8(e.auth)}}function p_8(e){if(e==null)return e;if(e.type!=="inferred")return e}var oI1={laterVersion:"v60",earlierVersion:"v59",firstGeneratorVersionToConsumeNewIR:{[ye.TYPESCRIPT_NODE_SDK]:"2.11.2",[ye.TYPESCRIPT_BROWSER_SDK]:"2.11.2",[ye.TYPESCRIPT]:"2.11.2",[ye.TYPESCRIPT_SDK]:"2.11.2",[ye.TYPESCRIPT_EXPRESS]:xt,[ye.JAVA]:xt,[ye.JAVA_MODEL]:xt,[ye.JAVA_SDK]:xt,[ye.JAVA_SPRING]:xt,[ye.OPENAPI_PYTHON_CLIENT]:xt,[ye.OPENAPI]:xt,[ye.PYTHON_FASTAPI]:xt,[ye.PYTHON_PYDANTIC]:xt,[ye.PYTHON_SDK]:xt,[ye.STOPLIGHT]:xt,[ye.POSTMAN]:xt,[ye.GO_FIBER]:xt,[ye.GO_MODEL]:xt,[ye.GO_SDK]:xt,[ye.RUBY_MODEL]:xt,[ye.RUBY_SDK]:xt,[ye.CSHARP_MODEL]:xt,[ye.CSHARP_SDK]:xt,[ye.SWIFT_MODEL]:xt,[ye.SWIFT_SDK]:xt,[ye.PHP_MODEL]:xt,[ye.PHP_SDK]:xt,[ye.RUST_MODEL]:Qn,[ye.RUST_SDK]:xt},jsonifyEarlierVersion:e=>$0.V59.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:y_8(e.services),auth:__8(e.auth)})};function __8(e){return{...e,schemes:h_8(e.schemes)}}function h_8(e){return e.map(t=>{switch(t.type){case"bearer":return ot.V59.AuthScheme.bearer({...t});case"basic":return ot.V59.AuthScheme.basic({...t});case"header":return ot.V59.AuthScheme.header({...t});case"oauth":switch(t.configuration.type){case"clientCredentials":return ot.V59.AuthScheme.oauth({...t,configuration:ot.V59.OAuthConfiguration.clientCredentials({...t.configuration,refreshEndpoint:t.configuration.refreshEndpoint?{...t.configuration.refreshEndpoint,responseProperties:{accessToken:nSa(t.configuration.refreshEndpoint.responseProperties.accessToken),expiresIn:pvo(t.configuration.refreshEndpoint.responseProperties.expiresIn),refreshToken:pvo(t.configuration.refreshEndpoint.responseProperties.refreshToken)},requestProperties:{refreshToken:_vo(t.configuration.refreshEndpoint.requestProperties.refreshToken)}}:void 0,tokenEndpoint:{...t.configuration.tokenEndpoint,responseProperties:{accessToken:nSa(t.configuration.tokenEndpoint.responseProperties.accessToken),expiresIn:pvo(t.configuration.tokenEndpoint.responseProperties.expiresIn),refreshToken:pvo(t.configuration.tokenEndpoint.responseProperties.refreshToken)},requestProperties:{clientId:_vo(t.configuration.tokenEndpoint.requestProperties.clientId),clientSecret:_vo(t.configuration.tokenEndpoint.requestProperties.clientSecret),scopes:zc_(t.configuration.tokenEndpoint.requestProperties.scopes),customProperties:t.configuration.tokenEndpoint.requestProperties.customProperties?.map(_vo)}}})});default:cc(t.configuration.type)}break;case"inferred":return ot.V59.AuthScheme.inferred({...t,tokenEndpoint:{...t.tokenEndpoint,expiryProperty:pvo(t.tokenEndpoint.expiryProperty),authenticatedRequestHeaders:t.tokenEndpoint.authenticatedRequestHeaders.map(r=>({...r,responseProperty:nSa(r.responseProperty)}))}});default:cc(t)}})}function y_8(e){return Object.entries(e).reduce((t,[r,n])=>(t[r]={...n,endpoints:v_8(n.endpoints)},t),{})}function v_8(e){return e.map(t=>({...t,pagination:b_8(t.pagination),sdkRequest:g_8(t.sdkRequest)}))}function b_8(e){if(!e)return e;switch(e.type){case"cursor":return ot.V59.Pagination.cursor({next:nSa(e.next),results:nSa(e.results),page:_vo(e.page)});case"offset":return ot.V59.Pagination.offset({hasNextPage:pvo(e.hasNextPage),results:nSa(e.results),page:_vo(e.page),step:zc_(e.step)});case"custom":return ot.V59.Pagination.custom({results:nSa(e.results)});default:cc(e)}}function zc_(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function _vo(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function pvo(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function nSa(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function g_8(e){return e&&{...e,streamParameter:zc_(e.streamParameter)}}function evu(){return O_8}var CGc=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new Qc_([...this.migrations,t])}},Qc_=class extends CGc{build(){return new Lc_(this.migrations)}},Lc_=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(()=>y0.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let c=this.migrate({intermediateRepresentation:r,shouldMigrate:p=>{let s=p.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,u=async()=>y0.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}),u=()=>Promise.resolve().then(()=>c.jsonifyEarlierVersion(a))}return{ir:a,jsonify:u}}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 xt:return!0;case Qn:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return fNe(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}},m_8={Builder:new CGc([])},O_8=m_8.Builder.withMigration(oI1).withMigration(aI1).withMigration(iI1).withMigration(nI1).withMigration(rI1).withMigration(GC1).withMigration(VC1).withMigration(TC1).withMigration(OC1).withMigration(_C1).withMigration(sC1).withMigration(uC1).withMigration(aC1).withMigration(iC1).withMigration(tC1).withMigration(ZD1).withMigration(XD1).withMigration($D1).withMigration(KD1).withMigration(JD1).withMigration(GD1).withMigration(HD1).withMigration(WD1).withMigration(VD1).withMigration(UD1).withMigration(LD1).withMigration(QD1).withMigration(zD1).withMigration(RD1).withMigration(xD1).withMigration(qD1).withMigration(TD1).withMigration(ED1).withMigration(jD1).withMigration(wD1).withMigration(AD1).withMigration(OD1).withMigration(anP).withMigration(rnP).withMigration(tnP).withMigration(ZrP).withMigration(YrP).withMigration(KrP).withMigration(JrP).withMigration(GrP).withMigration(VrP).withMigration(QrP).withMigration(zrP).withMigration(FrP).withMigration(NrP).withMigration(xrP).withMigration(qrP).withMigration(IrP).withMigration(SrP).withMigration(ErP).withMigration(jrP).withMigration(frP).withMigration(srP).withMigration(tdv).build();function tvu({intermediateRepresentation:e,context:t,targetGenerator:r}){return evu().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function Uc_({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:n}){return evu().migrateThroughVersion({version:n,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function rvu({intermediateRepresentation:e,context:t,version:r}){return evu().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function uI1({workspace:e,audiences:t,generatorInvocation:r,context:n,irVersionOverride:i,version:a,packageName:u,sourceConfig:c,includeOptionalRequestPropertyExamples:p,ir:s}){let o=s??UV({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:p,disabled:r.disableExamples},readme:r.readme,version:a,packageName:u,context:n,sourceResolver:new LV(n,e)});c!=null&&(o.sourceConfig=c),n.logger.debug("Generated IR");let l=i!=null?await rvu({intermediateRepresentation:o,context:n,version:i}):await tvu({intermediateRepresentation:o,context:n,targetGenerator:{name:r.name,version:r.version}});return{latest:o,migrated:l}}var sI1=Xi(MDs(),1),lYe=require("fs/promises"),cI1=Xi(TEe(),1),IGc=class{context;absolutePathToTmpOutputDirectory;absolutePathToTmpSnippetJSON;absolutePathToTmpSnippetTemplatesJSON;absolutePathToLocalSnippetTemplateJSON;absolutePathToLocalOutput;absolutePathToLocalSnippetJSON;constructor({context:t,absolutePathToTmpOutputDirectory:r,absolutePathToTmpSnippetJSON:n,absolutePathToLocalSnippetTemplateJSON:i,absolutePathToLocalOutput:a,absolutePathToLocalSnippetJSON:u,absolutePathToTmpSnippetTemplatesJSON:c}){this.context=t,this.absolutePathToLocalOutput=a,this.absolutePathToTmpOutputDirectory=r,this.absolutePathToTmpSnippetJSON=n,this.absolutePathToLocalSnippetJSON=u,this.absolutePathToLocalSnippetTemplateJSON=i,this.absolutePathToTmpSnippetTemplatesJSON=c}async copyGeneratedFiles(){await this.isFernIgnorePresent()?await this.copyGeneratedFilesWithFernIgnore():await this.copyGeneratedFilesNoFernIgnore(),this.absolutePathToTmpSnippetJSON!=null&&this.absolutePathToLocalSnippetJSON!=null&&await _v(this.absolutePathToTmpSnippetJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetJSON}),this.absolutePathToTmpSnippetTemplatesJSON!=null&&this.absolutePathToLocalSnippetTemplateJSON!=null&&await _v(this.absolutePathToTmpSnippetTemplatesJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetTemplatesJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetTemplateJSON})}async isFernIgnorePresent(){let t=D_.of(Jl(this.absolutePathToLocalOutput,hs.of(H6u)));return await _v(t)}async copyGeneratedFilesWithFernIgnore(){let t=D_.of((await cI1.default.dir({})).path),r=D_.of(Jl(this.absolutePathToLocalOutput,hs.of(H6u))),n=await P_8({absolutePathToFernignore:r});await(0,lYe.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,lYe.rm)(Jl(t,hs.of(".git")),{recursive:!0}),await(0,lYe.rm)(this.absolutePathToLocalOutput,{recursive:!0}),await(0,lYe.cp)(t,this.absolutePathToLocalOutput,{recursive:!0})}async copyGeneratedFilesNoFernIgnore(){this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`),await(0,lYe.rm)(this.absolutePathToLocalOutput,{force:!0,recursive:!0}),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesToDirectory(t){let[r,...n]=await(0,lYe.readdir)(this.absolutePathToTmpOutputDirectory);if(r!=null)if(this.context.logger.debug(`Copying generated files to ${t}`),r.endsWith(".zip")){await(0,sI1.default)(Jl(this.absolutePathToTmpOutputDirectory,hs.of(r)),t);for(let i of n)await(0,lYe.cp)(Jl(this.absolutePathToTmpOutputDirectory,hs.of(i)),Jl(t,hs.of(i)),{recursive:!0})}else await(0,lYe.cp)(this.absolutePathToTmpOutputDirectory,t,{recursive:!0})}async copySnippetJSON({absolutePathToTmpSnippetJSON:t,absolutePathToLocalSnippetJSON:r}){this.context.logger.debug(`Copying generated snippets to ${r}`),await(0,lYe.cp)(t,r)}async runGitCommand(t,r){return(await QV(this.context.logger,"git",t,{cwd:r,doNotPipeOutput:!0})).stdout}},A_8=/\r?\n/;async function P_8({absolutePathToFernignore:e}){let t=(await(0,lYe.readFile)(e)).toString();return[H6u,...t.trim().split(A_8).map(r=>{let n=r.indexOf("#");return n!==-1?r.slice(0,n).trim():r.trim()}).filter(r=>r.length>0)]}async function dI1({organization:e,absolutePathToFernConfig:t,workspace:r,generatorInvocation:n,absolutePathToLocalOutput:i,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:u,audiences:c,version:p,workspaceTempDir:s,keepDocker:o,context:l,irVersionOverride:O,outputVersionOverride:A,writeUnitTests:E,generateOauthClients:C,generatePaginatedClients:M,includeOptionalRequestPropertyExamples:q,inspect:L,executionEnvironment:U,runner:Q,ir:K}){let{latest:X,migrated:te}=await uI1({workspace:r,audiences:c,generatorInvocation:n,context:l,irVersionOverride:O,packageName:WA.getPackageName({generatorInvocation:n}),version:p??A,sourceConfig:j_8(r),includeOptionalRequestPropertyExamples:q,ir:K}),ee=await w_8({workspaceTempDir:s,filename:Z1f,context:l,ir:te});l.logger.debug("Wrote IR to: "+ee);let re=(0,hvo.join)(s.path,X1f),ue=D_.of(re);await(0,iSa.writeFile)(re,""),l.logger.debug("Will write config.json to: "+ue);let me=(0,hvo.join)(s.path,Y1f),Oe=D_.of(me);await(0,iSa.mkdir)(me,{recursive:!0}),l.logger.debug("Will write output to: "+Oe);let Ee;if(a!=null){let Ke=(0,hvo.join)(s.path,"snippet.json");Ee=D_.of(Ke),await(0,iSa.writeFile)(Ke,""),l.logger.debug("Will write snippet.json to: "+Ee)}let Pe;if(u!=null){let Ke=(0,hvo.join)(s.path,gT_);Pe=D_.of(Ke),await(0,iSa.writeFile)(Ke,""),l.logger.debug("Will write snippet-templates.json to: "+Pe)}let Ce=U??new W8o({dockerImage:`${n.name}:${n.version}`,keepDocker:o}),Be=Ce instanceof W8o?{outputDirectory:D_.of(LCs),irPath:D_.of(UCs),configPath:D_.of(V8o),snippetPath:D_.of(VCs),snippetTemplatePath:D_.of(WCs)}:{outputDirectory:Oe,configPath:ue,irPath:ee,snippetPath:Ee,snippetTemplatePath:Pe},Bt=edv({generatorInvocation:n,customConfig:n.config,workspaceName:r.definition.rootApiFile.contents.name,outputVersion:A,organization:e,absolutePathToSnippet:Ee,absolutePathToSnippetTemplates:Pe,absolutePathToFernConfig:t,writeUnitTests:E,generateOauthClients:C,generatePaginatedClients:M,paths:Be});return await(0,iSa.writeFile)(ue,JSON.stringify(await lI1.GeneratorConfig.jsonOrThrow(Bt),void 0,4)),await Ce.execute({generatorName:n.name,irPath:ee,configPath:ue,outputPath:Oe,snippetPath:Ee,snippetTemplatePath:Pe,context:l,inspect:L,runner:Q}),await new IGc({context:l,absolutePathToLocalOutput:i,absolutePathToTmpOutputDirectory:Oe,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:u,absolutePathToTmpSnippetJSON:Ee,absolutePathToTmpSnippetTemplatesJSON:Pe}).copyGeneratedFiles(),{ir:X,generatorConfig:Bt}}async function w_8({ir:e,workspaceTempDir:t,filename:r,context:n}){n.logger.debug("Migrated IR");let i;if(r)i=D_.of((0,hvo.join)(t.path,r));else{let a=await fI1.default.file({tmpdir:t.path});i=D_.of(a.path)}return await BEe(i,e,{pretty:!1}),n.logger.debug(`Wrote IR to ${i}`),i}function j_8(e){return{sources:e.getSources().map(t=>t.type==="protobuf"?dxe.proto({id:t.id,protoRootUrl:`file:///${E_8(t)}`}):dxe.openapi())}}function E_8(e){return`${Bav}/${e.id}`}var Vc_=Xi(require("os"),1),pI1=Xi(require("path"),1),_I1=Xi(TEe(),1);async function hI1({token:e,projectConfig:t,workspace:r,generatorGroup:n,version:i,keepDocker:a,inspect:u,context:c,runner:p}){let s=await D_8();(await Promise.all(n.generators.map(async l=>c.runInteractiveTask({name:l.name},async O=>{l=(X=>bwi(X,{onError:te=>O.failAndThrow(te)}))(l);let E=await r.toFernWorkspace({context:c},U9a(l)),C=UV({workspace:E,audiences:n.audiences,generationLanguage:l.language,keywords:l.keywords,smartCasing:l.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:!1,disabled:l.disableExamples},readme:l.readme,version:i,packageName:WA.getPackageName({generatorInvocation:l}),context:c,sourceResolver:new LV(c,E)}),M=uet({token:e?.value});if(l.absolutePathToLocalOutput==null&&(e=await V4a(),e==null)){O.failWithoutThrowing("Please provide a FERN_TOKEN in your environment.");return}let q=await M.organization.get(Yx.OrganizationId(t.organization));if(l.absolutePathToLocalOutput==null&&!q.ok){O.failWithoutThrowing(`Failed to load details for organization ${t.organization}.`);return}q.ok&&(q.body.selfHostedSdKs&&(C.selfHosted=!0),q.body.isWhitelabled&&(C.readmeConfig==null&&(C.readmeConfig=M_8),C.readmeConfig.whiteLabel=!0));let L=S_8(l),U=C_8({generatorInvocation:l,org:q.ok?q.body:void 0,version:i,packageName:L,context:O});U!=null&&(C.publishConfig=U);let Q=l.absolutePathToLocalOutput??Jl(r.absoluteFilePath,hs.of("sdks"),hs.of(l.language??l.name)),K=l.raw?.snippets?.path!=null?D_.of(Jl(r.absoluteFilePath,hs.of(l.raw.snippets.path))):void 0;await dI1({organization:t.organization,absolutePathToFernConfig:t._absolutePath,workspace:E,generatorInvocation:l,absolutePathToLocalOutput:Q,absolutePathToLocalSnippetJSON:K,absolutePathToLocalSnippetTemplateJSON:void 0,version:i,audiences:n.audiences,workspaceTempDir:s,keepDocker:a,context:O,irVersionOverride:l.irVersionOverride,outputVersionOverride:void 0,writeUnitTests:q.ok?q?.body.snippetUnitTestsEnabled??!1:!1,generateOauthClients:q.ok?q?.body.oauthClientEnabled??!1:!1,generatePaginatedClients:q.ok?q?.body.paginationEnabled??!1:!1,includeOptionalRequestPropertyExamples:!1,inspect:u,executionEnvironment:void 0,ir:C,runner:p}),O.logger.info(yd.green("Wrote files to "+Q))})))).some(l=>!l)&&c.failAndThrow()}function S_8(e){return typeof e.raw?.config=="object"&&e.raw?.config!==null?e.raw.config.package_name:void 0}async function D_8(){return _I1.default.dir({tmpdir:Vc_.default.platform()==="darwin"?pI1.default.join("/private",Vc_.default.tmpdir()):void 0,prefix:"fern"})}function C_8({generatorInvocation:e,org:t,version:r,packageName:n,context:i}){if(e.raw?.github!=null&&I_8(e.raw.github))return tp.PublishingConfig.github({owner:"",repo:"",uri:e.raw.github.uri,token:e.raw.github.token,target:tp.PublishTarget.postman({apiKey:"",workspaceId:"",collectionId:void 0})});if(e.raw?.output?.location==="local-file-system"){let a;if(e.language==="python")a=HEe.pypi({version:r,packageName:n}),i.logger.debug(`Created PyPiPublishTarget: version ${r} package name: ${n}`);else if(e.language==="java"){let u=e.raw?.config,c=(()=>{if(!u||typeof u!="object"||u===null)return;let s=u;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")})(),p=c?`${c.groupId}:${c.artifactId}`:void 0;if(p){let s=r??"0.0.0";a=HEe.maven({coordinate:p,version:s,usernameEnvironmentVariable:"MAVEN_USERNAME",passwordEnvironmentVariable:"MAVEN_PASSWORD",mavenUrlEnvironmentVariable:"MAVEN_PUBLISH_REGISTRY_URL"}),i.logger.debug(`Created MavenPublishTarget: coordinate ${p} version ${s}`)}else u&&typeof u=="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 tp.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:a})}return e.outputMode._visit({downloadFiles:()=>tp.PublishingConfig.filesystem({generateFullProject:t?.selfHostedSdKs??!1,publishTarget:void 0}),github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:()=>{},_other:()=>{}})}function I_8(e){return e==null?!1:"uri"in e&&"token"in e}var M_8={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};var FGc=Xi(G1i(),1);var yI1=require("fs"),MGc=require("fs/promises"),vI1=require("stream/promises");async function bI1({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await B_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(yd.green(`Downloaded to ${t}`))}catch{r.logger.debug(yd.yellow("Failed to download snippet.json from output."))}}async function B_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await eY.get(e,{responseType:"stream"});await _v(t)&&await(0,MGc.rm)(t,{recursive:!0}),await(0,MGc.mkdir)(cg(t),{recursive:!0}),await(0,vI1.pipeline)(r.data,(0,yI1.createWriteStream)(t))}var Gc_=Xi(Yke(),1);var yvo=Xi(G1i(),1);var gI1=Xi(tis(),1),fYe=require("fs/promises");var mI1=require("path"),OI1=Xi(fAs(),1),AI1=Xi(TEe(),1);async function PI1({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:n,generatorInvocation:i,version:a,context:u,shouldLogS3Url:c,token:p,whitelabel:s,irVersionOverride:o,absolutePathToPreview:l}){let O=await T_8({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:a,context:u,shouldLogS3Url:c,token:p,whitelabel:s,absolutePathToPreview:l});return await q_8({intermediateRepresentation:n,job:O,context:u,generatorInvocation:i,irVersionOverride:o}),O}async function T_8({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:i,context:a,shouldLogS3Url:u,token:c,whitelabel:p,absolutePathToPreview:s}){let o=qsi({token:c.value}),l={id:n.name,version:n.version,outputMode:n.outputMode,customConfig:n.config,publishMetadata:n.publishMetadata},O;if(n.outputMode.type.startsWith("github"))try{let E=await AI1.default.dir(),C=D_.of(E.path);a.logger.debug(`Writing mock fern definition to ${C}`);let M=Jl(C,hs.of(Dhe)),q=Jl(M,hs.of(Gce));await(0,fYe.mkdir)(q,{recursive:!0});let L=Jl(q,hs.of(rZ));await(0,fYe.writeFile)(L,lg.dump(t.definition.rootApiFile.contents)),await wI1({absolutePathToDefinitionDirectory:q,definition:t.definition});let U=Jl(M,hs.of(gqe));await(0,fYe.writeFile)(U,JSON.stringify(e.rawConfig,void 0,2));try{let X=t.getSources();for(let te of X){let ee=await(0,fYe.readFile)(te.absoluteFilePath),re=(0,mI1.relative)(t.absoluteFilePath,te.absoluteFilePath),ue=Jl(M,hs.of(re));await(0,fYe.mkdir)(cg(ue),{recursive:!0}),await(0,fYe.writeFile)(ue,new Uint8Array(ee))}}catch(X){a.logger.debug(`Failed to write source files to disk, continuing: ${X}`)}let Q=Jl(C,hs.of("definition.tgz"));await(0,OI1.create)({file:Q,cwd:M},["."]),a.logger.debug("Getting upload URL for Fern definition.");let K=await o.remoteGen.getDefinitionUploadUrl({apiName:t.definition.rootApiFile.contents.name,organizationName:r,version:i});K.ok?(a.logger.debug("Uploading definition..."),await eY.put(K.body.s3Url,await(0,fYe.readFile)(Q)),O={definitionS3DownloadUrl:K.body.s3Url,outputPath:".mock",cliVersion:e.version}):K.error.content.reason==="status-code"?a.logger.debug(`Failed with status-code to get upload URL with status code ${K.error.content.statusCode}, continuing: ${K.error.content.body}`):K.error.content.reason==="non-json"?a.logger.debug(`Failed with non-json to get upload URL with status code ${K.error.content.statusCode}, continuing: ${K.error.content.rawBody}`):K.error.content.reason==="unknown"&&a.logger.debug(`Failed to get upload URL as unknown error occurred continuing: ${K.error.content.errorMessage}`)}catch(E){a.logger.debug(`Failed to upload definition to S3, continuing: ${E}`)}let A=await o.remoteGen.createJobV3({apiName:t.definition.rootApiFile.contents.name,version:i,organizationName:r,generators:[l],uploadToS3:N_8({outputMode:n.outputMode,generatorInvocation:n,absolutePathToPreview:s,shouldLogS3Url:u}),whitelabel:p,fernDefinitionMetadata:O,preview:s!=null});return A.ok?A.body:x_8(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:E,invalidScope:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${E})`),cannotPublishToMavenGroup:({validGroup:E,invalidGroup:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${E})`),cannotPublishPypiPackage:({validPrefix:E,invalidPackageName:C})=>a.failAndThrow(`You do not have permission to publish to ${C} (expected ${E})`),generatorsDoNotExistError:E=>a.failAndThrow("Generators do not exist: "+E.nonExistentGenerators.map(C=>`${C.id}@${C.version}`).join(", ")),insufficientPermissions:()=>a.failAndThrow("Insufficient permissions."),orgNotConfiguredForWhitelabel:()=>a.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com."),_other:E=>a.failAndThrow("Failed to create job",E)})}async function wI1({absolutePathToDefinitionDirectory:e,definition:t}){for(let[r,n]of Object.entries(t.namedDefinitionFiles)){let i=Jl(e,hs.of(r));await(0,fYe.mkdir)(cg(i),{recursive:!0}),await(0,fYe.writeFile)(i,lg.dump(n.contents))}for(let[r,n]of Object.entries(t.packageMarkers))if(n.contents.export==null){let i=Jl(e,hs.of(r));await(0,fYe.mkdir)(cg(i),{recursive:!0}),await(0,fYe.writeFile)(i,lg.dump(n.contents))}for(let[r,n]of Object.entries(t.importedDefinitions))await wI1({absolutePathToDefinitionDirectory:Jl(e,hs.of(r)),definition:n.definition})}async function q_8({intermediateRepresentation:e,generatorInvocation:t,job:r,context:n,irVersionOverride:i}){let a=i==null?await tvu({intermediateRepresentation:e,context:n,targetGenerator:{name:t.name,version:t.version}}):await Uc_({intermediateRepresentation:e,context:n,irVersion:i,targetGenerator:{name:t.name,version:t.version}}),u=new gI1.default,c=await WBl(a,{onWrite:s=>{n.logger.debug("Wrote IR to disk: "+s)}});u.append("file",c);let p=QS(l2l(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await eY.post(p,u,{headers:u.getHeaders(),maxBodyLength:1/0})}catch(s){let o=s instanceof gQh?s.response?.data:s;n.logger.debug(`POST ${p} failed with ${JSON.stringify(s)}`),n.failAndThrow("Failed to start job",o)}}function x_8(e){if(e?.reason==="status-code"){let t=e.body;switch(t?._error){case"IllegalApiNameError":return yvo.FernFiddle.remoteGen.createJobV3.Error.illegalApiNameError();case"GeneratorsDoNotExistError":return yvo.FernFiddle.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.body);case"CannotPublishToNpmScope":return yvo.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.body);case"CannotPublishToMavenScope":return yvo.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.body);case"InsufficientPermissions":return yvo.FernFiddle.remoteGen.createJobV3.Error.insufficientPermissions(t.body)}}return e}function N_8({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:n}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||n}function BGc({apiName:e,organization:t,generatorInvocation:r}){let n=R_8(r);return{apiName:e,organization:t,customConfig:r.config,outputConfig:n??nd.GeneratorOutputConfig.local()}}function R_8(e){let t=e.outputMode;switch(t.type){case"downloadFiles":return nd.GeneratorOutputConfig.local();case"publishV2":return F_8({publish:t.publishV2,version:e.version});case"githubV2":return z_8({github:t.githubV2,language:e.language,version:e.version});case"publish":case"github":return;default:cc(t)}}function F_8({publish:e,version:t}){switch(e.type){case"npmOverride":{let r=e.npmOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.npm({version:t,packageName:r.packageName,repoUrl:void 0}))}case"mavenOverride":{let r=e.mavenOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.maven({version:t,coordinate:r.coordinate,repoUrl:void 0}))}case"pypiOverride":{let r=e.pypiOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.pypi({version:t,packageName:r.coordinate,repoUrl:void 0}))}case"rubyGemsOverride":{let r=e.rubyGemsOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.rubygems({version:t,packageName:r.packageName,repoUrl:void 0}))}case"nugetOverride":{let r=e.nugetOverride;return r==null?void 0:nd.GeneratorOutputConfig.publish(nd.PublishInfo.nuget({version:t,packageName:r.packageName,repoUrl:void 0}))}case"postman":return;default:cc(e)}}function z_8({github:e,version:t,language:r}){let n=Q_8({owner:e.owner,repo:e.repo});if(r===WA.GenerationLanguage.GO)return nd.GeneratorOutputConfig.publish(nd.PublishInfo.go({version:t,repoUrl:n}));let i=e.publishInfo;if(i!=null)switch(i.type){case"maven":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.maven({version:t,coordinate:i.coordinate,repoUrl:n}));case"npm":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.npm({version:t,packageName:i.packageName,repoUrl:n}));case"pypi":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.pypi({version:t,packageName:i.packageName,repoUrl:n}));case"rubygems":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.rubygems({version:t,packageName:i.packageName,repoUrl:n}));case"nuget":return nd.GeneratorOutputConfig.publish(nd.PublishInfo.nuget({version:t,packageName:i.packageName,repoUrl:n}));case"postman":return;default:cc(i)}}function Q_8({owner:e,repo:t}){return`https://github.com/${e}/${t}`}var jI1=qsi();var L_8=3;function EI1({job:e,taskId:t,taskHandler:r,context:n}){let i=0,a=async()=>{let u=await jI1.remoteGen.getJobStatus(e.jobId);if(u.ok)return u.body[t];n.logger.debug("Failed to get job status.",JSON.stringify(u.error.content))};return new Promise((u,c)=>{p();async function p(){try{let s=await a();if(s==null)i++,i===L_8&&n.failAndThrow(`Failed to get job status after ${i} attempts.`),setTimeout(p,2e3+1e3*i);else{i=0;let o=await r.processUpdate(s);r.isFinished?u(o):setTimeout(p,2e3)}}catch(s){c(s)}}})}var II1=Xi(MDs(),1),MI1=require("fs"),xGc=require("fs/promises"),Hc_=Xi(require("path"),1),BI1=require("stream/promises");var TGc=Xi(CI1(),1);function rgi(e,t,{target:r="stdout",...n}={}){return TGc.default[r]?$5a.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}rgi.isSupported=TGc.default.stdout;rgi.stderr=(e,t,r={})=>rgi(e,t,{target:"stderr",...r});rgi.stderr.isSupported=TGc.default.stderr;var TI1=Xi(TEe(),1),qGc=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}`,_other:()=>"<unknown package>"}));this.absolutePathToPreview==null&&this.context.setSubtitle(r.length>0?r.map(i=>`\u25E6 ${i}`).join(`
2838
2838
  `):void 0);for(let i of t.logs.slice(this.lengthOfLastLogs))this.context.logger.log(H_8(i.level),i.message);this.lengthOfLastLogs=t.logs.length;let n=i=>{this.context.logger.debug(`Generated files. ${rgi("View here",i,{fallback:(a,u)=>`${a}: ${u}`})}`)};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 V_8({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?Jl(this.absolutePathToPreview,hs.of(Hc_.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 V_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{await W_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(yd.green(`Downloaded to ${t}`))}catch(n){r.failAndThrow("Failed to download files",n)}}async function W_8({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await eY.get(e,{responseType:"stream"}),n=await TI1.default.dir({prefix:"fern",unsafeCleanup:!0}),i=Hc_.default.join(n.path,"output.zip");await(0,BI1.pipeline)(r.data,(0,MI1.createWriteStream)(i)),await _v(t)&&await(0,xGc.rm)(t,{recursive:!0}),await(0,xGc.mkdir)(t,{recursive:!0}),await(0,II1.default)(i,t)}function H_8(e){switch(e){case"DEBUG":return zj.Debug;case"INFO":return zj.Info;case"WARN":return zj.Warn;case"ERROR":return zj.Error;default:return zj.Info}}var RGc=require("fs/promises"),qI1=Xi(TEe(),1),G_8="proto.zip",NGc=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,RGc.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,RGc.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await qI1.default.dir(),n=Jl(D_.of(r.path),hs.of(G_8));return this.context.logger.debug(`Zipping source ${t} into ${n}`),await QV(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(dxe.proto({id:n,protoRootUrl:i.downloadUrl}));continue;case"openapi":r.push(dxe.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 xI1({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:n,generatorInvocation:i,version:a,audiences:u,shouldLogS3Url:c,token:p,whitelabel:s,irVersionOverride:o,absolutePathToPreview:l,readme:O}){let A=VHi({token:p.value}),E=WA.getPackageName({generatorInvocation:i}),C=l!=null,M=Ee=>bwi(Ee,{onError:Pe=>n.failAndThrow(Pe)},{substituteAsEmpty:C}),q=M(i),L=BGc({apiName:r.definition.rootApiFile.contents.name,organization:t,generatorInvocation:q}),U=UV({workspace:r,generationLanguage:i.language,keywords:i.keywords,smartCasing:i.smartCasing,exampleGeneration:{disabled:i.disableExamples,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!1},audiences:u,readme:O,packageName:E,version:a??await K_8({fdr:A,packageName:E,generatorInvocation:i}),context:n,sourceResolver:new LV(n,r),dynamicGeneratorConfig:L}),Q=r.getSources(),K=QSe({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},context:n}),X=await A.api.v1.register.registerApiDefinition({orgId:Gc_.FernRegistry.OrgId(t),apiId:Gc_.FernRegistry.ApiId(U.apiName.originalName),definition:K,sources:Q.length>0?$_8(Q):void 0}),te,ee;X.ok&&(te=X.body.apiDefinitionId,ee=X.body.sources);let re=new NGc(n,Q);if(ee==null&&re.sourceTypes.has("protobuf")&&(X.ok||n.failAndThrow(`Failed to register API definition: ${JSON.stringify(X.error.content)}`),n.failAndThrow("Did not successfully upload Protobuf source files.")),ee!=null){n.logger.debug("Uploading source files ...");let Ee=await re.uploadSources(ee);n.logger.debug("Setting IR source configuration ..."),U.sourceConfig=Ee}let ue=await PI1({projectConfig:e,workspace:r,organization:t,generatorInvocation:q,context:n,version:a,intermediateRepresentation:{...U,fdrApiDefinitionId:te,publishConfig:J_8({generatorInvocation:q})},shouldLogS3Url:c,token:p,whitelabel:s!=null?M(s):void 0,irVersionOverride:o,absolutePathToPreview:l});n.logger.debug(`Job ID: ${ue.jobId}`);let me=ue.taskIds[0];if(me==null){n.failAndThrow("Did not receive a task ID.");return}n.logger.debug(`Task ID: ${me}`);let Oe=new qGc({job:ue,taskId:me,generatorInvocation:i,interactiveTaskContext:n,absolutePathToPreview:l});return await EI1({job:ue,taskHandler:Oe,taskId:me,context:n})}function J_8({generatorInvocation:e}){return e.outputMode._visit({downloadFiles:()=>{},github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:t=>t._visit({mavenOverride:()=>{},pypiOverride:()=>{},nugetOverride:()=>{},npmOverride:()=>{},rubyGemsOverride:()=>{},postman:r=>{let n;return e.raw?.output?.location==="postman"&&(n=e.raw.output?.["collection-id"]),tp.PublishingConfig.direct({target:tp.PublishTarget.postman({apiKey:r.apiKey,workspaceId:r.workspaceId,collectionId:n})})},_other:()=>{}}),_other:()=>{}})}async function K_8({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 $_8(e){return Object.fromEntries(Object.values(e).map(t=>[t.id,{type:t.type==="protobuf"?"proto":t.type}]))}async function Jc_({projectConfig:e,organization:t,workspace:r,context:n,generatorGroup:i,version:a,shouldLogS3Url:u,token:c,whitelabel:p,absolutePathToPreview:s,mode:o}){if(i.generators.length===0)return n.logger.warn("No generators specified."),null;let l=[],O=[];return l.push(...i.generators.map(E=>n.runInteractiveTask({name:E.name},async C=>{let M=U9a(E),q=await r.toFernWorkspace({context:n},M),L=await xI1({projectConfig:e,organization:t,workspace:q,interactiveTaskContext:C,generatorInvocation:{...E,outputMode:E.outputMode._visit({downloadFiles:()=>E.outputMode,github:U=>FGc.FernFiddle.OutputMode.github({...U,makePr:o==="pull-request"}),githubV2:U=>o==="pull-request"?FGc.FernFiddle.OutputMode.githubV2(FGc.FernFiddle.GithubOutputModeV2.pullRequest(U)):E.outputMode,publish:()=>E.outputMode,publishV2:()=>E.outputMode,_other:()=>E.outputMode})},version:a,audiences:i.audiences,shouldLogS3Url:u,token:c,whitelabel:p,readme:E.readme,irVersionOverride:E.irVersionOverride,absolutePathToPreview:s});L!=null&&L.createdSnippets&&(O.push(E),E.absolutePathToLocalSnippets!=null&&L.snippetsS3PreSignedReadUrl!=null&&await bI1({snippetsS3PreSignedReadUrl:L.snippetsS3PreSignedReadUrl,absolutePathToLocalSnippetJSON:E.absolutePathToLocalSnippets,context:C}))}))),(await Promise.all(l)).some(E=>!E)&&n.failAndThrow(),{snippetsProducedBy:O}}var Ori=Xi(Yke(),1);var DM1=require("fs/promises");var _l_=Xi(e4a(),1);var OM1=Xi(mM1(),1);var AM1=require("util"),Ny8=(0,AM1.promisify)(OM1.default);async function PM1(e,t,r){let n=_Io(e,t),i=[];for(let a of n){let u=await Promise.all(a.map(async c=>{try{let p=await Ny8(c);return p==null||p.height==null||p.width==null?void 0:{filePath:c,width:p.width,height:p.height,blurDataUrl:void 0}}catch(p){r.logger.error(`Failed to measure image size for ${c}. ${p?.message}`);return}}));i.push(...u.filter(GP))}return new Map(i.map(a=>[a.filePath,a]))}var Ry8=10,wM1=10;async function CM1({token:e,organization:t,docsWorkspace:r,domain:n,customDomains:i,apiWorkspaces:a,ossWorkspaces:u,context:c,preview:p,editThisPage:s,isPrivate:o=!1,disableTemplates:l=!1,disableDynamicSnippets:O=!1}){let A=VHi({token:e.value}),E=o?{type:"private",authType:"sso"}:{type:"public"},C,M=i[0]??n,q=Fy8(n),U=await new YCr(n,r,u,a,c,s,async K=>{let X=new Map(K.map(Oe=>[Oe.absoluteFilePath,Oe])),ee=K.map(Oe=>({...Oe,mediaType:_l_.lookup(Oe.absoluteFilePath)})).filter(Oe=>Oe.mediaType!==!1).filter(Oe=>l2.parse(Oe.mediaType)?.isImage()??!1).map(Oe=>Oe.absoluteFilePath),re=await PM1(ee,Ry8,c),ue=[];[...re.values()].forEach(Oe=>{let Ee=X.get(Oe.filePath);if(Ee==null)return;let Pe={filePath:Ori.FernRegistry.docs.v1.write.FilePath(G7u(Ee.relativeFilePath)),width:Oe.width,height:Oe.height,blurDataUrl:Oe.blurDataUrl,alt:void 0};ue.push(Pe)});let me=K.filter(({absoluteFilePath:Oe})=>!re.has(Oe)).map(({relativeFilePath:Oe})=>G7u(Oe));if(p){let Oe=await A.docs.v2.write.startDocsPreviewRegister({orgId:Ori.FernRegistry.OrgId(t),authConfig:o?{type:"private",authType:"sso"}:{type:"public"},filepaths:me.map(Ee=>Ori.FernRegistry.docs.v1.write.FilePath(Ee)),images:ue,basePath:q});return Oe.ok?(M=Oe.body.previewUrl,C=Oe.body.docsRegistrationId,await jM1(Oe.body.uploadUrls,r.absoluteFilePath,c,wM1),EM1(Oe.body.uploadUrls,r.absoluteFilePath)):await SM1(Oe.error,c)}else{let Oe=await A.docs.v2.write.startDocsRegister({domain:n,customDomains:i,authConfig:E,apiId:Ori.FernRegistry.ApiId(""),orgId:Ori.FernRegistry.OrgId(t),filepaths:me.map(Ee=>Ori.FernRegistry.docs.v1.write.FilePath(Ee)),images:ue});return Oe.ok?(C=Oe.body.docsRegistrationId,await jM1(Oe.body.uploadUrls,r.absoluteFilePath,c,wM1),EM1(Oe.body.uploadUrls,r.absoluteFilePath)):SM1(Oe.error,c)}},async({ir:K,snippetsConfig:X,playgroundConfig:te,apiName:ee,workspace:re})=>{let ue=QSe({ir:K,snippetsConfig:X,playgroundConfig:te,context:c}),me;O||(me=await zy8({workspace:re,organization:t,context:c,snippetsConfig:X}));let Oe=await A.api.v1.register.registerApiDefinition({orgId:Ori.FernRegistry.OrgId(t),apiId:Ori.FernRegistry.ApiId(K.apiName.originalName),definition:{...ue,snippetsConfiguration:p?void 0:ue.snippetsConfiguration},definitionV2:void 0,dynamicIRs:me});if(Oe.ok)return c.logger.debug(`Registered API Definition ${Oe.body.apiDefinitionId}`),Oe.body.dynamicIRs&&me&&await Qy8({dynamicIRs:me,dynamicIRUploadUrls:Oe.body.dynamicIRs,context:c,apiId:Oe.body.apiDefinitionId}),Oe.body.apiDefinitionId;switch(Oe.error.error){case"UnauthorizedError":case"UserNotInOrgError":return c.failAndThrow("You do not have permissions to register the docs. Reach out to support@buildwithfern.com");default:return ee!=null?c.failAndThrow(`Failed to publish docs because API definition (${ee}) could not be uploaded. Please contact support@buildwithfern.com
2839
2839
  ${JSON.stringify(Oe.error)}`):c.failAndThrow(`Failed to publish docs because API definition could not be uploaded. Please contact support@buildwithfern.com
2840
2840
  ${JSON.stringify(Oe.error)}`)}}).resolve();if(C==null)return c.failAndThrow("Failed to publish docs.","Docs registration ID is missing.");c.logger.debug("Publishing docs...");let Q=await A.docs.v2.write.finishDocsRegister(Ori.FernRegistry.docs.v1.write.DocsRegistrationId(C),{docsDefinition:U});if(Q.ok){let K=LSe(M),X=rgi(K,K);c.logger.info(yd.green(`Published docs to ${X}`))}else switch(Q.error.error){case"UnauthorizedError":case"UserNotInOrgError":return c.failAndThrow("Insufficient permissions. Failed to publish docs to "+n);case"DocsRegistrationIdNotFound":return c.failAndThrow("Failed to publish docs to "+n,`Docs registration ID ${C} does not exist.`);default:return c.failAndThrow("Failed to publish docs to "+n,Q.error)}}async function jM1(e,t,r,n){let i=Date.now(),a=Object.keys(e).length;r.logger.debug(`Start uploading ${a} files...`);let u=_Io(Object.entries(e),n),c=0;for(let s of u){await Promise.all(s.map(async([l,{uploadUrl:O}])=>{let A=hs.of(l),E=fj(t,A);try{let C=_l_.lookup(E);await eY.put(O,await(0,DM1.readFile)(E),{headers:{"Content-Type":C===!1?"application/octet-stream":C,"Cache-Control":"public, max-age=31536000, immutable"}})}catch(C){r.failAndThrow(`Failed to upload ${E}`,C)}}));let o=Date.now();c+=s.length,r.logger.debug(`Uploaded ${c}/${a} files in ${o-i}ms`)}let p=Date.now();r.logger.debug(`Finished uploading ${a} files in ${p-i}ms`)}function EM1(e,t){let r=[];for(let[n,i]of Object.entries(e)){let a=hs.of(n),u=fj(t,a);r.push({relativeFilePath:a,absoluteFilePath:u,fileId:i.fileId})}return r}async function SM1(e,t){switch(await t.instrumentPostHogEvent({command:"docs-generation",properties:{error:JSON.stringify(e)}}),e.error){case"InvalidCustomDomainError":return t.failAndThrow("Your docs domain should end with docs.buildwithfern.com");case"InvalidDomainError":return t.failAndThrow("Please make sure that none of your custom domains are not overlapping (i.e. one is a substring of another)");case"UnauthorizedError":return t.failAndThrow("Please make sure that your FERN_TOKEN is set.");case"UserNotInOrgError":return t.failAndThrow("Please verify if you have access to the organization you are trying to publish the docs to. If you are not a member of the organization, please reach out to the organization owner.");case"UnavailableError":return t.failAndThrow("Failed to publish docs. Please try again later or reach out to Fern support at support@buildwithfern.com.");default:return t.failAndThrow("Failed to publish docs.",e)}}function Fy8(e){try{return new URL(LSe(e)).pathname}catch{return}}async function zy8({workspace:e,organization:t,context:r,snippetsConfig:n}){let i={};if(!e)return;let a={typescript:n.typescriptSdk?.package,python:n.pythonSdk?.package,java:n.javaSdk?.coordinate,go:n.goSdk?.githubRepo,csharp:n.csharpSdk?.package,ruby:n.rubySdk?.gem,php:n.phpSdk?.package,swift:n.swiftSdk?.package,rust:void 0};if(e.generatorsConfiguration?.groups)for(let u of e.generatorsConfiguration.groups)for(let c of u.generators){let p=BGc({apiName:e.workspaceName??"",organization:t,generatorInvocation:c}),s="";if(p?.outputConfig.type==="publish")switch(p.outputConfig.value.type){case"npm":case"nuget":case"pypi":case"rubygems":s=p.outputConfig.value.packageName;break;case"maven":s=p.outputConfig.value.coordinate;break;case"go":s=p.outputConfig.value.repoUrl;break}if(c.language==="php"&&c.config&&typeof c.config=="object"&&"packageName"in c.config&&(s=c.config.packageName??""),!!c.language&&c.language&&a[c.language]===s){let o=UV({workspace:e,generationLanguage:c.language,keywords:void 0,smartCasing:c.smartCasing,exampleGeneration:{disabled:!0,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},audiences:{type:"all"},readme:void 0,packageName:s,version:void 0,context:r,sourceResolver:new LV(r,e),dynamicGeneratorConfig:p}),l=w7o({ir:o,disableExamples:!0,smartCasing:c.smartCasing,generationLanguage:c.language,generatorConfig:p});l?i[c.language]={dynamicIR:l}:r.logger.debug(`Failed to create dynamic IR for ${c.language}`)}}if(Object.keys(i).length>0)return i}async function Qy8({dynamicIRs:e,dynamicIRUploadUrls:t,context:r,apiId:n}){if(Object.keys(t).length>0)for(let[i,a]of Object.entries(t)){let u=e[i]?.dynamicIR;u?(await fetch(a.uploadUrl,{method:"PUT",body:JSON.stringify(u),headers:{"Content-Type":"application/octet-stream","Content-Length":JSON.stringify(u).length.toString()}})).ok?r.logger.debug(`Uploaded dynamic IR for ${n}:${i}`):r.logger.warn(`Failed to upload dynamic IR for ${n}:${i}`):r.logger.warn(`Could not find matching dynamic IR to upload for ${n}:${i}`)}}async function hl_({organization:e,apiWorkspaces:t,ossWorkspaces:r,docsWorkspace:n,context:i,token:a,instanceUrl:u,preview:c,disableTemplates:p,disableDynamicSnippets:s}){let o=n.config.instances;if(n.config=bwi(n.config,{onError:A=>i.failAndThrow(A)},{substituteAsEmpty:c}),o.length===0){i.failAndThrow("No instances specified in docs.yml! Cannot register docs.");return}if(o.length>1&&u==null){i.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${o[0]?.url})`);return}let l=o.find(A=>A.url===u)??o[0];if(l==null){i.failAndThrow(`No docs instance with url ${u}. Failed to register.`);return}let O=[];l.customDomain!=null&&(typeof l.customDomain=="string"?O.push(l.customDomain):Array.isArray(l.customDomain)&&O.push(...l.customDomain)),await i.runInteractiveTask({name:l.url},async()=>{await CM1({docsWorkspace:n,customDomains:O,domain:l.url,token:a,organization:e,context:i,apiWorkspaces:t,ossWorkspaces:r,preview:c,editThisPage:l.editThisPage,isPrivate:l.private,disableTemplates:p,disableDynamicSnippets:s})})}var IB1=Xi(G1i(),1);var lpe={RequestReference:"requestReference",InlinedRequestProperty:"inlinedRequestProperty",Response:"response",StreamingResponse:"streamingResponse"};function A5(e,t){return r=>{r!=null&&e.docs?.(r,[...t,"docs"])}}function GPr({example:e,visitor:t,nodePath:r}){if(typeof e=="string")e.startsWith("$")&&t.exampleTypeReference?.(e,r);else if(qT(e))for(let n of Object.values(e))GPr({example:n,visitor:t,nodePath:r});else if(Array.isArray(e))for(let n of e)GPr({example:n,visitor:t,nodePath:r})}function txr(e){return(t,r,{_default:n,validation:i,location:a}={})=>{e.typeReference?.({typeReference:t,_default:n,validation:i,location:a,nodePath:r},r)}}function IM1({service:e,visitor:t,nodePath:r}){t.httpService?.(e,r),xq(e,{url:n=>{t.serviceBaseUrl?.(n,[...r,"url"])},"base-path":Hc,"display-name":Hc,availability:Hc,headers:n=>{MM1({headers:n,visitor:t,nodePath:[...r,"headers"]})},audiences:Hc,auth:Hc,"path-parameters":n=>{avu({pathParameters:n,visitor:t,nodePath:[...r,"path-parameters"]})},endpoints:n=>{for(let[i,a]of Object.entries(n)){let u=[...r,"endpoints",i];Ly8({endpointId:i,endpoint:a,service:e,visitor:t,nodePathForEndpoint:u})}},idempotent:Hc,transport:Hc,source:Hc})}function Ly8({endpointId:e,endpoint:t,service:r,visitor:n,nodePathForEndpoint:i}){let a=txr(n);n.httpEndpoint?.({endpointId:e,endpoint:t,service:r},i),xq(t,{docs:A5(n,i),"display-name":Hc,availability:Hc,"base-path":Hc,path:Hc,idempotent:Hc,url:u=>{n.endpointBaseUrl?.({baseUrl:u,service:r},[...i,"url"])},"path-parameters":u=>{avu({pathParameters:u,visitor:n,nodePath:[...i,"path-parameters"]})},request:u=>{if(u==null)return;let c=[...i,"request"];if(typeof u=="string"){a(u,c,{location:"requestReference"});return}xq(u,{name:Hc,docs:A5(n,c),"path-parameters":p=>{avu({pathParameters:p,visitor:n,nodePath:[...c,"path-parameters"]})},"query-parameters":p=>{if(p!=null)for(let[s,o]of Object.entries(p)){let l=[...c,"query-parameters",s];n.queryParameter?.({queryParameterKey:s,queryParameter:o},l),typeof o=="string"?a(o,l):xq(o,{name:Hc,docs:A5(n,l),availability:Hc,type:O=>{a(O,[...l,"type"],{_default:o.default,validation:o.validation})},"allow-multiple":Hc,audiences:Hc,encoding:Hc,default:Hc,validation:Hc})}},"content-type":Hc,headers:p=>{MM1({headers:p,visitor:n,nodePath:[...c,"headers"]})},body:p=>{if(p==null)return;let s=[...c,"body"];typeof p=="string"?a(p,s,{location:"requestReference"}):w9(p)?(n.typeDeclaration?.({typeName:{isInlined:!0,location:"inlinedRequest"},declaration:p},s),xq(p,{extends:o=>{if(o==null)return;let l=typeof o=="string"?[o]:o;for(let O of l){let A=[...s,"extends",O];n.extension?.(O,A),a(O,A)}},properties:o=>{if(o!=null)for(let[l,O]of Object.entries(o)){let A=[...s,"properties",l];typeof O=="string"?a(O,A,{location:lpe.InlinedRequestProperty}):xq(O,{name:Hc,docs:A5(n,A),availability:Hc,type:E=>{a(E,[...A,"type"],{location:lpe.InlinedRequestProperty,_default:O.default,validation:O.validation})},style:Hc,"content-type":Hc,audiences:Hc,encoding:Hc,default:Hc,validation:Hc})}},"extra-properties":Hc})):(A5(n,s)(p.docs),a(p.type,s))}})},audiences:Hc,method:Hc,auth:Hc,"stream-condition":u=>{n.streamCondition?.({streamCondition:u,endpoint:t},[...i,"stream-condition"])},"response-stream":u=>{u!=null&&(typeof u=="string"?a(u,[...i,"response-stream"],{location:lpe.StreamingResponse}):a(u.type,[...i,"response-stream"],{location:lpe.StreamingResponse}))},response:u=>{if(u==null)return;let c=[...i,"response"];typeof u=="string"?a(u,c,{location:lpe.Response}):xq(u,{docs:A5(n,c),type:p=>{p!=null&&a(p,[...c,"type"],{location:lpe.Response})},property:Hc,"status-code":Hc})},errors:u=>{if(u!=null)for(let c of u){let p=[...i,"errors",typeof c=="string"?c:c.error];typeof c=="string"?n.errorReference?.(c,p):xq(c,{docs:A5(n,p),error:s=>{n.errorReference?.(s,[...p,"error"])}})}},examples:u=>{if(u!=null)for(let[c,p]of u.entries())Uy8({nodePathForExample:[...i,{key:"examples",arrayIndex:c}],visitor:n,service:r,endpoint:t,example:p})},pagination:Hc,source:Hc,transport:Hc,retries:Hc})}function Uy8({nodePathForExample:e,visitor:t,service:r,endpoint:n,example:i}){if(i.headers==null&&i["path-parameters"]==null&&i["query-parameters"]==null&&i.request==null&&i.response==null&&i["code-samples"]!=null)return;t.exampleHttpEndpointCall?.({service:r,endpoint:n,example:i},e);let a=[...e,"headers"];if(t.exampleHeaders?.({service:r,endpoint:n,examples:i.headers},a),i.headers!=null)for(let o of Object.values(i.headers))GPr({example:o,visitor:t,nodePath:a});let u=[...e,"path-parameters"];if(t.examplePathParameters?.({service:r,endpoint:n,examples:i["path-parameters"]},u),i["path-parameters"]!=null)for(let o of Object.values(i["path-parameters"]))GPr({example:o,visitor:t,nodePath:u});let c=[...e,"query-parameters"];if(t.exampleQueryParameters?.({service:r,endpoint:n,examples:i["query-parameters"]},c),i["query-parameters"]!=null)for(let o of Object.values(i["query-parameters"]))GPr({example:o,visitor:t,nodePath:c});let p=[...e,"request"];t.exampleRequest?.({service:r,endpoint:n,example:i.request},p),i.request!=null&&GPr({example:i.request,visitor:t,nodePath:p});let s=[...e,"response"];if(t.exampleResponse?.({service:r,endpoint:n,example:i.response},s),i.response!=null&&gHi(n,i.response,{body:o=>{o.body!=null&&GPr({example:o.body,visitor:t,nodePath:s}),o.error!=null&&t.errorReference?.(o.error,[...s,"error"])},stream:o=>{for(let l of o.stream)GPr({example:l,visitor:t,nodePath:s})},events:o=>{for(let{data:l}of o.stream)GPr({example:l,visitor:t,nodePath:s})}}),i["code-samples"]!=null)for(let[o,l]of i["code-samples"].entries())t.exampleCodeSample?.({service:r,endpoint:n,example:i,sample:l},[...e,{key:"code-samples",arrayIndex:o}])}function avu({pathParameters:e,visitor:t,nodePath:r}){if(e==null)return;let n=txr(t);for(let[i,a]of Object.entries(e)){let u=[...r,i];t.pathParameter?.({pathParameterKey:i,pathParameter:a},u),J3a(a)?typeof a=="string"?t.variableReference?.(a,u):xq(a,{docs:A5(t,u),variable:c=>t.variableReference?.(c,[...u,"variable"]),availability:Hc}):typeof a=="string"?n(a,u):xq(a,{docs:A5(t,u),type:c=>{n(c,[...u,"type"],{_default:a.default,validation:a.validation})},availability:Hc,encoding:Hc,default:Hc,validation:Hc,name:Hc,audiences:Hc})}}function MM1({headers:e,visitor:t,nodePath:r}){if(e==null)return;let n=txr(t);for(let[i,a]of Object.entries(e)){let u=[...r,i];t.header?.({headerKey:i,header:a},u),typeof a=="string"?n(a,u):xq(a,{name:Hc,availability:Hc,type:c=>{n(c,u,{_default:a.default,validation:a.validation})},docs:A5(t,u),audiences:Hc,encoding:Hc,env:Hc,default:Hc,validation:Hc})}}function BM1({typeDeclarations:e,visitor:t,nodePath:r}){if(e!=null)for(let[n,i]of Object.entries(e)){let a=[...r,n];t.typeName?.(n,a),yl_({typeName:n,declaration:i,visitor:t,nodePathForType:a})}}function yl_({typeName:e,declaration:t,visitor:r,nodePathForType:n}){let i=txr(r);r.typeDeclaration?.({typeName:{isInlined:!1,name:e},declaration:t,nodePath:n},n);let a=u=>{if(u!=null)for(let[c,p]of u.entries()){let s=[...n,{key:"examples",arrayIndex:c}];r.exampleType?.({typeName:e,typeDeclaration:t,example:p},s),GPr({example:p.value,nodePath:s,visitor:r})}};vZ(t,{alias:u=>{typeof u=="string"?i(u,n):xq(u,{type:c=>{i(c,[...n,"type"])},docs:A5(r,n),availability:Hc,audiences:Hc,examples:a,validation:Hc,encoding:Hc,source:Hc,inline:Hc})},object:u=>{xq(u,{docs:A5(r,n),extends:c=>{if(c==null)return;let p=typeof c=="string"?[c]:c;for(let s of p){let o=[...n,"extends",s];r.extension?.(s,o),i(s,o)}},properties:c=>{if(c!=null)for(let[p,s]of Object.entries(c)){let o=[...n,"properties",p];typeof s=="string"?i(s,o):xq(s,{name:Hc,docs:A5(r,o),availability:Hc,type:l=>{i(l,[...o,"type"],{_default:s.default,validation:s.validation})},audiences:Hc,encoding:Hc,default:Hc,validation:Hc,access:Hc})}},"extra-properties":Hc,availability:Hc,audiences:Hc,encoding:Hc,source:Hc,examples:a,inline:Hc})},discriminatedUnion:u=>{xq(u,{docs:A5(r,n),discriminant:Hc,extends:c=>{if(c==null)return;let p=typeof c=="string"?[c]:c;for(let s of p){let o=[...n,"extends",s];r.extension?.(s,o),i(s,o)}},union:c=>{for(let[p,s]of Object.entries(c)){let o=[...n,"union",p];typeof s=="string"?i(s,o):xq(s,{docs:A5(r,o),name:Hc,key:Hc,type:l=>{typeof l=="string"&&i(l,[...n,"type"])},"display-name":Hc,availability:Hc})}},"base-properties":Hc,availability:Hc,audiences:Hc,encoding:Hc,source:Hc,examples:a,inline:Hc})},undiscriminatedUnion:u=>{xq(u,{docs:A5(r,n),discriminated:Hc,union:c=>{for(let[p,s]of c.entries()){let o=[...n,`union[${p}]`];typeof s!="string"&&xq(s,{docs:A5(r,o),type:l=>{i(l,[...n,"type"])},"display-name":Hc,validation:Hc})}},availability:Hc,audiences:Hc,encoding:Hc,source:Hc,examples:a,inline:Hc})},enum:u=>{xq(u,{docs:A5(r,n),enum:c=>{for(let p of c){let s=[...n,typeof p=="string"?p:p.name??p.value];typeof p!="string"&&xq(p,{docs:A5(r,s),name:Hc,value:Hc,casing:Hc})}},availability:Hc,audiences:Hc,default:Hc,encoding:Hc,source:Hc,examples:a,inline:Hc})}})}function TM1({errorDeclarations:e,visitor:t,nodePath:r}){if(e!=null)for(let[n,i]of Object.entries(e)){let a=[...r,n];t.errorDeclaration?.({errorName:n,declaration:i},a),Vy8({errorName:n,declaration:i,visitor:t,nodePathForError:a})}}function Vy8({errorName:e,declaration:t,visitor:r,nodePathForError:n}){let i=txr(r);typeof t=="string"?i(t,n):xq(t,{docs:A5(r,n),"status-code":Hc,type:a=>{if(a==null)return;let u=[...n,"type"];typeof a=="string"?i(a,u):yl_({typeName:e,declaration:a,visitor:r,nodePathForType:u})},examples:a=>{if(a!=null)for(let u of a){let c=[...n,"type"];r.exampleError?.({errorName:e,declaration:t,example:u},c)}}})}function qM1({imports:e,visitor:t,nodePath:r}){if(e!=null)for(let[n,i]of Object.entries(e))t.import?.({importPath:i,importedAs:n},[...r,n])}function xM1({webhook:e,visitor:t,nodePathForWebhook:r}){let n=txr(t);xq(e,{"display-name":Hc,method:Hc,examples:Hc,headers:i=>{Wy8({headers:i,visitor:t,nodePath:[...r,"headers"]})},payload:i=>{let a=[...r,"payload"];if(typeof i=="string"){n(i,a,{location:"requestReference"});return}if(Hy8(i)){n(i.type,[...a,"type"],{location:"requestReference"});return}let u=[...a];t.typeDeclaration?.({typeName:{isInlined:!0,location:"inlinedRequest"},declaration:i},u),xq(i,{name:Hc,extends:c=>{if(c==null)return;let p=typeof c=="string"?[c]:c;for(let s of p){let o=[...u,"extends",s];t.extension?.(s,o),n(s,o)}},properties:c=>{if(c!=null)for(let[p,s]of Object.entries(c)){let o=[...u,"properties",p];typeof s=="string"?n(s,o,{location:lpe.InlinedRequestProperty}):xq(s,{name:Hc,docs:A5(t,o),availability:Hc,type:l=>{n(l,[...o,"type"],{_default:s.default,validation:s.validation,location:lpe.InlinedRequestProperty})},audiences:Hc,encoding:Hc,default:Hc,validation:Hc,access:Hc})}}})},audiences:Hc,availability:Hc,docs:A5(t,r)})}function Wy8({headers:e,visitor:t,nodePath:r}){if(e==null)return;let n=txr(t);for(let[i,a]of Object.entries(e)){let u=[...r,i];t.header?.({headerKey:i,header:a},u),typeof a=="string"?n(a,u):xq(a,{name:Hc,availability:Hc,type:c=>{n(c,u,{_default:a.default,validation:a.validation})},docs:A5(t,u),audiences:Hc,encoding:Hc,env:Hc,default:Hc,validation:Hc})}}function Hy8(e){return e.type!=null}function Zbe(e,t){xq(e,{docs:A5(t,[]),imports:r=>{qM1({imports:r,visitor:t,nodePath:["imports"]})},types:r=>{BM1({typeDeclarations:r,visitor:t,nodePath:["types"]})},service:r=>{r!=null&&IM1({service:r,visitor:t,nodePath:["service"]})},webhooks:r=>{for(let[n,i]of Object.entries(r??{}))xM1({webhook:i,visitor:t,nodePathForWebhook:["webhooks",n]})},channel:Hc,errors:r=>{TM1({errorDeclarations:r,visitor:t,nodePath:["errors"]})}})}function vl_(e,t){xq(e,{docs:Hc,imports:Hc,types:Hc,service:Hc,webhooks:Hc,errors:Hc,channel:Hc,export:r=>{t.export?.(typeof r=="string"?r:r?.dependency,["export"])},navigation:r=>{t.navigation?.(r,["navigation"])}})}function bl_(e,t){t.file?.(e,[]),xq(e,{version:Hc,product:Hc,name:Hc,"default-url":Hc,"display-name":Hc,imports:Hc,auth:Hc,"idempotency-headers":Hc,"auth-schemes":r=>Object.entries(r??{}).map(([n,i])=>{F3l(i)&&t.oauth?.({name:n,oauth:i},["auth-scheme",n])}),pagination:Hc,"default-environment":r=>{t.defaultEnvironment?.(r,["default-environment"])},docs:Hc,headers:Hc,environments:r=>{if(r!=null)for(let[n,i]of Object.entries(r))t.environment?.({environmentId:n,environment:i},["environments",n])},"error-discrimination":r=>{t.errorDiscrimination?.(r,["error-discrimination"])},audiences:Hc,errors:r=>{if(r!=null)for(let n of r)t.errorReference?.(n,["errors",n])},"base-path":Hc,"path-parameters":r=>{avu({pathParameters:r,visitor:t,nodePath:["path-parameters"]})},variables:r=>{if(r!=null)for(let[n,i]of Object.entries(r))t.variableDeclaration?.({variableId:n,variable:i},["variables",n])}})}var hJc=new RegExp("^[a-zA-Z][a-zA-Z0-9_]*$");function NM1({relativeFilepath:e,contents:t,allRuleVisitors:r,addViolations:n}){function i(a){let u=(c,p)=>{for(let s of r){let o=s.definitionFile?.[a];if(o!=null){let l=o(c,{relativeFilepath:e,contents:t});n(l.map(O=>({severity:O.severity,relativeFilepath:e,nodePath:p,message:O.message})))}}};return{[a]:u}}return{...i("docs"),...i("import"),...i("typeReference"),...i("typeDeclaration"),...i("typeName"),...i("httpService"),...i("httpEndpoint"),...i("pathParameter"),...i("queryParameter"),...i("streamCondition"),...i("header"),...i("errorDeclaration"),...i("errorReference"),...i("exampleType"),...i("exampleTypeReference"),...i("exampleHttpEndpointCall"),...i("exampleCodeSample"),...i("exampleHeaders"),...i("examplePathParameters"),...i("exampleQueryParameters"),...i("exampleRequest"),...i("exampleResponse"),...i("variableReference"),...i("extension"),...i("serviceBaseUrl"),...i("endpointBaseUrl"),...i("exampleError")}}function RM1({relativeFilepath:e,contents:t,allRuleVisitors:r,addViolations:n}){function i(a){let u=(c,p)=>{for(let s of r){let o=s.packageMarker?.[a];if(o!=null){let l=o(c,{relativeFilepath:e,contents:t});n(l.map(O=>({severity:O.severity,relativeFilepath:e,nodePath:p,message:O.message})))}}};return{[a]:u}}return{...i("export"),...i("navigation")}}function FM1({relativeFilepath:e,contents:t,allRuleVisitors:r,addViolations:n}){function i(a){let u=(c,p)=>{for(let s of r){let o=s.rootApiFile?.[a];if(o!=null){let l=o(c,{relativeFilepath:e,contents:t});n(l.map(O=>({severity:O.severity,relativeFilepath:e,nodePath:p,message:O.message})))}}};return{[a]:u}}return{...i("file"),...i("oauth"),...i("defaultEnvironment"),...i("environment"),...i("errorDiscrimination"),...i("errorReference"),...i("variableDeclaration"),...i("variableReference"),...i("pathParameter")}}var gl_={name:"content-type-only-for-multipart",DISABLE_RULE:!1,create:()=>({definitionFile:{httpEndpoint:({endpoint:e})=>{if(e.request==null)return[];if(bHi(e.request)!=null)return[];if(typeof e.request!="string"&&e.request.body!=null&&w9(e.request.body)){let r=[];for(let[n,i]of Object.entries(e.request.body.properties??{}))typeof i!="string"&&i["content-type"]!=null&&r.push({severity:"fatal",message:`${n} has content-type, but the request is not multipart`});return r}return[]}}})};var PR=mSe({generationLanguage:void 0,keywords:void 0,smartCasing:!1});var ml_={name:"exploded-form-data-is-array",create:({workspace:e})=>{let t=new rN(e);return{definitionFile:{httpEndpoint:({endpoint:r},{relativeFilepath:n,contents:i})=>{if(r.request==null||typeof r.request=="string"||r.request?.body==null||typeof r.request.body=="string")return[];if(!Gy8(r.request.body))return[];let a=[];for(let[u,c]of Object.entries(r.request.body.properties??{})){if(typeof c=="string"||c.style!=="exploded")continue;let p=xE({relativeFilepath:n,definitionFile:i,casingsGenerator:PR,rootApiFile:e.definition.rootApiFile.contents}),s=t.resolveType({type:c.type,file:p});if(s==null)return[];zM1(s)||a.push({message:`${u} is exploded and must be a list. Did you mean list<${c.type}>?`,severity:"error"})}return a}}}}};function zM1(e){return e._type!=="container"?!1:e.container._type==="list"?!0:e.container._type==="optional"||e.container._type==="nullable"?zM1(e.container.itemType):!1}function Gy8(e){return e?.properties!=null}var Ol_={name:"import-file-exists",create:({workspace:e})=>{let t=Object.keys(Ali(e.definition)),r=new Set;return t.forEach(n=>{let i=Jl(e.definition.absoluteFilePath,hs.of(n));r.add(i)}),{definitionFile:{import:({importedAs:n,importPath:i},{relativeFilepath:a})=>{let u=[],c=Jl(e.definition.absoluteFilePath,cg(a),hs.of(i));return r.has(c)||u.push({severity:"fatal",message:`Import ${yd.bold(n)} points to non-existent path ${yd.bold(i)}.`}),u}}}}};function yJc(e){return e.definition.rootApiFile.contents.environments==null?[]:Object.values(e.definition.rootApiFile.contents.environments).reduce((t,r)=>{if(ret(r))for(let n of Object.keys(r.urls))t.includes(n)||t.push(n);return t},[])}var Al_={name:"matching-environment-urls",create:({workspace:e})=>{let t=yJc(e);return t.length===0?{}:{rootApiFile:{environment:({environmentId:r,environment:n})=>{let i=[],a=u=>{i.push({severity:"fatal",message:`Environment ${r} is missing URL for ${yd.bold(u)}`})};return Vzr(n,{singleBaseUrl:()=>{for(let u of t)a(u)},multipleBaseUrls:u=>{for(let c of t)u.urls[c]==null&&a(c)}}),i}}}}};var Pl_={name:"no-circular-imports",DISABLE_RULE:!0,create:({workspace:e})=>{let t=Jy8(e.definition.namedDefinitionFiles);return{definitionFile:{import:({importPath:r},{relativeFilepath:n})=>{let i=t[n];if(i==null)return[];let a=mIi({referencedIn:n,importPath:hs.of(r)});return i.filter(({chainWithoutStartingFilepath:c})=>c.length===0||c[0]===a).map(c=>({severity:"fatal",message:c.chainWithoutStartingFilepath.length===0?"A file cannot import itself":`Circular import detected: ${[c.startingFilepath,...c.chainWithoutStartingFilepath,c.startingFilepath].join(" -> ")}`}))}}}}};function Jy8(e){let t={};for(let r of qSr(e))t[r]=QM1(r,[r],e);return t}function QM1(e,t,r){let n=[],i=r[e];if(i==null)return[];if(i.contents.imports!=null)for(let a of Object.values(i.contents.imports)){let u=mIi({referencedIn:e,importPath:hs.of(a)});t.includes(u)?t[0]===u&&t[0]===Ky8(t)&&n.push({startingFilepath:u,chainWithoutStartingFilepath:t.slice(1)}):n.push(...QM1(u,[...t,u],r))}return n}function Ky8(e){return e.reduce((t,r)=>r<t?r:t)}var vJc=class{workspace;typeResolver;constructor(t){this.workspace=t,this.typeResolver=new rN(t)}isTypeComplex(t,r){let n=xE({relativeFilepath:r.relativeFilepath,definitionFile:r.contents,casingsGenerator:PR,rootApiFile:this.workspace.definition.rootApiFile.contents}),i=this.typeResolver.resolveType({type:t,file:n});if(i==null)return;let a=new Set;return this.isResolvedReferenceComplex({type:i,file:n,visited:a})}isResolvedReferenceComplex({type:t,file:r,visited:n}){switch(t._type){case"container":return this.isResolvedContainerComplex({type:t.container,file:r,visited:n});case"named":return this.isNamedTypeComplex({type:t,file:r,visited:n});case"primitive":return!1;case"unknown":return!0;default:cc(t)}}isResolvedContainerComplex({type:t,file:r,visited:n}){switch(t._type){case"literal":return!1;case"map":return(this.isResolvedReferenceComplex({type:t.keyType,file:r,visited:n})||this.isResolvedReferenceComplex({type:t.valueType,file:r,visited:n}))&&!(t.keyType._type==="primitive"&&t.keyType.primitive.v1==="STRING"&&t.valueType._type==="unknown");case"optional":case"nullable":case"list":case"set":return this.isResolvedReferenceComplex({type:t.itemType,file:r,visited:n});default:cc(t)}}isNamedTypeComplex({type:t,file:r,visited:n}){if(n.has(t.rawName))return!1;if(n.add(t.rawName),j1i(t.declaration))return!0;if(ADr(t.declaration))return!1;if(eR(t.declaration))return this.objectHasComplexProperties({typeName:t.rawName,objectDeclaration:t.declaration,file:r,visited:n});if(K3a(t.declaration)){for(let i of t.declaration.union){let a=typeof i=="string"?i:i.type,u=this.isTypeComplex(a,{contents:r.definitionFile,relativeFilepath:r.relativeFilepath});if(u!=null&&u)return!0}return!1}cc(t.declaration)}objectHasComplexProperties({typeName:t,objectDeclaration:r,file:n,visited:i}){return KCr({typeName:t,objectDeclaration:r,typeResolver:this.typeResolver,definitionFile:n.definitionFile,workspace:this.workspace,filepathOfDeclaration:n.relativeFilepath,smartCasing:!1}).some(u=>this.isComplex({type:u.resolvedPropertyType,file:n,visited:i}))}isComplex({type:t,file:r,visited:n}){switch(t._type){case"named":return this.isNamedTypeComplex({type:t,file:r,visited:n});case"primitive":case"unknown":return!1;case"container":return this.isComplexContainer({type:t.container,file:r,visited:n});default:cc(t)}}isComplexContainer({type:t,file:r,visited:n}){switch(t._type){case"literal":return!1;case"map":return this.isComplex({type:t.keyType,file:r,visited:n})||this.isComplex({type:t.valueType,file:r,visited:n});case"optional":case"nullable":case"list":case"set":return this.isComplex({type:t.itemType,file:r,visited:n});default:cc(t)}}};var wl_={name:"no-complex-query-params",create:({workspace:e})=>{let t=new vJc(e);return{definitionFile:{queryParameter:({queryParameter:r},n)=>{let i=typeof r=="string"?r:r.type,a=t.isTypeComplex(i,n);return a!=null&&a?[{severity:"fatal",message:`${i} is not a valid type for a query parameter`}]:[]}}}}};var jl_={name:"no-conflicting-endpoint-parameters",create:()=>({definitionFile:{pathParameter:({pathParameterKey:e})=>e===L1s?[{severity:"fatal",message:`Path parameter ${yd.bold(e)} is not suitable for code generation, because it can conflict with the request body parameter.`}]:[]}})};function ovu({service:e,endpoint:t}){return e["base-path"]+t.path}var bJc=class{root=new El_;registerEndpoint(t){this.root.insert(this.getPathPartsForEndpoint(t),t)}getConflictingEndpoints(t){return this.root.getMatchingEndpoints(this.getPathPartsForEndpoint(t)).filter(r=>!(r.relativeFilepath===t.relativeFilepath&&r.endpointId===t.endpointId)&&r.endpoint.method===t.endpoint.method)}getPathPartsForEndpoint(t){return ovu({service:t.service,endpoint:t.endpoint}).split("/").filter(r=>r.length>0)}},El_=class e{childPaths={};childPathParam;endpointsThatEndWithThisNode=[];insert(t,r){let[n,...i]=t;if(n==null){this.endpointsThatEndWithThisNode.push(r);return}(this.isPathParam(n)?this.childPathParam??=new e:this.childPaths[n]??=new e).insert(i,r)}getMatchingEndpoints(t){let[r,...n]=t;if(r==null)return this.endpointsThatEndWithThisNode;let i=[];if(this.isPathParam(r))i.push(...Object.values(this.childPaths).flatMap(a=>a.getMatchingEndpoints(n)));else{let a=this.childPaths[r];a!=null&&i.push(...a.getMatchingEndpoints(n))}return this.childPathParam!=null&&i.push(...this.childPathParam.getMatchingEndpoints(n)),i}isPathParam(t){return t.startsWith("{")&&t.endsWith("}")}};var Sl_={name:"no-conflicting-endpoint-paths",create:({workspace:e})=>{let t=new bJc;return FZ(e,(r,n)=>{Zbe(n,{httpEndpoint:({service:i,endpointId:a,endpoint:u})=>{t.registerEndpoint({service:i,endpointId:a,endpoint:u,relativeFilepath:r})}})}),{definitionFile:{httpEndpoint:({service:r,endpoint:n,endpointId:i},{relativeFilepath:a})=>{let u=t.getConflictingEndpoints({service:r,endpointId:i,endpoint:n,relativeFilepath:a});return u.length===0?[]:[{severity:"warning",message:[`Endpoint path ${ovu({service:r,endpoint:n})} conflicts with other endpoints:`,...u.map(c=>` - ${c.relativeFilepath} -> ${c.endpointId} ${yd.dim(ovu({service:c.service,endpoint:c.endpoint}))}`)].join(`