fern-api 0.42.10 → 0.42.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.cjs +3 -3
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -1754,7 +1754,7 @@ ${l.indent}`:""}${i4c(o)}:${f.indent?" ":""}`;return u=!1,c=!0,f.objectItem=void
|
|
|
1754
1754
|
`+e.slice(u+1):d+=e.slice(i),d.slice(1)}function W1O(e){for(var t="",r=0,n,i=0;i<e.length;r>=65536?i+=2:i++)r=tsi(e,i),n=gJ[r],!n&&asi(r)?(t+=e[i],r>=65536&&(t+=e[i+1])):t+=n||N1O(r);return t}function H1O(e,t,r){var n="",i=e.tag,a,u,f;for(a=0,u=r.length;a<u;a+=1)f=r[a],e.replacer&&(f=e.replacer.call(r,String(a),f)),(qwr(e,t,f,!1,!1)||typeof f>"u"&&qwr(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}function Z3c(e,t,r,n){var i="",a=e.tag,u,f,d;for(u=0,f=r.length;u<f;u+=1)d=r[u],e.replacer&&(d=e.replacer.call(r,String(u),d)),(qwr(e,t+1,d,!0,!0,!1,!0)||typeof d>"u"&&qwr(e,t+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=pLo(e,t)),e.dump&&nsi===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function $1O(e,t,r){var n="",i=e.tag,a=Object.keys(r),u,f,d,c,o;for(u=0,f=a.length;u<f;u+=1)o="",n!==""&&(o+=", "),e.condenseFlow&&(o+='"'),d=a[u],c=r[d],e.replacer&&(c=e.replacer.call(r,d,c)),qwr(e,t,d,!1,!1)&&(e.dump.length>1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),qwr(e,t,c,!1,!1)&&(o+=e.dump,n+=o));e.tag=i,e.dump="{"+n+"}"}function J1O(e,t,r,n){var i="",a=e.tag,u=Object.keys(r),f,d,c,o,l,g;if(e.sortKeys===!0)u.sort();else if(typeof e.sortKeys=="function")u.sort(e.sortKeys);else if(e.sortKeys)throw new VX("sortKeys must be a boolean or a function");for(f=0,d=u.length;f<d;f+=1)g="",(!n||i!=="")&&(g+=pLo(e,t)),c=u[f],o=r[c],e.replacer&&(o=e.replacer.call(r,c,o)),qwr(e,t+1,c,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&nsi===e.dump.charCodeAt(0)?g+="?":g+="? "),g+=e.dump,l&&(g+=pLo(e,t)),qwr(e,t+1,o,!0,l)&&(e.dump&&nsi===e.dump.charCodeAt(0)?g+=":":g+=": ",g+=e.dump,i+=g));e.tag=a,e.dump=i||"{}"}function k3c(e,t,r){var n,i,a,u,f,d;for(i=r?e.explicitTypes:e.implicitTypes,a=0,u=i.length;a<u;a+=1)if(f=i[a],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof t=="object"&&t instanceof f.instanceOf)&&(!f.predicate||f.predicate(t))){if(r?f.multi&&f.representName?e.tag=f.representName(t):e.tag=f.tag:e.tag="?",f.represent){if(d=e.styleMap[f.tag]||f.defaultStyle,TNc.call(f.represent)==="[object Function]")n=f.represent(t,d);else if(qNc.call(f.represent,d))n=f.represent[d](t,d);else throw new VX("!<"+f.tag+'> tag resolver accepts not "'+d+'" style');e.dump=n}return!0}return!1}function qwr(e,t,r,n,i,a,u){e.tag=null,e.dump=r,k3c(e,r,!1)||k3c(e,r,!0);var f=TNc.call(e.dump),d=n,c;n&&(n=e.flowLevel<0||e.flowLevel>t);var o=f==="[object Object]"||f==="[object Array]",l,g;if(o&&(l=e.duplicates.indexOf(r),g=l!==-1),(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&t>0)&&(i=!1),g&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(o&&g&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),f==="[object Object]")n&&Object.keys(e.dump).length!==0?(J1O(e,t,e.dump,i),g&&(e.dump="&ref_"+l+e.dump)):($1O(e,t,e.dump),g&&(e.dump="&ref_"+l+" "+e.dump));else if(f==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!u&&t>0?Z3c(e,t-1,e.dump,i):Z3c(e,t,e.dump,i),g&&(e.dump="&ref_"+l+e.dump)):(H1O(e,t,e.dump),g&&(e.dump="&ref_"+l+" "+e.dump));else if(f==="[object String]")e.tag!=="?"&&U1O(e,e.dump,t,a,d);else{if(f==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new VX("unacceptable kind of an object to dump "+f)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function G1O(e,t){var r=[],n=[],i,a;for(hLo(e,r,n),i=0,a=n.length;i<a;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(a)}function hLo(e,t,r){var n,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)hLo(e[i],t,r);else for(n=Object.keys(e),i=0,a=n.length;i<a;i+=1)hLo(e[n[i]],t,r)}function K1O(e,t){t=t||{};var r=new B1O(t);r.noRefs||G1O(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),qwr(r,0,n,!0,!0)?r.dump+`
|
|
1755
1755
|
`:""}var Y1O=K1O,X1O={dump:Y1O};function OLo(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Q1O=jV,Z1O=rNc,k1O=oNc,ejO=fNc,tjO=dNc,rjO=vLo,njO=xNc.load,ijO=xNc.loadAll,PLo=X1O.dump,jLo=VX,ajO={binary:vNc,float:lNc,map:aNc,null:uNc,pairs:gNc,set:mNc,timestamp:hNc,bool:sNc,int:cNc,merge:yNc,omap:bNc,seq:iNc,str:nNc},ojO=OLo("safeLoad","load"),ujO=OLo("safeLoadAll","loadAll"),sjO=OLo("safeDump","dump"),cjO={Type:Q1O,Schema:Z1O,FAILSAFE_SCHEMA:k1O,JSON_SCHEMA:ejO,CORE_SCHEMA:tjO,DEFAULT_SCHEMA:rjO,load:njO,loadAll:ijO,dump:PLo,YAMLException:jLo,types:ajO,safeLoad:ojO,safeLoadAll:ujO,safeDump:sjO},av=cjO;var $T;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let a={};for(let u of i)a[u]=u;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(f=>typeof i[i[f]]!="number"),u={};for(let f of a)u[f]=i[f];return e.objectValues(u)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let u in i)Object.prototype.hasOwnProperty.call(i,u)&&a.push(u);return a},e.find=(i,a)=>{for(let u of i)if(a(u))return u},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(u=>typeof u=="string"?`'${u}'`:u).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})($T||($T={}));var DLo;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(DLo||(DLo={}));var p0=$T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),y4r=e=>{switch(typeof e){case"undefined":return p0.undefined;case"string":return p0.string;case"number":return isNaN(e)?p0.nan:p0.number;case"boolean":return p0.boolean;case"function":return p0.function;case"bigint":return p0.bigint;case"symbol":return p0.symbol;case"object":return Array.isArray(e)?p0.array:e===null?p0.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?p0.promise:typeof Map<"u"&&e instanceof Map?p0.map:typeof Set<"u"&&e instanceof Set?p0.set:typeof Date<"u"&&e instanceof Date?p0.date:p0.object;default:return p0.unknown}},L_=$T.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ljO=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Q1e=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(let u of a.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)n._errors.push(r(u));else{let f=n,d=0;for(;d<u.path.length;){let c=u.path[d];d===u.path.length-1?(f[c]=f[c]||{_errors:[]},f[c]._errors.push(r(u))):f[c]=f[c]||{_errors:[]},f=f[c],d++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,$T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Q1e.create=e=>new Q1e(e);var osi=(e,t)=>{let r;switch(e.code){case L_.invalid_type:e.received===p0.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case L_.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,$T.jsonStringifyReplacer)}`;break;case L_.unrecognized_keys:r=`Unrecognized key(s) in object: ${$T.joinValues(e.keys,", ")}`;break;case L_.invalid_union:r="Invalid input";break;case L_.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${$T.joinValues(e.options)}`;break;case L_.invalid_enum_value:r=`Invalid enum value. Expected ${$T.joinValues(e.options)}, received '${e.received}'`;break;case L_.invalid_arguments:r="Invalid function arguments";break;case L_.invalid_return_type:r="Invalid function return type";break;case L_.invalid_date:r="Invalid date";break;case L_.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:$T.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case L_.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case L_.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case L_.custom:r="Invalid input";break;case L_.invalid_intersection_types:r="Intersection results could not be merged";break;case L_.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case L_.not_finite:r="Number must be finite";break;default:r=t.defaultError,$T.assertNever(e)}return{message:r}},WNc=osi;function fjO(e){WNc=e}function zGi(){return WNc}var BGi=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],u={...i,path:a},f="",d=n.filter(c=>!!c).slice().reverse();for(let c of d)f=c(u,{data:t,defaultError:f}).message;return{...i,path:a,message:i.message||f}},djO=[];function R0(e,t){let r=BGi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,zGi(),osi].filter(n=>!!n)});e.common.issues.push(r)}var h9=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return P1;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return h9.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:a,value:u}=i;if(a.status==="aborted"||u.status==="aborted")return P1;a.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof u.value<"u"||i.alwaysSet)&&(n[a.value]=u.value)}return{status:t.value,value:n}}},P1=Object.freeze({status:"aborted"}),HNc=e=>({status:"dirty",value:e}),WX=e=>({status:"valid",value:e}),SLo=e=>e.status==="aborted",ELo=e=>e.status==="dirty",usi=e=>e.status==="valid",IGi=e=>typeof Promise<"u"&&e instanceof Promise,em;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(em||(em={}));var sxe=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},UNc=(e,t)=>{if(usi(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Q1e(e.common.issues);return this._error=r,this._error}}};function Yj(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(u,f)=>u.code!=="invalid_type"?{message:f.defaultError}:typeof f.data>"u"?{message:n??f.defaultError}:{message:r??f.defaultError},description:i}}var Xj=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return y4r(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:y4r(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new h9,ctx:{common:t.parent.common,data:t.data,parsedType:y4r(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(IGi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:y4r(t)},a=this._parseSync({data:t,path:i.path,parent:i});return UNc(i,a)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:y4r(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(IGi(i)?i:Promise.resolve(i));return UNc(n,a)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let u=t(i),f=()=>a.addIssue({code:L_.custom,...n(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(d=>d?!0:(f(),!1)):u?!0:(f(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new k1e({schema:this,typeName:pO.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return eCt.create(this,this._def)}nullable(){return zwr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z1e.create(this,this._def)}promise(){return g4r.create(this,this._def)}or(t){return eQr.create([this,t],this._def)}and(t){return tQr.create(this,t,this._def)}transform(t){return new k1e({...Yj(this._def),schema:this,typeName:pO.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new oQr({...Yj(this._def),innerType:this,defaultValue:r,typeName:pO.ZodDefault})}brand(){return new RGi({typeName:pO.ZodBranded,type:this,...Yj(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new AMn({...Yj(this._def),innerType:this,catchValue:r,typeName:pO.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return uQr.create(this,t)}readonly(){return zMn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},pjO=/^c[^\s-]{8,}$/i,_jO=/^[a-z][a-z0-9]*$/,hjO=/^[0-9A-HJKMNP-TV-Z]{26}$/,yjO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,vjO=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bjO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wLo,gjO=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,mjO=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,OjO=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function PjO(e,t){return!!((t==="v4"||!t)&&gjO.test(e)||(t==="v6"||!t)&&mjO.test(e))}var X1e=class extends Xj{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==p0.string){let a=this._getOrReturnCtx(t);return R0(a,{code:L_.invalid_type,expected:p0.string,received:a.parsedType}),P1}let n=new h9,i;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let u=t.data.length>a.value,f=t.data.length<a.value;(u||f)&&(i=this._getOrReturnCtx(t,i),u?R0(i,{code:L_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):f&&R0(i,{code:L_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")vjO.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"email",code:L_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")wLo||(wLo=new RegExp(bjO,"u")),wLo.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"emoji",code:L_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")yjO.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"uuid",code:L_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")pjO.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"cuid",code:L_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")_jO.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"cuid2",code:L_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")hjO.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"ulid",code:L_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),R0(i,{validation:"url",code:L_.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"regex",code:L_.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?OjO(a).test(t.data)||(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?PjO(t.data,a.version)||(i=this._getOrReturnCtx(t,i),R0(i,{validation:"ip",code:L_.invalid_string,message:a.message}),n.dirty()):$T.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:L_.invalid_string,...em.errToObj(n)})}_addCheck(t){return new X1e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...em.errToObj(t)})}url(t){return this._addCheck({kind:"url",...em.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...em.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...em.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...em.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...em.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...em.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...em.errToObj(t)})}datetime(t){var r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,...em.errToObj(t==null?void 0:t.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...em.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...em.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...em.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...em.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...em.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...em.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...em.errToObj(r)})}nonempty(t){return this.min(1,em.errToObj(t))}trim(){return new X1e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X1e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X1e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};X1e.create=e=>{var t;return new X1e({checks:[],typeName:pO.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Yj(e)})};function jjO(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(e.toFixed(i).replace(".","")),u=parseInt(t.toFixed(i).replace(".",""));return a%u/Math.pow(10,i)}var T8t=class extends Xj{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==p0.number){let a=this._getOrReturnCtx(t);return R0(a,{code:L_.invalid_type,expected:p0.number,received:a.parsedType}),P1}let n,i=new h9;for(let a of this._def.checks)a.kind==="int"?$T.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?jjO(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.not_finite,message:a.message}),i.dirty()):$T.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,em.toString(r))}gt(t,r){return this.setLimit("min",t,!1,em.toString(r))}lte(t,r){return this.setLimit("max",t,!0,em.toString(r))}lt(t,r){return this.setLimit("max",t,!1,em.toString(r))}setLimit(t,r,n,i){return new T8t({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:em.toString(i)}]})}_addCheck(t){return new T8t({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:em.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:em.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:em.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:em.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:em.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:em.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:em.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:em.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:em.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&$T.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};T8t.create=e=>new T8t({checks:[],typeName:pO.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Yj(e)});var q8t=class extends Xj{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==p0.bigint){let a=this._getOrReturnCtx(t);return R0(a,{code:L_.invalid_type,expected:p0.bigint,received:a.parsedType}),P1}let n,i=new h9;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),R0(n,{code:L_.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):$T.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,em.toString(r))}gt(t,r){return this.setLimit("min",t,!1,em.toString(r))}lte(t,r){return this.setLimit("max",t,!0,em.toString(r))}lt(t,r){return this.setLimit("max",t,!1,em.toString(r))}setLimit(t,r,n,i){return new q8t({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:em.toString(i)}]})}_addCheck(t){return new q8t({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:em.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:em.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:em.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:em.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:em.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};q8t.create=e=>{var t;return new q8t({checks:[],typeName:pO.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Yj(e)})};var QXr=class extends Xj{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==p0.boolean){let n=this._getOrReturnCtx(t);return R0(n,{code:L_.invalid_type,expected:p0.boolean,received:n.parsedType}),P1}return WX(t.data)}};QXr.create=e=>new QXr({typeName:pO.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Yj(e)});var Awr=class extends Xj{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==p0.date){let a=this._getOrReturnCtx(t);return R0(a,{code:L_.invalid_type,expected:p0.date,received:a.parsedType}),P1}if(isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return R0(a,{code:L_.invalid_date}),P1}let n=new h9,i;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),R0(i,{code:L_.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):$T.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Awr({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:em.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:em.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Awr.create=e=>new Awr({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:pO.ZodDate,...Yj(e)});var xMn=class extends Xj{_parse(t){if(this._getType(t)!==p0.symbol){let n=this._getOrReturnCtx(t);return R0(n,{code:L_.invalid_type,expected:p0.symbol,received:n.parsedType}),P1}return WX(t.data)}};xMn.create=e=>new xMn({typeName:pO.ZodSymbol,...Yj(e)});var ZXr=class extends Xj{_parse(t){if(this._getType(t)!==p0.undefined){let n=this._getOrReturnCtx(t);return R0(n,{code:L_.invalid_type,expected:p0.undefined,received:n.parsedType}),P1}return WX(t.data)}};ZXr.create=e=>new ZXr({typeName:pO.ZodUndefined,...Yj(e)});var kXr=class extends Xj{_parse(t){if(this._getType(t)!==p0.null){let n=this._getOrReturnCtx(t);return R0(n,{code:L_.invalid_type,expected:p0.null,received:n.parsedType}),P1}return WX(t.data)}};kXr.create=e=>new kXr({typeName:pO.ZodNull,...Yj(e)});var b4r=class extends Xj{constructor(){super(...arguments),this._any=!0}_parse(t){return WX(t.data)}};b4r.create=e=>new b4r({typeName:pO.ZodAny,...Yj(e)});var Cwr=class extends Xj{constructor(){super(...arguments),this._unknown=!0}_parse(t){return WX(t.data)}};Cwr.create=e=>new Cwr({typeName:pO.ZodUnknown,...Yj(e)});var tCt=class extends Xj{_parse(t){let r=this._getOrReturnCtx(t);return R0(r,{code:L_.invalid_type,expected:p0.never,received:r.parsedType}),P1}};tCt.create=e=>new tCt({typeName:pO.ZodNever,...Yj(e)});var TMn=class extends Xj{_parse(t){if(this._getType(t)!==p0.undefined){let n=this._getOrReturnCtx(t);return R0(n,{code:L_.invalid_type,expected:p0.void,received:n.parsedType}),P1}return WX(t.data)}};TMn.create=e=>new TMn({typeName:pO.ZodVoid,...Yj(e)});var Z1e=class extends Xj{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==p0.array)return R0(r,{code:L_.invalid_type,expected:p0.array,received:r.parsedType}),P1;if(i.exactLength!==null){let u=r.data.length>i.exactLength.value,f=r.data.length<i.exactLength.value;(u||f)&&(R0(r,{code:u?L_.too_big:L_.too_small,minimum:f?i.exactLength.value:void 0,maximum:u?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(R0(r,{code:L_.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(R0(r,{code:L_.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((u,f)=>i.type._parseAsync(new sxe(r,u,r.path,f)))).then(u=>h9.mergeArray(n,u));let a=[...r.data].map((u,f)=>i.type._parseSync(new sxe(r,u,r.path,f)));return h9.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new Z1e({...this._def,minLength:{value:t,message:em.toString(r)}})}max(t,r){return new Z1e({...this._def,maxLength:{value:t,message:em.toString(r)}})}length(t,r){return new Z1e({...this._def,exactLength:{value:t,message:em.toString(r)}})}nonempty(t){return this.min(1,t)}};Z1e.create=(e,t)=>new Z1e({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pO.ZodArray,...Yj(t)});function MMn(e){if(e instanceof f7){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=eCt.create(MMn(n))}return new f7({...e._def,shape:()=>t})}else return e instanceof Z1e?new Z1e({...e._def,type:MMn(e.element)}):e instanceof eCt?eCt.create(MMn(e.unwrap())):e instanceof zwr?zwr.create(MMn(e.unwrap())):e instanceof cxe?cxe.create(e.items.map(t=>MMn(t))):e}var f7=class extends Xj{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=$T.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==p0.object){let c=this._getOrReturnCtx(t);return R0(c,{code:L_.invalid_type,expected:p0.object,received:c.parsedType}),P1}let{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:u}=this._getCached(),f=[];if(!(this._def.catchall instanceof tCt&&this._def.unknownKeys==="strip"))for(let c in i.data)u.includes(c)||f.push(c);let d=[];for(let c of u){let o=a[c],l=i.data[c];d.push({key:{status:"valid",value:c},value:o._parse(new sxe(i,l,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof tCt){let c=this._def.unknownKeys;if(c==="passthrough")for(let o of f)d.push({key:{status:"valid",value:o},value:{status:"valid",value:i.data[o]}});else if(c==="strict")f.length>0&&(R0(i,{code:L_.unrecognized_keys,keys:f}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let o of f){let l=i.data[o];d.push({key:{status:"valid",value:o},value:c._parse(new sxe(i,l,i.path,o)),alwaysSet:o in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let o of d){let l=await o.key;c.push({key:l,value:await o.value,alwaysSet:o.alwaysSet})}return c}).then(c=>h9.mergeObjectSync(n,c)):h9.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(t){return em.errToObj,new f7({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,a,u,f;let d=(u=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&u!==void 0?u:n.defaultError;return r.code==="unrecognized_keys"?{message:(f=em.errToObj(t).message)!==null&&f!==void 0?f:d}:{message:d}}}:{}})}strip(){return new f7({...this._def,unknownKeys:"strip"})}passthrough(){return new f7({...this._def,unknownKeys:"passthrough"})}extend(t){return new f7({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new f7({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:pO.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new f7({...this._def,catchall:t})}pick(t){let r={};return $T.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new f7({...this._def,shape:()=>r})}omit(t){let r={};return $T.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new f7({...this._def,shape:()=>r})}deepPartial(){return MMn(this)}partial(t){let r={};return $T.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new f7({...this._def,shape:()=>r})}required(t){let r={};return $T.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof eCt;)a=a._def.innerType;r[n]=a}}),new f7({...this._def,shape:()=>r})}keyof(){return $Nc($T.objectKeys(this.shape))}};f7.create=(e,t)=>new f7({shape:()=>e,unknownKeys:"strip",catchall:tCt.create(),typeName:pO.ZodObject,...Yj(t)});f7.strictCreate=(e,t)=>new f7({shape:()=>e,unknownKeys:"strict",catchall:tCt.create(),typeName:pO.ZodObject,...Yj(t)});f7.lazycreate=(e,t)=>new f7({shape:e,unknownKeys:"strip",catchall:tCt.create(),typeName:pO.ZodObject,...Yj(t)});var eQr=class extends Xj{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(let f of a)if(f.result.status==="valid")return f.result;for(let f of a)if(f.result.status==="dirty")return r.common.issues.push(...f.ctx.common.issues),f.result;let u=a.map(f=>new Q1e(f.ctx.common.issues));return R0(r,{code:L_.invalid_union,unionErrors:u}),P1}if(r.common.async)return Promise.all(n.map(async a=>{let u={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:u}),ctx:u}})).then(i);{let a,u=[];for(let d of n){let c={...r,common:{...r.common,issues:[]},parent:null},o=d._parseSync({data:r.data,path:r.path,parent:c});if(o.status==="valid")return o;o.status==="dirty"&&!a&&(a={result:o,ctx:c}),c.common.issues.length&&u.push(c.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let f=u.map(d=>new Q1e(d));return R0(r,{code:L_.invalid_union,unionErrors:f}),P1}}get options(){return this._def.options}};eQr.create=(e,t)=>new eQr({options:e,typeName:pO.ZodUnion,...Yj(t)});var NGi=e=>e instanceof nQr?NGi(e.schema):e instanceof k1e?NGi(e.innerType()):e instanceof iQr?[e.value]:e instanceof C8t?e.options:e instanceof aQr?Object.keys(e.enum):e instanceof oQr?NGi(e._def.innerType):e instanceof ZXr?[void 0]:e instanceof kXr?[null]:null,qMn=class extends Xj{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==p0.object)return R0(r,{code:L_.invalid_type,expected:p0.object,received:r.parsedType}),P1;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(R0(r,{code:L_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P1)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let a of r){let u=NGi(a.shape[t]);if(!u)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of u){if(i.has(f))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);i.set(f,a)}}return new qMn({typeName:pO.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...Yj(n)})}};function MLo(e,t){let r=y4r(e),n=y4r(t);if(e===t)return{valid:!0,data:e};if(r===p0.object&&n===p0.object){let i=$T.objectKeys(t),a=$T.objectKeys(e).filter(f=>i.indexOf(f)!==-1),u={...e,...t};for(let f of a){let d=MLo(e[f],t[f]);if(!d.valid)return{valid:!1};u[f]=d.data}return{valid:!0,data:u}}else if(r===p0.array&&n===p0.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<e.length;a++){let u=e[a],f=t[a],d=MLo(u,f);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return r===p0.date&&n===p0.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var tQr=class extends Xj{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(a,u)=>{if(SLo(a)||SLo(u))return P1;let f=MLo(a.value,u.value);return f.valid?((ELo(a)||ELo(u))&&r.dirty(),{status:r.value,value:f.data}):(R0(n,{code:L_.invalid_intersection_types}),P1)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,u])=>i(a,u)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};tQr.create=(e,t,r)=>new tQr({left:e,right:t,typeName:pO.ZodIntersection,...Yj(r)});var cxe=class extends Xj{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p0.array)return R0(n,{code:L_.invalid_type,expected:p0.array,received:n.parsedType}),P1;if(n.data.length<this._def.items.length)return R0(n,{code:L_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P1;!this._def.rest&&n.data.length>this._def.items.length&&(R0(n,{code:L_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((u,f)=>{let d=this._def.items[f]||this._def.rest;return d?d._parse(new sxe(n,u,n.path,f)):null}).filter(u=>!!u);return n.common.async?Promise.all(a).then(u=>h9.mergeArray(r,u)):h9.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new cxe({...this._def,rest:t})}};cxe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cxe({items:e,typeName:pO.ZodTuple,rest:null,...Yj(t)})};var rQr=class extends Xj{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p0.object)return R0(n,{code:L_.invalid_type,expected:p0.object,received:n.parsedType}),P1;let i=[],a=this._def.keyType,u=this._def.valueType;for(let f in n.data)i.push({key:a._parse(new sxe(n,f,n.path,f)),value:u._parse(new sxe(n,n.data[f],n.path,f))});return n.common.async?h9.mergeObjectAsync(r,i):h9.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Xj?new rQr({keyType:t,valueType:r,typeName:pO.ZodRecord,...Yj(n)}):new rQr({keyType:X1e.create(),valueType:t,typeName:pO.ZodRecord,...Yj(r)})}},CMn=class extends Xj{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p0.map)return R0(n,{code:L_.invalid_type,expected:p0.map,received:n.parsedType}),P1;let i=this._def.keyType,a=this._def.valueType,u=[...n.data.entries()].map(([f,d],c)=>({key:i._parse(new sxe(n,f,n.path,[c,"key"])),value:a._parse(new sxe(n,d,n.path,[c,"value"]))}));if(n.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let d of u){let c=await d.key,o=await d.value;if(c.status==="aborted"||o.status==="aborted")return P1;(c.status==="dirty"||o.status==="dirty")&&r.dirty(),f.set(c.value,o.value)}return{status:r.value,value:f}})}else{let f=new Map;for(let d of u){let c=d.key,o=d.value;if(c.status==="aborted"||o.status==="aborted")return P1;(c.status==="dirty"||o.status==="dirty")&&r.dirty(),f.set(c.value,o.value)}return{status:r.value,value:f}}}};CMn.create=(e,t,r)=>new CMn({valueType:t,keyType:e,typeName:pO.ZodMap,...Yj(r)});var Nwr=class extends Xj{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p0.set)return R0(n,{code:L_.invalid_type,expected:p0.set,received:n.parsedType}),P1;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(R0(n,{code:L_.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(R0(n,{code:L_.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function u(d){let c=new Set;for(let o of d){if(o.status==="aborted")return P1;o.status==="dirty"&&r.dirty(),c.add(o.value)}return{status:r.value,value:c}}let f=[...n.data.values()].map((d,c)=>a._parse(new sxe(n,d,n.path,c)));return n.common.async?Promise.all(f).then(d=>u(d)):u(f)}min(t,r){return new Nwr({...this._def,minSize:{value:t,message:em.toString(r)}})}max(t,r){return new Nwr({...this._def,maxSize:{value:t,message:em.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Nwr.create=(e,t)=>new Nwr({valueType:e,minSize:null,maxSize:null,typeName:pO.ZodSet,...Yj(t)});var v4r=class extends Xj{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==p0.function)return R0(r,{code:L_.invalid_type,expected:p0.function,received:r.parsedType}),P1;function n(f,d){return BGi({data:f,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zGi(),osi].filter(c=>!!c),issueData:{code:L_.invalid_arguments,argumentsError:d}})}function i(f,d){return BGi({data:f,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zGi(),osi].filter(c=>!!c),issueData:{code:L_.invalid_return_type,returnTypeError:d}})}let a={errorMap:r.common.contextualErrorMap},u=r.data;if(this._def.returns instanceof g4r){let f=this;return WX(async function(...d){let c=new Q1e([]),o=await f._def.args.parseAsync(d,a).catch(O=>{throw c.addIssue(n(d,O)),c}),l=await Reflect.apply(u,this,o);return await f._def.returns._def.type.parseAsync(l,a).catch(O=>{throw c.addIssue(i(l,O)),c})})}else{let f=this;return WX(function(...d){let c=f._def.args.safeParse(d,a);if(!c.success)throw new Q1e([n(d,c.error)]);let o=Reflect.apply(u,this,c.data),l=f._def.returns.safeParse(o,a);if(!l.success)throw new Q1e([i(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new v4r({...this._def,args:cxe.create(t).rest(Cwr.create())})}returns(t){return new v4r({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new v4r({args:t||cxe.create([]).rest(Cwr.create()),returns:r||Cwr.create(),typeName:pO.ZodFunction,...Yj(n)})}},nQr=class extends Xj{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};nQr.create=(e,t)=>new nQr({getter:e,typeName:pO.ZodLazy,...Yj(t)});var iQr=class extends Xj{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return R0(r,{received:r.data,code:L_.invalid_literal,expected:this._def.value}),P1}return{status:"valid",value:t.data}}get value(){return this._def.value}};iQr.create=(e,t)=>new iQr({value:e,typeName:pO.ZodLiteral,...Yj(t)});function $Nc(e,t){return new C8t({values:e,typeName:pO.ZodEnum,...Yj(t)})}var C8t=class extends Xj{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return R0(r,{expected:$T.joinValues(n),received:r.parsedType,code:L_.invalid_type}),P1}if(this._def.values.indexOf(t.data)===-1){let r=this._getOrReturnCtx(t),n=this._def.values;return R0(r,{received:r.data,code:L_.invalid_enum_value,options:n}),P1}return WX(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t){return C8t.create(t)}exclude(t){return C8t.create(this.options.filter(r=>!t.includes(r)))}};C8t.create=$Nc;var aQr=class extends Xj{_parse(t){let r=$T.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==p0.string&&n.parsedType!==p0.number){let i=$T.objectValues(r);return R0(n,{expected:$T.joinValues(i),received:n.parsedType,code:L_.invalid_type}),P1}if(r.indexOf(t.data)===-1){let i=$T.objectValues(r);return R0(n,{received:n.data,code:L_.invalid_enum_value,options:i}),P1}return WX(t.data)}get enum(){return this._def.values}};aQr.create=(e,t)=>new aQr({values:e,typeName:pO.ZodNativeEnum,...Yj(t)});var g4r=class extends Xj{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==p0.promise&&r.common.async===!1)return R0(r,{code:L_.invalid_type,expected:p0.promise,received:r.parsedType}),P1;let n=r.parsedType===p0.promise?r.data:Promise.resolve(r.data);return WX(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};g4r.create=(e,t)=>new g4r({type:e,typeName:pO.ZodPromise,...Yj(t)});var k1e=class extends Xj{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pO.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:u=>{R0(n,u),u.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let u=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(u).then(f=>this._def.schema._parseAsync({data:f,path:n.path,parent:n})):this._def.schema._parseSync({data:u,path:n.path,parent:n})}if(i.type==="refinement"){let u=f=>{let d=i.refinement(f,a);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return f.status==="aborted"?P1:(f.status==="dirty"&&r.dirty(),u(f.value),{status:r.value,value:f.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>f.status==="aborted"?P1:(f.status==="dirty"&&r.dirty(),u(f.value).then(()=>({status:r.value,value:f.value}))))}if(i.type==="transform")if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!usi(u))return u;let f=i.transform(u.value,a);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:f}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>usi(u)?Promise.resolve(i.transform(u.value,a)).then(f=>({status:r.value,value:f})):u);$T.assertNever(i)}};k1e.create=(e,t,r)=>new k1e({schema:e,typeName:pO.ZodEffects,effect:t,...Yj(r)});k1e.createWithPreprocess=(e,t,r)=>new k1e({schema:t,effect:{type:"preprocess",transform:e},typeName:pO.ZodEffects,...Yj(r)});var eCt=class extends Xj{_parse(t){return this._getType(t)===p0.undefined?WX(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};eCt.create=(e,t)=>new eCt({innerType:e,typeName:pO.ZodOptional,...Yj(t)});var zwr=class extends Xj{_parse(t){return this._getType(t)===p0.null?WX(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};zwr.create=(e,t)=>new zwr({innerType:e,typeName:pO.ZodNullable,...Yj(t)});var oQr=class extends Xj{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===p0.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};oQr.create=(e,t)=>new oQr({innerType:e,typeName:pO.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Yj(t)});var AMn=class extends Xj{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return IGi(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Q1e(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Q1e(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};AMn.create=(e,t)=>new AMn({innerType:e,typeName:pO.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Yj(t)});var NMn=class extends Xj{_parse(t){if(this._getType(t)!==p0.nan){let n=this._getOrReturnCtx(t);return R0(n,{code:L_.invalid_type,expected:p0.nan,received:n.parsedType}),P1}return{status:"valid",value:t.data}}};NMn.create=e=>new NMn({typeName:pO.ZodNaN,...Yj(e)});var wjO=Symbol("zod_brand"),RGi=class extends Xj{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},uQr=class extends Xj{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?P1:a.status==="dirty"?(r.dirty(),HNc(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?P1:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new uQr({in:t,out:r,typeName:pO.ZodPipeline})}},zMn=class extends Xj{_parse(t){let r=this._def.innerType._parse(t);return usi(r)&&(r.value=Object.freeze(r.value)),r}};zMn.create=(e,t)=>new zMn({innerType:e,typeName:pO.ZodReadonly,...Yj(t)});var JNc=(e,t={},r)=>e?b4r.create().superRefine((n,i)=>{var a,u;if(!e(n)){let f=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,d=(u=(a=f.fatal)!==null&&a!==void 0?a:r)!==null&&u!==void 0?u:!0,c=typeof f=="string"?{message:f}:f;i.addIssue({code:"custom",...c,fatal:d})}}):b4r.create(),DjO={object:f7.lazycreate},pO;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(pO||(pO={}));var SjO=(e,t={message:`Input not instance of ${e.name}`})=>JNc(r=>r instanceof e,t),GNc=X1e.create,KNc=T8t.create,EjO=NMn.create,MjO=q8t.create,YNc=QXr.create,xjO=Awr.create,TjO=xMn.create,qjO=ZXr.create,CjO=kXr.create,AjO=b4r.create,NjO=Cwr.create,zjO=tCt.create,BjO=TMn.create,IjO=Z1e.create,RjO=f7.create,FjO=f7.strictCreate,LjO=eQr.create,UjO=qMn.create,VjO=tQr.create,WjO=cxe.create,HjO=rQr.create,$jO=CMn.create,JjO=Nwr.create,GjO=v4r.create,KjO=nQr.create,YjO=iQr.create,XjO=C8t.create,QjO=aQr.create,ZjO=g4r.create,VNc=k1e.create,kjO=eCt.create,ewO=zwr.create,twO=k1e.createWithPreprocess,rwO=uQr.create,nwO=()=>GNc().optional(),iwO=()=>KNc().optional(),awO=()=>YNc().optional(),owO={string:e=>X1e.create({...e,coerce:!0}),number:e=>T8t.create({...e,coerce:!0}),boolean:e=>QXr.create({...e,coerce:!0}),bigint:e=>q8t.create({...e,coerce:!0}),date:e=>Awr.create({...e,coerce:!0})},uwO=P1,nr=Object.freeze({__proto__:null,defaultErrorMap:osi,setErrorMap:fjO,getErrorMap:zGi,makeIssue:BGi,EMPTY_PATH:djO,addIssueToContext:R0,ParseStatus:h9,INVALID:P1,DIRTY:HNc,OK:WX,isAborted:SLo,isDirty:ELo,isValid:usi,isAsync:IGi,get util(){return $T},get objectUtil(){return DLo},ZodParsedType:p0,getParsedType:y4r,ZodType:Xj,ZodString:X1e,ZodNumber:T8t,ZodBigInt:q8t,ZodBoolean:QXr,ZodDate:Awr,ZodSymbol:xMn,ZodUndefined:ZXr,ZodNull:kXr,ZodAny:b4r,ZodUnknown:Cwr,ZodNever:tCt,ZodVoid:TMn,ZodArray:Z1e,ZodObject:f7,ZodUnion:eQr,ZodDiscriminatedUnion:qMn,ZodIntersection:tQr,ZodTuple:cxe,ZodRecord:rQr,ZodMap:CMn,ZodSet:Nwr,ZodFunction:v4r,ZodLazy:nQr,ZodLiteral:iQr,ZodEnum:C8t,ZodNativeEnum:aQr,ZodPromise:g4r,ZodEffects:k1e,ZodTransformer:k1e,ZodOptional:eCt,ZodNullable:zwr,ZodDefault:oQr,ZodCatch:AMn,ZodNaN:NMn,BRAND:wjO,ZodBranded:RGi,ZodPipeline:uQr,ZodReadonly:zMn,custom:JNc,Schema:Xj,ZodSchema:Xj,late:DjO,get ZodFirstPartyTypeKind(){return pO},coerce:owO,any:AjO,array:IjO,bigint:MjO,boolean:YNc,date:xjO,discriminatedUnion:UjO,effect:VNc,enum:XjO,function:GjO,instanceof:SjO,intersection:VjO,lazy:KjO,literal:YjO,map:$jO,nan:EjO,nativeEnum:QjO,never:zjO,null:CjO,nullable:ewO,number:KNc,object:RjO,oboolean:awO,onumber:iwO,optional:kjO,ostring:nwO,pipeline:rwO,preprocess:twO,promise:ZjO,record:HjO,set:JjO,strictObject:FjO,string:GNc,symbol:TjO,transformer:VNc,tuple:WjO,undefined:qjO,union:LjO,unknown:NjO,void:BjO,NEVER:uwO,ZodIssueCode:L_,quotelessJson:ljO,ZodError:Q1e});var XNc=nr.object({dependencies:nr.record(nr.string(),nr.string())});async function ZNc({absolutePathToWorkspace:e,context:t}){let r=pf(e,zs.of(r7c));if(!await Vh(r))return;let n=await(0,QNc.readFile)(r),i=av.load(n.toString());return await lMn({schema:XNc,value:i,context:t,filepathBeingParsed:r})}async function kNc({absolutePathToWorkspace:e,context:t}){let r=await ZNc({absolutePathToWorkspace:e,context:t});return R3c({absolutePathToWorkspace:e,rawDependenciesConfiguration:r,context:t})}var Pre={};Wb(Pre,{RawSchemas:()=>rHo,getColorFromRawConfig:()=>qLo,getColorType:()=>TLo,getReferencedApiSections:()=>l8c,parseDocsConfiguration:()=>H_l,resolveFilepath:()=>sB});function LGi(e){return LGi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LGi(e)}var swO=/^\s+/,cwO=/\s+$/;function ky(e,t){if(e=e||"",t=t||{},e instanceof ky)return e;if(!(this instanceof ky))return new ky(e,t);var r=lwO(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}ky.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,i,a,u,f;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?u=n/12.92:u=Math.pow((n+.055)/1.055,2.4),i<=.03928?f=i/12.92:f=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*u+.0722*f},setAlpha:function(t){return this._a=o8c(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=t8c(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=t8c(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=e8c(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=e8c(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return r8c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return _wO(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(S4(this._r,255)*100)+"%",g:Math.round(S4(this._g,255)*100)+"%",b:Math.round(S4(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(S4(this._r,255)*100)+"%, "+Math.round(S4(this._g,255)*100)+"%, "+Math.round(S4(this._b,255)*100)+"%)":"rgba("+Math.round(S4(this._r,255)*100)+"%, "+Math.round(S4(this._g,255)*100)+"%, "+Math.round(S4(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:SwO[r8c(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+n8c(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=ky(t);n="#"+n8c(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return ky(this.toString())},_applyModification:function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(bwO,arguments)},brighten:function(){return this._applyModification(gwO,arguments)},darken:function(){return this._applyModification(mwO,arguments)},desaturate:function(){return this._applyModification(hwO,arguments)},saturate:function(){return this._applyModification(ywO,arguments)},greyscale:function(){return this._applyModification(vwO,arguments)},spin:function(){return this._applyModification(OwO,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(wwO,arguments)},complement:function(){return this._applyCombination(PwO,arguments)},monochromatic:function(){return this._applyCombination(DwO,arguments)},splitcomplement:function(){return this._applyCombination(jwO,arguments)},triad:function(){return this._applyCombination(i8c,[3])},tetrad:function(){return this._applyCombination(i8c,[4])}};ky.fromRatio=function(e,t){if(LGi(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=ssi(e[n]));e=r}return ky(e,t)};function lwO(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,f=!1;return typeof e=="string"&&(e=TwO(e)),LGi(e)=="object"&&(Bwr(e.r)&&Bwr(e.g)&&Bwr(e.b)?(t=fwO(e.r,e.g,e.b),u=!0,f=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Bwr(e.h)&&Bwr(e.s)&&Bwr(e.v)?(n=ssi(e.s),i=ssi(e.v),t=pwO(e.h,n,i),u=!0,f="hsv"):Bwr(e.h)&&Bwr(e.s)&&Bwr(e.l)&&(n=ssi(e.s),a=ssi(e.l),t=dwO(e.h,n,a),u=!0,f="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=o8c(r),{ok:u,format:e.format||f,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function fwO(e,t,r){return{r:S4(e,255)*255,g:S4(t,255)*255,b:S4(r,255)*255}}function e8c(e,t,r){e=S4(e,255),t=S4(t,255),r=S4(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,u,f=(n+i)/2;if(n==i)a=u=0;else{var d=n-i;switch(u=f>.5?d/(2-n-i):d/(n+i),n){case e:a=(t-r)/d+(t<r?6:0);break;case t:a=(r-e)/d+2;break;case r:a=(e-t)/d+4;break}a/=6}return{h:a,s:u,l:f}}function dwO(e,t,r){var n,i,a;e=S4(e,360),t=S4(t,100),r=S4(r,100);function u(c,o,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?c+(o-c)*6*l:l<1/2?o:l<2/3?c+(o-c)*(2/3-l)*6:c}if(t===0)n=i=a=r;else{var f=r<.5?r*(1+t):r+t-r*t,d=2*r-f;n=u(d,f,e+1/3),i=u(d,f,e),a=u(d,f,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function t8c(e,t,r){e=S4(e,255),t=S4(t,255),r=S4(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,u,f=n,d=n-i;if(u=n===0?0:d/n,n==i)a=0;else{switch(n){case e:a=(t-r)/d+(t<r?6:0);break;case t:a=(r-e)/d+2;break;case r:a=(e-t)/d+4;break}a/=6}return{h:a,s:u,v:f}}function pwO(e,t,r){e=S4(e,360)*6,t=S4(t,100),r=S4(r,100);var n=Math.floor(e),i=e-n,a=r*(1-t),u=r*(1-i*t),f=r*(1-(1-i)*t),d=n%6,c=[r,u,a,a,f,r][d],o=[f,r,r,u,a,a][d],l=[a,a,f,r,r,u][d];return{r:c*255,g:o*255,b:l*255}}function r8c(e,t,r,n){var i=[nCt(Math.round(e).toString(16)),nCt(Math.round(t).toString(16)),nCt(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function _wO(e,t,r,n,i){var a=[nCt(Math.round(e).toString(16)),nCt(Math.round(t).toString(16)),nCt(Math.round(r).toString(16)),nCt(u8c(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function n8c(e,t,r,n){var i=[nCt(u8c(n)),nCt(Math.round(e).toString(16)),nCt(Math.round(t).toString(16)),nCt(Math.round(r).toString(16))];return i.join("")}ky.equals=function(e,t){return!e||!t?!1:ky(e).toRgbString()==ky(t).toRgbString()};ky.random=function(){return ky.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function hwO(e,t){t=t===0?0:t||10;var r=ky(e).toHsl();return r.s-=t/100,r.s=UGi(r.s),ky(r)}function ywO(e,t){t=t===0?0:t||10;var r=ky(e).toHsl();return r.s+=t/100,r.s=UGi(r.s),ky(r)}function vwO(e){return ky(e).desaturate(100)}function bwO(e,t){t=t===0?0:t||10;var r=ky(e).toHsl();return r.l+=t/100,r.l=UGi(r.l),ky(r)}function gwO(e,t){t=t===0?0:t||10;var r=ky(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),ky(r)}function mwO(e,t){t=t===0?0:t||10;var r=ky(e).toHsl();return r.l-=t/100,r.l=UGi(r.l),ky(r)}function OwO(e,t){var r=ky(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,ky(r)}function PwO(e){var t=ky(e).toHsl();return t.h=(t.h+180)%360,ky(t)}function i8c(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=ky(e).toHsl(),n=[ky(e)],i=360/t,a=1;a<t;a++)n.push(ky({h:(r.h+a*i)%360,s:r.s,l:r.l}));return n}function jwO(e){var t=ky(e).toHsl(),r=t.h;return[ky(e),ky({h:(r+72)%360,s:t.s,l:t.l}),ky({h:(r+216)%360,s:t.s,l:t.l})]}function wwO(e,t,r){t=t||6,r=r||30;var n=ky(e).toHsl(),i=360/r,a=[ky(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(ky(n));return a}function DwO(e,t){t=t||6;for(var r=ky(e).toHsv(),n=r.h,i=r.s,a=r.v,u=[],f=1/t;t--;)u.push(ky({h:n,s:i,v:a})),a=(a+f)%1;return u}ky.mix=function(e,t,r){r=r===0?0:r||50;var n=ky(e).toRgb(),i=ky(t).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return ky(u)};ky.readability=function(e,t){var r=ky(e),n=ky(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};ky.isReadable=function(e,t,r){var n=ky.readability(e,t),i,a;switch(a=!1,i=qwO(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};ky.mostReadable=function(e,t,r){var n=null,i=0,a,u,f,d;r=r||{},u=r.includeFallbackColors,f=r.level,d=r.size;for(var c=0;c<t.length;c++)a=ky.readability(e,t[c]),a>i&&(i=a,n=ky(t[c]));return ky.isReadable(e,n,{level:f,size:d})||!u?n:(r.includeFallbackColors=!1,ky.mostReadable(e,["#fff","#000"],r))};var xLo=ky.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},SwO=ky.hexNames=EwO(xLo);function EwO(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function o8c(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function S4(e,t){MwO(e)&&(e="100%");var r=xwO(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function UGi(e){return Math.min(1,Math.max(0,e))}function eje(e){return parseInt(e,16)}function MwO(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function xwO(e){return typeof e=="string"&&e.indexOf("%")!=-1}function nCt(e){return e.length==1?"0"+e:""+e}function ssi(e){return e<=1&&(e=e*100+"%"),e}function u8c(e){return Math.round(parseFloat(e)*255).toString(16)}function a8c(e){return eje(e)/255}var rCt=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Bwr(e){return!!rCt.CSS_UNIT.exec(e)}function TwO(e){e=e.replace(swO,"").replace(cwO,"").toLowerCase();var t=!1;if(xLo[e])e=xLo[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=rCt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=rCt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=rCt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=rCt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=rCt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=rCt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=rCt.hex8.exec(e))?{r:eje(r[1]),g:eje(r[2]),b:eje(r[3]),a:a8c(r[4]),format:t?"name":"hex8"}:(r=rCt.hex6.exec(e))?{r:eje(r[1]),g:eje(r[2]),b:eje(r[3]),format:t?"name":"hex"}:(r=rCt.hex4.exec(e))?{r:eje(r[1]+""+r[1]),g:eje(r[2]+""+r[2]),b:eje(r[3]+""+r[3]),a:a8c(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=rCt.hex3.exec(e))?{r:eje(r[1]+""+r[1]),g:eje(r[2]+""+r[2]),b:eje(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function qwO(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}function s8c(e={accentPrimary:void 0,background:void 0},t){e.accentPrimary=e.accentPrimary??e.accentPrimaryDeprecated;let r=TLo(e);switch(r){case"dark":return{type:"dark",...VGi(e,t,"dark")};case"light":return{type:"light",...VGi(e,t,"light")};case"darkAndLight":return{type:"darkAndLight",dark:VGi(e,t,"dark"),light:VGi(e,t,"light")};default:Ol(r)}}function TLo({background:e,accentPrimary:t,accentPrimaryDeprecated:r}){if(t=t??r,typeof e=="string"&&typeof t=="string")return ky(e).isDark()?"dark":"light";if(e!=null){if(typeof e=="string")return ky(e).isDark()?"dark":"light";if(e.dark!=null&&e.light!=null)return"darkAndLight"}if(t!=null){if(typeof t=="string")return ky(t).isLight()?"dark":"light";if(t.dark!=null&&t.light!=null)return"darkAndLight"}if(t!=null&&e!=null){if(e.dark!=null&&t.dark!=null)return"dark";if(e.light!=null&&t.light!=null)return"light"}return"darkAndLight"}function VGi(e,t,r){var a,u,f,d;let n=BMn(e.accentPrimary??e.accentPrimaryDeprecated,t,"accent-primary",r)??ky.random(),i=BMn(e.background,t,"background",r);return{accentPrimary:n.toRgb(),background:i==null?void 0:i.toRgb(),border:(a=BMn(e.border,t,"border",r))==null?void 0:a.toRgb(),sidebarBackground:(u=BMn(e.sidebarBackground,t,"sidebar-background",r))==null?void 0:u.toRgb(),headerBackground:(f=BMn(e.headerBackground,t,"header-background",r))==null?void 0:f.toRgb(),cardBackground:(d=BMn(e.cardBackground,t,"card-background",r))==null?void 0:d.toRgb()}}function qLo(e,t,r){if(e==null)return;let n=typeof e=="string"?e:e[r];if(n==null&&t==="accent-primary"&&typeof e!="string"&&(n=e[r==="dark"?"light":"dark"]),n!=null)return n}function BMn(e,t,r,n){let i=qLo(e,r,n);if(i==null)return;let a=ky(i);return a.isValid()||t.failAndThrow(`'${typeof e=="string"?r:`colors.${r}.${n}`}' should be a hex color of the format #FFFFFF`),a}function l8c(e){let t=new ALo;switch(e.navigation.type){case"tabbed":case"untabbed":c8c({navigation:e.navigation,collector:t});break;case"versioned":e.navigation.versions.forEach(r=>{c8c({navigation:r.navigation,collector:t})});break;default:Ol(e.navigation)}return t.getReferences()}function c8c({navigation:e,collector:t}){switch(e.type){case"tabbed":e.items.forEach(r=>{r.child.type==="layout"&&r.child.layout.forEach(n=>{CLo({item:n,collector:t})})});break;case"untabbed":e.items.forEach(r=>{CLo({item:r,collector:t})});break;default:Ol(e)}}function CLo({item:e,collector:t}){switch(e.type){case"apiSection":t.collect(e);return;case"section":e.contents.forEach(r=>{CLo({item:r,collector:t})});return;case"page":case"link":case"changelog":return;default:Ol(e)}}var ALo=class{namedApis=new Set;defaultApi=!1;collect(t){t.apiName!=null?this.namedApis.add(t.apiName):this.defaultApi=!0}getReferences(){if(this.defaultApi)return{type:"default"};if(Object.keys(this.namedApis).length>0)return{type:"named",apiNames:[...this.namedApis]}}};var Z8t=yu(iXi(),1),aHo=require("fs/promises");var Zll=require("fs/promises");var eCO=typeof global=="object"&&global&&global.Object===Object&&global,aXi=eCO;var tCO=typeof self=="object"&&self&&self.Object===Object&&self,rCO=aXi||tCO||Function("return this")(),uB=rCO;var nCO=uB.Symbol,XX=nCO;var Nul=Object.prototype,iCO=Nul.hasOwnProperty,aCO=Nul.toString,Rsi=XX?XX.toStringTag:void 0;function oCO(e){var t=iCO.call(e,Rsi),r=e[Rsi];try{e[Rsi]=void 0;var n=!0}catch{}var i=aCO.call(e);return n&&(t?e[Rsi]=r:delete e[Rsi]),i}var zul=oCO;var uCO=Object.prototype,sCO=uCO.toString;function cCO(e){return sCO.call(e)}var Bul=cCO;var lCO="[object Null]",fCO="[object Undefined]",Iul=XX?XX.toStringTag:void 0;function dCO(e){return e==null?e===void 0?fCO:lCO:Iul&&Iul in Object(e)?zul(e):Bul(e)}var QX=dCO;function pCO(e){return e!=null&&typeof e=="object"}var TV=pCO;var _CO="[object Symbol]";function hCO(e){return typeof e=="symbol"||TV(e)&&QX(e)==_CO}var $8t=hCO;function yCO(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Oxn=yCO;var vCO=Array.isArray,SC=vCO;var bCO=1/0,Rul=XX?XX.prototype:void 0,Ful=Rul?Rul.toString:void 0;function Lul(e){if(typeof e=="string")return e;if(SC(e))return Oxn(e,Lul)+"";if($8t(e))return Ful?Ful.call(e):"";var t=e+"";return t=="0"&&1/e==-bCO?"-0":t}var Uul=Lul;var gCO=/\s/;function mCO(e){for(var t=e.length;t--&&gCO.test(e.charAt(t)););return t}var Vul=mCO;var OCO=/^\s+/;function PCO(e){return e&&e.slice(0,Vul(e)+1).replace(OCO,"")}var Wul=PCO;function jCO(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var kN=jCO;var Hul=0/0,wCO=/^[-+]0x[0-9a-f]+$/i,DCO=/^0b[01]+$/i,SCO=/^0o[0-7]+$/i,ECO=parseInt;function MCO(e){if(typeof e=="number")return e;if($8t(e))return Hul;if(kN(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=kN(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Wul(e);var r=DCO.test(e);return r||SCO.test(e)?ECO(e.slice(2),r?2:8):wCO.test(e)?Hul:+e}var $ul=MCO;var Jul=1/0,xCO=17976931348623157e292;function TCO(e){if(!e)return e===0?e:0;if(e=$ul(e),e===Jul||e===-Jul){var t=e<0?-1:1;return t*xCO}return e===e?e:0}var Gul=TCO;function qCO(e){var t=Gul(e),r=t%1;return t===t?r?t-r:t:0}var Kul=qCO;function CCO(e){return e}var Pxn=CCO;var ACO="[object AsyncFunction]",NCO="[object Function]",zCO="[object GeneratorFunction]",BCO="[object Proxy]";function ICO(e){if(!kN(e))return!1;var t=QX(e);return t==NCO||t==zCO||t==ACO||t==BCO}var jxn=ICO;var RCO=uB["__core-js_shared__"],oXi=RCO;var Yul=function(){var e=/[^.]+$/.exec(oXi&&oXi.keys&&oXi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function FCO(e){return!!Yul&&Yul in e}var Xul=FCO;var LCO=Function.prototype,UCO=LCO.toString;function VCO(e){if(e!=null){try{return UCO.call(e)}catch{}try{return e+""}catch{}}return""}var eDr=VCO;var WCO=/[\\^$.*+?()[\]{}|]/g,HCO=/^\[object .+?Constructor\]$/,$CO=Function.prototype,JCO=Object.prototype,GCO=$CO.toString,KCO=JCO.hasOwnProperty,YCO=RegExp("^"+GCO.call(KCO).replace(WCO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function XCO(e){if(!kN(e)||Xul(e))return!1;var t=jxn(e)?YCO:HCO;return t.test(eDr(e))}var Qul=XCO;function QCO(e,t){return e==null?void 0:e[t]}var Zul=QCO;function ZCO(e,t){var r=Zul(e,t);return Qul(r)?r:void 0}var bre=ZCO;var kCO=bre(uB,"WeakMap"),uXi=kCO;var kul=Object.create,eAO=function(){function e(){}return function(t){if(!kN(t))return{};if(kul)return kul(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),esl=eAO;function tAO(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var tsl=tAO;function rAO(){}var sCt=rAO;function nAO(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var rsl=nAO;var iAO=800,aAO=16,oAO=Date.now;function uAO(e){var t=0,r=0;return function(){var n=oAO(),i=aAO-(n-r);if(r=n,i>0){if(++t>=iAO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var nsl=uAO;function sAO(e){return function(){return e}}var isl=sAO;var cAO=function(){try{var e=bre(Object,"defineProperty");return e({},"",{}),e}catch{}}(),wxn=cAO;var lAO=wxn?function(e,t){return wxn(e,"toString",{configurable:!0,enumerable:!1,value:isl(t),writable:!0})}:Pxn,asl=lAO;var fAO=nsl(asl),osl=fAO;function dAO(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var usl=dAO;function pAO(e){return e!==e}var ssl=pAO;function _AO(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var csl=_AO;function hAO(e,t,r){return t===t?csl(e,t,r):usl(e,ssl,r)}var lsl=hAO;function yAO(e,t){var r=e==null?0:e.length;return!!r&&lsl(e,t,0)>-1}var fsl=yAO;var vAO=9007199254740991,bAO=/^(?:0|[1-9]\d*)$/;function gAO(e,t){var r=typeof e;return t=t??vAO,!!t&&(r=="number"||r!="symbol"&&bAO.test(e))&&e>-1&&e%1==0&&e<t}var e3r=gAO;function mAO(e,t,r){t=="__proto__"&&wxn?wxn(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var gre=mAO;function OAO(e,t){return e===t||e!==e&&t!==t}var J8t=OAO;var PAO=Object.prototype,jAO=PAO.hasOwnProperty;function wAO(e,t,r){var n=e[t];(!(jAO.call(e,t)&&J8t(n,r))||r===void 0&&!(t in e))&&gre(e,t,r)}var sXi=wAO;function DAO(e,t,r,n){var i=!r;r||(r={});for(var a=-1,u=t.length;++a<u;){var f=t[a],d=n?n(r[f],e[f],f,r,e):void 0;d===void 0&&(d=e[f]),i?gre(r,f,d):sXi(r,f,d)}return r}var dsl=DAO;var psl=Math.max;function SAO(e,t,r){return t=psl(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=psl(n.length-t,0),u=Array(a);++i<a;)u[i]=n[t+i];i=-1;for(var f=Array(t+1);++i<t;)f[i]=n[i];return f[t]=r(u),tsl(e,this,f)}}var _sl=SAO;function EAO(e,t){return osl(_sl(e,t,Pxn),e+"")}var cXi=EAO;var MAO=9007199254740991;function xAO(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=MAO}var Dxn=xAO;function TAO(e){return e!=null&&Dxn(e.length)&&!jxn(e)}var mre=TAO;function qAO(e,t,r){if(!kN(r))return!1;var n=typeof t;return(n=="number"?mre(r)&&e3r(t,r.length):n=="string"&&t in r)?J8t(r[t],e):!1}var lXi=qAO;function CAO(e){return cXi(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,u&&lXi(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var f=r[n];f&&e(t,f,n,a)}return t})}var hsl=CAO;var AAO=Object.prototype;function NAO(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||AAO;return e===r}var t3r=NAO;function zAO(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var ysl=zAO;var BAO="[object Arguments]";function IAO(e){return TV(e)&&QX(e)==BAO}var sWo=IAO;var vsl=Object.prototype,RAO=vsl.hasOwnProperty,FAO=vsl.propertyIsEnumerable,LAO=sWo(function(){return arguments}())?sWo:function(e){return TV(e)&&RAO.call(e,"callee")&&!FAO.call(e,"callee")},cCt=LAO;function UAO(){return!1}var bsl=UAO;var Osl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gsl=Osl&&typeof module=="object"&&module&&!module.nodeType&&module,VAO=gsl&&gsl.exports===Osl,msl=VAO?uB.Buffer:void 0,WAO=msl?msl.isBuffer:void 0,HAO=WAO||bsl,tDr=HAO;var $AO="[object Arguments]",JAO="[object Array]",GAO="[object Boolean]",KAO="[object Date]",YAO="[object Error]",XAO="[object Function]",QAO="[object Map]",ZAO="[object Number]",kAO="[object Object]",e6O="[object RegExp]",t6O="[object Set]",r6O="[object String]",n6O="[object WeakMap]",i6O="[object ArrayBuffer]",a6O="[object DataView]",o6O="[object Float32Array]",u6O="[object Float64Array]",s6O="[object Int8Array]",c6O="[object Int16Array]",l6O="[object Int32Array]",f6O="[object Uint8Array]",d6O="[object Uint8ClampedArray]",p6O="[object Uint16Array]",_6O="[object Uint32Array]",b7={};b7[o6O]=b7[u6O]=b7[s6O]=b7[c6O]=b7[l6O]=b7[f6O]=b7[d6O]=b7[p6O]=b7[_6O]=!0;b7[$AO]=b7[JAO]=b7[i6O]=b7[GAO]=b7[a6O]=b7[KAO]=b7[YAO]=b7[XAO]=b7[QAO]=b7[ZAO]=b7[kAO]=b7[e6O]=b7[t6O]=b7[r6O]=b7[n6O]=!1;function h6O(e){return TV(e)&&Dxn(e.length)&&!!b7[QX(e)]}var Psl=h6O;function y6O(e){return function(t){return e(t)}}var fXi=y6O;var jsl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fsi=jsl&&typeof module=="object"&&module&&!module.nodeType&&module,v6O=Fsi&&Fsi.exports===jsl,cWo=v6O&&aXi.process,b6O=function(){try{var e=Fsi&&Fsi.require&&Fsi.require("util").types;return e||cWo&&cWo.binding&&cWo.binding("util")}catch{}}(),lWo=b6O;var wsl=lWo&&lWo.isTypedArray,g6O=wsl?fXi(wsl):Psl,r3r=g6O;var m6O=Object.prototype,O6O=m6O.hasOwnProperty;function P6O(e,t){var r=SC(e),n=!r&&cCt(e),i=!r&&!n&&tDr(e),a=!r&&!n&&!i&&r3r(e),u=r||n||i||a,f=u?ysl(e.length,String):[],d=f.length;for(var c in e)(t||O6O.call(e,c))&&!(u&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||e3r(c,d)))&&f.push(c);return f}var dXi=P6O;function j6O(e,t){return function(r){return e(t(r))}}var pXi=j6O;var w6O=pXi(Object.keys,Object),Dsl=w6O;var D6O=Object.prototype,S6O=D6O.hasOwnProperty;function E6O(e){if(!t3r(e))return Dsl(e);var t=[];for(var r in Object(e))S6O.call(e,r)&&r!="constructor"&&t.push(r);return t}var Sxn=E6O;function M6O(e){return mre(e)?dXi(e):Sxn(e)}var Exn=M6O;function x6O(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Ssl=x6O;var T6O=Object.prototype,q6O=T6O.hasOwnProperty;function C6O(e){if(!kN(e))return Ssl(e);var t=t3r(e),r=[];for(var n in e)n=="constructor"&&(t||!q6O.call(e,n))||r.push(n);return r}var Esl=C6O;function A6O(e){return mre(e)?dXi(e,!0):Esl(e)}var Mxn=A6O;var N6O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z6O=/^\w*$/;function B6O(e,t){if(SC(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||$8t(e)?!0:z6O.test(e)||!N6O.test(e)||t!=null&&e in Object(t)}var xxn=B6O;var I6O=bre(Object,"create"),rDr=I6O;function R6O(){this.__data__=rDr?rDr(null):{},this.size=0}var Msl=R6O;function F6O(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xsl=F6O;var L6O="__lodash_hash_undefined__",U6O=Object.prototype,V6O=U6O.hasOwnProperty;function W6O(e){var t=this.__data__;if(rDr){var r=t[e];return r===L6O?void 0:r}return V6O.call(t,e)?t[e]:void 0}var Tsl=W6O;var H6O=Object.prototype,$6O=H6O.hasOwnProperty;function J6O(e){var t=this.__data__;return rDr?t[e]!==void 0:$6O.call(t,e)}var qsl=J6O;var G6O="__lodash_hash_undefined__";function K6O(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=rDr&&t===void 0?G6O:t,this}var Csl=K6O;function Txn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Txn.prototype.clear=Msl;Txn.prototype.delete=xsl;Txn.prototype.get=Tsl;Txn.prototype.has=qsl;Txn.prototype.set=Csl;var fWo=Txn;function Y6O(){this.__data__=[],this.size=0}var Asl=Y6O;function X6O(e,t){for(var r=e.length;r--;)if(J8t(e[r][0],t))return r;return-1}var n3r=X6O;var Q6O=Array.prototype,Z6O=Q6O.splice;function k6O(e){var t=this.__data__,r=n3r(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Z6O.call(t,r,1),--this.size,!0}var Nsl=k6O;function e7O(e){var t=this.__data__,r=n3r(t,e);return r<0?void 0:t[r][1]}var zsl=e7O;function t7O(e){return n3r(this.__data__,e)>-1}var Bsl=t7O;function r7O(e,t){var r=this.__data__,n=n3r(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Isl=r7O;function qxn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}qxn.prototype.clear=Asl;qxn.prototype.delete=Nsl;qxn.prototype.get=zsl;qxn.prototype.has=Bsl;qxn.prototype.set=Isl;var i3r=qxn;var n7O=bre(uB,"Map"),a3r=n7O;function i7O(){this.size=0,this.__data__={hash:new fWo,map:new(a3r||i3r),string:new fWo}}var Rsl=i7O;function a7O(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Fsl=a7O;function o7O(e,t){var r=e.__data__;return Fsl(t)?r[typeof t=="string"?"string":"hash"]:r.map}var o3r=o7O;function u7O(e){var t=o3r(this,e).delete(e);return this.size-=t?1:0,t}var Lsl=u7O;function s7O(e){return o3r(this,e).get(e)}var Usl=s7O;function c7O(e){return o3r(this,e).has(e)}var Vsl=c7O;function l7O(e,t){var r=o3r(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Wsl=l7O;function Cxn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Cxn.prototype.clear=Rsl;Cxn.prototype.delete=Lsl;Cxn.prototype.get=Usl;Cxn.prototype.has=Vsl;Cxn.prototype.set=Wsl;var RQr=Cxn;var f7O="Expected a function";function dWo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(f7O);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var u=e.apply(this,n);return r.cache=a.set(i,u)||a,u};return r.cache=new(dWo.Cache||RQr),r}dWo.Cache=RQr;var Hsl=dWo;var d7O=500;function p7O(e){var t=Hsl(e,function(n){return r.size===d7O&&r.clear(),n}),r=t.cache;return t}var $sl=p7O;var _7O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h7O=/\\(\\)?/g,y7O=$sl(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_7O,function(r,n,i,a){t.push(i?a.replace(h7O,"$1"):n||r)}),t}),Jsl=y7O;function v7O(e){return e==null?"":Uul(e)}var G8t=v7O;function b7O(e,t){return SC(e)?e:xxn(e,t)?[e]:Jsl(G8t(e))}var u3r=b7O;var g7O=1/0;function m7O(e){if(typeof e=="string"||$8t(e))return e;var t=e+"";return t=="0"&&1/e==-g7O?"-0":t}var K8t=m7O;function O7O(e,t){t=u3r(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[K8t(t[r++])];return r&&r==n?e:void 0}var Axn=O7O;function P7O(e,t,r){var n=e==null?void 0:Axn(e,t);return n===void 0?r:n}var Gsl=P7O;function j7O(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Nxn=j7O;var Ksl=XX?XX.isConcatSpreadable:void 0;function w7O(e){return SC(e)||cCt(e)||!!(Ksl&&e&&e[Ksl])}var Ysl=w7O;function Xsl(e,t,r,n,i){var a=-1,u=e.length;for(r||(r=Ysl),i||(i=[]);++a<u;){var f=e[a];t>0&&r(f)?t>1?Xsl(f,t-1,r,n,i):Nxn(i,f):n||(i[i.length]=f)}return i}var Qsl=Xsl;var D7O=pXi(Object.getPrototypeOf,Object),zxn=D7O;var S7O="[object Object]",E7O=Function.prototype,M7O=Object.prototype,Zsl=E7O.toString,x7O=M7O.hasOwnProperty,T7O=Zsl.call(Object);function q7O(e){if(!TV(e)||QX(e)!=S7O)return!1;var t=zxn(e);if(t===null)return!0;var r=x7O.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Zsl.call(r)==T7O}var Lsi=q7O;function C7O(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}var _Xi=C7O;function A7O(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:_Xi(e,t,r)}var ksl=A7O;var N7O="\\ud800-\\udfff",z7O="\\u0300-\\u036f",B7O="\\ufe20-\\ufe2f",I7O="\\u20d0-\\u20ff",R7O=z7O+B7O+I7O,F7O="\\ufe0e\\ufe0f",L7O="\\u200d",U7O=RegExp("["+L7O+N7O+R7O+F7O+"]");function V7O(e){return U7O.test(e)}var Bxn=V7O;function W7O(e){return e.split("")}var ecl=W7O;var tcl="\\ud800-\\udfff",H7O="\\u0300-\\u036f",$7O="\\ufe20-\\ufe2f",J7O="\\u20d0-\\u20ff",G7O=H7O+$7O+J7O,K7O="\\ufe0e\\ufe0f",Y7O="["+tcl+"]",pWo="["+G7O+"]",_Wo="\\ud83c[\\udffb-\\udfff]",X7O="(?:"+pWo+"|"+_Wo+")",rcl="[^"+tcl+"]",ncl="(?:\\ud83c[\\udde6-\\uddff]){2}",icl="[\\ud800-\\udbff][\\udc00-\\udfff]",Q7O="\\u200d",acl=X7O+"?",ocl="["+K7O+"]?",Z7O="(?:"+Q7O+"(?:"+[rcl,ncl,icl].join("|")+")"+ocl+acl+")*",k7O=ocl+acl+Z7O,e4O="(?:"+[rcl+pWo+"?",pWo,ncl,icl,Y7O].join("|")+")",t4O=RegExp(_Wo+"(?="+_Wo+")|"+e4O+k7O,"g");function r4O(e){return e.match(t4O)||[]}var ucl=r4O;function n4O(e){return Bxn(e)?ucl(e):ecl(e)}var scl=n4O;function i4O(e){return function(t){t=G8t(t);var r=Bxn(t)?scl(t):void 0,n=r?r[0]:t.charAt(0),i=r?ksl(r,1).join(""):t.slice(1);return n[e]()+i}}var ccl=i4O;var a4O=ccl("toUpperCase"),qV=a4O;function o4O(e){return qV(G8t(e).toLowerCase())}var Usi=o4O;function u4O(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}var lcl=u4O;function s4O(e){return function(t){return e==null?void 0:e[t]}}var fcl=s4O;var c4O={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},l4O=fcl(c4O),dcl=l4O;var f4O=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,d4O="\\u0300-\\u036f",p4O="\\ufe20-\\ufe2f",_4O="\\u20d0-\\u20ff",h4O=d4O+p4O+_4O,y4O="["+h4O+"]",v4O=RegExp(y4O,"g");function b4O(e){return e=G8t(e),e&&e.replace(f4O,dcl).replace(v4O,"")}var pcl=b4O;var g4O=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function m4O(e){return e.match(g4O)||[]}var _cl=m4O;var O4O=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function P4O(e){return O4O.test(e)}var hcl=P4O;var mcl="\\ud800-\\udfff",j4O="\\u0300-\\u036f",w4O="\\ufe20-\\ufe2f",D4O="\\u20d0-\\u20ff",S4O=j4O+w4O+D4O,Ocl="\\u2700-\\u27bf",Pcl="a-z\\xdf-\\xf6\\xf8-\\xff",E4O="\\xac\\xb1\\xd7\\xf7",M4O="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",x4O="\\u2000-\\u206f",T4O=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jcl="A-Z\\xc0-\\xd6\\xd8-\\xde",q4O="\\ufe0e\\ufe0f",wcl=E4O+M4O+x4O+T4O,Dcl="['\u2019]",ycl="["+wcl+"]",C4O="["+S4O+"]",Scl="\\d+",A4O="["+Ocl+"]",Ecl="["+Pcl+"]",Mcl="[^"+mcl+wcl+Scl+Ocl+Pcl+jcl+"]",N4O="\\ud83c[\\udffb-\\udfff]",z4O="(?:"+C4O+"|"+N4O+")",B4O="[^"+mcl+"]",xcl="(?:\\ud83c[\\udde6-\\uddff]){2}",Tcl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ixn="["+jcl+"]",I4O="\\u200d",vcl="(?:"+Ecl+"|"+Mcl+")",R4O="(?:"+Ixn+"|"+Mcl+")",bcl="(?:"+Dcl+"(?:d|ll|m|re|s|t|ve))?",gcl="(?:"+Dcl+"(?:D|LL|M|RE|S|T|VE))?",qcl=z4O+"?",Ccl="["+q4O+"]?",F4O="(?:"+I4O+"(?:"+[B4O,xcl,Tcl].join("|")+")"+Ccl+qcl+")*",L4O="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",U4O="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",V4O=Ccl+qcl+F4O,W4O="(?:"+[A4O,xcl,Tcl].join("|")+")"+V4O,H4O=RegExp([Ixn+"?"+Ecl+"+"+bcl+"(?="+[ycl,Ixn,"$"].join("|")+")",R4O+"+"+gcl+"(?="+[ycl,Ixn+vcl,"$"].join("|")+")",Ixn+"?"+vcl+"+"+bcl,Ixn+"+"+gcl,U4O,L4O,Scl,W4O].join("|"),"g");function $4O(e){return e.match(H4O)||[]}var Acl=$4O;function J4O(e,t,r){return e=G8t(e),t=r?void 0:t,t===void 0?hcl(e)?Acl(e):_cl(e):e.match(t)||[]}var Vsi=J4O;var G4O="['\u2019]",K4O=RegExp(G4O,"g");function Y4O(e){return function(t){return lcl(Vsi(pcl(t).replace(K4O,"")),e,"")}}var s3r=Y4O;var X4O=s3r(function(e,t,r){return t=t.toLowerCase(),e+(r?Usi(t):t)}),FE=X4O;var Q4O=Math.ceil,Z4O=Math.max;function k4O(e,t,r){(r?lXi(e,t,r):t===void 0)?t=1:t=Z4O(Kul(t),0);var n=e==null?0:e.length;if(!n||t<1)return[];for(var i=0,a=0,u=Array(Q4O(n/t));i<n;)u[a++]=_Xi(e,i,i+=t);return u}var Wsi=k4O;function e3O(){this.__data__=new i3r,this.size=0}var Ncl=e3O;function t3O(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var zcl=t3O;function r3O(e){return this.__data__.get(e)}var Bcl=r3O;function n3O(e){return this.__data__.has(e)}var Icl=n3O;var i3O=200;function a3O(e,t){var r=this.__data__;if(r instanceof i3r){var n=r.__data__;if(!a3r||n.length<i3O-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new RQr(n)}return r.set(e,t),this.size=r.size,this}var Rcl=a3O;function Rxn(e){var t=this.__data__=new i3r(e);this.size=t.size}Rxn.prototype.clear=Ncl;Rxn.prototype.delete=zcl;Rxn.prototype.get=Bcl;Rxn.prototype.has=Icl;Rxn.prototype.set=Rcl;var c3r=Rxn;var Vcl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fcl=Vcl&&typeof module=="object"&&module&&!module.nodeType&&module,o3O=Fcl&&Fcl.exports===Vcl,Lcl=o3O?uB.Buffer:void 0,Ucl=Lcl?Lcl.allocUnsafe:void 0;function u3O(e,t){if(t)return e.slice();var r=e.length,n=Ucl?Ucl(r):new e.constructor(r);return e.copy(n),n}var Wcl=u3O;function s3O(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var u=e[r];t(u,r,e)&&(a[i++]=u)}return a}var Hcl=s3O;function c3O(){return[]}var hXi=c3O;var l3O=Object.prototype,f3O=l3O.propertyIsEnumerable,$cl=Object.getOwnPropertySymbols,d3O=$cl?function(e){return e==null?[]:(e=Object(e),Hcl($cl(e),function(t){return f3O.call(e,t)}))}:hXi,yXi=d3O;var p3O=Object.getOwnPropertySymbols,_3O=p3O?function(e){for(var t=[];e;)Nxn(t,yXi(e)),e=zxn(e);return t}:hXi,Jcl=_3O;function h3O(e,t,r){var n=t(e);return SC(e)?n:Nxn(n,r(e))}var vXi=h3O;function y3O(e){return vXi(e,Exn,yXi)}var hWo=y3O;function v3O(e){return vXi(e,Mxn,Jcl)}var Gcl=v3O;var b3O=bre(uB,"DataView"),bXi=b3O;var g3O=bre(uB,"Promise"),gXi=g3O;var m3O=bre(uB,"Set"),mXi=m3O;var Kcl="[object Map]",O3O="[object Object]",Ycl="[object Promise]",Xcl="[object Set]",Qcl="[object WeakMap]",Zcl="[object DataView]",P3O=eDr(bXi),j3O=eDr(a3r),w3O=eDr(gXi),D3O=eDr(mXi),S3O=eDr(uXi),FQr=QX;(bXi&&FQr(new bXi(new ArrayBuffer(1)))!=Zcl||a3r&&FQr(new a3r)!=Kcl||gXi&&FQr(gXi.resolve())!=Ycl||mXi&&FQr(new mXi)!=Xcl||uXi&&FQr(new uXi)!=Qcl)&&(FQr=function(e){var t=QX(e),r=t==O3O?e.constructor:void 0,n=r?eDr(r):"";if(n)switch(n){case P3O:return Zcl;case j3O:return Kcl;case w3O:return Ycl;case D3O:return Xcl;case S3O:return Qcl}return t});var LQr=FQr;var E3O=uB.Uint8Array,Fxn=E3O;function M3O(e){var t=new e.constructor(e.byteLength);return new Fxn(t).set(new Fxn(e)),t}var kcl=M3O;function x3O(e,t){var r=t?kcl(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var ell=x3O;function T3O(e){return typeof e.constructor=="function"&&!t3r(e)?esl(zxn(e)):{}}var tll=T3O;function q3O(e){for(var t=-1,r=e==null?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i}var Y8t=q3O;var C3O="__lodash_hash_undefined__";function A3O(e){return this.__data__.set(e,C3O),this}var rll=A3O;function N3O(e){return this.__data__.has(e)}var nll=N3O;function OXi(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new RQr;++t<r;)this.add(e[t])}OXi.prototype.add=OXi.prototype.push=rll;OXi.prototype.has=nll;var PXi=OXi;function z3O(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var ill=z3O;function B3O(e,t){return e.has(t)}var jXi=B3O;var I3O=1,R3O=2;function F3O(e,t,r,n,i,a){var u=r&I3O,f=e.length,d=t.length;if(f!=d&&!(u&&d>f))return!1;var c=a.get(e),o=a.get(t);if(c&&o)return c==t&&o==e;var l=-1,g=!0,O=r&R3O?new PXi:void 0;for(a.set(e,t),a.set(t,e);++l<f;){var j=e[l],S=t[l];if(n)var x=u?n(S,j,l,t,e,a):n(j,S,l,e,t,a);if(x!==void 0){if(x)continue;g=!1;break}if(O){if(!ill(t,function(A,z){if(!jXi(O,z)&&(j===A||i(j,A,r,n,a)))return O.push(z)})){g=!1;break}}else if(!(j===S||i(j,S,r,n,a))){g=!1;break}}return a.delete(e),a.delete(t),g}var wXi=F3O;function L3O(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var all=L3O;function U3O(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var oll=U3O;var V3O=1,W3O=2,H3O="[object Boolean]",$3O="[object Date]",J3O="[object Error]",G3O="[object Map]",K3O="[object Number]",Y3O="[object RegExp]",X3O="[object Set]",Q3O="[object String]",Z3O="[object Symbol]",k3O="[object ArrayBuffer]",eNO="[object DataView]",ull=XX?XX.prototype:void 0,yWo=ull?ull.valueOf:void 0;function tNO(e,t,r,n,i,a,u){switch(r){case eNO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k3O:return!(e.byteLength!=t.byteLength||!a(new Fxn(e),new Fxn(t)));case H3O:case $3O:case K3O:return J8t(+e,+t);case J3O:return e.name==t.name&&e.message==t.message;case Y3O:case Q3O:return e==t+"";case G3O:var f=all;case X3O:var d=n&V3O;if(f||(f=oll),e.size!=t.size&&!d)return!1;var c=u.get(e);if(c)return c==t;n|=W3O,u.set(e,t);var o=wXi(f(e),f(t),n,i,a,u);return u.delete(e),o;case Z3O:if(yWo)return yWo.call(e)==yWo.call(t)}return!1}var sll=tNO;var rNO=1,nNO=Object.prototype,iNO=nNO.hasOwnProperty;function aNO(e,t,r,n,i,a){var u=r&rNO,f=hWo(e),d=f.length,c=hWo(t),o=c.length;if(d!=o&&!u)return!1;for(var l=d;l--;){var g=f[l];if(!(u?g in t:iNO.call(t,g)))return!1}var O=a.get(e),j=a.get(t);if(O&&j)return O==t&&j==e;var S=!0;a.set(e,t),a.set(t,e);for(var x=u;++l<d;){g=f[l];var A=e[g],z=t[g];if(n)var N=u?n(z,A,g,t,e,a):n(A,z,g,e,t,a);if(!(N===void 0?A===z||i(A,z,r,n,a):N)){S=!1;break}x||(x=g=="constructor")}if(S&&!x){var C=e.constructor,U=t.constructor;C!=U&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof U=="function"&&U instanceof U)&&(S=!1)}return a.delete(e),a.delete(t),S}var cll=aNO;var oNO=1,lll="[object Arguments]",fll="[object Array]",DXi="[object Object]",uNO=Object.prototype,dll=uNO.hasOwnProperty;function sNO(e,t,r,n,i,a){var u=SC(e),f=SC(t),d=u?fll:LQr(e),c=f?fll:LQr(t);d=d==lll?DXi:d,c=c==lll?DXi:c;var o=d==DXi,l=c==DXi,g=d==c;if(g&&tDr(e)){if(!tDr(t))return!1;u=!0,o=!1}if(g&&!o)return a||(a=new c3r),u||r3r(e)?wXi(e,t,r,n,i,a):sll(e,t,d,r,n,i,a);if(!(r&oNO)){var O=o&&dll.call(e,"__wrapped__"),j=l&&dll.call(t,"__wrapped__");if(O||j){var S=O?e.value():e,x=j?t.value():t;return a||(a=new c3r),i(S,x,r,n,a)}}return g?(a||(a=new c3r),cll(e,t,r,n,i,a)):!1}var pll=sNO;function _ll(e,t,r,n,i){return e===t?!0:e==null||t==null||!TV(e)&&!TV(t)?e!==e&&t!==t:pll(e,t,r,n,_ll,i)}var l3r=_ll;var cNO=1,lNO=2;function fNO(e,t,r,n){var i=r.length,a=i,u=!n;if(e==null)return!a;for(e=Object(e);i--;){var f=r[i];if(u&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++i<a;){f=r[i];var d=f[0],c=e[d],o=f[1];if(u&&f[2]){if(c===void 0&&!(d in e))return!1}else{var l=new c3r;if(n)var g=n(c,o,d,e,t,l);if(!(g===void 0?l3r(o,c,cNO|lNO,n,l):g))return!1}}return!0}var hll=fNO;function dNO(e){return e===e&&!kN(e)}var SXi=dNO;function pNO(e){for(var t=Exn(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,SXi(i)]}return t}var yll=pNO;function _NO(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var EXi=_NO;function hNO(e){var t=yll(e);return t.length==1&&t[0][2]?EXi(t[0][0],t[0][1]):function(r){return r===e||hll(r,e,t)}}var vll=hNO;function yNO(e,t){return e!=null&&t in Object(e)}var bll=yNO;function vNO(e,t,r){t=u3r(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var u=K8t(t[n]);if(!(a=e!=null&&r(e,u)))break;e=e[u]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&Dxn(i)&&e3r(u,i)&&(SC(e)||cCt(e)))}var gll=vNO;function bNO(e,t){return e!=null&&gll(e,t,bll)}var mll=bNO;var gNO=1,mNO=2;function ONO(e,t){return xxn(e)&&SXi(t)?EXi(K8t(e),t):function(r){var n=Gsl(r,e);return n===void 0&&n===t?mll(r,e):l3r(t,n,gNO|mNO)}}var Oll=ONO;function PNO(e){return function(t){return t==null?void 0:t[e]}}var MXi=PNO;function jNO(e){return function(t){return Axn(t,e)}}var Pll=jNO;function wNO(e){return xxn(e)?MXi(K8t(e)):Pll(e)}var jll=wNO;function DNO(e){return typeof e=="function"?e:e==null?Pxn:typeof e=="object"?SC(e)?Oll(e[0],e[1]):vll(e):jll(e)}var mxe=DNO;function SNO(e,t,r,n){for(var i=-1,a=e==null?0:e.length;++i<a;){var u=e[i];t(n,u,r(u),e)}return n}var wll=SNO;function ENO(e){return function(t,r,n){for(var i=-1,a=Object(t),u=n(t),f=u.length;f--;){var d=u[e?f:++i];if(r(a[d],d,a)===!1)break}return t}}var Dll=ENO;var MNO=Dll(),xXi=MNO;function xNO(e,t){return e&&xXi(e,t,Exn)}var Lxn=xNO;function TNO(e,t){return function(r,n){if(r==null)return r;if(!mre(r))return e(r,n);for(var i=r.length,a=t?i:-1,u=Object(r);(t?a--:++a<i)&&n(u[a],a,u)!==!1;);return r}}var Sll=TNO;var qNO=Sll(Lxn),Ell=qNO;function CNO(e,t,r,n){return Ell(e,function(i,a,u){t(n,i,r(i),u)}),n}var Mll=CNO;function ANO(e,t){return function(r,n){var i=SC(r)?wll:Mll,a=t?t():{};return i(r,e,mxe(n,2),a)}}var TXi=ANO;function NNO(e,t,r){(r!==void 0&&!J8t(e[t],r)||r===void 0&&!(t in e))&&gre(e,t,r)}var Hsi=NNO;function zNO(e){return TV(e)&&mre(e)}var $si=zNO;function BNO(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Jsi=BNO;function INO(e){return dsl(e,Mxn(e))}var xll=INO;function RNO(e,t,r,n,i,a,u){var f=Jsi(e,r),d=Jsi(t,r),c=u.get(d);if(c){Hsi(e,r,c);return}var o=a?a(f,d,r+"",e,t,u):void 0,l=o===void 0;if(l){var g=SC(d),O=!g&&tDr(d),j=!g&&!O&&r3r(d);o=d,g||O||j?SC(f)?o=f:$si(f)?o=rsl(f):O?(l=!1,o=Wcl(d,!0)):j?(l=!1,o=ell(d,!0)):o=[]:Lsi(d)||cCt(d)?(o=f,cCt(f)?o=xll(f):(!kN(f)||jxn(f))&&(o=tll(d))):l=!1}l&&(u.set(d,o),i(o,d,n,a,u),u.delete(d)),Hsi(e,r,o)}var Tll=RNO;function qll(e,t,r,n,i){e!==t&&xXi(t,function(a,u){if(i||(i=new c3r),kN(a))Tll(e,t,u,r,qll,n,i);else{var f=n?n(Jsi(e,u),a,u+"",e,t,i):void 0;f===void 0&&(f=a),Hsi(e,u,f)}},Mxn)}var Cll=qll;var FNO=hsl(function(e,t,r,n){Cll(e,t,r,n)}),qXi=FNO;function LNO(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var All=LNO;var UNO=200;function VNO(e,t,r,n){var i=-1,a=fsl,u=!0,f=e.length,d=[],c=t.length;if(!f)return d;r&&(t=Oxn(t,fXi(r))),n?(a=All,u=!1):t.length>=UNO&&(a=jXi,u=!1,t=new PXi(t));e:for(;++i<f;){var o=e[i],l=r==null?o:r(o);if(o=n||o!==0?o:0,u&&l===l){for(var g=c;g--;)if(t[g]===l)continue e;d.push(o)}else a(t,l,n)||d.push(o)}return d}var Nll=VNO;var WNO=cXi(function(e,t){return $si(e)?Nll(e,Qsl(t,1,$si,!0)):[]}),CXi=WNO;function HNO(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var vWo=HNO;var $NO=Object.prototype,JNO=$NO.hasOwnProperty,GNO=TXi(function(e,t,r){JNO.call(e,r)?e[r].push(t):gre(e,r,[t])}),bWo=GNO;function KNO(e,t){return e>t}var zll=KNO;var YNO="[object String]";function XNO(e){return typeof e=="string"||!SC(e)&&TV(e)&&QX(e)==YNO}var Bll=XNO;var QNO="[object Map]",ZNO="[object Set]",kNO=Object.prototype,e8O=kNO.hasOwnProperty;function t8O(e){if(e==null)return!0;if(mre(e)&&(SC(e)||typeof e=="string"||typeof e.splice=="function"||tDr(e)||r3r(e)||cCt(e)))return!e.length;var t=LQr(e);if(t==QNO||t==ZNO)return!e.size;if(t3r(e))return!Sxn(e).length;for(var r in e)if(e8O.call(e,r))return!1;return!0}var gWo=t8O;function r8O(e,t){return l3r(e,t)}var nDr=r8O;function n8O(e,t,r){r=typeof r=="function"?r:void 0;var n=r?r(e,t):void 0;return n===void 0?l3r(e,t,void 0,r):!!n}var Gsi=n8O;function i8O(e){return e===null}var mWo=i8O;var a8O=s3r(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),nR=a8O;var o8O=TXi(function(e,t,r){gre(e,r,t)}),OWo=o8O;function u8O(e,t){var r={};return t=mxe(t,3),Lxn(e,function(n,i,a){gre(r,t(n,i,a),n)}),r}var Ksi=u8O;function s8O(e,t){var r={};return t=mxe(t,3),Lxn(e,function(n,i,a){gre(r,i,t(n,i,a))}),r}var sy=s8O;function c8O(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],u=t(a);if(u!=null&&(f===void 0?u===u&&!$8t(u):r(u,f)))var f=u,d=a}return d}var Ill=c8O;function l8O(e,t){return e&&e.length?Ill(e,mxe(t,2),zll):void 0}var PWo=l8O;var f8O="Expected a function";function d8O(e){if(typeof e!="function")throw new TypeError(f8O);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var Rll=d8O;function p8O(e,t,r,n){if(!kN(e))return e;t=u3r(t,e);for(var i=-1,a=t.length,u=a-1,f=e;f!=null&&++i<a;){var d=K8t(t[i]),c=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=u){var o=f[d];c=n?n(o,d,f):void 0,c===void 0&&(c=kN(o)?o:e3r(t[i+1])?[]:{})}sXi(f,d,c),f=f[d]}return e}var Fll=p8O;function _8O(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var u=t[n],f=Axn(e,u);r(f,u)&&Fll(a,u3r(u,e),f)}return a}var Lll=_8O;function h8O(e,t){if(e==null)return{};var r=Oxn(Gcl(e),function(n){return[n]});return t=mxe(t),Lll(e,r,function(n,i){return t(n,i[0])})}var UQr=h8O;function y8O(e,t){return UQr(e,Rll(mxe(t)))}var jWo=y8O;var v8O=MXi("length"),Ull=v8O;var Wll="\\ud800-\\udfff",b8O="\\u0300-\\u036f",g8O="\\ufe20-\\ufe2f",m8O="\\u20d0-\\u20ff",O8O=b8O+g8O+m8O,P8O="\\ufe0e\\ufe0f",j8O="["+Wll+"]",wWo="["+O8O+"]",DWo="\\ud83c[\\udffb-\\udfff]",w8O="(?:"+wWo+"|"+DWo+")",Hll="[^"+Wll+"]",$ll="(?:\\ud83c[\\udde6-\\uddff]){2}",Jll="[\\ud800-\\udbff][\\udc00-\\udfff]",D8O="\\u200d",Gll=w8O+"?",Kll="["+P8O+"]?",S8O="(?:"+D8O+"(?:"+[Hll,$ll,Jll].join("|")+")"+Kll+Gll+")*",E8O=Kll+Gll+S8O,M8O="(?:"+[Hll+wWo+"?",wWo,$ll,Jll,j8O].join("|")+")",Vll=RegExp(DWo+"(?="+DWo+")|"+M8O+E8O,"g");function x8O(e){for(var t=Vll.lastIndex=0;Vll.test(e);)++t;return t}var Yll=x8O;function T8O(e){return Bxn(e)?Yll(e):Ull(e)}var Xll=T8O;var q8O="[object Map]",C8O="[object Set]";function A8O(e){if(e==null)return 0;if(mre(e))return Bll(e)?Xll(e):e.length;var t=LQr(e);return t==q8O||t==C8O?e.size:Sxn(e).length}var X8t=A8O;var N8O=s3r(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),AXi=N8O;var z8O=s3r(function(e,t,r){return e+(r?" ":"")+qV(t)}),Ysi=z8O;var Qll=100;async function B8O({files:e,absolutePathToFernFolder:t}){let r=await Promise.all(e.map(async n=>{let i=await(0,Zll.readFile)(n,"utf-8");return[await pMn(t,n),i]}));return Object.fromEntries(r)}async function kll({files:e,absolutePathToFernFolder:t}){let r={};for(let n=0;n<e.length;n+=Qll){let i=e.slice(n,n+Qll),a=await B8O({files:i,absolutePathToFernFolder:t});Object.assign(r,a)}return r}function EWo({landingPage:e,navigation:t}){return Y8t([e==null?void 0:e.absolutePath,...I8O(t)])}function I8O(e){switch(e.type){case"tabbed":return e.items.flatMap(t=>t.child.type==="layout"?t.child.layout.flatMap(r=>SWo({item:r})):t.child.type==="changelog"?t.child.changelog:[]);case"untabbed":return e.items.flatMap(t=>SWo({item:t}));case"versioned":return e.versions.flatMap(t=>EWo({landingPage:t.landingPage,navigation:t.navigation}));default:Ol(e)}}function SWo({item:e}){switch(e.type){case"apiSection":return Y8t([e.overviewAbsolutePath,...e.navigation.flatMap(t=>efl({item:t}))]);case"link":return[];case"page":return[e.absolutePath];case"section":return Y8t([e.overviewAbsolutePath,...e.contents.flatMap(t=>SWo({item:t}))]);case"changelog":return e.changelog;default:Ol(e)}}function efl({item:e}){return e.type==="page"?[e.absolutePath]:e.type==="package"||e.type==="section"?Y8t([e.overviewAbsolutePath,...e.contents.flatMap(t=>efl({item:t}))]):[]}var rHo={};Wb(rHo,{ContentAlignment:()=>CWo,FernDocsConfig:()=>Xsi,FernDocsConfigError:()=>VQr,FernDocsConfigTimeoutError:()=>WQr,FontDisplay:()=>zWo,FontStyle:()=>NWo,HeaderPosition:()=>AWo,JsScriptStrategy:()=>BWo,ProgrammingLanguage:()=>MWo,SearchbarPlacement:()=>TWo,Serializer:()=>o_,TabsPlacement:()=>qWo,TwitterCardSetting:()=>IWo,VersionAvailability:()=>xWo,docs:()=>NXi,serialization:()=>va});var Xsi={};Wb(Xsi,{ContentAlignment:()=>CWo,FontDisplay:()=>zWo,FontStyle:()=>NWo,HeaderPosition:()=>AWo,JsScriptStrategy:()=>BWo,ProgrammingLanguage:()=>MWo,SearchbarPlacement:()=>TWo,TabsPlacement:()=>qWo,TwitterCardSetting:()=>IWo,VersionAvailability:()=>xWo,docs:()=>NXi});var NXi={};Wb(NXi,{ContentAlignment:()=>CWo,FontDisplay:()=>zWo,FontStyle:()=>NWo,HeaderPosition:()=>AWo,JsScriptStrategy:()=>BWo,ProgrammingLanguage:()=>MWo,SearchbarPlacement:()=>TWo,TabsPlacement:()=>qWo,TwitterCardSetting:()=>IWo,VersionAvailability:()=>xWo});var MWo={Typescript:"typescript",Javascript:"javascript",Python:"python",Java:"java",Go:"go",Ruby:"ruby",Csharp:"csharp",Nodets:"nodets",Nodejs:"nodejs",Dotnet:"dotnet",Curl:"curl",Jvm:"jvm",Ts:"ts",Js:"js"};var xWo={Deprecated:"deprecated",Ga:"ga",Stable:"stable",Beta:"beta"};var TWo={Header:"header",HeaderTabs:"header-tabs",Sidebar:"sidebar"};var qWo={Header:"header",Sidebar:"sidebar"};var CWo={Center:"center",Left:"left"};var AWo={Fixed:"fixed",Static:"static"};var NWo={Normal:"normal",Italic:"italic"};var zWo={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"};var BWo={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"};var IWo={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"};var VQr=class extends Error{statusCode;body;constructor({message:t,statusCode:r,body:n}){super(R8O({message:t,statusCode:r,body:n})),Object.setPrototypeOf(this,VQr.prototype),r!=null&&(this.statusCode=r),n!==void 0&&(this.body=n)}};function R8O({message:e,statusCode:t,body:r}){let n=[];return e!=null&&n.push(e),t!=null&&n.push(`Status code: ${t.toString()}`),r!=null&&n.push(`Body: ${JSON.stringify(r,void 0,2)}`),n.join(`
|
|
1756
1756
|
`)}var WQr=class extends Error{constructor(){super("Timeout"),Object.setPrototypeOf(this,WQr.prototype)}};wy();c_();async function H_l({rawDocsConfiguration:e,absolutePathToFernFolder:t,absoluteFilepathToDocsConfig:r,context:n}){let{instances:i,title:a,tabs:u,versions:f,navigation:d,navbarLinks:c,footerLinks:o,defaultLanguage:l,metadata:g,redirects:O,logo:j,favicon:S,backgroundImage:x,colors:A,typography:z,layout:N,analytics:C,integrations:U,css:Y,js:te,experimental:G}=e,$=UXi(e.landingPage,r),ee=Y8O({tabs:u,versions:f,navigation:d,absolutePathToFernFolder:t,absolutePathToConfig:r,context:n}),Ve=ee.then(An=>kll({files:EWo({navigation:An,landingPage:$}),absolutePathToFernFolder:t})),$e=V8O(j,r),Dt=sB(S,r),Tt=W8O(x,r),Wt=z!=null?X8O({rawTypography:z,absoluteFilepathToDocsConfig:r}):void 0,Nt=H8O(Y,r),ur=G8O(te,r),Ar=f5O(g,r),[Gr,zt,_r,Xr,Gt,bn]=await Promise.all([ee,Ve,Wt,Nt,ur,Ar]);return{title:a,instances:i,pages:zt,landingPage:$,navigation:Gr,navbarLinks:c5O(c),footerLinks:l5O(o),defaultLanguage:l,announcement:e.announcement,metadata:bn,redirects:O,logo:$e,favicon:Dt,backgroundImage:Tt,colors:s8c(A,n),typography:_r,layout:K8O(N),analyticsConfig:e.analytics,integrations:U,css:Xr,js:Gt,experimental:G}}function V8O(e,t){return e!=null?{dark:sB(e.dark,t),light:sB(e.light,t),height:e.height,href:e.href!=null?e.href:void 0}:void 0}function W8O(e,t){if(e!=null)if(typeof e=="string"){let r=sB(e,t);return{dark:r,light:r}}else{let r=sB(e.dark,t),n=sB(e.light,t);return{dark:r,light:n}}}async function H8O(e,t){if(e==null)return;let r=typeof e=="string"?[e]:e;return{inline:await Promise.all(r.map(async n=>(await(0,aHo.readFile)(sB(n,t))).toString()))}}function $8O(e){return Object.hasOwn(e,"url")}function J8O(e){return Object.hasOwn(e,"path")}async function G8O(e,t){let r=[],n=[];if(e==null)return{files:[]};let i=Array.isArray(e)?e:[e];for(let a of i)typeof a=="string"?n.push({absolutePath:sB(a,t)}):$8O(a)?r.push(a):J8O(a)&&n.push({absolutePath:sB(a.path,t),strategy:a.strategy});return{remote:r,files:n}}function K8O(e){var t;if(e!=null)return{pageWidth:((t=e.pageWidth)==null?void 0:t.trim().toLowerCase())==="full"?{type:"full"}:FXi(e.pageWidth),contentWidth:FXi(e.contentWidth),sidebarWidth:FXi(e.sidebarWidth),headerHeight:FXi(e.headerHeight),searchbarPlacement:e.searchbarPlacement==="header"?Z8t.FernRegistry.docs.v1.commons.SearchbarPlacement.Header:e.searchbarPlacement==="header-tabs"?Z8t.FernRegistry.docs.v1.commons.SearchbarPlacement.HeaderTabs:Z8t.FernRegistry.docs.v1.commons.SearchbarPlacement.Sidebar,tabsPlacement:e.tabsPlacement==="header"?Z8t.FernRegistry.docs.v1.commons.TabsPlacement.Header:Z8t.FernRegistry.docs.v1.commons.TabsPlacement.Sidebar,contentAlignment:e.contentAlignment==="left"?Z8t.FernRegistry.docs.v1.commons.ContentAlignment.Left:Z8t.FernRegistry.docs.v1.commons.ContentAlignment.Center,headerPosition:e.headerPosition==="static"?Z8t.FernRegistry.docs.v1.commons.HeaderPosition.Absolute:Z8t.FernRegistry.docs.v1.commons.HeaderPosition.Fixed,disableHeader:e.disableHeader??!1}}function FXi(e){if(e==null)return;let t=e.trim().toLowerCase(),r=t.match(/^(\d+)px$/);if(r!=null&&r[1]!=null)return{type:"px",value:parseFloat(r[1])};let n=t.match(/^(\d+)rem$/);if(n!=null&&n[1]!=null)return{type:"rem",value:parseFloat(n[1])}}async function Y8O({tabs:e,versions:t,navigation:r,absolutePathToFernFolder:n,absolutePathToConfig:i,context:a}){if(r!=null)return await W_l({tabs:e,rawNavigationConfig:r,absolutePathToFernFolder:n,absolutePathToConfig:i,context:a});if(t!=null){let u=[];for(let f of t){let d=j2(n,f.path),c=av.load((await(0,aHo.readFile)(d)).toString()),o=await o_.VersionFileConfig.parseOrThrow(c),l=await W_l({tabs:o.tabs,rawNavigationConfig:o.navigation,absolutePathToFernFolder:n,absolutePathToConfig:d,context:a});u.push({landingPage:UXi(o.landingPage,d),version:f.displayName,navigation:l,availability:f.availability,slug:f.slug})}return{type:"versioned",versions:u}}throw new Error("Unexpected. Docs have neither navigation or versions defined.")}async function X8O({rawTypography:e,absoluteFilepathToDocsConfig:t}){return{headingsFont:e.headingsFont!=null?await nHo({rawFontConfig:e.headingsFont,absoluteFilepathToDocsConfig:t}):void 0,bodyFont:e.bodyFont!=null?await nHo({rawFontConfig:e.bodyFont,absoluteFilepathToDocsConfig:t}):void 0,codeFont:e.codeFont!=null?await nHo({rawFontConfig:e.codeFont,absoluteFilepathToDocsConfig:t}):void 0}}async function nHo({rawFontConfig:e,absoluteFilepathToDocsConfig:t}){return{name:e.name,variants:await Q8O(e,t),display:e.display,fallback:e.fallback,fontVariationSettings:e.fontVariationSettings}}function Q8O(e,t){var n;let r=[];return e.path!=null&&r.push({path:e.path,weight:e.weight,style:e.style}),(n=e.paths)==null||n.forEach(i=>{typeof i=="string"?r.push({path:i,weight:e.weight,style:e.style}):r.push({path:i.path,weight:i.weight??e.weight,style:i.style??e.style})}),Promise.all(r.map(async i=>({absolutePath:sB(i.path,t),weight:Z8O(i.weight),style:i.style})))}function Z8O(e){return e==null?void 0:typeof e=="number"?[e.toString()]:e.split(/\D+/).filter(r=>r!==""&&["100","200","300","400","500","600","700","800","900"].includes(r))}async function k8O({tabs:e,item:t,absolutePathToFernFolder:r,absolutePathToConfig:n,context:i}){let a=e[t.tab];if(a==null)throw new Error(`Tab ${t.tab} is not defined in the tabs config.`);if(t.layout!=null){let u=await Promise.all(t.layout.map(f=>oHo({rawConfig:f,absolutePathToFernFolder:r,absolutePathToConfig:n,context:i})));return{title:a.displayName,icon:a.icon,slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"layout",layout:u}}}if(a.href!=null)return{title:a.displayName,icon:a.icon,slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"link",href:a.href}};if(a.changelog!=null)return{title:a.displayName,icon:a.icon,slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"changelog",changelog:await o4r(sB(a.changelog,n),"{md,mdx}")}};Ol(a)}async function W_l({tabs:e={},rawNavigationConfig:t,absolutePathToFernFolder:r,absolutePathToConfig:n,context:i}){if(s5O(t)){let a=await Promise.all(t.map(u=>k8O({tabs:e,item:u,absolutePathToFernFolder:r,absolutePathToConfig:n,context:i})));return{type:"tabbed",items:a}}else return{type:"untabbed",items:await Promise.all(t.map(a=>oHo({rawConfig:a,absolutePathToFernFolder:r,absolutePathToConfig:n,context:i})))}}var e5O="Changelog";async function oHo({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:n}){var i;if($_l(e))return UXi(e,r);if(r5O(e))return{type:"section",title:e.section,icon:e.icon,contents:await Promise.all(e.contents.map(a=>oHo({rawConfig:a,absolutePathToFernFolder:t,absolutePathToConfig:r,context:n}))),slug:e.slug??void 0,collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,skipUrlSlug:e.skipSlug??!1,overviewAbsolutePath:sB(e.path,r)};if(n5O(e))return{type:"apiSection",title:e.api,icon:e.icon,apiName:e.apiName??void 0,audiences:e.audiences!=null?{type:"select",audiences:e.audiences}:{type:"all"},showErrors:e.displayErrors??!1,snippetsConfiguration:e.snippets!=null?t5O({rawConfig:e.snippets}):void 0,navigation:((i=e.layout)==null?void 0:i.flatMap(a=>LXi(a,r)))??[],overviewAbsolutePath:sB(e.summary,r),hidden:e.hidden??void 0,slug:e.slug,skipUrlSlug:e.skipSlug??!1,flattened:e.flattened??!1,alphabetized:e.alphabetized??!1,paginated:e.paginated??!1,playground:e.playground};if(J_l(e))return{type:"link",text:e.link,url:e.href,icon:e.icon};if(i5O(e))return{type:"changelog",changelog:await o4r(sB(e.changelog,r),"{md,mdx}"),hidden:e.hidden??!1,icon:e.icon,title:e.title??e5O,slug:e.slug};Ol(e)}function UXi(e,t){if(e!=null)return{type:"page",title:e.page,absolutePath:sB(e.path,t),slug:e.slug,icon:e.icon,hidden:e.hidden,noindex:void 0}}function LXi(e,t){var r;return typeof e=="string"?[{type:"item",value:e}]:$_l(e)?[UXi(e,t)]:J_l(e)?[{type:"link",text:e.link,url:e.href,icon:e.icon}]:a5O(e)?[{type:"section",title:e.section,referencedSubpackages:e.referencedPackages??[],overviewAbsolutePath:sB(e.summary,t),contents:((r=e.contents)==null?void 0:r.flatMap(n=>LXi(n,t)))??[],slug:e.slug,hidden:e.hidden,skipUrlSlug:e.skipSlug,icon:e.icon,playground:e.playground}]:o5O(e)?[{type:"endpoint",endpoint:e.endpoint,title:e.title,icon:e.icon,slug:e.slug,hidden:e.hidden,playground:e.playground}]:Object.entries(e).map(([n,i])=>{var a;return u5O(i)?{type:"package",title:i.title,package:n,overviewAbsolutePath:sB(i.summary,t),contents:((a=i.contents)==null?void 0:a.flatMap(u=>LXi(u,t)))??[],slug:i.slug,hidden:i.hidden,skipUrlSlug:i.skipSlug,icon:i.icon,playground:i.playground}:{type:"package",title:void 0,package:n,overviewAbsolutePath:void 0,contents:i.flatMap(u=>LXi(u,t)),hidden:!1,slug:void 0,skipUrlSlug:!1,icon:void 0,playground:void 0}})}function t5O({rawConfig:e}){return{python:e.python,typescript:e.typescript,go:e.go,java:e.java,ruby:e.ruby}}function $_l(e){return RO(e)&&typeof e.page=="string"&&typeof e.path=="string"}function r5O(e){return e.section!=null}function n5O(e){return e.api!=null}function J_l(e){return Xsi,RO(e)&&typeof e.link=="string"&&typeof e.href=="string"}function i5O(e){return RO(e)&&typeof e.changelog=="string"}function a5O(e){return RO(e)&&typeof e.section=="string"&&Array.isArray(e.contents)}function o5O(e){return RO(e)&&typeof e.endpoint=="string"}function u5O(e){return!Array.isArray(e)}function sB(e,t){if(e!=null)return j2(Cg(t),e)}function s5O(e){return Array.isArray(e)&&e.length>0&&e[0].tab!=null}function c5O(e){return e==null?void 0:e.map(t=>t.type==="github"?{type:"github",url:t.value}:{type:t.type,text:t.text,url:t.href??t.url??"/",icon:t.icon,rightIcon:t.rightIcon,rounded:t.rounded})}function l5O(e){if(e==null)return;let t=[];if(Object.keys(e).forEach(r=>{let n=e[r];n!=null&&t.push({type:r,value:n})}),t.length!==0)return t}async function f5O(e,t){if(e!=null)return{"og:site_name":e.ogSiteName,"og:title":e.ogTitle,"og:description":e.ogDescription,"og:url":e.ogUrl,"og:image":await iHo(e.ogImage,t),"og:image:width":e.ogImageWidth,"og:image:height":e.ogImageHeight,"og:locale":e.ogLocale,"og:logo":await iHo(e.ogLogo,t),"twitter:title":e.twitterTitle,"twitter:description":e.twitterDescription,"twitter:image":await iHo(e.twitterImage,t),"twitter:handle":e.twitterHandle,"twitter:site":e.twitterSite,"twitter:url":e.twitterUrl,"twitter:card":e.twitterCard,nofollow:void 0,noindex:void 0}}async function iHo(e,t){if(e==null)return;if(e.startsWith("http"))return{type:"url",value:e};let r=sB(e,t);return await Vh(r)?{type:"filepath",value:r}:{type:"url",value:e}}var k8t={};Wb(k8t,{ProjectConfigSchema:()=>VXi,loadProjectConfig:()=>d5O});var G_l=require("fs/promises");var VXi=nr.strictObject({organization:nr.string(),version:nr.string()});async function d5O({directory:e,context:t}){let r=pf(e,zs.of(E8t)),n=await(0,G_l.readFile)(r),i=JSON.parse(n.toString()),a=await lMn({schema:VXi,value:i,context:t,filepathBeingParsed:r});return{_absolutePath:r,rawConfig:a,organization:a.organization,version:a.version}}var pg={};Wb(pg,{API_ORIGIN_LOCATION_KEY:()=>yli,ASYNC_API_LOCATION_KEY:()=>vli,DEFAULT_GROUP_GENERATORS_CONFIG_KEY:()=>kQr,DEFAULT_GROUP_NAME:()=>Bui,GENERATOR_INVOCATIONS:()=>WXi,GenerationLanguage:()=>K5t,GeneratorName:()=>ut,OPENAPI_LOCATION_KEY:()=>hli,addGenerator:()=>Kgl,getGeneratorNameOrThrow:()=>HXi,getLatestGeneratorVersion:()=>hZi,getPackageName:()=>Xgl,getPathToGeneratorsConfiguration:()=>Dia,isApiConfigurationV2Schema:()=>vZi,isAsyncAPISchema:()=>Ygl,isOpenAPISchema:()=>bZi,isRawProtobufAPIDefinitionSchema:()=>Tci,loadGeneratorsConfiguration:()=>NMl,loadRawGeneratorsConfiguration:()=>wKo,updateGeneratorGroup:()=>yZi});var ut={TYPESCRIPT:"fernapi/fern-typescript",TYPESCRIPT_SDK:"fernapi/fern-typescript-sdk",TYPESCRIPT_NODE_SDK:"fernapi/fern-typescript-node-sdk",TYPESCRIPT_BROWSER_SDK:"fernapi/fern-typescript-browser-sdk",TYPESCRIPT_EXPRESS:"fernapi/fern-typescript-express",JAVA:"fernapi/fern-java",JAVA_MODEL:"fernapi/java-model",JAVA_SDK:"fernapi/fern-java-sdk",JAVA_SPRING:"fernapi/fern-java-spring",PYTHON_FASTAPI:"fernapi/fern-fastapi-server",PYTHON_PYDANTIC:"fernapi/fern-pydantic-model",PYTHON_SDK:"fernapi/fern-python-sdk",GO_MODEL:"fernapi/fern-go-model",GO_SDK:"fernapi/fern-go-sdk",GO_FIBER:"fernapi/fern-go-fiber",RUBY_MODEL:"fernapi/fern-ruby-model",RUBY_SDK:"fernapi/fern-ruby-sdk",CSHARP_MODEL:"fernapi/fern-csharp-model",CSHARP_SDK:"fernapi/fern-csharp-sdk",SWIFT_MODEL:"fernapi/fern-swift-model",SWIFT_SDK:"fernapi/fern-swift-sdk",OPENAPI:"fernapi/fern-openapi",STOPLIGHT:"fernapi/fern-stoplight",POSTMAN:"fernapi/fern-postman",OPENAPI_PYTHON_CLIENT:"fernapi/openapi-python-client"};var WXi={[ut.JAVA]:{version:"1.0.5"},[ut.TYPESCRIPT_EXPRESS]:{version:"0.17.3",output:{location:"local-file-system",path:"../src/fern"}},[ut.JAVA_MODEL]:{version:"0.9.2"},[ut.JAVA_SDK]:{version:"1.0.5"},[ut.JAVA_SPRING]:{version:"0.9.2",output:{location:"local-file-system",path:"../src/main/java/com/fern"},config:{"package-prefix":"com.fern"}},[ut.TYPESCRIPT]:{version:"0.39.3"},[ut.TYPESCRIPT_SDK]:{version:"0.39.3"},[ut.TYPESCRIPT_NODE_SDK]:{version:"0.39.3",output:{location:"local-file-system",path:"../sdks/typescript"}},[ut.TYPESCRIPT_BROWSER_SDK]:{version:"0.39.3",output:{location:"local-file-system",path:"../sdks/typescript"}},[ut.PYTHON_PYDANTIC]:{version:"1.4.3"},[ut.PYTHON_FASTAPI]:{version:"1.4.6",output:{location:"local-file-system",path:"../src/fern"}},[ut.PYTHON_SDK]:{version:"3.10.6",output:{location:"local-file-system",path:"../sdks/python"}},[ut.GO_FIBER]:{version:"0.23.0"},[ut.GO_MODEL]:{version:"0.23.0"},[ut.GO_SDK]:{version:"0.23.0",output:{location:"local-file-system",path:"../sdks/go"},config:{importPath:"go-mod-path/generated/go"}},[ut.RUBY_MODEL]:{version:"0.0.8"},[ut.RUBY_SDK]:{version:"0.8.2",output:{location:"local-file-system",path:"../sdks/ruby"}},[ut.OPENAPI]:{version:"0.0.31",config:{format:"yaml"},output:{location:"local-file-system",path:"../openapi"}},[ut.STOPLIGHT]:{version:"0.0.24",config:{format:"yaml"}},[ut.POSTMAN]:{version:"0.1.1",output:{location:"local-file-system",path:"../postman"}},[ut.OPENAPI_PYTHON_CLIENT]:{version:"0.0.11",output:{location:"local-file-system",path:"../sdks/python"},config:{format:"yaml"}},[ut.CSHARP_MODEL]:{version:"0.0.2"},[ut.CSHARP_SDK]:{version:"1.2.1",output:{location:"local-file-system",path:"../sdks/csharp"}},[ut.SWIFT_MODEL]:{version:"0.0.0"},[ut.SWIFT_SDK]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/swift/sdk"}}};function HXi(e,t){let r=p5O(e);return r??t.failAndThrow("Unrecognized generator: "+e)}function p5O(e){if(e.startsWith("fernapi/")||(e=`fernapi/${e}`),_5O(e))return e}function _5O(e){return Object.values(ut).includes(e)}var _Zi=yu(nZi(),1),Ggl=yu(ZQr(),1);async function hZi({generatorName:e,cliVersion:t,channel:r,currentGeneratorVersion:n,includeMajor:i,context:a}){let u=Ggl.default.parse(n),f=new _Zi.FernRegistryClient({environment:"https://registry.buildwithfern.com"});a==null||a.logger.debug(`Getting latest version for ${e} with CLI version ${t}, includeMajor: ${i}, prior version: ${u}`);let d={generator:yHO(e,a),releaseTypes:[r??_Zi.FernRegistry.generators.ReleaseType.Ga],cliVersion:t==="0.0.0"?void 0:t};!i&&u!=null&&(d.generatorMajorVersion=u.major);let c=await f.generators.versions.getLatestGeneratorRelease(d);if(c.ok)return c.body.version}function yHO(e,t){switch(e.startsWith("fernapi/")&&(e=e.replace("fernapi/","")),e){case"fern-python-sdk":return"python-sdk";case"fern-pydantic-model":return"pydantic";case"fern-fastapi-server":return"fastapi";case"fern-typescript-browser-sdk":case"fern-typescript-node-sdk":case"fern-typescript-sdk":return"ts-sdk";case"fern-typescript-express":return"ts-express";case"fern-java-sdk":return"java-sdk";case"java-model":return"java-model";case"fern-java-spring":return"java-spring";case"fern-go-sdk":return"go-sdk";case"fern-go-model":return"go-model";case"fern-go-fiber":return"go-fiber";case"fern-csharp-sdk":return"csharp-sdk";case"fern-csharp-model":return"csharp-model";case"fern-ruby-sdk":return"ruby-sdk";case"fern-ruby-model":return"ruby-model";case"fern-postman":return"postman";case"fern-openapi":return"openapi";default:return t==null||t.logger.warn(`Unrecognized generator name found, attempting to parse manually: ${e}`),e.startsWith("fern-")?e.replace("fern-",""):e}}async function Kgl({generatorName:e,generatorsConfiguration:t,groupName:r=t[kQr],context:n,cliVersion:i}){let a=HXi(e,n),u=WXi[a];return await yZi({generatorsConfiguration:t,groupName:r,context:n,update:async f=>{f.generators.some(d=>d.name===a)&&n.failAndThrow(`${e} is already installed in group ${r}.`),f.generators.push({name:a,...u,version:await hZi({cliVersion:i,generatorName:a,context:n,channel:void 0})??u.version})}})}function vZi(e){return(e==null?void 0:e.specs)!=null}function Ygl(e){return(e==null?void 0:e.asyncapi)!=null}function bZi(e){return(e==null?void 0:e.openapi)!=null}var K5t={TYPESCRIPT:"typescript",JAVA:"java",PYTHON:"python",GO:"go",RUBY:"ruby",CSHARP:"csharp",SWIFT:"swift",PHP:"php"};function Xgl({generatorInvocation:e}){return e.outputMode._visit({downloadFiles:()=>{},github:t=>{var r;return(r=t.publishInfo)==null?void 0:r._visit({maven:n=>n.coordinate,npm:n=>n.packageName,pypi:n=>n.packageName,postman:()=>{},rubygems:n=>n.packageName,nuget:n=>n.packageName,_other:()=>{}})},githubV2:t=>{var r;return(r=t.publishInfo)==null?void 0:r._visit({maven:n=>n.coordinate,npm:n=>n.packageName,pypi:n=>n.packageName,postman:()=>{},rubygems:n=>n.packageName,nuget:n=>n.packageName,_other:()=>{}})},publish:()=>{},publishV2:()=>{},_other:()=>{}})}function Tci(e){return typeof e!="string"&&"proto"in e}var CMl=require("fs/promises");var AMl=yu(require("path"),1);var JT=yu(gZr(),1),jKo=yu(NP(),1),SMl=require("fs/promises"),EMl=yu(require("path"),1);var _Bt="$";var t8={};Wb(t8,{AliasSchema:()=>Kki,AnyAuthSchemesSchema:()=>Yki,ApiAuthSchema:()=>Xki,AuthSchemeDeclarationSchema:()=>oea,AuthSchemeReferenceSchema:()=>n2n,AvailabilitySchema:()=>Uki,AvailabilityStatusSchema:()=>ZTn,AvailabilityUnionSchema:()=>$3r,BaseTypeDeclarationSchema:()=>jje,BasicAuthSchemeSchema:()=>Qki,BearerAuthSchemeSchema:()=>Zki,CasingOverridesSchema:()=>uea,CursorPaginationSchema:()=>sea,DeclarationSchema:()=>CJ,DeclarationWithoutDocsSchema:()=>nli,DefinitionFileSchema:()=>s2n,DiscriminatedUnionSchema:()=>pea,EncodingSchema:()=>kTn,EnumSchema:()=>_ea,EnumValueSchema:()=>a2n,EnvironmentSchema:()=>vea,ErrorDeclarationSchema:()=>bea,ErrorDiscriminationSchema:()=>Oea,ErrorReferenceSchema:()=>Pea,ExampleBodyResponseSchema:()=>qGo,ExampleCodeSampleSchema:()=>jea,ExampleEndpointCallArraySchema:()=>aEl,ExampleEndpointCallSchema:()=>ili,ExampleResponseSchema:()=>wea,ExampleSseResponseSchema:()=>AGo,ExampleStreamResponseSchema:()=>CGo,ExampleTypeReferenceSchema:()=>WV,ExampleTypeSchema:()=>e2n,ExampleTypeValueSchema:()=>Wki,ExampleWebSocketSession:()=>Dea,ExampleWebhookCallSchema:()=>ali,GrpcSchema:()=>zea,HeaderAuthSchemeSchema:()=>kki,HttpEndpointSchema:()=>Nea,HttpHeaderSchema:()=>Dje,HttpInlineRequestBodyPropertySchema:()=>oli,HttpInlineRequestBodySchema:()=>Sea,HttpMethodSchema:()=>NGo,HttpPathParameterSchema:()=>hBt,HttpQueryParameterSchema:()=>o2n,HttpReferencedRequestBodySchema:()=>Eea,HttpRequestBodySchema:()=>Mea,HttpRequestSchema:()=>xea,HttpResponseSchema:()=>Tea,HttpResponseStreamSchema:()=>qea,HttpServiceSchema:()=>Iea,MultipleBaseUrlsEnvironmentSchema:()=>hea,NumberValidationSchema:()=>Jki,OAuthAccessTokenRequestPropertiesSchema:()=>eea,OAuthAccessTokenResponsePropertiesSchema:()=>i2n,OAuthClientCredentialsSchema:()=>iea,OAuthGetTokenEndpointSchema:()=>tea,OAuthRefreshTokenEndpointSchema:()=>nea,OAuthRefreshTokenRequestPropertiesSchema:()=>rea,OAuthSchemeSchema:()=>aea,ObjectPropertySchema:()=>wje,ObjectSchema:()=>Rea,OffsetPaginationSchema:()=>Cea,OpenAPISourceSchema:()=>Hki,PackageMarkerFileSchema:()=>Xea,PaginationSchema:()=>u2n,PropertyErrorDiscriminationSchema:()=>gea,ProtobufSourceSchema:()=>$ki,ProtobufTypeSchema:()=>Vki,ResponseErrorsSchema:()=>Aea,RootApiFileSchema:()=>tta,SingleBaseUrlEnvironmentSchema:()=>yea,SingleUnionTypeKeySchema:()=>fea,SingleUnionTypeSchema:()=>dea,SourceSchema:()=>t2n,StatusCodeErrorDiscriminationSchema:()=>mea,StringValidationSchema:()=>Gki,SupportedSdkLanguageSchema:()=>TGo,TransportSchema:()=>Bea,TypeDeclarationSchema:()=>Lea,TypeReferenceSchema:()=>lea,UndiscriminatedUnionSchema:()=>Fea,ValidationSchema:()=>r2n,VariableDeclarationSchema:()=>Qea,VersionDeclarationHeaderObjectSchema:()=>Zea,VersionDeclarationHeaderSchema:()=>kea,VersionDeclarationSchema:()=>eta,WebSocketChannelInlinedMessageSchema:()=>$ea,WebSocketChannelMessageBodySchema:()=>Gea,WebSocketChannelMessageSchema:()=>Kea,WebSocketChannelReferencedMessageSchema:()=>Jea,WebSocketChannelSchema:()=>Yea,WebhookInlinedPayloadSchema:()=>Uea,WebhookPayloadSchema:()=>Wea,WebhookReferencedPayloadSchema:()=>Vea,WebhookSchema:()=>Hea,WithAuthSchema:()=>BGo,WithDocsSchema:()=>bM,WithEnvironmentsSchema:()=>zGo,WithHeadersSchema:()=>IGo,WithNameAndDocsSchema:()=>VV,WithNameSchema:()=>Kre});var ZTn=nr.enum(["in-development","pre-release","deprecated","generally-available"]);var Uki=nr.strictObject({status:ZTn,message:nr.optional(nr.string())});var $3r=nr.optional(nr.union([ZTn,Uki]));var bM=nr.strictObject({docs:nr.optional(nr.string())});var nli=nr.strictObject({availability:$3r,audiences:nr.optional(nr.array(nr.string()))}),CJ=bM.extend(nli.shape);var Vki=nr.strictObject({type:nr.string().describe("The name of the Protobuf type (e.g. google.protobuf.Struct).")});var kTn=nr.strictObject({proto:nr.optional(Vki)});var Wki=nr.unknown();var Kre=nr.strictObject({name:nr.optional(nr.string())});var VV=Kre.extend(bM.shape);var e2n=VV.extend({value:Wki});var Hki=nr.strictObject({openapi:nr.string().describe("The OpenAPI filepath that defined this node.")});var $ki=nr.strictObject({proto:nr.string().describe("The Protobuf filepath that defined this node.")});var t2n=nr.union([$ki,Hki]);var jje=CJ.extend({examples:nr.optional(nr.array(e2n)),encoding:nr.optional(kTn),source:nr.optional(t2n)});var Jki=nr.strictObject({min:nr.number().optional(),max:nr.number().optional(),exclusiveMin:nr.boolean().optional(),exclusiveMax:nr.boolean().optional(),multipleOf:nr.number().optional()});var Gki=nr.strictObject({minLength:nr.number().optional(),maxLength:nr.number().optional(),pattern:nr.string().optional(),format:nr.string().optional()});var r2n=nr.union([Gki,Jki]);var Kki=jje.extend(nr.strictObject({type:nr.string(),validation:nr.optional(r2n)}).shape);var n2n=bM.extend({scheme:nr.string()});var Yki=bM.extend({any:nr.array(nr.union([nr.string(),n2n]))});var Xki=nr.union([nr.string(),n2n,Yki]);var mZr=Kre.extend({env:nr.optional(nr.string())});var Qki=nr.strictObject({scheme:nr.literal("basic"),username:nr.optional(mZr),password:nr.optional(mZr)});var Zki=nr.strictObject({scheme:nr.literal("bearer"),token:nr.optional(mZr)});var kki=mZr.extend({header:nr.string(),type:nr.optional(nr.string()),prefix:nr.optional(nr.string())});var eea=nr.strictObject({"client-id":nr.optional(nr.string()).describe("The property name for the client ID."),"client-secret":nr.optional(nr.string()).describe("The property name for the client secret."),scopes:nr.optional(nr.string()).describe("The property name for the scopes.")});var i2n=nr.strictObject({"access-token":nr.optional(nr.string()).describe("The property name for the access token."),"expires-in":nr.optional(nr.string()).describe("The property name for the expires in property."),"refresh-token":nr.optional(nr.string()).describe("The property name for the refresh token.")});var tea=nr.strictObject({endpoint:nr.string().describe("The endpoint to get the access token, such as 'auth.get_token')"),"request-properties":eea.optional(),"response-properties":i2n.optional()});var rea=nr.strictObject({"refresh-token":nr.string().describe("The property name for the refresh token.")});var nea=nr.strictObject({endpoint:nr.string().describe("The endpoint to refresh the access token, such as 'auth.refresh_token')"),"request-properties":rea.optional(),"response-properties":i2n.optional()});var iea=nr.strictObject({scheme:nr.literal("oauth"),type:nr.literal("client-credentials"),scopes:nr.optional(nr.array(nr.string())),"client-id-env":nr.optional(nr.string()),"client-secret-env":nr.optional(nr.string()),"token-prefix":nr.optional(nr.string()),"get-token":tea,"refresh-token":nr.optional(nea)});var aea=iea;var oea=nr.union([aea,kki,Qki,Zki]);var uea=nr.object({camel:nr.optional(nr.string()),snake:nr.optional(nr.string()),pascal:nr.optional(nr.string()),"screaming-snake":nr.optional(nr.string())});var sea=nr.object({cursor:nr.string().describe("The path to the request property for the cursor."),next_cursor:nr.string().describe("The path to the response property for the next cursor."),results:nr.string().describe("The path to the response property for the page elements.")});var Yre=nr.union([nr.string(),nr.array(nr.string())]);var OZr=CJ.extend(Kre.shape);var cea=nr.strictObject({availability:$3r});function J3r(e){return nr.union([nr.string(),nr.strictObject({type:nr.string(),default:nr.unknown().optional(),encoding:nr.optional(kTn),validation:nr.optional(r2n)}).extend(cea.shape).extend(bM.shape).extend(e)])}var lea=J3r(nr.object({}).shape),vH6=J3r(CJ.shape),rEl=J3r(OZr.shape),nEl=J3r(OZr.extend({env:nr.optional(nr.string())}).shape);var wje=rEl;var fea=Kre.extend({value:nr.string()});var Xre=nr.strictObject({"display-name":nr.optional(nr.string())});var dea=nr.union([nr.string(),nr.strictObject({type:nr.optional(nr.union([nr.string(),nr.record(nr.never())])),key:nr.optional(nr.union([nr.string(),fea]))}).extend(cea.shape).extend(VV.shape).extend(Xre.shape)]);var iEl=Kre.extend({value:nr.string()});var pea=jje.extend({"base-properties":nr.optional(nr.record(wje)),extends:nr.optional(Yre),union:nr.record(dea),discriminant:nr.optional(nr.union([nr.string(),iEl]))});var a2n=VV.extend({value:nr.string(),casing:nr.optional(uea)});var _ea=jje.extend({default:nr.string().optional(),enum:nr.array(nr.union([nr.string(),a2n]))});var hea=bM.extend({urls:nr.record(nr.string()),audiences:nr.optional(nr.array(nr.string()))});var yea=bM.extend({url:nr.string(),audiences:nr.optional(nr.array(nr.string()))});var vea=nr.union([nr.string(),yea,hea]);var bea=bM.extend({"status-code":nr.number(),type:nr.optional(nr.string()),examples:nr.optional(nr.array(e2n))});var gea=nr.object({strategy:nr.literal("property"),"property-name":nr.string()});var mea=nr.object({strategy:nr.literal("status-code")});var Oea=nr.union([gea,mea]);var Pea=bM.extend({error:nr.string()});var TGo=nr.enum(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","c#","dotnet","jvm"]);var otP=VV.extend({sdk:TGo,code:nr.string()}),utP=VV.extend({language:nr.string(),code:nr.string(),install:nr.optional(nr.string())}),jea=nr.union([otP,utP]);var WV=nr.unknown();var qGo=nr.strictObject({error:nr.optional(nr.string()),body:nr.optional(WV)}),CGo=nr.strictObject({stream:nr.array(WV)}),stP=nr.strictObject({event:nr.string(),data:nr.optional(WV)}),AGo=nr.strictObject({stream:nr.array(stP)}),wea=nr.union([qGo,CGo,AGo]);var ili=VV.extend({id:nr.optional(nr.string()),"path-parameters":nr.optional(nr.record(nr.string(),WV)),"query-parameters":nr.optional(nr.record(nr.string(),WV)),headers:nr.optional(nr.record(nr.string(),WV)),request:nr.optional(WV),response:nr.optional(wea),"code-samples":nr.optional(nr.array(jea))}),aEl=nr.array(ili);var ali=VV.extend({id:nr.optional(nr.string()),payload:nr.optional(WV)}),R$6=nr.array(ali);var oEl=nr.object({type:nr.string(),body:nr.unknown()});var Dea=VV.extend({"path-parameters":nr.optional(nr.record(nr.string(),WV)),"query-parameters":nr.optional(nr.record(nr.string(),WV)),headers:nr.optional(nr.record(nr.string(),WV)),messages:nr.array(oEl)});var uEl=bM.extend({variable:nr.string(),availability:$3r});var hBt=nr.union([lea,nr.string(),uEl]);var Dje=nEl;var o2n=J3r(OZr.extend({"allow-multiple":nr.optional(nr.boolean())}).shape);var oli=J3r(OZr.extend({["content-type"]:nr.string().optional()}).shape);var Sea=nr.union([nr.strictObject({extends:Yre,properties:nr.optional(nr.record(oli)),["extra-properties"]:nr.optional(nr.boolean())}),nr.strictObject({extends:nr.optional(Yre),properties:nr.record(oli),["extra-properties"]:nr.optional(nr.boolean())})]);var Eea=bM.extend({type:nr.string()});var Mea=nr.union([nr.string(),Eea,Sea]);var xea=Kre.extend({["content-type"]:nr.optional(nr.string()),["query-parameters"]:nr.optional(nr.record(o2n)),headers:nr.optional(nr.record(Dje)),body:nr.optional(Mea)});var Tea=nr.union([nr.string(),bM.extend({type:nr.string(),property:nr.optional(nr.string()),"status-code":nr.optional(nr.number())})]);var qea=bM.extend({type:nr.string(),format:nr.union([nr.literal("sse"),nr.literal("json")]).optional(),terminator:nr.optional(nr.string())});var Cea=nr.object({offset:nr.string().describe("The path to the request property for the page offset."),results:nr.string().describe("The path to the response property for the page elements."),step:nr.string().optional().describe("The path to the request property for the page step."),"has-next-page":nr.string().optional().describe("The path to the response property indicating next page presence.")});var u2n=nr.union([sea,Cea]);var Aea=nr.array(nr.union([nr.string(),Pea]));var NGo=nr.enum(["GET","POST","PUT","PATCH","DELETE"]),Nea=CJ.extend({method:nr.optional(NGo),path:nr.string(),url:nr.optional(nr.string()),["path-parameters"]:nr.optional(nr.record(hBt)),auth:nr.optional(nr.boolean()),idempotent:nr.optional(nr.boolean()),"stream-condition":nr.optional(nr.string()),request:nr.optional(nr.union([nr.string(),xea])),response:nr.optional(Tea),"response-stream":nr.optional(nr.union([nr.string(),qea])),errors:nr.optional(Aea),examples:nr.optional(nr.array(ili)),pagination:nr.optional(nr.union([u2n,nr.boolean()]))}).extend(Xre.shape);var zea=nr.strictObject({"service-name":nr.string().describe("The name of the gRPC service.")});var Bea=nr.strictObject({grpc:nr.optional(zea)});var Iea=nli.extend({auth:nr.boolean(),url:nr.optional(nr.string()),"base-path":nr.string(),"path-parameters":nr.optional(nr.record(nr.string(),hBt)),idempotent:nr.optional(nr.boolean()),headers:nr.optional(nr.record(Dje)),transport:nr.optional(Bea),endpoints:nr.record(Nea),source:nr.optional(t2n)}).extend(Xre.shape);var Rea=nr.union([jje.extend({extensions:nr.optional(nr.record(nr.string(),nr.any())),extends:Yre,properties:nr.optional(nr.record(wje)),["extra-properties"]:nr.optional(nr.boolean())}),jje.extend({extensions:nr.optional(nr.record(nr.string(),nr.any())),extends:nr.optional(Yre),properties:nr.record(wje),["extra-properties"]:nr.optional(nr.boolean())})]);var Fea=jje.extend({union:nr.array(nr.union([nr.string(),bM.extend({type:nr.string()})])),discriminated:nr.literal(!1)});var Lea=nr.union([nr.string(),Rea,pea,Kki,_ea,Fea]);var Uea=nr.union([nr.strictObject({name:nr.string(),extends:Yre,properties:nr.optional(nr.record(wje))}),nr.strictObject({name:nr.string(),extends:nr.optional(Yre),properties:nr.record(wje)})]);var Vea=bM.extend({type:nr.string()});var Wea=nr.union([nr.string(),Vea,Uea]);var Hea=CJ.extend({method:nr.enum(["GET","POST"]),headers:nr.optional(nr.record(Dje)),payload:Wea,examples:nr.optional(nr.array(ali))}).extend(Xre.shape);var $ea=nr.union([nr.strictObject({name:nr.string(),extends:Yre,properties:nr.optional(nr.record(wje))}),nr.strictObject({name:nr.string(),extends:nr.optional(Yre),properties:nr.record(wje)})]);var Jea=bM.extend({type:nr.string()});var Gea=nr.union([nr.string(),Jea,$ea]);var Kea=CJ.extend({origin:nr.enum(["client","server"]),body:Gea}).extend(Xre.shape);var Yea=CJ.extend({auth:nr.boolean(),path:nr.string(),headers:nr.optional(nr.record(Dje)),"path-parameters":nr.optional(nr.record(nr.string(),hBt)),"query-parameters":nr.optional(nr.record(nr.string(),o2n)),messages:nr.optional(nr.record(nr.string(),Kea)),examples:nr.optional(nr.array(Dea))}).extend(Xre.shape);var s2n=nr.strictObject({docs:nr.optional(nr.string()),imports:nr.optional(nr.record(nr.string())),types:nr.optional(nr.record(Lea)),service:nr.optional(Iea),webhooks:nr.optional(nr.record(Hea)),channel:nr.optional(Yea),errors:nr.optional(nr.record(bea))});var ctP=nr.object({dependency:nr.string(),url:nr.optional(nr.string())}),Xea=s2n.extend({export:nr.optional(nr.union([nr.string(),ctP])),navigation:nr.optional(nr.union([nr.string(),nr.array(nr.string())]))});var Qea=nr.union([nr.string(),nr.strictObject({type:nr.string()}).extend(bM.shape)]);var Zea=nr.strictObject({name:nr.string().optional().describe("The name of the parameter used to represent the header"),env:nr.string().optional().describe("The environment variable to read the header value from (if any)"),value:nr.string().describe("The wire representation of the header (e.g. X-API-Version)")});var kea=nr.union([nr.string(),Zea]);var eta=nr.strictObject({header:nr.union([nr.string(),kea]),default:nr.string().optional(),values:nr.array(nr.union([nr.string(),a2n]))});var zGo=nr.strictObject({"default-url":nr.optional(nr.string()),"default-environment":nr.optional(nr.string().or(nr.null())),environments:nr.optional(nr.record(nr.string(),vea))}),BGo=nr.strictObject({auth:nr.optional(Xki),"auth-schemes":nr.optional(nr.record(oea))}),IGo=nr.strictObject({headers:nr.optional(nr.record(nr.string(),Dje))}),tta=nr.strictObject({name:nr.string(),imports:nr.optional(nr.record(nr.string())),"error-discrimination":nr.optional(Oea),audiences:nr.optional(nr.array(nr.string())),docs:nr.optional(nr.string()),errors:nr.optional(nr.array(nr.string())),"base-path":nr.optional(nr.string()),"path-parameters":nr.optional(nr.record(hBt)),"idempotency-headers":nr.optional(nr.record(nr.string(),Dje)),variables:nr.optional(nr.record(Qea)),pagination:nr.optional(u2n),version:nr.optional(eta)}).extend(zGo.shape).extend(BGo.shape).extend(Xre.shape).extend(IGo.shape);var ltP={optional:"optional",set:"set",list:"list",map:"map",literal:"literal"},sEl=new Set(Object.values(ltP));function j3(e){let t=e.match(/([\w.]+)<([\w,\s]+)>/);if((t==null?void 0:t[0])!=null&&t[1]!=null&&t[2]!=null&&!sEl.has(t[1].trim()))return{name:t[1].trim(),arguments:t[2].split(",").map(r=>r.trim())}}function yTe(e){return j3(e)!=null}function RGo(e){return e.scheme==="oauth"}function FGo(e){if(e.request!=null)return typeof e.request=="string"?e.request:e.request.body}function dA(e){return typeof e=="string"?!1:(e==null?void 0:e.extends)!=null||(e==null?void 0:e.properties)!=null}function rta(e){return e.proto!=null}var ftP="text";function c2n(e){return e===ftP}var h_={};Wb(h_,{ApiDefinitionSource:()=>rne,ApiVersionScheme:()=>X3r,AuthScheme:()=>HV,AuthSchemesRequirement:()=>G3r,AvailabilityStatus:()=>yCt,ContainerType:()=>MC,Environments:()=>vCt,ErrorDeclarationDiscriminantValue:()=>Y3r,ErrorDiscriminationStrategy:()=>OCt,ExampleCodeSample:()=>Sje,ExampleContainer:()=>_T,ExampleEndpointSuccessResponse:()=>Xq,ExamplePrimitive:()=>Xv,ExampleQueryParameterShape:()=>uR,ExampleRequestBody:()=>AJ,ExampleResponse:()=>w3,ExampleSingleUnionTypeProperties:()=>D3,ExampleTypeReferenceShape:()=>Q0,ExampleTypeShape:()=>mM,ExampleWebSocketMessageBody:()=>jCt,FileProperty:()=>bCt,FileUploadRequestProperty:()=>Zre,HttpMethod:()=>Qre,HttpRequestBody:()=>cB,HttpResponseBody:()=>pA,JsonResponse:()=>mCt,Literal:()=>OTe,NamedTypeDefault:()=>f2n,NonStreamHttpResponseBody:()=>kre,OAuthConfiguration:()=>K3r,Pagination:()=>mTe,PathParameterLocation:()=>bTe,PrimitiveTypeV1:()=>ID,PrimitiveTypeV2:()=>gM,ProtobufType:()=>Yw,PublishTarget:()=>l2n,PublishingConfig:()=>Q3r,RequestPropertyValue:()=>tne,ResolvedTypeReference:()=>$V,SdkRequestBodyType:()=>gCt,SdkRequestShape:()=>gTe,ShapeType:()=>PCt,SingleUnionTypeProperties:()=>nne,Source:()=>xDr,StreamingResponse:()=>ene,SupportedSdkLanguage:()=>yBt,Transport:()=>vTe,Type:()=>EC,TypeReference:()=>S2,WebSocketMessageBody:()=>PTe,WebSocketMessageOrigin:()=>ita,WebhookHttpMethod:()=>nta,WebhookPayload:()=>ine,WellKnownProtobufType:()=>th,auth:()=>LGo,commons:()=>UGo,constants:()=>cEl,environment:()=>VGo,errors:()=>WGo,http:()=>HGo,ir:()=>$Go,proto:()=>JGo,publish:()=>GGo,types:()=>KGo,variables:()=>lEl,webhooks:()=>YGo,websocket:()=>XGo});var LGo={};Wb(LGo,{AuthScheme:()=>HV,AuthSchemesRequirement:()=>G3r,OAuthConfiguration:()=>K3r});var G3r={All:"ALL",Any:"ANY",_visit:(e,t)=>{switch(e){case G3r.All:return t.all();case G3r.Any:return t.any();default:return t._other()}}};var HV={bearer:e=>({...e,type:"bearer",_visit:function(t){return HV._visit(this,t)}}),basic:e=>({...e,type:"basic",_visit:function(t){return HV._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return HV._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return HV._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bearer":return t.bearer(e);case"basic":return t.basic(e);case"header":return t.header(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var K3r={clientCredentials:e=>({...e,type:"clientCredentials",_visit:function(t){return K3r._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"clientCredentials":return t.clientCredentials(e);default:return t._other(e)}}};var UGo={};Wb(UGo,{AvailabilityStatus:()=>yCt});var yCt={InDevelopment:"IN_DEVELOPMENT",PreRelease:"PRE_RELEASE",GeneralAvailability:"GENERAL_AVAILABILITY",Deprecated:"DEPRECATED",_visit:(e,t)=>{switch(e){case yCt.InDevelopment:return t.inDevelopment();case yCt.PreRelease:return t.preRelease();case yCt.GeneralAvailability:return t.generalAvailability();case yCt.Deprecated:return t.deprecated();default:return t._other()}}};var cEl={};var VGo={};Wb(VGo,{Environments:()=>vCt});var vCt={singleBaseUrl:e=>({...e,type:"singleBaseUrl",_visit:function(t){return vCt._visit(this,t)}}),multipleBaseUrls:e=>({...e,type:"multipleBaseUrls",_visit:function(t){return vCt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"singleBaseUrl":return t.singleBaseUrl(e);case"multipleBaseUrls":return t.multipleBaseUrls(e);default:return t._other(e)}}};var WGo={};Wb(WGo,{ErrorDeclarationDiscriminantValue:()=>Y3r});var Y3r={property:e=>({...e,type:"property",_visit:function(t){return Y3r._visit(this,t)}}),statusCode:()=>({type:"statusCode",_visit:function(e){return Y3r._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"property":return t.property(e);case"statusCode":return t.statusCode();default:return t._other(e)}}};var HGo={};Wb(HGo,{ExampleCodeSample:()=>Sje,ExampleEndpointSuccessResponse:()=>Xq,ExampleQueryParameterShape:()=>uR,ExampleRequestBody:()=>AJ,ExampleResponse:()=>w3,FileProperty:()=>bCt,FileUploadRequestProperty:()=>Zre,HttpMethod:()=>Qre,HttpRequestBody:()=>cB,HttpResponseBody:()=>pA,JsonResponse:()=>mCt,NonStreamHttpResponseBody:()=>kre,Pagination:()=>mTe,PathParameterLocation:()=>bTe,RequestPropertyValue:()=>tne,SdkRequestBodyType:()=>gCt,SdkRequestShape:()=>gTe,StreamingResponse:()=>ene,SupportedSdkLanguage:()=>yBt,Transport:()=>vTe});var vTe={http:()=>({type:"http",_visit:function(e){return vTe._visit(this,e)}}),grpc:e=>({...e,type:"grpc",_visit:function(t){return vTe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"http":return t.http();case"grpc":return t.grpc(e);default:return t._other(e)}}};var Qre={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",_visit:(e,t)=>{switch(e){case Qre.Get:return t.get();case Qre.Post:return t.post();case Qre.Put:return t.put();case Qre.Patch:return t.patch();case Qre.Delete:return t.delete();default:return t._other()}}};var bTe={Root:"ROOT",Service:"SERVICE",Endpoint:"ENDPOINT",_visit:(e,t)=>{switch(e){case bTe.Root:return t.root();case bTe.Service:return t.service();case bTe.Endpoint:return t.endpoint();default:return t._other()}}};var cB={inlinedRequestBody:e=>({...e,type:"inlinedRequestBody",_visit:function(t){return cB._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return cB._visit(this,t)}}),fileUpload:e=>({...e,type:"fileUpload",_visit:function(t){return cB._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return cB._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedRequestBody":return t.inlinedRequestBody(e);case"reference":return t.reference(e);case"fileUpload":return t.fileUpload(e);case"bytes":return t.bytes(e);default:return t._other(e)}}};var Zre={file:e=>({value:e,type:"file",_visit:function(t){return Zre._visit(this,t)}}),bodyProperty:e=>({...e,type:"bodyProperty",_visit:function(t){return Zre._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e.value);case"bodyProperty":return t.bodyProperty(e);default:return t._other(e)}}};var bCt={file:e=>({...e,type:"file",_visit:function(t){return bCt._visit(this,t)}}),fileArray:e=>({...e,type:"fileArray",_visit:function(t){return bCt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"fileArray":return t.fileArray(e);default:return t._other(e)}}};var gCt={typeReference:e=>({...e,type:"typeReference",_visit:function(t){return gCt._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return gCt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"typeReference":return t.typeReference(e);case"bytes":return t.bytes(e);default:return t._other(e)}}};var gTe={justRequestBody:e=>({value:e,type:"justRequestBody",_visit:function(t){return gTe._visit(this,t)}}),wrapper:e=>({...e,type:"wrapper",_visit:function(t){return gTe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"justRequestBody":return t.justRequestBody(e.value);case"wrapper":return t.wrapper(e);default:return t._other(e)}}};var kre={json:e=>({value:e,type:"json",_visit:function(t){return kre._visit(this,t)}}),fileDownload:e=>({...e,type:"fileDownload",_visit:function(t){return kre._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return kre._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e.value);case"fileDownload":return t.fileDownload(e);case"text":return t.text(e);default:return t._other(e)}}};var pA={json:e=>({value:e,type:"json",_visit:function(t){return pA._visit(this,t)}}),fileDownload:e=>({...e,type:"fileDownload",_visit:function(t){return pA._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return pA._visit(this,t)}}),streaming:e=>({value:e,type:"streaming",_visit:function(t){return pA._visit(this,t)}}),streamParameter:e=>({...e,type:"streamParameter",_visit:function(t){return pA._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e.value);case"fileDownload":return t.fileDownload(e);case"text":return t.text(e);case"streaming":return t.streaming(e.value);case"streamParameter":return t.streamParameter(e);default:return t._other(e)}}};var mCt={response:e=>({...e,type:"response",_visit:function(t){return mCt._visit(this,t)}}),nestedPropertyAsResponse:e=>({...e,type:"nestedPropertyAsResponse",_visit:function(t){return mCt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"response":return t.response(e);case"nestedPropertyAsResponse":return t.nestedPropertyAsResponse(e);default:return t._other(e)}}};var ene={json:e=>({...e,type:"json",_visit:function(t){return ene._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return ene._visit(this,t)}}),sse:e=>({...e,type:"sse",_visit:function(t){return ene._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e);case"text":return t.text(e);case"sse":return t.sse(e);default:return t._other(e)}}};var mTe={cursor:e=>({...e,type:"cursor",_visit:function(t){return mTe._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return mTe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);default:return t._other(e)}}};var tne={query:e=>({...e,type:"query",_visit:function(t){return tne._visit(this,t)}}),body:e=>({...e,type:"body",_visit:function(t){return tne._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"query":return t.query(e);case"body":return t.body(e);default:return t._other(e)}}};var Sje={language:e=>({...e,type:"language",_visit:function(t){return Sje._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return Sje._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 yBt={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",_visit:(e,t)=>{switch(e){case yBt.Curl:return t.curl();case yBt.Python:return t.python();case yBt.Javascript:return t.javascript();case yBt.Typescript:return t.typescript();case yBt.Go:return t.go();case yBt.Ruby:return t.ruby();case yBt.Csharp:return t.csharp();case yBt.Java:return t.java();default:return t._other()}}};var uR={single:()=>({type:"single",_visit:function(e){return uR._visit(this,e)}}),exploded:()=>({type:"exploded",_visit:function(e){return uR._visit(this,e)}}),commaSeparated:()=>({type:"commaSeparated",_visit:function(e){return uR._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"single":return t.single();case"exploded":return t.exploded();case"commaSeparated":return t.commaSeparated();default:return t._other(e)}}};var AJ={inlinedRequestBody:e=>({...e,type:"inlinedRequestBody",_visit:function(t){return AJ._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return AJ._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedRequestBody":return t.inlinedRequestBody(e);case"reference":return t.reference(e);default:return t._other(e)}}};var w3={ok:e=>({value:e,type:"ok",_visit:function(t){return w3._visit(this,t)}}),error:e=>({...e,type:"error",_visit:function(t){return w3._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"ok":return t.ok(e.value);case"error":return t.error(e);default:return t._other(e)}}};var Xq={body:e=>({value:e,type:"body",_visit:function(t){return Xq._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return Xq._visit(this,t)}}),sse:e=>({value:e,type:"sse",_visit:function(t){return Xq._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"body":return t.body(e.value);case"stream":return t.stream(e.value);case"sse":return t.sse(e.value);default:return t._other(e)}}};var $Go={};Wb($Go,{ApiDefinitionSource:()=>rne,ApiVersionScheme:()=>X3r,ErrorDiscriminationStrategy:()=>OCt});var rne={proto:e=>({...e,type:"proto",_visit:function(t){return rne._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return rne._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"proto":return t.proto(e);case"openapi":return t.openapi();default:return t._other(e)}}};var X3r={header:e=>({...e,type:"header",_visit:function(t){return X3r._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"header":return t.header(e);default:return t._other(e)}}};var OCt={statusCode:()=>({type:"statusCode",_visit:function(e){return OCt._visit(this,e)}}),property:e=>({...e,type:"property",_visit:function(t){return OCt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"statusCode":return t.statusCode();case"property":return t.property(e);default:return t._other(e)}}};var JGo={};Wb(JGo,{ProtobufType:()=>Yw,WellKnownProtobufType:()=>th});var Yw={wellKnown:e=>({value:e,type:"wellKnown",_visit:function(t){return Yw._visit(this,t)}}),userDefined:e=>({...e,type:"userDefined",_visit:function(t){return Yw._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"wellKnown":return t.wellKnown(e.value);case"userDefined":return t.userDefined(e);default:return t._other(e)}}};var th={any:()=>({type:"any",_visit:function(e){return th._visit(this,e)}}),api:()=>({type:"api",_visit:function(e){return th._visit(this,e)}}),boolValue:()=>({type:"boolValue",_visit:function(e){return th._visit(this,e)}}),bytesValue:()=>({type:"bytesValue",_visit:function(e){return th._visit(this,e)}}),doubleValue:()=>({type:"doubleValue",_visit:function(e){return th._visit(this,e)}}),duration:()=>({type:"duration",_visit:function(e){return th._visit(this,e)}}),empty:()=>({type:"empty",_visit:function(e){return th._visit(this,e)}}),enum:()=>({type:"enum",_visit:function(e){return th._visit(this,e)}}),enumValue:()=>({type:"enumValue",_visit:function(e){return th._visit(this,e)}}),field:()=>({type:"field",_visit:function(e){return th._visit(this,e)}}),fieldCardinality:()=>({type:"fieldCardinality",_visit:function(e){return th._visit(this,e)}}),fieldKind:()=>({type:"fieldKind",_visit:function(e){return th._visit(this,e)}}),fieldMask:()=>({type:"fieldMask",_visit:function(e){return th._visit(this,e)}}),floatValue:()=>({type:"floatValue",_visit:function(e){return th._visit(this,e)}}),int32Value:()=>({type:"int32Value",_visit:function(e){return th._visit(this,e)}}),int64Value:()=>({type:"int64Value",_visit:function(e){return th._visit(this,e)}}),listValue:()=>({type:"listValue",_visit:function(e){return th._visit(this,e)}}),method:()=>({type:"method",_visit:function(e){return th._visit(this,e)}}),mixin:()=>({type:"mixin",_visit:function(e){return th._visit(this,e)}}),nullValue:()=>({type:"nullValue",_visit:function(e){return th._visit(this,e)}}),option:()=>({type:"option",_visit:function(e){return th._visit(this,e)}}),sourceContext:()=>({type:"sourceContext",_visit:function(e){return th._visit(this,e)}}),stringValue:()=>({type:"stringValue",_visit:function(e){return th._visit(this,e)}}),struct:()=>({type:"struct",_visit:function(e){return th._visit(this,e)}}),syntax:()=>({type:"syntax",_visit:function(e){return th._visit(this,e)}}),timestamp:()=>({type:"timestamp",_visit:function(e){return th._visit(this,e)}}),type:()=>({type:"type",_visit:function(e){return th._visit(this,e)}}),uint32Value:()=>({type:"uint32Value",_visit:function(e){return th._visit(this,e)}}),uint64Value:()=>({type:"uint64Value",_visit:function(e){return th._visit(this,e)}}),value:()=>({type:"value",_visit:function(e){return th._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"any":return t.any();case"api":return t.api();case"boolValue":return t.boolValue();case"bytesValue":return t.bytesValue();case"doubleValue":return t.doubleValue();case"duration":return t.duration();case"empty":return t.empty();case"enum":return t.enum();case"enumValue":return t.enumValue();case"field":return t.field();case"fieldCardinality":return t.fieldCardinality();case"fieldKind":return t.fieldKind();case"fieldMask":return t.fieldMask();case"floatValue":return t.floatValue();case"int32Value":return t.int32Value();case"int64Value":return t.int64Value();case"listValue":return t.listValue();case"method":return t.method();case"mixin":return t.mixin();case"nullValue":return t.nullValue();case"option":return t.option();case"sourceContext":return t.sourceContext();case"stringValue":return t.stringValue();case"struct":return t.struct();case"syntax":return t.syntax();case"timestamp":return t.timestamp();case"type":return t.type();case"uint32Value":return t.uint32Value();case"uint64Value":return t.uint64Value();case"value":return t.value();default:return t._other(e)}}};var GGo={};Wb(GGo,{PublishTarget:()=>l2n,PublishingConfig:()=>Q3r});var Q3r={github:e=>({...e,type:"github",_visit:function(t){return Q3r._visit(this,t)}}),direct:e=>({...e,type:"direct",_visit:function(t){return Q3r._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"github":return t.github(e);case"direct":return t.direct(e);default:return t._other(e)}}};var l2n={postman:e=>({...e,type:"postman",_visit:function(t){return l2n._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"postman":return t.postman(e);default:return t._other(e)}}};var KGo={};Wb(KGo,{ContainerType:()=>MC,ExampleContainer:()=>_T,ExamplePrimitive:()=>Xv,ExampleSingleUnionTypeProperties:()=>D3,ExampleTypeReferenceShape:()=>Q0,ExampleTypeShape:()=>mM,Literal:()=>OTe,NamedTypeDefault:()=>f2n,PrimitiveTypeV1:()=>ID,PrimitiveTypeV2:()=>gM,ResolvedTypeReference:()=>$V,ShapeType:()=>PCt,SingleUnionTypeProperties:()=>nne,Source:()=>xDr,Type:()=>EC,TypeReference:()=>S2});var xDr={proto:e=>({value:e,type:"proto",_visit:function(t){return xDr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"proto":return t.proto(e.value);default:return t._other(e)}}};var EC={alias:e=>({...e,type:"alias",_visit:function(t){return EC._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return EC._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return EC._visit(this,t)}}),union:e=>({...e,type:"union",_visit:function(t){return EC._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return EC._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"alias":return t.alias(e);case"enum":return t.enum(e);case"object":return t.object(e);case"union":return t.union(e);case"undiscriminatedUnion":return t.undiscriminatedUnion(e);default:return t._other(e)}}};var $V={container:e=>({container:e,type:"container",_visit:function(t){return $V._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return $V._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return $V._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return $V._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"container":return t.container(e.container);case"named":return t.named(e);case"primitive":return t.primitive(e.primitive);case"unknown":return t.unknown();default:return t._other(e)}}};var PCt={Enum:"ENUM",Object:"OBJECT",Union:"UNION",UndiscriminatedUnion:"UNDISCRIMINATED_UNION",_visit:(e,t)=>{switch(e){case PCt.Enum:return t.enum();case PCt.Object:return t.object();case PCt.Union:return t.union();case PCt.UndiscriminatedUnion:return t.undiscriminatedUnion();default:return t._other()}}};var nne={samePropertiesAsObject:e=>({...e,propertiesType:"samePropertiesAsObject",_visit:function(t){return nne._visit(this,t)}}),singleProperty:e=>({...e,propertiesType:"singleProperty",_visit:function(t){return nne._visit(this,t)}}),noProperties:()=>({propertiesType:"noProperties",_visit:function(e){return nne._visit(this,e)}}),_visit:(e,t)=>{switch(e.propertiesType){case"samePropertiesAsObject":return t.samePropertiesAsObject(e);case"singleProperty":return t.singleProperty(e);case"noProperties":return t.noProperties();default:return t._other(e)}}};var S2={container:e=>({container:e,type:"container",_visit:function(t){return S2._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return S2._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return S2._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return S2._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"container":return t.container(e.container);case"named":return t.named(e);case"primitive":return t.primitive(e.primitive);case"unknown":return t.unknown();default:return t._other(e)}}};var f2n={enum:e=>({...e,type:"enum",_visit:function(t){return f2n._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"enum":return t.enum(e);default:return t._other(e)}}};var MC={list:e=>({list:e,type:"list",_visit:function(t){return MC._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return MC._visit(this,t)}}),optional:e=>({optional:e,type:"optional",_visit:function(t){return MC._visit(this,t)}}),set:e=>({set:e,type:"set",_visit:function(t){return MC._visit(this,t)}}),literal:e=>({literal:e,type:"literal",_visit:function(t){return MC._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.list);case"map":return t.map(e);case"optional":return t.optional(e.optional);case"set":return t.set(e.set);case"literal":return t.literal(e.literal);default:return t._other(e)}}};var ID={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER",_visit:(e,t)=>{switch(e){case ID.Integer:return t.integer();case ID.Long:return t.long();case ID.Uint:return t.uint();case ID.Uint64:return t.uint64();case ID.Float:return t.float();case ID.Double:return t.double();case ID.Boolean:return t.boolean();case ID.String:return t.string();case ID.Date:return t.date();case ID.DateTime:return t.dateTime();case ID.Uuid:return t.uuid();case ID.Base64:return t.base64();case ID.BigInteger:return t.bigInteger();default:return t._other()}}};var gM={integer:e=>({...e,type:"integer",_visit:function(t){return gM._visit(this,t)}}),long:e=>({...e,type:"long",_visit:function(t){return gM._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return gM._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return gM._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return gM._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return gM._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return gM._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return gM._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return gM._visit(this,t)}}),dateTime:e=>({...e,type:"dateTime",_visit:function(t){return gM._visit(this,t)}}),uuid:e=>({...e,type:"uuid",_visit:function(t){return gM._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return gM._visit(this,t)}}),bigInteger:e=>({...e,type:"bigInteger",_visit:function(t){return gM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e);case"long":return t.long(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"boolean":return t.boolean(e);case"string":return t.string(e);case"date":return t.date(e);case"dateTime":return t.dateTime(e);case"uuid":return t.uuid(e);case"base64":return t.base64(e);case"bigInteger":return t.bigInteger(e);default:return t._other(e)}}};var OTe={string:e=>({string:e,type:"string",_visit:function(t){return OTe._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return OTe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"string":return t.string(e.string);case"boolean":return t.boolean(e.boolean);default:return t._other(e)}}};var mM={alias:e=>({...e,type:"alias",_visit:function(t){return mM._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return mM._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return mM._visit(this,t)}}),union:e=>({...e,type:"union",_visit:function(t){return mM._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return mM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"alias":return t.alias(e);case"enum":return t.enum(e);case"object":return t.object(e);case"union":return t.union(e);case"undiscriminatedUnion":return t.undiscriminatedUnion(e);default:return t._other(e)}}};var D3={samePropertiesAsObject:e=>({...e,type:"samePropertiesAsObject",_visit:function(t){return D3._visit(this,t)}}),singleProperty:e=>({...e,type:"singleProperty",_visit:function(t){return D3._visit(this,t)}}),noProperties:()=>({type:"noProperties",_visit:function(e){return D3._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"samePropertiesAsObject":return t.samePropertiesAsObject(e);case"singleProperty":return t.singleProperty(e);case"noProperties":return t.noProperties();default:return t._other(e)}}};var Q0={primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return Q0._visit(this,t)}}),container:e=>({container:e,type:"container",_visit:function(t){return Q0._visit(this,t)}}),unknown:e=>({unknown:e,type:"unknown",_visit:function(t){return Q0._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return Q0._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e.primitive);case"container":return t.container(e.container);case"unknown":return t.unknown(e.unknown);case"named":return t.named(e);default:return t._other(e)}}};var _T={list:e=>({...e,type:"list",_visit:function(t){return _T._visit(this,t)}}),set:e=>({...e,type:"set",_visit:function(t){return _T._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return _T._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return _T._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return _T._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e);case"set":return t.set(e);case"optional":return t.optional(e);case"map":return t.map(e);case"literal":return t.literal(e);default:return t._other(e)}}};var Xv={integer:e=>({integer:e,type:"integer",_visit:function(t){return Xv._visit(this,t)}}),long:e=>({long:e,type:"long",_visit:function(t){return Xv._visit(this,t)}}),uint:e=>({uint:e,type:"uint",_visit:function(t){return Xv._visit(this,t)}}),uint64:e=>({uint64:e,type:"uint64",_visit:function(t){return Xv._visit(this,t)}}),float:e=>({float:e,type:"float",_visit:function(t){return Xv._visit(this,t)}}),double:e=>({double:e,type:"double",_visit:function(t){return Xv._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return Xv._visit(this,t)}}),string:e=>({string:e,type:"string",_visit:function(t){return Xv._visit(this,t)}}),date:e=>({date:e,type:"date",_visit:function(t){return Xv._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return Xv._visit(this,t)}}),uuid:e=>({uuid:e,type:"uuid",_visit:function(t){return Xv._visit(this,t)}}),base64:e=>({base64:e,type:"base64",_visit:function(t){return Xv._visit(this,t)}}),bigInteger:e=>({bigInteger:e,type:"bigInteger",_visit:function(t){return Xv._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e.integer);case"long":return t.long(e.long);case"uint":return t.uint(e.uint);case"uint64":return t.uint64(e.uint64);case"float":return t.float(e.float);case"double":return t.double(e.double);case"boolean":return t.boolean(e.boolean);case"string":return t.string(e.string);case"date":return t.date(e.date);case"datetime":return t.datetime(e);case"uuid":return t.uuid(e.uuid);case"base64":return t.base64(e.base64);case"bigInteger":return t.bigInteger(e.bigInteger);default:return t._other(e)}}};var lEl={};var YGo={};Wb(YGo,{WebhookHttpMethod:()=>nta,WebhookPayload:()=>ine});var ine={inlinedPayload:e=>({...e,type:"inlinedPayload",_visit:function(t){return ine._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return ine._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedPayload":return t.inlinedPayload(e);case"reference":return t.reference(e);default:return t._other(e)}}};var nta={Get:"GET",Post:"POST",_visit:(e,t)=>{switch(e){case nta.Get:return t.get();case nta.Post:return t.post();default:return t._other()}}};var XGo={};Wb(XGo,{ExampleWebSocketMessageBody:()=>jCt,WebSocketMessageBody:()=>PTe,WebSocketMessageOrigin:()=>ita});var ita={Client:"client",Server:"server",_visit:(e,t)=>{switch(e){case ita.Client:return t.client();case ita.Server:return t.server();default:return t._other()}}};var PTe={inlinedBody:e=>({...e,type:"inlinedBody",_visit:function(t){return PTe._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return PTe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedBody":return t.inlinedBody(e);case"reference":return t.reference(e);default:return t._other(e)}}};var jCt={inlinedBody:e=>({...e,type:"inlinedBody",_visit:function(t){return jCt._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return jCt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedBody":return t.inlinedBody(e);case"reference":return t.reference(e);default:return t._other(e)}}};var Nv={};Wb(Nv,{AliasTypeDeclaration:()=>ana,ApiAuth:()=>jta,ApiDefinitionSource:()=>Qna,ApiDefinitionSourceId:()=>Yna,ApiVersionScheme:()=>Ira,AuthScheme:()=>Pta,AuthSchemesRequirement:()=>cta,AutogeneratedEndpointExample:()=>Sra,Availability:()=>mBt,AvailabilityStatus:()=>pta,Base64Type:()=>tna,BasicAuthScheme:()=>fta,BearerAuthScheme:()=>lta,BigIntegerType:()=>rna,BooleanType:()=>Yra,BytesRequest:()=>P2n,Constants:()=>Eta,ContainerType:()=>N2n,CsharpProtobufFileOptions:()=>Tra,CursorPagination:()=>fra,DateTimeType:()=>kra,DateType:()=>Zra,Declaration:()=>lB,DeclaredErrorName:()=>uNr,DeclaredServiceName:()=>Ita,DeclaredTypeName:()=>GA,DirectPublish:()=>tia,DoubleType:()=>Kra,DoubleValidationRules:()=>Gra,Encoding:()=>T2n,EndpointId:()=>TDr,EndpointName:()=>Fta,EndpointReference:()=>_2n,EnumTypeDeclaration:()=>C2n,EnumTypeReference:()=>FEl,EnumValue:()=>qDr,EnvironmentBaseUrlId:()=>oNr,EnvironmentBaseUrlWithId:()=>Tta,EnvironmentId:()=>aNr,EnvironmentUrl:()=>b2n,EnvironmentVariable:()=>jTe,Environments:()=>Ata,EnvironmentsConfig:()=>Nta,ErrorDeclaration:()=>Bta,ErrorDeclarationDiscriminantValue:()=>IEl,ErrorDiscriminationByPropertyStrategy:()=>Una,ErrorDiscriminationStrategy:()=>Vna,ErrorId:()=>iNr,EscapedString:()=>wta,ExampleAliasType:()=>sia,ExampleCodeSample:()=>vra,ExampleCodeSampleLanguage:()=>_ra,ExampleCodeSampleSdk:()=>yra,ExampleContainer:()=>via,ExampleDatetime:()=>yia,ExampleEndpointCall:()=>x2n,ExampleEndpointErrorResponse:()=>jra,ExampleEndpointSuccessResponse:()=>Pra,ExampleEnumType:()=>uia,ExampleError:()=>zta,ExampleHeader:()=>jZr,ExampleInlinedRequestBody:()=>M2n,ExampleInlinedRequestBodyProperty:()=>gra,ExampleKeyValuePair:()=>wia,ExampleListContainer:()=>mia,ExampleLiteralContainer:()=>gia,ExampleMapContainer:()=>jia,ExampleNamedType:()=>bia,ExampleObjectProperty:()=>fia,ExampleObjectType:()=>F2n,ExampleObjectTypeWithTypeId:()=>_ia,ExampleOptionalContainer:()=>Pia,ExamplePathParameter:()=>sNr,ExamplePrimitive:()=>L2n,ExampleQueryParameter:()=>E2n,ExampleQueryParameterShape:()=>bra,ExampleRequestBody:()=>mra,ExampleResponse:()=>wra,ExampleServerSideEvent:()=>Ora,ExampleSetContainer:()=>Oia,ExampleSingleUnionType:()=>dia,ExampleSingleUnionTypeProperties:()=>pia,ExampleType:()=>lli,ExampleTypeReference:()=>kj,ExampleTypeReferenceShape:()=>hia,ExampleTypeShape:()=>z2n,ExampleUndiscriminatedUnionType:()=>lia,ExampleUnionType:()=>cia,ExampleWebSocketMessage:()=>Bna,ExampleWebSocketMessageBody:()=>zna,ExampleWebSocketSession:()=>Ina,ExampleWebhookCall:()=>Dna,FeatureId:()=>Sta,FernFilepath:()=>DTe,FileDownloadResponse:()=>w2n,FileProperty:()=>$ta,FilePropertyArray:()=>Hta,FilePropertySingle:()=>Wta,FileUploadBodyProperty:()=>Jta,FileUploadRequest:()=>Kta,FileUploadRequestProperty:()=>Gta,FloatType:()=>Jra,GithubPublish:()=>eia,GrpcTransport:()=>Ara,HeaderApiVersionScheme:()=>Bra,HeaderAuthScheme:()=>dta,HttpEndpoint:()=>Era,HttpHeader:()=>oQ,HttpMethod:()=>Lta,HttpPath:()=>wCt,HttpPathPart:()=>Rta,HttpRequestBody:()=>Yta,HttpRequestBodyReference:()=>O2n,HttpResponse:()=>sra,HttpResponseBody:()=>ura,HttpService:()=>zra,InlinedRequestBody:()=>Vta,InlinedRequestBodyProperty:()=>m2n,InlinedWebSocketMessageBody:()=>qna,InlinedWebSocketMessageBodyProperty:()=>Tna,InlinedWebhookPayload:()=>Pna,InlinedWebhookPayloadProperty:()=>Ona,IntegerType:()=>Vra,IntegerValidationRules:()=>Ura,IntermediateRepresentation:()=>REl,JsonEncoding:()=>Mra,JsonResponse:()=>j2n,JsonResponseBody:()=>era,JsonResponseBodyWithProperty:()=>tra,JsonStreamChunk:()=>rra,Literal:()=>aia,LongType:()=>Wra,MapType:()=>oia,MultipleBaseUrlsEnvironment:()=>qta,MultipleBaseUrlsEnvironments:()=>Cta,Name:()=>vy,NameAndWireValue:()=>Um,NamedType:()=>iia,NamedTypeDefault:()=>nia,NonStreamHttpResponseBody:()=>ara,OAuthAccessTokenRequestProperties:()=>hta,OAuthAccessTokenResponseProperties:()=>h2n,OAuthClientCredentials:()=>gta,OAuthConfiguration:()=>mta,OAuthRefreshEndpoint:()=>bta,OAuthRefreshTokenRequestProperties:()=>vta,OAuthScheme:()=>Ota,OAuthTokenEndpoint:()=>yta,ObjectProperty:()=>iQ,ObjectTypeDeclaration:()=>ona,OffsetPagination:()=>dra,Package:()=>I2n,PackageNavigationConfig:()=>Fna,Pagination:()=>pra,PathParameter:()=>DCt,PathParameterLocation:()=>Uta,PlatformHeaders:()=>Hna,PostmanPublishTarget:()=>kna,PrimitiveType:()=>A2n,PrimitiveTypeV1:()=>Lra,PrimitiveTypeV2:()=>nna,ProtoEncoding:()=>xra,ProtoSource:()=>Xna,ProtobufFile:()=>q2n,ProtobufFileOptions:()=>qra,ProtobufService:()=>Cra,ProtobufType:()=>yna,PublishTarget:()=>R2n,PublishingConfig:()=>ria,QueryParameter:()=>rNr,ReadmeConfig:()=>Kna,RequestProperty:()=>aQ,RequestPropertyValue:()=>_ta,ResolvedNamedType:()=>Fra,ResolvedTypeReference:()=>ina,ResponseError:()=>cra,ResponseErrors:()=>lra,ResponseProperty:()=>wTe,SafeAndUnsafeString:()=>PZr,SdkConfig:()=>$na,SdkRequest:()=>kta,SdkRequestBodyType:()=>Xta,SdkRequestShape:()=>Zta,SdkRequestWrapper:()=>Qta,ServiceId:()=>bBt,ServiceTypeReferenceInfo:()=>Gna,ShapeType:()=>Rra,SingleBaseUrlEnvironment:()=>Mta,SingleBaseUrlEnvironments:()=>xta,SingleUnionType:()=>cna,SingleUnionTypeProperties:()=>sna,SingleUnionTypeProperty:()=>una,Source:()=>vna,SourceConfig:()=>Zna,SseStreamChunk:()=>ira,StreamParameterResponse:()=>ora,StreamingResponse:()=>S2n,StringType:()=>Qra,StringValidationRules:()=>Xra,Subpackage:()=>Lna,SubpackageId:()=>gBt,SupportedSdkLanguage:()=>hra,TextResponse:()=>D2n,TextStreamChunk:()=>nra,Transport:()=>Nra,Type:()=>pna,TypeDeclaration:()=>bna,TypeId:()=>JV,TypeReference:()=>Hb,Uint64Type:()=>$ra,UintType:()=>Hra,UndiscriminatedUnionMember:()=>fna,UndiscriminatedUnionTypeDeclaration:()=>dna,UnionTypeDeclaration:()=>lna,UserAgent:()=>Wna,UserDefinedProtobufType:()=>hna,UserSpecifiedEndpointExample:()=>Dra,UuidType:()=>ena,VariableDeclaration:()=>Jna,VariableId:()=>g2n,WebSocketChannel:()=>Rna,WebSocketChannelId:()=>v2n,WebSocketMessage:()=>Nna,WebSocketMessageBody:()=>Ana,WebSocketMessageBodyReference:()=>Cna,WebSocketMessageId:()=>B2n,WebSocketMessageOrigin:()=>xna,WebSocketName:()=>Mna,Webhook:()=>Sna,WebhookGroup:()=>Ena,WebhookGroupId:()=>y2n,WebhookHttpMethod:()=>mna,WebhookId:()=>Dta,WebhookName:()=>gna,WebhookPayload:()=>wna,WebhookPayloadReference:()=>jna,WellKnownProtobufType:()=>_na,WithDocs:()=>T0,WithDocsAndAvailability:()=>nNr,WithJsonExample:()=>OBt,auth:()=>tKo,commons:()=>rKo,constants:()=>nKo,environment:()=>iKo,errors:()=>aKo,http:()=>oKo,ir:()=>uKo,proto:()=>sKo,publish:()=>cKo,types:()=>lKo,variables:()=>fKo,webhooks:()=>dKo,websocket:()=>pKo});var tKo={};Wb(tKo,{ApiAuth:()=>jta,AuthScheme:()=>Pta,AuthSchemesRequirement:()=>cta,BasicAuthScheme:()=>fta,BearerAuthScheme:()=>lta,EnvironmentVariable:()=>jTe,HeaderAuthScheme:()=>dta,OAuthAccessTokenRequestProperties:()=>hta,OAuthAccessTokenResponseProperties:()=>h2n,OAuthClientCredentials:()=>gta,OAuthConfiguration:()=>mta,OAuthRefreshEndpoint:()=>bta,OAuthRefreshTokenRequestProperties:()=>vta,OAuthScheme:()=>Ota,OAuthTokenEndpoint:()=>yta});var Jr={};Wb(Jr,{JsonError:()=>Z3r,ParseError:()=>k3r,any:()=>wEl,boolean:()=>DEl,booleanLiteral:()=>jEl,date:()=>dEl,discriminant:()=>NEl,enum_:()=>ota,getObjectLikeUtils:()=>vBt,getObjectUtils:()=>p2n,getSchemaUtils:()=>_A,isProperty:()=>tNr,lazy:()=>pEl,lazyObject:()=>mEl,list:()=>sta,number:()=>SEl,object:()=>uta,objectWithoutOptionalProperties:()=>gEl,optional:()=>QGo,property:()=>hEl,record:()=>TEl,set:()=>qEl,string:()=>EEl,stringLiteral:()=>PEl,transform:()=>ZGo,undiscriminatedUnion:()=>AEl,union:()=>BEl,unknown:()=>MEl,withParsedProperties:()=>eKo});var LS={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 Qq(e,t){return`Expected ${t}. Received ${dtP(e)}.`}function dtP(e){if(Array.isArray(e))return"list";if(e===null)return"null";switch(typeof e){case"string":return`"${e}"`;case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function NJ(e){return{...e,json:fEl(e.json),parse:fEl(e.parse)}}function fEl(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(`
|
|
1757
|
-
`)),{ok:!0,value:t}):n}}function ata(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var Z3r=class extends Error{errors;constructor(t){super(t.map(ata).join("; ")),this.errors=t,Object.setPrototypeOf(this,Z3r.prototype)}};var k3r=class extends Error{errors;constructor(t){super(t.map(ata).join("; ")),this.errors=t,Object.setPrototypeOf(this,k3r.prototype)}};function _A(e){return{optional:()=>QGo(e),transform:t=>ZGo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new k3r(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new Z3r(n.errors)}}}function QGo(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>(n==null?void 0:n.omitUndefined)&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>LS.OPTIONAL};return{...t,..._A(t)}}function ZGo(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,..._A(r)}}var ptP=/^([+-]?\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 dEl(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Qq(t,"string")}]}:ptP.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:Qq(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:Qq(t,"Date object")}]},getType:()=>LS.DATE};return{...NJ(e),..._A(e)}}function zJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...NJ(r),..._A(r)}}}function ota(e){let t=new Set(e);return zJ(LS.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:a,message:Qq(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:a,message:Qq(n,"enum")}]}:{ok:!0,value:n})()}function pEl(e){let t=kGo(e);return{...t,..._A(t)}}function kGo(e){return{parse:(t,r)=>d2n(e).parse(t,r),json:(t,r)=>d2n(e).json(t,r),getType:()=>d2n(e).getType()}}function d2n(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function uli(e){return Object.entries(e)}function sli(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,a])=>(r.has(i)&&(n[i]=a),n),{})}function eNr(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 cli(e){return Object.keys(e)}function _El(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function vBt(e){return{withParsedProperties:t=>eKo(e,t)}}function eKo(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);if(!a.ok)return a;let u=Object.entries(t).reduce((f,[d,c])=>({...f,[d]:typeof c=="function"?c(a.value):c}),{});return{ok:!0,value:{...a.value,...u}}},json:(n,i)=>{if(!eNr(n))return{ok:!1,errors:[{path:(i==null?void 0:i.breadcrumbsPrefix)??[],message:Qq(n,"object")}]};let a=new Set(Object.keys(t)),u=sli(n,Object.keys(n).filter(f=>!a.has(f)));return e.json(u,i)},getType:()=>e.getType()};return{...r,..._A(r),...vBt(r)}}function hEl(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function tNr(e){return e.isProperty}function uta(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>tNr(n)?n.rawKey:r),_getParsedProperties:()=>cli(e),parse:(r,n)=>{let i={},a=[];for(let[u,f]of uli(e)){let d=tNr(f)?f.rawKey:u,c=tNr(f)?f.valueSchema:f,o={rawKey:d,parsedKey:u,valueSchema:c};i[d]=o,bEl(c)&&a.push(d)}return yEl({value:r,requiredKeys:a,getProperty:u=>{let f=i[u];if(f!=null)return{transformedKey:f.parsedKey,transform:d=>f.valueSchema.parse(d,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],u]})}},unrecognizedObjectKeys:n==null?void 0:n.unrecognizedObjectKeys,skipValidation:n==null?void 0:n.skipValidation,breadcrumbsPrefix:n==null?void 0:n.breadcrumbsPrefix,omitUndefined:n==null?void 0:n.omitUndefined})},json:(r,n)=>{let i=[];for(let[a,u]of uli(e)){let f=tNr(u)?u.valueSchema:u;bEl(f)&&i.push(a)}return yEl({value:r,requiredKeys:i,getProperty:a=>{let u=e[a];if(u!=null)return tNr(u)?{transformedKey:u.rawKey,transform:f=>u.valueSchema.json(f,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],a]})}:{transformedKey:a,transform:f=>u.json(f,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],a]})}},unrecognizedObjectKeys:n==null?void 0:n.unrecognizedObjectKeys,skipValidation:n==null?void 0:n.skipValidation,breadcrumbsPrefix:n==null?void 0:n.breadcrumbsPrefix,omitUndefined:n==null?void 0:n.omitUndefined})},getType:()=>LS.OBJECT};return{...NJ(t),..._A(t),...vBt(t),...p2n(t)}}function yEl({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:a=[]}){if(!eNr(e))return{ok:!1,errors:[{path:a,message:Qq(e,"object")}]};let u=new Set(t),f=[],d={};for(let[c,o]of Object.entries(e)){let l=r(c);if(l!=null){u.delete(c);let g=l.transform(o);g.ok?d[l.transformedKey]=g.value:(d[c]=o,f.push(...g.errors))}else switch(n){case"fail":f.push({path:[...a,c],message:`Unexpected key "${c}"`});break;case"strip":break;case"passthrough":d[c]=o;break}}return f.push(...t.filter(c=>u.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),f.length===0||i?{ok:!0,value:d}:{ok:!1,errors:f}}function p2n(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>vEl({extensionKeys:t._getRawProperties(),value:n,transformBase:a=>e.parse(a,i),transformExtension:a=>t.parse(a,i)}),json:(n,i)=>vEl({extensionKeys:t._getParsedProperties(),value:n,transformBase:a=>e.json(a,i),transformExtension:a=>t.json(a,i)}),getType:()=>LS.OBJECT};return{...r,..._A(r),...vBt(r),...p2n(r)}}}}function vEl({extensionKeys:e,value:t,transformBase:r,transformExtension:n}){let i=new Set(e),[a,u]=_El(cli(t),c=>i.has(c)),f=r(sli(t,u)),d=n(sli(t,a));return f.ok&&d.ok?{ok:!0,value:{...f.value,...d.value}}:{ok:!1,errors:[...f.ok?[]:f.errors,...d.ok?[]:d.errors]}}function bEl(e){return!_tP(e)}function _tP(e){switch(e.getType()){case LS.ANY:case LS.UNKNOWN:case LS.OPTIONAL:return!0;default:return!1}}function gEl(e){return uta(e)}function mEl(e){let t={...kGo(e),_getRawProperties:()=>d2n(e)._getRawProperties(),_getParsedProperties:()=>d2n(e)._getParsedProperties()};return{...t,..._A(t),...vBt(t),...p2n(t)}}function sta(e){let t={parse:(r,n)=>OEl(r,(i,a)=>e.parse(i,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],`[${a}]`]})),json:(r,n)=>OEl(r,(i,a)=>e.json(i,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],`[${a}]`]})),getType:()=>LS.LIST};return{...NJ(t),..._A(t)}}function OEl(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:Qq(e,"list"),path:[]}]}}function PEl(e){return zJ(LS.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Qq(r,`"${e}"`)}]})()}function jEl(e){return zJ(LS.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Qq(r,`${e.toString()}`)}]})()}var wEl=zJ(LS.ANY,e=>({ok:!0,value:e}));var DEl=zJ(LS.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Qq(e,"boolean")}]});var SEl=zJ(LS.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Qq(e,"number")}]});var EEl=zJ(LS.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Qq(e,"string")}]});var MEl=zJ(LS.UNKNOWN,e=>({ok:!0,value:e}));function TEl(e,t){let r={parse:(n,i)=>xEl({value:n,isKeyNumeric:e.getType()===LS.NUMBER,transformKey:a=>e.parse(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${u}`]}),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(n,i)=>xEl({value:n,isKeyNumeric:e.getType()===LS.NUMBER,transformKey:a=>e.json(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${u}`]}),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>LS.RECORD};return{...NJ(r),..._A(r)}}function xEl({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return eNr(e)?uli(e).reduce((a,[u,f])=>{if(f==null)return a;let d=a,c=u;if(t){let O=u.length>0?Number(u):NaN;isNaN(O)||(c=O)}let o=r(c),l=n(f,c);if(d.ok&&o.ok&&l.ok)return{ok:!0,value:{...d.value,[o.value]:l.value}};let g=[];return d.ok||g.push(...d.errors),o.ok||g.push(...o.errors),l.ok||g.push(...l.errors),{ok:!1,errors:g}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:Qq(e,"object")}]}}function qEl(e){let t=sta(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==null?void 0:i.breadcrumbsPrefix)??[],message:Qq(n,"Set")}]},getType:()=>LS.SET};return{...NJ(r),..._A(r)}}function AEl(e){let t={parse:(r,n)=>CEl((i,a)=>i.parse(r,a),e,n),json:(r,n)=>CEl((i,a)=>i.json(r,a),e,n),getType:()=>LS.UNDISCRIMINATED_UNION};return{...NJ(t),..._A(t)}}function CEl(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 f of u.errors)n.push({path:f.path,message:`[Variant ${i}] ${f.message}`})}return{ok:!1,errors:n}}function NEl(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function BEl(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=ota(cli(t)),a={parse:(u,f)=>zEl({value:u,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:d=>i.parse(d,{allowUnrecognizedEnumValues:f==null?void 0:f.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f==null?void 0:f.breadcrumbsPrefix)??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:f==null?void 0:f.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,c)=>c.parse(d,f),breadcrumbsPrefix:f==null?void 0:f.breadcrumbsPrefix}),json:(u,f)=>zEl({value:u,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:d=>i.json(d,{allowUnrecognizedEnumValues:f==null?void 0:f.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f==null?void 0:f.breadcrumbsPrefix)??[],n]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:f==null?void 0:f.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,c)=>c.json(d,f),breadcrumbsPrefix:f==null?void 0:f.breadcrumbsPrefix}),getType:()=>LS.UNION};return{...NJ(a),..._A(a),...vBt(a)}}function zEl({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:f=[]}){if(!eNr(e))return{ok:!1,errors:[{path:f,message:Qq(e,"object")}]};let{[t]:d,...c}=e;if(d==null)return{ok:!1,errors:[{path:f,message:`Missing discriminant ("${t}")`}]};let o=n(d);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,...c}}:{ok:!1,errors:[{path:[...f,t],message:"Unexpected discriminant value"}]};let g=u(c,l);return g.ok?{ok:!0,value:{[r]:d,...g.value}}:g}var jTe=Jr.string();var cta=Jr.enum_(["ALL","ANY"]);var PZr=Jr.objectWithoutOptionalProperties({unsafeName:Jr.string(),safeName:Jr.string()});var vy=Jr.objectWithoutOptionalProperties({originalName:Jr.string(),camelCase:PZr,pascalCase:PZr,snakeCase:PZr,screamingSnakeCase:PZr});var T0=Jr.objectWithoutOptionalProperties({docs:Jr.string().optional()});var lta=Jr.objectWithoutOptionalProperties({token:vy,tokenEnvVar:jTe.optional()}).extend(T0);var fta=Jr.objectWithoutOptionalProperties({username:vy,usernameEnvVar:jTe.optional(),password:vy,passwordEnvVar:jTe.optional()}).extend(T0);var Um=Jr.objectWithoutOptionalProperties({wireValue:Jr.string(),name:vy});var dta=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb),prefix:Jr.string().optional(),headerEnvVar:jTe.optional()}).extend(T0);var TDr=Jr.string();var bBt=Jr.string();var gBt=Jr.string();var _2n=Jr.objectWithoutOptionalProperties({endpointId:TDr,serviceId:bBt,subpackageId:gBt.optional()});var pta=Jr.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var mBt=Jr.objectWithoutOptionalProperties({status:pta,message:Jr.string().optional()});var lB=Jr.objectWithoutOptionalProperties({availability:mBt.optional()}).extend(T0);var rNr=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb),allowMultiple:Jr.boolean()}).extend(lB);var iQ=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(lB);var _ta=Jr.union("type",{query:rNr,body:iQ}).transform({transform:e=>{switch(e.type){case"query":return tne.query(e);case"body":return tne.body(e);default:return e}},untransform:({_visit:e,...t})=>t});var aQ=Jr.objectWithoutOptionalProperties({propertyPath:Jr.list(vy).optional(),property:_ta});var hta=Jr.objectWithoutOptionalProperties({clientId:aQ,clientSecret:aQ,scopes:aQ.optional()});var wTe=Jr.objectWithoutOptionalProperties({propertyPath:Jr.list(vy).optional(),property:iQ});var h2n=Jr.objectWithoutOptionalProperties({accessToken:wTe,expiresIn:wTe.optional(),refreshToken:wTe.optional()});var yta=Jr.objectWithoutOptionalProperties({endpointReference:_2n,requestProperties:hta,responseProperties:h2n});var vta=Jr.objectWithoutOptionalProperties({refreshToken:aQ});var bta=Jr.objectWithoutOptionalProperties({endpointReference:_2n,requestProperties:vta,responseProperties:h2n});var gta=Jr.objectWithoutOptionalProperties({clientIdEnvVar:jTe.optional(),clientSecretEnvVar:jTe.optional(),tokenPrefix:Jr.string().optional(),scopes:Jr.list(Jr.string()).optional(),tokenEndpoint:yta,refreshEndpoint:bta.optional()});var mta=Jr.union("type",{clientCredentials:gta}).transform({transform:e=>{switch(e.type){case"clientCredentials":return K3r.clientCredentials(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ota=Jr.objectWithoutOptionalProperties({configuration:mta}).extend(T0);var Pta=Jr.union(Jr.discriminant("type","_type"),{bearer:lta,basic:fta,header:dta,oauth:Ota}).transform({transform:e=>{switch(e.type){case"bearer":return HV.bearer(e);case"basic":return HV.basic(e);case"header":return HV.header(e);case"oauth":return HV.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var jta=Jr.objectWithoutOptionalProperties({requirement:cta,schemes:Jr.list(Pta)}).extend(T0);var rKo={};Wb(rKo,{Availability:()=>mBt,AvailabilityStatus:()=>pta,Declaration:()=>lB,EndpointId:()=>TDr,EndpointReference:()=>_2n,ErrorId:()=>iNr,EscapedString:()=>wta,FeatureId:()=>Sta,FernFilepath:()=>DTe,Name:()=>vy,NameAndWireValue:()=>Um,SafeAndUnsafeString:()=>PZr,ServiceId:()=>bBt,SubpackageId:()=>gBt,TypeId:()=>JV,WebSocketChannelId:()=>v2n,WebhookGroupId:()=>y2n,WebhookId:()=>Dta,WithDocs:()=>T0,WithDocsAndAvailability:()=>nNr,WithJsonExample:()=>OBt});var nNr=Jr.objectWithoutOptionalProperties({availability:mBt.optional()}).extend(T0);var DTe=Jr.objectWithoutOptionalProperties({allParts:Jr.list(vy),packagePath:Jr.list(vy),file:vy.optional()});var wta=Jr.objectWithoutOptionalProperties({original:Jr.string()});var OBt=Jr.objectWithoutOptionalProperties({jsonExample:Jr.unknown()});var JV=Jr.string();var iNr=Jr.string();var y2n=Jr.string();var Dta=Jr.string();var v2n=Jr.string();var Sta=Jr.string();var nKo={};Wb(nKo,{Constants:()=>Eta});var Eta=Jr.objectWithoutOptionalProperties({errorInstanceIdKey:Um});var iKo={};Wb(iKo,{EnvironmentBaseUrlId:()=>oNr,EnvironmentBaseUrlWithId:()=>Tta,EnvironmentId:()=>aNr,EnvironmentUrl:()=>b2n,Environments:()=>Ata,EnvironmentsConfig:()=>Nta,MultipleBaseUrlsEnvironment:()=>qta,MultipleBaseUrlsEnvironments:()=>Cta,SingleBaseUrlEnvironment:()=>Mta,SingleBaseUrlEnvironments:()=>xta});var aNr=Jr.string();var oNr=Jr.string();var b2n=Jr.string();var Mta=Jr.objectWithoutOptionalProperties({id:aNr,name:vy,url:b2n}).extend(T0);var xta=Jr.objectWithoutOptionalProperties({environments:Jr.list(Mta)});var Tta=Jr.objectWithoutOptionalProperties({id:oNr,name:vy});var qta=Jr.objectWithoutOptionalProperties({id:aNr,name:vy,urls:Jr.record(oNr,b2n)}).extend(T0);var Cta=Jr.objectWithoutOptionalProperties({baseUrls:Jr.list(Tta),environments:Jr.list(qta)});var Ata=Jr.union("type",{singleBaseUrl:xta,multipleBaseUrls:Cta}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return vCt.singleBaseUrl(e);case"multipleBaseUrls":return vCt.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t});var Nta=Jr.objectWithoutOptionalProperties({defaultEnvironment:aNr.optional(),environments:Ata});var aKo={};Wb(aKo,{DeclaredErrorName:()=>uNr,ErrorDeclaration:()=>Bta,ErrorDeclarationDiscriminantValue:()=>IEl,ExampleError:()=>zta});var uNr=Jr.objectWithoutOptionalProperties({errorId:iNr,fernFilepath:DTe,name:vy});var zta=Jr.objectWithoutOptionalProperties({name:vy.optional(),shape:Jr.lazyObject(()=>kj)}).extend(OBt).extend(T0);var Bta=Jr.objectWithoutOptionalProperties({name:uNr,discriminantValue:Um,type:Jr.lazy(()=>Hb).optional(),statusCode:Jr.number(),examples:Jr.list(zta)}).extend(T0);var IEl=Jr.union("type",{property:Um,statusCode:Jr.object({})}).transform({transform:e=>{switch(e.type){case"property":return Y3r.property(e);case"statusCode":return Y3r.statusCode();default:return e}},untransform:({_visit:e,...t})=>t});var oKo={};Wb(oKo,{AutogeneratedEndpointExample:()=>Sra,BytesRequest:()=>P2n,CursorPagination:()=>fra,DeclaredServiceName:()=>Ita,EndpointName:()=>Fta,ExampleCodeSample:()=>vra,ExampleCodeSampleLanguage:()=>_ra,ExampleCodeSampleSdk:()=>yra,ExampleEndpointCall:()=>x2n,ExampleEndpointErrorResponse:()=>jra,ExampleEndpointSuccessResponse:()=>Pra,ExampleHeader:()=>jZr,ExampleInlinedRequestBody:()=>M2n,ExampleInlinedRequestBodyProperty:()=>gra,ExamplePathParameter:()=>sNr,ExampleQueryParameter:()=>E2n,ExampleQueryParameterShape:()=>bra,ExampleRequestBody:()=>mra,ExampleResponse:()=>wra,ExampleServerSideEvent:()=>Ora,FileDownloadResponse:()=>w2n,FileProperty:()=>$ta,FilePropertyArray:()=>Hta,FilePropertySingle:()=>Wta,FileUploadBodyProperty:()=>Jta,FileUploadRequest:()=>Kta,FileUploadRequestProperty:()=>Gta,GrpcTransport:()=>Ara,HttpEndpoint:()=>Era,HttpHeader:()=>oQ,HttpMethod:()=>Lta,HttpPath:()=>wCt,HttpPathPart:()=>Rta,HttpRequestBody:()=>Yta,HttpRequestBodyReference:()=>O2n,HttpResponse:()=>sra,HttpResponseBody:()=>ura,HttpService:()=>zra,InlinedRequestBody:()=>Vta,InlinedRequestBodyProperty:()=>m2n,JsonResponse:()=>j2n,JsonResponseBody:()=>era,JsonResponseBodyWithProperty:()=>tra,JsonStreamChunk:()=>rra,NonStreamHttpResponseBody:()=>ara,OffsetPagination:()=>dra,Pagination:()=>pra,PathParameter:()=>DCt,PathParameterLocation:()=>Uta,QueryParameter:()=>rNr,RequestProperty:()=>aQ,RequestPropertyValue:()=>_ta,ResponseError:()=>cra,ResponseErrors:()=>lra,ResponseProperty:()=>wTe,SdkRequest:()=>kta,SdkRequestBodyType:()=>Xta,SdkRequestShape:()=>Zta,SdkRequestWrapper:()=>Qta,SseStreamChunk:()=>ira,StreamParameterResponse:()=>ora,StreamingResponse:()=>S2n,SupportedSdkLanguage:()=>hra,TextResponse:()=>D2n,TextStreamChunk:()=>nra,Transport:()=>Nra,UserSpecifiedEndpointExample:()=>Dra});var Ita=Jr.objectWithoutOptionalProperties({fernFilepath:DTe});var Rta=Jr.objectWithoutOptionalProperties({pathParameter:Jr.string(),tail:Jr.string()});var wCt=Jr.objectWithoutOptionalProperties({head:Jr.string(),parts:Jr.list(Rta)});var Fta=vy;var Lta=Jr.enum_(["GET","POST","PUT","PATCH","DELETE"]);var oQ=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb),env:Jr.string().optional()}).extend(lB);var Uta=Jr.enum_(["ROOT","SERVICE","ENDPOINT"]);var g2n=Jr.string();var DCt=Jr.objectWithoutOptionalProperties({name:vy,valueType:Jr.lazy(()=>Hb),location:Uta,variable:g2n.optional()}).extend(T0);var GA=Jr.objectWithoutOptionalProperties({typeId:JV,fernFilepath:DTe,name:vy});var m2n=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(nNr);var Vta=Jr.objectWithoutOptionalProperties({name:vy,extends:Jr.list(GA),properties:Jr.list(m2n),extendedProperties:Jr.list(iQ).optional(),contentType:Jr.string().optional(),extraProperties:Jr.property("extra-properties",Jr.boolean())});var O2n=Jr.objectWithoutOptionalProperties({requestBodyType:Jr.lazy(()=>Hb),contentType:Jr.string().optional()}).extend(T0);var Wta=Jr.objectWithoutOptionalProperties({key:Um,isOptional:Jr.boolean(),contentType:Jr.string().optional()});var Hta=Jr.objectWithoutOptionalProperties({key:Um,isOptional:Jr.boolean(),contentType:Jr.string().optional()});var $ta=Jr.union("type",{file:Wta,fileArray:Hta}).transform({transform:e=>{switch(e.type){case"file":return bCt.file(e);case"fileArray":return bCt.fileArray(e);default:return e}},untransform:({_visit:e,...t})=>t});var Jta=Jr.objectWithoutOptionalProperties({contentType:Jr.string().optional()}).extend(m2n);var Gta=Jr.union("type",{file:Jr.object({value:$ta}),bodyProperty:Jta}).transform({transform:e=>{switch(e.type){case"file":return Zre.file(e.value);case"bodyProperty":return Zre.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t});var Kta=Jr.objectWithoutOptionalProperties({name:vy,properties:Jr.list(Gta)});var P2n=Jr.objectWithoutOptionalProperties({isOptional:Jr.boolean(),contentType:Jr.string().optional()});var Yta=Jr.union("type",{inlinedRequestBody:Vta,reference:O2n,fileUpload:Kta,bytes:P2n}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return cB.inlinedRequestBody(e);case"reference":return cB.reference(e);case"fileUpload":return cB.fileUpload(e);case"bytes":return cB.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var Xta=Jr.union("type",{typeReference:O2n,bytes:P2n}).transform({transform:e=>{switch(e.type){case"typeReference":return gCt.typeReference(e);case"bytes":return gCt.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var Qta=Jr.objectWithoutOptionalProperties({wrapperName:vy,bodyKey:vy});var Zta=Jr.union("type",{justRequestBody:Jr.object({value:Xta}),wrapper:Qta}).transform({transform:e=>{switch(e.type){case"justRequestBody":return gTe.justRequestBody(e.value);case"wrapper":return gTe.wrapper(e);default:return e}},untransform:({_visit:e,...t})=>t});var kta=Jr.objectWithoutOptionalProperties({streamParameter:aQ.optional(),requestParameterName:vy,shape:Zta});var era=Jr.objectWithoutOptionalProperties({responseBodyType:Jr.lazy(()=>Hb)}).extend(T0);var tra=Jr.objectWithoutOptionalProperties({responseBodyType:Jr.lazy(()=>Hb),responseProperty:iQ.optional()}).extend(T0);var j2n=Jr.union("type",{response:era,nestedPropertyAsResponse:tra}).transform({transform:e=>{switch(e.type){case"response":return mCt.response(e);case"nestedPropertyAsResponse":return mCt.nestedPropertyAsResponse(e);default:return e}},untransform:({_visit:e,...t})=>t});var w2n=Jr.objectWithoutOptionalProperties({}).extend(T0);var D2n=Jr.objectWithoutOptionalProperties({}).extend(T0);var rra=Jr.objectWithoutOptionalProperties({payload:Jr.lazy(()=>Hb),terminator:Jr.string().optional()}).extend(T0);var nra=Jr.objectWithoutOptionalProperties({}).extend(T0);var ira=Jr.objectWithoutOptionalProperties({payload:Jr.lazy(()=>Hb),terminator:Jr.string().optional()}).extend(T0);var S2n=Jr.union("type",{json:rra,text:nra,sse:ira}).transform({transform:e=>{switch(e.type){case"json":return ene.json(e);case"text":return ene.text(e);case"sse":return ene.sse(e);default:return e}},untransform:({_visit:e,...t})=>t});var ara=Jr.union("type",{json:Jr.object({value:j2n}),fileDownload:w2n,text:D2n}).transform({transform:e=>{switch(e.type){case"json":return kre.json(e.value);case"fileDownload":return kre.fileDownload(e);case"text":return kre.text(e);default:return e}},untransform:({_visit:e,...t})=>t});var ora=Jr.objectWithoutOptionalProperties({nonStreamResponse:ara,streamResponse:S2n});var ura=Jr.union("type",{json:Jr.object({value:j2n}),fileDownload:w2n,text:D2n,streaming:Jr.object({value:S2n}),streamParameter:ora}).transform({transform:e=>{switch(e.type){case"json":return pA.json(e.value);case"fileDownload":return pA.fileDownload(e);case"text":return pA.text(e);case"streaming":return pA.streaming(e.value);case"streamParameter":return pA.streamParameter(e);default:return e}},untransform:({_visit:e,...t})=>t});var sra=Jr.objectWithoutOptionalProperties({statusCode:Jr.property("status-code",Jr.number().optional()),body:ura.optional()});var cra=Jr.objectWithoutOptionalProperties({error:uNr}).extend(T0);var lra=Jr.list(cra);var fra=Jr.objectWithoutOptionalProperties({page:aQ,next:wTe,results:wTe});var dra=Jr.objectWithoutOptionalProperties({page:aQ,results:wTe,hasNextPage:wTe.optional(),step:aQ.optional()});var pra=Jr.union("type",{cursor:fra,offset:dra}).transform({transform:e=>{switch(e.type){case"cursor":return mTe.cursor(e);case"offset":return mTe.offset(e);default:return e}},untransform:({_visit:e,...t})=>t});var _ra=Jr.objectWithoutOptionalProperties({name:vy.optional(),language:Jr.string(),code:Jr.string(),install:Jr.string().optional()}).extend(T0);var hra=Jr.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var yra=Jr.objectWithoutOptionalProperties({name:vy.optional(),sdk:hra,code:Jr.string()}).extend(T0);var vra=Jr.union("type",{language:_ra,sdk:yra}).transform({transform:e=>{switch(e.type){case"language":return Sje.language(e);case"sdk":return Sje.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var sNr=Jr.objectWithoutOptionalProperties({name:vy,value:Jr.lazyObject(()=>kj)});var jZr=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj)});var bra=Jr.union("type",{single:Jr.object({}),exploded:Jr.object({}),commaSeparated:Jr.object({})}).transform({transform:e=>{switch(e.type){case"single":return uR.single();case"exploded":return uR.exploded();case"commaSeparated":return uR.commaSeparated();default:return e}},untransform:({_visit:e,...t})=>t});var E2n=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj),shape:bra.optional()});var gra=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj),originalTypeDeclaration:GA.optional()});var M2n=Jr.objectWithoutOptionalProperties({properties:Jr.list(gra)}).extend(OBt);var mra=Jr.union("type",{inlinedRequestBody:M2n,reference:Jr.lazyObject(()=>kj)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return AJ.inlinedRequestBody(e);case"reference":return AJ.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ora=Jr.objectWithoutOptionalProperties({event:Jr.string(),data:Jr.lazyObject(()=>kj)});var Pra=Jr.union("type",{body:Jr.object({value:Jr.lazyObject(()=>kj).optional()}),stream:Jr.object({value:Jr.list(Jr.lazyObject(()=>kj))}),sse:Jr.object({value:Jr.list(Ora)})}).transform({transform:e=>{switch(e.type){case"body":return Xq.body(e.value);case"stream":return Xq.stream(e.value);case"sse":return Xq.sse(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var jra=Jr.objectWithoutOptionalProperties({error:uNr,body:Jr.lazyObject(()=>kj).optional()});var wra=Jr.union("type",{ok:Jr.object({value:Pra}),error:jra}).transform({transform:e=>{switch(e.type){case"ok":return w3.ok(e.value);case"error":return w3.error(e);default:return e}},untransform:({_visit:e,...t})=>t});var x2n=Jr.objectWithoutOptionalProperties({id:Jr.string().optional(),name:vy.optional(),url:Jr.string(),rootPathParameters:Jr.list(sNr),servicePathParameters:Jr.list(sNr),endpointPathParameters:Jr.list(sNr),serviceHeaders:Jr.list(jZr),endpointHeaders:Jr.list(jZr),queryParameters:Jr.list(E2n),request:mra.optional(),response:wra}).extend(T0);var Dra=Jr.objectWithoutOptionalProperties({codeSamples:Jr.list(vra).optional(),example:x2n.optional()});var Sra=Jr.objectWithoutOptionalProperties({example:x2n});var Era=Jr.objectWithoutOptionalProperties({id:TDr,name:Fta,displayName:Jr.string().optional(),method:Lta,headers:Jr.list(oQ),baseUrl:oNr.optional(),path:wCt,fullPath:wCt,pathParameters:Jr.list(DCt),allPathParameters:Jr.list(DCt),queryParameters:Jr.list(rNr),requestBody:Yta.optional(),sdkRequest:kta.optional(),response:sra.optional(),errors:lra,auth:Jr.boolean(),idempotent:Jr.boolean(),pagination:pra.optional(),userSpecifiedExamples:Jr.list(Dra),autogeneratedExamples:Jr.list(Sra)}).extend(lB);var Mra=Jr.objectWithoutOptionalProperties({});var xra=Jr.objectWithoutOptionalProperties({});var T2n=Jr.objectWithoutOptionalProperties({json:Mra.optional(),proto:xra.optional()});var Tra=Jr.objectWithoutOptionalProperties({namespace:Jr.string()});var qra=Jr.objectWithoutOptionalProperties({csharp:Tra.optional()});var q2n=Jr.objectWithoutOptionalProperties({filepath:Jr.string(),packageName:Jr.string().optional(),options:qra.optional()});var Cra=Jr.objectWithoutOptionalProperties({file:q2n,name:vy});var Ara=Jr.objectWithoutOptionalProperties({service:Cra});var Nra=Jr.union("type",{http:Jr.object({}),grpc:Ara}).transform({transform:e=>{switch(e.type){case"http":return vTe.http();case"grpc":return vTe.grpc(e);default:return e}},untransform:({_visit:e,...t})=>t});var zra=Jr.objectWithoutOptionalProperties({availability:mBt.optional(),name:Ita,displayName:Jr.string().optional(),basePath:wCt,endpoints:Jr.list(Era),headers:Jr.list(oQ),pathParameters:Jr.list(DCt),encoding:T2n.optional(),transport:Nra.optional()});var uKo={};Wb(uKo,{ApiDefinitionSource:()=>Qna,ApiDefinitionSourceId:()=>Yna,ApiVersionScheme:()=>Ira,ErrorDiscriminationByPropertyStrategy:()=>Una,ErrorDiscriminationStrategy:()=>Vna,HeaderApiVersionScheme:()=>Bra,IntermediateRepresentation:()=>REl,Package:()=>I2n,PackageNavigationConfig:()=>Fna,PlatformHeaders:()=>Hna,ProtoSource:()=>Xna,ReadmeConfig:()=>Kna,SdkConfig:()=>$na,ServiceTypeReferenceInfo:()=>Gna,SourceConfig:()=>Zna,Subpackage:()=>Lna,UserAgent:()=>Wna});var qDr=Jr.objectWithoutOptionalProperties({name:Um}).extend(lB);var C2n=Jr.objectWithoutOptionalProperties({default:qDr.optional(),values:Jr.list(qDr)});var Bra=Jr.objectWithoutOptionalProperties({header:oQ,value:C2n});var Ira=Jr.union("type",{header:Bra}).transform({transform:e=>{switch(e.type){case"header":return X3r.header(e);default:return e}},untransform:({_visit:e,...t})=>t});var Rra=Jr.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var Fra=Jr.objectWithoutOptionalProperties({name:GA,shape:Rra});var Lra=Jr.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var Ura=Jr.objectWithoutOptionalProperties({min:Jr.number().optional(),max:Jr.number().optional(),exclusiveMin:Jr.boolean().optional(),exclusiveMax:Jr.boolean().optional(),multipleOf:Jr.number().optional()});var Vra=Jr.objectWithoutOptionalProperties({default:Jr.number().optional(),validation:Ura.optional()});var Wra=Jr.objectWithoutOptionalProperties({default:Jr.number().optional()});var Hra=Jr.objectWithoutOptionalProperties({});var $ra=Jr.objectWithoutOptionalProperties({});var Jra=Jr.objectWithoutOptionalProperties({});var Gra=Jr.objectWithoutOptionalProperties({min:Jr.number().optional(),max:Jr.number().optional(),exclusiveMin:Jr.boolean().optional(),exclusiveMax:Jr.boolean().optional(),multipleOf:Jr.number().optional()});var Kra=Jr.objectWithoutOptionalProperties({default:Jr.number().optional(),validation:Gra.optional()});var Yra=Jr.objectWithoutOptionalProperties({default:Jr.boolean().optional()});var Xra=Jr.objectWithoutOptionalProperties({format:Jr.string().optional(),pattern:Jr.string().optional(),minLength:Jr.number().optional(),maxLength:Jr.number().optional()});var Qra=Jr.objectWithoutOptionalProperties({default:Jr.string().optional(),validation:Xra.optional()});var Zra=Jr.objectWithoutOptionalProperties({});var kra=Jr.objectWithoutOptionalProperties({});var ena=Jr.objectWithoutOptionalProperties({});var tna=Jr.objectWithoutOptionalProperties({});var rna=Jr.objectWithoutOptionalProperties({default:Jr.string().optional()});var nna=Jr.union("type",{integer:Vra,long:Wra,uint:Hra,uint64:$ra,float:Jra,double:Kra,boolean:Yra,string:Qra,date:Zra,dateTime:kra,uuid:ena,base64:tna,bigInteger:rna}).transform({transform:e=>{switch(e.type){case"integer":return gM.integer(e);case"long":return gM.long(e);case"uint":return gM.uint(e);case"uint64":return gM.uint64(e);case"float":return gM.float(e);case"double":return gM.double(e);case"boolean":return gM.boolean(e);case"string":return gM.string(e);case"date":return gM.date(e);case"dateTime":return gM.dateTime(e);case"uuid":return gM.uuid(e);case"base64":return gM.base64(e);case"bigInteger":return gM.bigInteger(e);default:return e}},untransform:({_visit:e,...t})=>t});var A2n=Jr.objectWithoutOptionalProperties({v1:Lra,v2:nna.optional()});var ina=Jr.union(Jr.discriminant("type","_type"),{container:Jr.object({container:Jr.lazy(()=>N2n)}),named:Fra,primitive:Jr.object({primitive:A2n}),unknown:Jr.object({})}).transform({transform:e=>{switch(e.type){case"container":return $V.container(e.container);case"named":return $V.named(e);case"primitive":return $V.primitive(e.primitive);case"unknown":return $V.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var ana=Jr.objectWithoutOptionalProperties({aliasOf:Jr.lazy(()=>Hb),resolvedType:ina});var ona=Jr.objectWithoutOptionalProperties({extends:Jr.list(GA),properties:Jr.list(iQ),extendedProperties:Jr.list(iQ).optional(),extraProperties:Jr.property("extra-properties",Jr.boolean())});var una=Jr.objectWithoutOptionalProperties({name:Um,type:Jr.lazy(()=>Hb)});var sna=Jr.union(Jr.discriminant("propertiesType","_type"),{samePropertiesAsObject:GA,singleProperty:una,noProperties:Jr.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return nne.samePropertiesAsObject(e);case"singleProperty":return nne.singleProperty(e);case"noProperties":return nne.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var cna=Jr.objectWithoutOptionalProperties({discriminantValue:Um,shape:sna,displayName:Jr.string().optional(),availability:mBt.optional()}).extend(T0);var lna=Jr.objectWithoutOptionalProperties({discriminant:Um,extends:Jr.list(GA),types:Jr.list(cna),baseProperties:Jr.list(iQ)});var fna=Jr.objectWithoutOptionalProperties({type:Jr.lazy(()=>Hb)}).extend(T0);var dna=Jr.objectWithoutOptionalProperties({members:Jr.list(fna)});var pna=Jr.union(Jr.discriminant("type","_type"),{alias:ana,enum:C2n,object:ona,union:lna,undiscriminatedUnion:dna}).transform({transform:e=>{switch(e.type){case"alias":return EC.alias(e);case"enum":return EC.enum(e);case"object":return EC.object(e);case"union":return EC.union(e);case"undiscriminatedUnion":return EC.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var lli=Jr.objectWithoutOptionalProperties({name:vy.optional(),shape:Jr.lazy(()=>z2n)}).extend(OBt).extend(T0);var _na=Jr.union("type",{any:Jr.object({}),api:Jr.object({}),boolValue:Jr.object({}),bytesValue:Jr.object({}),doubleValue:Jr.object({}),duration:Jr.object({}),empty:Jr.object({}),enum:Jr.object({}),enumValue:Jr.object({}),field:Jr.object({}),fieldCardinality:Jr.object({}),fieldKind:Jr.object({}),fieldMask:Jr.object({}),floatValue:Jr.object({}),int32Value:Jr.object({}),int64Value:Jr.object({}),listValue:Jr.object({}),method:Jr.object({}),mixin:Jr.object({}),nullValue:Jr.object({}),option:Jr.object({}),sourceContext:Jr.object({}),stringValue:Jr.object({}),struct:Jr.object({}),syntax:Jr.object({}),timestamp:Jr.object({}),type:Jr.object({}),uint32Value:Jr.object({}),uint64Value:Jr.object({}),value:Jr.object({})}).transform({transform:e=>{switch(e.type){case"any":return th.any();case"api":return th.api();case"boolValue":return th.boolValue();case"bytesValue":return th.bytesValue();case"doubleValue":return th.doubleValue();case"duration":return th.duration();case"empty":return th.empty();case"enum":return th.enum();case"enumValue":return th.enumValue();case"field":return th.field();case"fieldCardinality":return th.fieldCardinality();case"fieldKind":return th.fieldKind();case"fieldMask":return th.fieldMask();case"floatValue":return th.floatValue();case"int32Value":return th.int32Value();case"int64Value":return th.int64Value();case"listValue":return th.listValue();case"method":return th.method();case"mixin":return th.mixin();case"nullValue":return th.nullValue();case"option":return th.option();case"sourceContext":return th.sourceContext();case"stringValue":return th.stringValue();case"struct":return th.struct();case"syntax":return th.syntax();case"timestamp":return th.timestamp();case"type":return th.type();case"uint32Value":return th.uint32Value();case"uint64Value":return th.uint64Value();case"value":return th.value();default:return e}},untransform:({_visit:e,...t})=>t});var hna=Jr.objectWithoutOptionalProperties({file:q2n,name:vy});var yna=Jr.union("type",{wellKnown:Jr.object({value:_na}),userDefined:hna}).transform({transform:e=>{switch(e.type){case"wellKnown":return Yw.wellKnown(e.value);case"userDefined":return Yw.userDefined(e);default:return e}},untransform:({_visit:e,...t})=>t});var vna=Jr.union("type",{proto:Jr.object({value:yna})}).transform({transform:e=>{switch(e.type){case"proto":return xDr.proto(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var bna=Jr.objectWithoutOptionalProperties({name:GA,shape:pna,autogeneratedExamples:Jr.list(lli),userProvidedExamples:Jr.list(lli),referencedTypes:Jr.set(JV),encoding:T2n.optional(),source:vna.optional()}).extend(lB);var gna=vy;var mna=Jr.enum_(["GET","POST"]);var Ona=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(nNr);var Pna=Jr.objectWithoutOptionalProperties({name:vy,extends:Jr.list(GA),properties:Jr.list(Ona)});var jna=Jr.objectWithoutOptionalProperties({payloadType:Jr.lazy(()=>Hb)}).extend(T0);var wna=Jr.union("type",{inlinedPayload:Pna,reference:jna}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return ine.inlinedPayload(e);case"reference":return ine.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Dna=Jr.objectWithoutOptionalProperties({name:vy.optional(),payload:Jr.lazyObject(()=>kj)}).extend(T0);var Sna=Jr.objectWithoutOptionalProperties({id:Dta,name:gna,displayName:Jr.string().optional(),method:mna,headers:Jr.list(oQ),payload:wna,examples:Jr.list(Dna).optional()}).extend(lB);var Ena=Jr.list(Sna);var Mna=vy;var B2n=Jr.string();var xna=Jr.enum_(["client","server"]);var Tna=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(nNr);var qna=Jr.objectWithoutOptionalProperties({name:vy,extends:Jr.list(GA),properties:Jr.list(Tna)});var Cna=Jr.objectWithoutOptionalProperties({bodyType:Jr.lazy(()=>Hb)}).extend(T0);var Ana=Jr.union("type",{inlinedBody:qna,reference:Cna}).transform({transform:e=>{switch(e.type){case"inlinedBody":return PTe.inlinedBody(e);case"reference":return PTe.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Nna=Jr.objectWithoutOptionalProperties({type:B2n,displayName:Jr.string().optional(),origin:xna,body:Ana}).extend(lB);var zna=Jr.union("type",{inlinedBody:M2n,reference:Jr.lazyObject(()=>kj)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return jCt.inlinedBody(e);case"reference":return jCt.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Bna=Jr.objectWithoutOptionalProperties({type:B2n,body:zna});var Ina=Jr.objectWithoutOptionalProperties({name:vy.optional(),url:Jr.string(),pathParameters:Jr.list(sNr),headers:Jr.list(jZr),queryParameters:Jr.list(E2n),messages:Jr.list(Bna)}).extend(T0);var Rna=Jr.objectWithoutOptionalProperties({name:Mna,displayName:Jr.string().optional(),path:wCt,auth:Jr.boolean(),headers:Jr.list(oQ),queryParameters:Jr.list(rNr),pathParameters:Jr.list(DCt),messages:Jr.list(Nna),examples:Jr.list(Ina)}).extend(lB);var Fna=Jr.objectWithoutOptionalProperties({pointsTo:gBt});var I2n=Jr.objectWithoutOptionalProperties({fernFilepath:DTe,service:bBt.optional(),types:Jr.list(JV),errors:Jr.list(iNr),webhooks:y2n.optional(),websocket:v2n.optional(),subpackages:Jr.list(gBt),hasEndpointsInTree:Jr.boolean(),navigationConfig:Fna.optional()}).extend(T0);var Lna=Jr.objectWithoutOptionalProperties({name:vy}).extend(I2n);var Una=Jr.objectWithoutOptionalProperties({discriminant:Um,contentProperty:Um});var Vna=Jr.union("type",{statusCode:Jr.object({}),property:Una}).transform({transform:e=>{switch(e.type){case"statusCode":return OCt.statusCode();case"property":return OCt.property(e);default:return e}},untransform:({_visit:e,...t})=>t});var Wna=Jr.objectWithoutOptionalProperties({header:Jr.stringLiteral("User-Agent"),value:Jr.string()});var Hna=Jr.objectWithoutOptionalProperties({language:Jr.string(),sdkName:Jr.string(),sdkVersion:Jr.string(),userAgent:Wna.optional()});var $na=Jr.objectWithoutOptionalProperties({isAuthMandatory:Jr.boolean(),hasStreamingEndpoints:Jr.boolean(),hasPaginatedEndpoints:Jr.boolean(),hasFileDownloadEndpoints:Jr.boolean(),platformHeaders:Hna});var Jna=Jr.objectWithoutOptionalProperties({id:g2n,name:vy,type:Jr.lazy(()=>Hb)}).extend(T0);var Gna=Jr.objectWithoutOptionalProperties({typesReferencedOnlyByService:Jr.record(bBt,Jr.list(JV)),sharedTypes:Jr.list(JV)});var Kna=Jr.objectWithoutOptionalProperties({defaultEndpoint:TDr.optional(),bannerLink:Jr.string().optional(),introduction:Jr.string().optional(),apiReferenceLink:Jr.string().optional(),features:Jr.record(Sta,Jr.list(TDr)).optional()});var Yna=Jr.string();var Xna=Jr.objectWithoutOptionalProperties({id:Yna,protoRootUrl:Jr.string()});var Qna=Jr.union("type",{proto:Xna,openapi:Jr.object({})}).transform({transform:e=>{switch(e.type){case"proto":return rne.proto(e);case"openapi":return rne.openapi();default:return e}},untransform:({_visit:e,...t})=>t});var Zna=Jr.objectWithoutOptionalProperties({sources:Jr.list(Qna)});var kna=Jr.objectWithoutOptionalProperties({apiKey:Jr.string(),workspaceId:Jr.string(),collectionId:Jr.string().optional()});var R2n=Jr.union("type",{postman:kna}).transform({transform:e=>{switch(e.type){case"postman":return l2n.postman(e);default:return e}},untransform:({_visit:e,...t})=>t});var eia=Jr.objectWithoutOptionalProperties({owner:Jr.string(),repo:Jr.string(),target:R2n});var tia=Jr.objectWithoutOptionalProperties({target:R2n});var ria=Jr.union("type",{github:eia,direct:tia}).transform({transform:e=>{switch(e.type){case"github":return Q3r.github(e);case"direct":return Q3r.direct(e);default:return e}},untransform:({_visit:e,...t})=>t});var REl=Jr.objectWithoutOptionalProperties({fdrApiDefinitionId:Jr.string().optional(),apiVersion:Ira.optional(),apiName:vy,apiDisplayName:Jr.string().optional(),apiDocs:Jr.string().optional(),auth:jta,headers:Jr.list(oQ),idempotencyHeaders:Jr.list(oQ),types:Jr.record(JV,bna),services:Jr.record(bBt,zra),webhookGroups:Jr.record(y2n,Ena),websocketChannels:Jr.record(v2n,Rna).optional(),errors:Jr.record(iNr,Bta),subpackages:Jr.record(gBt,Lna),rootPackage:I2n,constants:Eta,environments:Nta.optional(),basePath:wCt.optional(),pathParameters:Jr.list(DCt),errorDiscriminationStrategy:Vna,sdkConfig:$na,variables:Jr.list(Jna),serviceTypeReferenceInfo:Gna,readmeConfig:Kna.optional(),sourceConfig:Zna.optional(),publishConfig:ria.optional()});var sKo={};Wb(sKo,{CsharpProtobufFileOptions:()=>Tra,ProtobufFile:()=>q2n,ProtobufFileOptions:()=>qra,ProtobufService:()=>Cra,ProtobufType:()=>yna,UserDefinedProtobufType:()=>hna,WellKnownProtobufType:()=>_na});var cKo={};Wb(cKo,{DirectPublish:()=>tia,GithubPublish:()=>eia,PostmanPublishTarget:()=>kna,PublishTarget:()=>R2n,PublishingConfig:()=>ria});var lKo={};Wb(lKo,{AliasTypeDeclaration:()=>ana,Base64Type:()=>tna,BigIntegerType:()=>rna,BooleanType:()=>Yra,ContainerType:()=>N2n,DateTimeType:()=>kra,DateType:()=>Zra,DeclaredTypeName:()=>GA,DoubleType:()=>Kra,DoubleValidationRules:()=>Gra,Encoding:()=>T2n,EnumTypeDeclaration:()=>C2n,EnumTypeReference:()=>FEl,EnumValue:()=>qDr,ExampleAliasType:()=>sia,ExampleContainer:()=>via,ExampleDatetime:()=>yia,ExampleEnumType:()=>uia,ExampleKeyValuePair:()=>wia,ExampleListContainer:()=>mia,ExampleLiteralContainer:()=>gia,ExampleMapContainer:()=>jia,ExampleNamedType:()=>bia,ExampleObjectProperty:()=>fia,ExampleObjectType:()=>F2n,ExampleObjectTypeWithTypeId:()=>_ia,ExampleOptionalContainer:()=>Pia,ExamplePrimitive:()=>L2n,ExampleSetContainer:()=>Oia,ExampleSingleUnionType:()=>dia,ExampleSingleUnionTypeProperties:()=>pia,ExampleType:()=>lli,ExampleTypeReference:()=>kj,ExampleTypeReferenceShape:()=>hia,ExampleTypeShape:()=>z2n,ExampleUndiscriminatedUnionType:()=>lia,ExampleUnionType:()=>cia,FloatType:()=>Jra,IntegerType:()=>Vra,IntegerValidationRules:()=>Ura,JsonEncoding:()=>Mra,Literal:()=>aia,LongType:()=>Wra,MapType:()=>oia,NamedType:()=>iia,NamedTypeDefault:()=>nia,ObjectProperty:()=>iQ,ObjectTypeDeclaration:()=>ona,PrimitiveType:()=>A2n,PrimitiveTypeV1:()=>Lra,PrimitiveTypeV2:()=>nna,ProtoEncoding:()=>xra,ResolvedNamedType:()=>Fra,ResolvedTypeReference:()=>ina,ShapeType:()=>Rra,SingleUnionType:()=>cna,SingleUnionTypeProperties:()=>sna,SingleUnionTypeProperty:()=>una,Source:()=>vna,StringType:()=>Qra,StringValidationRules:()=>Xra,Type:()=>pna,TypeDeclaration:()=>bna,TypeReference:()=>Hb,Uint64Type:()=>$ra,UintType:()=>Hra,UndiscriminatedUnionMember:()=>fna,UndiscriminatedUnionTypeDeclaration:()=>dna,UnionTypeDeclaration:()=>lna,UuidType:()=>ena});var nia=Jr.union("type",{enum:qDr}).transform({transform:e=>{switch(e.type){case"enum":return f2n.enum(e);default:return e}},untransform:({_visit:e,...t})=>t});var iia=Jr.objectWithoutOptionalProperties({typeId:JV,fernFilepath:DTe,name:vy,default:nia.optional(),inline:Jr.boolean().optional()});var Hb=Jr.union(Jr.discriminant("type","_type"),{container:Jr.object({container:Jr.lazy(()=>N2n)}),named:iia,primitive:Jr.object({primitive:A2n}),unknown:Jr.object({})}).transform({transform:e=>{switch(e.type){case"container":return S2.container(e.container);case"named":return S2.named(e);case"primitive":return S2.primitive(e.primitive);case"unknown":return S2.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var FEl=Jr.objectWithoutOptionalProperties({default:qDr.optional(),name:GA});var aia=Jr.union("type",{string:Jr.object({string:Jr.string()}),boolean:Jr.object({boolean:Jr.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return OTe.string(e.string);case"boolean":return OTe.boolean(e.boolean);default:return e}},untransform:({_visit:e,...t})=>t});var N2n=Jr.union(Jr.discriminant("type","_type"),{list:Jr.object({list:Jr.lazy(()=>Hb)}),map:Jr.lazyObject(()=>oia),optional:Jr.object({optional:Jr.lazy(()=>Hb)}),set:Jr.object({set:Jr.lazy(()=>Hb)}),literal:Jr.object({literal:aia})}).transform({transform:e=>{switch(e.type){case"list":return MC.list(e.list);case"map":return MC.map(e);case"optional":return MC.optional(e.optional);case"set":return MC.set(e.set);case"literal":return MC.literal(e.literal);default:return e}},untransform:({_visit:e,...t})=>t});var oia=Jr.objectWithoutOptionalProperties({keyType:Jr.lazy(()=>Hb),valueType:Jr.lazy(()=>Hb)});var uia=Jr.objectWithoutOptionalProperties({value:Um});var z2n=Jr.union("type",{alias:Jr.lazyObject(()=>sia),enum:uia,object:Jr.lazyObject(()=>F2n),union:Jr.lazyObject(()=>cia),undiscriminatedUnion:Jr.lazyObject(()=>lia)}).transform({transform:e=>{switch(e.type){case"alias":return mM.alias(e);case"enum":return mM.enum(e);case"object":return mM.object(e);case"union":return mM.union(e);case"undiscriminatedUnion":return mM.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var sia=Jr.objectWithoutOptionalProperties({value:Jr.lazyObject(()=>kj)});var F2n=Jr.objectWithoutOptionalProperties({properties:Jr.list(Jr.lazyObject(()=>fia))});var fia=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj),originalTypeDeclaration:GA});var cia=Jr.objectWithoutOptionalProperties({discriminant:Um,singleUnionType:Jr.lazyObject(()=>dia)});var lia=Jr.objectWithoutOptionalProperties({index:Jr.number(),singleUnionType:Jr.lazyObject(()=>kj)});var dia=Jr.objectWithoutOptionalProperties({wireDiscriminantValue:Um,shape:Jr.lazy(()=>pia)});var pia=Jr.union("type",{samePropertiesAsObject:Jr.lazyObject(()=>_ia),singleProperty:Jr.lazyObject(()=>kj),noProperties:Jr.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return D3.samePropertiesAsObject(e);case"singleProperty":return D3.singleProperty(e);case"noProperties":return D3.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var kj=Jr.objectWithoutOptionalProperties({shape:Jr.lazy(()=>hia)}).extend(OBt);var yia=Jr.objectWithoutOptionalProperties({datetime:Jr.date(),raw:Jr.string().optional()});var L2n=Jr.union("type",{integer:Jr.object({integer:Jr.number()}),long:Jr.object({long:Jr.number()}),uint:Jr.object({uint:Jr.number()}),uint64:Jr.object({uint64:Jr.number()}),float:Jr.object({float:Jr.number()}),double:Jr.object({double:Jr.number()}),boolean:Jr.object({boolean:Jr.boolean()}),string:Jr.object({string:wta}),date:Jr.object({date:Jr.string()}),datetime:yia,uuid:Jr.object({uuid:Jr.string()}),base64:Jr.object({base64:Jr.string()}),bigInteger:Jr.object({bigInteger:Jr.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Xv.integer(e.integer);case"long":return Xv.long(e.long);case"uint":return Xv.uint(e.uint);case"uint64":return Xv.uint64(e.uint64);case"float":return Xv.float(e.float);case"double":return Xv.double(e.double);case"boolean":return Xv.boolean(e.boolean);case"string":return Xv.string(e.string);case"date":return Xv.date(e.date);case"datetime":return Xv.datetime(e);case"uuid":return Xv.uuid(e.uuid);case"base64":return Xv.base64(e.base64);case"bigInteger":return Xv.bigInteger(e.bigInteger);default:return e}},untransform:({_visit:e,...t})=>t});var hia=Jr.union("type",{primitive:Jr.object({primitive:L2n}),container:Jr.object({container:Jr.lazy(()=>via)}),unknown:Jr.object({unknown:Jr.unknown()}),named:Jr.lazyObject(()=>bia)}).transform({transform:e=>{switch(e.type){case"primitive":return Q0.primitive(e.primitive);case"container":return Q0.container(e.container);case"unknown":return Q0.unknown(e.unknown);case"named":return Q0.named(e);default:return e}},untransform:({_visit:e,...t})=>t});var gia=Jr.objectWithoutOptionalProperties({literal:L2n});var via=Jr.union("type",{list:Jr.lazyObject(()=>mia),set:Jr.lazyObject(()=>Oia),optional:Jr.lazyObject(()=>Pia),map:Jr.lazyObject(()=>jia),literal:gia}).transform({transform:e=>{switch(e.type){case"list":return _T.list(e);case"set":return _T.set(e);case"optional":return _T.optional(e);case"map":return _T.map(e);case"literal":return _T.literal(e);default:return e}},untransform:({_visit:e,...t})=>t});var mia=Jr.objectWithoutOptionalProperties({list:Jr.list(Jr.lazyObject(()=>kj)),itemType:Jr.lazy(()=>Hb)});var Oia=Jr.objectWithoutOptionalProperties({set:Jr.list(Jr.lazyObject(()=>kj)),itemType:Jr.lazy(()=>Hb)});var Pia=Jr.objectWithoutOptionalProperties({optional:Jr.lazyObject(()=>kj).optional(),valueType:Jr.lazy(()=>Hb)});var jia=Jr.objectWithoutOptionalProperties({map:Jr.list(Jr.lazyObject(()=>wia)),keyType:Jr.lazy(()=>Hb),valueType:Jr.lazy(()=>Hb)});var wia=Jr.objectWithoutOptionalProperties({key:Jr.lazyObject(()=>kj),value:Jr.lazyObject(()=>kj)});var bia=Jr.objectWithoutOptionalProperties({typeName:GA,shape:Jr.lazy(()=>z2n)});var _ia=Jr.objectWithoutOptionalProperties({typeId:JV,object:Jr.lazyObject(()=>F2n)});var fKo={};Wb(fKo,{VariableDeclaration:()=>Jna,VariableId:()=>g2n});var dKo={};Wb(dKo,{ExampleWebhookCall:()=>Dna,InlinedWebhookPayload:()=>Pna,InlinedWebhookPayloadProperty:()=>Ona,Webhook:()=>Sna,WebhookGroup:()=>Ena,WebhookHttpMethod:()=>mna,WebhookName:()=>gna,WebhookPayload:()=>wna,WebhookPayloadReference:()=>jna});var pKo={};Wb(pKo,{ExampleWebSocketMessage:()=>Bna,ExampleWebSocketMessageBody:()=>zna,ExampleWebSocketSession:()=>Ina,InlinedWebSocketMessageBody:()=>qna,InlinedWebSocketMessageBodyProperty:()=>Tna,WebSocketChannel:()=>Rna,WebSocketMessage:()=>Nna,WebSocketMessageBody:()=>Ana,WebSocketMessageBodyReference:()=>Cna,WebSocketMessageId:()=>B2n,WebSocketMessageOrigin:()=>xna,WebSocketName:()=>Mna});var uQ={integer:"integer",long:"long",uint:"uint",uint64:"uint64",float:"float",double:"double",boolean:"boolean",string:"string",datetime:"datetime",base64:"base64",uuid:"uuid",date:"date",bigint:"bigint",unknown:"unknown"};var Eje={MAP:/^map<\s*([^,]*)\s*,\s*(.*)\s*>$/,LIST:/^list<\s*(.*)\s*>$/,SET:/^set<\s*(.*)\s*>$/,OPTIONAL:/^optional<\s*(.*)\s*>$/,LITERAL:/^literal<\s*(?:"(.*)"|(true|false))\s*>$/};function wZr({type:e,_default:t,validation:r,visitor:n}){switch(e){case uQ.integer:{let c=r??void 0;return n.primitive({v1:ID.Integer,v2:gM.integer({default:t??void 0,validation:c!=null?{min:c.min,max:c.max,exclusiveMin:c.exclusiveMin,exclusiveMax:c.exclusiveMax,multipleOf:c.multipleOf}:void 0})})}case uQ.double:{let c=r??void 0;return n.primitive({v1:ID.Double,v2:gM.double({default:t??void 0,validation:c!=null?{min:c.min,max:c.max,exclusiveMin:c.exclusiveMin,exclusiveMax:c.exclusiveMax,multipleOf:c.multipleOf}:void 0})})}case uQ.string:{let c=r??void 0;return n.primitive({v1:ID.String,v2:gM.string({default:t??void 0,validation:c!=null?{format:c.format,pattern:c.pattern,minLength:c.minLength,maxLength:c.maxLength}:void 0})})}case uQ.float:return n.primitive({v1:ID.Float,v2:void 0});case uQ.long:return n.primitive({v1:ID.Long,v2:void 0});case uQ.boolean:return n.primitive({v1:ID.Boolean,v2:void 0});case uQ.datetime:return n.primitive({v1:ID.DateTime,v2:void 0});case uQ.date:return n.primitive({v1:ID.Date,v2:void 0});case uQ.uuid:return n.primitive({v1:ID.Uuid,v2:void 0});case uQ.base64:return n.primitive({v1:ID.Base64,v2:void 0});case uQ.bigint:return n.primitive({v1:ID.BigInteger,v2:void 0});case uQ.uint:return n.primitive({v1:ID.Uint,v2:void 0});case uQ.uint64:return n.primitive({v1:ID.Uint64,v2:void 0});case uQ.unknown:return n.unknown()}let i=e.match(Eje.MAP);if((i==null?void 0:i[1])!=null&&i[2]!=null)return n.map({keyType:i[1],valueType:i[2]});let a=e.match(Eje.LIST);if((a==null?void 0:a[1])!=null)return n.list(a[1]);let u=e.match(Eje.SET);if((u==null?void 0:u[1])!=null)return n.set(u[1]);let f=e.match(Eje.OPTIONAL);if((f==null?void 0:f[1])!=null)return n.optional(f[1]);let d=e.match(Eje.LITERAL);if((d==null?void 0:d[1])!=null)return n.literal(OTe.string(d[1]));if((d==null?void 0:d[2])!=null){let c=d[2];switch(c){case"false":return n.literal(OTe.boolean(!1));case"true":return n.literal(OTe.boolean(!0));default:throw new Error(`Unsupported literal value: ${c}`)}}return n.named(e)}var LEl="bytes";function cNr(e){if(e===LEl)return{isOptional:!1};let t=e.match(Eje.OPTIONAL);if((t==null?void 0:t[1])===LEl)return{isOptional:!0}}function fli(e){let t=typeof e=="string"?e:typeof e.body=="string"?e.body:void 0;if(t!=null)return cNr(t)}var _Ko="file";function UEl(e){let t=e.match(Eje.LIST);return(t==null?void 0:t[1])===_Ko}function STe(e){if(e===_Ko)return{isOptional:!1,isArray:!1};let t=e.match(Eje.OPTIONAL);if((t==null?void 0:t[1])!==void 0){if(t[1]===_Ko)return{isOptional:!0,isArray:!1};if(UEl(t[1]))return{isOptional:!0,isArray:!0}}if(UEl(e))return{isOptional:!1,isArray:!0}}function htP(e){var t;return typeof e=="string"?!1:!!((((t=sA.parse(e["content-type"]))==null?void 0:t.isMultiPartFormData())??!1)||e.body!=null&&dA(e.body)&&Object.values(e.body.properties??[]).some(r=>(typeof r=="string"?r:r.type)==="file"))}function DZr(e){if(!(!htP(e)||e.body==null)&&e.name!=null&&e.body!=null&&dA(e.body))return ytP(e.name,e.body)}function ytP(e,t){let r=Object.entries(t.properties??[]).reduce((n,[i,a])=>{let u=typeof a!="string"?a.docs:void 0,f=typeof a!="string"?a["content-type"]:void 0,d=STe(typeof a=="string"?a:a.type);return d!=null?n.push({isFile:!0,key:i,docs:u,isOptional:d.isOptional,isArray:d.isArray,contentType:f}):n.push({isFile:!1,key:i,propertyType:a,docs:u,contentType:f}),n},[]);return t["extra-properties"],{name:e,extends:t.extends,properties:r}}var VEl="text";function dli(e){if(e===VEl)return{isOptional:!1};let t=e.match(Eje.OPTIONAL);if((t==null?void 0:t[1])===VEl)return{isOptional:!0}}function BJ({type:e,_default:t,validation:r,visitor:n}){return wZr({type:e,_default:t,validation:r,visitor:{primitive:n.primitive,map:({keyType:i,valueType:a})=>n.map({keyType:BJ({type:i,_default:void 0,validation:void 0,visitor:n}),valueType:BJ({type:a,_default:void 0,validation:void 0,visitor:n})}),list:i=>n.list(BJ({type:i,_default:void 0,validation:void 0,visitor:n})),set:i=>n.set(BJ({type:i,_default:void 0,validation:void 0,visitor:n})),optional:i=>n.optional(BJ({type:i,_default:t,validation:r,visitor:n})),literal:n.literal,named:n.named,unknown:n.unknown}})}function hKo(e,t){if(vtP(e))return t.sdk(e);if(btP(e))return t.language(e);Ol(e)}function vtP(e){return e.sdk!=null}function btP(e){return e.language!=null}function WEl(e){return e["response-stream"]!=null&&(typeof e["response-stream"]=="string"||e["response-stream"].format==null||e["response-stream"].format==="json")}function HEl(e){return e["response-stream"]!=null&&typeof e["response-stream"]!="string"&&e["response-stream"].format==="sse"}function SZr(e,t,r){return gtP(e,t)?r.stream(t):mtP(e,t)?r.events(t):r.body(t)}function gtP(e,t){return t.stream!==void 0&&WEl(e)}function mtP(e,t){return t.stream!==void 0&&HEl(e)}function pli(e,t){if($El(e))return t.single(e);if(JEl(e))return t.any(e);Ol(e)}function $El(e){return typeof e=="string"||e.scheme!=null}function JEl(e){let[t,...r]=Object.keys(e);return t==="any"&&r.length===0}function yKo(e,t){if(GEl(e))return t.header(e);switch(e.scheme){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"oauth":return t.oauth(e);default:Ol(e)}}function GEl(e){return e.header!=null}function CDr(e,t){if(KEl(e))return t.singleBaseUrl(e);if(U2n(e))return t.multipleBaseUrls(e);Ol(e)}function KEl(e){return typeof e=="string"||"url"in e}function U2n(e){return typeof e!="string"&&"urls"in e}function V2n(e){return typeof e=="string"?e.startsWith("$"):"variable"in e}function y5(e,t){if(W2n(e))return t.alias(e);if(lNr(e))return t.discriminatedUnion(e);if(LE(e))return t.object(e);if(H2n(e))return t.undiscriminatedUnion(e);if(SCt(e))return t.enum(e);Ol(e)}function W2n(e){return typeof e=="string"||e.type!=null}function LE(e){return e.extends!=null||e.properties!=null}function lNr(e){return e.union!=null&&e.discriminated==null}function H2n(e){let t=e;return t.union!=null&&t.discriminated!=null}function SCt(e){return e.enum!=null}var _li=class{REFERENCE_REGEX=/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/]*)$/;validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let n=t.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};var OtP=nr.strictObject({"optional-additional-properties":nr.optional(nr.boolean())}),PtP=nr.strictObject({openapi:nr.string(),overrides:nr.string().optional(),namespace:nr.string().optional(),settings:nr.optional(OtP)}),jtP=nr.strictObject({"optional-additional-properties":nr.optional(nr.boolean())}),wtP=nr.strictObject({asyncapi:nr.string(),overrides:nr.string().optional(),namespace:nr.string().optional(),settings:nr.optional(jtP)}),DtP=nr.union([PtP,wtP]),YEl=nr.object({auth:nr.optional(t8.ApiAuthSchema),specs:nr.array(DtP)}).extend(t8.WithHeadersSchema.shape).extend(t8.WithEnvironmentsSchema.shape);var bKo=nr.string().describe("Path to the OpenAPI, AsyncAPI or Fern Definition"),EZr=nr.object({"use-title":nr.optional(nr.boolean()).describe("Whether to use the titles of the schemas within an OpenAPI definition as the names of the types within Fern. Defaults to true."),unions:nr.optional(nr.enum(["v1"])).describe("What version of union generation to use, this will grow over time. Defaults to v0."),"message-naming":nr.optional(nr.enum(["v1","v2"])).describe("What version of message naming to use for AsyncAPI messages, this will grow over time. Defaults to v1.")}),QEl=nr.object({path:bKo,origin:nr.optional(nr.string()).describe("The URL of the API definition origin, from which the file should be polled."),overrides:nr.optional(nr.string()).describe("Path to the OpenAPI or AsyncAPI overrides"),audiences:nr.optional(nr.array(nr.string())).describe("Audiences that you would like to filter to"),settings:nr.optional(EZr)}),StP=nr.strictObject({root:nr.string().describe("The path to the `.proto` directroy root (e.g. `proto`)."),target:nr.string().describe("The path to the target `.proto` file that defines the API (e.g. `proto/user/v1/user.proto`)."),overrides:nr.optional(nr.string()).describe("Path to the overrides configuration"),"local-generation":nr.optional(nr.boolean()).describe("Whether to compile the `.proto` files locally. By default, we generate remotely.")}),ZEl=nr.strictObject({proto:StP}),EtP=nr.array(nr.union([bKo,QEl,ZEl])),XEl=nr.union([bKo,QEl,EtP,ZEl]),kEl=nr.union([XEl,nr.strictObject({namespaces:nr.record(XEl)}),YEl]);var eMl=nr.strictObject({location:nr.literal("local-file-system"),path:nr.string()});var MtP=nr.strictObject({keyId:nr.string(),password:nr.string(),secretKey:nr.string()}),tMl=nr.strictObject({location:nr.literal("maven"),url:nr.optional(nr.string()),coordinate:nr.string(),username:nr.optional(nr.string()),password:nr.optional(nr.string()),signature:nr.optional(MtP)});var rMl=nr.strictObject({location:nr.literal("npm"),url:nr.optional(nr.string()),"package-name":nr.string(),token:nr.optional(nr.string())});var nMl=nr.strictObject({location:nr.literal("nuget"),url:nr.optional(nr.string()),"package-name":nr.string(),"api-key":nr.optional(nr.string())});var iMl=nr.strictObject({location:nr.literal("postman"),"api-key":nr.string(),"workspace-id":nr.string(),"collection-id":nr.string().optional()});var xtP=nr.strictObject({name:nr.string(),email:nr.string()}),$2n=nr.strictObject({description:nr.optional(nr.string()),authors:nr.optional(nr.array(xtP))});var aMl=$2n.extend({keywords:nr.optional(nr.array(nr.string())),"documentation-link":nr.optional(nr.string()),"homepage-link":nr.optional(nr.string())});var oMl=nr.strictObject({location:nr.literal("pypi"),url:nr.optional(nr.string()),"package-name":nr.string(),token:nr.optional(nr.string()),username:nr.optional(nr.string()),password:nr.optional(nr.string()),metadata:nr.optional(aMl)});var uMl=nr.strictObject({location:nr.literal("rubygems"),url:nr.optional(nr.string()),"package-name":nr.string(),"api-key":nr.optional(nr.string())});var sMl=nr.discriminatedUnion("location",[rMl,tMl,oMl,iMl,eMl,nMl,uMl]);var cMl=nr.strictObject({custom:nr.string()});var fNr=nr.union([nr.enum(["MIT","Apache-2.0"]),cMl]);var gKo=nr.strictObject({"package-description":nr.optional(nr.string()),email:nr.optional(nr.string()),"reference-url":nr.optional(nr.string()),author:nr.optional(nr.string()),license:nr.optional(fNr)});var lMl=nr.strictObject({path:nr.string().describe("The path to the generated snippets file.")});var fMl=nr.strictObject({repository:nr.string(),license:nr.optional(fNr),mode:nr.optional(nr.enum(["commit","release"]))});var J2n="reviewers",dMl=nr.strictObject({name:nr.string()}),G2n=nr.strictObject({teams:nr.optional(nr.array(dMl)),users:nr.optional(nr.array(dMl))});var pMl=nr.strictObject({repository:nr.string(),branch:nr.optional(nr.string()),license:nr.optional(fNr),mode:nr.literal("pull-request"),[J2n]:nr.optional(G2n)});var _Ml=nr.strictObject({repository:nr.string(),license:nr.optional(fNr),mode:nr.literal("push"),branch:nr.optional(nr.string())});var hMl=nr.union([fMl,pMl,_Ml]);var yMl=nr.strictObject({name:nr.string(),version:nr.string(),output:nr.optional(sMl),github:nr.optional(hMl),config:nr.unknown(),metadata:nr.optional(gKo),keywords:nr.optional(nr.array(nr.string())),snippets:nr.optional(lMl),"ir-version":nr.optional(nr.string()),"smart-casing":nr.optional(nr.boolean()),api:nr.optional(nr.object({settings:nr.optional(EZr)})),"disable-examples":nr.optional(nr.boolean()),"publish-metadata":nr.optional(gKo)});var vMl=nr.strictObject({audiences:nr.optional(nr.array(nr.string())),generators:nr.array(yMl),metadata:nr.optional($2n),[J2n]:nr.optional(G2n)});var TtP="disable-examples",bMl=nr.strictObject({path:nr.string(),origin:nr.optional(nr.string()),overrides:nr.optional(nr.string()),[TtP]:nr.optional(nr.boolean()),settings:EZr});var gMl=nr.union([bMl,nr.string()]);var mMl=nr.strictObject({method:nr.string(),path:nr.string(),stream:nr.optional(nr.boolean())});var mKo=nr.union([nr.string().describe("Endpoint name in 'POST /users' format"),mMl]);var OMl=nr.strictObject({bannerLink:nr.optional(nr.string()),introduction:nr.optional(nr.string()),apiReferenceLink:nr.optional(nr.string()),defaultEndpoint:nr.optional(mKo).describe("If set, use this endpoint's snippet as the default whenever possible"),features:nr.optional(nr.record(nr.array(mKo))).describe("Specifies a list of endpoints associated with the feature")});var PMl=nr.strictObject({username:nr.string(),email:nr.string(),token:nr.string()});var jMl=nr.strictObject({github:nr.optional(PMl)});var kQr="default-group",hli="openapi",OKo="openapi-overrides",yli="spec-origin",vli="async-api",PKo="api-settings",wMl=nr.strictObject({"auth-schemes":nr.optional(nr.record(t8.AuthSchemeDeclarationSchema)),api:nr.optional(kEl),whitelabel:nr.optional(jMl),metadata:nr.optional($2n),readme:nr.optional(OMl),[kQr]:nr.optional(nr.string()),groups:nr.optional(nr.record(vMl)),[J2n]:nr.optional(G2n),[hli]:nr.optional(gMl),[OKo]:nr.optional(nr.string()),[yli]:nr.optional(nr.string()),[vli]:nr.optional(nr.string()),[PKo]:nr.optional(EZr)});async function MMl({absolutePathToGeneratorsConfiguration:e,rawGeneratorsConfiguration:t}){let r=qMl(t.metadata),n=t.readme,i=await CtP(t);return{absolutePathToConfiguration:e,api:i,rawConfiguration:t,defaultGroup:t["default-group"],reviewers:t.reviewers,groups:t.groups!=null?await Promise.all(Object.entries(t.groups).map(([a,u])=>AtP({absolutePathToGeneratorsConfiguration:e,groupName:a,group:u,maybeTopLevelMetadata:r,maybeTopLevelReviewers:t.reviewers,readme:n}))):[],whitelabel:t.whitelabel!=null&&t.whitelabel.github!=null?{github:t.whitelabel.github}:void 0}}async function DMl(e,t){var n,i,a,u,f,d,c,o;let r=[];if(e!=null)if(typeof e=="string")r.push({schema:{type:"oss",path:e},origin:void 0,overrides:void 0,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}});else if(Tci(e))r.push({schema:{type:"protobuf",root:e.proto.root,target:e.proto.target,localGeneration:e.proto["local-generation"]??!1},origin:void 0,overrides:e.proto.overrides,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}});else if(Array.isArray(e))for(let l of e)typeof l=="string"?r.push({schema:{type:"oss",path:l},origin:void 0,overrides:void 0,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}):Tci(l)?r.push({schema:{type:"protobuf",root:l.proto.root,target:l.proto.target,localGeneration:l.proto["local-generation"]??!1},origin:void 0,overrides:l.proto.overrides,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}):r.push({schema:{type:"oss",path:l.path},origin:l.origin,overrides:l.overrides,audiences:l.audiences,settings:{shouldUseTitleAsName:(n=l.settings)==null?void 0:n["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:((i=l.settings)==null?void 0:i.unions)==="v1",asyncApiMessageNaming:(a=l.settings)==null?void 0:a["message-naming"],shouldUseOptionalAdditionalProperties:void 0}});else r.push({schema:{type:"oss",path:e.path},origin:e.origin,overrides:e.overrides,audiences:e.audiences,settings:{shouldUseTitleAsName:(u=e.settings)==null?void 0:u["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:((f=e.settings)==null?void 0:f.unions)==="v1",asyncApiMessageNaming:(d=e.settings)==null?void 0:d["message-naming"],shouldUseOptionalAdditionalProperties:void 0}});else{let l=t[hli],g=t[yli],O=t[OKo],j=t[vli],S=t[PKo];l!=null&&typeof l=="string"?r.push({schema:{type:"oss",path:l},origin:g,overrides:O,audiences:[],settings:{shouldUseTitleAsName:S==null?void 0:S["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:(S==null?void 0:S.unions)==="v1",asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}):l!=null&&r.push({schema:{type:"oss",path:l.path},origin:l.origin,overrides:l.overrides,audiences:[],settings:{shouldUseTitleAsName:(c=l.settings)==null?void 0:c["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:((o=l.settings)==null?void 0:o.unions)==="v1",asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}),j!=null&&r.push({schema:{type:"oss",path:j},origin:g,overrides:void 0,audiences:[],settings:{shouldUseTitleAsName:S==null?void 0:S["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:(S==null?void 0:S.unions)==="v1",asyncApiMessageNaming:S==null?void 0:S["message-naming"],shouldUseOptionalAdditionalProperties:void 0}})}return r}async function qtP({apiConfiguration:e,rawConfiguration:t}){var a,u;let r=[],n={};for(let f of e.specs)if(bZi(f)){let d={schema:{type:"oss",path:f.openapi},origin:void 0,overrides:f.overrides,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:((a=f.settings)==null?void 0:a["optional-additional-properties"])??!0}};f.namespace==null?r.push(d):(n[u=f.namespace]??(n[u]=[]),n[f.namespace].push(d))}let i={"auth-schemes":e.auth!=null?Object.fromEntries(Object.entries(t["auth-schemes"]??{}).filter(([f,d])=>e.auth==null?!1:pli(e.auth,{any:c=>c.any.includes(f),single:c=>c===f}))):void 0,...e};return Object.keys(n).length===0?{type:"singleNamespace",definitions:r,...i}:{type:"multiNamespace",rootDefinitions:r,definitions:n,...i}}async function CtP(e){let t=e.api;if(t!=null&&vZi(t))return qtP({apiConfiguration:t,rawConfiguration:e});if(RO(t)&&"namespaces"in t){let r={};for(let[n,i]of Object.entries(t.namespaces))r[n]=await DMl(i,e);return{type:"multiNamespace",rootDefinitions:void 0,definitions:r}}return{type:"singleNamespace",definitions:await DMl(t,e)}}async function AtP({absolutePathToGeneratorsConfiguration:e,groupName:t,group:r,maybeTopLevelMetadata:n,maybeTopLevelReviewers:i,readme:a}){let u=qMl(r.metadata);return{groupName:t,reviewers:r.reviewers,audiences:r.audiences==null?{type:"all"}:{type:"select",audiences:r.audiences},generators:await Promise.all(r.generators.map(f=>NtP({absolutePathToGeneratorsConfiguration:e,generator:f,maybeTopLevelMetadata:n,maybeGroupLevelMetadata:u,maybeTopLevelReviewers:i,maybeGroupLevelReviewers:r.reviewers,readme:a})))}}async function NtP({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n,maybeGroupLevelReviewers:i,maybeTopLevelReviewers:a,readme:u}){var f,d,c;return{raw:t,name:t.name,version:t.version,config:t.config,outputMode:await ItP({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n,maybeGroupLevelReviewers:i,maybeTopLevelReviewers:a}),keywords:t.keywords,smartCasing:t["smart-casing"]??!1,disableExamples:t["disable-examples"]??!1,absolutePathToLocalOutput:((f=t.output)==null?void 0:f.location)==="local-file-system"?j2(Cg(e),t.output.path):void 0,absolutePathToLocalSnippets:((d=t.snippets)==null?void 0:d.path)!=null?j2(Cg(e),t.snippets.path):void 0,language:LtP(t.name),irVersionOverride:t["ir-version"]??void 0,publishMetadata:ztP({generatorInvocation:t}),readme:u,settings:((c=t.api)==null?void 0:c.settings)??void 0}}function ztP({generatorInvocation:e}){let t=e["publish-metadata"];if(t!=null)return{packageDescription:t["package-description"],publisherEmail:t.email,publisherName:t.author,referenceUrl:t["reference-url"]};if(e.metadata!=null)return{packageDescription:e.metadata["package-description"],publisherEmail:e.metadata.email,publisherName:e.metadata.author,referenceUrl:e.metadata["reference-url"]}}function xMl({pypiOutputMetadata:e,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r}){let n;return e!=null&&(n=VtP(e),n={...r,...t,...n}),n}function BtP({topLevelReviewers:e,groupLevelReviewers:t,outputModeReviewers:r}){let n=new Set,i=new Set,a=[],u=[...(e==null?void 0:e.teams)??[],...(t==null?void 0:t.teams)??[],...(r==null?void 0:r.teams)??[]],f=[...(e==null?void 0:e.users)??[],...(t==null?void 0:t.users)??[],...(r==null?void 0:r.users)??[]];for(let d of u)n.has(d.name)||(a.push(jKo.GithubPullRequestReviewer.team({name:d.name})),n.add(d.name));for(let d of f)i.has(d.name)||(a.push(jKo.GithubPullRequestReviewer.user({name:d.name})),i.add(d.name));return a}async function ItP({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r={},maybeTopLevelMetadata:n={},maybeGroupLevelReviewers:i,maybeTopLevelReviewers:a}){let u=t.snippets!=null&&t.snippets.path!=="";if(t.github!=null){let f=t.github.repository.indexOf("/"),d=t.github.repository.slice(0,f),c=t.github.repository.slice(f+1),o=t.output!=null?FtP(t.output,r,n):void 0,l=UtP(t),g=l!=null?await RtP({absolutePathToGeneratorsConfiguration:e,githubLicense:l}):void 0,O=t.github.mode??"release";switch(O){case"commit":case"release":return JT.FernFiddle.OutputMode.githubV2(JT.FernFiddle.GithubOutputModeV2.commitAndRelease({owner:d,repo:c,license:g,publishInfo:o,downloadSnippets:u}));case"pull-request":{let j=BtP({topLevelReviewers:a,groupLevelReviewers:i,outputModeReviewers:t.github.reviewers});return JT.FernFiddle.OutputMode.githubV2(JT.FernFiddle.GithubOutputModeV2.pullRequest({owner:d,repo:c,license:g,publishInfo:o,downloadSnippets:u,reviewers:j}))}case"push":return JT.FernFiddle.OutputMode.githubV2(JT.FernFiddle.GithubOutputModeV2.push({owner:d,repo:c,branch:t.github.mode==="push"?t.github.branch:void 0,license:g,publishInfo:o,downloadSnippets:u}));default:Ol(O)}}if(t.output==null)return JT.FernFiddle.remoteGen.OutputMode.publish({registryOverrides:{}});switch(t.output.location){case"local-file-system":return JT.FernFiddle.OutputMode.downloadFiles({downloadSnippets:u});case"npm":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://registry.npmjs.org",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:u}));case"maven":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.mavenOverride({registryUrl:TMl(t.output),username:t.output.username??"",password:t.output.password??"",coordinate:t.output.coordinate,signature:t.output.signature!=null?{keyId:t.output.signature.keyId,secretKey:t.output.signature.secretKey,password:t.output.signature.password}:void 0,downloadSnippets:u}));case"postman":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.postman({apiKey:t.output["api-key"],workspaceId:t.output["workspace-id"]}));case"pypi":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.pypiOverride({registryUrl:t.output.url??"https://upload.pypi.org/legacy/",username:t.output.token!=null?"__token__":t.output.password??"",password:t.output.token??t.output.password??"",coordinate:t.output["package-name"],downloadSnippets:u,pypiMetadata:xMl({pypiOutputMetadata:t.output.metadata,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n})}));case"nuget":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.nugetOverride({registryUrl:t.output.url??"https://nuget.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));case"rubygems":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.rubyGemsOverride({registryUrl:t.output.url??"https://rubygems.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));default:Ol(t.output)}}async function RtP({absolutePathToGeneratorsConfiguration:e,githubLicense:t}){if(typeof t=="string")switch(t){case"MIT":return JT.FernFiddle.GithubLicense.basic({id:JT.FernFiddle.GithubLicenseId.Mit});case"Apache-2.0":return JT.FernFiddle.GithubLicense.basic({id:JT.FernFiddle.GithubLicenseId.Apache});default:Ol(t)}let r=pf(I_.of(EMl.default.dirname(e)),zs.of(t.custom)),n=await(0,SMl.readFile)(r);return JT.FernFiddle.GithubLicense.custom({contents:n.toString()})}function FtP(e,t,r){switch(e.location){case"local-file-system":throw new Error("Cannot use local-file-system with github publishing");case"npm":return JT.FernFiddle.GithubPublishInfo.npm({registryUrl:e.url??"https://registry.npmjs.org",packageName:e["package-name"],token:e.token});case"maven":return JT.FernFiddle.GithubPublishInfo.maven({registryUrl:TMl(e),coordinate:e.coordinate,credentials:e.username!=null&&e.password!=null?{username:e.username,password:e.password}:void 0,signature:e.signature!=null?{keyId:e.signature.keyId,password:e.signature.password,secretKey:e.signature.secretKey}:void 0});case"postman":return JT.FernFiddle.GithubPublishInfo.postman({apiKey:e["api-key"],workspaceId:e["workspace-id"]});case"pypi":return JT.FernFiddle.GithubPublishInfo.pypi({registryUrl:e.url??"https://upload.pypi.org/legacy/",packageName:e["package-name"],credentials:e.token!=null?{username:"__token__",password:e.token}:{username:e.username??"",password:e.password??""},pypiMetadata:xMl({pypiOutputMetadata:e.metadata,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r})});case"nuget":return JT.FernFiddle.GithubPublishInfo.nuget({registryUrl:e.url??"https://nuget.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"rubygems":return JT.FernFiddle.GithubPublishInfo.rubygems({registryUrl:e.url??"https://rubygems.org/",packageName:e["package-name"],apiKey:e["api-key"]});default:Ol(e)}}function LtP(e){if(e.includes("typescript"))return K5t.TYPESCRIPT;if(e.includes("java")||e.includes("spring"))return K5t.JAVA;if(e.includes("python")||e.includes("fastapi")||e.includes("pydantic"))return K5t.PYTHON;if(e.includes("go"))return K5t.GO;if(e.includes("ruby"))return K5t.RUBY;if(e.includes("csharp"))return K5t.CSHARP;if(e.includes("swift"))return K5t.SWIFT}function TMl(e){return e.url!=null?e.url:e.signature!=null?"https://oss.sonatype.org/service/local/staging/deploy/maven2/":"https://s01.oss.sonatype.org/content/repositories/releases/"}function UtP(e){var t,r,n;return((t=e["publish-metadata"])==null?void 0:t.license)!=null?e["publish-metadata"].license:((r=e.metadata)==null?void 0:r.license)!=null?e.metadata.license:(n=e.github)==null?void 0:n.license}function qMl(e){var t;return e!=null?{description:e.description,authors:(t=e.authors)==null?void 0:t.map(r=>({name:r.name,email:r.email}))}:void 0}function VtP(e){var t;return e!=null?{description:e.description,authors:(t=e.authors)==null?void 0:t.map(r=>({name:r.name,email:r.email})),keywords:e.keywords,documentationLink:e["documentation-link"],homepageLink:e["homepage-link"]}:void 0}async function wKo({absolutePathToWorkspace:e,context:t}){let r=Dia({absolutePathToWorkspace:e});if(!await Vh(r))return;let n=await(0,CMl.readFile)(r);try{let i=av.load(n.toString());return lMn({schema:wMl,value:i,context:t,filepathBeingParsed:r})}catch(i){if(i instanceof av.YAMLException)t.failAndThrow(`Failed to parse ${AMl.default.relative(process.cwd(),r)}: ${i.reason}`);else throw i}}async function NMl({absolutePathToWorkspace:e,context:t}){let r=await wKo({absolutePathToWorkspace:e,context:t});if(r!=null)return MMl({absolutePathToGeneratorsConfiguration:Dia({absolutePathToWorkspace:e}),rawGeneratorsConfiguration:r})}function Dia({absolutePathToWorkspace:e}){return pf(e,zs.of(a5))}async function yZi({generatorsConfiguration:e,groupName:t=e[kQr],context:r,update:n}){if(t==null)return r.failAndThrow("No group specified.");let i=e.groups??(e.groups={}),a=i[t];if(a==null){let u=i[t]??(i[t]={generators:[]});await n(u,t)}else await n(a,t);return e}var K2n=yu(require("path"),1),FMl=require("url");var zMl=yu(require("process"),1),BMl=yu(require("path"),1),Mia=yu(require("fs"),1),IMl=require("url");var DKo=class{value;next;constructor(t){this.value=t}},PBt,MZr,xZr,bli=class{constructor(){lh(this,PBt,void 0);lh(this,MZr,void 0);lh(this,xZr,void 0);this.clear()}enqueue(t){let r=new DKo(t);yc(this,PBt)?(yc(this,MZr).next=r,pv(this,MZr,r)):(pv(this,PBt,r),pv(this,MZr,r)),X7r(this,xZr)._++}dequeue(){let t=yc(this,PBt);if(!!t)return pv(this,PBt,yc(this,PBt).next),X7r(this,xZr)._--,t.value}clear(){pv(this,PBt,void 0),pv(this,MZr,void 0),pv(this,xZr,0)}get size(){return yc(this,xZr)}*[Symbol.iterator](){let t=yc(this,PBt);for(;t;)yield t.value,t=t.next}};PBt=new WeakMap,MZr=new WeakMap,xZr=new WeakMap;function Sia(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new bli,r=0,n=()=>{r--,t.size>0&&t.dequeue()()},i=async(f,d,c)=>{r++;let o=(async()=>f(...c))();d(o);try{await o}catch{}n()},a=(f,d,c)=>{t.enqueue(i.bind(void 0,f,d,c)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},u=(f,...d)=>new Promise(c=>{a(f,c,d)});return Object.defineProperties(u,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),u}var Eia=class extends Error{constructor(t){super(),this.value=t}},WtP=async(e,t)=>t(await e),HtP=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new Eia(t[0]);return!1};async function SKo(e,t,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=Sia(r),a=[...e].map(f=>[f,i(WtP,f,t)]),u=Sia(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(a.map(f=>u(HtP,f)))}catch(f){if(f instanceof Eia)return f.value;throw f}}var RMl={directory:"isDirectory",file:"isFile"};function $tP(e){if(!Object.hasOwnProperty.call(RMl,e))throw new Error(`Invalid type specified: ${e}`)}var JtP=(e,t)=>t[RMl[e]](),GtP=e=>e instanceof URL?(0,IMl.fileURLToPath)(e):e;async function EKo(e,{cwd:t=zMl.default.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:a}={}){$tP(r),t=GtP(t);let u=n?Mia.promises.stat:Mia.promises.lstat;return SKo(e,async f=>{try{let d=await u(BMl.default.resolve(t,f));return JtP(r,d)}catch{return!1}},{concurrency:i,preserveOrder:a})}var KtP=e=>e instanceof URL?(0,FMl.fileURLToPath)(e):e,YtP=Symbol("findUpStop");async function XtP(e,t={}){let r=K2n.default.resolve(KtP(t.cwd)||""),{root:n}=K2n.default.parse(r),i=K2n.default.resolve(r,t.stopAt||n),a=t.limit||Number.POSITIVE_INFINITY,u=[e].flat(),f=async c=>{if(typeof e!="function")return EKo(u,c);let o=await e(c.cwd);return typeof o=="string"?EKo([o],c):o},d=[];for(;;){let c=await f({...t,cwd:r});if(c===YtP||(c&&d.push(K2n.default.resolve(r,c)),r===i||d.length>=a))break;r=K2n.default.dirname(r)}return d}async function GT(e,t={}){return(await XtP(e,{...t,limit:1}))[0]}async function jBt(e){let t=await GT(e??Yqt,{type:"directory"});if(t==null)return;let r=I_.of(t);if(await Vh(pf(r,zs.of(E8t))))return r}var Puu=yu(ATl(),1),juu=require("fs/promises"),Jif=yu(require("path"),1);var LTl=yu(iXi(),1);var LiP=yu(T3r()),UiP=yu(AQr());var WKo,HKo,$Ko,JKo,ziP=typeof window<"u"&&typeof window.document<"u",BiP=typeof self=="object"&&typeof(self==null?void 0:self.importScripts)=="function"&&(((WKo=self.constructor)===null||WKo===void 0?void 0:WKo.name)==="DedicatedWorkerGlobalScope"||((HKo=self.constructor)===null||HKo===void 0?void 0:HKo.name)==="ServiceWorkerGlobalScope"||(($Ko=self.constructor)===null||$Ko===void 0?void 0:$Ko.name)==="SharedWorkerGlobalScope"),RTl=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",FTl=typeof Bun<"u"&&typeof Bun.version<"u",IiP=typeof process<"u"&&Boolean(process.version)&&Boolean((JKo=process.versions)===null||JKo===void 0?void 0:JKo.node)&&!RTl&&!FTl,RiP=typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative",MCt=FiP();function FiP(){return ziP?{type:"browser",version:window.navigator.userAgent}:BiP?{type:"web-worker"}:RTl?{type:"deno",version:Deno.version.deno}:FTl?{type:"bun",version:Bun.version}:IiP?{type:"node",version:process.versions.node}:RiP?{type:"react-native"}:{type:"unknown"}}var OE7=typeof TextDecoder=="function"?new TextDecoder:void 0,PE7=typeof TextEncoder=="function"?new TextEncoder:void 0,ViP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",WiP=Array.prototype.slice.call(ViP),jE7=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(WiP);var wE7=String.fromCharCode.bind(String),DE7=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):(e,t=r=>r)=>new Uint8Array(Array.prototype.slice.call(e,0).map(t));var ZiP=yu(Nw());var HiP=yu(Nw());var $iP=yu(Nw());var JiP=yu(Nw());var GiP=yu(Nw());var KiP=yu(Nw());var YiP=yu(Nw());var XiP=yu(Nw());var QiP=yu(Nw());function AZr({environment:e="https://registry.buildwithfern.com",token:t}){return new LTl.FernRegistryClient({environment:e,token:t})}var ZAl=yu(QAl(),1);function Qaa({environment:e="https://registry.buildwithfern.com",token:t}){return new ZAl.FernRegistryClient({environment:e,token:t})}var kAl=yu(gZr(),1),e6l=process.env.FERN_FIDDLE_ORIGIN??"https://fiddle-coordinator.buildwithfern.com"??"https://fiddle-coordinator.buildwithfern.com";function iXo(){return e6l}function XDr({token:e}={}){return new kAl.FernFiddleClient({environment:e6l,token:e})}var o8l=yu(E2(),1);function BCt({environment:e="https://venus.buildwithfern.com",token:t}={}){return new o8l.FernVenusApiClient({environment:e,token:t})}var WQo=yu(E2(),1);function u8l(e){if(e.length===0)return"Organization name cannot be empty"}async function eSr({organization:e,token:t,context:r}){let n=BCt({token:t.value});if((await n.organization.get(WQo.FernVenusApi.OrganizationId(e))).ok)return!1;let a=u8l(e);a!=null&&r.failAndThrow(a);let u=await n.organization.create({organizationId:WQo.FernVenusApi.OrganizationId(e)});return u.ok||r.failAndThrow(`Failed to create organization: ${e}`,u.error),!0}var c8l=require("fs/promises");var s8l=require("os"),vbP="token",bbP=".fern";function gua(){return pf(I_.of((0,s8l.homedir)()),zs.of(bbP),zs.of(vbP))}var gbP="FERN_TOKEN";async function pfi(){return await mua()??await Oua()}async function mua(){let e=process.env[gbP];if(e!=null)return{type:"organization",value:e}}async function Oua(){let e=gua();if(!await Vh(e))return;let n=(await(0,c8l.readFile)(e)).toString().trim();if(n.length!==0)return{type:"user",value:n}}var Pua=require("fs/promises"),l8l=yu(require("path"),1);async function HQo(e){let t=gua();await(0,Pua.mkdir)(l8l.default.dirname(t),{recursive:!0}),await(0,Pua.writeFile)(t,e)}async function $Qo({token:e,context:t}){let r=await BCt({token:e.value}).user.getMyself();return r.ok?r.body:t.failAndThrow("Failed to fetch user info")}var Q5l=yu(hZo(),1);function yZo(e){let t=Q5l.default.decode(e.value,{complete:!0});if(t==null)return;let r=t.payload;return typeof r=="string"?void 0:r.sub}async function Z5l(e){return(await BCt({token:e.value}).organization.getMyOrganizationFromScopedToken()).ok}var utu=yu(hZo(),1),WRl=yu(VRl(),1),yxP=(0,WRl.default)({jwksUri:"https://fern-prod.us.auth0.com/.well-known/jwks.json"});async function HRl(e){let t=utu.default.decode(e.value,{complete:!0});if(t==null)return!1;try{let r=await yxP.getSigningKey(t.header.kid);return utu.default.verify(e.value,r.getPublicKey(),{algorithms:["RS256"]}),!0}catch{return!1}}async function stu(){let e=await pfi();if(e==null)return!1;switch(e.type){case"organization":return Z5l(e);case"user":return HRl(e);default:Ol(e)}}var HCt=yu(require("process"),1);function vxP(){return HCt.default.platform!=="win32"?HCt.default.env.TERM!=="linux":Boolean(HCt.default.env.WT_SESSION)||Boolean(HCt.default.env.TERMINUS_SUBLIME)||HCt.default.env.ConEmuTask==="{cmd::Cmder}"||HCt.default.env.TERM_PROGRAM==="Terminus-Sublime"||HCt.default.env.TERM_PROGRAM==="vscode"||HCt.default.env.TERM==="xterm-256color"||HCt.default.env.TERM==="alacritty"||HCt.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var $Rl={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},JRl={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},bxP={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},gxP={...$Rl,...JRl},mxP={...$Rl,...bxP},OxP=vxP(),PxP=OxP?gxP:mxP,n8r=PxP,C37=Object.entries(JRl);var oiu=yu(dca(),1),ZXl=yu(Hfi(),1),sRt=yu(Bje(),1);var M3=yu(Bje(),1);function RFP(e,t){return{value:e,key:t||{}}}function cW(e){let t=(0,M3.fromEvent)(e.input,"keypress",RFP).pipe((0,M3.takeUntil)((0,M3.fromEvent)(e,"close"))).pipe((0,M3.filter)(({key:r})=>r.name!=="enter"&&r.name!=="return"));return{line:(0,M3.fromEvent)(e,"line"),keypress:t,normalizedUpKey:t.pipe((0,M3.filter)(({key:r})=>r.name==="up"||r.name==="k"||r.name==="p"&&r.ctrl),(0,M3.share)()),normalizedDownKey:t.pipe((0,M3.filter)(({key:r})=>r.name==="down"||r.name==="j"||r.name==="n"&&r.ctrl),(0,M3.share)()),numberKey:t.pipe((0,M3.filter)(r=>r.value&&"123456789".includes(r.value)),(0,M3.map)(r=>Number(r.value)),(0,M3.share)()),spaceKey:t.pipe((0,M3.filter)(({key:r})=>r&&r.name==="space"),(0,M3.share)()),aKey:t.pipe((0,M3.filter)(({key:r})=>r&&r.name==="a"),(0,M3.share)()),iKey:t.pipe((0,M3.filter)(({key:r})=>r&&r.name==="i"),(0,M3.share)())}}var KCt=class{constructor(t,r={}){let{isInfinite:n=!0}=r;this.lastIndex=0,this.screen=t,this.isInfinite=n}paginate(t,r,n){n||(n=7);let i=t.split(`
|
|
1757
|
+
`)),{ok:!0,value:t}):n}}function ata(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var Z3r=class extends Error{errors;constructor(t){super(t.map(ata).join("; ")),this.errors=t,Object.setPrototypeOf(this,Z3r.prototype)}};var k3r=class extends Error{errors;constructor(t){super(t.map(ata).join("; ")),this.errors=t,Object.setPrototypeOf(this,k3r.prototype)}};function _A(e){return{optional:()=>QGo(e),transform:t=>ZGo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new k3r(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new Z3r(n.errors)}}}function QGo(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>(n==null?void 0:n.omitUndefined)&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>LS.OPTIONAL};return{...t,..._A(t)}}function ZGo(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,..._A(r)}}var ptP=/^([+-]?\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 dEl(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Qq(t,"string")}]}:ptP.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:Qq(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:Qq(t,"Date object")}]},getType:()=>LS.DATE};return{...NJ(e),..._A(e)}}function zJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...NJ(r),..._A(r)}}}function ota(e){let t=new Set(e);return zJ(LS.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:a,message:Qq(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:a,message:Qq(n,"enum")}]}:{ok:!0,value:n})()}function pEl(e){let t=kGo(e);return{...t,..._A(t)}}function kGo(e){return{parse:(t,r)=>d2n(e).parse(t,r),json:(t,r)=>d2n(e).json(t,r),getType:()=>d2n(e).getType()}}function d2n(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function uli(e){return Object.entries(e)}function sli(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,a])=>(r.has(i)&&(n[i]=a),n),{})}function eNr(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 cli(e){return Object.keys(e)}function _El(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function vBt(e){return{withParsedProperties:t=>eKo(e,t)}}function eKo(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);if(!a.ok)return a;let u=Object.entries(t).reduce((f,[d,c])=>({...f,[d]:typeof c=="function"?c(a.value):c}),{});return{ok:!0,value:{...a.value,...u}}},json:(n,i)=>{if(!eNr(n))return{ok:!1,errors:[{path:(i==null?void 0:i.breadcrumbsPrefix)??[],message:Qq(n,"object")}]};let a=new Set(Object.keys(t)),u=sli(n,Object.keys(n).filter(f=>!a.has(f)));return e.json(u,i)},getType:()=>e.getType()};return{...r,..._A(r),...vBt(r)}}function hEl(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function tNr(e){return e.isProperty}function uta(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>tNr(n)?n.rawKey:r),_getParsedProperties:()=>cli(e),parse:(r,n)=>{let i={},a=[];for(let[u,f]of uli(e)){let d=tNr(f)?f.rawKey:u,c=tNr(f)?f.valueSchema:f,o={rawKey:d,parsedKey:u,valueSchema:c};i[d]=o,bEl(c)&&a.push(d)}return yEl({value:r,requiredKeys:a,getProperty:u=>{let f=i[u];if(f!=null)return{transformedKey:f.parsedKey,transform:d=>f.valueSchema.parse(d,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],u]})}},unrecognizedObjectKeys:n==null?void 0:n.unrecognizedObjectKeys,skipValidation:n==null?void 0:n.skipValidation,breadcrumbsPrefix:n==null?void 0:n.breadcrumbsPrefix,omitUndefined:n==null?void 0:n.omitUndefined})},json:(r,n)=>{let i=[];for(let[a,u]of uli(e)){let f=tNr(u)?u.valueSchema:u;bEl(f)&&i.push(a)}return yEl({value:r,requiredKeys:i,getProperty:a=>{let u=e[a];if(u!=null)return tNr(u)?{transformedKey:u.rawKey,transform:f=>u.valueSchema.json(f,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],a]})}:{transformedKey:a,transform:f=>u.json(f,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],a]})}},unrecognizedObjectKeys:n==null?void 0:n.unrecognizedObjectKeys,skipValidation:n==null?void 0:n.skipValidation,breadcrumbsPrefix:n==null?void 0:n.breadcrumbsPrefix,omitUndefined:n==null?void 0:n.omitUndefined})},getType:()=>LS.OBJECT};return{...NJ(t),..._A(t),...vBt(t),...p2n(t)}}function yEl({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:a=[]}){if(!eNr(e))return{ok:!1,errors:[{path:a,message:Qq(e,"object")}]};let u=new Set(t),f=[],d={};for(let[c,o]of Object.entries(e)){let l=r(c);if(l!=null){u.delete(c);let g=l.transform(o);g.ok?d[l.transformedKey]=g.value:(d[c]=o,f.push(...g.errors))}else switch(n){case"fail":f.push({path:[...a,c],message:`Unexpected key "${c}"`});break;case"strip":break;case"passthrough":d[c]=o;break}}return f.push(...t.filter(c=>u.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),f.length===0||i?{ok:!0,value:d}:{ok:!1,errors:f}}function p2n(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>vEl({extensionKeys:t._getRawProperties(),value:n,transformBase:a=>e.parse(a,i),transformExtension:a=>t.parse(a,i)}),json:(n,i)=>vEl({extensionKeys:t._getParsedProperties(),value:n,transformBase:a=>e.json(a,i),transformExtension:a=>t.json(a,i)}),getType:()=>LS.OBJECT};return{...r,..._A(r),...vBt(r),...p2n(r)}}}}function vEl({extensionKeys:e,value:t,transformBase:r,transformExtension:n}){let i=new Set(e),[a,u]=_El(cli(t),c=>i.has(c)),f=r(sli(t,u)),d=n(sli(t,a));return f.ok&&d.ok?{ok:!0,value:{...f.value,...d.value}}:{ok:!1,errors:[...f.ok?[]:f.errors,...d.ok?[]:d.errors]}}function bEl(e){return!_tP(e)}function _tP(e){switch(e.getType()){case LS.ANY:case LS.UNKNOWN:case LS.OPTIONAL:return!0;default:return!1}}function gEl(e){return uta(e)}function mEl(e){let t={...kGo(e),_getRawProperties:()=>d2n(e)._getRawProperties(),_getParsedProperties:()=>d2n(e)._getParsedProperties()};return{...t,..._A(t),...vBt(t),...p2n(t)}}function sta(e){let t={parse:(r,n)=>OEl(r,(i,a)=>e.parse(i,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],`[${a}]`]})),json:(r,n)=>OEl(r,(i,a)=>e.json(i,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],`[${a}]`]})),getType:()=>LS.LIST};return{...NJ(t),..._A(t)}}function OEl(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:Qq(e,"list"),path:[]}]}}function PEl(e){return zJ(LS.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Qq(r,`"${e}"`)}]})()}function jEl(e){return zJ(LS.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Qq(r,`${e.toString()}`)}]})()}var wEl=zJ(LS.ANY,e=>({ok:!0,value:e}));var DEl=zJ(LS.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Qq(e,"boolean")}]});var SEl=zJ(LS.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Qq(e,"number")}]});var EEl=zJ(LS.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Qq(e,"string")}]});var MEl=zJ(LS.UNKNOWN,e=>({ok:!0,value:e}));function TEl(e,t){let r={parse:(n,i)=>xEl({value:n,isKeyNumeric:e.getType()===LS.NUMBER,transformKey:a=>e.parse(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${u}`]}),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(n,i)=>xEl({value:n,isKeyNumeric:e.getType()===LS.NUMBER,transformKey:a=>e.json(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${u}`]}),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>LS.RECORD};return{...NJ(r),..._A(r)}}function xEl({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return eNr(e)?uli(e).reduce((a,[u,f])=>{if(f==null)return a;let d=a,c=u;if(t){let O=u.length>0?Number(u):NaN;isNaN(O)||(c=O)}let o=r(c),l=n(f,c);if(d.ok&&o.ok&&l.ok)return{ok:!0,value:{...d.value,[o.value]:l.value}};let g=[];return d.ok||g.push(...d.errors),o.ok||g.push(...o.errors),l.ok||g.push(...l.errors),{ok:!1,errors:g}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:Qq(e,"object")}]}}function qEl(e){let t=sta(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==null?void 0:i.breadcrumbsPrefix)??[],message:Qq(n,"Set")}]},getType:()=>LS.SET};return{...NJ(r),..._A(r)}}function AEl(e){let t={parse:(r,n)=>CEl((i,a)=>i.parse(r,a),e,n),json:(r,n)=>CEl((i,a)=>i.json(r,a),e,n),getType:()=>LS.UNDISCRIMINATED_UNION};return{...NJ(t),..._A(t)}}function CEl(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 f of u.errors)n.push({path:f.path,message:`[Variant ${i}] ${f.message}`})}return{ok:!1,errors:n}}function NEl(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function BEl(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=ota(cli(t)),a={parse:(u,f)=>zEl({value:u,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:d=>i.parse(d,{allowUnrecognizedEnumValues:f==null?void 0:f.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f==null?void 0:f.breadcrumbsPrefix)??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:f==null?void 0:f.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,c)=>c.parse(d,f),breadcrumbsPrefix:f==null?void 0:f.breadcrumbsPrefix}),json:(u,f)=>zEl({value:u,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:d=>i.json(d,{allowUnrecognizedEnumValues:f==null?void 0:f.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f==null?void 0:f.breadcrumbsPrefix)??[],n]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:f==null?void 0:f.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,c)=>c.json(d,f),breadcrumbsPrefix:f==null?void 0:f.breadcrumbsPrefix}),getType:()=>LS.UNION};return{...NJ(a),..._A(a),...vBt(a)}}function zEl({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:f=[]}){if(!eNr(e))return{ok:!1,errors:[{path:f,message:Qq(e,"object")}]};let{[t]:d,...c}=e;if(d==null)return{ok:!1,errors:[{path:f,message:`Missing discriminant ("${t}")`}]};let o=n(d);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,...c}}:{ok:!1,errors:[{path:[...f,t],message:"Unexpected discriminant value"}]};let g=u(c,l);return g.ok?{ok:!0,value:{[r]:d,...g.value}}:g}var jTe=Jr.string();var cta=Jr.enum_(["ALL","ANY"]);var PZr=Jr.objectWithoutOptionalProperties({unsafeName:Jr.string(),safeName:Jr.string()});var vy=Jr.objectWithoutOptionalProperties({originalName:Jr.string(),camelCase:PZr,pascalCase:PZr,snakeCase:PZr,screamingSnakeCase:PZr});var T0=Jr.objectWithoutOptionalProperties({docs:Jr.string().optional()});var lta=Jr.objectWithoutOptionalProperties({token:vy,tokenEnvVar:jTe.optional()}).extend(T0);var fta=Jr.objectWithoutOptionalProperties({username:vy,usernameEnvVar:jTe.optional(),password:vy,passwordEnvVar:jTe.optional()}).extend(T0);var Um=Jr.objectWithoutOptionalProperties({wireValue:Jr.string(),name:vy});var dta=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb),prefix:Jr.string().optional(),headerEnvVar:jTe.optional()}).extend(T0);var TDr=Jr.string();var bBt=Jr.string();var gBt=Jr.string();var _2n=Jr.objectWithoutOptionalProperties({endpointId:TDr,serviceId:bBt,subpackageId:gBt.optional()});var pta=Jr.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var mBt=Jr.objectWithoutOptionalProperties({status:pta,message:Jr.string().optional()});var lB=Jr.objectWithoutOptionalProperties({availability:mBt.optional()}).extend(T0);var rNr=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb),allowMultiple:Jr.boolean()}).extend(lB);var iQ=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(lB);var _ta=Jr.union("type",{query:rNr,body:iQ}).transform({transform:e=>{switch(e.type){case"query":return tne.query(e);case"body":return tne.body(e);default:return e}},untransform:({_visit:e,...t})=>t});var aQ=Jr.objectWithoutOptionalProperties({propertyPath:Jr.list(vy).optional(),property:_ta});var hta=Jr.objectWithoutOptionalProperties({clientId:aQ,clientSecret:aQ,scopes:aQ.optional()});var wTe=Jr.objectWithoutOptionalProperties({propertyPath:Jr.list(vy).optional(),property:iQ});var h2n=Jr.objectWithoutOptionalProperties({accessToken:wTe,expiresIn:wTe.optional(),refreshToken:wTe.optional()});var yta=Jr.objectWithoutOptionalProperties({endpointReference:_2n,requestProperties:hta,responseProperties:h2n});var vta=Jr.objectWithoutOptionalProperties({refreshToken:aQ});var bta=Jr.objectWithoutOptionalProperties({endpointReference:_2n,requestProperties:vta,responseProperties:h2n});var gta=Jr.objectWithoutOptionalProperties({clientIdEnvVar:jTe.optional(),clientSecretEnvVar:jTe.optional(),tokenPrefix:Jr.string().optional(),scopes:Jr.list(Jr.string()).optional(),tokenEndpoint:yta,refreshEndpoint:bta.optional()});var mta=Jr.union("type",{clientCredentials:gta}).transform({transform:e=>{switch(e.type){case"clientCredentials":return K3r.clientCredentials(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ota=Jr.objectWithoutOptionalProperties({configuration:mta}).extend(T0);var Pta=Jr.union(Jr.discriminant("type","_type"),{bearer:lta,basic:fta,header:dta,oauth:Ota}).transform({transform:e=>{switch(e.type){case"bearer":return HV.bearer(e);case"basic":return HV.basic(e);case"header":return HV.header(e);case"oauth":return HV.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var jta=Jr.objectWithoutOptionalProperties({requirement:cta,schemes:Jr.list(Pta)}).extend(T0);var rKo={};Wb(rKo,{Availability:()=>mBt,AvailabilityStatus:()=>pta,Declaration:()=>lB,EndpointId:()=>TDr,EndpointReference:()=>_2n,ErrorId:()=>iNr,EscapedString:()=>wta,FeatureId:()=>Sta,FernFilepath:()=>DTe,Name:()=>vy,NameAndWireValue:()=>Um,SafeAndUnsafeString:()=>PZr,ServiceId:()=>bBt,SubpackageId:()=>gBt,TypeId:()=>JV,WebSocketChannelId:()=>v2n,WebhookGroupId:()=>y2n,WebhookId:()=>Dta,WithDocs:()=>T0,WithDocsAndAvailability:()=>nNr,WithJsonExample:()=>OBt});var nNr=Jr.objectWithoutOptionalProperties({availability:mBt.optional()}).extend(T0);var DTe=Jr.objectWithoutOptionalProperties({allParts:Jr.list(vy),packagePath:Jr.list(vy),file:vy.optional()});var wta=Jr.objectWithoutOptionalProperties({original:Jr.string()});var OBt=Jr.objectWithoutOptionalProperties({jsonExample:Jr.unknown()});var JV=Jr.string();var iNr=Jr.string();var y2n=Jr.string();var Dta=Jr.string();var v2n=Jr.string();var Sta=Jr.string();var nKo={};Wb(nKo,{Constants:()=>Eta});var Eta=Jr.objectWithoutOptionalProperties({errorInstanceIdKey:Um});var iKo={};Wb(iKo,{EnvironmentBaseUrlId:()=>oNr,EnvironmentBaseUrlWithId:()=>Tta,EnvironmentId:()=>aNr,EnvironmentUrl:()=>b2n,Environments:()=>Ata,EnvironmentsConfig:()=>Nta,MultipleBaseUrlsEnvironment:()=>qta,MultipleBaseUrlsEnvironments:()=>Cta,SingleBaseUrlEnvironment:()=>Mta,SingleBaseUrlEnvironments:()=>xta});var aNr=Jr.string();var oNr=Jr.string();var b2n=Jr.string();var Mta=Jr.objectWithoutOptionalProperties({id:aNr,name:vy,url:b2n}).extend(T0);var xta=Jr.objectWithoutOptionalProperties({environments:Jr.list(Mta)});var Tta=Jr.objectWithoutOptionalProperties({id:oNr,name:vy});var qta=Jr.objectWithoutOptionalProperties({id:aNr,name:vy,urls:Jr.record(oNr,b2n)}).extend(T0);var Cta=Jr.objectWithoutOptionalProperties({baseUrls:Jr.list(Tta),environments:Jr.list(qta)});var Ata=Jr.union("type",{singleBaseUrl:xta,multipleBaseUrls:Cta}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return vCt.singleBaseUrl(e);case"multipleBaseUrls":return vCt.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t});var Nta=Jr.objectWithoutOptionalProperties({defaultEnvironment:aNr.optional(),environments:Ata});var aKo={};Wb(aKo,{DeclaredErrorName:()=>uNr,ErrorDeclaration:()=>Bta,ErrorDeclarationDiscriminantValue:()=>IEl,ExampleError:()=>zta});var uNr=Jr.objectWithoutOptionalProperties({errorId:iNr,fernFilepath:DTe,name:vy});var zta=Jr.objectWithoutOptionalProperties({name:vy.optional(),shape:Jr.lazyObject(()=>kj)}).extend(OBt).extend(T0);var Bta=Jr.objectWithoutOptionalProperties({name:uNr,discriminantValue:Um,type:Jr.lazy(()=>Hb).optional(),statusCode:Jr.number(),examples:Jr.list(zta)}).extend(T0);var IEl=Jr.union("type",{property:Um,statusCode:Jr.object({})}).transform({transform:e=>{switch(e.type){case"property":return Y3r.property(e);case"statusCode":return Y3r.statusCode();default:return e}},untransform:({_visit:e,...t})=>t});var oKo={};Wb(oKo,{AutogeneratedEndpointExample:()=>Sra,BytesRequest:()=>P2n,CursorPagination:()=>fra,DeclaredServiceName:()=>Ita,EndpointName:()=>Fta,ExampleCodeSample:()=>vra,ExampleCodeSampleLanguage:()=>_ra,ExampleCodeSampleSdk:()=>yra,ExampleEndpointCall:()=>x2n,ExampleEndpointErrorResponse:()=>jra,ExampleEndpointSuccessResponse:()=>Pra,ExampleHeader:()=>jZr,ExampleInlinedRequestBody:()=>M2n,ExampleInlinedRequestBodyProperty:()=>gra,ExamplePathParameter:()=>sNr,ExampleQueryParameter:()=>E2n,ExampleQueryParameterShape:()=>bra,ExampleRequestBody:()=>mra,ExampleResponse:()=>wra,ExampleServerSideEvent:()=>Ora,FileDownloadResponse:()=>w2n,FileProperty:()=>$ta,FilePropertyArray:()=>Hta,FilePropertySingle:()=>Wta,FileUploadBodyProperty:()=>Jta,FileUploadRequest:()=>Kta,FileUploadRequestProperty:()=>Gta,GrpcTransport:()=>Ara,HttpEndpoint:()=>Era,HttpHeader:()=>oQ,HttpMethod:()=>Lta,HttpPath:()=>wCt,HttpPathPart:()=>Rta,HttpRequestBody:()=>Yta,HttpRequestBodyReference:()=>O2n,HttpResponse:()=>sra,HttpResponseBody:()=>ura,HttpService:()=>zra,InlinedRequestBody:()=>Vta,InlinedRequestBodyProperty:()=>m2n,JsonResponse:()=>j2n,JsonResponseBody:()=>era,JsonResponseBodyWithProperty:()=>tra,JsonStreamChunk:()=>rra,NonStreamHttpResponseBody:()=>ara,OffsetPagination:()=>dra,Pagination:()=>pra,PathParameter:()=>DCt,PathParameterLocation:()=>Uta,QueryParameter:()=>rNr,RequestProperty:()=>aQ,RequestPropertyValue:()=>_ta,ResponseError:()=>cra,ResponseErrors:()=>lra,ResponseProperty:()=>wTe,SdkRequest:()=>kta,SdkRequestBodyType:()=>Xta,SdkRequestShape:()=>Zta,SdkRequestWrapper:()=>Qta,SseStreamChunk:()=>ira,StreamParameterResponse:()=>ora,StreamingResponse:()=>S2n,SupportedSdkLanguage:()=>hra,TextResponse:()=>D2n,TextStreamChunk:()=>nra,Transport:()=>Nra,UserSpecifiedEndpointExample:()=>Dra});var Ita=Jr.objectWithoutOptionalProperties({fernFilepath:DTe});var Rta=Jr.objectWithoutOptionalProperties({pathParameter:Jr.string(),tail:Jr.string()});var wCt=Jr.objectWithoutOptionalProperties({head:Jr.string(),parts:Jr.list(Rta)});var Fta=vy;var Lta=Jr.enum_(["GET","POST","PUT","PATCH","DELETE"]);var oQ=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb),env:Jr.string().optional()}).extend(lB);var Uta=Jr.enum_(["ROOT","SERVICE","ENDPOINT"]);var g2n=Jr.string();var DCt=Jr.objectWithoutOptionalProperties({name:vy,valueType:Jr.lazy(()=>Hb),location:Uta,variable:g2n.optional()}).extend(T0);var GA=Jr.objectWithoutOptionalProperties({typeId:JV,fernFilepath:DTe,name:vy});var m2n=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(nNr);var Vta=Jr.objectWithoutOptionalProperties({name:vy,extends:Jr.list(GA),properties:Jr.list(m2n),extendedProperties:Jr.list(iQ).optional(),contentType:Jr.string().optional(),extraProperties:Jr.property("extra-properties",Jr.boolean())});var O2n=Jr.objectWithoutOptionalProperties({requestBodyType:Jr.lazy(()=>Hb),contentType:Jr.string().optional()}).extend(T0);var Wta=Jr.objectWithoutOptionalProperties({key:Um,isOptional:Jr.boolean(),contentType:Jr.string().optional()});var Hta=Jr.objectWithoutOptionalProperties({key:Um,isOptional:Jr.boolean(),contentType:Jr.string().optional()});var $ta=Jr.union("type",{file:Wta,fileArray:Hta}).transform({transform:e=>{switch(e.type){case"file":return bCt.file(e);case"fileArray":return bCt.fileArray(e);default:return e}},untransform:({_visit:e,...t})=>t});var Jta=Jr.objectWithoutOptionalProperties({contentType:Jr.string().optional()}).extend(m2n);var Gta=Jr.union("type",{file:Jr.object({value:$ta}),bodyProperty:Jta}).transform({transform:e=>{switch(e.type){case"file":return Zre.file(e.value);case"bodyProperty":return Zre.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t});var Kta=Jr.objectWithoutOptionalProperties({name:vy,properties:Jr.list(Gta)});var P2n=Jr.objectWithoutOptionalProperties({isOptional:Jr.boolean(),contentType:Jr.string().optional()});var Yta=Jr.union("type",{inlinedRequestBody:Vta,reference:O2n,fileUpload:Kta,bytes:P2n}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return cB.inlinedRequestBody(e);case"reference":return cB.reference(e);case"fileUpload":return cB.fileUpload(e);case"bytes":return cB.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var Xta=Jr.union("type",{typeReference:O2n,bytes:P2n}).transform({transform:e=>{switch(e.type){case"typeReference":return gCt.typeReference(e);case"bytes":return gCt.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var Qta=Jr.objectWithoutOptionalProperties({wrapperName:vy,bodyKey:vy});var Zta=Jr.union("type",{justRequestBody:Jr.object({value:Xta}),wrapper:Qta}).transform({transform:e=>{switch(e.type){case"justRequestBody":return gTe.justRequestBody(e.value);case"wrapper":return gTe.wrapper(e);default:return e}},untransform:({_visit:e,...t})=>t});var kta=Jr.objectWithoutOptionalProperties({streamParameter:aQ.optional(),requestParameterName:vy,shape:Zta});var era=Jr.objectWithoutOptionalProperties({responseBodyType:Jr.lazy(()=>Hb)}).extend(T0);var tra=Jr.objectWithoutOptionalProperties({responseBodyType:Jr.lazy(()=>Hb),responseProperty:iQ.optional()}).extend(T0);var j2n=Jr.union("type",{response:era,nestedPropertyAsResponse:tra}).transform({transform:e=>{switch(e.type){case"response":return mCt.response(e);case"nestedPropertyAsResponse":return mCt.nestedPropertyAsResponse(e);default:return e}},untransform:({_visit:e,...t})=>t});var w2n=Jr.objectWithoutOptionalProperties({}).extend(T0);var D2n=Jr.objectWithoutOptionalProperties({}).extend(T0);var rra=Jr.objectWithoutOptionalProperties({payload:Jr.lazy(()=>Hb),terminator:Jr.string().optional()}).extend(T0);var nra=Jr.objectWithoutOptionalProperties({}).extend(T0);var ira=Jr.objectWithoutOptionalProperties({payload:Jr.lazy(()=>Hb),terminator:Jr.string().optional()}).extend(T0);var S2n=Jr.union("type",{json:rra,text:nra,sse:ira}).transform({transform:e=>{switch(e.type){case"json":return ene.json(e);case"text":return ene.text(e);case"sse":return ene.sse(e);default:return e}},untransform:({_visit:e,...t})=>t});var ara=Jr.union("type",{json:Jr.object({value:j2n}),fileDownload:w2n,text:D2n}).transform({transform:e=>{switch(e.type){case"json":return kre.json(e.value);case"fileDownload":return kre.fileDownload(e);case"text":return kre.text(e);default:return e}},untransform:({_visit:e,...t})=>t});var ora=Jr.objectWithoutOptionalProperties({nonStreamResponse:ara,streamResponse:S2n});var ura=Jr.union("type",{json:Jr.object({value:j2n}),fileDownload:w2n,text:D2n,streaming:Jr.object({value:S2n}),streamParameter:ora}).transform({transform:e=>{switch(e.type){case"json":return pA.json(e.value);case"fileDownload":return pA.fileDownload(e);case"text":return pA.text(e);case"streaming":return pA.streaming(e.value);case"streamParameter":return pA.streamParameter(e);default:return e}},untransform:({_visit:e,...t})=>t});var sra=Jr.objectWithoutOptionalProperties({statusCode:Jr.property("status-code",Jr.number().optional()),body:ura.optional()});var cra=Jr.objectWithoutOptionalProperties({error:uNr}).extend(T0);var lra=Jr.list(cra);var fra=Jr.objectWithoutOptionalProperties({page:aQ,next:wTe,results:wTe});var dra=Jr.objectWithoutOptionalProperties({page:aQ,results:wTe,hasNextPage:wTe.optional(),step:aQ.optional()});var pra=Jr.union("type",{cursor:fra,offset:dra}).transform({transform:e=>{switch(e.type){case"cursor":return mTe.cursor(e);case"offset":return mTe.offset(e);default:return e}},untransform:({_visit:e,...t})=>t});var _ra=Jr.objectWithoutOptionalProperties({name:vy.optional(),language:Jr.string(),code:Jr.string(),install:Jr.string().optional()}).extend(T0);var hra=Jr.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var yra=Jr.objectWithoutOptionalProperties({name:vy.optional(),sdk:hra,code:Jr.string()}).extend(T0);var vra=Jr.union("type",{language:_ra,sdk:yra}).transform({transform:e=>{switch(e.type){case"language":return Sje.language(e);case"sdk":return Sje.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var sNr=Jr.objectWithoutOptionalProperties({name:vy,value:Jr.lazyObject(()=>kj)});var jZr=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj)});var bra=Jr.union("type",{single:Jr.object({}),exploded:Jr.object({}),commaSeparated:Jr.object({})}).transform({transform:e=>{switch(e.type){case"single":return uR.single();case"exploded":return uR.exploded();case"commaSeparated":return uR.commaSeparated();default:return e}},untransform:({_visit:e,...t})=>t});var E2n=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj),shape:bra.optional()});var gra=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj),originalTypeDeclaration:GA.optional()});var M2n=Jr.objectWithoutOptionalProperties({properties:Jr.list(gra)}).extend(OBt);var mra=Jr.union("type",{inlinedRequestBody:M2n,reference:Jr.lazyObject(()=>kj)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return AJ.inlinedRequestBody(e);case"reference":return AJ.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ora=Jr.objectWithoutOptionalProperties({event:Jr.string(),data:Jr.lazyObject(()=>kj)});var Pra=Jr.union("type",{body:Jr.object({value:Jr.lazyObject(()=>kj).optional()}),stream:Jr.object({value:Jr.list(Jr.lazyObject(()=>kj))}),sse:Jr.object({value:Jr.list(Ora)})}).transform({transform:e=>{switch(e.type){case"body":return Xq.body(e.value);case"stream":return Xq.stream(e.value);case"sse":return Xq.sse(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var jra=Jr.objectWithoutOptionalProperties({error:uNr,body:Jr.lazyObject(()=>kj).optional()});var wra=Jr.union("type",{ok:Jr.object({value:Pra}),error:jra}).transform({transform:e=>{switch(e.type){case"ok":return w3.ok(e.value);case"error":return w3.error(e);default:return e}},untransform:({_visit:e,...t})=>t});var x2n=Jr.objectWithoutOptionalProperties({id:Jr.string().optional(),name:vy.optional(),url:Jr.string(),rootPathParameters:Jr.list(sNr),servicePathParameters:Jr.list(sNr),endpointPathParameters:Jr.list(sNr),serviceHeaders:Jr.list(jZr),endpointHeaders:Jr.list(jZr),queryParameters:Jr.list(E2n),request:mra.optional(),response:wra}).extend(T0);var Dra=Jr.objectWithoutOptionalProperties({codeSamples:Jr.list(vra).optional(),example:x2n.optional()});var Sra=Jr.objectWithoutOptionalProperties({example:x2n});var Era=Jr.objectWithoutOptionalProperties({id:TDr,name:Fta,displayName:Jr.string().optional(),method:Lta,headers:Jr.list(oQ),baseUrl:oNr.optional(),path:wCt,fullPath:wCt,pathParameters:Jr.list(DCt),allPathParameters:Jr.list(DCt),queryParameters:Jr.list(rNr),requestBody:Yta.optional(),sdkRequest:kta.optional(),response:sra.optional(),errors:lra,auth:Jr.boolean(),idempotent:Jr.boolean(),pagination:pra.optional(),userSpecifiedExamples:Jr.list(Dra),autogeneratedExamples:Jr.list(Sra)}).extend(lB);var Mra=Jr.objectWithoutOptionalProperties({});var xra=Jr.objectWithoutOptionalProperties({});var T2n=Jr.objectWithoutOptionalProperties({json:Mra.optional(),proto:xra.optional()});var Tra=Jr.objectWithoutOptionalProperties({namespace:Jr.string()});var qra=Jr.objectWithoutOptionalProperties({csharp:Tra.optional()});var q2n=Jr.objectWithoutOptionalProperties({filepath:Jr.string(),packageName:Jr.string().optional(),options:qra.optional()});var Cra=Jr.objectWithoutOptionalProperties({file:q2n,name:vy});var Ara=Jr.objectWithoutOptionalProperties({service:Cra});var Nra=Jr.union("type",{http:Jr.object({}),grpc:Ara}).transform({transform:e=>{switch(e.type){case"http":return vTe.http();case"grpc":return vTe.grpc(e);default:return e}},untransform:({_visit:e,...t})=>t});var zra=Jr.objectWithoutOptionalProperties({availability:mBt.optional(),name:Ita,displayName:Jr.string().optional(),basePath:wCt,endpoints:Jr.list(Era),headers:Jr.list(oQ),pathParameters:Jr.list(DCt),encoding:T2n.optional(),transport:Nra.optional()});var uKo={};Wb(uKo,{ApiDefinitionSource:()=>Qna,ApiDefinitionSourceId:()=>Yna,ApiVersionScheme:()=>Ira,ErrorDiscriminationByPropertyStrategy:()=>Una,ErrorDiscriminationStrategy:()=>Vna,HeaderApiVersionScheme:()=>Bra,IntermediateRepresentation:()=>REl,Package:()=>I2n,PackageNavigationConfig:()=>Fna,PlatformHeaders:()=>Hna,ProtoSource:()=>Xna,ReadmeConfig:()=>Kna,SdkConfig:()=>$na,ServiceTypeReferenceInfo:()=>Gna,SourceConfig:()=>Zna,Subpackage:()=>Lna,UserAgent:()=>Wna});var qDr=Jr.objectWithoutOptionalProperties({name:Um}).extend(lB);var C2n=Jr.objectWithoutOptionalProperties({default:qDr.optional(),values:Jr.list(qDr)});var Bra=Jr.objectWithoutOptionalProperties({header:oQ,value:C2n});var Ira=Jr.union("type",{header:Bra}).transform({transform:e=>{switch(e.type){case"header":return X3r.header(e);default:return e}},untransform:({_visit:e,...t})=>t});var Rra=Jr.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var Fra=Jr.objectWithoutOptionalProperties({name:GA,shape:Rra});var Lra=Jr.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var Ura=Jr.objectWithoutOptionalProperties({min:Jr.number().optional(),max:Jr.number().optional(),exclusiveMin:Jr.boolean().optional(),exclusiveMax:Jr.boolean().optional(),multipleOf:Jr.number().optional()});var Vra=Jr.objectWithoutOptionalProperties({default:Jr.number().optional(),validation:Ura.optional()});var Wra=Jr.objectWithoutOptionalProperties({default:Jr.number().optional()});var Hra=Jr.objectWithoutOptionalProperties({});var $ra=Jr.objectWithoutOptionalProperties({});var Jra=Jr.objectWithoutOptionalProperties({});var Gra=Jr.objectWithoutOptionalProperties({min:Jr.number().optional(),max:Jr.number().optional(),exclusiveMin:Jr.boolean().optional(),exclusiveMax:Jr.boolean().optional(),multipleOf:Jr.number().optional()});var Kra=Jr.objectWithoutOptionalProperties({default:Jr.number().optional(),validation:Gra.optional()});var Yra=Jr.objectWithoutOptionalProperties({default:Jr.boolean().optional()});var Xra=Jr.objectWithoutOptionalProperties({format:Jr.string().optional(),pattern:Jr.string().optional(),minLength:Jr.number().optional(),maxLength:Jr.number().optional()});var Qra=Jr.objectWithoutOptionalProperties({default:Jr.string().optional(),validation:Xra.optional()});var Zra=Jr.objectWithoutOptionalProperties({});var kra=Jr.objectWithoutOptionalProperties({});var ena=Jr.objectWithoutOptionalProperties({});var tna=Jr.objectWithoutOptionalProperties({});var rna=Jr.objectWithoutOptionalProperties({default:Jr.string().optional()});var nna=Jr.union("type",{integer:Vra,long:Wra,uint:Hra,uint64:$ra,float:Jra,double:Kra,boolean:Yra,string:Qra,date:Zra,dateTime:kra,uuid:ena,base64:tna,bigInteger:rna}).transform({transform:e=>{switch(e.type){case"integer":return gM.integer(e);case"long":return gM.long(e);case"uint":return gM.uint(e);case"uint64":return gM.uint64(e);case"float":return gM.float(e);case"double":return gM.double(e);case"boolean":return gM.boolean(e);case"string":return gM.string(e);case"date":return gM.date(e);case"dateTime":return gM.dateTime(e);case"uuid":return gM.uuid(e);case"base64":return gM.base64(e);case"bigInteger":return gM.bigInteger(e);default:return e}},untransform:({_visit:e,...t})=>t});var A2n=Jr.objectWithoutOptionalProperties({v1:Lra,v2:nna.optional()});var ina=Jr.union(Jr.discriminant("type","_type"),{container:Jr.object({container:Jr.lazy(()=>N2n)}),named:Fra,primitive:Jr.object({primitive:A2n}),unknown:Jr.object({})}).transform({transform:e=>{switch(e.type){case"container":return $V.container(e.container);case"named":return $V.named(e);case"primitive":return $V.primitive(e.primitive);case"unknown":return $V.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var ana=Jr.objectWithoutOptionalProperties({aliasOf:Jr.lazy(()=>Hb),resolvedType:ina});var ona=Jr.objectWithoutOptionalProperties({extends:Jr.list(GA),properties:Jr.list(iQ),extendedProperties:Jr.list(iQ).optional(),extraProperties:Jr.property("extra-properties",Jr.boolean())});var una=Jr.objectWithoutOptionalProperties({name:Um,type:Jr.lazy(()=>Hb)});var sna=Jr.union(Jr.discriminant("propertiesType","_type"),{samePropertiesAsObject:GA,singleProperty:una,noProperties:Jr.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return nne.samePropertiesAsObject(e);case"singleProperty":return nne.singleProperty(e);case"noProperties":return nne.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var cna=Jr.objectWithoutOptionalProperties({discriminantValue:Um,shape:sna,displayName:Jr.string().optional(),availability:mBt.optional()}).extend(T0);var lna=Jr.objectWithoutOptionalProperties({discriminant:Um,extends:Jr.list(GA),types:Jr.list(cna),baseProperties:Jr.list(iQ)});var fna=Jr.objectWithoutOptionalProperties({type:Jr.lazy(()=>Hb)}).extend(T0);var dna=Jr.objectWithoutOptionalProperties({members:Jr.list(fna)});var pna=Jr.union(Jr.discriminant("type","_type"),{alias:ana,enum:C2n,object:ona,union:lna,undiscriminatedUnion:dna}).transform({transform:e=>{switch(e.type){case"alias":return EC.alias(e);case"enum":return EC.enum(e);case"object":return EC.object(e);case"union":return EC.union(e);case"undiscriminatedUnion":return EC.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var lli=Jr.objectWithoutOptionalProperties({name:vy.optional(),shape:Jr.lazy(()=>z2n)}).extend(OBt).extend(T0);var _na=Jr.union("type",{any:Jr.object({}),api:Jr.object({}),boolValue:Jr.object({}),bytesValue:Jr.object({}),doubleValue:Jr.object({}),duration:Jr.object({}),empty:Jr.object({}),enum:Jr.object({}),enumValue:Jr.object({}),field:Jr.object({}),fieldCardinality:Jr.object({}),fieldKind:Jr.object({}),fieldMask:Jr.object({}),floatValue:Jr.object({}),int32Value:Jr.object({}),int64Value:Jr.object({}),listValue:Jr.object({}),method:Jr.object({}),mixin:Jr.object({}),nullValue:Jr.object({}),option:Jr.object({}),sourceContext:Jr.object({}),stringValue:Jr.object({}),struct:Jr.object({}),syntax:Jr.object({}),timestamp:Jr.object({}),type:Jr.object({}),uint32Value:Jr.object({}),uint64Value:Jr.object({}),value:Jr.object({})}).transform({transform:e=>{switch(e.type){case"any":return th.any();case"api":return th.api();case"boolValue":return th.boolValue();case"bytesValue":return th.bytesValue();case"doubleValue":return th.doubleValue();case"duration":return th.duration();case"empty":return th.empty();case"enum":return th.enum();case"enumValue":return th.enumValue();case"field":return th.field();case"fieldCardinality":return th.fieldCardinality();case"fieldKind":return th.fieldKind();case"fieldMask":return th.fieldMask();case"floatValue":return th.floatValue();case"int32Value":return th.int32Value();case"int64Value":return th.int64Value();case"listValue":return th.listValue();case"method":return th.method();case"mixin":return th.mixin();case"nullValue":return th.nullValue();case"option":return th.option();case"sourceContext":return th.sourceContext();case"stringValue":return th.stringValue();case"struct":return th.struct();case"syntax":return th.syntax();case"timestamp":return th.timestamp();case"type":return th.type();case"uint32Value":return th.uint32Value();case"uint64Value":return th.uint64Value();case"value":return th.value();default:return e}},untransform:({_visit:e,...t})=>t});var hna=Jr.objectWithoutOptionalProperties({file:q2n,name:vy});var yna=Jr.union("type",{wellKnown:Jr.object({value:_na}),userDefined:hna}).transform({transform:e=>{switch(e.type){case"wellKnown":return Yw.wellKnown(e.value);case"userDefined":return Yw.userDefined(e);default:return e}},untransform:({_visit:e,...t})=>t});var vna=Jr.union("type",{proto:Jr.object({value:yna})}).transform({transform:e=>{switch(e.type){case"proto":return xDr.proto(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var bna=Jr.objectWithoutOptionalProperties({name:GA,shape:pna,autogeneratedExamples:Jr.list(lli),userProvidedExamples:Jr.list(lli),referencedTypes:Jr.set(JV),encoding:T2n.optional(),source:vna.optional()}).extend(lB);var gna=vy;var mna=Jr.enum_(["GET","POST"]);var Ona=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(nNr);var Pna=Jr.objectWithoutOptionalProperties({name:vy,extends:Jr.list(GA),properties:Jr.list(Ona)});var jna=Jr.objectWithoutOptionalProperties({payloadType:Jr.lazy(()=>Hb)}).extend(T0);var wna=Jr.union("type",{inlinedPayload:Pna,reference:jna}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return ine.inlinedPayload(e);case"reference":return ine.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Dna=Jr.objectWithoutOptionalProperties({name:vy.optional(),payload:Jr.lazyObject(()=>kj)}).extend(T0);var Sna=Jr.objectWithoutOptionalProperties({id:Dta,name:gna,displayName:Jr.string().optional(),method:mna,headers:Jr.list(oQ),payload:wna,examples:Jr.list(Dna).optional()}).extend(lB);var Ena=Jr.list(Sna);var Mna=vy;var B2n=Jr.string();var xna=Jr.enum_(["client","server"]);var Tna=Jr.objectWithoutOptionalProperties({name:Um,valueType:Jr.lazy(()=>Hb)}).extend(nNr);var qna=Jr.objectWithoutOptionalProperties({name:vy,extends:Jr.list(GA),properties:Jr.list(Tna)});var Cna=Jr.objectWithoutOptionalProperties({bodyType:Jr.lazy(()=>Hb)}).extend(T0);var Ana=Jr.union("type",{inlinedBody:qna,reference:Cna}).transform({transform:e=>{switch(e.type){case"inlinedBody":return PTe.inlinedBody(e);case"reference":return PTe.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Nna=Jr.objectWithoutOptionalProperties({type:B2n,displayName:Jr.string().optional(),origin:xna,body:Ana}).extend(lB);var zna=Jr.union("type",{inlinedBody:M2n,reference:Jr.lazyObject(()=>kj)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return jCt.inlinedBody(e);case"reference":return jCt.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var Bna=Jr.objectWithoutOptionalProperties({type:B2n,body:zna});var Ina=Jr.objectWithoutOptionalProperties({name:vy.optional(),url:Jr.string(),pathParameters:Jr.list(sNr),headers:Jr.list(jZr),queryParameters:Jr.list(E2n),messages:Jr.list(Bna)}).extend(T0);var Rna=Jr.objectWithoutOptionalProperties({name:Mna,displayName:Jr.string().optional(),path:wCt,auth:Jr.boolean(),headers:Jr.list(oQ),queryParameters:Jr.list(rNr),pathParameters:Jr.list(DCt),messages:Jr.list(Nna),examples:Jr.list(Ina)}).extend(lB);var Fna=Jr.objectWithoutOptionalProperties({pointsTo:gBt});var I2n=Jr.objectWithoutOptionalProperties({fernFilepath:DTe,service:bBt.optional(),types:Jr.list(JV),errors:Jr.list(iNr),webhooks:y2n.optional(),websocket:v2n.optional(),subpackages:Jr.list(gBt),hasEndpointsInTree:Jr.boolean(),navigationConfig:Fna.optional()}).extend(T0);var Lna=Jr.objectWithoutOptionalProperties({name:vy}).extend(I2n);var Una=Jr.objectWithoutOptionalProperties({discriminant:Um,contentProperty:Um});var Vna=Jr.union("type",{statusCode:Jr.object({}),property:Una}).transform({transform:e=>{switch(e.type){case"statusCode":return OCt.statusCode();case"property":return OCt.property(e);default:return e}},untransform:({_visit:e,...t})=>t});var Wna=Jr.objectWithoutOptionalProperties({header:Jr.stringLiteral("User-Agent"),value:Jr.string()});var Hna=Jr.objectWithoutOptionalProperties({language:Jr.string(),sdkName:Jr.string(),sdkVersion:Jr.string(),userAgent:Wna.optional()});var $na=Jr.objectWithoutOptionalProperties({isAuthMandatory:Jr.boolean(),hasStreamingEndpoints:Jr.boolean(),hasPaginatedEndpoints:Jr.boolean(),hasFileDownloadEndpoints:Jr.boolean(),platformHeaders:Hna});var Jna=Jr.objectWithoutOptionalProperties({id:g2n,name:vy,type:Jr.lazy(()=>Hb)}).extend(T0);var Gna=Jr.objectWithoutOptionalProperties({typesReferencedOnlyByService:Jr.record(bBt,Jr.list(JV)),sharedTypes:Jr.list(JV)});var Kna=Jr.objectWithoutOptionalProperties({defaultEndpoint:TDr.optional(),bannerLink:Jr.string().optional(),introduction:Jr.string().optional(),apiReferenceLink:Jr.string().optional(),features:Jr.record(Sta,Jr.list(TDr)).optional()});var Yna=Jr.string();var Xna=Jr.objectWithoutOptionalProperties({id:Yna,protoRootUrl:Jr.string()});var Qna=Jr.union("type",{proto:Xna,openapi:Jr.object({})}).transform({transform:e=>{switch(e.type){case"proto":return rne.proto(e);case"openapi":return rne.openapi();default:return e}},untransform:({_visit:e,...t})=>t});var Zna=Jr.objectWithoutOptionalProperties({sources:Jr.list(Qna)});var kna=Jr.objectWithoutOptionalProperties({apiKey:Jr.string(),workspaceId:Jr.string(),collectionId:Jr.string().optional()});var R2n=Jr.union("type",{postman:kna}).transform({transform:e=>{switch(e.type){case"postman":return l2n.postman(e);default:return e}},untransform:({_visit:e,...t})=>t});var eia=Jr.objectWithoutOptionalProperties({owner:Jr.string(),repo:Jr.string(),target:R2n});var tia=Jr.objectWithoutOptionalProperties({target:R2n});var ria=Jr.union("type",{github:eia,direct:tia}).transform({transform:e=>{switch(e.type){case"github":return Q3r.github(e);case"direct":return Q3r.direct(e);default:return e}},untransform:({_visit:e,...t})=>t});var REl=Jr.objectWithoutOptionalProperties({fdrApiDefinitionId:Jr.string().optional(),apiVersion:Ira.optional(),apiName:vy,apiDisplayName:Jr.string().optional(),apiDocs:Jr.string().optional(),auth:jta,headers:Jr.list(oQ),idempotencyHeaders:Jr.list(oQ),types:Jr.record(JV,bna),services:Jr.record(bBt,zra),webhookGroups:Jr.record(y2n,Ena),websocketChannels:Jr.record(v2n,Rna).optional(),errors:Jr.record(iNr,Bta),subpackages:Jr.record(gBt,Lna),rootPackage:I2n,constants:Eta,environments:Nta.optional(),basePath:wCt.optional(),pathParameters:Jr.list(DCt),errorDiscriminationStrategy:Vna,sdkConfig:$na,variables:Jr.list(Jna),serviceTypeReferenceInfo:Gna,readmeConfig:Kna.optional(),sourceConfig:Zna.optional(),publishConfig:ria.optional()});var sKo={};Wb(sKo,{CsharpProtobufFileOptions:()=>Tra,ProtobufFile:()=>q2n,ProtobufFileOptions:()=>qra,ProtobufService:()=>Cra,ProtobufType:()=>yna,UserDefinedProtobufType:()=>hna,WellKnownProtobufType:()=>_na});var cKo={};Wb(cKo,{DirectPublish:()=>tia,GithubPublish:()=>eia,PostmanPublishTarget:()=>kna,PublishTarget:()=>R2n,PublishingConfig:()=>ria});var lKo={};Wb(lKo,{AliasTypeDeclaration:()=>ana,Base64Type:()=>tna,BigIntegerType:()=>rna,BooleanType:()=>Yra,ContainerType:()=>N2n,DateTimeType:()=>kra,DateType:()=>Zra,DeclaredTypeName:()=>GA,DoubleType:()=>Kra,DoubleValidationRules:()=>Gra,Encoding:()=>T2n,EnumTypeDeclaration:()=>C2n,EnumTypeReference:()=>FEl,EnumValue:()=>qDr,ExampleAliasType:()=>sia,ExampleContainer:()=>via,ExampleDatetime:()=>yia,ExampleEnumType:()=>uia,ExampleKeyValuePair:()=>wia,ExampleListContainer:()=>mia,ExampleLiteralContainer:()=>gia,ExampleMapContainer:()=>jia,ExampleNamedType:()=>bia,ExampleObjectProperty:()=>fia,ExampleObjectType:()=>F2n,ExampleObjectTypeWithTypeId:()=>_ia,ExampleOptionalContainer:()=>Pia,ExamplePrimitive:()=>L2n,ExampleSetContainer:()=>Oia,ExampleSingleUnionType:()=>dia,ExampleSingleUnionTypeProperties:()=>pia,ExampleType:()=>lli,ExampleTypeReference:()=>kj,ExampleTypeReferenceShape:()=>hia,ExampleTypeShape:()=>z2n,ExampleUndiscriminatedUnionType:()=>lia,ExampleUnionType:()=>cia,FloatType:()=>Jra,IntegerType:()=>Vra,IntegerValidationRules:()=>Ura,JsonEncoding:()=>Mra,Literal:()=>aia,LongType:()=>Wra,MapType:()=>oia,NamedType:()=>iia,NamedTypeDefault:()=>nia,ObjectProperty:()=>iQ,ObjectTypeDeclaration:()=>ona,PrimitiveType:()=>A2n,PrimitiveTypeV1:()=>Lra,PrimitiveTypeV2:()=>nna,ProtoEncoding:()=>xra,ResolvedNamedType:()=>Fra,ResolvedTypeReference:()=>ina,ShapeType:()=>Rra,SingleUnionType:()=>cna,SingleUnionTypeProperties:()=>sna,SingleUnionTypeProperty:()=>una,Source:()=>vna,StringType:()=>Qra,StringValidationRules:()=>Xra,Type:()=>pna,TypeDeclaration:()=>bna,TypeReference:()=>Hb,Uint64Type:()=>$ra,UintType:()=>Hra,UndiscriminatedUnionMember:()=>fna,UndiscriminatedUnionTypeDeclaration:()=>dna,UnionTypeDeclaration:()=>lna,UuidType:()=>ena});var nia=Jr.union("type",{enum:qDr}).transform({transform:e=>{switch(e.type){case"enum":return f2n.enum(e);default:return e}},untransform:({_visit:e,...t})=>t});var iia=Jr.objectWithoutOptionalProperties({typeId:JV,fernFilepath:DTe,name:vy,default:nia.optional(),inline:Jr.boolean().optional()});var Hb=Jr.union(Jr.discriminant("type","_type"),{container:Jr.object({container:Jr.lazy(()=>N2n)}),named:iia,primitive:Jr.object({primitive:A2n}),unknown:Jr.object({})}).transform({transform:e=>{switch(e.type){case"container":return S2.container(e.container);case"named":return S2.named(e);case"primitive":return S2.primitive(e.primitive);case"unknown":return S2.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var FEl=Jr.objectWithoutOptionalProperties({default:qDr.optional(),name:GA});var aia=Jr.union("type",{string:Jr.object({string:Jr.string()}),boolean:Jr.object({boolean:Jr.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return OTe.string(e.string);case"boolean":return OTe.boolean(e.boolean);default:return e}},untransform:({_visit:e,...t})=>t});var N2n=Jr.union(Jr.discriminant("type","_type"),{list:Jr.object({list:Jr.lazy(()=>Hb)}),map:Jr.lazyObject(()=>oia),optional:Jr.object({optional:Jr.lazy(()=>Hb)}),set:Jr.object({set:Jr.lazy(()=>Hb)}),literal:Jr.object({literal:aia})}).transform({transform:e=>{switch(e.type){case"list":return MC.list(e.list);case"map":return MC.map(e);case"optional":return MC.optional(e.optional);case"set":return MC.set(e.set);case"literal":return MC.literal(e.literal);default:return e}},untransform:({_visit:e,...t})=>t});var oia=Jr.objectWithoutOptionalProperties({keyType:Jr.lazy(()=>Hb),valueType:Jr.lazy(()=>Hb)});var uia=Jr.objectWithoutOptionalProperties({value:Um});var z2n=Jr.union("type",{alias:Jr.lazyObject(()=>sia),enum:uia,object:Jr.lazyObject(()=>F2n),union:Jr.lazyObject(()=>cia),undiscriminatedUnion:Jr.lazyObject(()=>lia)}).transform({transform:e=>{switch(e.type){case"alias":return mM.alias(e);case"enum":return mM.enum(e);case"object":return mM.object(e);case"union":return mM.union(e);case"undiscriminatedUnion":return mM.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var sia=Jr.objectWithoutOptionalProperties({value:Jr.lazyObject(()=>kj)});var F2n=Jr.objectWithoutOptionalProperties({properties:Jr.list(Jr.lazyObject(()=>fia))});var fia=Jr.objectWithoutOptionalProperties({name:Um,value:Jr.lazyObject(()=>kj),originalTypeDeclaration:GA});var cia=Jr.objectWithoutOptionalProperties({discriminant:Um,singleUnionType:Jr.lazyObject(()=>dia)});var lia=Jr.objectWithoutOptionalProperties({index:Jr.number(),singleUnionType:Jr.lazyObject(()=>kj)});var dia=Jr.objectWithoutOptionalProperties({wireDiscriminantValue:Um,shape:Jr.lazy(()=>pia)});var pia=Jr.union("type",{samePropertiesAsObject:Jr.lazyObject(()=>_ia),singleProperty:Jr.lazyObject(()=>kj),noProperties:Jr.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return D3.samePropertiesAsObject(e);case"singleProperty":return D3.singleProperty(e);case"noProperties":return D3.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var kj=Jr.objectWithoutOptionalProperties({shape:Jr.lazy(()=>hia)}).extend(OBt);var yia=Jr.objectWithoutOptionalProperties({datetime:Jr.date(),raw:Jr.string().optional()});var L2n=Jr.union("type",{integer:Jr.object({integer:Jr.number()}),long:Jr.object({long:Jr.number()}),uint:Jr.object({uint:Jr.number()}),uint64:Jr.object({uint64:Jr.number()}),float:Jr.object({float:Jr.number()}),double:Jr.object({double:Jr.number()}),boolean:Jr.object({boolean:Jr.boolean()}),string:Jr.object({string:wta}),date:Jr.object({date:Jr.string()}),datetime:yia,uuid:Jr.object({uuid:Jr.string()}),base64:Jr.object({base64:Jr.string()}),bigInteger:Jr.object({bigInteger:Jr.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Xv.integer(e.integer);case"long":return Xv.long(e.long);case"uint":return Xv.uint(e.uint);case"uint64":return Xv.uint64(e.uint64);case"float":return Xv.float(e.float);case"double":return Xv.double(e.double);case"boolean":return Xv.boolean(e.boolean);case"string":return Xv.string(e.string);case"date":return Xv.date(e.date);case"datetime":return Xv.datetime(e);case"uuid":return Xv.uuid(e.uuid);case"base64":return Xv.base64(e.base64);case"bigInteger":return Xv.bigInteger(e.bigInteger);default:return e}},untransform:({_visit:e,...t})=>t});var hia=Jr.union("type",{primitive:Jr.object({primitive:L2n}),container:Jr.object({container:Jr.lazy(()=>via)}),unknown:Jr.object({unknown:Jr.unknown()}),named:Jr.lazyObject(()=>bia)}).transform({transform:e=>{switch(e.type){case"primitive":return Q0.primitive(e.primitive);case"container":return Q0.container(e.container);case"unknown":return Q0.unknown(e.unknown);case"named":return Q0.named(e);default:return e}},untransform:({_visit:e,...t})=>t});var gia=Jr.objectWithoutOptionalProperties({literal:L2n});var via=Jr.union("type",{list:Jr.lazyObject(()=>mia),set:Jr.lazyObject(()=>Oia),optional:Jr.lazyObject(()=>Pia),map:Jr.lazyObject(()=>jia),literal:gia}).transform({transform:e=>{switch(e.type){case"list":return _T.list(e);case"set":return _T.set(e);case"optional":return _T.optional(e);case"map":return _T.map(e);case"literal":return _T.literal(e);default:return e}},untransform:({_visit:e,...t})=>t});var mia=Jr.objectWithoutOptionalProperties({list:Jr.list(Jr.lazyObject(()=>kj)),itemType:Jr.lazy(()=>Hb)});var Oia=Jr.objectWithoutOptionalProperties({set:Jr.list(Jr.lazyObject(()=>kj)),itemType:Jr.lazy(()=>Hb)});var Pia=Jr.objectWithoutOptionalProperties({optional:Jr.lazyObject(()=>kj).optional(),valueType:Jr.lazy(()=>Hb)});var jia=Jr.objectWithoutOptionalProperties({map:Jr.list(Jr.lazyObject(()=>wia)),keyType:Jr.lazy(()=>Hb),valueType:Jr.lazy(()=>Hb)});var wia=Jr.objectWithoutOptionalProperties({key:Jr.lazyObject(()=>kj),value:Jr.lazyObject(()=>kj)});var bia=Jr.objectWithoutOptionalProperties({typeName:GA,shape:Jr.lazy(()=>z2n)});var _ia=Jr.objectWithoutOptionalProperties({typeId:JV,object:Jr.lazyObject(()=>F2n)});var fKo={};Wb(fKo,{VariableDeclaration:()=>Jna,VariableId:()=>g2n});var dKo={};Wb(dKo,{ExampleWebhookCall:()=>Dna,InlinedWebhookPayload:()=>Pna,InlinedWebhookPayloadProperty:()=>Ona,Webhook:()=>Sna,WebhookGroup:()=>Ena,WebhookHttpMethod:()=>mna,WebhookName:()=>gna,WebhookPayload:()=>wna,WebhookPayloadReference:()=>jna});var pKo={};Wb(pKo,{ExampleWebSocketMessage:()=>Bna,ExampleWebSocketMessageBody:()=>zna,ExampleWebSocketSession:()=>Ina,InlinedWebSocketMessageBody:()=>qna,InlinedWebSocketMessageBodyProperty:()=>Tna,WebSocketChannel:()=>Rna,WebSocketMessage:()=>Nna,WebSocketMessageBody:()=>Ana,WebSocketMessageBodyReference:()=>Cna,WebSocketMessageId:()=>B2n,WebSocketMessageOrigin:()=>xna,WebSocketName:()=>Mna});var uQ={integer:"integer",long:"long",uint:"uint",uint64:"uint64",float:"float",double:"double",boolean:"boolean",string:"string",datetime:"datetime",base64:"base64",uuid:"uuid",date:"date",bigint:"bigint",unknown:"unknown"};var Eje={MAP:/^map<\s*([^,]*)\s*,\s*(.*)\s*>$/,LIST:/^list<\s*(.*)\s*>$/,SET:/^set<\s*(.*)\s*>$/,OPTIONAL:/^optional<\s*(.*)\s*>$/,LITERAL:/^literal<\s*(?:"(.*)"|(true|false))\s*>$/};function wZr({type:e,_default:t,validation:r,visitor:n}){switch(e){case uQ.integer:{let c=r??void 0;return n.primitive({v1:ID.Integer,v2:gM.integer({default:t??void 0,validation:c!=null?{min:c.min,max:c.max,exclusiveMin:c.exclusiveMin,exclusiveMax:c.exclusiveMax,multipleOf:c.multipleOf}:void 0})})}case uQ.double:{let c=r??void 0;return n.primitive({v1:ID.Double,v2:gM.double({default:t??void 0,validation:c!=null?{min:c.min,max:c.max,exclusiveMin:c.exclusiveMin,exclusiveMax:c.exclusiveMax,multipleOf:c.multipleOf}:void 0})})}case uQ.string:{let c=r??void 0;return n.primitive({v1:ID.String,v2:gM.string({default:t??void 0,validation:c!=null?{format:c.format,pattern:c.pattern,minLength:c.minLength,maxLength:c.maxLength}:void 0})})}case uQ.float:return n.primitive({v1:ID.Float,v2:void 0});case uQ.long:return n.primitive({v1:ID.Long,v2:void 0});case uQ.boolean:return n.primitive({v1:ID.Boolean,v2:void 0});case uQ.datetime:return n.primitive({v1:ID.DateTime,v2:void 0});case uQ.date:return n.primitive({v1:ID.Date,v2:void 0});case uQ.uuid:return n.primitive({v1:ID.Uuid,v2:void 0});case uQ.base64:return n.primitive({v1:ID.Base64,v2:void 0});case uQ.bigint:return n.primitive({v1:ID.BigInteger,v2:void 0});case uQ.uint:return n.primitive({v1:ID.Uint,v2:void 0});case uQ.uint64:return n.primitive({v1:ID.Uint64,v2:void 0});case uQ.unknown:return n.unknown()}let i=e.match(Eje.MAP);if((i==null?void 0:i[1])!=null&&i[2]!=null)return n.map({keyType:i[1],valueType:i[2]});let a=e.match(Eje.LIST);if((a==null?void 0:a[1])!=null)return n.list(a[1]);let u=e.match(Eje.SET);if((u==null?void 0:u[1])!=null)return n.set(u[1]);let f=e.match(Eje.OPTIONAL);if((f==null?void 0:f[1])!=null)return n.optional(f[1]);let d=e.match(Eje.LITERAL);if((d==null?void 0:d[1])!=null)return n.literal(OTe.string(d[1]));if((d==null?void 0:d[2])!=null){let c=d[2];switch(c){case"false":return n.literal(OTe.boolean(!1));case"true":return n.literal(OTe.boolean(!0));default:throw new Error(`Unsupported literal value: ${c}`)}}return n.named(e)}var LEl="bytes";function cNr(e){if(e===LEl)return{isOptional:!1};let t=e.match(Eje.OPTIONAL);if((t==null?void 0:t[1])===LEl)return{isOptional:!0}}function fli(e){let t=typeof e=="string"?e:typeof e.body=="string"?e.body:void 0;if(t!=null)return cNr(t)}var _Ko="file";function UEl(e){let t=e.match(Eje.LIST);return(t==null?void 0:t[1])===_Ko}function STe(e){if(e===_Ko)return{isOptional:!1,isArray:!1};let t=e.match(Eje.OPTIONAL);if((t==null?void 0:t[1])!==void 0){if(t[1]===_Ko)return{isOptional:!0,isArray:!1};if(UEl(t[1]))return{isOptional:!0,isArray:!0}}if(UEl(e))return{isOptional:!1,isArray:!0}}function htP(e){var t;return typeof e=="string"?!1:!!((((t=sA.parse(e["content-type"]))==null?void 0:t.isMultiPartFormData())??!1)||e.body!=null&&dA(e.body)&&Object.values(e.body.properties??[]).some(r=>(typeof r=="string"?r:r.type)==="file"))}function DZr(e){if(!(!htP(e)||e.body==null)&&e.name!=null&&e.body!=null&&dA(e.body))return ytP(e.name,e.body)}function ytP(e,t){let r=Object.entries(t.properties??[]).reduce((n,[i,a])=>{let u=typeof a!="string"?a.docs:void 0,f=typeof a!="string"?a["content-type"]:void 0,d=STe(typeof a=="string"?a:a.type);return d!=null?n.push({isFile:!0,key:i,docs:u,isOptional:d.isOptional,isArray:d.isArray,contentType:f}):n.push({isFile:!1,key:i,propertyType:a,docs:u,contentType:f}),n},[]);return t["extra-properties"],{name:e,extends:t.extends,properties:r}}var VEl="text";function dli(e){if(e===VEl)return{isOptional:!1};let t=e.match(Eje.OPTIONAL);if((t==null?void 0:t[1])===VEl)return{isOptional:!0}}function BJ({type:e,_default:t,validation:r,visitor:n}){return wZr({type:e,_default:t,validation:r,visitor:{primitive:n.primitive,map:({keyType:i,valueType:a})=>n.map({keyType:BJ({type:i,_default:void 0,validation:void 0,visitor:n}),valueType:BJ({type:a,_default:void 0,validation:void 0,visitor:n})}),list:i=>n.list(BJ({type:i,_default:void 0,validation:void 0,visitor:n})),set:i=>n.set(BJ({type:i,_default:void 0,validation:void 0,visitor:n})),optional:i=>n.optional(BJ({type:i,_default:t,validation:r,visitor:n})),literal:n.literal,named:n.named,unknown:n.unknown}})}function hKo(e,t){if(vtP(e))return t.sdk(e);if(btP(e))return t.language(e);Ol(e)}function vtP(e){return e.sdk!=null}function btP(e){return e.language!=null}function WEl(e){return e["response-stream"]!=null&&(typeof e["response-stream"]=="string"||e["response-stream"].format==null||e["response-stream"].format==="json")}function HEl(e){return e["response-stream"]!=null&&typeof e["response-stream"]!="string"&&e["response-stream"].format==="sse"}function SZr(e,t,r){return gtP(e,t)?r.stream(t):mtP(e,t)?r.events(t):r.body(t)}function gtP(e,t){return t.stream!==void 0&&WEl(e)}function mtP(e,t){return t.stream!==void 0&&HEl(e)}function pli(e,t){if($El(e))return t.single(e);if(JEl(e))return t.any(e);Ol(e)}function $El(e){return typeof e=="string"||e.scheme!=null}function JEl(e){let[t,...r]=Object.keys(e);return t==="any"&&r.length===0}function yKo(e,t){if(GEl(e))return t.header(e);switch(e.scheme){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"oauth":return t.oauth(e);default:Ol(e)}}function GEl(e){return e.header!=null}function CDr(e,t){if(KEl(e))return t.singleBaseUrl(e);if(U2n(e))return t.multipleBaseUrls(e);Ol(e)}function KEl(e){return typeof e=="string"||"url"in e}function U2n(e){return typeof e!="string"&&"urls"in e}function V2n(e){return typeof e=="string"?e.startsWith("$"):"variable"in e}function y5(e,t){if(W2n(e))return t.alias(e);if(lNr(e))return t.discriminatedUnion(e);if(LE(e))return t.object(e);if(H2n(e))return t.undiscriminatedUnion(e);if(SCt(e))return t.enum(e);Ol(e)}function W2n(e){return typeof e=="string"||e.type!=null}function LE(e){return e.extends!=null||e.properties!=null}function lNr(e){return e.union!=null&&e.discriminated==null}function H2n(e){let t=e;return t.union!=null&&t.discriminated!=null}function SCt(e){return e.enum!=null}var _li=class{REFERENCE_REGEX=/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/]*)$/;validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let n=t.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};var OtP=nr.strictObject({"title-as-schema-name":nr.optional(nr.boolean()),"optional-additional-properties":nr.optional(nr.boolean())}),PtP=nr.strictObject({openapi:nr.string(),overrides:nr.string().optional(),namespace:nr.string().optional(),settings:nr.optional(OtP)}),jtP=nr.strictObject({"title-as-schema-name":nr.optional(nr.boolean()),"optional-additional-properties":nr.optional(nr.boolean())}),wtP=nr.strictObject({asyncapi:nr.string(),overrides:nr.string().optional(),namespace:nr.string().optional(),settings:nr.optional(jtP)}),DtP=nr.union([PtP,wtP]),YEl=nr.object({auth:nr.optional(t8.ApiAuthSchema),specs:nr.array(DtP)}).extend(t8.WithHeadersSchema.shape).extend(t8.WithEnvironmentsSchema.shape);var bKo=nr.string().describe("Path to the OpenAPI, AsyncAPI or Fern Definition"),EZr=nr.object({"use-title":nr.optional(nr.boolean()).describe("Whether to use the titles of the schemas within an OpenAPI definition as the names of the types within Fern. Defaults to true."),unions:nr.optional(nr.enum(["v1"])).describe("What version of union generation to use, this will grow over time. Defaults to v0."),"message-naming":nr.optional(nr.enum(["v1","v2"])).describe("What version of message naming to use for AsyncAPI messages, this will grow over time. Defaults to v1.")}),QEl=nr.object({path:bKo,origin:nr.optional(nr.string()).describe("The URL of the API definition origin, from which the file should be polled."),overrides:nr.optional(nr.string()).describe("Path to the OpenAPI or AsyncAPI overrides"),audiences:nr.optional(nr.array(nr.string())).describe("Audiences that you would like to filter to"),settings:nr.optional(EZr)}),StP=nr.strictObject({root:nr.string().describe("The path to the `.proto` directroy root (e.g. `proto`)."),target:nr.string().describe("The path to the target `.proto` file that defines the API (e.g. `proto/user/v1/user.proto`)."),overrides:nr.optional(nr.string()).describe("Path to the overrides configuration"),"local-generation":nr.optional(nr.boolean()).describe("Whether to compile the `.proto` files locally. By default, we generate remotely.")}),ZEl=nr.strictObject({proto:StP}),EtP=nr.array(nr.union([bKo,QEl,ZEl])),XEl=nr.union([bKo,QEl,EtP,ZEl]),kEl=nr.union([XEl,nr.strictObject({namespaces:nr.record(XEl)}),YEl]);var eMl=nr.strictObject({location:nr.literal("local-file-system"),path:nr.string()});var MtP=nr.strictObject({keyId:nr.string(),password:nr.string(),secretKey:nr.string()}),tMl=nr.strictObject({location:nr.literal("maven"),url:nr.optional(nr.string()),coordinate:nr.string(),username:nr.optional(nr.string()),password:nr.optional(nr.string()),signature:nr.optional(MtP)});var rMl=nr.strictObject({location:nr.literal("npm"),url:nr.optional(nr.string()),"package-name":nr.string(),token:nr.optional(nr.string())});var nMl=nr.strictObject({location:nr.literal("nuget"),url:nr.optional(nr.string()),"package-name":nr.string(),"api-key":nr.optional(nr.string())});var iMl=nr.strictObject({location:nr.literal("postman"),"api-key":nr.string(),"workspace-id":nr.string(),"collection-id":nr.string().optional()});var xtP=nr.strictObject({name:nr.string(),email:nr.string()}),$2n=nr.strictObject({description:nr.optional(nr.string()),authors:nr.optional(nr.array(xtP))});var aMl=$2n.extend({keywords:nr.optional(nr.array(nr.string())),"documentation-link":nr.optional(nr.string()),"homepage-link":nr.optional(nr.string())});var oMl=nr.strictObject({location:nr.literal("pypi"),url:nr.optional(nr.string()),"package-name":nr.string(),token:nr.optional(nr.string()),username:nr.optional(nr.string()),password:nr.optional(nr.string()),metadata:nr.optional(aMl)});var uMl=nr.strictObject({location:nr.literal("rubygems"),url:nr.optional(nr.string()),"package-name":nr.string(),"api-key":nr.optional(nr.string())});var sMl=nr.discriminatedUnion("location",[rMl,tMl,oMl,iMl,eMl,nMl,uMl]);var cMl=nr.strictObject({custom:nr.string()});var fNr=nr.union([nr.enum(["MIT","Apache-2.0"]),cMl]);var gKo=nr.strictObject({"package-description":nr.optional(nr.string()),email:nr.optional(nr.string()),"reference-url":nr.optional(nr.string()),author:nr.optional(nr.string()),license:nr.optional(fNr)});var lMl=nr.strictObject({path:nr.string().describe("The path to the generated snippets file.")});var fMl=nr.strictObject({repository:nr.string(),license:nr.optional(fNr),mode:nr.optional(nr.enum(["commit","release"]))});var J2n="reviewers",dMl=nr.strictObject({name:nr.string()}),G2n=nr.strictObject({teams:nr.optional(nr.array(dMl)),users:nr.optional(nr.array(dMl))});var pMl=nr.strictObject({repository:nr.string(),branch:nr.optional(nr.string()),license:nr.optional(fNr),mode:nr.literal("pull-request"),[J2n]:nr.optional(G2n)});var _Ml=nr.strictObject({repository:nr.string(),license:nr.optional(fNr),mode:nr.literal("push"),branch:nr.optional(nr.string())});var hMl=nr.union([fMl,pMl,_Ml]);var yMl=nr.strictObject({name:nr.string(),version:nr.string(),output:nr.optional(sMl),github:nr.optional(hMl),config:nr.unknown(),metadata:nr.optional(gKo),keywords:nr.optional(nr.array(nr.string())),snippets:nr.optional(lMl),"ir-version":nr.optional(nr.string()),"smart-casing":nr.optional(nr.boolean()),api:nr.optional(nr.object({settings:nr.optional(EZr)})),"disable-examples":nr.optional(nr.boolean()),"publish-metadata":nr.optional(gKo)});var vMl=nr.strictObject({audiences:nr.optional(nr.array(nr.string())),generators:nr.array(yMl),metadata:nr.optional($2n),[J2n]:nr.optional(G2n)});var TtP="disable-examples",bMl=nr.strictObject({path:nr.string(),origin:nr.optional(nr.string()),overrides:nr.optional(nr.string()),[TtP]:nr.optional(nr.boolean()),settings:EZr});var gMl=nr.union([bMl,nr.string()]);var mMl=nr.strictObject({method:nr.string(),path:nr.string(),stream:nr.optional(nr.boolean())});var mKo=nr.union([nr.string().describe("Endpoint name in 'POST /users' format"),mMl]);var OMl=nr.strictObject({bannerLink:nr.optional(nr.string()),introduction:nr.optional(nr.string()),apiReferenceLink:nr.optional(nr.string()),defaultEndpoint:nr.optional(mKo).describe("If set, use this endpoint's snippet as the default whenever possible"),features:nr.optional(nr.record(nr.array(mKo))).describe("Specifies a list of endpoints associated with the feature")});var PMl=nr.strictObject({username:nr.string(),email:nr.string(),token:nr.string()});var jMl=nr.strictObject({github:nr.optional(PMl)});var kQr="default-group",hli="openapi",OKo="openapi-overrides",yli="spec-origin",vli="async-api",PKo="api-settings",wMl=nr.strictObject({"auth-schemes":nr.optional(nr.record(t8.AuthSchemeDeclarationSchema)),api:nr.optional(kEl),whitelabel:nr.optional(jMl),metadata:nr.optional($2n),readme:nr.optional(OMl),[kQr]:nr.optional(nr.string()),groups:nr.optional(nr.record(vMl)),[J2n]:nr.optional(G2n),[hli]:nr.optional(gMl),[OKo]:nr.optional(nr.string()),[yli]:nr.optional(nr.string()),[vli]:nr.optional(nr.string()),[PKo]:nr.optional(EZr)});async function MMl({absolutePathToGeneratorsConfiguration:e,rawGeneratorsConfiguration:t}){let r=qMl(t.metadata),n=t.readme,i=await CtP(t);return{absolutePathToConfiguration:e,api:i,rawConfiguration:t,defaultGroup:t["default-group"],reviewers:t.reviewers,groups:t.groups!=null?await Promise.all(Object.entries(t.groups).map(([a,u])=>AtP({absolutePathToGeneratorsConfiguration:e,groupName:a,group:u,maybeTopLevelMetadata:r,maybeTopLevelReviewers:t.reviewers,readme:n}))):[],whitelabel:t.whitelabel!=null&&t.whitelabel.github!=null?{github:t.whitelabel.github}:void 0}}async function DMl(e,t){var n,i,a,u,f,d,c,o;let r=[];if(e!=null)if(typeof e=="string")r.push({schema:{type:"oss",path:e},origin:void 0,overrides:void 0,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}});else if(Tci(e))r.push({schema:{type:"protobuf",root:e.proto.root,target:e.proto.target,localGeneration:e.proto["local-generation"]??!1},origin:void 0,overrides:e.proto.overrides,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}});else if(Array.isArray(e))for(let l of e)typeof l=="string"?r.push({schema:{type:"oss",path:l},origin:void 0,overrides:void 0,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}):Tci(l)?r.push({schema:{type:"protobuf",root:l.proto.root,target:l.proto.target,localGeneration:l.proto["local-generation"]??!1},origin:void 0,overrides:l.proto.overrides,audiences:[],settings:{shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}):r.push({schema:{type:"oss",path:l.path},origin:l.origin,overrides:l.overrides,audiences:l.audiences,settings:{shouldUseTitleAsName:(n=l.settings)==null?void 0:n["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:((i=l.settings)==null?void 0:i.unions)==="v1",asyncApiMessageNaming:(a=l.settings)==null?void 0:a["message-naming"],shouldUseOptionalAdditionalProperties:void 0}});else r.push({schema:{type:"oss",path:e.path},origin:e.origin,overrides:e.overrides,audiences:e.audiences,settings:{shouldUseTitleAsName:(u=e.settings)==null?void 0:u["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:((f=e.settings)==null?void 0:f.unions)==="v1",asyncApiMessageNaming:(d=e.settings)==null?void 0:d["message-naming"],shouldUseOptionalAdditionalProperties:void 0}});else{let l=t[hli],g=t[yli],O=t[OKo],j=t[vli],S=t[PKo];l!=null&&typeof l=="string"?r.push({schema:{type:"oss",path:l},origin:g,overrides:O,audiences:[],settings:{shouldUseTitleAsName:S==null?void 0:S["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:(S==null?void 0:S.unions)==="v1",asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}):l!=null&&r.push({schema:{type:"oss",path:l.path},origin:l.origin,overrides:l.overrides,audiences:[],settings:{shouldUseTitleAsName:(c=l.settings)==null?void 0:c["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:((o=l.settings)==null?void 0:o.unions)==="v1",asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:void 0}}),j!=null&&r.push({schema:{type:"oss",path:j},origin:g,overrides:void 0,audiences:[],settings:{shouldUseTitleAsName:S==null?void 0:S["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:(S==null?void 0:S.unions)==="v1",asyncApiMessageNaming:S==null?void 0:S["message-naming"],shouldUseOptionalAdditionalProperties:void 0}})}return r}async function qtP({apiConfiguration:e,rawConfiguration:t}){var a,u,f;let r=[],n={};for(let d of e.specs)if(bZi(d)){let c={schema:{type:"oss",path:d.openapi},origin:void 0,overrides:d.overrides,audiences:[],settings:{shouldUseTitleAsName:(a=d.settings)==null?void 0:a["title-as-schema-name"],shouldUseUndiscriminatedUnionsWithLiterals:void 0,asyncApiMessageNaming:void 0,shouldUseOptionalAdditionalProperties:((u=d.settings)==null?void 0:u["optional-additional-properties"])??!0}};d.namespace==null?r.push(c):(n[f=d.namespace]??(n[f]=[]),n[d.namespace].push(c))}let i={"auth-schemes":e.auth!=null?Object.fromEntries(Object.entries(t["auth-schemes"]??{}).filter(([d,c])=>e.auth==null?!1:pli(e.auth,{any:o=>o.any.includes(d),single:o=>o===d}))):void 0,...e};return Object.keys(n).length===0?{type:"singleNamespace",definitions:r,...i}:{type:"multiNamespace",rootDefinitions:r,definitions:n,...i}}async function CtP(e){let t=e.api;if(t!=null&&vZi(t))return qtP({apiConfiguration:t,rawConfiguration:e});if(RO(t)&&"namespaces"in t){let r={};for(let[n,i]of Object.entries(t.namespaces))r[n]=await DMl(i,e);return{type:"multiNamespace",rootDefinitions:void 0,definitions:r}}return{type:"singleNamespace",definitions:await DMl(t,e)}}async function AtP({absolutePathToGeneratorsConfiguration:e,groupName:t,group:r,maybeTopLevelMetadata:n,maybeTopLevelReviewers:i,readme:a}){let u=qMl(r.metadata);return{groupName:t,reviewers:r.reviewers,audiences:r.audiences==null?{type:"all"}:{type:"select",audiences:r.audiences},generators:await Promise.all(r.generators.map(f=>NtP({absolutePathToGeneratorsConfiguration:e,generator:f,maybeTopLevelMetadata:n,maybeGroupLevelMetadata:u,maybeTopLevelReviewers:i,maybeGroupLevelReviewers:r.reviewers,readme:a})))}}async function NtP({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n,maybeGroupLevelReviewers:i,maybeTopLevelReviewers:a,readme:u}){var f,d,c;return{raw:t,name:t.name,version:t.version,config:t.config,outputMode:await ItP({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n,maybeGroupLevelReviewers:i,maybeTopLevelReviewers:a}),keywords:t.keywords,smartCasing:t["smart-casing"]??!1,disableExamples:t["disable-examples"]??!1,absolutePathToLocalOutput:((f=t.output)==null?void 0:f.location)==="local-file-system"?j2(Cg(e),t.output.path):void 0,absolutePathToLocalSnippets:((d=t.snippets)==null?void 0:d.path)!=null?j2(Cg(e),t.snippets.path):void 0,language:LtP(t.name),irVersionOverride:t["ir-version"]??void 0,publishMetadata:ztP({generatorInvocation:t}),readme:u,settings:((c=t.api)==null?void 0:c.settings)??void 0}}function ztP({generatorInvocation:e}){let t=e["publish-metadata"];if(t!=null)return{packageDescription:t["package-description"],publisherEmail:t.email,publisherName:t.author,referenceUrl:t["reference-url"]};if(e.metadata!=null)return{packageDescription:e.metadata["package-description"],publisherEmail:e.metadata.email,publisherName:e.metadata.author,referenceUrl:e.metadata["reference-url"]}}function xMl({pypiOutputMetadata:e,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r}){let n;return e!=null&&(n=VtP(e),n={...r,...t,...n}),n}function BtP({topLevelReviewers:e,groupLevelReviewers:t,outputModeReviewers:r}){let n=new Set,i=new Set,a=[],u=[...(e==null?void 0:e.teams)??[],...(t==null?void 0:t.teams)??[],...(r==null?void 0:r.teams)??[]],f=[...(e==null?void 0:e.users)??[],...(t==null?void 0:t.users)??[],...(r==null?void 0:r.users)??[]];for(let d of u)n.has(d.name)||(a.push(jKo.GithubPullRequestReviewer.team({name:d.name})),n.add(d.name));for(let d of f)i.has(d.name)||(a.push(jKo.GithubPullRequestReviewer.user({name:d.name})),i.add(d.name));return a}async function ItP({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r={},maybeTopLevelMetadata:n={},maybeGroupLevelReviewers:i,maybeTopLevelReviewers:a}){let u=t.snippets!=null&&t.snippets.path!=="";if(t.github!=null){let f=t.github.repository.indexOf("/"),d=t.github.repository.slice(0,f),c=t.github.repository.slice(f+1),o=t.output!=null?FtP(t.output,r,n):void 0,l=UtP(t),g=l!=null?await RtP({absolutePathToGeneratorsConfiguration:e,githubLicense:l}):void 0,O=t.github.mode??"release";switch(O){case"commit":case"release":return JT.FernFiddle.OutputMode.githubV2(JT.FernFiddle.GithubOutputModeV2.commitAndRelease({owner:d,repo:c,license:g,publishInfo:o,downloadSnippets:u}));case"pull-request":{let j=BtP({topLevelReviewers:a,groupLevelReviewers:i,outputModeReviewers:t.github.reviewers});return JT.FernFiddle.OutputMode.githubV2(JT.FernFiddle.GithubOutputModeV2.pullRequest({owner:d,repo:c,license:g,publishInfo:o,downloadSnippets:u,reviewers:j}))}case"push":return JT.FernFiddle.OutputMode.githubV2(JT.FernFiddle.GithubOutputModeV2.push({owner:d,repo:c,branch:t.github.mode==="push"?t.github.branch:void 0,license:g,publishInfo:o,downloadSnippets:u}));default:Ol(O)}}if(t.output==null)return JT.FernFiddle.remoteGen.OutputMode.publish({registryOverrides:{}});switch(t.output.location){case"local-file-system":return JT.FernFiddle.OutputMode.downloadFiles({downloadSnippets:u});case"npm":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://registry.npmjs.org",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:u}));case"maven":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.mavenOverride({registryUrl:TMl(t.output),username:t.output.username??"",password:t.output.password??"",coordinate:t.output.coordinate,signature:t.output.signature!=null?{keyId:t.output.signature.keyId,secretKey:t.output.signature.secretKey,password:t.output.signature.password}:void 0,downloadSnippets:u}));case"postman":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.postman({apiKey:t.output["api-key"],workspaceId:t.output["workspace-id"]}));case"pypi":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.pypiOverride({registryUrl:t.output.url??"https://upload.pypi.org/legacy/",username:t.output.token!=null?"__token__":t.output.password??"",password:t.output.token??t.output.password??"",coordinate:t.output["package-name"],downloadSnippets:u,pypiMetadata:xMl({pypiOutputMetadata:t.output.metadata,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n})}));case"nuget":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.nugetOverride({registryUrl:t.output.url??"https://nuget.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));case"rubygems":return JT.FernFiddle.OutputMode.publishV2(JT.FernFiddle.remoteGen.PublishOutputModeV2.rubyGemsOverride({registryUrl:t.output.url??"https://rubygems.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));default:Ol(t.output)}}async function RtP({absolutePathToGeneratorsConfiguration:e,githubLicense:t}){if(typeof t=="string")switch(t){case"MIT":return JT.FernFiddle.GithubLicense.basic({id:JT.FernFiddle.GithubLicenseId.Mit});case"Apache-2.0":return JT.FernFiddle.GithubLicense.basic({id:JT.FernFiddle.GithubLicenseId.Apache});default:Ol(t)}let r=pf(I_.of(EMl.default.dirname(e)),zs.of(t.custom)),n=await(0,SMl.readFile)(r);return JT.FernFiddle.GithubLicense.custom({contents:n.toString()})}function FtP(e,t,r){switch(e.location){case"local-file-system":throw new Error("Cannot use local-file-system with github publishing");case"npm":return JT.FernFiddle.GithubPublishInfo.npm({registryUrl:e.url??"https://registry.npmjs.org",packageName:e["package-name"],token:e.token});case"maven":return JT.FernFiddle.GithubPublishInfo.maven({registryUrl:TMl(e),coordinate:e.coordinate,credentials:e.username!=null&&e.password!=null?{username:e.username,password:e.password}:void 0,signature:e.signature!=null?{keyId:e.signature.keyId,password:e.signature.password,secretKey:e.signature.secretKey}:void 0});case"postman":return JT.FernFiddle.GithubPublishInfo.postman({apiKey:e["api-key"],workspaceId:e["workspace-id"]});case"pypi":return JT.FernFiddle.GithubPublishInfo.pypi({registryUrl:e.url??"https://upload.pypi.org/legacy/",packageName:e["package-name"],credentials:e.token!=null?{username:"__token__",password:e.token}:{username:e.username??"",password:e.password??""},pypiMetadata:xMl({pypiOutputMetadata:e.metadata,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r})});case"nuget":return JT.FernFiddle.GithubPublishInfo.nuget({registryUrl:e.url??"https://nuget.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"rubygems":return JT.FernFiddle.GithubPublishInfo.rubygems({registryUrl:e.url??"https://rubygems.org/",packageName:e["package-name"],apiKey:e["api-key"]});default:Ol(e)}}function LtP(e){if(e.includes("typescript"))return K5t.TYPESCRIPT;if(e.includes("java")||e.includes("spring"))return K5t.JAVA;if(e.includes("python")||e.includes("fastapi")||e.includes("pydantic"))return K5t.PYTHON;if(e.includes("go"))return K5t.GO;if(e.includes("ruby"))return K5t.RUBY;if(e.includes("csharp"))return K5t.CSHARP;if(e.includes("swift"))return K5t.SWIFT}function TMl(e){return e.url!=null?e.url:e.signature!=null?"https://oss.sonatype.org/service/local/staging/deploy/maven2/":"https://s01.oss.sonatype.org/content/repositories/releases/"}function UtP(e){var t,r,n;return((t=e["publish-metadata"])==null?void 0:t.license)!=null?e["publish-metadata"].license:((r=e.metadata)==null?void 0:r.license)!=null?e.metadata.license:(n=e.github)==null?void 0:n.license}function qMl(e){var t;return e!=null?{description:e.description,authors:(t=e.authors)==null?void 0:t.map(r=>({name:r.name,email:r.email}))}:void 0}function VtP(e){var t;return e!=null?{description:e.description,authors:(t=e.authors)==null?void 0:t.map(r=>({name:r.name,email:r.email})),keywords:e.keywords,documentationLink:e["documentation-link"],homepageLink:e["homepage-link"]}:void 0}async function wKo({absolutePathToWorkspace:e,context:t}){let r=Dia({absolutePathToWorkspace:e});if(!await Vh(r))return;let n=await(0,CMl.readFile)(r);try{let i=av.load(n.toString());return lMn({schema:wMl,value:i,context:t,filepathBeingParsed:r})}catch(i){if(i instanceof av.YAMLException)t.failAndThrow(`Failed to parse ${AMl.default.relative(process.cwd(),r)}: ${i.reason}`);else throw i}}async function NMl({absolutePathToWorkspace:e,context:t}){let r=await wKo({absolutePathToWorkspace:e,context:t});if(r!=null)return MMl({absolutePathToGeneratorsConfiguration:Dia({absolutePathToWorkspace:e}),rawGeneratorsConfiguration:r})}function Dia({absolutePathToWorkspace:e}){return pf(e,zs.of(a5))}async function yZi({generatorsConfiguration:e,groupName:t=e[kQr],context:r,update:n}){if(t==null)return r.failAndThrow("No group specified.");let i=e.groups??(e.groups={}),a=i[t];if(a==null){let u=i[t]??(i[t]={generators:[]});await n(u,t)}else await n(a,t);return e}var K2n=yu(require("path"),1),FMl=require("url");var zMl=yu(require("process"),1),BMl=yu(require("path"),1),Mia=yu(require("fs"),1),IMl=require("url");var DKo=class{value;next;constructor(t){this.value=t}},PBt,MZr,xZr,bli=class{constructor(){lh(this,PBt,void 0);lh(this,MZr,void 0);lh(this,xZr,void 0);this.clear()}enqueue(t){let r=new DKo(t);yc(this,PBt)?(yc(this,MZr).next=r,pv(this,MZr,r)):(pv(this,PBt,r),pv(this,MZr,r)),X7r(this,xZr)._++}dequeue(){let t=yc(this,PBt);if(!!t)return pv(this,PBt,yc(this,PBt).next),X7r(this,xZr)._--,t.value}clear(){pv(this,PBt,void 0),pv(this,MZr,void 0),pv(this,xZr,0)}get size(){return yc(this,xZr)}*[Symbol.iterator](){let t=yc(this,PBt);for(;t;)yield t.value,t=t.next}};PBt=new WeakMap,MZr=new WeakMap,xZr=new WeakMap;function Sia(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new bli,r=0,n=()=>{r--,t.size>0&&t.dequeue()()},i=async(f,d,c)=>{r++;let o=(async()=>f(...c))();d(o);try{await o}catch{}n()},a=(f,d,c)=>{t.enqueue(i.bind(void 0,f,d,c)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},u=(f,...d)=>new Promise(c=>{a(f,c,d)});return Object.defineProperties(u,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),u}var Eia=class extends Error{constructor(t){super(),this.value=t}},WtP=async(e,t)=>t(await e),HtP=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new Eia(t[0]);return!1};async function SKo(e,t,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=Sia(r),a=[...e].map(f=>[f,i(WtP,f,t)]),u=Sia(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(a.map(f=>u(HtP,f)))}catch(f){if(f instanceof Eia)return f.value;throw f}}var RMl={directory:"isDirectory",file:"isFile"};function $tP(e){if(!Object.hasOwnProperty.call(RMl,e))throw new Error(`Invalid type specified: ${e}`)}var JtP=(e,t)=>t[RMl[e]](),GtP=e=>e instanceof URL?(0,IMl.fileURLToPath)(e):e;async function EKo(e,{cwd:t=zMl.default.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:a}={}){$tP(r),t=GtP(t);let u=n?Mia.promises.stat:Mia.promises.lstat;return SKo(e,async f=>{try{let d=await u(BMl.default.resolve(t,f));return JtP(r,d)}catch{return!1}},{concurrency:i,preserveOrder:a})}var KtP=e=>e instanceof URL?(0,FMl.fileURLToPath)(e):e,YtP=Symbol("findUpStop");async function XtP(e,t={}){let r=K2n.default.resolve(KtP(t.cwd)||""),{root:n}=K2n.default.parse(r),i=K2n.default.resolve(r,t.stopAt||n),a=t.limit||Number.POSITIVE_INFINITY,u=[e].flat(),f=async c=>{if(typeof e!="function")return EKo(u,c);let o=await e(c.cwd);return typeof o=="string"?EKo([o],c):o},d=[];for(;;){let c=await f({...t,cwd:r});if(c===YtP||(c&&d.push(K2n.default.resolve(r,c)),r===i||d.length>=a))break;r=K2n.default.dirname(r)}return d}async function GT(e,t={}){return(await XtP(e,{...t,limit:1}))[0]}async function jBt(e){let t=await GT(e??Yqt,{type:"directory"});if(t==null)return;let r=I_.of(t);if(await Vh(pf(r,zs.of(E8t))))return r}var Puu=yu(ATl(),1),juu=require("fs/promises"),Jif=yu(require("path"),1);var LTl=yu(iXi(),1);var LiP=yu(T3r()),UiP=yu(AQr());var WKo,HKo,$Ko,JKo,ziP=typeof window<"u"&&typeof window.document<"u",BiP=typeof self=="object"&&typeof(self==null?void 0:self.importScripts)=="function"&&(((WKo=self.constructor)===null||WKo===void 0?void 0:WKo.name)==="DedicatedWorkerGlobalScope"||((HKo=self.constructor)===null||HKo===void 0?void 0:HKo.name)==="ServiceWorkerGlobalScope"||(($Ko=self.constructor)===null||$Ko===void 0?void 0:$Ko.name)==="SharedWorkerGlobalScope"),RTl=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",FTl=typeof Bun<"u"&&typeof Bun.version<"u",IiP=typeof process<"u"&&Boolean(process.version)&&Boolean((JKo=process.versions)===null||JKo===void 0?void 0:JKo.node)&&!RTl&&!FTl,RiP=typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative",MCt=FiP();function FiP(){return ziP?{type:"browser",version:window.navigator.userAgent}:BiP?{type:"web-worker"}:RTl?{type:"deno",version:Deno.version.deno}:FTl?{type:"bun",version:Bun.version}:IiP?{type:"node",version:process.versions.node}:RiP?{type:"react-native"}:{type:"unknown"}}var OE7=typeof TextDecoder=="function"?new TextDecoder:void 0,PE7=typeof TextEncoder=="function"?new TextEncoder:void 0,ViP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",WiP=Array.prototype.slice.call(ViP),jE7=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(WiP);var wE7=String.fromCharCode.bind(String),DE7=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):(e,t=r=>r)=>new Uint8Array(Array.prototype.slice.call(e,0).map(t));var ZiP=yu(Nw());var HiP=yu(Nw());var $iP=yu(Nw());var JiP=yu(Nw());var GiP=yu(Nw());var KiP=yu(Nw());var YiP=yu(Nw());var XiP=yu(Nw());var QiP=yu(Nw());function AZr({environment:e="https://registry.buildwithfern.com",token:t}){return new LTl.FernRegistryClient({environment:e,token:t})}var ZAl=yu(QAl(),1);function Qaa({environment:e="https://registry.buildwithfern.com",token:t}){return new ZAl.FernRegistryClient({environment:e,token:t})}var kAl=yu(gZr(),1),e6l=process.env.FERN_FIDDLE_ORIGIN??"https://fiddle-coordinator.buildwithfern.com"??"https://fiddle-coordinator.buildwithfern.com";function iXo(){return e6l}function XDr({token:e}={}){return new kAl.FernFiddleClient({environment:e6l,token:e})}var o8l=yu(E2(),1);function BCt({environment:e="https://venus.buildwithfern.com",token:t}={}){return new o8l.FernVenusApiClient({environment:e,token:t})}var WQo=yu(E2(),1);function u8l(e){if(e.length===0)return"Organization name cannot be empty"}async function eSr({organization:e,token:t,context:r}){let n=BCt({token:t.value});if((await n.organization.get(WQo.FernVenusApi.OrganizationId(e))).ok)return!1;let a=u8l(e);a!=null&&r.failAndThrow(a);let u=await n.organization.create({organizationId:WQo.FernVenusApi.OrganizationId(e)});return u.ok||r.failAndThrow(`Failed to create organization: ${e}`,u.error),!0}var c8l=require("fs/promises");var s8l=require("os"),vbP="token",bbP=".fern";function gua(){return pf(I_.of((0,s8l.homedir)()),zs.of(bbP),zs.of(vbP))}var gbP="FERN_TOKEN";async function pfi(){return await mua()??await Oua()}async function mua(){let e=process.env[gbP];if(e!=null)return{type:"organization",value:e}}async function Oua(){let e=gua();if(!await Vh(e))return;let n=(await(0,c8l.readFile)(e)).toString().trim();if(n.length!==0)return{type:"user",value:n}}var Pua=require("fs/promises"),l8l=yu(require("path"),1);async function HQo(e){let t=gua();await(0,Pua.mkdir)(l8l.default.dirname(t),{recursive:!0}),await(0,Pua.writeFile)(t,e)}async function $Qo({token:e,context:t}){let r=await BCt({token:e.value}).user.getMyself();return r.ok?r.body:t.failAndThrow("Failed to fetch user info")}var Q5l=yu(hZo(),1);function yZo(e){let t=Q5l.default.decode(e.value,{complete:!0});if(t==null)return;let r=t.payload;return typeof r=="string"?void 0:r.sub}async function Z5l(e){return(await BCt({token:e.value}).organization.getMyOrganizationFromScopedToken()).ok}var utu=yu(hZo(),1),WRl=yu(VRl(),1),yxP=(0,WRl.default)({jwksUri:"https://fern-prod.us.auth0.com/.well-known/jwks.json"});async function HRl(e){let t=utu.default.decode(e.value,{complete:!0});if(t==null)return!1;try{let r=await yxP.getSigningKey(t.header.kid);return utu.default.verify(e.value,r.getPublicKey(),{algorithms:["RS256"]}),!0}catch{return!1}}async function stu(){let e=await pfi();if(e==null)return!1;switch(e.type){case"organization":return Z5l(e);case"user":return HRl(e);default:Ol(e)}}var HCt=yu(require("process"),1);function vxP(){return HCt.default.platform!=="win32"?HCt.default.env.TERM!=="linux":Boolean(HCt.default.env.WT_SESSION)||Boolean(HCt.default.env.TERMINUS_SUBLIME)||HCt.default.env.ConEmuTask==="{cmd::Cmder}"||HCt.default.env.TERM_PROGRAM==="Terminus-Sublime"||HCt.default.env.TERM_PROGRAM==="vscode"||HCt.default.env.TERM==="xterm-256color"||HCt.default.env.TERM==="alacritty"||HCt.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var $Rl={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},JRl={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},bxP={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},gxP={...$Rl,...JRl},mxP={...$Rl,...bxP},OxP=vxP(),PxP=OxP?gxP:mxP,n8r=PxP,C37=Object.entries(JRl);var oiu=yu(dca(),1),ZXl=yu(Hfi(),1),sRt=yu(Bje(),1);var M3=yu(Bje(),1);function RFP(e,t){return{value:e,key:t||{}}}function cW(e){let t=(0,M3.fromEvent)(e.input,"keypress",RFP).pipe((0,M3.takeUntil)((0,M3.fromEvent)(e,"close"))).pipe((0,M3.filter)(({key:r})=>r.name!=="enter"&&r.name!=="return"));return{line:(0,M3.fromEvent)(e,"line"),keypress:t,normalizedUpKey:t.pipe((0,M3.filter)(({key:r})=>r.name==="up"||r.name==="k"||r.name==="p"&&r.ctrl),(0,M3.share)()),normalizedDownKey:t.pipe((0,M3.filter)(({key:r})=>r.name==="down"||r.name==="j"||r.name==="n"&&r.ctrl),(0,M3.share)()),numberKey:t.pipe((0,M3.filter)(r=>r.value&&"123456789".includes(r.value)),(0,M3.map)(r=>Number(r.value)),(0,M3.share)()),spaceKey:t.pipe((0,M3.filter)(({key:r})=>r&&r.name==="space"),(0,M3.share)()),aKey:t.pipe((0,M3.filter)(({key:r})=>r&&r.name==="a"),(0,M3.share)()),iKey:t.pipe((0,M3.filter)(({key:r})=>r&&r.name==="i"),(0,M3.share)())}}var KCt=class{constructor(t,r={}){let{isInfinite:n=!0}=r;this.lastIndex=0,this.screen=t,this.isInfinite=n}paginate(t,r,n){n||(n=7);let i=t.split(`
|
|
1758
1758
|
`);if(this.screen&&(i=this.screen.breakLines(i),r=i.map(u=>u.length).splice(0,r).reduce((u,f)=>u+f,0),i=i.flat()),i.length<=n)return t;let a=this.isInfinite?this.getInfiniteLines(i,r,n):this.getFiniteLines(i,r,n);return this.lastIndex=r,a.join(`
|
|
1759
1759
|
`)+`
|
|
1760
1760
|
`+cl.dim("(Move up and down to reveal more choices)")}getInfiniteLines(t,r,n){this.pointer===void 0&&(this.pointer=0);let i=Math.floor(n/2);this.pointer<i&&this.lastIndex<r&&r-this.lastIndex<n&&(this.pointer=Math.min(i,this.pointer+r-this.lastIndex));let a=[t,t,t].flat(),u=Math.max(0,r+t.length-this.pointer);return a.splice(u,n)}getFiniteLines(t,r,n){let i=r-n/2;return i<0?i=0:i+n>t.length&&(i=t.length-n),t.splice(i,n)}};function fSr(e,t,r){let n=r.choices.realLength,i="loop"in r?Boolean(r.loop):!0;if(t==="up")return e>0?e-1:i?n-1:e;if(t==="down")return e<n-1?e+1:i?0:e;throw new Error("dir must be up or down")}var XXl=yu(nHl(),1),QXl=yu(WJl(),1);var aiu=yu(Hfi(),1),QCt=yu(Bje(),1);var unu=yu(require("assert"),1),CKl=yu(EKl(),1),AKl=yu(qKl(),1);var gne=class{constructor(t){this.type="separator",this.line=cl.dim(t||Array.from({length:15}).join(n8r.line))}static exclude(t){return t.type!=="separator"}toString(){return this.line}};var M8r=class{constructor(t,r){if(t instanceof M8r||t.type==="separator")return t;typeof t=="string"||typeof t=="number"?(this.name=String(t),this.value=t,this.short=String(t)):Object.assign(this,t,{name:t.name||t.value,value:"value"in t?t.value:t.name,short:t.short||t.name||t.value}),this.disabled=typeof t.disabled=="function"?t.disabled(r):t.disabled}};var mdi=class{constructor(t,r){this.choices=t.map(n=>n.type==="separator"?(n instanceof gne||(n=new gne(n.line)),n):new M8r(n,r)),this.realChoices=this.choices.filter(gne.exclude).filter(n=>!n.disabled),Object.defineProperty(this,"length",{get(){return this.choices.length},set(n){this.choices.length=n}}),Object.defineProperty(this,"realLength",{get(){return this.realChoices.length},set(){throw new Error("Cannot set `realLength` of a Choices collection")}})}[Symbol.iterator](){let t=this.choices,r=-1;return{next:()=>({value:t[++r],done:!(r in t)})}}getChoice(t){return(0,unu.default)(typeof t=="number"),this.realChoices[t]}get(t){return(0,unu.default)(typeof t=="number"),this.choices[t]}where(t){return(0,CKl.default)(this.realChoices,t)}pluck(t){return(0,AKl.default)(this.realChoices,t)}indexOf(...t){return this.choices.indexOf(...t)}forEach(...t){return this.choices.forEach(...t)}filter(...t){return this.choices.filter(...t)}reduce(...t){return this.choices.reduce(...t)}find(t){return this.choices.find(t)}some(t){return this.choices.some(t)}push(...t){let r=t.map(n=>new M8r(n));return this.choices.push(...r),this.realChoices=this.choices.filter(gne.exclude).filter(n=>!n.disabled),this.choices}};var $Xl=yu(zKl(),1),JXl=yu(aYl(),1),GXl=yu(Tkr(),1),KXl=yu(qkr(),1),iiu=yu(IXl(),1);var NAn=yu(FXl(),1),vpa=function(e,t){e.output.write(NAn.default.cursorBackward(t))},LXl=function(e,t){e.output.write(NAn.default.cursorForward(t))},UXl=function(e,t){e.output.write(NAn.default.cursorUp(t))},niu=function(e,t){e.output.write(NAn.default.cursorDown(t))},Bdi=function(e,t){e.output.write(NAn.default.eraseLines(t))};function WXl(e){return e.split(`
|
|
@@ -1784,7 +1784,7 @@ ${l.indent}`:""}${i4c(o)}:${f.indent?" ":""}`;return u=!1,c=!0,f.objectItem=void
|
|
|
1784
1784
|
`}),r.replaceAll(/\n$/g,"")}function RZP(e){return e?cl.green(n8r.radioOn):n8r.radioOff}var Opa=yu(Bje(),1);function kXl(e,t){return e=String(e),t=typeof t=="string"?t:"*",e.length===0?"":Array.from({length:e.length+1}).join(t)}var Hdi=class extends dR{_run(t){this.done=t;let r=cW(this.rl),n=r.line.pipe((0,Opa.map)(this.filterInput.bind(this))),i=this.handleSubmitEvents(n);return i.success.forEach(this.onEnd.bind(this)),i.error.forEach(this.onError.bind(this)),r.keypress.pipe((0,Opa.takeUntil)(i.success)).forEach(this.onKeypress.bind(this)),this.render(),this}render(t){let r=this.getQuestion(),n="";r+=this.status==="answered"?this.getMaskedValue(this.answer):this.getMaskedValue(this.rl.line||""),t&&(n=`
|
|
1785
1785
|
`+cl.red(">> ")+t),this.screen.render(r,n)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?cl.cyan(kXl(t,this.opt.mask)):cl.italic.dim("[hidden]"):this.opt.mask?kXl(t,this.opt.mask):cl.italic.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(){var t;(t=this.opt).default&&(t.default=void 0),this.render()}};var DZl=yu(wZl(),1),SZl=yu(Bje(),1);var epi=class extends dR{_run(t){this.done=t,this.editorResult=new SZl.Subject;let r=cW(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"?cl.dim("Received"):cl.dim("Press <enter> to launch your preferred editor."),t&&(r=cl.red(">> ")+t),this.screen.render(n,r)}startExternalEditor(){this.rl.pause(),(0,DZl.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 NZl=yu(xZl(),1);var CZl=yu(require("readline"),1),AZl=yu(qZl(),1),Wkr=class{constructor(t){this.rl||(this.rl=CZl.default.createInterface(MkP(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 MkP(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 AZl.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var tpi=class extends Wkr{constructor(t={}){super(t),this.log=(0,NZl.default)(this.writeLog.bind(this)),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return Bdi(this.rl,this.bottomBar.split(`
|
|
1786
1786
|
`).length),this}updateBottomBar(t){return Bdi(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+`
|
|
1787
|
-
`}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&&vpa(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var HZl=yu(IZl(),1),$Zl=yu(anu(),1),JZl=yu(VZl(),1),iq=yu(Bje(),1),GZl=yu(Hfi(),1);var Wpa=yu(Bje(),1),WZl=yu(Hfi(),1),Hpa=function(e,t,r){return typeof e[t]!="function"?(0,Wpa.of)(e):(0,Wpa.from)((0,WZl.default)(e[t])(r).then(n=>(e[t]=n,e)))};var rpi={isPlainObject:HZl.default,set:JZl.default,get:$Zl.default},KAn=class extends Wkr{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=rpi.isPlainObject(r)?{...r}:{},rpi.isPlainObject(t)&&(t=Object.values(t).every(i=>rpi.isPlainObject(i)&&i.name===void 0)?Object.entries(t).map(([i,a])=>({name:i,...a})):[t]);let n=Array.isArray(t)?(0,iq.from)(t):t;return this.process=n.pipe((0,iq.concatMap)(this.processQuestion.bind(this)),(0,iq.publish)()),this.process.connect(),this.process.pipe((0,iq.reduce)((i,a)=>(rpi.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,iq.defer)(()=>(0,iq.of)(t).pipe((0,iq.concatMap)(this.setDefaultType.bind(this)),(0,iq.concatMap)(this.filterIfRunnable.bind(this)),(0,iq.concatMap)(()=>Hpa(t,"message",this.answers)),(0,iq.concatMap)(()=>Hpa(t,"default",this.answers)),(0,iq.concatMap)(()=>Hpa(t,"choices",this.answers)),(0,iq.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,iq.defer)(()=>(0,iq.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,iq.defer)(()=>(0,iq.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&rpi.get(this.answers,t.name)!==void 0)return(0,iq.empty)();if(t.when===!1)return(0,iq.empty)();if(typeof t.when!="function")return(0,iq.of)(t);let{answers:r}=this;return(0,iq.defer)(()=>(0,iq.from)((0,GZl.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,iq.filter)(n=>n!=null)))}};function KZl(e){let t=function(r,n){let i;try{i=new KAn(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",Rdi),this.registerPrompt("input",Bkr),this.registerPrompt("number",Fdi),this.registerPrompt("confirm",Ldi),this.registerPrompt("rawlist",Udi),this.registerPrompt("expand",Vdi),this.registerPrompt("checkbox",Wdi),this.registerPrompt("password",Hdi),this.registerPrompt("editor",epi)},t.restoreDefaultPrompts(),t}var Ziu=KZl();function JkP(e,t){Ziu.registerPrompt(e,t)}function GkP(){Ziu.restoreDefaultPrompts()}var KkP={prompt:Ziu,ui:{BottomBar:tpi,Prompt:KAn},createPromptModule:KZl,registerPrompt:JkP,restoreDefaultPrompts:GkP,Separator:gne},$pa=KkP;var lkl=yu(iau(),1),Gpa=class{posthog;constructor({posthogApiKey:t}){this.posthog=new lkl.PostHog(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.42.
|
|
1787
|
+
`}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&&vpa(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var HZl=yu(IZl(),1),$Zl=yu(anu(),1),JZl=yu(VZl(),1),iq=yu(Bje(),1),GZl=yu(Hfi(),1);var Wpa=yu(Bje(),1),WZl=yu(Hfi(),1),Hpa=function(e,t,r){return typeof e[t]!="function"?(0,Wpa.of)(e):(0,Wpa.from)((0,WZl.default)(e[t])(r).then(n=>(e[t]=n,e)))};var rpi={isPlainObject:HZl.default,set:JZl.default,get:$Zl.default},KAn=class extends Wkr{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=rpi.isPlainObject(r)?{...r}:{},rpi.isPlainObject(t)&&(t=Object.values(t).every(i=>rpi.isPlainObject(i)&&i.name===void 0)?Object.entries(t).map(([i,a])=>({name:i,...a})):[t]);let n=Array.isArray(t)?(0,iq.from)(t):t;return this.process=n.pipe((0,iq.concatMap)(this.processQuestion.bind(this)),(0,iq.publish)()),this.process.connect(),this.process.pipe((0,iq.reduce)((i,a)=>(rpi.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,iq.defer)(()=>(0,iq.of)(t).pipe((0,iq.concatMap)(this.setDefaultType.bind(this)),(0,iq.concatMap)(this.filterIfRunnable.bind(this)),(0,iq.concatMap)(()=>Hpa(t,"message",this.answers)),(0,iq.concatMap)(()=>Hpa(t,"default",this.answers)),(0,iq.concatMap)(()=>Hpa(t,"choices",this.answers)),(0,iq.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,iq.defer)(()=>(0,iq.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,iq.defer)(()=>(0,iq.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&rpi.get(this.answers,t.name)!==void 0)return(0,iq.empty)();if(t.when===!1)return(0,iq.empty)();if(typeof t.when!="function")return(0,iq.of)(t);let{answers:r}=this;return(0,iq.defer)(()=>(0,iq.from)((0,GZl.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,iq.filter)(n=>n!=null)))}};function KZl(e){let t=function(r,n){let i;try{i=new KAn(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",Rdi),this.registerPrompt("input",Bkr),this.registerPrompt("number",Fdi),this.registerPrompt("confirm",Ldi),this.registerPrompt("rawlist",Udi),this.registerPrompt("expand",Vdi),this.registerPrompt("checkbox",Wdi),this.registerPrompt("password",Hdi),this.registerPrompt("editor",epi)},t.restoreDefaultPrompts(),t}var Ziu=KZl();function JkP(e,t){Ziu.registerPrompt(e,t)}function GkP(){Ziu.restoreDefaultPrompts()}var KkP={prompt:Ziu,ui:{BottomBar:tpi,Prompt:KAn},createPromptModule:KZl,registerPrompt:JkP,restoreDefaultPrompts:GkP,Separator:gne},$pa=KkP;var lkl=yu(iau(),1),Gpa=class{posthog;constructor({posthogApiKey:t}){this.posthog=new lkl.PostHog(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.42.11",usingAccessToken:!0}})}flush(){this.posthog.flush()}};var opi=class{async sendEvent(){}async identify(){}async flush(){}};var XAn=require("fs/promises"),Tkl=require("os"),qkl=require("path"),Ckl=yu(iau(),1);var _Rt=yu(xkl(),1),pU7=_Rt.default.v1,_U7=_Rt.default.v3,$kr=_Rt.default.v4,hU7=_Rt.default.v5,yU7=_Rt.default.NIL,vU7=_Rt.default.version,bU7=_Rt.default.validate,gU7=_Rt.default.stringify,mU7=_Rt.default.parse;var jt1="id",wt1=".fern",lpi=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new Ckl.PostHog(r),this.userId=t==null?void 0:yZo(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.42.11",...t,...t.properties}})}flush(){this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=pf(I_.of((0,Tkl.homedir)()),zs.of(wt1),zs.of(jt1));await Vh(t)||(await(0,XAn.mkdir)((0,qkl.dirname)(t),{recursive:!0}),await(0,XAn.writeFile)(t,$kr())),this.persistedDistinctId=(await(0,XAn.readFile)(t)).toString()}return this.persistedDistinctId}};var dau;async function QAn(){return dau==null&&(dau=await Dt1()),dau}async function Dt1(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new opi;let r=await Oua();return r!=null?new lpi({token:r,posthogApiKey:e}):await mua()!=null?new Gpa({posthogApiKey:e}):new lpi({token:void 0,posthogApiKey:e})}catch{return new opi}}var uou=yu(yRt(),1);var ppi=yu(require("process"),1);var Stf=yu(Iau(),1),Etf=yu(Dtf(),1);function N9(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Kqt(e),e.length===0))return 0;e=e.replace((0,Etf.default)()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let a=i.codePointAt(0);if(a<=31||a>=127&&a<=159||a>=768&&a<=879)continue;switch(Stf.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function m_a(e){let t=0;for(let r of e.split(`
|
|
1788
1788
|
`))t=Math.max(t,N9(r));return t}var Gtf=yu(Fau(),1);var On1=/[\p{Lu}]/u,Pn1=/[\p{Ll}]/u,Ttf=/^[\p{Lu}](?![\p{Lu}])/gu,Atf=/([\p{Alpha}\p{N}_]|$)/u,Lau=/[_.\- ]+/,jn1=new RegExp("^"+Lau.source),qtf=new RegExp(Lau.source+Atf.source,"gu"),Ctf=new RegExp("\\d+"+Atf.source,"gu"),wn1=(e,t,r,n)=>{let i=!1,a=!1,u=!1,f=!1;for(let d=0;d<e.length;d++){let c=e[d];f=d>2?e[d-3]==="-":!0,i&&On1.test(c)?(e=e.slice(0,d)+"-"+e.slice(d),i=!1,u=a,a=!0,d++):a&&u&&Pn1.test(c)&&(!f||n)?(e=e.slice(0,d-1)+"-"+e.slice(d-1),u=a,a=!1,i=!0):(i=t(c)===c&&r(c)!==c,u=a,a=r(c)===c&&t(c)!==c)}return e},Dn1=(e,t)=>(Ttf.lastIndex=0,e.replace(Ttf,r=>t(r))),Sn1=(e,t)=>(qtf.lastIndex=0,Ctf.lastIndex=0,e.replace(qtf,(r,n)=>t(n)).replace(Ctf,r=>t(r)));function Uau(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(a=>a.trim()).filter(a=>a.length).join("-"):e=e.trim(),e.length===0)return"";let r=t.locale===!1?a=>a.toLowerCase():a=>a.toLocaleLowerCase(t.locale),n=t.locale===!1?a=>a.toUpperCase():a=>a.toLocaleUpperCase(t.locale);return e.length===1?Lau.test(e)?"":t.pascalCase?n(e):r(e):(e!==r(e)&&(e=wn1(e,r,n,t.preserveConsecutiveUppercase)),e=e.replace(jn1,""),e=t.preserveConsecutiveUppercase?Dn1(e,r):r(e),t.pascalCase&&(e=n(e.charAt(0))+e.slice(1)),Sn1(e,n))}var $au=yu(ztf(),1);var Btf=(e=0)=>t=>`\x1B[${t+e}m`,Itf=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Rtf=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`;function Tn1(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[i,a]of Object.entries(n))t[i]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},n[i]=t[i],e.set(a[0],a[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi=Btf(),t.color.ansi256=Itf(),t.color.ansi16m=Rtf(),t.bgColor.ansi=Btf(10),t.bgColor.ansi256=Itf(10),t.bgColor.ansi16m=Rtf(10),Object.defineProperties(t,{rgbToAnsi256:{value:(r,n,i)=>r===n&&n===i?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:r=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(r.toString(16));if(!n)return[0,0,0];let{colorString:i}=n.groups;i.length===3&&(i=i.split("").map(u=>u+u).join(""));let a=Number.parseInt(i,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:r=>t.rgbToAnsi256(...t.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value:r=>{if(r<8)return 30+r;if(r<16)return 90+(r-8);let n,i,a;if(r>=232)n=((r-232)*10+8)/255,i=n,a=n;else{r-=16;let d=r%36;n=Math.floor(r/36)/5,i=Math.floor(d/6)/5,a=d%6/5}let u=Math.max(n,i,a)*2;if(u===0)return 30;let f=30+(Math.round(a)<<2|Math.round(i)<<1|Math.round(n));return u===2&&(f+=60),f},enumerable:!1},rgbToAnsi:{value:(r,n,i)=>t.ansi256ToAnsi(t.rgbToAnsi256(r,n,i)),enumerable:!1},hexToAnsi:{value:r=>t.ansi256ToAnsi(t.hexToAnsi256(r)),enumerable:!1}}),t}var qn1=Tn1(),Ftf=qn1;var O_a=new Set(["\x1B","\x9B"]),Cn1=39,Wau="\x07",Vtf="[",An1="]",Wtf="m",Hau=`${An1}8;;`,Ltf=e=>`${O_a.values().next().value}${Vtf}${e}${Wtf}`,Utf=e=>`${O_a.values().next().value}${Hau}${e}${Wau}`,Nn1=e=>e.split(" ").map(t=>N9(t)),Vau=(e,t,r)=>{let n=[...t],i=!1,a=!1,u=N9(Kqt(e[e.length-1]));for(let[f,d]of n.entries()){let c=N9(d);if(u+c<=r?e[e.length-1]+=d:(e.push(d),u=0),O_a.has(d)&&(i=!0,a=n.slice(f+1).join("").startsWith(Hau)),i){a?d===Wau&&(i=!1,a=!1):d===Wtf&&(i=!1);continue}u+=c,u===r&&f<n.length-1&&(e.push(""),u=0)}!u&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},zn1=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(N9(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Bn1=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,a,u=Nn1(e),f=[""];for(let[c,o]of e.split(" ").entries()){r.trim!==!1&&(f[f.length-1]=f[f.length-1].trimStart());let l=N9(f[f.length-1]);if(c!==0&&(l>=t&&(r.wordWrap===!1||r.trim===!1)&&(f.push(""),l=0),(l>0||r.trim===!1)&&(f[f.length-1]+=" ",l++)),r.hard&&u[c]>t){let g=t-l,O=1+Math.floor((u[c]-g-1)/t);Math.floor((u[c]-1)/t)<O&&f.push(""),Vau(f,o,t);continue}if(l+u[c]>t&&l>0&&u[c]>0){if(r.wordWrap===!1&&l<t){Vau(f,o,t);continue}f.push("")}if(l+u[c]>t&&r.wordWrap===!1){Vau(f,o,t);continue}f[f.length-1]+=o}r.trim!==!1&&(f=f.map(c=>zn1(c)));let d=[...f.join(`
|
|
1789
1789
|
`)];for(let[c,o]of d.entries()){if(n+=o,O_a.has(o)){let{groups:g}=new RegExp(`(?:\\${Vtf}(?<code>\\d+)m|\\${Hau}(?<uri>.*)${Wau})`).exec(d.slice(c).join(""))||{groups:{}};if(g.code!==void 0){let O=Number.parseFloat(g.code);i=O===Cn1?void 0:O}else g.uri!==void 0&&(a=g.uri.length===0?void 0:g.uri)}let l=Ftf.codes.get(Number(i));d[c+1]===`
|
|
1790
1790
|
`?(a&&(n+=Utf("")),i&&l&&(n+=Ltf(l))):o===`
|
|
@@ -1901,7 +1901,7 @@ errors:
|
|
|
1901
1901
|
Run ${cl.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
|
|
1902
1902
|
Run ${cl.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),u6n(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function Tsu({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!uuf(e))return;let i=t??"",a=e.filter(f=>f.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let u=a.sort((f,d)=>f.generatorName.localeCompare(d.generatorName)||f.currentVersion.localeCompare(d.currentVersion));for(let f of u)i+=`
|
|
1903
1903
|
${await zp1(f.generatorName)} (${f.apiName!=null?"API: "+f.apiName+", ":""}Group: ${f.generatorGroup}) `+cl.dim(f.currentVersion)+cl.reset(" \u2192 ")+cl.green(f.latestVersion);return i+=`
|
|
1904
|
-
`,n?u6n(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function zp1(e){let r=await new ouf.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 Bp1({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let f={type:"singleApi",versions:{}};return await cuf({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,c,o,l)=>{f.versions[c]==null&&(f.versions[c]={});let g=pg.getGeneratorNameOrThrow(o.name,l),O=await pg.getLatestGeneratorVersion({generatorName:g,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:i,includeMajor:a,context:l});O!=null&&(f.versions[c][o.name]={previousVersion:o.version,latestVersion:O})},generatorFilter:r,groupFilter:n}),f}let u={type:"multiApi",versions:{}};return await cuf({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(f,d,c,o)=>{if(f==null)return;u.versions[f]==null&&(u.versions[f]={}),u.versions[f][d]==null&&(u.versions[f][d]={});let l=pg.getGeneratorNameOrThrow(c.name,o),g=await pg.getLatestGeneratorVersion({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:c.version,channel:i,includeMajor:a,context:o});g!=null&&(u.versions[f][d][c.name]={previousVersion:c.version,latestVersion:g})},generatorFilter:r,groupFilter:n}),u}async function cuf({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let f=await pg.loadGeneratorsConfiguration({absolutePathToWorkspace:a.absoluteFilepath,context:u});if(!(f==null||f.groups==null)){for(let d of f.groups)if(!(i!=null&&d.groupName!==i))for(let c of d.generators)n!=null&&c.name!==n||await r(a.workspaceName,d.groupName,c,u)}})}))}function luf(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[u,f]of Object.entries(a)){r.debug(`Checking if ${u} in group ${i} has an upgrade available...`);let d=Pne(f.latestVersion,f.previousVersion);r.debug(`Latest version: ${f.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),n.push({generatorName:u,generatorGroup:i,apiName:t,isUpgradeAvailable:d,currentVersion:f.previousVersion,latestVersion:f.latestVersion})}return n}async function Eha({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let u=[];if(e!=null){let f=await Bp1({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(f.type==="multiApi")for(let[d,c]of Object.entries(f.versions))u.push(...luf(c,d,t.logger));else u.push(...luf(f.versions,void 0,t.logger))}return u}var e_i=class extends Error{constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${i} ${a}`.trim(),f=u?`status code ${u}`:"an unknown error";super(`Request failed with ${f}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var F6n=class extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}};var t_i=e=>e!==null&&typeof e=="object";var r_i=(...e)=>{for(let t of e)if((!t_i(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Mha({},...e)},qsu=(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},Mha=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(t_i(n)){for(let[i,a]of Object.entries(n))t_i(a)&&i in t&&(a=Mha(t[i],a)),t={...t,[i]:a};t_i(n.headers)&&(r=qsu(r,n.headers),t.headers=r)}return t};var fuf=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";return r&&n&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),duf=typeof globalThis.AbortController=="function",puf=typeof globalThis.ReadableStream=="function",_uf=typeof globalThis.FormData=="function",xha=["get","post","put","patch","head","delete"],Ip1=()=>{};Ip1();var huf={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Tha=2147483647,qha=Symbol("stop"),yuf={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},vuf={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};var guf=e=>xha.includes(e)?e.toUpperCase():e,Rp1=["get","put","head","delete","options","trace"],Fp1=[408,413,429,500,502,503,504],muf=[413,429,503],buf={limit:2,methods:Rp1,statusCodes:Fp1,afterStatusCodes:muf,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Ouf=(e={})=>{if(typeof e=="number")return{...buf,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{...buf,...e,afterStatusCodes:muf}};async function Csu(e,t,r,n){return new Promise((i,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new F6n(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(u)})})}async function Asu(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==null||t.removeEventListener("abort",i),r()},e)})}var Puf=(e,t)=>{let r={};for(let n in t)!(n in vuf)&&!(n in yuf)&&!(n in e)&&(r[n]=t[n]);return r};var den=class{static create(t,r){let n=new den(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Tha)throw new RangeError(`The \`timeout\` option cannot be greater than ${Tha}`);await Promise.resolve();let f=await n._fetch();for(let d of n._options.hooks.afterResponse){let c=await d(n.request,n._options,n._decorateResponse(f.clone()));c instanceof globalThis.Response&&(f=c)}if(n._decorateResponse(f),!f.ok&&n._options.throwHttpErrors){let d=new e_i(f,n.request,n._options);for(let c of n._options.hooks.beforeError)d=await c(d);throw d}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!puf)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(f.clone(),n._options.onDownloadProgress)}return f},u=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[f,d]of Object.entries(huf))u[f]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||d);let o=(await u).clone();if(f==="json"){if(o.status===204||(await o.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await o.text())}return o[f]()};return u}constructor(t,r={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t;let n="credentials"in Request.prototype;if(this._options={credentials:n?this._input.credentials:void 0,...r,headers:qsu(this._input.headers,r.headers),hooks:Mha({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:guf(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:Ouf(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(duf){if(this.abortController=new globalThis.AbortController,this._options.signal){let i=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(i.reason)})}this._options.signal=this.abortController.signal}if(fuf&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i=typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString(),a="?"+i,u=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);(_uf&&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(u,{...this.request}),this._options)}this._options.json!==void 0&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(t instanceof F6n)){if(t instanceof e_i){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;let n=t.response.headers.get("Retry-After");if(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let i=Number(n);return Number.isNaN(i)?i=Date.parse(n)-Date.now():i*=1e3,this._options.retry.maxRetryAfter!==void 0&&i>this._options.retry.maxRetryAfter?0:i}if(t.response.status===413)return 0}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}return 0}_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),Tha);if(n!==0&&this._retryCount>0){await Asu(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})===qha)return;return this._retry(t)}throw r}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=Puf(this.request,this._options);return this._options.timeout===!1?this._options.fetch(this.request.clone(),t):Csu(this.request.clone(),t,this.abortController,this._options)}_stream(t,r){let n=Number(t.headers.get("content-length"))||0,i=0;return t.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(a){let u=t.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function f(){let{done:d,value:c}=await u.read();if(d){a.close();return}if(r){i+=c.byteLength;let o=n===0?0:i/n;r({percent:o,transferredBytes:i,totalBytes:n},c)}a.enqueue(c),await f()}await f()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Nsu=e=>{let t=(r,n)=>den.create(r,r_i(e,n));for(let r of xha)t[r]=(n,i)=>den.create(n,r_i(e,i,{method:r}));return t.create=r=>Nsu(r_i(r)),t.extend=r=>Nsu(r_i(e,r)),t.stop=qha,t},Lp1=Nsu(),juf=Lp1;var Juf=yu($uf(),1);function Fsu(e){let t=(0,Juf.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var Vsf=yu(Usf(),1),Wsf=yu(ZQr(),1),Qsu=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},Zsu=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function ksu(e,t={}){var l;let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??Fsu(i),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),f=(0,Vsf.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,f&&(d.authorization=`${f.type} ${f.token}`);let c;try{c=await juf(u,{headers:d,keepalive:!0}).json()}catch(g){throw((l=g==null?void 0:g.response)==null?void 0:l.status)===404?new Qsu(e):g}if(t.allVersions)return c;let o=new Zsu(e,r);if(c["dist-tags"][r]){let{time:g}=c;c=c.versions[c["dist-tags"][r]],c.time=g}else if(r){let g=Boolean(c.versions[r]);if(n&&!g)for(let[j,S]of Object.entries(c.versions))S.deprecated&&delete c.versions[j];if(!g){let j=Object.keys(c.versions);if(r=Wsf.default.maxSatisfying(j,r),!r)throw o}let{time:O}=c;if(c=c.versions[r],c.time=O,!c)throw o}return c}async function u_i(e,t){let{version:r}=await ksu(e.toLowerCase(),t);return r}async function J6n({cliEnvironment:e,includePreReleases:t=!1}){return e.packageVersion==="0.0.0"?e.packageVersion:u_i(e.packageName,{version:t?"prerelease":"latest"})}var Hsf=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],Hha=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=hM.Info;constructor(t){this.ttyAwareLogger=new Sha(t);let r=this.getPackageName(),n=this.getPackageVersion(),i=this.getCliName();(r==null||n==null||i==null)&&this.exitProgram(),this.environment={packageName:r,packageVersion:n,cliName:i}}getPackageName(){return"fern-api"==null&&this.logger.error("CLI_PACKAGE_NAME is not defined"),"fern-api"}getPackageVersion(){return"0.42.10"==null&&this.logger.error("CLI_VERSION is not defined"),"0.42.10"}getCliName(){return"fern"==null&&this.logger.error("CLI_NAME is not defined"),"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${cl.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new Jte}failWithoutThrowing(t,r){this.didSucceed=!1,Pha({message:t,error:r,logger:this.logger})}async exit(){this._suppressUpgradeMessage||await this.nudgeUpgradeIfAvaialable(),this.ttyAwareLogger.finish(),(await QAn()).flush(),this.exitProgram()}async nudgeUpgradeIfAvaialable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await suf({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
1904
|
+
`,n?u6n(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function zp1(e){let r=await new ouf.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 Bp1({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let f={type:"singleApi",versions:{}};return await cuf({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,c,o,l)=>{f.versions[c]==null&&(f.versions[c]={});let g=pg.getGeneratorNameOrThrow(o.name,l),O=await pg.getLatestGeneratorVersion({generatorName:g,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:i,includeMajor:a,context:l});O!=null&&(f.versions[c][o.name]={previousVersion:o.version,latestVersion:O})},generatorFilter:r,groupFilter:n}),f}let u={type:"multiApi",versions:{}};return await cuf({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(f,d,c,o)=>{if(f==null)return;u.versions[f]==null&&(u.versions[f]={}),u.versions[f][d]==null&&(u.versions[f][d]={});let l=pg.getGeneratorNameOrThrow(c.name,o),g=await pg.getLatestGeneratorVersion({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:c.version,channel:i,includeMajor:a,context:o});g!=null&&(u.versions[f][d][c.name]={previousVersion:c.version,latestVersion:g})},generatorFilter:r,groupFilter:n}),u}async function cuf({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let f=await pg.loadGeneratorsConfiguration({absolutePathToWorkspace:a.absoluteFilepath,context:u});if(!(f==null||f.groups==null)){for(let d of f.groups)if(!(i!=null&&d.groupName!==i))for(let c of d.generators)n!=null&&c.name!==n||await r(a.workspaceName,d.groupName,c,u)}})}))}function luf(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[u,f]of Object.entries(a)){r.debug(`Checking if ${u} in group ${i} has an upgrade available...`);let d=Pne(f.latestVersion,f.previousVersion);r.debug(`Latest version: ${f.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),n.push({generatorName:u,generatorGroup:i,apiName:t,isUpgradeAvailable:d,currentVersion:f.previousVersion,latestVersion:f.latestVersion})}return n}async function Eha({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let u=[];if(e!=null){let f=await Bp1({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(f.type==="multiApi")for(let[d,c]of Object.entries(f.versions))u.push(...luf(c,d,t.logger));else u.push(...luf(f.versions,void 0,t.logger))}return u}var e_i=class extends Error{constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${i} ${a}`.trim(),f=u?`status code ${u}`:"an unknown error";super(`Request failed with ${f}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var F6n=class extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}};var t_i=e=>e!==null&&typeof e=="object";var r_i=(...e)=>{for(let t of e)if((!t_i(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Mha({},...e)},qsu=(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},Mha=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(t_i(n)){for(let[i,a]of Object.entries(n))t_i(a)&&i in t&&(a=Mha(t[i],a)),t={...t,[i]:a};t_i(n.headers)&&(r=qsu(r,n.headers),t.headers=r)}return t};var fuf=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";return r&&n&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),duf=typeof globalThis.AbortController=="function",puf=typeof globalThis.ReadableStream=="function",_uf=typeof globalThis.FormData=="function",xha=["get","post","put","patch","head","delete"],Ip1=()=>{};Ip1();var huf={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Tha=2147483647,qha=Symbol("stop"),yuf={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},vuf={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};var guf=e=>xha.includes(e)?e.toUpperCase():e,Rp1=["get","put","head","delete","options","trace"],Fp1=[408,413,429,500,502,503,504],muf=[413,429,503],buf={limit:2,methods:Rp1,statusCodes:Fp1,afterStatusCodes:muf,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Ouf=(e={})=>{if(typeof e=="number")return{...buf,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{...buf,...e,afterStatusCodes:muf}};async function Csu(e,t,r,n){return new Promise((i,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new F6n(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(u)})})}async function Asu(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==null||t.removeEventListener("abort",i),r()},e)})}var Puf=(e,t)=>{let r={};for(let n in t)!(n in vuf)&&!(n in yuf)&&!(n in e)&&(r[n]=t[n]);return r};var den=class{static create(t,r){let n=new den(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Tha)throw new RangeError(`The \`timeout\` option cannot be greater than ${Tha}`);await Promise.resolve();let f=await n._fetch();for(let d of n._options.hooks.afterResponse){let c=await d(n.request,n._options,n._decorateResponse(f.clone()));c instanceof globalThis.Response&&(f=c)}if(n._decorateResponse(f),!f.ok&&n._options.throwHttpErrors){let d=new e_i(f,n.request,n._options);for(let c of n._options.hooks.beforeError)d=await c(d);throw d}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!puf)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(f.clone(),n._options.onDownloadProgress)}return f},u=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[f,d]of Object.entries(huf))u[f]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||d);let o=(await u).clone();if(f==="json"){if(o.status===204||(await o.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await o.text())}return o[f]()};return u}constructor(t,r={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t;let n="credentials"in Request.prototype;if(this._options={credentials:n?this._input.credentials:void 0,...r,headers:qsu(this._input.headers,r.headers),hooks:Mha({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:guf(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:Ouf(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(duf){if(this.abortController=new globalThis.AbortController,this._options.signal){let i=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(i.reason)})}this._options.signal=this.abortController.signal}if(fuf&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i=typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString(),a="?"+i,u=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);(_uf&&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(u,{...this.request}),this._options)}this._options.json!==void 0&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(t instanceof F6n)){if(t instanceof e_i){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;let n=t.response.headers.get("Retry-After");if(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let i=Number(n);return Number.isNaN(i)?i=Date.parse(n)-Date.now():i*=1e3,this._options.retry.maxRetryAfter!==void 0&&i>this._options.retry.maxRetryAfter?0:i}if(t.response.status===413)return 0}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}return 0}_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),Tha);if(n!==0&&this._retryCount>0){await Asu(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})===qha)return;return this._retry(t)}throw r}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=Puf(this.request,this._options);return this._options.timeout===!1?this._options.fetch(this.request.clone(),t):Csu(this.request.clone(),t,this.abortController,this._options)}_stream(t,r){let n=Number(t.headers.get("content-length"))||0,i=0;return t.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(a){let u=t.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function f(){let{done:d,value:c}=await u.read();if(d){a.close();return}if(r){i+=c.byteLength;let o=n===0?0:i/n;r({percent:o,transferredBytes:i,totalBytes:n},c)}a.enqueue(c),await f()}await f()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var Nsu=e=>{let t=(r,n)=>den.create(r,r_i(e,n));for(let r of xha)t[r]=(n,i)=>den.create(n,r_i(e,i,{method:r}));return t.create=r=>Nsu(r_i(r)),t.extend=r=>Nsu(r_i(e,r)),t.stop=qha,t},Lp1=Nsu(),juf=Lp1;var Juf=yu($uf(),1);function Fsu(e){let t=(0,Juf.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var Vsf=yu(Usf(),1),Wsf=yu(ZQr(),1),Qsu=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},Zsu=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function ksu(e,t={}){var l;let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??Fsu(i),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),f=(0,Vsf.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,f&&(d.authorization=`${f.type} ${f.token}`);let c;try{c=await juf(u,{headers:d,keepalive:!0}).json()}catch(g){throw((l=g==null?void 0:g.response)==null?void 0:l.status)===404?new Qsu(e):g}if(t.allVersions)return c;let o=new Zsu(e,r);if(c["dist-tags"][r]){let{time:g}=c;c=c.versions[c["dist-tags"][r]],c.time=g}else if(r){let g=Boolean(c.versions[r]);if(n&&!g)for(let[j,S]of Object.entries(c.versions))S.deprecated&&delete c.versions[j];if(!g){let j=Object.keys(c.versions);if(r=Wsf.default.maxSatisfying(j,r),!r)throw o}let{time:O}=c;if(c=c.versions[r],c.time=O,!c)throw o}return c}async function u_i(e,t){let{version:r}=await ksu(e.toLowerCase(),t);return r}async function J6n({cliEnvironment:e,includePreReleases:t=!1}){return e.packageVersion==="0.0.0"?e.packageVersion:u_i(e.packageName,{version:t?"prerelease":"latest"})}var Hsf=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],Hha=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=hM.Info;constructor(t){this.ttyAwareLogger=new Sha(t);let r=this.getPackageName(),n=this.getPackageVersion(),i=this.getCliName();(r==null||n==null||i==null)&&this.exitProgram(),this.environment={packageName:r,packageVersion:n,cliName:i}}getPackageName(){return"fern-api"==null&&this.logger.error("CLI_PACKAGE_NAME is not defined"),"fern-api"}getPackageVersion(){return"0.42.11"==null&&this.logger.error("CLI_VERSION is not defined"),"0.42.11"}getCliName(){return"fern"==null&&this.logger.error("CLI_NAME is not defined"),"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${cl.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new Jte}failWithoutThrowing(t,r){this.didSucceed=!1,Pha({message:t,error:r,logger:this.logger})}async exit(){this._suppressUpgradeMessage||await this.nudgeUpgradeIfAvaialable(),this.ttyAwareLogger.finish(),(await QAn()).flush(),this.exitProgram()}async nudgeUpgradeIfAvaialable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await suf({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
1905
1905
|
`)||(r+=`
|
|
1906
1906
|
`),this.logger.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram(){process.exit(this.didSucceed?0:1)}longestWorkspaceName;registerWorkspaces(t){let r=PWo(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 Wpi(t);return this.ttyAwareLogger.registerTask(r),r}async runTaskWithInit(t,r){let n=this.addTaskWithInit(t).start(),i;try{i=await r(n)}catch(a){throw n.failWithoutThrowing(void 0,a),new Jte}finally{n.finish()}return i}async instrumentPostHogEvent(t){(await QAn()).sendEvent(t)}logger=Zui(this.log.bind(this));constructTaskInitForWorkspace(t){let r=$sf(t.type==="docs"?"docs":t.workspaceName??"api"),n=1+(this.longestWorkspaceName!=null?$sf(this.longestWorkspaceName):r).length,i=r.padEnd(n),a=Hsf[this.numTasks++%Hsf.length],u=cl.hex(a)(i);return{...this.constructTaskInit(),logPrefix:u}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===D4.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}])}logImmediately(t){let r=t.filter(n=>p4r.indexOf(n.level)>=p4r.indexOf(this.logLevel));this.ttyAwareLogger.log(r,{includeDebugInfo:this.logLevel===hM.Debug})}_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 J6n({cliEnvironment:this.environment,includePreReleases:t}),n=Pne(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(n?"Upgrade available.":"No upgrade available."));let i={isUpgradeAvailable:n,latestVersion:r},a=await Eha({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:i,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}};function $sf(e){return`[${e}]:`}var tC;(function(e){e.FILE_READ="FILE_READ",e.FILE_PARSE="FILE_PARSE",e.FILE_MISSING="FILE_MISSING",e.STRUCTURE_VALIDATION="STRUCTURE_VALIDATION",e.DEPENDENCY_NOT_LISTED="DEPENDENCY_NOT_LISTED",e.FAILED_TO_LOAD_DEPENDENCY="FAILED_TO_LOAD_DEPENDENCY",e.EXPORTING_PACKAGE_MARKER_OTHER_KEYS="EXPORTING_PACKAGE_MARKER_OTHER_KEYS",e.EXPORT_PACKAGE_HAS_DEFINITIONS="EXPORT_PACKAGE_HAS_DEFINITIONS",e.MISCONFIGURED_DIRECTORY="MISCONFIGURED_DIRECTORY"})(tC||(tC={}));function ecu(e,t){for(let[r,n]of v3(e.failures))Jsf({relativeFilepath:r,failure:n,logger:t})}function $ha(e,t){for(let[r,n]of v3(e))Jsf({relativeFilepath:r,failure:n,logger:t})}function Jsf({relativeFilepath:e,failure:t,logger:r}){switch(t.type){case tC.MISCONFIGURED_DIRECTORY:r.error("Misconfigured fern directory: please see the docs at https://buildwithfern.com/learn/api-definition/introduction/what-is-the-fern-folder");break;case tC.FILE_READ:r.error("Failed to open file: "+e);break;case tC.FILE_MISSING:r.error("Missing file: "+e);break;case tC.FILE_PARSE:t.error instanceof jLo?r.error(jMn({title:`Failed to parse ${e}: ${t.error.reason}`,subtitle:t.error.mark.snippet})):r.error("Failed to parse file: "+e);break;case tC.STRUCTURE_VALIDATION:for(let n of t.error.issues)for(let{title:i,subtitle:a}of W_1(n))r.error(jMn({title:i,subtitle:a,breadcrumbs:[e,...n.path]}));break;case tC.FAILED_TO_LOAD_DEPENDENCY:r.error("Failed to load dependency: "+t.dependencyName);break;case tC.DEPENDENCY_NOT_LISTED:r.error(`Dependency is not listed in ${t7c}: `+t.dependencyName);break;case tC.EXPORT_PACKAGE_HAS_DEFINITIONS:r.error("Exported package contains API definitions: "+t.pathToPackage);break;case tC.EXPORTING_PACKAGE_MARKER_OTHER_KEYS:r.error(`${t.pathOfPackageMarker} has an export so it cannot define other keys.`);break;default:Ol(t)}}function W_1(e){switch(e.code){case L_.invalid_type:return[{title:"Incorrect type",subtitle:`Expected ${cl.underline(e.expected)} but received ${cl.underline(e.received)}`}];case L_.unrecognized_keys:return e.keys.map(t=>({title:"Unexpected key",subtitle:`Encountered unexpected key ${cl.underline(t)}`}));case L_.invalid_enum_value:return[{title:"Unrecognized value",subtitle:`Allowed values: ${e.options.map(t=>cl.underline(t)).join(", ")}`}];case L_.invalid_union:case L_.invalid_arguments:case L_.invalid_return_type:case L_.invalid_date:case L_.invalid_string:case L_.too_small:case L_.too_big:case L_.invalid_intersection_types:case L_.not_multiple_of:case L_.custom:default:return[{title:e.message}]}}var Gsf=require("fs/promises");async function Jha(e,t){let r=[];for(let n of await o4r(e,t))r.push(await H_1({relativeFilepath:YN(e,n),absoluteFilepath:n}));return r}async function H_1({relativeFilepath:e,absoluteFilepath:t}){return{relativeFilepath:e,absoluteFilepath:t,fileContents:(await(0,Gsf.readFile)(t)).toString()}}async function Ksf({absolutePathToWorkspace:e}){let t=pf(e,zs.of(k6c));if(!await Vh(t))return;let n=await Jha(t,"{md,mdx}");return{files:await Promise.all(n.map(i=>({absoluteFilepath:i.absoluteFilepath,contents:i.fileContents})))}}var ldf=yu(ncu(),1);async function ecf(e){let t={},r={};function n(i){try{t[i.relativeFilepath]={defaultUrl:void 0,contents:av.load(i.fileContents,{schema:av.CORE_SCHEMA}),rawContents:i.fileContents}}catch(a){r[i.relativeFilepath]={type:tC.FILE_PARSE,error:a}}}return await Promise.all(e.map(n)),Object.keys(r).length>0?{didSucceed:!1,failures:r}:{didSucceed:!0,files:t}}var Hlu=yu(gZr(),1),Zff=yu(yRt(),1),kff=require("fs"),v7n=require("fs/promises");var edf=require("os"),tdf=yu(require("path"),1),rdf=require("stream/promises"),ndf=yu(kya(),1),idf=yu($te(),1);var O01=XDr();async function adf({dependencyName:e,dependenciesConfiguration:t,context:r,rootApiFile:n,cliVersion:i,settings:a}){let u,f={type:tC.FAILED_TO_LOAD_DEPENDENCY,dependencyName:e},d=t.dependencies[e];return d==null?f={type:tC.DEPENDENCY_NOT_LISTED,dependencyName:e}:await r.runInteractiveTask({name:`Download ${M01(d)}`},async c=>{switch(d.type){case"version":u=await S01({context:c,dependency:d,cliVersion:i,settings:a});return;case"local":u=await D01({context:c,dependency:d,cliVersion:i,settings:a});return;default:Ol(d)}}),u!=null?{didSucceed:!0,definition:u}:{didSucceed:!1,failure:f}}var odf="dependencies";var P01="metadata.json",j01=".fern";function w01(e){return pf(I_.of((0,edf.homedir)()),zs.of(j01),zs.of(odf),zs.of(e.organization),zs.of(e.apiName),zs.of(e.version))}async function D01({dependency:e,context:t,cliVersion:r,settings:n}){t.logger.info("Parsing...");let i=await Aen({absolutePathToWorkspace:e.absoluteFilepath,context:t,cliVersion:r,workspaceName:void 0});if(!i.didSucceed){t.failWithoutThrowing("Failed to load api definition",i.failures);return}t.logger.info("Modifying source filepath ...");let a=await i.workspace.getDefinition({context:t,relativePathToDependency:zs.of(e.path)},n);return t.logger.info("Loaded..."),a}async function S01({dependency:e,context:t,cliVersion:r,settings:n}){let i=w01(e),a=pf(i,zs.of(odf)),u=pf(i,zs.of(P01)),f;if(!await Vh(a)||!await Vh(u)){t.logger.info("Downloading manifest...");let o=await O01.definitionRegistry.get(Hlu.FernFiddle.OrganizationId(e.organization),Hlu.FernFiddle.ApiId(e.apiName),e.version);if(!o.ok){o.error._visit({orgDoesNotExistError:()=>{t.failWithoutThrowing("Organization does not exist")},apiDoesNotExistError:()=>{t.failWithoutThrowing("API does not exist")},versionDoesNotExistError:()=>{t.failWithoutThrowing("Version does not exist")},_other:j=>{t.failWithoutThrowing("Failed to download API manifest",j)}});return}let l=o.body.yamlSchemaVersion!=null?parseInt(o.body.yamlSchemaVersion):void 0,g=sen(r),O=sen(o.body.cliVersion);if(l!=null){if(l>1){t.failWithoutThrowing(`${e.organization}/${e.apiName}@${e.version} on a higher version of fern. Upgrade this workspace to ${o.body.cliVersion}`);return}else if(l<1){t.failWithoutThrowing(`${e.organization}/${e.apiName}@${e.version} on a lower version of fern. Upgrade it to ${r}`);return}}else if(g.major!==O.major||g.minor!==O.minor){t.failWithoutThrowing(`CLI version is ${o.body.cliVersion}. Expected ${g.major}.${g.minor}.x (to match current workspace).`);return}t.logger.info("Downloading..."),t.logger.debug("Remote URL: "+o.body.definitionS3DownloadUrl),await(0,v7n.mkdir)(a,{recursive:!0});try{await E01({s3PreSignedReadUrl:o.body.definitionS3DownloadUrl,absolutePathToLocalOutput:a})}catch(j){t.failWithoutThrowing("Failed to download API",j);return}f=o.body,await(0,v7n.writeFile)(u,JSON.stringify(f))}else f=JSON.parse((await(0,v7n.readFile)(u)).toString());t.logger.info("Parsing...");let d=await Aen({absolutePathToWorkspace:a,context:t,cliVersion:f.cliVersion,workspaceName:void 0});if(!d.didSucceed){t.failWithoutThrowing("Failed to parse dependency after downloading",d.failures);return}if(d.workspace.type==="oss"){t.failWithoutThrowing("Dependency must be a fern workspace.");return}return await d.workspace.getDefinition({context:t},n)}async function E01({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await Zff.default.get(e,{responseType:"stream"}),n=await idf.default.dir(),i=tdf.default.join(n.path,"api.tgz");await(0,rdf.pipeline)(r.data,(0,kff.createWriteStream)(i)),await ndf.default.extract({file:i,cwd:t})}function M01(e){switch(e.type){case"version":return`@${e.organization}/${e.apiName}`;case"local":return`${e.path}`;default:Ol(e)}}async function udf({dependenciesConfiguration:e,structuralValidationResult:t,context:r,cliVersion:n,settings:i}){let a={},u={},f={};return await Promise.all(v3(t.packageMarkers).map(async([d,c])=>{if(c.contents.export==null)a[d]=c;else{let{export:o,...l}=c.contents;if(X8t(l)>0)f[d]={type:tC.EXPORTING_PACKAGE_MARKER_OTHER_KEYS,pathOfPackageMarker:d};else{let g=Cg(d);if(S8t(t.namedDefinitionFiles).some(j=>j!==d&&j.startsWith(g)))f[d]={type:tC.EXPORT_PACKAGE_HAS_DEFINITIONS,pathToPackage:g};else{let j=await adf({dependencyName:typeof c.contents.export=="string"?c.contents.export:c.contents.export.dependency,dependenciesConfiguration:e,context:r,rootApiFile:t.rootApiFile.contents,cliVersion:n,settings:i});j.didSucceed?u[Cg(d)]={definition:j.definition,url:typeof c.contents.export=="object"?c.contents.export.url:void 0}:f[d]=j.failure}}}})),X8t(f)>0?{didSucceed:!1,failures:f}:{didSucceed:!0,packageMarkers:a,importedDefinitions:u}}var sdf=yu(require("path"),1);function cdf({files:e,absolutePathToDefinition:t}){let r,n={},i={},a={};for(let[u,f]of v3(e)){let d=f.contents,c=o=>{a[u]={type:tC.STRUCTURE_VALIDATION,error:o}};if(u===nB){let o=tta.safeParse(d);o.success?r={defaultUrl:o.data["default-url"],contents:o.data,rawContents:f.rawContents}:c(o.error)}else if(sdf.default.basename(u)===HT){let o=Xea.safeParse(d);o.success?i[u]={defaultUrl:typeof o.data.export=="object"?o.data.export.url:void 0,contents:o.data,rawContents:f.rawContents}:c(o.error)}else{let o=s2n.safeParse(d);o.success?n[u]={defaultUrl:void 0,contents:o.data,rawContents:f.rawContents,absoluteFilepath:pf(t,u)}:c(o.error)}}return r==null?{didSucceed:!1,failures:{[zs.of(nB)]:{type:tC.FILE_MISSING},...a}}:Object.keys(a).length>0?{didSucceed:!1,failures:a}:{didSucceed:!0,namedDefinitionFiles:n,rootApiFile:r,packageMarkers:i}}var Nen=class{};var y5r=class extends Nen{type="fern";workspaceName;absoluteFilepath;generatorsConfiguration;dependenciesConfiguration;definition;changelog;sources;cliVersion;constructor({absoluteFilepath:t,workspaceName:r,generatorsConfiguration:n,dependenciesConfiguration:i,definition:a,changelog:u,sources:f,cliVersion:d}){super(),this.absoluteFilepath=t,this.workspaceName=r,this.changelog=u,this.generatorsConfiguration=n,this.dependenciesConfiguration=i,this.definition=a,this.sources=f??[],this.cliVersion=d}async getDefinition(){return this.definition}async toFernWorkspace(){return this}getAbsoluteFilepaths(){return[this.absoluteFilepath]}getSources(){return this.sources}},zen=class extends Nen{type="fern";workspaceName;absoluteFilepath;generatorsConfiguration;changelog;context;cliVersion;fernWorkspaces={};constructor({absoluteFilepath:t,workspaceName:r,generatorsConfiguration:n,changelog:i,cliVersion:a,context:u}){super(),this.absoluteFilepath=t,this.workspaceName=r,this.changelog=i,this.generatorsConfiguration=n,this.cliVersion=a,this.context=u}async getDefinition({context:t},r){return(await this.toFernWorkspace({context:t},r)).definition}async toFernWorkspace({context:t},r){let n=(0,ldf.default)(r??{}),i=this.fernWorkspaces[n];if(i==null){let a=t||this.context,u=pf(this.absoluteFilepath,zs.of(p9)),f=await FGi.loadDependenciesConfiguration({absolutePathToWorkspace:this.absoluteFilepath,context:a}),d=await Jha(u,"{yml,yaml}"),c=await ecf(d);if(!c.didSucceed)return $ha(c.failures,a.logger),a.failAndThrow();let o=cdf({files:c.files,absolutePathToDefinition:u});if(!o.didSucceed)return $ha(o.failures,a.logger),a.failAndThrow();let l=await udf({dependenciesConfiguration:f,structuralValidationResult:o,context:a,cliVersion:this.cliVersion,settings:r});if(!l.didSucceed)return $ha(l.failures,a.logger),a.failAndThrow();i=new y5r({absoluteFilepath:this.absoluteFilepath,generatorsConfiguration:this.generatorsConfiguration,dependenciesConfiguration:f,workspaceName:this.workspaceName,definition:{absoluteFilepath:u,rootApiFile:o.rootApiFile,namedDefinitionFiles:o.namedDefinitionFiles,packageMarkers:l.packageMarkers,importedDefinitions:l.importedDefinitions},changelog:this.changelog,sources:void 0,cliVersion:this.cliVersion}),this.fernWorkspaces[n]=i}return i}getAbsoluteFilepaths(){return[this.absoluteFilepath]}};var WSr={openapi:e=>({...e,type:"openapi",_visit:function(t){return WSr._visit(this,t)}}),protobuf:e=>({...e,type:"protobuf",_visit:function(t){return WSr._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 b7n={protobuf:e=>({...e,type:"protobuf",_visit:function(t){return b7n._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var F9={basic:e=>({...e,type:"basic",_visit:function(t){return F9._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return F9._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return F9._visit(this,t)}}),query:e=>({...e,type:"query",_visit:function(t){return F9._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return F9._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 RP={primitive:e=>({value:e,type:"primitive",_visit:function(t){return RP._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return RP._visit(this,t)}}),array:e=>({value:e,type:"array",_visit:function(t){return RP._visit(this,t)}}),map:e=>({value:e,type:"map",_visit:function(t){return RP._visit(this,t)}}),enum:e=>({value:e,type:"enum",_visit:function(t){return RP._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return RP._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return RP._visit(this,t)}}),unknown:e=>({value:e,type:"unknown",_visit:function(t){return RP._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 t0={int:e=>({value:e,type:"int",_visit:function(t){return t0._visit(this,t)}}),int64:e=>({value:e,type:"int64",_visit:function(t){return t0._visit(this,t)}}),uint:e=>({value:e,type:"uint",_visit:function(t){return t0._visit(this,t)}}),uint64:e=>({value:e,type:"uint64",_visit:function(t){return t0._visit(this,t)}}),float:e=>({value:e,type:"float",_visit:function(t){return t0._visit(this,t)}}),double:e=>({value:e,type:"double",_visit:function(t){return t0._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return t0._visit(this,t)}}),datetime:e=>({value:e,type:"datetime",_visit:function(t){return t0._visit(this,t)}}),date:e=>({value:e,type:"date",_visit:function(t){return t0._visit(this,t)}}),base64:e=>({value:e,type:"base64",_visit:function(t){return t0._visit(this,t)}}),boolean:e=>({value:e,type:"boolean",_visit:function(t){return t0._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 g7n={boolean:e=>({value:e,type:"boolean",_visit:function(t){return g7n._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return g7n._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 v5r={discriminated:e=>({value:e,type:"discriminated",_visit:function(t){return v5r._visit(this,t)}}),undisciminated:e=>({value:e,type:"undisciminated",_visit:function(t){return v5r._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e.value);case"undisciminated":return t.undisciminated(e.value);default:return t._other(e)}}};var vW={GenerallyAvailable:"GenerallyAvailable",Beta:"Beta",Deprecated:"Deprecated",_visit:(e,t)=>{switch(e){case vW.GenerallyAvailable:return t.generallyAvailable();case vW.Beta:return t.beta();case vW.Deprecated:return t.deprecated();default:return t._other()}}};var HSr={cursor:e=>({...e,type:"cursor",_visit:function(t){return HSr._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return HSr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);default:return t._other(e)}}};var $Sr={language:e=>({...e,type:"language",_visit:function(t){return $Sr._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return $Sr._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 bW={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 bW.Curl:return t.curl();case bW.Python:return t.python();case bW.Javascript:return t.javascript();case bW.Typescript:return t.typescript();case bW.Go:return t.go();case bW.Ruby:return t.ruby();case bW.Csharp:return t.csharp();case bW.Java:return t.java();case bW.Js:return t.js();case bW.Node:return t.node();case bW.Ts:return t.ts();case bW.Nodets:return t.nodets();case bW.Golang:return t.golang();case bW.Dotnet:return t.dotnet();case bW.Jvm:return t.jvm();default:return t._other()}}};var dAt={unknown:e=>({value:e,type:"unknown",_visit:function(t){return dAt._visit(this,t)}}),full:e=>({...e,type:"full",_visit:function(t){return dAt._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 GJ={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",Options:"OPTIONS",Trace:"TRACE",_visit:(e,t)=>{switch(e){case GJ.Get:return t.get();case GJ.Post:return t.post();case GJ.Put:return t.put();case GJ.Patch:return t.patch();case GJ.Delete:return t.delete();case GJ.Head:return t.head();case GJ.Options:return t.options();case GJ.Trace:return t.trace();default:return t._other()}}};var b5r={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return b5r._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return b5r._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return b5r._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);default:return t._other(e)}}};var D2e={file:e=>({...e,type:"file",_visit:function(t){return D2e._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return D2e._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 Sne={file:e=>({...e,type:"file",_visit:function(t){return Sne._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return Sne._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return Sne._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return Sne._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return Sne._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return Sne._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"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var ib={primitive:e=>({...e,type:"primitive",_visit:function(t){return ib._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return ib._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return ib._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return ib._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return ib._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return ib._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return ib._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return ib._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return ib._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return ib._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return ib._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 Xw={int:e=>({...e,type:"int",_visit:function(t){return Xw._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return Xw._visit(this,t)}}),uint:()=>({type:"uint",_visit:function(e){return Xw._visit(this,e)}}),uint64:()=>({type:"uint64",_visit:function(e){return Xw._visit(this,e)}}),float:()=>({type:"float",_visit:function(e){return Xw._visit(this,e)}}),double:e=>({...e,type:"double",_visit:function(t){return Xw._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Xw._visit(this,t)}}),datetime:()=>({type:"datetime",_visit:function(e){return Xw._visit(this,e)}}),date:()=>({type:"date",_visit:function(e){return Xw._visit(this,e)}}),base64:()=>({type:"base64",_visit:function(e){return Xw._visit(this,e)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Xw._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 E7={boolean:e=>({value:e,type:"boolean",_visit:function(t){return E7._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return E7._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 JSr={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return JSr._visit(this,t)}}),undisciminated:e=>({...e,type:"undisciminated",_visit:function(t){return JSr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undisciminated":return t.undisciminated(e);default:return t._other(e)}}};var S2e={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return S2e._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return S2e._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return S2e._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);default:return t._other(e)}}};var T3={file:e=>({...e,type:"file",_visit:function(t){return T3._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return T3._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return T3._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return T3._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return T3._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return T3._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"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var Lp={primitive:e=>({...e,type:"primitive",_visit:function(t){return Lp._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Lp._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return Lp._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Lp._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Lp._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Lp._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return Lp._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Lp._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return Lp._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Lp._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return Lp._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 PQ={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return PQ._visit(this,t)}}),undisciminated:e=>({...e,type:"undisciminated",_visit:function(t){return PQ._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undisciminated":return t.undisciminated(e);default:return t._other(e)}}};var by={int:e=>({...e,type:"int",_visit:function(t){return by._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return by._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return by._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return by._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return by._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return by._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return by._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return by._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return by._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return by._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return by._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 Ng={};Wb(Ng,{AllOfPropertyConflict:()=>I7n,ArraySchema:()=>fva,ArraySchemaWithExample:()=>Lva,Availability:()=>c0a,Base64WithExample:()=>zva,BasicSecurityScheme:()=>d0a,BearerSecurityScheme:()=>p0a,BooleanSchema:()=>ava,BooleanWithExample:()=>Bva,CasingOverrides:()=>y0a,CommonProperty:()=>gva,CommonPropertyWithExample:()=>Yva,CursorPagination:()=>H0a,CustomCodeSample:()=>V0a,CustomCodeSampleLanguage:()=>F0a,CustomCodeSampleSdk:()=>U0a,DateWithExample:()=>Nva,DatetimeWithExample:()=>Ava,DiscriminatedOneOfSchema:()=>vva,DiscriminatedOneOfSchemaWithExample:()=>Gva,DoubleSchema:()=>nva,DoubleWithExample:()=>qva,Encoding:()=>s0a,Endpoint:()=>J0a,EndpointExample:()=>N7n,EndpointSdkName:()=>M5r,EndpointWithExample:()=>Fdf,EnumSchema:()=>P7n,EnumSchemaWithExample:()=>Rva,EnumValue:()=>j5r,ErrorExample:()=>z0a,FernExample:()=>I0a,FileResponse:()=>T7n,FileSchema:()=>x0a,FloatWithExample:()=>Tva,FullEndpointExample:()=>W0a,FullExample:()=>yA,FullObjectExample:()=>w0a,FullOneOfExample:()=>S0a,GlobalHeader:()=>uva,Header:()=>E5r,HeaderExample:()=>A7n,HeaderSecurityScheme:()=>_0a,HeaderWithExample:()=>L7n,HttpEndpointServer:()=>q7n,HttpError:()=>B0a,HttpErrorWithExample:()=>Dva,HttpMethod:()=>D7n,IdempotencyHeader:()=>sva,Int64WithExample:()=>Eva,IntSchema:()=>tva,IntWithExample:()=>Sva,JsonRequest:()=>C0a,JsonRequestWithExample:()=>Ova,JsonResponse:()=>GSr,JsonResponseWithExample:()=>jva,KeyValuePair:()=>D0a,LiteralExample:()=>j0a,LiteralSchema:()=>B7n,LiteralSchemaValue:()=>cva,LongSchema:()=>rva,MapSchema:()=>dva,MapSchemaWithExample:()=>Uva,MultipartRequest:()=>x7n,MultipartRequestProperty:()=>q0a,MultipartSchema:()=>T0a,NamedFullExample:()=>zRt,Namespace:()=>v0a,NamespaceId:()=>P0a,NullableSchema:()=>_va,NullableSchemaWithExample:()=>Wva,OauthSecurityScheme:()=>g0a,ObjectProperty:()=>yva,ObjectPropertyConflictInfo:()=>R7n,ObjectPropertyWithExample:()=>Jva,ObjectSchema:()=>lva,ObjectSchemaWithExample:()=>Hva,OctetStreamRequest:()=>M7n,OffsetPagination:()=>$0a,OneOfSchema:()=>hva,OneOfSchemaWithExample:()=>$va,OpenApiIntermediateRepresentation:()=>Idf,OpenApiSource:()=>i0a,OptionalSchema:()=>pva,OptionalSchemaWithExample:()=>Vva,Pagination:()=>z7n,PathParameter:()=>S7n,PathParameterExample:()=>R0a,PathParameterWithExample:()=>mva,PrimitiveExample:()=>w7n,PrimitiveSchema:()=>T5r,PrimitiveSchemaValue:()=>ova,PrimitiveSchemaValueWithExample:()=>Iva,PrimitiveSchemaWithExample:()=>U7n,PropertyKey:()=>j7n,ProtobufEncoding:()=>u0a,ProtobufSource:()=>a0a,QueryParameter:()=>E7n,QueryParameterExample:()=>C7n,QueryParameterWithExample:()=>F7n,QuerySecurityScheme:()=>h0a,ReferencedSchema:()=>NRt,Request:()=>A0a,RequestWithExample:()=>Pva,Response:()=>N0a,ResponseWithExample:()=>wva,Schema:()=>D1,SchemaId:()=>jQ,SchemaWithExample:()=>aq,Schemas:()=>eva,SdkGroup:()=>b0a,SdkGroupInfo:()=>E0a,SdkGroupName:()=>w5r,SecurityScheme:()=>m0a,SecuritySchemeId:()=>f0a,Server:()=>O0a,Source:()=>o0a,StatusCode:()=>D5r,StringSchema:()=>iva,StringSchemaWithExample:()=>Cva,SupportedSdkLanguage:()=>L0a,Tag:()=>l0a,TagId:()=>Kje,Tags:()=>M0a,TextResponse:()=>x5r,Uint64WithExample:()=>xva,UintWithExample:()=>Mva,UnDiscriminatedOneOfSchema:()=>bva,UnDiscriminatedOneOfSchemaWithExample:()=>Kva,UnknownSchemaWithExample:()=>Fva,Webhook:()=>Y0a,WebhookExampleCall:()=>K0a,WebhookHttpMethod:()=>G0a,WebsocketChannel:()=>k0a,WebsocketHandshake:()=>X0a,WebsocketHandshakeWithExample:()=>Rdf,WebsocketMessageExample:()=>Q0a,WebsocketSessionExample:()=>Z0a,WithAvailability:()=>Z0,WithDescription:()=>O_,WithEncoding:()=>Ene,WithName:()=>Ym,WithNamespace:()=>S5r,WithSdkGroupName:()=>w1,WithSource:()=>hb,WithTitle:()=>j1,commons:()=>Ylu,example:()=>Xlu,finalIr:()=>Qlu,parseIr:()=>Zlu});var Ylu={};Wb(Ylu,{BasicSecurityScheme:()=>d0a,BearerSecurityScheme:()=>p0a,Encoding:()=>s0a,HeaderSecurityScheme:()=>_0a,Namespace:()=>v0a,NamespaceId:()=>P0a,OauthSecurityScheme:()=>g0a,OpenApiSource:()=>i0a,ProtobufEncoding:()=>u0a,ProtobufSource:()=>a0a,QuerySecurityScheme:()=>h0a,SchemaId:()=>jQ,SdkGroup:()=>b0a,SdkGroupName:()=>w5r,SecurityScheme:()=>m0a,SecuritySchemeId:()=>f0a,Server:()=>O0a,Source:()=>o0a,StatusCode:()=>D5r,Tag:()=>l0a,TagId:()=>Kje,WithAvailability:()=>Z0,WithDescription:()=>O_,WithEncoding:()=>Ene,WithName:()=>Ym,WithNamespace:()=>S5r,WithSdkGroupName:()=>w1,WithSource:()=>hb,WithTitle:()=>j1});var Wn={};Wb(Wn,{JsonError:()=>g5r,ParseError:()=>m5r,any:()=>wdf,boolean:()=>Ddf,booleanLiteral:()=>jdf,date:()=>ddf,discriminant:()=>Ndf,enum_:()=>t0a,getObjectLikeUtils:()=>ARt,getObjectUtils:()=>O7n,getSchemaUtils:()=>hA,isProperty:()=>P5r,lazy:()=>pdf,lazyObject:()=>mdf,list:()=>n0a,number:()=>Sdf,object:()=>r0a,objectWithoutOptionalProperties:()=>gdf,optional:()=>$lu,property:()=>hdf,record:()=>Tdf,set:()=>qdf,string:()=>Edf,stringLiteral:()=>Pdf,transform:()=>Jlu,undiscriminatedUnion:()=>Adf,union:()=>Bdf,unknown:()=>Mdf,withParsedProperties:()=>Klu});var VS={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 rC(e,t){return`Expected ${t}. Received ${x01(e)}.`}function x01(e){if(Array.isArray(e))return"list";if(e===null)return"null";switch(typeof e){case"string":return`"${e}"`;case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function KJ(e){return{...e,json:fdf(e.json),parse:fdf(e.parse)}}function fdf(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(`
|
|
1907
1907
|
`)),{ok:!0,value:t}):n}}function e0a(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var g5r=class extends Error{errors;constructor(t){super(t.map(e0a).join("; ")),this.errors=t,Object.setPrototypeOf(this,g5r.prototype)}};var m5r=class extends Error{errors;constructor(t){super(t.map(e0a).join("; ")),this.errors=t,Object.setPrototypeOf(this,m5r.prototype)}};function hA(e){return{optional:()=>$lu(e),transform:t=>Jlu(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new m5r(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new g5r(n.errors)}}}function $lu(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>(n==null?void 0:n.omitUndefined)&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>VS.OPTIONAL};return{...t,...hA(t)}}function Jlu(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,...hA(r)}}var T01=/^([+-]?\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 ddf(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:rC(t,"string")}]}:T01.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:rC(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:rC(t,"Date object")}]},getType:()=>VS.DATE};return{...KJ(e),...hA(e)}}function YJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...KJ(r),...hA(r)}}}function t0a(e){let t=new Set(e);return YJ(VS.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:a,message:rC(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:a,message:rC(n,"enum")}]}:{ok:!0,value:n})()}function pdf(e){let t=Glu(e);return{...t,...hA(t)}}function Glu(e){return{parse:(t,r)=>m7n(e).parse(t,r),json:(t,r)=>m7n(e).json(t,r),getType:()=>m7n(e).getType()}}function m7n(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function T_i(e){return Object.entries(e)}function q_i(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,a])=>(r.has(i)&&(n[i]=a),n),{})}function O5r(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 C_i(e){return Object.keys(e)}function _df(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function ARt(e){return{withParsedProperties:t=>Klu(e,t)}}function Klu(e,t){let r={parse:(n,i)=>{let a=e.parse(n,i);if(!a.ok)return a;let u=Object.entries(t).reduce((f,[d,c])=>({...f,[d]:typeof c=="function"?c(a.value):c}),{});return{ok:!0,value:{...a.value,...u}}},json:(n,i)=>{if(!O5r(n))return{ok:!1,errors:[{path:(i==null?void 0:i.breadcrumbsPrefix)??[],message:rC(n,"object")}]};let a=new Set(Object.keys(t)),u=q_i(n,Object.keys(n).filter(f=>!a.has(f)));return e.json(u,i)},getType:()=>e.getType()};return{...r,...hA(r),...ARt(r)}}function hdf(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function P5r(e){return e.isProperty}function r0a(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>P5r(n)?n.rawKey:r),_getParsedProperties:()=>C_i(e),parse:(r,n)=>{let i={},a=[];for(let[u,f]of T_i(e)){let d=P5r(f)?f.rawKey:u,c=P5r(f)?f.valueSchema:f,o={rawKey:d,parsedKey:u,valueSchema:c};i[d]=o,bdf(c)&&a.push(d)}return ydf({value:r,requiredKeys:a,getProperty:u=>{let f=i[u];if(f!=null)return{transformedKey:f.parsedKey,transform:d=>f.valueSchema.parse(d,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],u]})}},unrecognizedObjectKeys:n==null?void 0:n.unrecognizedObjectKeys,skipValidation:n==null?void 0:n.skipValidation,breadcrumbsPrefix:n==null?void 0:n.breadcrumbsPrefix,omitUndefined:n==null?void 0:n.omitUndefined})},json:(r,n)=>{let i=[];for(let[a,u]of T_i(e)){let f=P5r(u)?u.valueSchema:u;bdf(f)&&i.push(a)}return ydf({value:r,requiredKeys:i,getProperty:a=>{let u=e[a];if(u!=null)return P5r(u)?{transformedKey:u.rawKey,transform:f=>u.valueSchema.json(f,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],a]})}:{transformedKey:a,transform:f=>u.json(f,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],a]})}},unrecognizedObjectKeys:n==null?void 0:n.unrecognizedObjectKeys,skipValidation:n==null?void 0:n.skipValidation,breadcrumbsPrefix:n==null?void 0:n.breadcrumbsPrefix,omitUndefined:n==null?void 0:n.omitUndefined})},getType:()=>VS.OBJECT};return{...KJ(t),...hA(t),...ARt(t),...O7n(t)}}function ydf({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:a=[]}){if(!O5r(e))return{ok:!1,errors:[{path:a,message:rC(e,"object")}]};let u=new Set(t),f=[],d={};for(let[c,o]of Object.entries(e)){let l=r(c);if(l!=null){u.delete(c);let g=l.transform(o);g.ok?d[l.transformedKey]=g.value:(d[c]=o,f.push(...g.errors))}else switch(n){case"fail":f.push({path:[...a,c],message:`Unexpected key "${c}"`});break;case"strip":break;case"passthrough":d[c]=o;break}}return f.push(...t.filter(c=>u.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),f.length===0||i?{ok:!0,value:d}:{ok:!1,errors:f}}function O7n(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>vdf({extensionKeys:t._getRawProperties(),value:n,transformBase:a=>e.parse(a,i),transformExtension:a=>t.parse(a,i)}),json:(n,i)=>vdf({extensionKeys:t._getParsedProperties(),value:n,transformBase:a=>e.json(a,i),transformExtension:a=>t.json(a,i)}),getType:()=>VS.OBJECT};return{...r,...hA(r),...ARt(r),...O7n(r)}}}}function vdf({extensionKeys:e,value:t,transformBase:r,transformExtension:n}){let i=new Set(e),[a,u]=_df(C_i(t),c=>i.has(c)),f=r(q_i(t,u)),d=n(q_i(t,a));return f.ok&&d.ok?{ok:!0,value:{...f.value,...d.value}}:{ok:!1,errors:[...f.ok?[]:f.errors,...d.ok?[]:d.errors]}}function bdf(e){return!q01(e)}function q01(e){switch(e.getType()){case VS.ANY:case VS.UNKNOWN:case VS.OPTIONAL:return!0;default:return!1}}function gdf(e){return r0a(e)}function mdf(e){let t={...Glu(e),_getRawProperties:()=>m7n(e)._getRawProperties(),_getParsedProperties:()=>m7n(e)._getParsedProperties()};return{...t,...hA(t),...ARt(t),...O7n(t)}}function n0a(e){let t={parse:(r,n)=>Odf(r,(i,a)=>e.parse(i,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],`[${a}]`]})),json:(r,n)=>Odf(r,(i,a)=>e.json(i,{...n,breadcrumbsPrefix:[...(n==null?void 0:n.breadcrumbsPrefix)??[],`[${a}]`]})),getType:()=>VS.LIST};return{...KJ(t),...hA(t)}}function Odf(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:rC(e,"list"),path:[]}]}}function Pdf(e){return YJ(VS.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:rC(r,`"${e}"`)}]})()}function jdf(e){return YJ(VS.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:rC(r,`${e.toString()}`)}]})()}var wdf=YJ(VS.ANY,e=>({ok:!0,value:e}));var Ddf=YJ(VS.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:rC(e,"boolean")}]});var Sdf=YJ(VS.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:rC(e,"number")}]});var Edf=YJ(VS.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:rC(e,"string")}]});var Mdf=YJ(VS.UNKNOWN,e=>({ok:!0,value:e}));function Tdf(e,t){let r={parse:(n,i)=>xdf({value:n,isKeyNumeric:e.getType()===VS.NUMBER,transformKey:a=>e.parse(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${u}`]}),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(n,i)=>xdf({value:n,isKeyNumeric:e.getType()===VS.NUMBER,transformKey:a=>e.json(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...i,breadcrumbsPrefix:[...(i==null?void 0:i.breadcrumbsPrefix)??[],`${u}`]}),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>VS.RECORD};return{...KJ(r),...hA(r)}}function xdf({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return O5r(e)?T_i(e).reduce((a,[u,f])=>{if(f==null)return a;let d=a,c=u;if(t){let O=u.length>0?Number(u):NaN;isNaN(O)||(c=O)}let o=r(c),l=n(f,c);if(d.ok&&o.ok&&l.ok)return{ok:!0,value:{...d.value,[o.value]:l.value}};let g=[];return d.ok||g.push(...d.errors),o.ok||g.push(...o.errors),l.ok||g.push(...l.errors),{ok:!1,errors:g}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:rC(e,"object")}]}}function qdf(e){let t=n0a(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==null?void 0:i.breadcrumbsPrefix)??[],message:rC(n,"Set")}]},getType:()=>VS.SET};return{...KJ(r),...hA(r)}}function Adf(e){let t={parse:(r,n)=>Cdf((i,a)=>i.parse(r,a),e,n),json:(r,n)=>Cdf((i,a)=>i.json(r,a),e,n),getType:()=>VS.UNDISCRIMINATED_UNION};return{...KJ(t),...hA(t)}}function Cdf(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 f of u.errors)n.push({path:f.path,message:`[Variant ${i}] ${f.message}`})}return{ok:!1,errors:n}}function Ndf(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function Bdf(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=t0a(C_i(t)),a={parse:(u,f)=>zdf({value:u,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:d=>i.parse(d,{allowUnrecognizedEnumValues:f==null?void 0:f.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f==null?void 0:f.breadcrumbsPrefix)??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:f==null?void 0:f.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,c)=>c.parse(d,f),breadcrumbsPrefix:f==null?void 0:f.breadcrumbsPrefix}),json:(u,f)=>zdf({value:u,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:d=>i.json(d,{allowUnrecognizedEnumValues:f==null?void 0:f.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(f==null?void 0:f.breadcrumbsPrefix)??[],n]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:f==null?void 0:f.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,c)=>c.json(d,f),breadcrumbsPrefix:f==null?void 0:f.breadcrumbsPrefix}),getType:()=>VS.UNION};return{...KJ(a),...hA(a),...ARt(a)}}function zdf({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:f=[]}){if(!O5r(e))return{ok:!1,errors:[{path:f,message:rC(e,"object")}]};let{[t]:d,...c}=e;if(d==null)return{ok:!1,errors:[{path:f,message:`Missing discriminant ("${t}")`}]};let o=n(d);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,...c}}:{ok:!1,errors:[{path:[...f,t],message:"Unexpected discriminant value"}]};let g=u(c,l);return g.ok?{ok:!0,value:{[r]:d,...g.value}}:g}var j1=Wn.objectWithoutOptionalProperties({title:Wn.string().optional()});var i0a=Wn.objectWithoutOptionalProperties({file:Wn.string()});var a0a=Wn.objectWithoutOptionalProperties({file:Wn.string()});var o0a=Wn.union("type",{openapi:i0a,protobuf:a0a}).transform({transform:e=>{switch(e.type){case"openapi":return WSr.openapi(e);case"protobuf":return WSr.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var hb=Wn.objectWithoutOptionalProperties({source:o0a.optional()});var u0a=Wn.objectWithoutOptionalProperties({typeName:Wn.string()});var s0a=Wn.union("type",{protobuf:u0a}).transform({transform:e=>{switch(e.type){case"protobuf":return b7n.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ene=Wn.objectWithoutOptionalProperties({encoding:s0a.optional()});var O_=Wn.objectWithoutOptionalProperties({description:Wn.string().optional()});var c0a=Wn.enum_(["GenerallyAvailable","Beta","Deprecated"]);var Z0=Wn.objectWithoutOptionalProperties({availability:c0a.optional()});var Ym=Wn.objectWithoutOptionalProperties({nameOverride:Wn.string().optional(),generatedName:Wn.string()});var jQ=Wn.string();var Kje=Wn.string();var l0a=Wn.objectWithoutOptionalProperties({id:Kje}).extend(O_);var f0a=Wn.string();var d0a=Wn.objectWithoutOptionalProperties({usernameVariableName:Wn.string().optional(),usernameEnvVar:Wn.string().optional(),passwordVariableName:Wn.string().optional(),passwordEnvVar:Wn.string().optional()});var p0a=Wn.objectWithoutOptionalProperties({tokenVariableName:Wn.string().optional(),tokenEnvVar:Wn.string().optional()});var _0a=Wn.objectWithoutOptionalProperties({headerName:Wn.string(),prefix:Wn.string().optional(),headerVariableName:Wn.string().optional(),headerEnvVar:Wn.string().optional()});var h0a=Wn.objectWithoutOptionalProperties({queryParameterName:Wn.string()});var y0a=Wn.objectWithoutOptionalProperties({snake:Wn.string().optional(),camel:Wn.string().optional(),screamingSnake:Wn.string().optional(),pascal:Wn.string().optional()});var j5r=Wn.objectWithoutOptionalProperties({nameOverride:Wn.string().optional(),generatedName:Wn.string(),value:Wn.string(),casing:y0a.optional()}).extend(O_).extend(Z0);var v0a=Wn.objectWithoutOptionalProperties({type:Wn.stringLiteral("namespace"),name:Wn.string()});var b0a=Wn.undiscriminatedUnion([Wn.string(),v0a]);var w5r=Wn.list(b0a);var w1=Wn.objectWithoutOptionalProperties({groupName:w5r.optional()});var P7n=Wn.objectWithoutOptionalProperties({default:j5r.optional(),values:Wn.list(j5r)}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(hb).extend(j1);var g0a=Wn.objectWithoutOptionalProperties({scopesEnum:P7n.optional()});var m0a=Wn.union("type",{basic:d0a,bearer:p0a,header:_0a,query:h0a,oauth:g0a}).transform({transform:e=>{switch(e.type){case"basic":return F9.basic(e);case"bearer":return F9.bearer(e);case"header":return F9.header(e);case"query":return F9.query(e);case"oauth":return F9.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var D5r=Wn.number();var O0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),url:Wn.string(),audiences:Wn.list(Wn.string()).optional()}).extend(O_);var P0a=Wn.string();var S5r=Wn.objectWithoutOptionalProperties({namespace:Wn.string().optional()});var Xlu={};Wb(Xlu,{FullExample:()=>yA,FullObjectExample:()=>w0a,FullOneOfExample:()=>S0a,KeyValuePair:()=>D0a,LiteralExample:()=>j0a,PrimitiveExample:()=>w7n,PropertyKey:()=>j7n});var j7n=Wn.string();var w7n=Wn.union("type",{int:Wn.object({value:Wn.number()}),int64:Wn.object({value:Wn.number()}),uint:Wn.object({value:Wn.number()}),uint64:Wn.object({value:Wn.number()}),float:Wn.object({value:Wn.number()}),double:Wn.object({value:Wn.number()}),string:Wn.object({value:Wn.string()}),datetime:Wn.object({value:Wn.string()}),date:Wn.object({value:Wn.string()}),base64:Wn.object({value:Wn.string()}),boolean:Wn.object({value:Wn.boolean()})}).transform({transform:e=>{switch(e.type){case"int":return t0.int(e.value);case"int64":return t0.int64(e.value);case"uint":return t0.uint(e.value);case"uint64":return t0.uint64(e.value);case"float":return t0.float(e.value);case"double":return t0.double(e.value);case"string":return t0.string(e.value);case"datetime":return t0.datetime(e.value);case"date":return t0.date(e.value);case"base64":return t0.base64(e.value);case"boolean":return t0.boolean(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var j0a=Wn.union("type",{boolean:Wn.object({value:Wn.boolean()}),string:Wn.object({value:Wn.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return g7n.boolean(e.value);case"string":return g7n.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var yA=Wn.union("type",{primitive:Wn.object({value:w7n}),object:Wn.lazyObject(()=>w0a),array:Wn.object({value:Wn.list(Wn.lazy(()=>yA))}),map:Wn.object({value:Wn.list(Wn.lazyObject(()=>D0a))}),enum:Wn.object({value:Wn.string()}),literal:Wn.object({value:j0a}),oneOf:Wn.object({value:Wn.lazy(()=>S0a)}),unknown:Wn.object({value:Wn.lazy(()=>yA)})}).transform({transform:e=>{switch(e.type){case"primitive":return RP.primitive(e.value);case"object":return RP.object(e);case"array":return RP.array(e.value);case"map":return RP.map(e.value);case"enum":return RP.enum(e.value);case"literal":return RP.literal(e.value);case"oneOf":return RP.oneOf(e.value);case"unknown":return RP.unknown(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var w0a=Wn.objectWithoutOptionalProperties({properties:Wn.record(j7n,Wn.lazy(()=>yA))});var D0a=Wn.objectWithoutOptionalProperties({key:w7n,value:Wn.lazy(()=>yA)});var S0a=Wn.union("type",{discriminated:Wn.object({value:Wn.record(j7n,Wn.lazy(()=>yA))}),undisciminated:Wn.object({value:Wn.lazy(()=>yA)})}).transform({transform:e=>{switch(e.type){case"discriminated":return v5r.discriminated(e.value);case"undisciminated":return v5r.undisciminated(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Qlu={};Wb(Qlu,{AllOfPropertyConflict:()=>I7n,ArraySchema:()=>fva,Availability:()=>c0a,BooleanSchema:()=>ava,CasingOverrides:()=>y0a,CommonProperty:()=>gva,CursorPagination:()=>H0a,CustomCodeSample:()=>V0a,CustomCodeSampleLanguage:()=>F0a,CustomCodeSampleSdk:()=>U0a,DiscriminatedOneOfSchema:()=>vva,DoubleSchema:()=>nva,Endpoint:()=>J0a,EndpointExample:()=>N7n,EndpointSdkName:()=>M5r,EnumSchema:()=>P7n,EnumValue:()=>j5r,ErrorExample:()=>z0a,FernExample:()=>I0a,FileResponse:()=>T7n,FileSchema:()=>x0a,FullEndpointExample:()=>W0a,GlobalHeader:()=>uva,Header:()=>E5r,HeaderExample:()=>A7n,HttpEndpointServer:()=>q7n,HttpError:()=>B0a,HttpMethod:()=>D7n,IdempotencyHeader:()=>sva,IntSchema:()=>tva,JsonRequest:()=>C0a,JsonResponse:()=>GSr,LiteralSchema:()=>B7n,LiteralSchemaValue:()=>cva,LongSchema:()=>rva,MapSchema:()=>dva,MultipartRequest:()=>x7n,MultipartRequestProperty:()=>q0a,MultipartSchema:()=>T0a,NullableSchema:()=>_va,ObjectProperty:()=>yva,ObjectPropertyConflictInfo:()=>R7n,ObjectSchema:()=>lva,OctetStreamRequest:()=>M7n,OffsetPagination:()=>$0a,OneOfSchema:()=>hva,OpenApiIntermediateRepresentation:()=>Idf,OptionalSchema:()=>pva,Pagination:()=>z7n,PathParameter:()=>S7n,PathParameterExample:()=>R0a,PrimitiveSchema:()=>T5r,PrimitiveSchemaValue:()=>ova,QueryParameter:()=>E7n,QueryParameterExample:()=>C7n,ReferencedSchema:()=>NRt,Request:()=>A0a,Response:()=>N0a,Schema:()=>D1,Schemas:()=>eva,SdkGroupInfo:()=>E0a,StringSchema:()=>iva,SupportedSdkLanguage:()=>L0a,Tags:()=>M0a,TextResponse:()=>x5r,UnDiscriminatedOneOfSchema:()=>bva,Webhook:()=>Y0a,WebhookExampleCall:()=>K0a,WebhookHttpMethod:()=>G0a,WebsocketChannel:()=>k0a,WebsocketHandshake:()=>X0a,WebsocketMessageExample:()=>Q0a,WebsocketSessionExample:()=>Z0a});var E0a=Wn.objectWithoutOptionalProperties({summary:Wn.string().optional(),description:Wn.string().optional()});var M0a=Wn.objectWithoutOptionalProperties({tagsById:Wn.record(Kje,l0a),orderedTagIds:Wn.list(Kje).optional()});var D7n=Wn.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","TRACE"]);var S7n=Wn.objectWithoutOptionalProperties({name:Wn.string(),schema:Wn.lazy(()=>D1),variableReference:Wn.string().optional(),parameterNameOverride:Wn.string().optional()}).extend(O_).extend(Z0).extend(hb);var E7n=Wn.objectWithoutOptionalProperties({name:Wn.string(),schema:Wn.lazy(()=>D1),parameterNameOverride:Wn.string().optional()}).extend(O_).extend(Z0).extend(hb);var E5r=Wn.objectWithoutOptionalProperties({name:Wn.string(),schema:Wn.lazy(()=>D1),env:Wn.string().optional(),parameterNameOverride:Wn.string().optional()}).extend(O_).extend(Z0).extend(hb);var M5r=Wn.objectWithoutOptionalProperties({groupName:w5r,methodName:Wn.string()});var M7n=Wn.objectWithoutOptionalProperties({}).extend(O_).extend(hb);var x0a=Wn.objectWithoutOptionalProperties({isOptional:Wn.boolean(),isArray:Wn.boolean()});var T0a=Wn.union("type",{file:x0a,json:Wn.object({value:Wn.lazy(()=>D1)})}).transform({transform:e=>{switch(e.type){case"file":return D2e.file(e);case"json":return D2e.json(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var q0a=Wn.objectWithoutOptionalProperties({key:Wn.string(),schema:T0a,contentType:Wn.string().optional()}).extend(O_);var x7n=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),properties:Wn.list(q0a)}).extend(O_).extend(hb);var C0a=Wn.objectWithoutOptionalProperties({schema:Wn.lazy(()=>D1),contentType:Wn.string().optional(),additionalProperties:Wn.boolean()}).extend(O_).extend(hb);var A0a=Wn.union("type",{octetStream:M7n,multipart:x7n,json:C0a}).transform({transform:e=>{switch(e.type){case"octetStream":return b5r.octetStream(e);case"multipart":return b5r.multipart(e);case"json":return b5r.json(e);default:return e}},untransform:({_visit:e,...t})=>t});var T7n=Wn.objectWithoutOptionalProperties({}).extend(O_).extend(hb);var GSr=Wn.objectWithoutOptionalProperties({schema:Wn.lazy(()=>D1),responseProperty:Wn.string().optional()}).extend(O_).extend(hb);var x5r=Wn.objectWithoutOptionalProperties({}).extend(O_).extend(hb);var N0a=Wn.union("type",{file:T7n,json:GSr,text:x5r,streamingSse:GSr,streamingText:x5r,streamingJson:GSr}).transform({transform:e=>{switch(e.type){case"file":return Sne.file(e);case"json":return Sne.json(e);case"text":return Sne.text(e);case"streamingSse":return Sne.streamingSse(e);case"streamingText":return Sne.streamingText(e);case"streamingJson":return Sne.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var z0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),description:Wn.string().optional(),example:Wn.lazy(()=>yA)});var B0a=Wn.objectWithoutOptionalProperties({schema:Wn.lazy(()=>D1).optional(),examples:Wn.list(z0a).optional()}).extend(O_).extend(Ym).extend(hb);var q7n=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),url:Wn.string().optional(),audiences:Wn.list(Wn.string()).optional()});var I0a=Wn.unknown();var R0a=Wn.objectWithoutOptionalProperties({name:Wn.string(),parameterNameOverride:Wn.string().optional(),value:Wn.lazy(()=>yA)});var C7n=Wn.objectWithoutOptionalProperties({name:Wn.string(),value:Wn.lazy(()=>yA)});var A7n=Wn.objectWithoutOptionalProperties({name:Wn.string(),value:Wn.lazy(()=>yA)});var F0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),language:Wn.string(),code:Wn.string(),install:Wn.string().optional()}).extend(O_);var L0a=Wn.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","dotnet","jvm"]);var U0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),sdk:L0a,code:Wn.string()}).extend(O_);var V0a=Wn.union("type",{language:F0a,sdk:U0a}).transform({transform:e=>{switch(e.type){case"language":return $Sr.language(e);case"sdk":return $Sr.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var W0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),pathParameters:Wn.list(R0a).optional(),queryParameters:Wn.list(C7n).optional(),headers:Wn.list(A7n).optional(),request:Wn.lazy(()=>yA).optional(),response:Wn.lazy(()=>yA).optional(),codeSamples:Wn.list(V0a)}).extend(O_);var N7n=Wn.union("type",{unknown:Wn.object({value:I0a}),full:W0a}).transform({transform:e=>{switch(e.type){case"unknown":return dAt.unknown(e.value);case"full":return dAt.full(e);default:return e}},untransform:({_visit:e,...t})=>t});var H0a=Wn.objectWithoutOptionalProperties({cursor:Wn.string(),nextCursor:Wn.property("next_cursor",Wn.string()),results:Wn.string()});var $0a=Wn.objectWithoutOptionalProperties({offset:Wn.string(),results:Wn.string(),step:Wn.string().optional(),hasNextPage:Wn.string().optional()});var z7n=Wn.union("type",{cursor:H0a,offset:$0a}).transform({transform:e=>{switch(e.type){case"cursor":return HSr.cursor(e);case"offset":return HSr.offset(e);default:return e}},untransform:({_visit:e,...t})=>t});var J0a=Wn.objectWithoutOptionalProperties({authed:Wn.boolean(),internal:Wn.boolean().optional(),idempotent:Wn.boolean().optional(),method:D7n,audiences:Wn.list(Wn.string()),path:Wn.string(),summary:Wn.string().optional(),operationId:Wn.string().optional(),tags:Wn.list(Kje),pathParameters:Wn.list(S7n),queryParameters:Wn.list(E7n),headers:Wn.list(E5r),sdkName:M5r.optional(),generatedRequestName:Wn.string(),requestNameOverride:Wn.string().optional(),request:A0a.optional(),response:N0a.optional(),errors:Wn.record(D5r,B0a),server:Wn.list(q7n),examples:Wn.list(N7n),pagination:z7n.optional()}).extend(O_).extend(Z0).extend(hb).extend(S5r);var G0a=Wn.enum_(["GET","POST"]);var K0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),payload:Wn.lazy(()=>yA)}).extend(O_);var Y0a=Wn.objectWithoutOptionalProperties({sdkName:M5r.optional(),method:G0a,summary:Wn.string().optional(),operationId:Wn.string(),tags:Wn.list(Kje),headers:Wn.list(E5r),generatedPayloadName:Wn.string(),payload:Wn.lazy(()=>D1),examples:Wn.list(K0a)}).extend(O_).extend(hb).extend(S5r);var X0a=Wn.objectWithoutOptionalProperties({queryParameters:Wn.list(E7n),headers:Wn.list(E5r),pathParameters:Wn.list(S7n)});var Q0a=Wn.objectWithoutOptionalProperties({messageType:Wn.string(),payload:Wn.lazy(()=>yA)}).extend(O_);var Z0a=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),queryParameters:Wn.list(C7n).optional(),headers:Wn.list(A7n).optional(),messages:Wn.list(Q0a)}).extend(O_);var k0a=Wn.objectWithoutOptionalProperties({path:Wn.string(),groupName:w5r,summary:Wn.string().optional(),handshake:X0a,publish:Wn.lazy(()=>D1).optional(),subscribe:Wn.lazy(()=>D1).optional(),examples:Wn.list(Z0a)}).extend(O_).extend(hb);var eva=Wn.objectWithoutOptionalProperties({rootSchemas:Wn.record(jQ,Wn.lazy(()=>D1)),namespacedSchemas:Wn.record(P0a,Wn.record(jQ,Wn.lazy(()=>D1)))});var tva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),minimum:Wn.number().optional(),maximum:Wn.number().optional(),exclusiveMinimum:Wn.boolean().optional(),exclusiveMaximum:Wn.boolean().optional(),multipleOf:Wn.number().optional()});var rva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional()});var nva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),minimum:Wn.number().optional(),maximum:Wn.number().optional(),exclusiveMinimum:Wn.boolean().optional(),exclusiveMaximum:Wn.boolean().optional(),multipleOf:Wn.number().optional()});var iva=Wn.objectWithoutOptionalProperties({default:Wn.string().optional(),pattern:Wn.string().optional(),format:Wn.string().optional(),minLength:Wn.number().optional(),maxLength:Wn.number().optional()});var ava=Wn.objectWithoutOptionalProperties({default:Wn.boolean().optional()});var ova=Wn.union("type",{int:tva,int64:rva,uint:Wn.object({}),uint64:Wn.object({}),float:Wn.object({}),double:nva,string:iva,datetime:Wn.object({}),date:Wn.object({}),base64:Wn.object({}),boolean:ava}).transform({transform:e=>{switch(e.type){case"int":return Xw.int(e);case"int64":return Xw.int64(e);case"uint":return Xw.uint();case"uint64":return Xw.uint64();case"float":return Xw.float();case"double":return Xw.double(e);case"string":return Xw.string(e);case"datetime":return Xw.datetime();case"date":return Xw.date();case"base64":return Xw.base64();case"boolean":return Xw.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var T5r=Wn.objectWithoutOptionalProperties({schema:ova}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(j1);var uva=Wn.objectWithoutOptionalProperties({header:Wn.string(),name:Wn.string().optional(),optional:Wn.boolean().optional(),env:Wn.string().optional(),schema:Wn.lazy(()=>D1).optional()});var sva=Wn.objectWithoutOptionalProperties({header:Wn.string(),name:Wn.string().optional(),env:Wn.string().optional(),schema:Wn.lazy(()=>D1).optional()});var Idf=Wn.objectWithoutOptionalProperties({apiVersion:Wn.unknown().optional(),title:Wn.string().optional(),description:Wn.string().optional(),basePath:Wn.string().optional(),servers:Wn.list(O0a),groups:Wn.record(Wn.string(),E0a),tags:M0a,hasEndpointsMarkedInternal:Wn.boolean(),endpoints:Wn.list(J0a),webhooks:Wn.list(Y0a),channel:Wn.list(k0a),groupedSchemas:eva,variables:Wn.record(Wn.string(),T5r),nonRequestReferencedSchemas:Wn.set(jQ),securitySchemes:Wn.record(f0a,m0a),globalHeaders:Wn.list(uva).optional(),idempotencyHeaders:Wn.list(sva).optional()});var NRt=Wn.objectWithoutOptionalProperties({schema:jQ}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(hb).extend(j1);var cva=Wn.union("type",{boolean:Wn.object({value:Wn.boolean()}),string:Wn.object({value:Wn.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return E7.boolean(e.value);case"string":return E7.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var B7n=Wn.objectWithoutOptionalProperties({value:cva}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(j1);var D1=Wn.union("type",{primitive:T5r,object:Wn.lazyObject(()=>lva),array:Wn.lazyObject(()=>fva),map:Wn.lazyObject(()=>dva),optional:Wn.lazyObject(()=>pva),enum:P7n,reference:NRt,literal:B7n,oneOf:Wn.object({value:Wn.lazy(()=>hva)}),nullable:Wn.lazyObject(()=>_va),unknown:Ym}).transform({transform:e=>{switch(e.type){case"primitive":return ib.primitive(e);case"object":return ib.object(e);case"array":return ib.array(e);case"map":return ib.map(e);case"optional":return ib.optional(e);case"enum":return ib.enum(e);case"reference":return ib.reference(e);case"literal":return ib.literal(e);case"oneOf":return ib.oneOf(e.value);case"nullable":return ib.nullable(e);case"unknown":return ib.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var I7n=Wn.objectWithoutOptionalProperties({propertyKey:Wn.string(),allOfSchemaIds:Wn.list(jQ),conflictingTypeSignatures:Wn.boolean()});var lva=Wn.objectWithoutOptionalProperties({allOf:Wn.list(NRt),properties:Wn.list(Wn.lazyObject(()=>yva)),allOfPropertyConflicts:Wn.list(I7n),additionalProperties:Wn.boolean()}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(hb).extend(j1);var R7n=Wn.objectWithoutOptionalProperties({differentSchema:Wn.boolean()});var yva=Wn.objectWithoutOptionalProperties({key:Wn.string(),schema:Wn.lazy(()=>D1),conflict:Wn.record(jQ,R7n),generatedName:Wn.string(),nameOverride:Wn.string().optional(),audiences:Wn.list(Wn.string())}).extend(Z0);var fva=Wn.objectWithoutOptionalProperties({value:Wn.lazy(()=>D1)}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(j1);var dva=Wn.objectWithoutOptionalProperties({key:T5r,value:Wn.lazy(()=>D1)}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(Ene).extend(j1);var pva=Wn.objectWithoutOptionalProperties({value:Wn.lazy(()=>D1)}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(j1);var _va=Wn.objectWithoutOptionalProperties({value:Wn.lazy(()=>D1)}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(j1);var hva=Wn.union("type",{discriminated:Wn.lazyObject(()=>vva),undisciminated:Wn.lazyObject(()=>bva)}).transform({transform:e=>{switch(e.type){case"discriminated":return JSr.discriminated(e);case"undisciminated":return JSr.undisciminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var vva=Wn.objectWithoutOptionalProperties({discriminantProperty:Wn.string(),commonProperties:Wn.list(Wn.lazyObject(()=>gva)),schemas:Wn.record(Wn.string(),Wn.lazy(()=>D1))}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(Ene).extend(hb).extend(j1);var gva=Wn.objectWithoutOptionalProperties({key:Wn.string(),schema:Wn.lazy(()=>D1)});var bva=Wn.objectWithoutOptionalProperties({schemas:Wn.list(Wn.lazy(()=>D1))}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(Ene).extend(hb).extend(j1);var Zlu={};Wb(Zlu,{ArraySchemaWithExample:()=>Lva,Base64WithExample:()=>zva,BooleanWithExample:()=>Bva,CommonPropertyWithExample:()=>Yva,DateWithExample:()=>Nva,DatetimeWithExample:()=>Ava,DiscriminatedOneOfSchemaWithExample:()=>Gva,DoubleWithExample:()=>qva,EndpointWithExample:()=>Fdf,EnumSchemaWithExample:()=>Rva,FloatWithExample:()=>Tva,HeaderWithExample:()=>L7n,HttpErrorWithExample:()=>Dva,Int64WithExample:()=>Eva,IntWithExample:()=>Sva,JsonRequestWithExample:()=>Ova,JsonResponseWithExample:()=>jva,MapSchemaWithExample:()=>Uva,NamedFullExample:()=>zRt,NullableSchemaWithExample:()=>Wva,ObjectPropertyWithExample:()=>Jva,ObjectSchemaWithExample:()=>Hva,OneOfSchemaWithExample:()=>$va,OptionalSchemaWithExample:()=>Vva,PathParameterWithExample:()=>mva,PrimitiveSchemaValueWithExample:()=>Iva,PrimitiveSchemaWithExample:()=>U7n,QueryParameterWithExample:()=>F7n,RequestWithExample:()=>Pva,ResponseWithExample:()=>wva,SchemaWithExample:()=>aq,StringSchemaWithExample:()=>Cva,Uint64WithExample:()=>xva,UintWithExample:()=>Mva,UnDiscriminatedOneOfSchemaWithExample:()=>Kva,UnknownSchemaWithExample:()=>Fva,WebsocketHandshakeWithExample:()=>Rdf});var zRt=Wn.objectWithoutOptionalProperties({name:Wn.string().optional(),value:Wn.unknown()}).extend(O_);var F7n=Wn.objectWithoutOptionalProperties({name:Wn.string(),schema:Wn.lazy(()=>aq),parameterNameOverride:Wn.string().optional()}).extend(O_).extend(Z0).extend(hb);var L7n=Wn.objectWithoutOptionalProperties({name:Wn.string(),schema:Wn.lazy(()=>aq),env:Wn.string().optional(),parameterNameOverride:Wn.string().optional()}).extend(O_).extend(Z0).extend(hb);var Rdf=Wn.objectWithoutOptionalProperties({queryParameters:Wn.list(F7n),headers:Wn.list(L7n)});var mva=Wn.objectWithoutOptionalProperties({name:Wn.string(),schema:Wn.lazy(()=>aq),variableReference:Wn.string().optional(),parameterNameOverride:Wn.string().optional()}).extend(O_).extend(Z0).extend(hb);var Ova=Wn.objectWithoutOptionalProperties({schema:Wn.lazy(()=>aq),contentType:Wn.string().optional(),fullExamples:Wn.list(zRt).optional(),additionalProperties:Wn.boolean()}).extend(O_).extend(hb);var Pva=Wn.union("type",{octetStream:M7n,multipart:x7n,json:Ova}).transform({transform:e=>{switch(e.type){case"octetStream":return S2e.octetStream(e);case"multipart":return S2e.multipart(e);case"json":return S2e.json(e);default:return e}},untransform:({_visit:e,...t})=>t});var jva=Wn.objectWithoutOptionalProperties({schema:Wn.lazy(()=>aq),responseProperty:Wn.string().optional(),fullExamples:Wn.list(zRt).optional()}).extend(O_).extend(hb);var wva=Wn.union("type",{file:T7n,json:jva,text:x5r,streamingSse:GSr,streamingText:x5r,streamingJson:GSr}).transform({transform:e=>{switch(e.type){case"file":return T3.file(e);case"json":return T3.json(e);case"text":return T3.text(e);case"streamingSse":return T3.streamingSse(e);case"streamingText":return T3.streamingText(e);case"streamingJson":return T3.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var Dva=Wn.objectWithoutOptionalProperties({statusCode:D5r,schema:Wn.lazy(()=>aq),fullExamples:Wn.list(zRt).optional()}).extend(O_).extend(Ym).extend(hb);var Fdf=Wn.objectWithoutOptionalProperties({authed:Wn.boolean(),internal:Wn.boolean().optional(),idempotent:Wn.boolean().optional(),method:D7n,audiences:Wn.list(Wn.string()),path:Wn.string(),summary:Wn.string().optional(),operationId:Wn.string().optional(),tags:Wn.list(Kje),pathParameters:Wn.list(mva),queryParameters:Wn.list(F7n),headers:Wn.list(L7n),sdkName:M5r.optional(),generatedRequestName:Wn.string(),requestNameOverride:Wn.string().optional(),request:Pva.optional(),response:wva.optional(),errors:Wn.record(D5r,Dva),server:Wn.list(q7n),examples:Wn.list(N7n),pagination:z7n.optional()}).extend(O_).extend(Z0).extend(hb).extend(S5r);var Sva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),minimum:Wn.number().optional(),maximum:Wn.number().optional(),exclusiveMinimum:Wn.boolean().optional(),exclusiveMaximum:Wn.boolean().optional(),multipleOf:Wn.number().optional(),example:Wn.number().optional()});var Eva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),example:Wn.number().optional()});var Mva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),example:Wn.number().optional()});var xva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),example:Wn.number().optional()});var Tva=Wn.objectWithoutOptionalProperties({example:Wn.number().optional()});var qva=Wn.objectWithoutOptionalProperties({default:Wn.number().optional(),minimum:Wn.number().optional(),maximum:Wn.number().optional(),exclusiveMinimum:Wn.boolean().optional(),exclusiveMaximum:Wn.boolean().optional(),multipleOf:Wn.number().optional(),example:Wn.number().optional()});var Cva=Wn.objectWithoutOptionalProperties({default:Wn.string().optional(),pattern:Wn.string().optional(),format:Wn.string().optional(),minLength:Wn.number().optional(),maxLength:Wn.number().optional(),example:Wn.string().optional()});var Ava=Wn.objectWithoutOptionalProperties({example:Wn.string().optional()});var Nva=Wn.objectWithoutOptionalProperties({example:Wn.string().optional()});var zva=Wn.objectWithoutOptionalProperties({example:Wn.string().optional()});var Bva=Wn.objectWithoutOptionalProperties({default:Wn.boolean().optional(),example:Wn.boolean().optional()});var Iva=Wn.union("type",{int:Sva,int64:Eva,uint:Mva,uint64:xva,float:Tva,double:qva,string:Cva,datetime:Ava,date:Nva,base64:zva,boolean:Bva}).transform({transform:e=>{switch(e.type){case"int":return by.int(e);case"int64":return by.int64(e);case"uint":return by.uint(e);case"uint64":return by.uint64(e);case"float":return by.float(e);case"double":return by.double(e);case"string":return by.string(e);case"datetime":return by.datetime(e);case"date":return by.date(e);case"base64":return by.base64(e);case"boolean":return by.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var U7n=Wn.objectWithoutOptionalProperties({schema:Iva}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(j1);var Rva=Wn.objectWithoutOptionalProperties({default:j5r.optional(),values:Wn.list(j5r),example:Wn.string().optional()}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(hb).extend(j1);var Fva=Wn.objectWithoutOptionalProperties({example:Wn.unknown()}).extend(w1).extend(Ym).extend(O_).extend(Z0).extend(j1);var aq=Wn.union("type",{primitive:U7n,object:Wn.lazyObject(()=>Hva),array:Wn.lazyObject(()=>Lva),map:Wn.lazyObject(()=>Uva),optional:Wn.lazyObject(()=>Vva),enum:Rva,reference:NRt,literal:B7n,oneOf:Wn.object({value:Wn.lazy(()=>$va)}),nullable:Wn.lazyObject(()=>Wva),unknown:Fva}).transform({transform:e=>{switch(e.type){case"primitive":return Lp.primitive(e);case"object":return Lp.object(e);case"array":return Lp.array(e);case"map":return Lp.map(e);case"optional":return Lp.optional(e);case"enum":return Lp.enum(e);case"reference":return Lp.reference(e);case"literal":return Lp.literal(e);case"oneOf":return Lp.oneOf(e.value);case"nullable":return Lp.nullable(e);case"unknown":return Lp.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var Lva=Wn.objectWithoutOptionalProperties({value:Wn.lazy(()=>aq),example:Wn.list(Wn.unknown()).optional()}).extend(w1).extend(Ym).extend(O_).extend(Z0).extend(j1);var Uva=Wn.objectWithoutOptionalProperties({key:U7n,value:Wn.lazy(()=>aq),example:Wn.unknown().optional()}).extend(w1).extend(Ym).extend(O_).extend(Z0).extend(Ene).extend(j1);var Vva=Wn.objectWithoutOptionalProperties({value:Wn.lazy(()=>aq)}).extend(w1).extend(Ym).extend(O_).extend(Z0).extend(j1);var Wva=Wn.objectWithoutOptionalProperties({value:Wn.lazy(()=>aq)}).extend(w1).extend(Ym).extend(O_).extend(Z0).extend(j1);var Hva=Wn.objectWithoutOptionalProperties({allOf:Wn.list(NRt),properties:Wn.list(Wn.lazyObject(()=>Jva)),allOfPropertyConflicts:Wn.list(I7n),fullExamples:Wn.list(zRt).optional(),additionalProperties:Wn.boolean()}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(hb).extend(j1);var Jva=Wn.objectWithoutOptionalProperties({key:Wn.string(),schema:Wn.lazy(()=>aq),audiences:Wn.list(Wn.string()),conflict:Wn.record(jQ,R7n),nameOverride:Wn.string().optional(),generatedName:Wn.string()}).extend(Z0);var $va=Wn.union("type",{discriminated:Wn.lazyObject(()=>Gva),undisciminated:Wn.lazyObject(()=>Kva)}).transform({transform:e=>{switch(e.type){case"discriminated":return PQ.discriminated(e);case"undisciminated":return PQ.undisciminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var Gva=Wn.objectWithoutOptionalProperties({discriminantProperty:Wn.string(),commonProperties:Wn.list(Wn.lazyObject(()=>Yva)),schemas:Wn.record(Wn.string(),Wn.lazy(()=>aq))}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(Ene).extend(hb).extend(j1);var Yva=Wn.objectWithoutOptionalProperties({key:Wn.string(),schema:Wn.lazy(()=>aq)});var Kva=Wn.objectWithoutOptionalProperties({schemas:Wn.list(Wn.lazy(()=>aq))}).extend(O_).extend(Ym).extend(w1).extend(Z0).extend(Ene).extend(hb).extend(j1);function Xva(e){switch(e.type){case"protobuf":return{proto:{type:e.typeName}};default:Ol(e.type)}}function V7n(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:Ol(e)}}function A2(e){return typeof e=="string"?e:e.type}function A_i(e){if(typeof e!="string")return e.docs}function Ldf(e){if(typeof e!="string")return e.default}function Udf(e){if(typeof e!="string")return e.validation}function C01(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 Vdf(e){let t=e?C01(e):void 0;if(t==null||t.length===0)return zui;let r=[];for(let[n,i]of t.entries())if(typeof i=="string")r.push(FE(i));else if(typeof i=="object")switch(i.type){case"namespace":{n<t.length-1?r.push(FE(i.name)):r.push(i.name,zui);break}default:Ol(i.type)}else Ol(i);return r.join("/")}function W7n(e){return zs.of(`${Vdf(e)}.yml`)}function klu({sdkName:e,namespaceOverride:t}){let r;return e==null||e.groupName.length===0&&t==null?zui:(t!=null?r=[{type:"namespace",name:t},...e.groupName.filter(n=>typeof n=="string"||n.type!=="namespace")]:r=e.groupName,Vdf(r))}function Wdf({sdkName:e,namespaceOverride:t}){return zs.of(`${klu({sdkName:e,namespaceOverride:t})}.yml`)}function Hdf({location:e,namespaceOverride:t}){return t!=null?pf(zs.of(t),e):e}function q3(e){switch(e){case vW.Deprecated:return"deprecated";case vW.Beta:return"pre-release";case vW.GenerallyAvailable:return"generally-available";default:return}}var A01=-2147483648,N01=2147483647,z01=-17976931348623157e292,B01=17976931348623157e292;function S1({schema:e,fileContainingReference:t,declarationFile:r=t,context:n,namespace:i}){switch(e.type){case"primitive":return Qva(e);case"array":return rfu({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i});case"map":return nfu({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i});case"reference":return tfu({schema:e,fileContainingReference:t,context:n,namespace:i});case"unknown":return afu();case"optional":case"nullable":return ifu({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i});case"enum":return $01({schema:e,fileContainingReference:t,context:n,declarationFile:r});case"literal":return e.value,ofu(e);case"object":return J01({schema:e,fileContainingReference:t,context:n,declarationFile:r,namespace:i});case"oneOf":return G01({schema:e.value,fileContainingReference:t,context:n,declarationFile:r,namespace:i});default:Ol(e)}}function Qva(e){switch(e.schema.type){case"string":return F01({description:e.description,schema:e.schema});case"int":return L01({description:e.description,schema:e.schema});case"float":return U01({description:e.description,schema:e.schema});case"double":return V01({description:e.description,schema:e.schema});case"boolean":return I01({description:e.description,schema:e.schema});case"int64":return R01({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:q3(e.availability)}:{}}}function I01({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 R01({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 F01({description:e,schema:t}){let r="string",n=W01(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 L01({description:e,schema:t}){let r="integer",n=$df(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 U01({description:e,schema:t}){let r="float";if(e==null)return r;let n={type:r};return e!=null&&(n.docs=e),n}function V01({description:e,schema:t}){let r="double",n=$df(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 W01(e){if(e==null)return;let{format:t,pattern:r,minLength:n,maxLength:i}=e,a=H01(t);if(!(a==null&&r==null&&n==null&&i==null))return{format:a,pattern:r,minLength:n,maxLength:i}}function H01(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 $df(e,t){if(e==null)return;let{minimum:r,maximum:n,multipleOf:i}=e,{exclusiveMinimum:a,exclusiveMaximum:u}=e;if(r=efu(r,t),n=efu(n,t),i=efu(i,t),!(r==null&&n==null&&a==null&&u==null&&i==null))return{min:r,max:n,exclusiveMin:a,exclusiveMax:u,multipleOf:i}}function efu(e,t){if(e===void 0)return;let[r,n]=t==="integer"?[A01,N01]:[z01,B01];return e<r||e>n?void 0:e}function tfu({schema:e,fileContainingReference:t,context:r,namespace:n}){let i=r.getSchema(e.schema,n);if(i==null)return"unknown";let a=K01(i)??e.schema,u=V7n(i),f=Y01(i),d=Zva({context:r,fileContainingReference:t,declarationFile:W7n(u),type:a}),c=i.type==="nullable"?`optional<${d}>`:d;return e.description==null&&f==null?c:{...f!=null?{"display-name":f}:{},type:i.type==="nullable"?`optional<${d}>`:d,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:q3(e.availability)}:{}}}function rfu({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i}){let a=S1({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i}),u=`list<${A2(a)}>`;return e.description==null&&e.title==null?u:{...e.title!=null?{"display-name":e.title}:{},...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:q3(e.availability)}:{},type:u}}function nfu({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i}){let a=Qva(e.key),u=S1({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i}),f=e.encoding!=null?Xva(e.encoding):void 0,d=`map<${A2(a)}, ${A2(u)}>`;if(e.description==null&&f==null&&e.title==null)return d;let c={type:d};return e.description!=null&&(c.docs=e.description),e.encoding!=null&&(c.encoding=f),e.availability!=null&&(c.availability=q3(e.availability)),c}function ifu({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i}){let a=S1({schema:e.value,fileContainingReference:t,declarationFile:r,context:n,namespace:i}),u=A2(a),f=A_i(a),d=Ldf(a),c=Udf(a),o=u.startsWith("optional<")?u:`optional<${u}>`;if(e.availability==null&&e.description==null&&f==null&&d==null&&c==null&&e.title==null)return o;let l={type:o};return(e.description!=null||f!=null)&&(l.docs=e.description??f),d!=null&&(l.default=d),c!=null&&(l.validation=c),e.availability!=null&&(l.availability=q3(e.availability)),l}function afu(){return"unknown"}function ofu(e){let t;switch(e.value.type){case"boolean":{t=`literal<${e.value.value}>`;break}case"string":{t=`literal<"${e.value.value}">`;break}default:Ol(e.value)}return e.description==null&&e.title==null?t:{...e.title!=null?{"display-name":e.title}:{},type:t,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:q3(e.availability)}:{}}}function $01({schema:e,fileContainingReference:t,declarationFile:r,context:n}){let i=N_i(e),a=e.nameOverride??e.generatedName;n.builder.addType(r,{name:a,schema:i.schema});let u=Zva({type:a,fileContainingReference:t,declarationFile:r,context:n});if(e.description==null&&e.default==null&&e.title==null)return u;let f={type:u};return e.description!=null&&(f.docs=e.description),e.default!=null&&(f.default=e.default.value),e.availability!=null&&(f.availability=q3(e.availability)),f}function J01({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i}){let a=ufu({schema:e,declarationFile:r,context:n,namespace:i}),u=e.nameOverride??e.generatedName;n.builder.addType(r,{name:u,schema:a.schema});let f=Zva({type:u,fileContainingReference:t,declarationFile:r,context:n});return e.description==null&&e.title==null?f:{...e.title!=null?{"display-name":e.title}:{},type:f,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:q3(e.availability)}:{}}}function G01({schema:e,fileContainingReference:t,declarationFile:r,context:n,namespace:i}){let a=sfu({schema:e,declarationFile:r,context:n,namespace:i}),u=e.nameOverride??e.generatedName;n.builder.addType(r,{name:u,schema:a.schema});let f=Zva({type:u,fileContainingReference:t,declarationFile:r,context:n});return e.description==null&&e.title==null?f:{...e.title!=null?{"display-name":e.title}:{},type:f,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:q3(e.availability)}:{}}}function Zva({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 K01(e){return ib._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 Y01(e){return ib._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 Ben(e){switch(e.type){case"openapi":return{openapi:e.file};case"protobuf":return{proto:e.file};default:Ol(e)}}function Gdf({schema:e,context:t,declarationFile:r,namespace:n}){switch(e.type){case"primitive":return Z01(e);case"array":return X01({schema:e,context:t,declarationFile:r,namespace:n});case"map":return Q01({schema:e,context:t,declarationFile:r,namespace:n});case"reference":return k01({schema:e,context:t,declarationFile:r,namespace:n});case"unknown":return tv1(e.nameOverride,e.generatedName);case"optional":case"nullable":return ev1({schema:e,context:t,declarationFile:r,namespace:n});case"enum":return N_i(e);case"literal":return rv1(e,e.nameOverride,e.generatedName);case"object":return ufu({schema:e,context:t,declarationFile:r,namespace:n});case"oneOf":return sfu({schema:e.value,context:t,declarationFile:r,namespace:n});default:Ol(e)}}function ufu({schema:e,context:t,declarationFile:r,namespace:n}){let i={},a=new Set;for(let c of e.properties){if(Object.keys(c.conflict).length>0){if(Object.entries(c.conflict).every(([S,x])=>!x.differentSchema))continue;Object.entries(c.conflict).forEach(([S])=>{cfu({property:c.key,schemaId:S,context:t,namespace:n}).forEach(A=>{a.add(A)})})}let o=S1({schema:c.schema,context:t,fileContainingReference:r,namespace:n}),l=c.audiences,g=c.nameOverride,O=q3(c.availability);i[c.key]=av1(o,l,g,O)}let u=new Set;for(let c of e.allOfPropertyConflicts)c.allOfSchemaIds.forEach(o=>a.add(o)),c.conflictingTypeSignatures&&u.add(c.propertyKey);let f=[];for(let c of e.allOf){let o=Kdf({schema:c.schema,context:t,namespace:n});if(o==null||a.has(c.schema)||a.has(o))continue;let l=S1({schema:ib.reference(c),context:t,fileContainingReference:r,namespace:n});f.push(A2(l))}for(let c of a){let o=lfu(t,c,n);for(let l of o.properties)i[l.key]==null&&(u.has(l.key)&&(i[l.key]="unknown"),i[l.key]=S1({schema:l.schema,context:t,fileContainingReference:r,namespace:n}));for(let l of o.allOf){if(a.has(l.schema))continue;let g=S1({schema:ib.reference(l),context:t,fileContainingReference:r,namespace:n});f.push(A2(g))}}let d={docs:e.description??void 0,properties:Object.fromEntries(Object.entries(i).map(([c,o])=>iv1(c)?[c,typeof o=="string"?{type:o,name:`_${c}`}:{...o,name:`_${c}`}]:[c,o]))};return f.length>0&&(d.extends=f),e.additionalProperties&&(d["extra-properties"]=!0),e.availability!=null&&(d.availability=q3(e.availability)),e.source!=null&&(d.source=Ben(e.source)),{name:e.nameOverride??e.generatedName,schema:d}}function cfu({property:e,schemaId:t,context:r,namespace:n}){let i=r.getSchema(t,n);if(i==null)return[];if(i.type==="reference")return cfu({property:e,schemaId:i.schema,context:r,namespace:n});if(i.type==="object"){let{properties:a,allOf:u}=lfu(r,t,n),f=a.some(c=>c.key===e),d=[...u.flatMap(c=>cfu({property:e,context:r,schemaId:c.schema,namespace:n}))];if(f||d.length>0)return[t,...d]}return[]}function lfu(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 lfu(e,n.schema,r);throw new Error(`Cannot getAllProperties for a non-object schema. schemaId=${t}, type=${n.type}`)}function X01({schema:e,context:t,declarationFile:r,namespace:n}){return{name:e.nameOverride??e.generatedName,schema:rfu({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:n})}}function Q01({schema:e,context:t,declarationFile:r,namespace:n}){return{name:e.nameOverride??e.generatedName,schema:nfu({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:n})}}function Z01(e){let t=Qva(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 Jdf(e){return e.camel==null&&e.pascal==null&&e.screamingSnake==null&&e.snake==null}function N_i(e){let t={enum:e.values.map(i=>{let a=i.nameOverride??i.generatedName,u=i.value;if(a===u&&i.description==null&&(i.casing==null||Jdf(i.casing)))return a;let f={value:i.value};if(a!==u&&(f.name=a),i.description!=null&&(f.docs=i.description),i.casing!=null&&!Jdf(i.casing)){let d={},c=!1;i.casing.camel!=null&&(d.camel=i.casing.camel,c=!0),i.casing.screamingSnake!=null&&(d["screaming-snake"]=i.casing.screamingSnake,c=!0),i.casing.snake!=null&&(d.snake=i.casing.snake,c=!0),i.casing.pascal!=null&&(d.pascal=i.casing.pascal,c=!0),c&&(f.casing=d)}return f})};e.description!=null&&(t.docs=e.description),e.default!=null&&(t.default=e.default.value);let r=new Set,n={...t,enum:[],source:e.source!=null?Ben(e.source):void 0};for(let i of t.enum){let a=typeof i=="string"?i:i.name??i.value;r.has(a.toLowerCase())||(n.enum.push(i),r.add(a.toLowerCase()))}return{name:e.nameOverride??e.generatedName,schema:n}}function k01({schema:e,context:t,declarationFile:r,namespace:n}){return{name:e.nameOverride??e.generatedName,schema:tfu({schema:e,context:t,fileContainingReference:r,namespace:n})}}function ev1({schema:e,context:t,declarationFile:r,namespace:n}){return{name:e.nameOverride??e.generatedName,schema:ifu({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:n})}}function tv1(e,t){return{name:e??t,schema:afu()}}function rv1(e,t,r){return{name:t??r,schema:ofu(e)}}function sfu({schema:e,context:t,declarationFile:r,namespace:n}){let i=e.encoding!=null?Xva(e.encoding):void 0;if(e.type==="discriminated"){let u={};for(let d of e.commonProperties)u[d.key]=S1({schema:d.schema,fileContainingReference:r,context:t,namespace:n});let f={};for(let[d,c]of Object.entries(e.schemas))f[d]=S1({schema:c,context:t,fileContainingReference:r,namespace:n});return{name:e.nameOverride??e.generatedName,schema:{discriminant:e.discriminantProperty,"base-properties":u,docs:e.description??void 0,availability:e.availability!=null?q3(e.availability):void 0,union:f,encoding:i,source:e.source!=null?Ben(e.source):void 0}}}let a=[];for(let u of e.schemas)a.push(S1({schema:u,fileContainingReference:r,context:t,namespace:n}));return{name:e.nameOverride??e.generatedName,schema:{discriminated:!1,docs:e.description??void 0,union:a,encoding:i,source:e.source!=null?Ben(e.source):void 0}}}var nv1=/^[0-9]/;function iv1(e){return nv1.test(e)}function Kdf({schema:e,context:t,namespace:r}){let n=t.getSchema(e,r);if(n!=null)return n.type==="reference"?Kdf({context:t,schema:n.schema,namespace:r}):e}function av1(e,t,r,n){return t.length===0&&r==null&&n==null?e:{...typeof e=="string"?{type:e}:{...e},...t.length>0?{audiences:t}:{},...r!=null?{name:r}:{},...n!=null?{availability:n}:{}}}function Ydf(e){let t=e.replace(/^x-|^X-/,"");return FE(t)}var Xdf="BasicAuthScheme",kva="BearerAuthScheme";function Qdf(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:Xdf,schema:i}),t||(e.builder.setAuth(Xdf),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:kva,schema:i}),t||(e.builder.setAuth(kva),t=!0)}else if(n.type==="header")if(t)e.builder.addGlobalHeader({name:n.headerName,schema:{type:"string",name:n.headerVariableName??Ydf(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:kva,schema:i}),t||(e.builder.setAuth(kva),t=!0),n.scopesEnum!=null&&n.scopesEnum.values.length>0&&e.builder.addType(zs.of("__package__.yml"),{name:"OauthScope",schema:N_i(n.scopesEnum).schema})}}function BRt({header:e,context:t,fileContainingReference:r,namespace:n}){let i=S1({schema:e.schema,context:t,fileContainingReference:r,namespace:n}),a=A2(i),u=e.name.replace(/^x-|^X-/,""),f=e.parameterNameOverride!=null?e.parameterNameOverride:FE(u);if(e.description==null&&e.name===f&&e.env==null&&e.availability==null)return a;let d={type:a};return f!==e.name&&(d.name=f),e.description!=null&&(d.docs=e.description),e.env!=null&&(d.env=e.env),e.availability!=null&&(d.availability=q3(e.availability)),d}function eba({pathParameter:e,context:t,fileContainingReference:r,namespace:n}){let i=S1({schema:e.schema,context:t,fileContainingReference:r,namespace:n});if(e.variableReference==null&&e.description==null&&e.availability==null)return A2(i);let a=e.variableReference!=null?{variable:`$${e.variableReference}`}:{type:A2(i)};return e.description!=null&&(a.docs=e.description),e.availability!=null&&(a.availability=q3(e.availability)),a}var Zmu=require("fs/promises");var Zdf={naming:"v1"};function Lh(e,t){let r=Array.isArray(t)?t:[t];for(let n of r){let i=e[n];if(i!=null)return i}}function IRt(e,t,r,n,i=[]){try{let a=Lh(e,t);if(a!=null)return r.parse(a)}catch{let u=Y8t(i).join(" -> ");n.error(`${u.length>0?`${u}: `:""}Failed to parse ${t}`)}}var tba={of(e){return e}};var kh={SDK_METHOD_NAME:tba.of("x-fern-sdk-method-name"),SDK_GROUP_NAME:tba.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:tba.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",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"};function gy(e){return e.$ref!=null}function E2e(e){switch(Lh(e,kh.AVAILABILITY)){case"deprecated":return vW.Deprecated;case"beta":return vW.Beta;case"generally-available":return vW.GenerallyAvailable;default:break}if(!gy(e)&&e.deprecated)return vW.Deprecated}var Yje={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"};function kdf({schema:e,logger:t}){return IRt(e,kh.ENCODING,t8.EncodingSchema,t)??void 0}function epf(e){return Lh(e,kh.FERN_ENUM)}function tpf({nameOverride:e,generatedName:t,title:r,schema:n,description:i,availability:a}){let u=Lh(n,kh.SDK_GROUP_NAME),f=Lh(n,kh.TYPE_DEFINITION);if(f!=null)return z_i({fernType:f,nameOverride:e,generatedName:t,title:r,description:i,availability:a,groupName:typeof u=="string"?[u]:u})}function z_i({fernType:e,nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u}){return BJ({type:e,_default:void 0,validation:void 0,visitor:{primitive:f=>{switch(f.v1){case"BASE_64":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.base64({example:void 0})});case"BOOLEAN":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.boolean({default:void 0,example:void 0})});case"DATE":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.date({example:void 0})});case"DATE_TIME":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.datetime({example:void 0})});case"FLOAT":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.float({example:void 0})});case"DOUBLE":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.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 Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.uint({default:void 0,example:void 0})});case"INTEGER":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.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 Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.uint64({default:void 0,example:void 0})});case"LONG":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.int64({default:void 0,example:void 0})});case"STRING":case"UUID":case"BIG_INTEGER":return Lp.primitive({nameOverride:t,generatedName:r,title:n,description:i,availability:a,groupName:u,schema:by.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})});default:Ol(f.v1)}},unknown:()=>Lp.unknown({nameOverride:t,generatedName:r,title:n,example:void 0,description:i,availability:a,groupName:u}),map:({keyType:f,valueType:d})=>(f==null?void 0:f.type)==="primitive"&&d!=null?Lp.map({nameOverride:t,generatedName:r,title:n,key:f,value:d,description:i,availability:a,groupName:u,encoding:void 0,example:void 0}):void 0,list:f=>f!=null?Lp.array({nameOverride:t,generatedName:r,title:n,value:f,description:i,availability:a,groupName:u,example:void 0}):void 0,optional:f=>f!=null?Lp.optional({nameOverride:t,generatedName:r,title:n,value:f,description:i,availability:a,groupName:u}):void 0,set:f=>f!=null?Lp.array({nameOverride:t,generatedName:r,title:n,value:f,description:i,availability:a,groupName:u,example:void 0}):void 0,literal:f=>Lp.literal({nameOverride:t,generatedName:r,title:n,value:f._visit({string:d=>E7.string(d),boolean:d=>E7.boolean(d),_other:()=>{throw new Error("Unexpected literal type")}}),description:i,availability:a,groupName:u}),named:()=>{}}})}function Ien(e){if(e!=null&&typeof e=="boolean")return e}function rpf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,additionalProperties:i,description:a,availability:u,wrapAsNullable:f,context:d,groupName:c,example:o,encoding:l,source:g,namespace:O}){return typeof i=="boolean"||H7n(i)?rba({nameOverride:e,generatedName:t,title:r,wrapAsNullable:f,description:a,availability:u,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:by.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:void 0}),groupName:void 0},valueSchema:Lp.unknown({nameOverride:void 0,generatedName:`${t}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,groupName:void 0}),groupName:c,example:o,encoding:l}):rba({nameOverride:e,generatedName:t,title:r,wrapAsNullable:f,description:a,availability:u,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:by.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:void 0}),groupName:void 0},valueSchema:L1(i,d.options.optionalAdditionalProperties?f:!1,d,[...n,"Value"],g,O),groupName:c,example:o,encoding:l})}function rba({nameOverride:e,generatedName:t,title:r,keySchema:n,valueSchema:i,wrapAsNullable:a,description:u,availability:f,groupName:d,example:c,encoding:o}){return a?Lp.nullable({nameOverride:e,generatedName:t,title:r,value:Lp.map({nameOverride:e,generatedName:t,title:r,description:u,availability:n.availability,key:n,value:i,groupName:d,encoding:o,example:c}),description:u,availability:f,groupName:d}):Lp.map({nameOverride:e,generatedName:t,title:r,description:u,availability:f,key:n,value:i,groupName:d,encoding:o,example:c})}function H7n(e){return e==null?!1:typeof e=="boolean"?e:!gy(e)&&Object.keys(e).length===0}function npf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,item:i,description:a,availability:u,wrapAsNullable:f,context:d,groupName:c,example:o,source:l,namespace:g}){let O=i==null?Lp.unknown({nameOverride:e,generatedName:t,title:r,description:void 0,availability:void 0,example:void 0,groupName:c}):L1(i,!1,d,[...n,"Item"],l,g);return ov1({nameOverride:e,generatedName:t,title:r,groupName:c,itemSchema:O,wrapAsNullable:f,description:a,availability:u,example:o})}function ov1({nameOverride:e,generatedName:t,title:r,itemSchema:n,wrapAsNullable:i,description:a,availability:u,groupName:f,example:d}){return i?Lp.nullable({nameOverride:e,generatedName:t,title:r,value:Lp.array({nameOverride:e,generatedName:t,title:r,value:n,description:a,availability:u,groupName:f,example:d}),description:a,availability:u,groupName:f}):Lp.array({nameOverride:e,generatedName:t,title:r,value:n,description:a,availability:u,groupName:f,example:d})}function ffu({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,availability:u,required:f,wrapAsNullable:d,discriminator:c,context:o,groupName:l,encoding:g,source:O,namespace:j}){let S=c.propertyName,x=Object.fromEntries(Object.entries(c.mapping??{}).map(([z,N])=>{let C=$7n({$ref:N},!1,o,[N],g,O,j);return o.markReferencedByDiscriminatedUnion({$ref:N},S,1),[z,C]})),A=Object.entries(i).filter(([z])=>z!==S).map(([z,N])=>{let C=f!=null&&f.includes(z),U=L1(N,!C,o,[...n,z],O,j);return{key:z,schema:U}});return ipf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:d,properties:A,description:a,availability:u,discriminant:S,subtypes:x,groupName:l,source:O})}function dfu({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,availability:u,required:f,wrapAsNullable:d,discriminant:c,variants:o,context:l,groupName:g,encoding:O,source:j,namespace:S}){let x=Object.fromEntries(Object.entries(o).map(([z,N])=>{if(gy(N)){let C=$7n(N,!1,l,[N.$ref],O,j,S);return l.markReferencedByDiscriminatedUnion(N,c,1),[z,C]}else{let C=q5r(N,!1,l,[...n,z],O,j,S,new Set([c]));return[z,C]}})),A=Object.entries(i).filter(([z])=>z!==c).map(([z,N])=>{let C=f!=null&&f.includes(z),U=L1(N,!C,l,[...n,z],j,S);return{key:z,schema:U}});return ipf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:d,properties:A,description:a,availability:u,discriminant:c,subtypes:x,groupName:g,source:j})}function ipf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,properties:i,description:a,availability:u,discriminant:f,subtypes:d,groupName:c,source:o}){return n?Lp.nullable({nameOverride:e,generatedName:t,title:r,value:Lp.oneOf(PQ.discriminated({description:a,availability:u,discriminantProperty:f,nameOverride:e,generatedName:t,title:r,schemas:d,commonProperties:i,groupName:c,encoding:void 0,source:o})),groupName:c,description:a,availability:u}):Lp.oneOf(PQ.discriminated({description:a,availability:u,discriminantProperty:f,nameOverride:e,generatedName:t,title:r,schemas:d,commonProperties:i,groupName:c,encoding:void 0,source:o}))}function apf(e){if(e.proto!=null)return b7n.protobuf({typeName:e.proto.type})}var uv1=/^(\d+)/;function nba(e){let t=e.match(uv1);if(t&&t[0]!=null){let r=t[0],n=e.substring(r.length),i=parseFloat(r);if(!isNaN(i)&&isFinite(i)){let a=J7n(i);return n.length>0?`${a}_${n}`:a}}}function J7n(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),f=e%10;return f===0?n[u]:`${n[u]}_${t[f]}`}if(e<1e3){let u=Math.floor(e/100),f=e%100;return f===0?`${t[u]}_hundred`:`${t[u]}_hundred_${J7n(f)}`}let i=Math.floor(e/1e3),a=e%1e3;return a===0?`${t[i]}_thousand`:`${t[i]}_thousand_${J7n(a)}`}var G7n=/^[a-zA-Z][a-zA-Z0-9_]*$/;function C5r({nameOverride:e,generatedName:t,title:r,fernEnum:n,enumVarNames:i,enumValues:a,_default:u,description:f,availability:d,wrapAsNullable:c,groupName:o,context:l,source:g}){let O=lv1(i??[]),j=new Set(a),S=Array.from(j).map((A,z)=>{var G,$,ee,Ve;let N=n==null?void 0:n[A],C=O[z],U=G7n.test(A),Y=(N==null?void 0:N.name)??C,te=U?A:B_i(A);return Y!=null&&!G7n.test(Y)&&(l==null||l.logger.warn(`Enum name override ${Y} is not a valid name. Falling back on ${te}.`),Y=void 0),{nameOverride:Y,generatedName:te,value:A,description:N==null?void 0:N.description,availability:d,casing:{snake:((G=N==null?void 0:N.casing)==null?void 0:G.snake)??void 0,pascal:(($=N==null?void 0:N.casing)==null?void 0:$.pascal)??void 0,screamingSnake:((ee=N==null?void 0:N.casing)==null?void 0:ee.screamingSnake)??void 0,camel:((Ve=N==null?void 0:N.casing)==null?void 0:Ve.camel)??void 0}}}),x=u!=null?S.find(A=>A.value===u):void 0;return sv1({wrapAsNullable:c,nameOverride:e,generatedName:t,title:r,values:S,_default:x,description:f,availability:d,groupName:o,source:g})}function sv1({wrapAsNullable:e,nameOverride:t,generatedName:r,title:n,values:i,_default:a,description:u,availability:f,groupName:d,source:c}){return e?Lp.nullable({nameOverride:t,generatedName:r,title:n,value:Lp.enum({nameOverride:t,generatedName:r,title:n,values:i,description:u,default:a,availability:f,example:void 0,groupName:d,source:c}),description:u,availability:f,groupName:d}):Lp.enum({nameOverride:t,generatedName:r,title:n,values:i,description:u,availability:f,default:a,example:void 0,groupName:d,source:c})}var cv1={"<":"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 B_i(e){let t=nba(e),r=cv1[e];return t!=null?qV(FE(t)):r??(e.toLowerCase()==="n/a"?"NOT_APPLICABLE":qV(FE(e)))}function lv1(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 opf({nameOverride:e,generatedName:t,title:r,format:n,_default:i,minimum:a,maximum:u,exclusiveMinimum:f,exclusiveMaximum:d,multipleOf:c,description:o,availability:l,wrapAsNullable:g,example:O,groupName:j}){return n==="int64"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.int64({default:i,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="uint32"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.uint({default:i,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="uint64"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.uint64({default:i,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):L9({nameOverride:e,generatedName:t,title:r,primitive:by.int({default:i,minimum:a,maximum:u,exclusiveMinimum:f,exclusiveMaximum:d,multipleOf:c,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j})}function upf(e){return typeof e=="string"?E7.string(e):typeof e=="boolean"?E7.boolean(e):E7.string(`${e}`)}function spf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,value:i,description:a,availability:u,groupName:f}){return n?Lp.nullable({nameOverride:e,generatedName:t,title:r,value:Lp.literal({nameOverride:e,generatedName:t,title:r,value:upf(i),description:a,availability:u,groupName:f}),description:a,availability:u,groupName:f}):Lp.literal({nameOverride:e,generatedName:t,title:r,value:upf(i),description:a,availability:u,groupName:f})}function pfu({nameOverride:e,generatedName:t,title:r,format:n,_default:i,minimum:a,maximum:u,exclusiveMinimum:f,exclusiveMaximum:d,multipleOf:c,description:o,availability:l,wrapAsNullable:g,example:O,groupName:j}){return n==null||n==="double"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.double({default:i,minimum:a,maximum:u,exclusiveMinimum:f,exclusiveMaximum:d,multipleOf:c,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="float"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.float({example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="int32"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.int({default:i,minimum:a,maximum:u,exclusiveMinimum:f,exclusiveMaximum:d,multipleOf:c,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="int64"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.int64({default:i,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="uint32"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.uint({default:i,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="uint64"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.uint64({default:i,example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):n==="time-delta"?L9({nameOverride:e,generatedName:t,title:r,primitive:by.float({example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j}):L9({nameOverride:e,generatedName:t,title:r,primitive:by.float({example:O}),wrapAsNullable:g,description:o,availability:l,groupName:j})}var fv1={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="schemas",applyStrategy:e=>{let t=[e[3]??""];return{refUnderProcessing:e.slice(4),newBreadcrumbs:t}}},dv1={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}}},pv1={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}}},_v1={isApplicable:e=>e[0]==="properties",applyStrategy:e=>{let t=[e[1]??""];return{refUnderProcessing:e.slice(2),newBreadcrumbs:t}}},hv1={isApplicable:e=>e[0]==="items",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},yv1={isApplicable:e=>e[0]==="allOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},vv1={isApplicable:e=>e[0]==="anyOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},bv1={isApplicable:e=>e[0]==="oneOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})};function iba(e){let t=e.split("/").map(a=>a.replace(/~1/g,"/")),r=[],n=[fv1,dv1,pv1,_v1,hv1,yv1,vv1,bv1],i;do{i=t;for(let a of n)if(a.isApplicable(t)){let{refUnderProcessing:u,newBreadcrumbs:f}=a.applyStrategy(t);t=u,r=[...r,...f]}}while(t.join("")!==i.join(""));return r}function yR(e){let t=e.join("_"),r=qV(FE(t));return/^\d/.test(r)?nba(r)??r:r}function _fu(e){let t=e.join("_");return FE(t)}function oq(e){switch(e.type){case"object":return ib.object({allOf:e.allOf,properties:e.properties.map(t=>mv1(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,groupName:e.groupName,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source});case"array":return ib.array({description:e.description,availability:e.availability,value:oq(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,groupName:e.groupName});case"enum":return ib.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,values:e.values,default:e.default,groupName:e.groupName,source:e.source});case"literal":return ib.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,groupName:e.groupName});case"nullable":return ib.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:oq(e.value),groupName:e.groupName});case"optional":return ib.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:oq(e.value),groupName:e.groupName});case"primitive":return ib.primitive({description:e.description,availability:e.availability,schema:cpf(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,groupName:e.groupName});case"map":return ib.map({description:e.description,availability:e.availability,key:ib.primitive({description:e.key.description,availability:e.key.availability,schema:cpf(e.key.schema),generatedName:e.key.generatedName,title:e.key.title,nameOverride:e.key.nameOverride,groupName:e.groupName}),value:oq(e.value),generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,groupName:e.groupName,encoding:e.encoding});case"reference":return ib.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schema:e.schema,groupName:e.groupName,source:e.source});case"oneOf":return ib.oneOf(gv1(e.value));case"unknown":return ib.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName});default:Ol(e)}}function gv1(e){switch(e.type){case"discriminated":return JSr.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:oq(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,oq(r)])),groupName:e.groupName,encoding:e.encoding,source:e.source});case"undisciminated":return JSr.undisciminated({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schemas:e.schemas.map(t=>oq(t)),groupName:e.groupName,encoding:e.encoding,source:e.source});default:Ol(e)}}function cpf(e){switch(e.type){case"string":return Xw.string(e);case"base64":return Xw.base64();case"boolean":return Xw.boolean(e);case"date":return Xw.date();case"datetime":return Xw.datetime();case"double":return Xw.double(e);case"float":return Xw.float();case"int":return Xw.int(e);case"int64":return Xw.int64(e);case"uint":return Xw.uint();case"uint64":return Xw.uint64();default:Ol(e)}}function mv1(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:oq(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability}}function aba(e,t){return RRt(oq(e),oq(t))}function RRt(e,t){return e.type==="primitive"&&t.type==="primitive"?lpf(e.schema,t.schema):e.type==="enum"&&t.type==="enum"?Ov1(e.values,t.values):e.type==="array"&&t.type==="array"?RRt(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"?RRt(e.value,t.value):e.type==="oneOf"&&t.type==="oneOf"?Pv1(e.value,t.value):e.type==="object"&&t.type==="object"?jv1(e,t):e.type==="map"&&t.type==="map"?lpf(e.key.schema,t.key.schema)&&RRt(e.value,t.value):e.type==="literal"&&t.type==="literal"?e.value===t.value:!1}function lpf(e,t){return e.type===t.type}function Ov1(e,t){let r=new Set(...e.map(i=>i.value)),n=new Set(...t.map(i=>i.value));return nDr(r,n)}function Pv1(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:RRt(n,i)}):e.type==="undisciminated"&&t.type==="undisciminated"?e.schemas.length===t.schemas.length&&e.schemas.every((r,n)=>{let i=t.schemas[n];return i==null?!1:RRt(r,i)}):!1}function jv1(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:RRt(a,i.schema)})}function fpf({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,properties:i,description:a,required:u,wrapAsNullable:f,allOf:d,context:c,propertiesToExclude:o,groupName:l,fullExamples:g,additionalProperties:O,availability:j,encoding:S,source:x,namespace:A}){let z=[...u??[]],N={...i},C=[],U=[];for(let $ of d)if(gy($)){let ee=c.resolveSchemaReference($);if(ee.discriminator!=null&&ee.discriminator.mapping!=null)continue;if(ee.oneOf!=null){for(let $e of ee.oneOf){let Dt=gy($e)?c.resolveSchemaReference($e):$e,Tt=L1(Dt,!1,c.DUMMY,n,x,A);Tt.type==="object"&&C.push(...Tt.properties.map(Wt=>Wt.schema.type!=="optional"&&Wt.schema.type!=="nullable"?{...Wt,schema:Lp.optional({nameOverride:void 0,generatedName:"",title:void 0,value:Wt.schema,description:void 0,availability:Wt.availability,groupName:void 0})}:Wt))}continue}let Ve=A5r($);if(Ve==null)continue;U.push({schemaId:Ve,convertedSchema:hfu($,[Ve],x),properties:dpf({schema:$,context:c,breadcrumbs:n,source:x,namespace:A})}),c.markSchemaAsReferencedByNonRequest(Ve)}else{let ee=L1($,!1,c,n,x,A);ee.type==="object"&&C.push(...ee.properties)}let Y={};for(let $ of U)for(let[ee,Ve]of Object.entries($.properties)){let $e=Y[ee];$e!=null?($e.schemaIds.push($.schemaId),$e.schemas.some(Tt=>aba(Tt,Ve))||$e.schemas.push(Ve)):Y[ee]={schemaIds:[$.schemaId],schemas:[Ve]}}let te=[];for(let[$,ee]of Object.entries(Y))ee.schemaIds.length>1&&te.push({propertyKey:$,allOfSchemaIds:ee.schemaIds,conflictingTypeSignatures:ee.schemas.length>1});let G=Object.entries(N).map(([$,ee])=>{let Ve=z.includes($),$e=Lh(ee,kh.AUDIENCES)??[],Dt=E2e(ee),Tt=Lh(ee,kh.FERN_PROPERTY_NAME),Wt=[...n,$],Nt=_fu(Wt),ur=Ve?L1(ee,!1,c,Wt,x,A):Lp.optional({nameOverride:e,generatedName:Nt,title:r,description:void 0,availability:Dt,value:L1(ee,!1,c,Wt,x,A),groupName:l}),Ar={};for(let Gr of U){let zt=Gr.properties[$];zt!=null&&!aba(ur,zt)?Ar[Gr.schemaId]={differentSchema:!0}:zt!=null&&(Ar[Gr.schemaId]={differentSchema:!1})}return{key:$,schema:ur,nameOverride:Tt,audiences:$e,conflict:Ar,generatedName:_fu([...n,$]),availability:Dt}});return G.push(...C.map($=>{let ee=$.conflict;for(let Ve of U){let $e=Ve.properties[$.key];$e!=null&&!aba($.schema,$e)?ee[Ve.schemaId]={differentSchema:!0}:$e!=null&&(ee[Ve.schemaId]={differentSchema:!1})}return{...$,conflict:ee}})),wv1({nameOverride:e,generatedName:t,title:r,wrapAsNullable:f,properties:G.filter($=>!o.has($.key)),description:a,allOf:U.map($=>$.convertedSchema),allOfPropertyConflicts:te,groupName:l,fullExamples:g,additionalProperties:O,availability:j,source:x})}function wv1({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,properties:i,description:a,allOf:u,allOfPropertyConflicts:f,groupName:d,fullExamples:c,additionalProperties:o,availability:l,source:g}){return n?Lp.nullable({nameOverride:e,generatedName:t,title:r,value:Lp.object({description:a,properties:i,nameOverride:e,generatedName:t,title:r,allOf:u,allOfPropertyConflicts:f,groupName:d,fullExamples:c,additionalProperties:H7n(o),availability:void 0,source:g}),description:a,availability:l,groupName:d}):Lp.object({description:a,properties:i,nameOverride:e,generatedName:t,title:r,allOf:u,allOfPropertyConflicts:f,groupName:d,fullExamples:c,additionalProperties:H7n(o),availability:l,source:g})}function dpf({schema:e,context:t,breadcrumbs:r,source:n,namespace:i}){let a={},[u,f]=gy(e)?[t.resolveSchemaReference(e),iba(e.$ref)]:[e,r];for(let d of u.allOf??[])a={...a,...dpf({schema:d,context:t,breadcrumbs:f,source:n,namespace:i})};for(let[d,c]of Object.entries(u.properties??{})){let o=L1(c,!1,t,[...f,d],n,i);a[d]=o}return a}function K7n({nameOverride:e,generatedName:t,title:r,breadcrumbs:n,description:i,availability:a,wrapAsNullable:u,context:f,subtypes:d,groupName:c,encoding:o,source:l,subtypePrefixOverrides:g,namespace:O}){let j=Dv1({schemas:d}),S=d.flatMap((z,N)=>{if(!gy(z)&&z.enum!=null)return z.enum.map(U=>Lp.literal({nameOverride:void 0,generatedName:yR([t,U]),title:void 0,value:E7.string(U),groupName:void 0,description:void 0,availability:U.availability}));let C=j[N];if(g!=null){let U=g[N];U!=null&&"name"in U&&(C=U.name)}return[L1(z,!1,f,[...n,C??`${N}`],l,O)]}),x=[];for(let z=0;z<S.length;++z){let N=S[z],C=!1;for(let U=z+1;U<S.length;++U){let Y=S[U];if(N!=null&&Y!=null&&RRt(N,Y)){C=!0;break}}N!=null&&!C&&x.push(N)}if(Object.entries(x).every(([z,N])=>N.type==="literal")){let z={},N=[];return Object.entries(x).forEach(([C,U])=>{U.type==="literal"&&U.value.type==="string"&&(N.push(U.value.value),U.description!=null&&(z[U.value.value]={description:U.description}))}),C5r({nameOverride:e,generatedName:t,title:r,wrapAsNullable:u,description:i,availability:a,fernEnum:z,enumVarNames:void 0,enumValues:N,_default:void 0,groupName:c,context:f,source:l})}return x.length===1&&x[0]!=null?x[0]:ppf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:u,description:i,availability:a,subtypes:x,groupName:c,encoding:o,source:l})}function yfu({nameOverride:e,generatedName:t,title:r,description:n,availability:i,wrapAsNullable:a,context:u,groupName:f,discriminator:d,encoding:c,source:o,namespace:l}){let g=Object.entries(d.mapping??{}).map(([S,x],A)=>{let z={$ref:x},N=$7n(z,!1,u,[x],c,o,l);return u.markSchemaWithDiscriminantValue(z,d.propertyName,S),N.type==="object"&&(N.properties={[d.propertyName]:Lp.literal({nameOverride:void 0,generatedName:yR([t,S]),title:void 0,value:E7.string(S),groupName:void 0,description:void 0,availability:void 0}),...N.properties.filter(C=>C.key!==d.propertyName)}),N}),O=[];for(let S=0;S<g.length;++S){let x=g[S],A=!1;for(let z=S+1;z<g.length;++z){let N=g[z];if(x!=null&&N!=null&&RRt(x,N)){A=!0;break}}x!=null&&!A&&O.push(x)}if(Object.entries(O).every(([S,x])=>x.type==="literal")){let S={},x=[];return Object.entries(O).forEach(([A,z])=>{z.type==="literal"&&z.value.type==="string"&&(x.push(z.value.value),z.description!=null&&(S[z.value.value]={description:z.description}))}),C5r({nameOverride:e,generatedName:t,title:r,wrapAsNullable:a,description:n,availability:i,fernEnum:S,enumVarNames:void 0,enumValues:x,_default:void 0,groupName:f,context:u,source:o})}return O.length===1&&O[0]!=null?O[0]:ppf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:a,description:n,availability:i,subtypes:O,groupName:f,encoding:c,source:o})}function Dv1({schemas:e}){let t={},r=0;for(let a of e){if(!gy(a)){if(a.properties!=null&&Object.entries(a.properties).length>0){let u=Object.keys(a.properties),f={},d=u;for(let[c,o]of Object.entries(t)){let l=CXi(o,u);d=CXi(d,o),f[c]=l}f[r]=d,t=f}}r++}let n=[],i=0;for(let a of e){let u=t[i];if(u!=null&&u.length>0){let f=u.sort();if(f[0]!=null){n.push(f[0]),++i;continue}}gy(a)?n.push(J7n(i)??`${i}`):a.type==="array"||a.type==="boolean"||a.type==="integer"||a.type==="number"||a.type==="string"?n.push(""):n.push(J7n(i)??`${i}`),++i}return n}function ppf({nameOverride:e,generatedName:t,title:r,wrapAsNullable:n,description:i,availability:a,subtypes:u,groupName:f,encoding:d,source:c}){return n?Lp.nullable({nameOverride:e,generatedName:t,title:r,value:Lp.oneOf(PQ.undisciminated({description:i,availability:a,nameOverride:e,generatedName:t,title:r,schemas:u,groupName:f,encoding:d,source:c})),description:i,availability:a,groupName:f}):Lp.oneOf(PQ.undisciminated({description:i,availability:a,nameOverride:e,generatedName:t,title:r,schemas:u,groupName:f,encoding:d,source:c}))}function Y7n(e){if(e.default!=null&&typeof e.default=="string")return e.default}function oba({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="number")return e.example;if(r&&typeof r=="number")return r;r&&t.warn(`Expected fallback to be a number, but got ${typeof r}`)}function _pf({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="boolean")return e.example;if(r&&typeof r=="boolean")return r;r&&t.warn(`Expected fallback to be a boolean, but got ${typeof r}`)}function FRt({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="string")return e.example;if(r&&typeof r=="string")return r;r&&t.warn(`Expected fallback to be a string, but got ${typeof r}`)}function hpf({schema:e,logger:t,fallback:r}){if(e.example!=null&&Array.isArray(e.example))return e.example;if(r&&Array.isArray(r))return r;r&&t.warn(`Expected fallback to be a array, but got ${typeof r}`)}var Ren="#/components/schemas/";function L1(e,t,r,n,i,a,u=!1,f=new Set,d){let c=Cv1({schema:e,logger:r.logger});if(gy(e)){let o=A5r(e);return o!=null?(u?r.markSchemaAsReferencedByRequest(o):r.markSchemaAsReferencedByNonRequest(o),$7n(e,t,r,n,c,i,a)):q5r(r.resolveSchemaReference(e),t,r,iba(e.$ref),c,i,a,f,u,d)}return q5r(e,t,r,n,c,i,a,f,u,d)}function $7n(e,t,r,n,i,a,u){let f=e.$ref.includes("properties")?q5r(r.resolveSchemaReference(e),t,r,n,i,a,u,new Set):Lp.reference(hfu(e,n,a));return t?Lp.nullable({title:void 0,nameOverride:void 0,generatedName:yR(n),value:f,description:void 0,availability:void 0,groupName:void 0}):f}function Sv1(e){if(e!=null&&!e.includes(" ")&&!!/^[a-zA-Z]+$/.test(e))return e}function q5r(e,t,r,n,i,a,u,f=new Set,d=!1,c){var C;let o=Lh(e,kh.TYPE_NAME)??(r.options.useTitlesAsName?Sv1(e.title):void 0),l=Lh(e,kh.SDK_GROUP_NAME)??((C=Lh(e,Yje.TAGS))==null?void 0:C[0]),g=(typeof l=="string"?[l]:l)??[];g=r.resolveGroupName(g);let O=yR(n),j=e.title,S=e.description,x=E2e(e),A=Lh(e,Yje.EXAMPLES),z=[];e.example!=null&&z.push({name:void 0,value:e.example,description:void 0}),A!=null&&Object.keys(A).length>0&&z.push(...Object.entries(A).map(([U,Y])=>({name:Y.summary??U,value:Y.value,description:Y.description})));let N=tpf({schema:e,description:S,title:j,nameOverride:o,generatedName:O,availability:x});if(N!=null)return N;if(!t&&e.nullable===!0)return q5r(e,!0,r,n,i,a,u,f,d,c);if(e.enum!=null&&(e.type==="string"||e.type==null)){if(!I_i(e.enum))return L9({nameOverride:o,generatedName:O,title:j,primitive:by.string({default:Y7n(e),minLength:e.minLength,maxLength:e.maxLength,pattern:e.pattern,format:e.format,example:FRt({schema:e,logger:r.logger,fallback:c})}),groupName:g,wrapAsNullable:t,description:S,availability:x});let U=epf(e);return e.enum.length===1&&e.enum[0]!=null&&U==null?spf({nameOverride:o,generatedName:O,title:j,wrapAsNullable:t,value:e.enum[0],description:S,availability:x,groupName:g}):C5r({nameOverride:o,generatedName:O,title:j,fernEnum:U,enumVarNames:Lh(e,[Yje.ENUM_VAR_NAMES]),enumValues:e.enum,_default:e.default,description:S,availability:x,wrapAsNullable:t,groupName:g,context:r,source:a})}if(I_i(e.type)&&e.type[1]!=null&&e.type[0]!=null){let U=e.type[0],Y=e.type[1];if(U==="null")return Lp.nullable({nameOverride:o,generatedName:O,title:j,value:q5r({...e,type:Y},t,r,n,i,a,u,f,d,c),groupName:g,description:e.description,availability:x});if(Y==="null")return Lp.nullable({nameOverride:o,generatedName:O,title:j,value:q5r({...e,type:U},t,r,n,i,a,u,f,d,c),groupName:g,description:e.description,availability:x})}if(I_i(e.type)&&e.type.length>1){let U=e.type.includes("null"),Y=e.type.filter(te=>te!=="null").map(te=>({type:te,nullable:U}));return K7n({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,description:S,availability:x,wrapAsNullable:t,context:r,subtypes:Y,groupName:g,encoding:i,source:a,namespace:u})}if(e==="boolean"||e.type==="boolean"){let U=Lh(e,kh.BOOLEAN_LITERAL);return U!=null?vpf({nameOverride:o,generatedName:O,title:j,literal:E7.boolean(U),wrapAsNullable:t,description:S,availability:x,groupName:g}):L9({nameOverride:o,generatedName:O,title:j,primitive:by.boolean({default:e.default,example:_pf({schema:e,logger:r.logger,fallback:c})}),wrapAsNullable:t,description:S,availability:x,groupName:g})}if(e==="number"||e.type==="number")return pfu({nameOverride:o,generatedName:O,title:j,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:Ien(e.exclusiveMinimum),exclusiveMaximum:Ien(e.exclusiveMaximum),multipleOf:e.multipleOf,description:S,availability:x,wrapAsNullable:t,example:oba({schema:e,logger:r.logger,fallback:c}),groupName:g});if(e==="integer"||e.type==="integer")return opf({nameOverride:o,generatedName:O,title:j,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:Ien(e.exclusiveMinimum),exclusiveMaximum:Ien(e.exclusiveMaximum),multipleOf:e.multipleOf,description:S,availability:x,wrapAsNullable:t,example:oba({schema:e,logger:r.logger,fallback:c}),groupName:g});if(e==="float")return pfu({nameOverride:o,generatedName:O,title:j,format:"float",_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:Ien(e.exclusiveMinimum),exclusiveMaximum:Ien(e.exclusiveMaximum),multipleOf:e.multipleOf,description:S,availability:x,wrapAsNullable:t,example:oba({schema:e,logger:r.logger,fallback:c}),groupName:g});if(e==="string"||e.type==="string"){if(e.format==="date-time")return L9({nameOverride:o,generatedName:O,title:j,primitive:by.datetime({example:FRt({schema:e,logger:r.logger,fallback:c})}),wrapAsNullable:t,description:S,availability:x,groupName:g});if(e.format==="json-string")return Lp.unknown({nameOverride:o,generatedName:O,title:j,description:S,availability:x,groupName:g,example:void 0});let U=mpf(e,"const");return U!=null?vpf({nameOverride:o,generatedName:O,title:j,literal:E7.string(U),wrapAsNullable:t,description:S,availability:x,groupName:g}):L9({nameOverride:o,generatedName:O,title:j,primitive:by.string({default:Y7n(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:FRt({schema:e,logger:r.logger,fallback:c})}),groupName:g,wrapAsNullable:t,description:S,availability:x})}if(e.type==="array")return npf({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,item:e.items,description:S,availability:x,wrapAsNullable:t,context:r,groupName:g,example:hpf({schema:e,logger:r.logger,fallback:c}),source:a,namespace:u});if(e.additionalProperties!=null&&e.additionalProperties!==!1&&ypf(e))return rpf({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,additionalProperties:e.additionalProperties,description:S,availability:x,wrapAsNullable:t,context:r,groupName:g,encoding:i,example:e.example,source:a,namespace:u});if(e.type==="object"&&e.discriminator!=null&&e.discriminator.mapping!=null)return r.options.discriminatedUnionV2?yfu({nameOverride:o,generatedName:O,title:j,description:S,availability:x,wrapAsNullable:t,context:r,groupName:g,discriminator:e.discriminator,encoding:i,source:a,namespace:u}):ffu({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,description:S,availability:x,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsNullable:t,context:r,groupName:g,encoding:i,source:a,namespace:u});if(Array.isArray(e.type)&&(e.oneOf==null?e.oneOf=e.type:e.oneOf.push(...e.type)),e.oneOf!=null&&e.oneOf.length>0){let U=Lh(e,kh.IS_UNDISCRIMINATED);if(e.discriminator!=null&&e.discriminator.mapping!=null&&Object.keys(e.discriminator.mapping).length>0)return r.options.discriminatedUnionV2||U?yfu({nameOverride:o,generatedName:O,title:j,description:S,availability:x,wrapAsNullable:t,context:r,groupName:g,discriminator:e.discriminator,encoding:i,source:a,namespace:u}):ffu({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,description:S,availability:x,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsNullable:t,context:r,groupName:g,encoding:i,source:a,namespace:u});if(e.oneOf.length===1&&e.oneOf[0]!=null){let Y=L1(e.oneOf[0],t,r,n,a,u,d);return X7n(Y,S,g)}else if(e.oneOf.length>1){if(e.oneOf.length===2&&e.oneOf[0]!=null&&e.oneOf[1]!=null){let $=e.oneOf[0],ee=e.oneOf[1];if(!gy($)&&$.type==="null")return L1(ee,!0,r,n,a,u);if(!gy(ee)&&ee.type==="null")return L1($,!0,r,n,a,u)}let Y=xv1({schemas:e.oneOf});if(Y!=null)return C5r({nameOverride:o,generatedName:O,title:j,fernEnum:void 0,enumVarNames:void 0,enumValues:Y,_default:e.default,description:S,availability:x,wrapAsNullable:t,groupName:g,context:r,source:a});let te=bpf({schemas:e.oneOf,context:r});if(te!=null&&!r.options.discriminatedUnionV2&&!U)return dfu({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,properties:e.properties??{},required:e.required,description:S,availability:x,wrapAsNullable:t,discriminant:te.discriminant,variants:te.schemas,context:r,groupName:g,encoding:i,source:a,namespace:u});let G=e.oneOf.filter($=>!gy($)&&$.type==="null").length>0;return K7n({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,description:S,availability:x,wrapAsNullable:t||G,context:r,subtypes:e.oneOf.filter($=>gy($)||$.type!=="null"),encoding:i,groupName:g,source:a,namespace:u})}}if(e.anyOf!=null&&e.anyOf.length>0){if(e.anyOf.length===1&&e.anyOf[0]!=null){let te=L1(e.anyOf[0],t,r,n,a,u,d);return X7n(te,S,g)}if(e.anyOf.length===2){let[te,G]=e.anyOf;if(te!=null&&G!=null){if(!gy(te)&&te.type==="null"){let $=L1(G,!0,r,n,a,u);return X7n($,S,g)}else if(!gy(G)&&G.type==="null"){let $=L1(te,!0,r,n,a,u);return X7n($,S,g)}}}let U=bpf({schemas:e.anyOf,context:r});if(U!=null&&!r.options.discriminatedUnionV2)return dfu({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,properties:e.properties??{},required:e.required,description:S,availability:x,wrapAsNullable:t,discriminant:U.discriminant,variants:U.schemas,context:r,groupName:g,encoding:i,source:a,namespace:u});let Y=e.anyOf.filter(te=>!gy(te)&&te.type==="null").length>0;return K7n({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,description:S,availability:x,wrapAsNullable:t||Y,context:r,subtypes:e.anyOf.filter(te=>gy(te)||te.type!=="null"),encoding:i,groupName:g,source:a,namespace:u})}if(e.allOf!=null||e.properties!=null){let U=[];for(let te of e.allOf??[])(gy(te)||Object.keys(te).length>0)&&U.push(te);if((e.properties==null||e.properties.length===0)&&U.length===1&&U[0]!=null){let te=L1(U[0],t,r,n,a,u,d);return X7n(te,S,g)}let Y=U.filter(te=>{let G=uba(te);return G||r.logger.warn(`Skipping non-object allOf element: ${JSON.stringify(te)}`),G});if((e.properties==null||e.properties.length===0)&&Y.length===1&&Y[0]!=null){let te=L1(Y[0],t,r,n,a,u,d);return X7n(te,S,g)}return fpf({nameOverride:o,generatedName:O,title:j,breadcrumbs:n,properties:e.properties??{},description:S,required:e.required,wrapAsNullable:t,allOf:Y,context:r,propertiesToExclude:f,groupName:g,fullExamples:z,additionalProperties:e.additionalProperties,availability:x,encoding:i,source:a,namespace:u})}if(e.type==="object"&&Ev1(e)&&Mv1(e)&&ypf(e))return rba({nameOverride:o,generatedName:O,title:j,description:S,availability:x,wrapAsNullable:t,keySchema:{nameOverride:void 0,generatedName:`${O}Key`,title:void 0,description:void 0,availability:void 0,schema:by.string({default:Y7n(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:FRt({schema:e,logger:r.logger,fallback:c})}),groupName:g},valueSchema:Lp.unknown({nameOverride:void 0,generatedName:`${O}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,groupName:g}),groupName:g,encoding:i,example:e.example});if(e.type==null){let U=e.example??e.default;return Lp.unknown({nameOverride:o,generatedName:O,title:j,description:S,availability:x,groupName:g,example:U})}throw new Error(`Failed to convert schema breadcrumbs=${JSON.stringify(n)} value=${JSON.stringify(e)}`)}function A5r(e){if(!!e.$ref.startsWith(Ren))return e.$ref.replace(Ren,"")}function hfu(e,t,r){let n=Lh(e,kh.TYPE_NAME),i=yR(t),a=e.description,u=E2e(e),f=A5r(e);if(f==null)throw new Error(`Invalid schema reference ${JSON.stringify(e)}`);return ib.reference({generatedName:i,nameOverride:n,title:void 0,schema:f,description:a??void 0,availability:u,groupName:void 0,source:r})}function Ev1(e){return e.oneOf==null||e.oneOf.length===0}function Mv1(e){return e.allOf==null||e.allOf.length===0}function ypf(e){return e.properties==null||Object.keys(e.properties).length===0}function I_i(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function X7n(e,t,r){return e.type==="reference"?Lp.reference({...e,description:t,availability:e.availability,groupName:r}):e.type==="optional"?Lp.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,groupName:r}):e.type==="nullable"?Lp.nullable({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,groupName:r}):e}function uba(e){return gy(e)||e.type==="object"||e.properties!=null?!0:e.allOf!=null?e.allOf.every(t=>uba(t)):e.oneOf!=null?e.oneOf.every(t=>uba(t)):e.anyOf!=null?e.anyOf.every(t=>uba(t)):!1}function vpf({literal:e,wrapAsNullable:t,groupName:r,description:n,availability:i,nameOverride:a,generatedName:u,title:f}){return t?Lp.nullable({nameOverride:a,generatedName:u,title:f,value:Lp.literal({nameOverride:a,generatedName:u,title:f,value:e,description:n,availability:i,groupName:r}),groupName:r,description:n,availability:i}):Lp.literal({nameOverride:a,generatedName:u,title:f,value:e,groupName:r,description:n,availability:i})}function L9({primitive:e,wrapAsNullable:t,groupName:r,description:n,availability:i,generatedName:a,nameOverride:u,title:f}){return r=typeof r=="string"?[r]:r,t?Lp.nullable({nameOverride:u,generatedName:a,title:f,value:Lp.primitive({nameOverride:u,generatedName:a,title:f,schema:e,description:n,availability:i,groupName:r}),groupName:r,description:n,availability:i}):Lp.primitive({nameOverride:u,generatedName:a,title:f,schema:e,description:n,availability:i,groupName:r})}function xv1({schemas:e}){let t=new Set;for(let r of e){if(gy(r))return;if(r.enum!=null&&I_i(r.enum))r.enum.forEach(n=>t.add(n));else return}return Array.from(t)}function bpf({schemas:e,context:t}){let r={};for(let n of e){let i=gpf({schema:n,context:t});for(let[a,u]of Object.entries(i)){let f=r[a];f!=null?f[u]=n:r[a]={[u]:n}}}for(let[n,i]of Object.entries(r))if(Object.keys(i).length===e.length)return{discriminant:n,schemas:i}}function gpf({schema:e,context:t}){let r=gy(e)?t.resolveSchemaReference(e):e;return Tv1({schema:r,context:t})}function Tv1({schema:e,context:t}){let r={};if(e.anyOf!=null){for(let n of e.anyOf){let i=gpf({schema:n,context:t});for(let[a,u]of Object.entries(i??{}))r[a]=u}return r}for(let[n,i]of Object.entries(e.properties??{})){let a=gy(i)?t.resolveSchemaReference(i):i;a.type==="string"&&a.enum!=null&&I_i(a.enum)&&qv1(a.enum).length===1&&a.enum[0]!=null&&(r[n]=a.enum[0]);let u=mpf(a,"const");a.type==="string"&&u!=null&&(r[n]=u),n==="type"&&a.example!=null&&(r[n]=a.example)}return r}function qv1(e){if(!e)return[];let t=new Set;return e.forEach(r=>{typeof r=="string"?t.add(r.toLowerCase()):t.add(r)}),Array.from(t)}function mpf(e,t){let r=e[t];if(r!=null)return r}function Cv1({schema:e,logger:t}){let r=kdf({schema:e,logger:t});if(r!=null)return apf(r)}function sba(e,t){let r={},n={};return e==null?r=t:n={[e]:t},{rootSchemas:r,namespacedSchemas:n}}var Opf="#/components/messages/",vfu=class{logger;document;taskContext;DUMMY;options;namespace;constructor({document:t,taskContext:r,options:n,namespace:i}){this.document=t,this.taskContext=r,this.logger=r.logger,this.DUMMY=this,this.options=n,this.namespace=i}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveTags(t,r){if(this.namespace==null&&t==null&&r!=null)return[r];let n=[];if(this.namespace!=null){let i={type:"namespace",name:this.namespace};n.push(i)}return n.concat(t??[])}resolveSchemaReference(t){var a;if(this.document.components==null||this.document.components.schemas==null||!t.$ref.startsWith(Ren))throw new Error(`Failed to resolve ${t.$ref}`);let n=t.$ref.substring(Ren.length).split("/");if(n[0]==null)throw new Error(`${t.$ref} is undefined`);let i=this.document.components.schemas[n[0]];if(i==null)throw new Error(`${n[0]} is undefined`);if(gy(i)&&(i=this.resolveSchemaReference(i)),n[1]==="properties"&&n[2]!=null){let u=(a=i.properties)==null?void 0:a[n[2]];if(u==null)throw new Error(`${t.$ref} is undefiened. Property does not exist on object.`);gy(u)?i=this.resolveSchemaReference(u):i=u}return i}resolveMessageReference(t){if(this.document.components==null||this.document.components.messages==null||!t.$ref.startsWith(Opf))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(Opf.length),n=this.document.components.messages[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return n}referenceExists(t){let r=t.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return!1;n=n[i]}return!0}},cba=class extends vfu{constructor({document:t,taskContext:r,options:n,namespace:i}){super({document:t,taskContext:r,options:n,namespace:i})}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}markReferencedByDiscriminatedUnion(t,r,n){}markSchemaWithDiscriminantValue(t,r,n){}};function N5r(e){if(typeof e=="string")return RP.primitive(t0.string(e));if(typeof e=="number")return Number.isInteger(e)?RP.primitive(t0.int(e)):RP.primitive(t0.double(e));if(typeof e=="boolean")return RP.primitive(t0.boolean(e));if(Array.isArray(e)){let t=e.map(r=>N5r(r));return t.length===0?void 0:RP.array(t.filter(r=>r!=null))}else if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string")){let t=[];for(let[r,n]of Object.entries(e)){let i=N5r(n);i!=null&&t.push({key:t0.string(r),value:i})}return RP.map(t)}}function R_i(e){if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string"))return e}function Ppf(e){if(e!=null&&Array.isArray(e))return e}var Q7n=class{schemas;constructor(t){this.schemas=t}buildExample({schema:t,exampleId:r,example:n,options:i}){return this.buildExampleHelper({schema:t,visitedSchemaIds:new Set,exampleId:r,example:n,options:{...i,maxCheckerDepth:i.maxCheckerDepth??5},depth:0})}buildExampleHelper({exampleId:t,example:r,schema:n,depth:i,visitedSchemaIds:a,options:u}){var f,d,c,o;switch(n.type){case"enum":return typeof r=="string"&&jpf({schema:n,value:r})?RP.enum(r):n.values[0]!=null?RP.enum((f=n.values[0])==null?void 0:f.value):void 0;case"literal":return RP.literal(n.value);case"nullable":{if(r==null&&!this.hasExample(n.value,0,a,u)&&(u.ignoreOptionals||this.exceedsMaxDepth(i,u)))return;let l=this.buildExampleHelper({schema:n.value,visitedSchemaIds:a,exampleId:t,example:r,depth:i,options:u});return l!=null&&l.type==="array"&&l.value.length===0||l!=null&&l.type==="map"&&l.value.length===0||l!=null&&l.type==="object"&&Object.keys(l.properties).length===0?void 0:l}case"optional":{if(r==null&&!this.hasExample(n.value,0,a,u)&&(u.ignoreOptionals||this.exceedsMaxDepth(i,u)))return;let l=this.buildExampleHelper({schema:n.value,visitedSchemaIds:a,exampleId:t,example:r,depth:i,options:u});return l!=null&&l.type==="array"&&l.value.length===0||l!=null&&l.type==="map"&&l.value.length===0||l!=null&&l.type==="object"&&Object.keys(l.properties).length===0?void 0:l}case"primitive":{let l=this.buildExampleFromPrimitive({schema:n.schema,example:r,options:u});return RP.primitive(l)}case"reference":{let l=this.schemas[n.schema];if(l!=null&&!a.has(n.schema)){a.add(n.schema);let g=this.buildExampleHelper({example:r,schema:l,exampleId:t,visitedSchemaIds:a,depth:i,options:u});return a.delete(n.schema),g}return}case"oneOf":switch(n.value.type){case"discriminated":{let l={},g={},O={},j=R_i(r),S=j==null?void 0:j[n.value.discriminantProperty],x=n.value.schemas[S],A=[],z=this.getDiscriminatedUnionVariantSchema(n.value,j);z!=null&&A.push(z),A.push(...Object.entries(n.value.schemas));for(let N of A)if(S!=null&&x!=null&&x.type==="object"){g=this.getAllProperties(x),O=this.getAllRequiredProperties(x),l[n.value.discriminantProperty]=RP.primitive(t0.string(S));break}else{let C=this.getObjectSchema(N[1]);if(C==null)continue;g=this.getAllProperties(C),O=this.getAllRequiredProperties(C),l[n.value.discriminantProperty]=RP.primitive(t0.string(N[0]))}for(let N of n.value.commonProperties){g[N.key]=N.schema;let C=this.getResolvedSchema(N.schema);C.type!=="optional"&&C.type!=="nullable"&&(O[N.key]=N.schema)}for(let[N,C]of Object.entries(g)){let U=N in O;if(U&&(j==null?void 0:j[N])!=null){let Y=this.buildExampleHelper({schema:C,exampleId:t,example:j[N],visitedSchemaIds:a,depth:i+1,options:u});if(Y!=null)l[N]=Y;else return}else{let Y=this.buildExampleHelper({exampleId:t,schema:C,example:j==null?void 0:j[N],visitedSchemaIds:a,depth:i+1,options:u});if(Y!=null)l[N]=Y;else if(U)return}}return RP.oneOf(v5r.discriminated(l))}case"undisciminated":{let l=this.getUnDiscriminatedUnionVariantSchema(n.value,r);if(l!=null)return this.buildExampleHelper({exampleId:t,example:r,schema:l,visitedSchemaIds:a,depth:i,options:u});break}}return;case"unknown":if(r!=null){let l=N5r(r);if(l!=null)return RP.unknown(l)}return u.ignoreOptionals||this.exceedsMaxDepth(i,u)?void 0:u.isParameter?RP.primitive(t0.string(u.name??"string")):RP.map([{key:t0.string("key"),value:RP.primitive(t0.string("value"))}]);case"array":{let l=Ppf(r),g=[];if(l!=null&&l.length>0)for(let O of l){let j=this.buildExampleHelper({exampleId:t,example:O,schema:n.value,depth:i+1,visitedSchemaIds:a,options:u});j!=null&&g.push(j)}else if(n.example!=null&&n.example.length>0)for(let O of n.example){let j=this.buildExampleHelper({exampleId:t,example:O,schema:n.value,depth:i+1,visitedSchemaIds:a,options:u});j!=null&&g.push(j)}else{let O=this.buildExampleHelper({exampleId:t,example:void 0,schema:n.value,depth:i+1,visitedSchemaIds:a,options:u});O!=null&&g.push(O)}return RP.array(g)}case"map":{let l=R_i(r??n.example);if(l!=null&&Object.entries(l).length>0){let j=[];for(let[S,x]of Object.entries(l)){let A=this.buildExampleFromPrimitive({schema:n.key.schema,example:S,options:u}),z=this.buildExampleHelper({exampleId:t,example:x,schema:n.value,visitedSchemaIds:a,depth:i+1,options:u});z!=null&&j.push({key:A,value:z})}return RP.map(j)}if(n.key.schema.type==="string"&&n.value.type==="unknown")return RP.map([{key:t0.string("key"),value:RP.unknown(RP.primitive(t0.string("value")))}]);let g=this.buildExampleFromPrimitive({schema:n.key.schema,example:void 0,options:{...u,name:"key"}}),O=this.buildExampleHelper({exampleId:t,example:void 0,schema:n.value,visitedSchemaIds:a,depth:i+1,options:{...u,name:"value"}});return O!=null?RP.map([{key:g,value:O}]):RP.map([])}case"object":{let l={},g=((d=n.fullExamples)==null?void 0:d.find(x=>x.name===t))??((c=n.fullExamples)==null?void 0:c.find(x=>x.name==null))??((o=n.fullExamples)==null?void 0:o[0]),O=R_i(r)??(g!=null?R_i(g.value):{})??{},j=this.getAllProperties(n),S=this.getAllRequiredProperties(n);for(let[x,A]of Object.entries(j)){let z=x in S,N=Object.keys(O).includes(x),C=this.buildExampleHelper({schema:A,exampleId:t,example:O[x],visitedSchemaIds:a,depth:i+1,options:{...u,name:x}});if(z&&C!=null)l[x]=C;else{if(z)return;(N&&C!=null||!u.ignoreOptionals&&C!=null)&&(l[x]=C)}}return RP.object({properties:l})}default:Ol(n)}}getObjectSchema(t){if(t.type==="object")return t;if(t.type==="reference"){let r=this.schemas[t.schema];if(r!=null)return this.getObjectSchema(r)}}getDiscriminatedUnionVariantSchema(t,r){let n=r==null?void 0:r[t.discriminantProperty];if(n==null||typeof n!="string")return Object.entries(t.schemas)[0];let i=t.schemas[n];return i==null?Object.entries(t.schemas)[0]:[n,i]}getUnDiscriminatedUnionVariantSchema(t,r){var a;return r==null?t.schemas[0]:(a=t.schemas.map(u=>({schema:u,heuristic:this.calcExampleHeuristic(u,r)})).sort((u,f)=>f.heuristic-u.heuristic)[0])==null?void 0:a.schema}calcExampleHeuristic(t,r){switch(t.type){case"literal":return t.value.value===r?5:0;case"enum":return jpf({schema:t,value:r})?5:0;case"object":{if(!RO(r))return 0;let n=this.getAllProperties(t),i=0;for(let[a,u]of Object.entries(n))r[a]!=null?(i++,i+=this.calcExampleHeuristic(u,r[a])):i--;return i}case"array":{if(!Array.isArray(r))return 0;let n=0;for(let i of r)n+=this.calcExampleHeuristic(t.value,i);return n}case"map":{if(!RO(r))return 0;let n=0;for(let[,i]of Object.entries(r))n+=this.calcExampleHeuristic(t.value,i);return n}case"nullable":case"optional":return this.calcExampleHeuristic(t.value,r);case"reference":{let n=this.getResolvedSchema(t);return n==null?0:this.calcExampleHeuristic(n,r)}case"oneOf":return Object.values(t.value.schemas).map(i=>this.calcExampleHeuristic(i,r)).sort((i,a)=>a-i)[0]??0;case"primitive":return r==null?0:t.schema._visit({int:()=>typeof r=="number",int64:()=>typeof r=="number",uint:()=>typeof r=="number",uint64:()=>typeof r=="number",float:()=>typeof r=="number",double:()=>typeof r=="number",string:()=>typeof r=="string",datetime:()=>typeof r=="string",date:()=>typeof r=="string",base64:()=>typeof r=="string",boolean:()=>typeof r=="boolean",_other:()=>!0})?1:-1;default:return 0}}hasExample(t,r,n=new Set,i){if(this.exceedsMaxCheckerDepth(r,i))return!1;switch(t.type){case"array":return this.hasExample(t.value,r+1,n,i);case"enum":return t.example!=null;case"literal":return!1;case"map":return t.example!=null||t.key.schema.example!=null&&this.hasExample(t.value,r+1,n,i);case"object":{if(t.fullExamples!=null&&t.fullExamples.length>0)return!0;for(let u of t.properties)if(this.hasExample(u.schema,r+1,n,i))return!0;return!1}case"primitive":return t.schema.example!=null;case"reference":{let a=this.schemas[t.schema];if(a!=null&&!n.has(t.schema)){n.add(t.schema);let u=this.hasExample(a,r,n,i);return n.delete(t.schema),u}return!1}case"unknown":return t.example!=null;case"oneOf":return Object.values(t.value.schemas).some(a=>this.hasExample(a,r,n,i));default:return!1}}exceedsMaxCheckerDepth(t,r){return t>(r.maxCheckerDepth??0)}exceedsMaxDepth(t,r){return t>(r.maxDepth??0)}getAllProperties(t){let r={};for(let n of t.properties)r[n.key]=n.schema;for(let n of t.allOf){let i=this.schemas[n.schema];if(i==null)continue;let a=this.getResolvedSchema(i);a.type==="object"&&(r={...this.getAllProperties(a),...r})}return r}getAllRequiredProperties(t){let r={};for(let n of t.properties){let i=this.getResolvedSchema(n.schema);i.type!=="optional"&&i.type!=="nullable"&&(r[n.key]=n.schema)}for(let n of t.allOf){let i=this.schemas[n.schema];if(i==null)continue;let a=this.getResolvedSchema(i);a.type==="object"&&(r={...this.getAllRequiredProperties(a),...r})}return r}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}buildExampleFromPrimitive({example:t,schema:r,options:n}){switch(r.type){case"string":return t!=null&&typeof t=="string"?t0.string(t):r.example!=null?t0.string(r.example):t0.string(n.name??DC.STRING);case"base64":return t!=null&&typeof t=="string"?t0.base64(t):r.example!=null?t0.base64(r.example):t0.base64(DC.BASE64);case"boolean":return t!=null&&typeof t=="boolean"?t0.boolean(t):r.example!=null?t0.boolean(r.example):t0.boolean(DC.BOOLEAN);case"date":return t!=null&&typeof t=="string"?t0.date(t):r.example!=null?t0.date(r.example):t0.date(DC.DATE);case"datetime":return t!=null&&typeof t=="string"?t0.datetime(t):r.example!=null?t0.datetime(r.example):t0.datetime(DC.DATE_TIME);case"double":return t!=null&&typeof t=="number"?t0.double(t):r.example!=null?t0.double(r.example):t0.double(DC.DOUBLE);case"float":return t!=null&&typeof t=="number"?t0.float(t):r.example!=null?t0.float(r.example):t0.float(DC.FLOAT);case"int":return t!=null&&typeof t=="number"?t0.int(t):r.example!=null?t0.int(r.example):t0.int(DC.INT);case"int64":return t!=null&&typeof t=="number"?t0.int64(t):r.example!=null?t0.int64(r.example):t0.int64(DC.INT64);case"uint":return t!=null&&typeof t=="number"?t0.uint(t):r.example!=null?t0.uint(r.example):t0.uint(DC.UINT);case"uint64":return t!=null&&typeof t=="number"?t0.uint64(t):r.example!=null?t0.uint64(r.example):t0.uint64(DC.UINT64);default:Ol(r)}}};function jpf({schema:e,value:t}){return e.values.map(r=>r.value).includes(t)}function LRt(e){switch(e.type){case"object":return Lp.object({allOf:e.allOf,properties:e.properties.map(t=>Nv1(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,groupName:e.groupName,fullExamples:void 0,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source});case"array":return Lp.array({description:e.description,availability:e.availability,value:LRt(e.value),generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,groupName:e.groupName,example:void 0});case"enum":return Lp.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,values:e.values,default:e.default,groupName:e.groupName,example:void 0,source:e.source});case"literal":return Lp.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,groupName:e.groupName});case"nullable":return Lp.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:LRt(e.value),groupName:e.groupName});case"optional":return Lp.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:LRt(e.value),groupName:e.groupName});case"primitive":return Lp.primitive({description:e.description,availability:e.availability,schema:wpf(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,groupName:e.groupName});case"map":return Lp.map({description:e.description,availability:e.availability,key:Lp.primitive({description:e.key.description,availability:e.key.availability,schema:wpf(e.key.schema),generatedName:e.key.generatedName,nameOverride:e.key.nameOverride,title:e.key.title,groupName:e.groupName}),value:LRt(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,groupName:e.groupName,encoding:e.encoding,example:void 0});case"reference":return Lp.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schema:e.schema,groupName:e.groupName,source:e.source});case"oneOf":return Lp.oneOf(Av1(e.value));case"unknown":return Lp.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName,title:void 0,example:void 0,groupName:void 0,description:void 0,availability:void 0});default:Ol(e)}}function Av1(e){switch(e.type){case"discriminated":return PQ.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:LRt(t.schema)})),description:e.description,availability:e.availability,discriminantProperty:e.discriminantProperty,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:Object.fromEntries(Object.entries(e.schemas).map(([t,r])=>[t,LRt(r)])),groupName:e.groupName,encoding:e.encoding,source:e.source});case"undisciminated":return PQ.undisciminated({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:e.schemas.map(t=>LRt(t)),groupName:e.groupName,encoding:e.encoding,source:e.source});default:Ol(e)}}function wpf(e){switch(e.type){case"string":return by.string({default:e.default,pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:void 0});case"base64":return by.base64({example:void 0});case"boolean":return by.boolean({default:e.default,example:void 0});case"date":return by.date({example:void 0});case"datetime":return by.datetime({example:void 0});case"double":return by.double({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"float":return by.float({example:void 0});case"int":return by.int({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"int64":return by.int64({default:e.default,example:void 0});case"uint":return by.uint({default:void 0,example:void 0});case"uint64":return by.uint64({default:void 0,example:void 0});default:Ol(e)}}function Nv1(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:LRt(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability}}function lba(e){return e.type!=="optional"&&e.type!=="nullable"}function F_i(e){if(e.type==="full")return e.request==null&&e.response==null&&e.queryParameters==null&&e.pathParameters==null&&e.headers==null;{let t=e.value;return t.request==null&&t.response==null&&t["query-parameters"]==null&&t["path-parameters"]==null&&t.headers==null}}var fba=class{exampleTypeFactory;logger;schemas;constructor(t,r){this.schemas=t,this.exampleTypeFactory=new Q7n(t),this.logger=r}buildEndpointExample(t){this.logger.debug(`Building endpoint example for ${t.method.toUpperCase()} ${t.path}`);let r=Bv1(t.request),n=Iv1(t.response);if((r==null?void 0:r.type)==="unsupported"||(n==null?void 0:n.type)==="unsupported")return[];let i=[];if(r!=null&&r.type==="present"){let l=this.isSchemaRequired(r.schema);if(r.examples.length===0){let g=this.exampleTypeFactory.buildExample({schema:r.schema,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});g!=null&&i.push([void 0,g])}else for(let{name:g,value:O}of r.examples){let j=this.exampleTypeFactory.buildExample({schema:r.schema,exampleId:g,example:O,options:{isParameter:!1,ignoreOptionals:!0}});j!=null&&i.push([g,j])}if(l&&i.length===0)return this.logger.warn(`Failed to generate required request example for ${t.method.toUpperCase()} ${t.path}`),[]}let a=[];if(n!=null&&n.type==="present"){let l=this.isSchemaRequired(n.schema);if(n.examples.length===0){let g=this.exampleTypeFactory.buildExample({schema:n.schema,exampleId:void 0,example:void 0,options:{maxDepth:3,isParameter:!1,ignoreOptionals:!1}});g!=null&&a.push([void 0,g])}else for(let{name:g,value:O}of n.examples){let j=this.exampleTypeFactory.buildExample({schema:n.schema,exampleId:g,example:O,options:{maxDepth:3,isParameter:!1,ignoreOptionals:!1}});j!=null&&a.push([g,j])}if(l&&a.length===0)return this.logger.warn(`Failed to generate required response example for ${t.method.toUpperCase()} ${t.path}`),[]}let u=[];for(let l of t.pathParameters){let g=this.isSchemaRequired(l.schema),O=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(O!=null&&!URt(O)&&(this.logger.warn(`Expected a primitive example but got ${O.type} for path parameter ${l.name} for ${t.method.toUpperCase()} ${t.path}`),O=void 0),g&&O==null)return[];O!=null&&u.push({name:l.name,parameterNameOverride:l.parameterNameOverride,value:O})}let f=[];for(let l of t.queryParameters){let g=this.isSchemaRequired(l.schema),O=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(O!=null&&!URt(O)&&(this.logger.warn(`Expected a primitive example but got ${O.type} for query parameter ${l.name} for ${t.method.toUpperCase()} ${t.path}`),O=void 0),g&&O==null)return[];O!=null&&f.push({name:l.name,value:O})}let d=[];for(let l of t.headers){let g=this.isSchemaRequired(l.schema),O=this.exampleTypeFactory.buildExample({schema:l.schema,exampleId:void 0,example:void 0,options:{name:l.name,isParameter:!0,ignoreOptionals:!0}});if(O!=null&&!URt(O)&&(this.logger.warn(`Expected a primitive example but got ${O.type} for header ${l.name} for ${t.method.toUpperCase()} ${t.path}`),O=void 0),g&&O==null)return[];O!=null&&d.push({name:l.name,value:O})}let c=[];t.request!=null&&t.response!=null?c=zv1(i,a):t.request!=null?c=i.map(([l,g])=>({id:l,request:g,response:void 0})):t.response!=null&&(c=a.map(([l,g])=>({id:l,request:void 0,response:g})));let o=t.examples.filter(l=>F_i(l)).flatMap(l=>{if(l.type==="unknown"){if(l.value!=null){let g=l.value["code-samples"];if(g!=null)return this.convertCodeSamples(g)}return}else return l.codeSamples}).filter(l=>RS(l));return c.length===0?[dAt.full({name:void 0,description:void 0,pathParameters:u,queryParameters:f,headers:d,request:void 0,response:void 0,codeSamples:o})]:c.map(({id:l,request:g,response:O})=>dAt.full({name:l,description:void 0,pathParameters:u,queryParameters:f,headers:d,request:g,response:O,codeSamples:o}))}convertCodeSamples(t){return t.map(r=>"language"in r?$Sr.language({name:r.name??void 0,description:r.docs??void 0,language:r.language,code:r.code,install:r.install??void 0}):$Sr.sdk({name:r.name??void 0,description:r.docs??void 0,sdk:r.sdk==="c#"?bW.Csharp:r.sdk,code:r.code})).filter(RS)}isSchemaRequired(t){return lba(this.getResolvedSchema(t))}getResolvedSchema(t){return t}};function zv1(e,t){var i,a,u,f;let r=[];if(e.length<=1){let[d,c]=e[0]??[];if(t.length===0)return r.push({id:d,request:c,response:void 0}),r;for(let[o,l]of t)r.push({id:o??d,request:c,response:l});return r}if(t.length<=1){let[d,c]=t[0]??[];if(t.length===0)return r.push({id:d,request:void 0,response:c}),r;for(let[o,l]of e)r.push({id:o??d,request:l,response:c});return r}let n=new Set;for(let[d,c]of e){let o=((i=t.find(([g])=>g==null))==null?void 0:i[1])??((a=t[0])==null?void 0:a[1]);if(d==null){if(o==null)continue;r.push({id:void 0,request:c,response:o});continue}let l=!1;for(let g=0;g<t.length;g++){let[O,j]=t[g];O!=null||n.has(g)||d===O&&(r.push({id:d,request:c,response:j}),O!=null&&n.add(g),l=!0)}!l&&o!=null&&r.push({id:d,request:c,response:o})}for(let d=0;d<t.length;d++){if(n.has(d))continue;let[c,o]=t[d],l=((u=e.find(([g])=>g==null))==null?void 0:u[1])??((f=e[0])==null?void 0:f[1]);l!=null&&r.push({id:c,request:l,response:o})}return r}function Bv1(e){if(e!=null)return e.type==="multipart"?{type:"present",schema:Rv1(e),examples:[]}:e.type==="json"?{type:"present",schema:e.schema,examples:e.fullExamples??[]}:{type:"unsupported"}}function Iv1(e){if(e!=null)return e.type!=="json"?{type:"unsupported"}:{type:"present",schema:e.schema,examples:e.fullExamples??[]}}function URt(e){switch(e.type){case"primitive":case"enum":case"literal":return!0;case"unknown":return URt(e);case"array":case"object":case"map":return!1;case"oneOf":switch(e.value.type){case"discriminated":return!1;case"undisciminated":return URt(e.value.value);default:return!1}default:Ol(e)}}function Rv1(e){return Lp.object({properties:e.properties.map(t=>t.schema.type==="file"?null:{key:t.key,schema:LRt(t.schema.value),audiences:[],conflict:{},generatedName:t.key,nameOverride:void 0,availability:void 0}).filter(RS),allOf:[],allOfPropertyConflicts:[],fullExamples:void 0,description:e.description,nameOverride:void 0,generatedName:"",title:void 0,groupName:void 0,additionalProperties:!1,availability:void 0,source:e.source})}var dba=class{exampleTypeFactory;schemas;constructor(t,r){this.exampleTypeFactory=new Q7n(t),this.schemas=t}buildWebsocketSessionExamplesForExtension({context:t,extensionExamples:r,publish:n,subscribe:i,handshake:a,source:u,namespace:f}){var c,o;let d=[];for(let l of r){let g=[];for(let S of a.queryParameters){let x=this.isSchemaRequired(S.schema),A=this.exampleTypeFactory.buildExample({schema:S.schema,exampleId:void 0,example:(c=l.queryParameters)==null?void 0:c[S.name],options:{name:S.name,isParameter:!0,ignoreOptionals:!0}});A!=null&&!URt(A)&&(A=void 0),!(x&&A==null)&&A!=null&&g.push({name:S.name,value:A})}let O=[];for(let S of a.headers){let x=this.isSchemaRequired(S.schema),A=this.exampleTypeFactory.buildExample({schema:S.schema,exampleId:void 0,example:(o=l.headers)==null?void 0:o[S.name],options:{name:S.name,isParameter:!0,ignoreOptionals:!0}});A!=null&&!URt(A)&&(A=void 0),!(x&&A==null)&&A!=null&&O.push({name:S.name,value:A})}let j=[];for(let S of l.messages){let x=t.resolveMessageReference({$ref:`#/components/messages/${S.messageId}`}),A=gy(x.payload)?t.resolveSchemaReference(x.payload):x.payload,z=this.exampleTypeFactory.buildExample({schema:L1(A,!1,t,[S.messageId],u,f),exampleId:void 0,example:S.value,options:{isParameter:!1,ignoreOptionals:!0}});z!=null&&j.push({messageType:S.type,payload:z,description:void 0})}d.push({name:l.summary,queryParameters:g,headers:O,description:l.description,messages:j})}return d}buildWebsocketSessionExample({publish:t,subscribe:r,handshake:n}){let i={name:void 0,queryParameters:[],headers:[],description:void 0,messages:[]},a=[];for(let f of n.queryParameters){let d=this.isSchemaRequired(f.schema),c=this.exampleTypeFactory.buildExample({schema:f.schema,exampleId:void 0,example:void 0,options:{name:f.name,isParameter:!0,ignoreOptionals:!0}});if(c!=null&&!URt(c)&&(c=void 0),d&&c==null)return;c!=null&&a.push({name:f.name,value:c})}let u=[];for(let f of n.headers){let d=this.isSchemaRequired(f.schema),c=this.exampleTypeFactory.buildExample({schema:f.schema,exampleId:void 0,example:void 0,options:{name:f.name,isParameter:!0,ignoreOptionals:!0}});if(c!=null&&!URt(c)&&(c=void 0),d&&c==null)return;c!=null&&u.push({name:f.name,value:c})}if(t!=null){let f=this.exampleTypeFactory.buildExample({schema:t,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});f!=null&&i.messages.push({messageType:"publish",payload:f,description:void 0})}if(r!=null){let f=this.exampleTypeFactory.buildExample({schema:r,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});f!=null&&i.messages.push({messageType:"subscribe",payload:f,description:void 0})}return i}isSchemaRequired(t){return lba(this.getResolvedSchema(t))}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}};var L_i={FERN_DISPLAY_NAME:"x-fern-display-name",FERN_EXAMPLES:"x-fern-examples",BASE_PATH:"x-fern-base-path"};function Dpf(e){return Lh(e,L_i.FERN_EXAMPLES)??[]}function Epf({document:e,taskContext:t,options:r,source:n,asyncApiOptions:i,namespace:a}){var l,g,O,j,S,x;let u=[];a!=null&&u.push(a),((l=e.tags)==null?void 0:l[0])!=null?u.push(e.tags[0].name):i.naming!=="v2"&&u.push("websocket");let f=new cba({document:e,taskContext:t,options:r,namespace:a}),d={},c;for(let[A,z]of Object.entries(((g=e.components)==null?void 0:g.schemas)??{})){let N=L1(z,!1,f,[A],n,a);d[A]=N}let o=new dba(d,t.logger);for(let[A,z]of Object.entries(e.channels??{})){if(((O=z.bindings)==null?void 0:O.ws)==null){f.logger.error(`Channel ${A} does not have websocket bindings. Skipping.`);continue}let N=[];if(z.parameters!=null)for(let[G,$]of Object.entries(z.parameters??{}))N.push({name:G,description:$.description,parameterNameOverride:void 0,schema:$.schema!=null?L1($.schema,!1,f,u,n,a):Lp.primitive({schema:by.string({default:void 0,pattern:void 0,format:void 0,maxLength:void 0,minLength:void 0,example:void 0}),description:void 0,availability:void 0,generatedName:"",title:void 0,groupName:void 0,nameOverride:void 0}),variableReference:void 0,availability:E2e($),source:n});let C=[];if(z.bindings.ws.headers!=null){let G=z.bindings.ws.headers.required??[];for(let[$,ee]of Object.entries(z.bindings.ws.headers.properties??{})){let Ve=gy(ee)?f.resolveSchemaReference(ee):ee;C.push({name:$,schema:L1(Ve,!G.includes($),f,u,n,a),description:Ve.description,parameterNameOverride:void 0,env:void 0,availability:E2e(Ve),source:n})}}let U=[];if(z.bindings.ws.query!=null){let G=z.bindings.ws.query.required??[];for(let[$,ee]of Object.entries(z.bindings.ws.query.properties??{})){let Ve=gy(ee)?f.resolveSchemaReference(ee):ee;U.push({name:$,schema:L1(Ve,!G.includes($),f,u,n,a),description:Ve.description,parameterNameOverride:void 0,availability:E2e(Ve),source:n})}}let Y;z.publish!=null&&(Y=Spf({generatedName:z.publish.operationId??"PublishEvent",event:z.publish,breadcrumbs:u,context:f,source:n,options:r,asyncApiOptions:i}));let te;if(z.subscribe!=null&&(te=Spf({generatedName:z.subscribe.operationId??"SubscribeEvent",event:z.subscribe,breadcrumbs:u,context:f,source:n,options:r,asyncApiOptions:i})),C.length>0||U.length>0||Y!=null||te!=null){let G=Dpf(z),$=[];if(G.length>0)$=o.buildWebsocketSessionExamplesForExtension({context:f,extensionExamples:G,handshake:{headers:C,queryParameters:U},publish:Y,subscribe:te,source:n,namespace:a});else{let Ve=o.buildWebsocketSessionExample({handshake:{headers:C,queryParameters:U},publish:Y,subscribe:te});Ve!=null&&$.push(Ve)}let ee=((S=(j=e.tags)==null?void 0:j[0])==null?void 0:S.name)!=null?[(x=e.tags)==null?void 0:x[0].name]:void 0;c={handshake:{headers:C.map(Ve=>({...Ve,schema:oq(Ve.schema),env:Ve.env})),queryParameters:U.map(Ve=>({...Ve,schema:oq(Ve.schema)})),pathParameters:N.map(Ve=>({...Ve,parameterNameOverride:void 0,schema:oq(Ve.schema)}))},groupName:f.resolveTags(ee,"Websocket"),publish:Y!=null?oq(Y):Y,subscribe:te!=null?oq(te):te,summary:Lh(z,L_i.FERN_DISPLAY_NAME),path:A,description:void 0,examples:$,source:n};break}}return{groupedSchemas:sba(a,d),channel:c,basePath:Lh(e,L_i.BASE_PATH)}}function Spf({generatedName:e,event:t,context:r,breadcrumbs:n,source:i,options:a,asyncApiOptions:u}){if(t.message.oneOf!=null){let f=[],d=[];for(let c of t.message.oneOf){let o,l={type:"notFound"};if(gy(c)){let g=r.resolveMessageReference(c);!gy(g.payload)&&u.naming==="v2"?(l=g.name?{type:"name",name:g.name}:l,o={...g.payload,title:g.name??g.payload.title,description:g.name??g.payload.description}):o=g.payload}else o=c;d.push(l),f.push(o)}return K7n({description:t.description??t.message.description,availability:E2e(t.message),subtypes:f,nameOverride:t.operationId,generatedName:e,title:t.message.title,groupName:void 0,wrapAsNullable:!1,breadcrumbs:n,context:r,encoding:void 0,source:i,namespace:r.namespace,subtypePrefixOverrides:u.naming==="v2"?d:[]})}}var NEf=yu(Fbf(),1);var Itn=yu(qEf(),1);var CEf=require("fs/promises");async function jPa({absoluteFilepathToOverrides:e,data:t,context:r}){let n=null;try{let u=(await(0,CEf.readFile)(e,"utf8")).toString();try{n=JSON.parse(u)}catch{n=av.load(u,{json:!0})}}catch{return r.failAndThrow(`Failed to read overrides from file ${e}`)}let i=qXi(t,qXi,n,(u,f)=>Array.isArray(u)&&Array.isArray(f)?f.every(d=>typeof d=="object")&&u.every(d=>typeof d=="object")?void 0:[...f]:void 0);return Wbu(i,mWo)}var Wbu=(e,t)=>{function r(n){if(!Array.isArray(n)&&!Lsi(n))return n;if(Array.isArray(n))return n.map(a=>Wbu(a,t));let i={};for(let[a,u]of Object.entries(n))i[a]=Wbu(u,t);return jWo(i,t)}return r(e)};var OH1={properties:{"stream-condition":{type:"string"},response:"Schema","response-stream":"Schema"},required:["stream-condition","response","response-stream"],extensionsPrefix:"x-"},PH1={id:"",typeExtension:{oas3:e=>{var t;return{...e,XFernStreaming:OH1,Operation:{...e.Operation,properties:{...(t=e.Operation)==null?void 0:t.properties,"x-fern-streaming":"XFernStreaming"}}}}}};async function zEf({absolutePathToOpenAPI:e,absolutePathToOpenAPIOverrides:t,context:r}){let n=await AEf({absolutePathToOpenAPI:e}),i;if(t!=null?i=t:typeof n=="object"&&n[kh.OPENAPI_OVERIDES_FILEPATH]!=null&&(i=pf(Cg(e),zs.of(n[kh.OPENAPI_OVERIDES_FILEPATH]))),i!=null){let a=await jPa({absoluteFilepathToOverrides:i,context:r,data:n});return await AEf({absolutePathToOpenAPI:e,parsed:a})}return n}async function AEf({absolutePathToOpenAPI:e,parsed:t}){let r={config:new Itn.Config({apis:{},styleguide:{plugins:[PH1],rules:{spec:"warn"}}},void 0),dereference:!1,removeUnusedComponents:!1,keepUrlRefs:!0},n=t!=null?await(0,Itn.bundle)({...r,doc:{source:new Itn.Source(e,"<openapi>"),parsed:t}}):await(0,Itn.bundle)({...r,ref:e});return await NEf.default.parse(n.bundle.parsed)}var xqf=yu(I2f(),1);function R2f(e){return Lh(e,kh.ASYNC_CONFIG)}var F2f="$request.";function L2f(e){let t=Lh(e,kh.STREAMING);if(t!=null)return typeof t=="boolean"?t?{type:"stream",format:"json"}:void 0:t["stream-condition"]==null&&t.format!=null?{type:"stream",format:t.format}:{type:"streamCondition",format:t.format??"json",streamConditionProperty:NX1(t["stream-condition"]),responseStream:t["response-stream"],response:t.response}}function NX1(e){return e.startsWith(F2f)?e.slice(F2f.length):e}function U2f(e){let t=e;if(t.cursor!=null)return HSr.cursor({cursor:t.cursor,nextCursor:t.next_cursor,results:t.results});let r=e;return HSr.offset({offset:r.offset,results:r.results,step:r.step,hasNextPage:r["has-next-page"]})}function V2f(e,t){let r=Lh(t,kh.PAGINATION);if(r!=null){if(typeof r=="boolean"){let n=Lh(e,kh.PAGINATION);if(typeof n=="boolean")throw new Error("Global pagination extension is a boolean, expected an object. Only endpoints may declare a boolean for x-fern-pagination.");return n==null?void 0:U2f(n)}return U2f(r)}}function W2f(e){let t=zX1(e),r={};return Hmu({obj:t,occurrences:r,breadcrumbs:[]}),r}function Hmu({obj:e,occurrences:t,breadcrumbs:r}){if(e!=null){if(Array.isArray(e)){for(let n of e)Hmu({obj:n,occurrences:t,breadcrumbs:r});return}if(typeof e=="object"){if(e.$ref!=null&&typeof e.$ref=="string"){let n=e.$ref;t[n]==null?t[n]=1:t[n]+=1;return}for(let n in e)Hmu({obj:e[n],occurrences:t,breadcrumbs:[...r,n]})}}}function zX1(e){return{...e,paths:Object.fromEntries(Object.entries(e.paths??{}).map(([t,r])=>[t,{...r,get:(r==null?void 0:r.get)!=null?C0i(r.get):void 0,put:(r==null?void 0:r.put)!=null?C0i(r.put):void 0,post:(r==null?void 0:r.post)!=null?C0i(r.post):void 0,patch:(r==null?void 0:r.patch)!=null?C0i(r.patch):void 0,delete:(r==null?void 0:r.delete)!=null?C0i(r.delete):void 0}]))}}function C0i(e){return{...e,requestBody:e.requestBody!=null?gy(e.requestBody)?e.requestBody:BX1(e.requestBody):void 0}}function BX1(e){let t,r;for(let n in e.content){let i=sA.parse(n);i!=null&&(i.isJSON()?t=e.content[n]:i.isMultipart()&&(r=e.content[n]))}return r!=null&&t!=null?{...e,content:{[sA.MULTIPART_FORM_DATA]:r}}:e}var H2f="#/components/parameters/",$2f="#/components/responses/",J2f="#/components/examples/",G2f="#/components/requestBodies/",V3n=class{logger;document;taskContext;authHeaders;refOccurrences;DUMMY;options;source;namespace;constructor({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:u}){this.document=t,this.logger=r.logger,this.taskContext=r,this.authHeaders=n,this.refOccurrences=W2f(t),this.options=i,this.source=a,this.DUMMY=this.getDummy(),this.namespace=u}getNumberOfOccurrencesForRef(t){return this.refOccurrences[t.$ref]??0}resolveTagsToTagIds(t){let r=[];return this.namespace!=null&&r.push(this.namespace),r.concat(t??[])}resolveTags(t){let r=[];if(this.namespace!=null){let n={type:"namespace",name:this.namespace};r.push(n)}return r.concat(t??[])}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveSchemaReference(t){let r=t.$ref.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return{"x-fern-type":"unknown",additionalProperties:!0};n=n[i]}return n==null?{"x-fern-type":"unknown",additionalProperties:!0}:(gy(n)&&(n=this.resolveSchemaReference(n)),n)}resolveParameterReference(t){if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith(H2f))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(H2f.length),n=this.document.components.parameters[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return gy(n)?this.resolveParameterReference(n):n}resolveRequestBodyReference(t){if(this.document.components==null||this.document.components.requestBodies==null||!t.$ref.startsWith(G2f))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(G2f.length),n=this.document.components.requestBodies[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return gy(n)?this.resolveRequestBodyReference(n):n}resolveResponseReference(t){if(this.document.components==null||this.document.components.responses==null||!t.$ref.startsWith($2f))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring($2f.length),n=this.document.components.responses[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return gy(n)?this.resolveResponseReference(n):n}resolveExampleReference(t){if(this.document.components==null||this.document.components.examples==null||!t.$ref.startsWith(J2f))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(J2f.length),n=this.document.components.examples[r];if(n==null)throw new Error(`${t.$ref} is undefined`);return gy(n)?this.resolveExampleReference(n):n}referenceExists(t){let r=t.substring(2).split("/").map(i=>i.replace(/~1/g,"/")),n=this.document;for(let i of r){if(typeof n!="object"||n==null)return!1;n=n[i]}return!0}};var W3n=class extends V3n{constructor({document:t,taskContext:r,options:n,source:i,namespace:a}){super({document:t,taskContext:r,authHeaders:new Set,options:n,source:i,namespace:a})}getDummy(){return this}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}getReferencedSchemas(){return new Set}markReferencedByDiscriminatedUnion(t,r,n){}getReferencesFromDiscriminatedUnion(t){}excludeSchema(t){}isSchemaExcluded(t){return!1}markSchemaWithDiscriminantValue(t,r,n){}getDiscriminatedUnionMetadata(t){}};var IX1=nr.object({lang:nr.string(),label:nr.optional(nr.string()),source:nr.string()}),$mu=nr.array(IX1);var K2f={README_EXT:"x-readme"};function RX1(e){if(!Array.isArray(e))return!1;for(let t of e)if(!RO(t)||typeof t.language!="string"||typeof t.code!="string")return!1;return!0}function Y2f(e){let t=Lh(e,K2f.README_EXT);if(!RO(t))return[];let r=t["code-samples"];if(!RX1(r))return[];let n=[];for(let i of r)n.push({name:i.name,language:i.language,code:i.code,install:i.install,docs:void 0});return n}function X2f(e,t,r){let n=IRt(t,kh.EXAMPLES,t8.ExampleEndpointCallArraySchema,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],i=IRt(t,Yje.REDOCLY_CODE_SAMPLES_KEBAB,$mu,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],u=[...IRt(t,Yje.REDOCLY_CODE_SAMPLES_CAMEL,$mu,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],...i];u.length>0&&n.push({"code-samples":u.map(d=>({name:d.label??d.lang,language:d.lang,code:d.source,install:void 0,docs:void 0}))});let f=Y2f(t);return f.length>0&&n.push({"code-samples":f}),n.map(dAt.unknown)}function Q2f(e){let t=Lh(e,kh.AVAILABILITY);if(t==="ga"||t==="generally-available")return vW.GenerallyAvailable;if(t==="beta"||t==="pre-release")return vW.Beta;if(t==="deprecated")return vW.Deprecated;if(e.deprecated)return vW.Deprecated}function x1a(e){return{url:FX1({url:e.url,variables:e.variables??{}}),description:e.description,name:LX1(e),audiences:Lh(e,kh.AUDIENCES)}}function FX1({url:e,variables:t}){let r=Object.fromEntries(Object.entries(t).map(([n,i])=>[n,i.default]));for(let[n,i]of Object.entries(r))e=e.replace(`{${n}}`,i);return e}function LX1(e){var r,n;let t=Lh(e,[kh.SERVER_NAME_V1,kh.SERVER_NAME_V2]);if(t!=null)return t;if(((r=e.description)==null?void 0:r.toLowerCase())==="production")return"Production";if(((n=e.description)==null?void 0:n.toLowerCase())==="sandbox")return"Sandbox"}function Z2f(e){return Lh(e,kh.PARAMETER_NAME)}function k2f(e){return Lh(e,kh.SDK_VARIABLE)}function T1a({path:e,httpMethod:t,parameters:r,context:n,requestBreadcrumbs:i,source:a}){var f;let u={pathParameters:[],queryParameters:[],headers:[]};for(let d of r){let c=gy(d)?n.resolveParameterReference(d):d,o=c.required??!1,l=E2e(c),g=[...i,c.name],O=yR(g);(f=FRt({schema:c,logger:n.logger}))!=null&&f.includes(" ")&&n.logger.warn("Parameter example contains a space, which is ambiguous. Consider using enums for multiple examples, or use an encoding if a space is part of the parameter.");let j=c.schema!=null?L1(c.schema,!o,n,g,a,n.namespace,!1,new Set,FRt({schema:c,logger:n.logger})):o?Lp.primitive({nameOverride:void 0,generatedName:O,title:void 0,schema:by.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:FRt({schema:c,logger:n.logger})}),description:void 0,availability:l,groupName:void 0}):Lp.optional({nameOverride:void 0,generatedName:O,title:void 0,value:Lp.primitive({nameOverride:void 0,generatedName:O,title:void 0,schema:by.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:FRt({schema:c,logger:n.logger})}),description:void 0,availability:void 0,groupName:void 0}),description:void 0,availability:l,groupName:void 0});if(c.in==="header"&&c.schema!=null&&!gy(c.schema)&&c.schema.default!=null){let x=c.schema.default;typeof x=="string"&&x.length>0&&(j=Lp.literal({nameOverride:void 0,generatedName:O,title:void 0,value:E7.string(x),description:void 0,availability:l,groupName:void 0}))}let S={name:c.name,schema:j,description:c.description,parameterNameOverride:Z2f(c),availability:l,source:a};c.in==="query"?u.queryParameters.push(S):c.in==="path"?u.pathParameters.push({...S,variableReference:k2f(c)}):c.in==="header"?!UX1.has(c.name)&&!n.authHeaders.has(c.name)?u.headers.push({...S,env:void 0}):n.logger.debug(`Ignoring ${c.name} header, in ${t.toUpperCase()} ${e}`):n.logger.warn(`Skipping ${c.in} parameter, ${c.name}, in ${t.toUpperCase()} ${e}`)}return u}var UX1=new Set(["User-Agent","Content-Length","Content-Type","X-Forwarded-For","Cookie","Origin","Content-Disposition","X-Ping-Custom-Domain"]);function H3n(e,t){for(let r of Object.keys(e))if(r.includes("json")||r==="*/*"){let n=e[r];if(n==null)continue;return{schema:n.schema??{},examples:tqf(n,t)}}}function eqf(e,t){for(let r of Object.keys(e)){let n=e[r];if(n==null)continue;return{schema:n.schema??{},examples:tqf(n,t)}}}function tqf(e,t){let r=[];e.example!=null&&r.push({name:void 0,value:e.example,description:void 0});let n=Lh(e,Yje.EXAMPLES);return n!=null&&Object.keys(n).length>0&&r.push(...Object.entries(n).map(([i,a])=>({name:a.summary??i,value:a.value,description:a.description}))),e.examples!=null&&Object.keys(e.examples).length>0&&r.push(...Object.entries(e.examples).map(([i,a])=>{let u=gy(a)?t.resolveExampleReference(a):a;return{name:u.summary??i,value:u.value,description:u.description}})),r}function VX1(e){var t;for(let[r,n]of Object.entries(e.content))if((t=sA.parse(r))!=null&&t.isMultipart())return{schema:n.schema,encoding:n.encoding}}function WX1(e){var t;for(let r in e.content)if((t=sA.parse(r))!=null&&t.isOctetStream())return!0;return!1}function HX1(e,t){let r=gy(e)?Jmu(e,t):{id:void 0,schema:e};return Object.entries(r.schema.properties??{}).find(([n,i])=>!gy(i)&&i.type==="string"&&i.format==="binary")!=null}function $3n({requestBody:e,document:t,context:r,requestBreadcrumbs:n,source:i,namespace:a}){var g,O,j,S,x;let u=gy(e)?r.resolveRequestBodyReference(e):e,f=VX1(u),d=f==null?void 0:f.schema,c=f==null?void 0:f.encoding,o=H3n(u.content,r);if(WX1(u))return S2e.octetStream({description:void 0,source:i});if(d!=null&&o==null||d!=null&&HX1(d,t)){let A=gy(d)?Jmu(d,t):{id:void 0,schema:d},z=L1(A.schema,!1,r,n,i,a),N=[];if(z.type==="object")for(let C of z.properties){if(C.schema.type==="primitive"&&C.schema.schema.type==="string"&&C.schema.schema.format==="binary"){N.push({key:C.key,schema:D2e.file({isOptional:!1,isArray:!1}),description:C.schema.description,contentType:c!=null?(g=c[C.key])==null?void 0:g.contentType:void 0});continue}if(C.schema.type==="optional"&&C.schema.value.type==="primitive"&&C.schema.value.schema.type==="string"&&C.schema.value.schema.format==="binary"){N.push({key:C.key,schema:D2e.file({isOptional:!0,isArray:!1}),description:C.schema.description,contentType:c!=null?(O=c[C.key])==null?void 0:O.contentType:void 0});continue}if(C.schema.type==="array"&&C.schema.value.type==="primitive"&&C.schema.value.schema.type==="string"&&C.schema.value.schema.format==="binary"){N.push({key:C.key,schema:D2e.file({isOptional:!1,isArray:!0}),description:C.schema.description,contentType:c!=null?(j=c[C.key])==null?void 0:j.contentType:void 0});continue}if(C.schema.type==="optional"&&C.schema.value.type==="array"&&C.schema.value.value.type==="primitive"&&C.schema.value.value.schema.type==="string"&&C.schema.value.value.schema.format==="binary"){N.push({key:C.key,schema:D2e.file({isOptional:!0,isArray:!0}),description:C.schema.description,contentType:c!=null?(S=c[C.key])==null?void 0:S.contentType:void 0});continue}N.push({key:C.key,schema:D2e.json(C.schema),description:void 0,contentType:c!=null?(x=c[C.key])==null?void 0:x.contentType:void 0})}return S2e.multipart({name:gy(d)&&r.getNumberOfOccurrencesForRef(d)===1?A.id:void 0,description:void 0,properties:N,source:i})}if(o==null)return;let l=L1(o.schema,!1,r,n,i,a,!0);return S2e.json({description:void 0,schema:l,contentType:void 0,fullExamples:o.examples,additionalProperties:!gy(o.schema)&&H7n(o.schema.additionalProperties),source:i})}function Jmu(e,t){var i,a;if(!e.$ref.startsWith(Ren))throw new Error(`Failed to resolve schema reference because of unsupported prefix: ${e.$ref}`);let r=A5r(e);if(r==null)throw new Error(`Failed to resolve schema reference because missing schema id: ${e.$ref}`);let n=(a=(i=t.components)==null?void 0:i.schemas)==null?void 0:a[r];if(n==null)throw new Error(`Failed to resolve schema reference because missing: ${e.$ref}`);return gy(n)?Jmu(n,t):{id:r,schema:n}}var Gmu={400:"BadRequestError",401:"UnauthorizedError",402:"PaymentRequiredError",403:"ForbiddenError",404:"NotFoundError",405:"MethodNotAllowedError",406:"NotAcceptableError",407:"ProxyAuthenticationRequiredError",408:"RequestTimeoutError",409:"ConflictError",410:"GoneError",411:"LengthRequiredError",412:"PreconditionFailedError",413:"ContentTooLargeError",414:"URITooLongError",415:"UnsupportedMediaTypeError",416:"RangeNotSatisfiableError",417:"ExpectationFailedError",418:"ImATeapotError",419:"AuthenticationTimeoutError",420:"MethodFailureError",421:"MisdirectedRequestError",422:"UnprocessableEntityError",423:"LockedError",424:"FailedDependencyError",425:"TooEarlyError",426:"UpgradeRequiredError",428:"PreconditionError",429:"TooManyRequestsError",430:"RequestHeaderFieldsTooLargeError",431:"RequestHeaderFieldsTooLargeError",444:"NoResponseError",449:"RetryWithError",450:"BlockedByWindowsParentalControlsError",451:"UnavailableForLegalReasonsError",499:"ClientClosedRequestError",500:"InternalServerError",501:"NotImplementedError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError",505:"HTTPVersionNotSupportedError",506:"VariantAlsoNegotiatesError",507:"InsufficientStorageError",508:"LoopDetectedError",509:"BandwidthLimitExceededError",510:"NotExtendedError",511:"NetworkAuthenticationRequiredError"},rqf=new Set(Object.values(Gmu));var $X1=["200","201","202","204"];function iqf({operationContext:e,responses:t,context:r,responseBreadcrumbs:n,responseStatusCode:i,streamFormat:a,source:u}){if(t==null)return{value:void 0,errors:{}};let f=JX1({responses:t,context:r,source:u,namespace:r.namespace}),d=!1,c;for(let o of i!=null?[i]:$X1){let l=t[o];l!=null&&(d=!0,c==null&&(c=nqf({operationContext:e,response:l,context:r,responseBreadcrumbs:n,streamFormat:a,source:u,namespace:r.namespace})))}if(c==null&&!d&&t.default!=null&&(c=nqf({operationContext:e,response:t.default,context:r,responseBreadcrumbs:n,streamFormat:a,source:u,namespace:r.namespace})),c!=null)switch(c.type){case"json":return{value:c,errors:f};case"streamingJson":case"streamingSse":return{value:c,errors:f};case"file":case"text":case"streamingText":return{value:c,errors:f};default:Ol(c)}return{value:void 0,errors:f}}function nqf({operationContext:e,streamFormat:t,response:r,context:n,responseBreadcrumbs:i,source:a,namespace:u}){let f=gy(r)?n.resolveResponseReference(r):r;if(f.content!=null&&Object.entries(f.content).find(([o,l])=>{if(l.schema==null)return!1;let g=gy(l.schema)?n.resolveSchemaReference(l.schema):l.schema;return g.type==="string"&&g.format==="binary"}))return T3.file({description:f.description,source:a});let d=H3n(f.content??{},n);if(d!=null){if(t!=null)switch(t){case"json":return T3.streamingJson({description:f.description,responseProperty:void 0,schema:oq(L1(d.schema,!1,n,i,a,u)),source:a});case"sse":return T3.streamingSse({description:f.description,responseProperty:void 0,schema:oq(L1(d.schema,!1,n,i,a,u)),source:a})}return T3.json({description:f.description,schema:L1(d.schema,!1,n,i,a,u),responseProperty:Lh(e.operation,kh.RESPONSE_PROPERTY),fullExamples:d.examples,source:a})}for(let[c,o]of Object.entries(f.content??{})){let l=sA.parse(c);if(l!=null){if(l.isOctetStream()||l.isPDF()||l.isAudio()||l.isImage()||l.isVideo())return T3.file({description:f.description,source:a});if(l.isPlainText()){let g=o.schema;if(g==null)return T3.text({description:f.description,source:a});let O=gy(g)?n.resolveSchemaReference(g):g;return O.type==="string"&&O.format==="byte"?T3.file({description:f.description,source:a}):T3.text({description:f.description,source:a})}}}}function JX1({responses:e,context:t,source:r,namespace:n}){let i={};for(let[a,u]of Object.entries(e)){if(a==="default")continue;let f=parseInt(a);if(f<400||f>600)continue;let d=gy(u)?t.resolveResponseReference(u):u,c=eqf(d.content??{},t),o=Gmu[f];if(o==null){t.logger.warn(`No error name found for status code ${a}`);continue}i[f]={statusCode:f,nameOverride:void 0,generatedName:o,description:d.description,schema:L1((c==null?void 0:c.schema)??{},!1,t,[o,"Body"],r,n),fullExamples:c==null?void 0:c.examples,source:r}}return i}function yEr({operationContext:e,context:t,responseStatusCode:r,suffix:n,streamFormat:i,source:a}){let{document:u,operation:f,path:d,method:c,baseBreadcrumbs:o,sdkMethodName:l}=e,g=Lh(f,kh.IDEMPOTENT),O=Lh(f,[kh.REQUEST_NAME_V1,kh.REQUEST_NAME_V2]),j=[...o,"Request"],S=T1a({parameters:[...e.pathItemParameters,...e.operationParameters],context:t,requestBreadcrumbs:j,path:d,httpMethod:c,source:a}),x=f.requestBody!=null?$3n({requestBody:f.requestBody,document:u,context:new W3n({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:j,source:a,namespace:t.namespace}):void 0;(S.queryParameters.length>0||S.headers.length>0)&&x!=null&&x.type==="json"&&x.schema.type!=="object"&&f.requestBody!=null?x=$3n({requestBody:f.requestBody,document:u,context:t,requestBreadcrumbs:[...j,"Body"],source:a,namespace:t.namespace}):f.requestBody!=null&&(x=$3n({requestBody:f.requestBody,document:u,context:t,requestBreadcrumbs:[...j],source:a,namespace:t.namespace}));let A=[...o,"Response"],z=iqf({operationContext:e,streamFormat:i,responses:f.responses,context:t,responseBreadcrumbs:A,responseStatusCode:r,source:a}),N=Q2f(f),C=X2f(e,f,t),U=Lh(f,kh.SERVER_NAME_V2);return{summary:f.summary,internal:Lh(f,Yje.INTERNAL),idempotent:g,audiences:Lh(f,kh.AUDIENCES)??[],operationId:f.operationId!=null&&n!=null?f.operationId+"_"+n:f.operationId,tags:t.resolveTagsToTagIds(f.tags),namespace:t.namespace,sdkName:l,pathParameters:S.pathParameters,queryParameters:S.queryParameters,headers:S.headers,requestNameOverride:O??void 0,generatedRequestName:yR(j),request:x,response:z.value,errors:z.errors,server:U!=null?[{name:U,url:void 0,audiences:void 0}]:(f.servers??[]).map(Y=>x1a(Y)),description:f.description,authed:GX1(f,u),availability:N,method:c,path:d,examples:C,pagination:e.pagination,source:a}}function GX1(e,t){return e.security!=null?Object.keys(e.security).length>0:t.security!=null?Object.keys(t.security).length>0:!1}function oqf({operationContext:e,context:t,asyncExtension:r,source:n}){let{operation:i,pathItemParameters:a,operationParameters:u}=e,f=r.discriminant.name,d=r.discriminant.value,c=r["response-status-code"],o=aqf({context:t,headerToIgnore:f,parameters:a}),l=aqf({context:t,headerToIgnore:f,parameters:u}),g=yEr({operationContext:{...e,pathItemParameters:o,operationParameters:l,operation:{...i,responses:Object.fromEntries(Object.entries(i.responses).filter(([j])=>parseInt(j)!==c))}},context:t,streamFormat:void 0,source:n}),O=yEr({operationContext:{...e,pathItemParameters:o,operationParameters:l,baseBreadcrumbs:[...e.baseBreadcrumbs,"async"]},context:t,suffix:"async",responseStatusCode:c,streamFormat:void 0,source:n});return O.headers.push({name:f,schema:Lp.literal({nameOverride:void 0,generatedName:yR([f]),title:void 0,description:void 0,availability:void 0,value:E7.string(d),groupName:void 0}),description:void 0,parameterNameOverride:void 0,env:void 0,availability:void 0,source:n}),{sync:g,async:O}}function aqf({context:e,headerToIgnore:t,parameters:r}){return r.filter(n=>{let i=gy(n)?e.resolveParameterReference(n):n;return!(i.in==="header"&&i.name===t)})}var Kmu="stream";function lqf({operationContext:e,context:t,streamingExtension:r}){switch(r.type){case"stream":return{streaming:yEr({operationContext:e,context:t,streamFormat:r.format,source:t.source}),nonStreaming:void 0};case"streamCondition":{let n=uqf({context:t,operation:e.operation,streamingExtension:r,isStreaming:!0});if((n==null?void 0:n.schemaReference)!=null){let c=A5r(n.schemaReference);c!=null&&t.excludeSchema(c)}let i=sqf({operation:e.operation,response:r.responseStream}),a=yEr({operationContext:{...e,sdkMethodName:e.sdkMethodName!=null?{groupName:e.sdkMethodName.groupName,methodName:e.sdkMethodName.methodName+"_"+Kmu}:void 0,operation:{...e.operation,requestBody:n==null?void 0:n.requestBody,responses:i},baseBreadcrumbs:[...e.baseBreadcrumbs,Kmu]},context:t,streamFormat:r.format,suffix:Kmu,source:t.source});a.examples=a.examples.filter(c=>cqf(c,t)!==!1);let u=uqf({context:t,operation:e.operation,streamingExtension:r,isStreaming:!1}),f=sqf({operation:e.operation,response:r.response}),d=yEr({streamFormat:void 0,operationContext:{...e,operation:{...e.operation,requestBody:u==null?void 0:u.requestBody,responses:f}},context:t,source:t.source});return d.examples=d.examples.filter(c=>cqf(c,t)!==!0),{streaming:a,nonStreaming:d}}default:Ol(r)}}function uqf({context:e,operation:t,streamingExtension:r,isStreaming:n}){var c;if(t.requestBody==null)return;let i=gy(t.requestBody)?e.resolveRequestBodyReference(t.requestBody):t.requestBody,a=H3n(i.content,e);if(a==null)return;let u=gy(a.schema)?e.resolveSchemaReference(a.schema):a.schema;if(u.allOf==null&&u.properties==null)return;let f=(c=u.properties)==null?void 0:c[r.streamConditionProperty];f!=null&&gy(f)&&(f=void 0);let d={...u,properties:{...u.properties,[r.streamConditionProperty]:{type:"boolean","x-fern-boolean-literal":n,...f??{}}},title:void 0,required:[...u.required??[],r.streamConditionProperty]};return{requestBody:{content:{[sA.APPLICATION_JSON]:{schema:d}}},schemaReference:gy(a.schema)?a.schema:void 0}}function sqf({operation:e,response:t}){return{...e.responses,200:{description:"",content:{[sA.APPLICATION_JSON]:{schema:t}}}}}function cqf(e,t){return e._visit({unknown:r=>{let n=t8.ExampleEndpointCallSchema.safeParse(r);if(!n.success){t.logger.error("Failed to parse example",n.error.toString());return}if(n.data.response!=null)return n.data.response.stream!=null},full:()=>{},_other:()=>{}})}function fqf({context:e,operationContext:t,source:r}){let{document:n,operation:i,path:a,method:u,baseBreadcrumbs:f,sdkMethodName:d}=t,c=[...f,"Payload"],o=T1a({parameters:[...t.pathItemParameters,...t.operationParameters],context:e,requestBreadcrumbs:c,path:a,httpMethod:u,source:r});if(i.requestBody==null){e.logger.error(`Skipping webhook ${u.toUpperCase()} ${a}: Missing a request body`);return}if(u!=="POST"&&u!=="GET"){e.logger.error(`Skipping webhook ${u.toUpperCase()} ${a}: Not POST or GET`);return}let l=$3n({requestBody:i.requestBody,document:n,context:e,requestBreadcrumbs:[...f,"Payload"],source:r,namespace:e.namespace});if(l==null||l.type!=="json"){e.logger.error(`Skipping webhook ${a} because non-json request body`);return}if(i.operationId==null){e.logger.error(`Skipping webhook ${a} because no operation id present`);return}return{summary:i.summary,sdkName:d,namespace:e.namespace,method:u,operationId:i.operationId,tags:e.resolveTagsToTagIds(i.tags),headers:o.headers,generatedPayloadName:yR(c),payload:l.schema,description:i.description,examples:KX1(l.fullExamples),source:r}}function KX1(e){if(e==null)return[];let t=[];for(let r of e){let n=N5r(r.value);n!=null&&t.push({description:r.description,name:r.name,payload:n})}return t}function Ymu({context:e,pathItemContext:t,operation:r,convertToWebhook:n}){let i=Lh(r,kh.IGNORE);if(i!=null&&i){e.logger.info(`${t.method.toUpperCase()} ${t.path} is marked with x-fern-ignore. Skipping.`);return}let a=YX1(r,e),u=V2f(e.document,r),f={...t,sdkMethodName:a,baseBreadcrumbs:XX1({operation:r,sdkMethodName:a,httpMethod:t.method,path:t.path}),operation:r,operationParameters:r.parameters??[],pagination:u};if(n){let l=fqf({context:e,operationContext:f,source:e.source});return l!=null?{type:"webhook",value:l}:void 0}let d=L2f(r);if(d!=null){let l=lqf({context:e,operationContext:f,streamingExtension:d});return l!=null?{type:"streaming",streaming:l.streaming,nonStreaming:l.nonStreaming}:void 0}let c=R2f(r);if(c!=null){let l=oqf({context:e,operationContext:f,asyncExtension:c,source:e.source});return{type:"async",async:l.async,sync:l.sync}}let o=yEr({context:e,operationContext:f,streamFormat:void 0,source:e.source});return{type:"http",value:o}}function YX1(e,t){let r=Lh(e,kh.SDK_METHOD_NAME),n=Lh(e,kh.SDK_GROUP_NAME)??[];if(r!=null){let i=typeof n=="string"?[n]:n;return i=t.resolveGroupName(i),{groupName:i,methodName:r}}}function XX1({sdkMethodName:e,operation:t,httpMethod:r,path:n}){let i=[];if(e!=null){if(e.groupName.length>0){let a=e.groupName[e.groupName.length-1];a!=null&&i.push(typeof a=="string"?a:a.name)}i.push(e.methodName)}else t.operationId!=null?i.push(t.operationId):i.push(FE(`${r}_${n.split("/").join("_")}`));return i}function dqf(e,t,r,n){let i=[],a=_qf(t),u={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let f of a){let d=QX1({operation:f.operation}),c=Ymu({context:n,pathItemContext:{...u,method:f.method},operation:f.operation,convertToWebhook:d});c!=null&&i.push(c)}return i}function pqf(e,t,r,n){let i=[],a=_qf(t),u={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let f of a){let d=Ymu({context:n,pathItemContext:{...u,method:f.method},operation:f.operation,convertToWebhook:!0});d!=null&&i.push(d)}return i}function _qf(e){let t=[];return e.get!=null&&t.push({method:GJ.Get,operation:e.get}),e.post!=null&&t.push({method:GJ.Post,operation:e.post}),e.put!=null&&t.push({method:GJ.Put,operation:e.put}),e.delete!=null&&t.push({method:GJ.Delete,operation:e.delete}),e.patch!=null&&t.push({method:GJ.Patch,operation:e.patch}),t}function QX1({operation:e}){return Lh(e,[kh.WEBHOOK])??!1}function hqf(e){let t=Lh(e,kh.BASIC_AUTH_USERNAME_VARIABLE_NAME),r=Lh(e,kh.BASIC_AUTH_PASSWORD_VARIABLE_NAME);return{usernameVariable:t,passwordVariable:r}}function yqf(e){return Lh(e,kh.FERN_BASIC_AUTH)}function Xmu(e,t){if(gy(e))throw new Error(`Converting referenced security schemes is unsupported: ${JSON.stringify(e)}`);return ZX1(e,t)}function ZX1(e,t){var r,n,i,a;if(e.type==="apiKey"&&e.in==="header"){let u=Lh(e,Yje.BEARER_FORMAT),f=Lh(e,kh.FERN_HEADER_AUTH);return F9.header({headerName:e.name,prefix:u!=null?"Bearer":f==null?void 0:f.prefix,headerVariableName:(f==null?void 0:f.name)??Lh(e,kh.HEADER_VARIABLE_NAME),headerEnvVar:f==null?void 0:f.env})}else if(e.type==="http"&&e.scheme==="bearer"){let u=Lh(e,kh.FERN_BEARER_TOKEN);return F9.bearer({tokenVariableName:(u==null?void 0:u.name)??Lh(e,kh.BEARER_TOKEN_VARIABLE_NAME),tokenEnvVar:u==null?void 0:u.env})}else if(e.type==="http"&&e.scheme==="basic"){let u=yqf(e),f=hqf(e);return F9.basic({usernameVariableName:((r=u==null?void 0:u.username)==null?void 0:r.name)??f.usernameVariable,usernameEnvVar:(n=u==null?void 0:u.username)==null?void 0:n.env,passwordVariableName:((i=u==null?void 0:u.password)==null?void 0:i.name)??f.passwordVariable,passwordEnvVar:(a=u==null?void 0:u.password)==null?void 0:a.env})}else{if(e.type==="openIdConnect")return F9.bearer({tokenVariableName:void 0,tokenEnvVar:void 0});if(e.type==="oauth2")return F9.oauth({scopesEnum:kX1(e,t)})}throw new Error(`Failed to convert security scheme ${JSON.stringify(e)}`)}function kX1(e,t){var n,i,a,u;let r=((n=e.flows.authorizationCode)==null?void 0:n.scopes)??((i=e.flows.clientCredentials)==null?void 0:i.scopes)??((a=e.flows.implicit)==null?void 0:a.scopes)??((u=e.flows.password)==null?void 0:u.scopes);if(r!=null){let f=C5r({nameOverride:void 0,generatedName:"OauthScope",title:void 0,enumValues:Object.keys(r),fernEnum:Object.fromEntries(Object.entries(r).map(([c,o])=>[c,{description:o}])),_default:void 0,description:void 0,availability:void 0,enumVarNames:void 0,wrapAsNullable:!1,groupName:void 0,context:void 0,source:t}),d=oq(f);if(d.type==="enum")return d}}function vqf(e){return Lh(e,kh.BASE_PATH)}var eQ1=nr.record(nr.string(),nr.object({summary:nr.string().optional(),description:nr.string().optional()}));function bqf({document:e,context:t}){return IRt(e,kh.GROUPS,eQ1,t.logger)}function gqf({context:e,document:t}){return IRt(t,kh.FERN_VERSION,t8.VersionDeclarationSchema,e.logger)??void 0}function mqf(e){let t=Lh(e,kh.FERN_GLOBAL_HEADERS),r=[];for(let n of t??[])r.push({...n,schema:n.type!=null?z_i({fernType:n.type,description:void 0,availability:void 0,generatedName:n.name??n.header,title:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function Oqf(e){let t=Lh(e,kh.FERN_IDEMPOTENCY_HEADERS),r=[];for(let n of t??[])r.push({...n,schema:n.type!=null?z_i({fernType:n.type,description:void 0,availability:void 0,generatedName:n.name??n.header,title:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function Pqf(e){let t=Lh(e,kh.SDK_VARIABLES);return t==null?{}:Object.fromEntries(Object.entries(t).map(([r,n])=>{if(n.type==="string")return[r,{nameOverride:void 0,generatedName:yR([r]),title:n.title,schema:Xw.string({default:Y7n(n),pattern:n.pattern,format:n.format,minLength:n.minLength,maxLength:n.maxLength}),description:n.description,availability:void 0,groupName:void 0}];throw new Error(`Variable ${r} has unsupported schema ${JSON.stringify(n)}`)}))}var tQ1="webhooks";function jqf(e){return Lh(e,tQ1)??{}}var q1a=class extends V3n{nonRequestReferencedSchemas=new Set;twoOrMoreRequestsReferencedSchemas=new Set;singleRequestReferencedSchemas=new Set;discrminatedUnionReferences={};discrminatedUnionMetadata={};schemasToExclude=new Set;constructor({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:u}){super({document:t,taskContext:r,authHeaders:n,options:i,source:a,namespace:u})}getDummy(){return new W3n({document:this.document,taskContext:this.taskContext,options:this.options,source:this.source,namespace:this.namespace})}markSchemaAsReferencedByNonRequest(t){this.nonRequestReferencedSchemas.add(t)}markSchemaAsReferencedByRequest(t){this.singleRequestReferencedSchemas.has(t)?this.twoOrMoreRequestsReferencedSchemas.add(t):this.singleRequestReferencedSchemas.add(t)}getReferencedSchemas(){return new Set([...this.nonRequestReferencedSchemas,...this.twoOrMoreRequestsReferencedSchemas])}markReferencedByDiscriminatedUnion(t,r,n){let i=this.discrminatedUnionReferences[t.$ref];i!=null?(i.discriminants.add(r),i.numReferences+=n):this.discrminatedUnionReferences[t.$ref]={discriminants:new Set([r]),numReferences:n}}getReferencesFromDiscriminatedUnion(t){return this.discrminatedUnionReferences[t.$ref]}markSchemaWithDiscriminantValue(t,r,n){let i=this.discrminatedUnionMetadata[t.$ref];i!=null?i.discriminants.set(r,n):this.discrminatedUnionMetadata[t.$ref]={discriminants:new Map([[r,n]])}}getDiscriminatedUnionMetadata(t){return this.discrminatedUnionMetadata[t.$ref]}excludeSchema(t){this.schemasToExclude.add(t)}isSchemaExcluded(t){return this.schemasToExclude.has(t)}};function wqf(e){return Lh(e,kh.RESOLUTIONS)}function Dqf({openapi:e}){let t=wqf(e);if(t==null)return e;let r={};for(let n of t){let i=`#/components/schemas/${n.name}`;for(let a of n.resolutions)e=rQ1({openapi:e,schemaReference:a,schemaName:n.name}),e=Sqf({openapi:e,replaceReference:a,schemaReference:i,replacedReferences:r}),r={...r,...Object.fromEntries(n.resolutions.map(u=>[i,u]))}}return e}function rQ1({openapi:e,schemaReference:t,schemaName:r}){let n=t.replace("#/","").split("/").map(a=>a.replace("~1","/")),i=e;for(let a of n){let u=i[a];if(u==null)return e;i=u}return e.components==null&&(e.components={}),e.components.schemas==null&&(e.components.schemas={}),e.components.schemas[r]=i,e}function Sqf({openapi:e,replaceReference:t,schemaReference:r,replacedReferences:n}){let i=Object.keys(n).filter(d=>t.startsWith(d)).sort((d,c)=>c.length-d.length)[0];if(i!=null){let d=n[i];if(d!=null){let c=r.replace(i,d);return Sqf({openapi:e,replaceReference:t,schemaReference:c,replacedReferences:{}})}}let a=t.replace("#/","").split("/").map(d=>d.replace("~1","/")),u=e;for(let d of a.slice(0,-1)){let c=u[d];if(c==null)return e;u=c}let f=a[a.length-1];return f==null||(u[f]={$ref:r}),e}function C1a({openApi:e,taskContext:t,options:r,source:n,namespace:i}){var Y,te,G;e=Dqf({openapi:e});let a=Object.fromEntries(Object.entries(((Y=e.components)==null?void 0:Y.securitySchemes)??{}).map(([$,ee])=>Xmu(ee,n)==null?[]:[$,Xmu(ee,n)])),u=new Set(...Object.entries(a).map(([$,ee])=>ee.type==="basic"||ee.type==="bearer"?"Authorization":ee.type==="header"?ee.headerName:null)),f=new q1a({document:e,taskContext:t,authHeaders:u,options:r,source:n,namespace:i}),d=Pqf(e),c=mqf(e),o=Oqf(e),l=r.audiences??[],g=[],O=[];Object.entries(e.paths??{}).forEach(([$,ee])=>{if(ee==null)return;t.logger.debug(`Converting path ${$}`);let Ve=dqf($,ee,e,f);for(let $e of Ve){let Dt=Eqf({operation:$e});if(!(l.length>0&&!l.some(Tt=>Dt.includes(Tt))))switch($e.type){case"async":g.push($e.sync),g.push($e.async);break;case"http":g.push($e.value);break;case"streaming":g.push($e.streaming),$e.nonStreaming&&g.push($e.nonStreaming);break;case"webhook":O.push($e.value);break;default:Ol($e)}}}),Object.entries(jqf(e)).forEach(([$,ee])=>{if(ee==null)return;t.logger.debug(`Converting path ${$}`);let Ve=pqf($,ee,e,f);for(let $e of Ve){let Dt=Eqf({operation:$e});l.length>0&&!l.some(Tt=>Dt.includes(Tt))||O.push($e.value)}});let j=Object.fromEntries(Object.entries(((te=e.components)==null?void 0:te.schemas)??{}).map(([$,ee])=>{if(!gy(ee)){let Ve=Lh(ee,kh.IGNORE);if(Ve!=null&&Ve)return[];if(rqf.has($))return[$,L1({...ee,"x-fern-type-name":`${$}Body`},!1,f,[$],n,i)]}return[$,L1(ee,!1,f,[$],n,i)]}).filter($=>$.length>0)),S=nQ1(j,f,n),x=iQ1(S,f),A={};for(let[$,ee]of Object.entries(x)){let Ve=oq(ee);f.isSchemaExcluded($)||(A[$]=Ve,t.logger.debug(`Converted schema ${$}`))}let z=new fba(x,f.logger),N=g.map($=>{let ee=$.examples,Ve=ee;if(!r.disableExamples&&(ee.length===0||ee.every(F_i))){let Tt=z.buildEndpointExample($);Tt.length>0&&(Ve=[...Tt,...ee.filter(Wt=>!F_i(Wt))])}let $e=$.request,Dt=$.response;return{...$,request:($e==null?void 0:$e.type)==="json"?{...$e,schema:oq($e.schema)}:$e,response:(Dt==null?void 0:Dt.type)==="json"?{...Dt,schema:oq(Dt.schema)}:Dt,queryParameters:$.queryParameters.map(Tt=>({description:Tt.description,name:Tt.name,schema:oq(Tt.schema),parameterNameOverride:Tt.parameterNameOverride,availability:Tt.availability,source:Tt.source})),pathParameters:$.pathParameters.map(Tt=>({description:Tt.description,name:Tt.name,schema:oq(Tt.schema),parameterNameOverride:Tt.parameterNameOverride,variableReference:Tt.variableReference,availability:Tt.availability,source:Tt.source})),headers:$.headers.map(Tt=>({description:Tt.description,name:Tt.name,schema:oq(Tt.schema),parameterNameOverride:Tt.parameterNameOverride,env:Tt.env,availability:Tt.availability,source:Tt.source})),examples:Ve,errors:sy($.errors,Tt=>{var Wt;return{generatedName:Tt.generatedName,nameOverride:Tt.nameOverride,schema:oq(Tt.schema),description:Tt.description,source:Tt.source,examples:(Wt=Tt.fullExamples)==null?void 0:Wt.map(Nt=>{let ur=N5r(Nt.value);if(ur!=null)return{name:Nt.name,description:Nt.description,example:ur}}).filter(RS)}})}}),C=bqf({document:e,context:f});return{apiVersion:gqf({context:f,document:e}),basePath:vqf(e),title:e.info.title,description:e.info.description,groups:Object.fromEntries(Object.entries(C??{}).map(([$,ee])=>[$,{summary:ee.summary??void 0,description:ee.description??void 0}])),servers:(e.servers??[]).map($=>x1a($)),tags:{tagsById:Object.fromEntries((e.tags??[]).map($=>[$.name,{id:$.name,description:$.description}])),orderedTagIds:(G=e.tags)==null?void 0:G.map($=>$.name)},endpoints:N,webhooks:O,channel:[],groupedSchemas:sba(i,A),securitySchemes:a,hasEndpointsMarkedInternal:N.some($=>$.internal),nonRequestReferencedSchemas:f.getReferencedSchemas(),variables:d,globalHeaders:c,idempotencyHeaders:o}}function nQ1(e,t,r){let n={};for(let[i,a]of Object.entries(e)){if(a.type!=="object"){n[i]=a;continue}let u={$ref:`#/components/schemas/${i}`},f=t.getReferencesFromDiscriminatedUnion(u);if(f==null){n[i]=a;continue}let d={...a,type:"object",properties:a.properties.filter(o=>!f.discriminants.has(o.key)),allOfPropertyConflicts:a.allOfPropertyConflicts.filter(o=>!f.discriminants.has(o.propertyKey)),source:r};n[i]=d;let c=Mqf({schema:a,schemas:e});for(let o of[...new Set(c)]){let l=n[o]??e[o];l==null||l.type!=="object"||(n[o]={...l,type:"object",properties:l.properties.filter(g=>!f.discriminants.has(g.key)),allOfPropertyConflicts:l.allOfPropertyConflicts.filter(g=>!f.discriminants.has(g.propertyKey))})}}return n}function iQ1(e,t){let r={};for(let[n,i]of Object.entries(e)){if(i.type!=="object"){r[n]=i;continue}let a={$ref:`#/components/schemas/${n}`},u=t.getDiscriminatedUnionMetadata(a);if(u==null){r[n]=i;continue}let f=[];for(let c of i.properties)if(u.discriminants.has(c.key)){let o=u.discriminants.get(c.key);o!=null&&f.push({...c,schema:Lp.literal({nameOverride:void 0,generatedName:yR([i.generatedName,o]),title:void 0,value:E7.string(o),groupName:void 0,description:void 0,availability:i.availability})})}else f.push(c);let d={...i,type:"object",properties:f};r[n]=d}return r}function Mqf({schema:e,schemas:t}){let r=[];for(let n of e.allOf){r.push(n.schema);let i=t[n.schema];i!=null&&i.type==="object"&&r.push(...Mqf({schema:i,schemas:t}))}return r}function Eqf({operation:e}){let t=[];switch(e.type){case"async":t=e.async.audiences;break;case"http":t=e.value.audiences;break;case"streaming":t=e.streaming.audiences;break;case"webhook":break;default:Ol(e)}return t}async function Tqf({openApi:e,taskContext:t,options:r,source:n,namespace:i}){let a=await(0,xqf.convertObj)(e,{});return C1a({openApi:a.openapi,taskContext:t,options:r,source:n,namespace:i})}var J3n={disableExamples:!1,discriminatedUnionV2:!1,useTitlesAsName:!0,audiences:void 0,optionalAdditionalProperties:!0};async function Gtn({absoluteFilePathToWorkspace:e,specs:t,taskContext:r,optionOverrides:n}){let i={apiVersion:void 0,title:void 0,description:void 0,basePath:void 0,servers:[],tags:{tagsById:{},orderedTagIds:void 0},hasEndpointsMarkedInternal:!1,endpoints:[],webhooks:[],channel:[],groupedSchemas:{rootSchemas:{},namespacedSchemas:{}},variables:{},nonRequestReferencedSchemas:new Set,securitySchemes:{},globalHeaders:[],idempotencyHeaders:[],groups:{}};for(let a of t){let u=(await(0,Zmu.readFile)(a.absoluteFilepath)).toString(),f=YN(e,a.source.file);a.source.relativePathToDependency!=null&&(f=pf(a.source.relativePathToDependency,f));let d=a.source.type==="protobuf"?WSr.protobuf({file:f}):WSr.openapi({file:f});if(u.includes("openapi")||u.includes("swagger")){let c=await zEf({absolutePathToOpenAPI:a.absoluteFilepath,context:r,absolutePathToOpenAPIOverrides:a.absoluteFilepathToOverrides});if(uQ1(c)){let o=C1a({openApi:c,taskContext:r,options:Qmu({specSettings:a.settings,overrides:n}),source:d,namespace:a.namespace});i=qqf(i,o)}else if(sQ1(c)){let o=await Tqf({openApi:c,taskContext:r,options:Qmu({specSettings:a.settings}),source:d,namespace:a.namespace});i=qqf(i,o)}}else if(u.includes("asyncapi")){let c=await oQ1({absoluteFilePathToAsyncAPI:a.absoluteFilepath,context:r,absoluteFilePathToAsyncAPIOverrides:a.absoluteFilepathToOverrides}),o=Epf({document:c,taskContext:r,options:Qmu({specSettings:a.settings}),source:d,asyncApiOptions:aQ1({specSettings:a.settings}),namespace:a.namespace});o.channel!=null&&i.channel.push(o.channel),o.groupedSchemas!=null&&(i.groupedSchemas=Cqf(i.groupedSchemas,o.groupedSchemas)),o.basePath!=null&&(i.basePath=o.basePath)}else r.failAndThrow(`${a.absoluteFilepath} is not a valid OpenAPI or AsyncAPI file`)}return i}function Qmu({specSettings:e,overrides:t}){return{disableExamples:(t==null?void 0:t.disableExamples)??J3n.disableExamples,discriminatedUnionV2:(t==null?void 0:t.discriminatedUnionV2)??(e==null?void 0:e.shouldUseUndiscriminatedUnionsWithLiterals)??J3n.discriminatedUnionV2,useTitlesAsName:(t==null?void 0:t.useTitlesAsName)??(e==null?void 0:e.shouldUseTitleAsName)??J3n.useTitlesAsName,audiences:(t==null?void 0:t.audiences)??(e==null?void 0:e.audiences)??J3n.audiences,optionalAdditionalProperties:(t==null?void 0:t.optionalAdditionalProperties)??(e==null?void 0:e.optionalAdditionalProperties)??J3n.optionalAdditionalProperties}}function aQ1({specSettings:e,overrides:t}){return{naming:(t==null?void 0:t.naming)??(e==null?void 0:e.asyncApiNaming)??Zdf.naming}}function qqf(e,t){return{apiVersion:e.apiVersion??t.apiVersion,title:e.title??t.title,description:e.description??t.description,basePath:e.basePath??t.basePath,servers:[...e.servers,...t.servers],tags:{tagsById:{...e.tags.tagsById,...t.tags.tagsById},orderedTagIds:e.tags.orderedTagIds==null&&t.tags.orderedTagIds==null?void 0:[...e.tags.orderedTagIds??[],...t.tags.orderedTagIds??[]]},hasEndpointsMarkedInternal:e.hasEndpointsMarkedInternal||t.hasEndpointsMarkedInternal,endpoints:[...e.endpoints,...t.endpoints],webhooks:[...e.webhooks,...t.webhooks],channel:[...e.channel,...t.channel],groupedSchemas:Cqf(e.groupedSchemas,t.groupedSchemas),variables:{...e.variables,...t.variables},nonRequestReferencedSchemas:new Set([...e.nonRequestReferencedSchemas,...t.nonRequestReferencedSchemas]),securitySchemes:{...e.securitySchemes,...t.securitySchemes},globalHeaders:e.globalHeaders!=null?[...e.globalHeaders,...t.globalHeaders??[]]:void 0,idempotencyHeaders:e.idempotencyHeaders!=null?[...e.idempotencyHeaders,...t.idempotencyHeaders??[]]:void 0,groups:{...e.groups,...t.groups}}}function Cqf(e,t){e.rootSchemas={...e.rootSchemas,...t.rootSchemas};for(let[r,n]of Object.entries(t.namespacedSchemas))e.namespacedSchemas[r]!=null?e.namespacedSchemas[r]={...e.namespacedSchemas[r],...n}:e.namespacedSchemas[r]=n;return e}async function oQ1({absoluteFilePathToAsyncAPI:e,absoluteFilePathToAsyncAPIOverrides:t,context:r}){let n=(await(0,Zmu.readFile)(e)).toString(),i=await av.load(n);return t!=null?await jPa({absoluteFilepathToOverrides:t,context:r,data:i}):i}function uQ1(e){return e.openapi!=null}function sQ1(e){return e.swagger!=null}function N1a({queryParameter:e,context:t,fileContainingReference:r,namespace:n}){let i=kmu({schema:e.schema,context:t,fileContainingReference:r,namespace:n});if(i==null)return;let a=A2(i.value);if(a==="unknown"?a="string":a==="optional<unknown>"&&(a="optional<string>"),e.description==null&&!i.allowMultiple&&e.parameterNameOverride==null&&e.availability==null)return a;let u={type:a};return i.allowMultiple&&(u["allow-multiple"]=!0),e.description!=null&&(u.docs=e.description),e.parameterNameOverride!=null&&(u.name=e.parameterNameOverride),e.availability!=null&&(u.availability=q3(e.availability)),u}function kmu({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:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:i.value,description:e.description??i.description,availability:e.availability,groupName:void 0}),context:t,declarationFile:zs.of(HT),fileContainingReference:r,namespace:n}),allowMultiple:!0};if(i.type==="oneOf"&&i.value.type==="undisciminated"){let a=[];for(let[u,f]of Object.entries(i.value.schemas))f.type==="literal"&&f.value.type==="string"&&(G7n.test(f.value.value)?a.push(f.value.value):a.push({value:f.value.value,name:B_i(f.value.value)}));if(a.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:a}}),{value:e.generatedName,allowMultiple:!1};if(i.value.schemas.length===2){let[u,f]=i.value.schemas;if(u!=null&&f!=null&&A1a({array:u,primitive:f}))return{value:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:f,description:e.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n}),allowMultiple:!0};if(u!=null&&f!=null&&A1a({array:u,primitive:f}))return{value:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:u,description:e.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n}),allowMultiple:!0}}for(let[u,f]of Object.entries(i.value.schemas))return kmu({schema:f,context:t,fileContainingReference:r,namespace:n})}else if(i.type==="object")return}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:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:i.value,description:e.description??i.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,declarationFile:zs.of(HT),namespace:n}),allowMultiple:!0}}if(e.value.type==="array")return{value:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value.value,description:e.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n}),allowMultiple:!0};if(e.value.type==="oneOf"&&e.value.value.type==="undisciminated"){let i=[];for(let[a,u]of Object.entries(e.value.value.schemas))u.type==="literal"&&u.value.type==="string"&&(G7n.test(u.value.value)?i.push(u.value.value):i.push({value:u.value.value,name:B_i(u.value.value)}));if(i.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:i}}),{value:`optional<${e.value.value.generatedName}>`,allowMultiple:!1};if(e.value.value.schemas.length===2){let[a,u]=e.value.value.schemas;if(a!=null&&u!=null&&A1a({array:a,primitive:u}))return{value:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:u,description:e.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n}),allowMultiple:!0};if(a!=null&&u!=null&&A1a({array:u,primitive:a}))return{value:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:a,description:e.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n}),allowMultiple:!0}}for(let[a,u]of Object.entries(e.value.value.schemas))return kmu({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:u,description:void 0,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n})}else if(e.value.type==="object")return;return{value:S1({schema:e,context:t,fileContainingReference:r,namespace:n}),allowMultiple:!1}}return e.type==="array"?{value:S1({schema:ib.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:e.description,availability:e.availability,groupName:void 0}),context:t,fileContainingReference:r,namespace:n}),allowMultiple:!0}:{value:S1({schema:e,context:t,fileContainingReference:r,namespace:n}),allowMultiple:!1}}function A1a({array:e,primitive:t}){return(e==null?void 0:e.type)==="array"&&e.value.type==="primitive"&&(t==null?void 0:t.type)==="primitive"&&e.value.schema.type===t.schema.type}function Aqf({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"]=cQ1(e.queryParameters)),e.headers!=null&&e.headers.length>0&&(r.headers=lQ1({context:t,namedFullExamples:e.headers}));for(let n of e.messages){let i=Rzr(n.payload);i!=null&&r.messages.push({type:n.messageType,body:i})}return r}function cQ1(e){let t={};return e.forEach(r=>{let n=Rzr(r.value);Array.isArray(n)?t[r.name]=n[0]:n!=null&&(t[r.name]=n)}),t}function lQ1({context:e,namedFullExamples:t}){let r=e.builder.getGlobalHeaderNames(),n={};return t.forEach(i=>{let a=Rzr(i.value);r.has(i.name)||a!=null&&(n[i.name]=a)}),n}function Rzr(e){switch(e.type){case"primitive":return Nqf(e.value);case"object":return zqf(e.properties);case"array":return fQ1(e.value);case"map":return dQ1(e.value);case"oneOf":return pQ1(e.value);case"enum":return e.value;case"literal":return _Q1(e.value);case"unknown":return Rzr(e.value);default:Ol(e)}}function Nqf(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:Ol(e)}}function zqf(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Rzr(r)]))}function fQ1(e){return e.map(t=>Rzr(t))}function dQ1(e){return Object.fromEntries(e.map(t=>[Nqf(t.key),Rzr(t.value)]))}function pQ1(e){return e.type==="discriminated"?zqf(e.value):Rzr(e.value)}function _Q1(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:Ol(e)}}function vEr(e){var t;return(t=e.find(r=>typeof r!="string"&&r.type==="namespace"))==null?void 0:t.name}function z1a(e,t){return t??((e==null?void 0:e.groupName)!=null?vEr(e.groupName):void 0)}function Bqf({channel:e,context:t,declarationFile:r}){let n={path:e.path,auth:!1};e.summary!=null&&(n["display-name"]=e.summary);let i=vEr(e.groupName),a={};if(e.handshake.pathParameters.length>0)for(let d of e.handshake.pathParameters)a[d.name]=eba({pathParameter:d,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 d of e.handshake.queryParameters){let c=N1a({queryParameter:d,context:t,fileContainingReference:r,namespace:i});c!=null&&(u[d.name]=c)}Object.keys(u).length>0&&(n["query-parameters"]=u);let f={};if(e.handshake.headers.length>0)for(let d of e.handshake.headers){let c=BRt({header:d,context:t,fileContainingReference:r,namespace:i});f[d.name]=c}Object.keys(f).length>0&&(n.headers=f),t.builder.addChannel(r,{channel:n}),e.subscribe!=null&&t.builder.addChannelMessage(r,{messageId:"subscribe",message:{origin:"server",body:S1({schema:e.subscribe,context:t,fileContainingReference:r,namespace:i})}}),e.publish!=null&&t.builder.addChannelMessage(r,{messageId:"publish",message:{origin:"client",body:S1({schema:e.publish,context:t,fileContainingReference:r,namespace:i})}});for(let d of e.examples){let c=Aqf({context:t,websocketExample:d});t.builder.addChannelExample(r,{example:c})}}var Iqf="Production",Rqf="Default";function Fqf(e){return Object.entries(e).reduce((t,[r,n])=>(U2n(n)?Object.entries(n.urls).forEach(([i,a])=>{t[i]=a}):t[r]=typeof n=="string"?n:n.url,t),{})}function Lqf(e){var f,d;if(e.environmentOverrides!=null){for(let[c,o]of Object.entries(e.environmentOverrides.environments??{}))e.builder.addEnvironment({name:c,schema:o});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=[];for(let c of e.ir.servers){let o=c.audiences?{url:c.url,audiences:c.audiences}:c.url;if(c.name==null){r.push(o);continue}t[c.name]=o}let n={},i=[];for(let c of e.ir.endpoints)for(let o of c.server){if(o.url==null)continue;let l=o.audiences?{url:o.url,audiences:o.audiences}:o.url;if(o.name==null){i.push(l);continue}n[o.name]=l}let a=Object.keys(t).length,u=Object.keys(n).length;if(a===0&&u===0){let c=(f=e.ir.servers[0])==null?void 0:f.url,o=(d=e.ir.servers[0])==null?void 0:d.audiences;c!=null&&(e.builder.addEnvironment({name:Rqf,schema:o?{url:c,audiences:o}:c}),e.builder.setDefaultEnvironment(Rqf))}else if(a>0&&u===0){let c=0;r.length>0&&e.logger.error(`Skipping servers ${r.map(o=>typeof o=="string"?o:o.url).join(", ")} because x-fern-server-name was not provided.`);for(let[o,l]of Object.entries(t))c===0&&e.builder.setDefaultEnvironment(o),e.builder.addEnvironment({name:o,schema:l}),c+=1}else if(u>0){(r.length>0||i.length>0)&&e.logger.error(`Skipping servers ${[...r,...i].map(o=>typeof o=="string"?o:o.url).join(", ")} because x-fern-server-name was not provided.`);let c=Object.entries(t)[0];if(c!=null){let[o,l]=c;e.setDefaultServerName(o)}e.builder.addEnvironment({name:Iqf,schema:{urls:{...Fqf(t),...Fqf(n)}}}),e.builder.setDefaultEnvironment(Iqf)}}function B1a(e){return A2(e).startsWith("optional")?e:typeof e=="string"?`optional<${e}>`:{...e,type:`optional<${e.type}>`}}var eOu=class{schema;count=0;constructor(t){this.schema=t}increment(){this.count+=1}},hQ1=.75,yQ1=new Set("authorization");function Uqf(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?V7n(n.schema):void 0,u=a!=null?vEr(a):void 0,f=zs.of("api.yml");i={name:n.name,env:n.env,type:n.schema!=null?A2(S1({schema:n.schema,context:e,fileContainingReference:u?pf(zs.of(FE(u)),f):f,namespace:u}))??"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(yQ1.has(a.name.toLowerCase()))continue;let u=r[a.name];if(u==null){let f=t[a.name],d=BRt({header:{...a,schema:(f==null?void 0:f.schema)??a.schema,name:(f==null?void 0:f.name)??a.name},fileContainingReference:zs.of(nB),context:e,namespace:void 0});u=new eOu(d),r[a.name]=u}u.increment()}let n=e.ir.endpoints.length*hQ1;for(let[i,a]of Object.entries(r)){let u=t[i],f=a.count===e.ir.endpoints.length,d=a.count>=n;u==null&&(f?e.builder.addGlobalHeader({name:i,schema:a.schema}):d&&e.builder.addGlobalHeader({name:i,schema:B1a(a.schema)}))}}}function Vqf(e){for(let t of e.ir.idempotencyHeaders??[]){let r=t.schema?V7n(t.schema):void 0,n=r!=null?vEr(r):void 0,i=BRt({header:{...t,schema:t.schema??ib.primitive({description:void 0,availability:void 0,generatedName:"",title:void 0,groupName:void 0,nameOverride:void 0,schema:Xw.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:zs.of(nB),context:e,namespace:n});e.builder.addIdempotencyHeader({name:t.header,schema:B1a(i)})}}function cG(e){switch(e.type){case"primitive":return Wqf(e.value);case"object":return Hqf(e.properties);case"array":return vQ1(e.value);case"map":return bQ1(e.value);case"oneOf":return gQ1(e.value);case"enum":return e.value;case"literal":return mQ1(e.value);case"unknown":return cG(e.value);default:Ol(e)}}function Wqf(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!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:Ol(e)}}function Hqf(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,cG(r)]))}function vQ1(e){return e.map(t=>cG(t))}function bQ1(e){return Object.fromEntries(e.map(t=>[Wqf(t.key),cG(t.value)]))}function gQ1(e){return e.type==="discriminated"?Hqf(e.value):cG(e.value)}function mQ1(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:Ol(e)}}function $qf({endpointExample:e,context:t}){let r={};return e.type!=="full"?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"]=OQ1(e.pathParameters)),e.queryParameters!=null&&e.queryParameters.length>0&&(r["query-parameters"]=PQ1(e.queryParameters)),e.headers!=null&&e.headers.length>0&&(r.headers=jQ1({context:t,namedFullExamples:e.headers})),e.request!=null&&(r.request=cG(e.request)),e.response!=null&&(r.response={body:cG(e.response)}),e.response!=null&&(r.response={body:cG(e.response)}),e.codeSamples!=null&&e.codeSamples.length>0&&(r["code-samples"]=e.codeSamples.map(n=>n.type==="language"?{name:n.name??void 0,docs:n.description??void 0,language:n.language,code:n.code,install:n.install??void 0}:{name:n.name??void 0,docs:n.description??void 0,sdk:n.sdk,code:n.code}).filter(RS)),r)}function OQ1(e){let t={};return e.forEach(r=>{let n=cG(r.value);n!=null&&(t[r.parameterNameOverride??r.name]=n)}),t}function PQ1(e){let t={};return e.forEach(r=>{let n=cG(r.value);Array.isArray(n)?t[r.name]=n[0]:n!=null&&(t[r.name]=n)}),t}function jQ1({context:e,namedFullExamples:t}){let r=e.builder.getGlobalHeaderNames(),n={};return t.forEach(i=>{let a=cG(i.value);r.has(i.name)||a!=null&&(n[i.name]=a)}),n}function Jqf(e){return GJ._visit(e,{get:()=>t8.HttpMethodSchema.Enum.GET,post:()=>t8.HttpMethodSchema.Enum.POST,put:()=>t8.HttpMethodSchema.Enum.PUT,patch:()=>t8.HttpMethodSchema.Enum.PATCH,delete:()=>t8.HttpMethodSchema.Enum.DELETE,head:()=>{throw new Error("HEAD is unsupported")},options:()=>{throw new Error("HEAD is unsupported")},trace:()=>{throw new Error("HEAD is unsupported")},_other:()=>{throw new Error("Unkown http method is unsupported")}})}function Gqf({endpoint:e,declarationFile:t,context:r}){let{nonRequestReferencedSchemas:n}=r.ir,i=[],a=new Set,u=e.path,f=z1a(e.sdkName,e.namespace),d={};for(let S of e.pathParameters)S.parameterNameOverride&&(u=u.replace(S.name,S.parameterNameOverride)),d[S.parameterNameOverride??S.name]=eba({pathParameter:S,context:r,fileContainingReference:t,namespace:f}),a.add(S.name);let c={};for(let S of e.queryParameters){let x=N1a({queryParameter:S,context:r,fileContainingReference:t,namespace:f});x!=null&&(c[S.name]=x,a.add(S.name))}let o;e.pagination!=null&&(e.pagination.type==="cursor"?o={cursor:e.pagination.cursor,next_cursor:e.pagination.nextCursor,results:e.pagination.results}:o={offset:e.pagination.offset,step:e.pagination.step,results:e.pagination.results,"has-next-page":e.pagination.hasNextPage});let l={path:u,method:Jqf(e.method),auth:e.authed,docs:e.description??void 0,pagination:o};Object.keys(d).length>0&&(l["path-parameters"]=d),e.summary!=null&&(l["display-name"]=e.summary);let g={},O=r.builder.getGlobalHeaderNames(),j=e.headers.filter(S=>!O.has(S.name));for(let S of j){let x=BRt({header:S,context:r,fileContainingReference:t,namespace:f});g[S.name]=x,a.add(typeof x=="string"?S.name:x.name??S.name)}if(e.request!=null){let S=DQ1({context:r,declarationFile:t,request:e.request,generatedRequestName:e.generatedRequestName,requestNameOverride:e.requestNameOverride??void 0,queryParameters:Object.keys(c).length>0?c:void 0,nonRequestReferencedSchemas:Array.from(n),headers:Object.keys(g).length>0?g:void 0,usedNames:a,namespace:f});l.request=S.value,i=[...i,...S.schemaIdsToExclude??[]]}else{let S=Object.keys(c).length>0,x=Object.keys(g).length>0,A={};(S||x)&&(A.name=e.requestNameOverride??e.generatedRequestName),S&&(A["query-parameters"]=c),x&&(A.headers=g),Object.keys(A).length>0&&(l.request=A)}if(e.response!=null&&e.response._visit({json:S=>{let x=S1({schema:S.schema,context:r,fileContainingReference:t,namespace:f});l.response={docs:S.description??void 0,type:A2(x)},S.responseProperty!=null&&(l.response.property=S.responseProperty)},streamingJson:S=>{let x=S1({schema:S.schema,context:r,fileContainingReference:t,namespace:f});l["response-stream"]={docs:S.description??void 0,type:A2(x),format:"json"}},streamingSse:S=>{let x=S1({schema:S.schema,context:r,fileContainingReference:t,namespace:f});l["response-stream"]={docs:S.description??void 0,type:A2(x),format:"sse"}},file:S=>{l.response={docs:S.description??void 0,type:"file"}},streamingText:S=>{l["response-stream"]={docs:S.description??void 0,type:"text"}},text:S=>{l.response={docs:S.description??void 0,type:"text"}},_other:()=>{var S;throw new Error("Unrecognized Response type: "+((S=e.response)==null?void 0:S.type))}}),r.builder.getEnvironmentType()==="multi"){let S=r.getDefaultServerName(),x=e.server[0];x==null?S!=null&&(l.url=S):l.url=x.name??void 0}return e.idempotent&&(l.idempotent=!0),e.availability!=null&&(l.availability=q3(e.availability)),Object.entries(e.errors).forEach(([S,x])=>{var te;let A=x.generatedName,z=zs.of(HT);r.builder.enableUniqueErrorsPerEndpoint&&(A=`${e.generatedRequestName}${x.generatedName}`,x.schema!=null&&(x.schema.type!=="reference"&&x.schema.type!=="oneOf"?x.schema.generatedName=`${e.generatedRequestName}${x.schema.generatedName}`:x.schema.type==="oneOf"&&(x.schema.value.generatedName=`${e.generatedRequestName}${x.schema.value.generatedName}`)));let N={"status-code":parseInt(S)},C=Hdf({location:Kqf,namespaceOverride:f});if(x.schema!=null){let G=S1({schema:x.schema,context:r,fileContainingReference:C,declarationFile:C,namespace:f});N.type=A2(G),N.docs=x.description}r.builder.addError(C,{name:A,schema:N}),l.errors==null&&(l.errors=[]);let U=r.builder.addImport({file:t,fileToImport:C});l.errors.push(U!=null?`${U}.${A}`:A),N.type!=null&&((te=x.examples)==null||te.forEach(G=>{let $={value:cG(G.example),name:G.name,docs:G.description};r.builder.addErrorExample(C,{name:A,example:$})}))}),e.examples.length>0&&(l.examples=wQ1({endpointExamples:e.examples,context:r})),r.ir.hasEndpointsMarkedInternal&&(e.internal==null||!e.internal)?l.audiences=[tOu,...e.audiences]:e.audiences.length>0&&(l.audiences=e.audiences),{value:l,schemaIdsToExclude:i}}function wQ1({endpointExamples:e,context:t}){return e.map(r=>{try{return $qf({endpointExample:r,context:t})}catch(n){throw console.error(`Error building endpoint example: ${n}`),n}})}function DQ1({declarationFile:e,context:t,request:r,requestNameOverride:n,generatedRequestName:i,queryParameters:a,nonRequestReferencedSchemas:u,headers:f,usedNames:d,namespace:c}){if(r.type==="json"){let o=r.schema.type==="reference"?r.schema.schema:void 0,l=r.schema.type==="reference"?t.getSchema(r.schema.schema,c):r.schema;if((l==null?void 0:l.type)!=="object"||o!=null&&u.includes(o)){let x=S1({schema:r.schema,fileContainingReference:e,context:t,namespace:c}),A={schemaIdsToExclude:[],value:{body:x}},z=Object.keys(a??{}).length>0,N=Object.keys(f??{}).length>0;return z&&(A.value["query-parameters"]=a),N&&(A.value.headers=f),(z||N)&&(A.value.name=n??i),r.contentType!=null&&(A.value["content-type"]=r.contentType),A}let g=Object.fromEntries(l.properties.map(x=>{let A=S1({schema:x.schema,fileContainingReference:e,context:t,namespace:c}),z=x.nameOverride??x.key,N=q3(x.availability);if(!d.has(z)&&x.audiences.length<=0)return d.add(z),x.nameOverride!=null?[x.key,{type:A2(A),docs:A_i(A),name:x.nameOverride,availability:N}]:[x.key,N?{...typeof A=="string"?{type:A}:A,availability:N}:A];let C={type:A2(A),docs:A_i(A)};return d.has(z)&&(C.name=x.generatedName),x.audiences.length>0&&(C.audiences=x.audiences),N!=null&&(C.availability=N),d.add(z),[x.key,C]})),O=l.allOf.map(x=>{let A=S1({schema:ib.reference(x),fileContainingReference:e,context:t,namespace:c});return A2(A)}),j={properties:g};O.length>0&&(j.extends=O),r.additionalProperties&&(j["extra-properties"]=!0);let S={name:n??l.nameOverride??l.generatedName,"query-parameters":a,headers:f,body:j};return r.contentType!=null&&(S["content-type"]=r.contentType),{schemaIdsToExclude:o!=null?[o]:[],value:S}}else{if(r.type==="octetStream")return{schemaIdsToExclude:[],value:{body:"bytes","content-type":sA.APPLICATION_OCTET_STREAM}};if(r.type==="multipart"){let o=Object.fromEntries(r.properties.map(l=>{if(l.schema.type==="file"){let g=l.schema.isArray?"list<file>":"file";if(g=l.schema.isOptional?`optional<${g}>`:g,l.description!=null||l.contentType!=null){let O={type:g};return l.description!=null&&(O.docs=l.description),l.contentType!=null&&(O["content-type"]=l.contentType),[l.key,O]}return[l.key,g]}else{let g=S1({schema:l.schema.value,fileContainingReference:e,context:t,namespace:c});return l.contentType!=null&&(typeof g=="string"?g={type:g,"content-type":l.contentType}:g["content-type"]=l.contentType),[l.key,g]}}));return{schemaIdsToExclude:r.name==null?[]:[r.name],value:{name:n??r.name??i,"query-parameters":a,headers:f,body:{properties:o},"content-type":sA.MULTIPART_FORM_DATA}}}else Ol(r)}}function SQ1({location:e,namespaceOverride:t}){return t!=null?{...e,file:pf(zs.of(t),e.file)}:e}function EQ1(e){let t=e.namespace,r=e.tags.filter(d=>d!==t)[0],n=e.operationId;if(n==null)return r!=null?{file:zs.of(`${FE(r)}.yml`),endpointId:e.summary!=null?FE(e.summary):FE(`${e.method}_${e.path.split("/").join("_")}`)}:e.summary!=null?{file:zs.of(HT),endpointId:FE(e.summary)}:{file:zs.of(HT),endpointId:FE(`${e.method}_${e.path.split("/").join("_")}`)};if(r==null)return{file:zs.of(HT),endpointId:n};let i=A0i(r),a=A0i(n);if(nDr(i,a))return{file:zs.of("__package__.yml"),endpointId:r};let u=TQ1({operationId:n,tag:r,path:e.path,method:e.method});if(u!=null)return u;let f=[];for(let d=0;d<i.length;++d){let c=i[d];if(c!=null&&c===a[d])f.push(c);else{let o=FE(r);return{file:zs.of(`${o}.yml`),endpointId:n,tag:r}}}if(f.length>=a.length)throw new Error(`Cannot get file for endpoint ${JSON.stringify(e)}`);return{file:zs.of(FE(f.join("_"))+".yml"),endpointId:FE(a.slice(f.length).join("_")),tag:r}}function N0i(e){let t=e.tags[0];if(e.sdkName!=null){let r=klu({sdkName:e.sdkName,namespaceOverride:e.namespace}),n=`${r}.yml`,i=r.toLowerCase()===(t==null?void 0:t.toLowerCase().replaceAll(" ",""));return{file:zs.of(n),endpointId:e.sdkName.methodName,tag:i?t:void 0}}return SQ1({namespaceOverride:e.namespace,location:EQ1(e)})}function A0i(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=Y8t(t),t}var MQ1=new RegExp("[^a-zA-Z0-9{}]+"),xQ1=new RegExp("[{}]","g");function TQ1({operationId:e,tag:t,path:r,method:n}){let a=`${r.split(MQ1).join("_").replaceAll(xQ1,"_")}_${n.toLowerCase()}`;if(e.endsWith(a))return{file:zs.of(FE(t)+".yml"),endpointId:FE(e.slice(0,-1*a.length)),tag:t}}function Yqf(e){let t=new Set,{endpoints:r,tags:n}=e.ir,i=[];for(let a of r){let{endpointId:u,file:f,tag:d}=N0i(a),c=f.split(".")[0];c!=null&&t.add(c);let o;if(a.sdkName!=null){let O=e.ir.groups;for(let j of a.sdkName.groupName){let S=typeof j=="string"?j:j.name,x=O[S];if(x==null)break;if(x.summary!=null||x.description!=null){o=O[S];break}}}let l=d==null?void 0:n.tagsById[d],g=Gqf({context:e,endpoint:a,declarationFile:f});i=[...i,...g.schemaIdsToExclude],e.builder.addEndpoint(f,{name:u,schema:g.value,source:a.source}),((l==null?void 0:l.id)!=null||(l==null?void 0:l.description)!=null)&&e.builder.setServiceInfo(f,{displayName:(o==null?void 0:o.summary)??(l==null?void 0:l.id),docs:(o==null?void 0:o.description)??(l==null?void 0:l.description)??void 0})}return{schemaIdsToExclude:i,sdkGroups:t}}function Xqf(e){for(let[t,r]of Object.entries(e.ir.variables)){let n=r.groupName!=null?vEr(r.groupName):void 0,i=S1({schema:ib.primitive(r),context:e,fileContainingReference:zs.of(HT),namespace:n});e.builder.addVariable({name:t,schema:{type:A2(i),docs:r.description??void 0}})}}function Qqf(e){for(let t of e.ir.webhooks){let r=AQ1({webhook:t,context:e});if(r==null)continue;let n=z1a(t.sdkName,t.namespace),i={};for(let u of t.headers)i[u.name]=BRt({header:u,context:e,fileContainingReference:r.file,namespace:n});let a={method:t.method,"display-name":t.summary??void 0,headers:i,payload:S1({schema:t.payload,context:e,fileContainingReference:r.file,namespace:n}),examples:t.examples!=null?t.examples.map(u=>({docs:u.description,name:u.name,payload:cG(u.payload)})):void 0};e.builder.addWebhook(r.file,{name:r.endpointId,schema:a}),t.description!=null&&(a.docs=t.description)}}function qQ1({location:e,namespaceOverride:t}){if(e!=null)return t!=null?{...e,file:pf(zs.of(t),e.file)}:e}function CQ1({webhook:e,context:t}){let r=e.tags[0],n=e.operationId;if(r==null)return{file:zs.of(HT),endpointId:n};let i=A0i(r),a=A0i(n);if(nDr(i,a))return{file:zs.of("__package__.yml"),endpointId:r};let u=[];for(let f=0;f<i.length;++f){let d=i[f];if(d!=null&&d===a[f])u.push(d);else{let c=FE(r);return{file:zs.of(`${c}.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:zs.of(FE(u.join("_"))+".yml"),endpointId:FE(a.slice(u.length).join("_")),tag:r}}function AQ1({webhook:e,context:t}){return e.sdkName!=null?{file:Wdf({sdkName:e.sdkName,namespaceOverride:e.namespace}),endpointId:e.sdkName.methodName}:qQ1({namespaceOverride:e.namespace,location:CQ1({webhook:e,context:t})})}var NQ1=zs.of(HT);function Zqf(e){switch(e.type){case"object":return vFt(e.groupName);case"enum":return vFt(e.groupName);case"oneOf":return vFt(e.value.groupName);case"array":return vFt(e.groupName);case"map":return vFt(e.groupName);case"reference":return vFt(e.groupName);case"literal":return vFt(e.groupName);case"optional":return vFt(e.groupName);case"nullable":return vFt(e.groupName);case"primitive":return vFt(e.groupName);case"unknown":return NQ1;default:Ol(e)}}function vFt(e){return W7n(e)}var tOu="external",Kqf=zs.of(HT);function kqf({schemas:e,schemaIdsToExclude:t,namespace:r,context:n}){for(let[i,a]of Object.entries(e)){if(t.includes(i))continue;let u=Zqf(a),f=Gdf({schema:a,context:n,declarationFile:u,namespace:r});if(W2n(f.schema)){let d=A2(f.schema);if(d===(f.name??i)||d===`optional<${f.name??i}>`)continue}n.builder.addType(u,{name:f.name??i,schema:f.schema})}}function eCf(e){e.ir.apiVersion!=null&&e.builder.setApiVersion(e.ir.apiVersion),Lqf(e),Uqf(e),Vqf(e),Qdf(e),Xqf(e),e.ir.basePath!=null&&e.builder.setBasePath(e.ir.basePath),e.ir.hasEndpointsMarkedInternal&&e.builder.addAudience(tOu);let{schemaIdsToExclude:t,sdkGroups:r}=Yqf(e);Qqf(e);for(let n of e.ir.channel){let i=W7n(n.groupName);Bqf({channel:n,context:e,declarationFile:i})}kqf({schemas:e.ir.groupedSchemas.rootSchemas,schemaIdsToExclude:t,namespace:void 0,context:e});for(let[n,i]of Object.entries(e.ir.groupedSchemas.namespacedSchemas))kqf({schemas:i,schemaIdsToExclude:t,namespace:n,context:e});return e.ir.tags.orderedTagIds!=null&&e.ir.tags.orderedTagIds.length>0&&e.ir.tags.orderedTagIds.every(i=>r.has(i))&&e.builder.addNavigation({navigation:e.ir.tags.orderedTagIds}),e.builder.build()}var Fzr=yu(require("path"),1);var I1a=yu(require("path"),1),G3n=class{files={};directories={};getAllFiles(){let t={},r=(n,i)=>{for(let[u,f]of Object.entries(n.files)){let d=i!=null?zs.of(`${i}${I1a.default.sep}${u}`):zs.of(u);t[d]=f}let a=Object.keys(n.directories).sort();for(let u of a){let f=i!=null?`${i}${I1a.default.sep}${u}`:u,d=n.directories[u];r(d,f)}};return r(this),t}getOrCreateFile(t){return this.getOrCreateFileRecursive(t.split(I1a.default.sep))}getOrCreateFileRecursive(t){var i,a;if(t.length===1)return(i=this.files)[a=zs.of(t[0])]??(i[a]={});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 G3n),this.directories[r].getOrCreateFileRecursive(n)}};var R1a=class{modifyBasePaths;enableUniqueErrorsPerEndpoint;root;rootApiFile;packageMarkerFile={};basePath=void 0;constructor(t,r,n){this.modifyBasePaths=r,this.enableUniqueErrorsPerEndpoint=n,this.root=new G3n,this.rootApiFile={name:"api","error-discrimination":{strategy:"status-code"}},t.title!=null&&(this.rootApiFile["display-name"]=t.title)}addNavigation({navigation:t}){this.packageMarkerFile.navigation=t}setServiceInfo(t,{displayName:r,docs:n}){let i=this.getOrCreateFile(t);i.service==null&&(i.service={auth:!1,"base-path":"",endpoints:{}}),r!=null&&(i.service["display-name"]=r),n!=null&&(i.docs=n)}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 CDr(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??{}),r=this.getVersionHeader();return r!=null&&t.push(r),new Set(t)}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)}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}){if(t===r)return;let n=FE((Cg(r)+"/"+(0,Fzr.basename)(r,(0,Fzr.extname)(r))).replaceAll("__package__","root"));if(t===zs.of(nB))return this.rootApiFile.imports==null&&(this.rootApiFile.imports={}),this.rootApiFile.imports[n]=YN(Cg(I_.of(`/${t}`)),I_.of(`/${r}`)),n;let i=this.getOrCreateFile(t);return i.imports==null&&(i.imports={}),i.imports[n]=YN(Cg(I_.of(`/${t}`)),I_.of(`/${r}`)),n}addType(t,{name:r,schema:n}){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}){var a;let i=this.getOrCreateFile(t);i.errors==null&&(i.errors={}),i.errors[r]==null?i.errors[r]=n:((a=i.errors[r])==null?void 0:a.type)!==n.type&&(i.errors[r]={"status-code":n["status-code"],type:"unknown"})}addErrorExample(t,{name:r,example:n}){var f;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(d=>nDr(d,n))??!1)||(f=a.examples)==null||f.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=Ben(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=Fzr.default.join(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();if(this.modifyBasePaths){let i=zQ1(this.rootApiFile);this.packageMarkerFile.service!=null&&(this.packageMarkerFile.service={...this.packageMarkerFile.service,endpoints:Object.fromEntries(Object.entries(this.packageMarkerFile.service.endpoints).map(([a,u])=>[a,{...u,path:`${i}${u.path}`}]))});for(let a of Object.values(t))a.service!=null&&(a.service={...a.service,endpoints:Object.fromEntries(Object.entries(a.service.endpoints).map(([u,f])=>[u,{...f,path:`${i}${f.path}`}]))});this.rootApiFile.environments!=null&&(this.rootApiFile.environments={...Object.fromEntries(Object.entries(this.rootApiFile.environments).map(([a,u])=>typeof u=="string"?[a,u.substring(0,u.length-i.length)]:tCf(u)?[a,{url:u.url.substring(0,u.url.length-i.length)}]:[a,{urls:Object.fromEntries(Object.entries(u.urls).map(([f,d])=>[f,d.substring(0,d.length-i.length)]))}]))})}let 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:Fzr.default.join(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:Fzr.default.join(r,u.path)}]))})}return{rootApiFile:this.rootApiFile,packageMarkerFile:this.packageMarkerFile,definitionFiles:t}}getOrCreateFile(t){return t===HT?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 zQ1(e){if(e.environments==null)return"";let t=Object.entries(e.environments).flatMap(([r,n])=>typeof n=="string"?[n]:tCf(n)?[n.url]:Object.values(n.urls));return IQ1(t.map(BQ1))}function BQ1(e){try{let r=new URL(e).pathname;return r.endsWith("/")?r.slice(0,-1):r}catch{return""}}function IQ1(e){let t="";for(;;){let r=e.map(i=>i[i.length-t.length-1]),n=r[0];if(n==null||r.some(i=>i!==n))break;t=n+t}return t}function tCf(e){return e.url!=null}var F1a=class{logger;taskContext;ir;builder;environmentOverrides;authOverrides;globalHeaderOverrides;detectGlobalHeaders;defaultServerName=void 0;constructor({taskContext:t,ir:r,enableUniqueErrorsPerEndpoint:n,detectGlobalHeaders:i,environmentOverrides:a,globalHeaderOverrides:u,authOverrides:f}){this.logger=t.logger,this.taskContext=t,this.ir=r,this.builder=new R1a(r,!1,n),this.detectGlobalHeaders=i,this.environmentOverrides=a,this.authOverrides=f,this.globalHeaderOverrides=u}getSchema(t,r){var n;return r==null?this.ir.groupedSchemas.rootSchemas[t]:(n=this.ir.groupedSchemas.namespacedSchemas[r])==null?void 0:n[t]}getDefaultServerName(){return this.defaultServerName}setDefaultServerName(t){this.defaultServerName=t}};function rOu(e){let t=new F1a(e);return eCf(t)}var xAf=yu(MAf(),1);async function iwe(e,t,r=[],{doNotPipeOutput:n=!1,secrets:i=[],substitutions:a={},...u}={}){var o,l;let f=i.reduce((g,O)=>({...g,[O]:"<redacted>"}),a),d=[t,...r].join(" ");for(let[g,O]of Object.entries(f))d=d.replaceAll(g,O);e==null||e.debug(`+ ${d}`);let c=(0,xAf.default)(t,r,u);return n||((o=c.stdout)==null||o.pipe(process.stdout),(l=c.stderr)==null||l.pipe(process.stderr)),c}function G1a(e,{logger:t,...r}={}){return(n,i)=>iwe(t,e,n,{...r,...i})}var Y1a=require("fs/promises"),TAf=yu($te(),1),Tk1="buf.gen.yaml",qAf="output",qk1=`${qAf}/openapi.yaml`,Ck1=`
|