fern-api 5.170.7 → 5.170.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.cjs +7 -7
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -97,7 +97,7 @@ ${r.indent}`:""}}`):a._push("}"),a.item=r,a.unvisit(t);return}if(l=n[i],(c==null
97
97
  ${p.indent}`:""}${qVa(l)}:${a.indent?" ":""}`;return s=!1,u=!0,a.objectItem=void 0,d}};this.item=p}_push(t){let r=(this.objectItem?this.objectItem.write():"")+t;return this.prePush&&r.length&&(this.buffer+=this.prePush,this.prePush=void 0),this.buffer+=r,this.buffer.length>=this.bufferSize?(this.pushCalled=!this.push(this.buffer),this.buffer="",this.bufferLength=0,!1):!0}async _read(t){if(this.readState===BV.Consumed)return;if(this.readState!==BV.Inactive){this.readState=BV.ReadMore;return}this.readState=BV.Reading,this.pushCalled=!1;let r;for(;!this.pushCalled&&this.item!==this.root&&this.buffer!==void 0;)r=this.item.read(t),r&&await r;if(this.buffer!==void 0){if(this.item===this.root){this.buffer.length&&this.push(this.buffer),this.push(null),this.readState=BV.Consumed,this.cleanup();return}if(this.readState===BV.ReadMore){this.readState=BV.Inactive,await this._read(t);return}this.readState=BV.Inactive}}cleanup(){this.readState=BV.Consumed,this.buffer=void 0,this.visited=void 0,this.item=void 0,this.root=void 0,this.prePush=void 0}destroy(t){var r;return t&&this.emit("error",t),(r=super.destroy)===null||r===void 0||r.call(this),this.cleanup(),this}}});async function Ux(e,t,{pretty:r=!1}={}){let n=new T$e(t,void 0,r?4:void 0);return new Promise((i,o)=>{n.pipe((0,HVa.createWriteStream)(e)).on("error",o).on("finish",i)})}var HVa,oHi=h(()=>{"use strict";HVa=require("fs");iHi()});var p5a=E((Kbb,yfe)=>{"use strict";var FA=require("fs"),u0r=require("os"),gw=require("path"),KVa=require("crypto"),$Z={fs:FA.constants,os:u0r.constants},JVa="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",$Va=/XXXXXX/,Ped=3,e5a=($Z.O_CREAT||$Z.fs.O_CREAT)|($Z.O_EXCL||$Z.fs.O_EXCL)|($Z.O_RDWR||$Z.fs.O_RDWR),Bed=u0r.platform()==="win32",Red=$Z.EBADF||$Z.os.errno.EBADF,Ded=$Z.ENOENT||$Z.os.errno.ENOENT,t5a=448,r5a=384,ked="exit",O$e=[],n5a=FA.rmdirSync.bind(FA),i5a=!1;function Fed(e,t){return FA.rm(e,{recursive:!0},t)}function o5a(e){return FA.rmSync(e,{recursive:!0})}function uHi(e,t){let r=P$e(e,t),n=r[0],i=r[1];Ged(n,function(o,s){if(o)return i(o);let a=s.tries;(function c(){try{let u=a5a(s);FA.stat(u,function(l){if(!l)return a-- >0?c():i(new Error("Could not get a unique tmp filename, max tries reached "+u));i(null,u)})}catch(u){i(u)}})()})}function lHi(e){let t=P$e(e),r=t[0],n=qed(r),i=n.tries;do{let o=a5a(n);try{FA.statSync(o)}catch{return o}}while(i-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function Ned(e,t){let r=P$e(e,t),n=r[0],i=r[1];uHi(n,function(s,a){if(s)return i(s);FA.open(a,e5a,n.mode||r5a,function(u,l){if(u)return i(u);if(n.discardDescriptor)return FA.close(l,function(d){return i(d,a,void 0,aHi(a,-1,n,!1))});{let p=n.discardDescriptor||n.detachDescriptor;i(null,a,l,aHi(a,p?-1:l,n,!1))}})})}function jed(e){let t=P$e(e),r=t[0],n=r.discardDescriptor||r.detachDescriptor,i=lHi(r),o=FA.openSync(i,e5a,r.mode||r5a);return r.discardDescriptor&&(FA.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:aHi(i,n?-1:o,r,!0)}}function zed(e,t){let r=P$e(e,t),n=r[0],i=r[1];uHi(n,function(s,a){if(s)return i(s);FA.mkdir(a,n.mode||t5a,function(u){if(u)return i(u);i(null,a,s5a(a,n,!1))})})}function Qed(e){let t=P$e(e),r=t[0],n=lHi(r);return FA.mkdirSync(n,r.mode||t5a),{name:n,removeCallback:s5a(n,r,!0)}}function Med(e,t){let r=function(n){if(n&&!cHi(n))return t(n);t()};0<=e[0]?FA.close(e[0],function(){FA.unlink(e[1],r)}):FA.unlink(e[1],r)}function Led(e){let t=null;try{0<=e[0]&&FA.closeSync(e[0])}catch(r){if(!Wed(r)&&!cHi(r))throw r}finally{try{FA.unlinkSync(e[1])}catch(r){cHi(r)||(t=r)}}if(t!==null)throw t}function aHi(e,t,r,n){let i=c0r(Led,[t,e],n),o=c0r(Med,[t,e],n,i);return r.keep||O$e.unshift(i),n?i:o}function s5a(e,t,r){let n=t.unsafeCleanup?Fed:FA.rmdir.bind(FA),i=t.unsafeCleanup?o5a:n5a,o=c0r(i,e,r),s=c0r(n,e,r,o);return t.keep||O$e.unshift(o),r?o:s}function c0r(e,t,r,n){let i=!1;return function o(s){if(!i){let a=n||o,c=O$e.indexOf(a);return c>=0&&O$e.splice(c,1),i=!0,r||e===n5a||e===o5a?e(t):e(t,s||function(){})}}}function _ed(){if(i5a)for(;O$e.length;)try{O$e[0]()}catch{}}function YVa(e){let t=[],r=null;try{r=KVa.randomBytes(e)}catch{r=KVa.pseudoRandomBytes(e)}for(let n=0;n<e;n++)t.push(JVa[r[n]%JVa.length]);return t.join("")}function tQ(e){return typeof e>"u"}function P$e(e,t){if(typeof e=="function")return[{},e];if(tQ(e))return[{},t];let r={};for(let n of Object.getOwnPropertyNames(e))r[n]=e[n];return[r,t]}function Ued(e,t,r){let n=gw.isAbsolute(e)?e:gw.join(t,e);FA.stat(n,function(i){i?FA.realpath(gw.dirname(n),function(o,s){if(o)return r(o);r(null,gw.join(s,gw.basename(n)))}):FA.realpath(n,r)})}function Ved(e,t){let r=gw.isAbsolute(e)?e:gw.join(t,e);try{return FA.statSync(r),FA.realpathSync(r)}catch{let i=FA.realpathSync(gw.dirname(r));return gw.join(i,gw.basename(r))}}function a5a(e){let t=e.tmpdir;if(!tQ(e.name))return gw.join(t,e.dir,e.name);if(!tQ(e.template))return gw.join(t,e.dir,e.template).replace($Va,YVa(6));let r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",YVa(12),e.postfix?"-"+e.postfix:""].join("");return gw.join(t,e.dir,r)}function sHi(e,t){if(typeof t!="string")throw new Error(`${e} option must be a string, got "${typeof t}".`);if(t.includes(".."))throw new Error("Relative value not allowed");return t}function c5a(e){if(!tQ(e.name)){let t=e.name;if(gw.isAbsolute(t))throw new Error(`name option must not contain an absolute path, found "${t}".`);let r=gw.basename(t);if(r===".."||r==="."||r!==t)throw new Error(`name option must not contain a path, found "${t}".`)}if(!tQ(e.template)){if(typeof e.template!="string")throw new Error(`template option must be a string, got "${typeof e.template}".`);if(!e.template.match($Va))throw new Error(`Invalid template, found "${e.template}".`)}if(!tQ(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);e.tries=tQ(e.name)?e.tries||Ped:1,e.keep=!!e.keep,e.detachDescriptor=!!e.detachDescriptor,e.discardDescriptor=!!e.discardDescriptor,e.unsafeCleanup=!!e.unsafeCleanup,e.prefix=tQ(e.prefix)?"":sHi("prefix",e.prefix),e.postfix=tQ(e.postfix)?"":sHi("postfix",e.postfix),e.template=tQ(e.template)?void 0:sHi("template",e.template)}function XVa(e,t,r,n){if(tQ(t))return n(null);Ued(t,r,function(i,o){if(i)return n(i);let s=gw.relative(r,o);if(s.startsWith("..")||gw.isAbsolute(s))return n(new Error(`${e} option must be relative to "${r}", found "${s}".`));n(null,s)})}function ZVa(e,t,r){if(tQ(t))return;let n=Ved(t,r),i=gw.relative(r,n);if(i.startsWith("..")||gw.isAbsolute(i))throw new Error(`${e} option must be relative to "${r}", found "${i}".`);return i}function Ged(e,t){Ked(e,function(r,n){if(r)return t(r);e.tmpdir=n;try{c5a(e,n)}catch(i){return t(i)}XVa("dir",e.dir,n,function(i,o){if(i)return t(i);e.dir=tQ(o)?"":o,XVa("template",e.template,n,function(s,a){if(s)return t(s);e.template=a,t(null,e)})})})}function qed(e){let t=e.tmpdir=l5a(e);c5a(e,t);let r=ZVa("dir",e.dir,t);return e.dir=tQ(r)?"":r,e.template=ZVa("template",e.template,t),e}function Wed(e){return u5a(e,-Red,"EBADF")}function cHi(e){return u5a(e,-Ded,"ENOENT")}function u5a(e,t,r){return Bed?e.code===r:e.code===r&&e.errno===t}function Hed(){i5a=!0}function Ked(e,t){return FA.realpath(e&&e.tmpdir||u0r.tmpdir(),t)}function l5a(e){return FA.realpathSync(e&&e.tmpdir||u0r.tmpdir())}process.addListener(ked,_ed);Object.defineProperty(yfe.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return l5a()}});yfe.exports.dir=zed;yfe.exports.dirSync=Qed;yfe.exports.file=Ned;yfe.exports.fileSync=jed;yfe.exports.tmpName=uHi;yfe.exports.tmpNameSync=lHi;yfe.exports.setGracefulCleanup=Hed});var aI=E((Jbb,k3)=>{"use strict";var{promisify:GMt}=require("util"),mIe=p5a();k3.exports.fileSync=mIe.fileSync;var Jed=GMt((e,t)=>mIe.file(e,(r,n,i,o)=>r?t(r):t(void 0,{path:n,fd:i,cleanup:GMt(o)})));k3.exports.file=async e=>Jed(e);k3.exports.withFile=async function(t,r){let{path:n,fd:i,cleanup:o}=await k3.exports.file(r);try{return await t({path:n,fd:i})}finally{await o()}};k3.exports.dirSync=mIe.dirSync;var Yed=GMt((e,t)=>mIe.dir(e,(r,n,i)=>r?t(r):t(void 0,{path:n,cleanup:GMt(i)})));k3.exports.dir=async e=>Yed(e);k3.exports.withDir=async function(t,r){let{path:n,cleanup:i}=await k3.exports.dir(r);try{return await t({path:n})}finally{await i()}};k3.exports.tmpNameSync=mIe.tmpNameSync;k3.exports.tmpName=GMt(mIe.tmpName);k3.exports.tmpdir=mIe.tmpdir;k3.exports.setGracefulCleanup=mIe.setGracefulCleanup});async function l0r(e,{pretty:t,onWrite:r}={}){let n=await d5a.default.file(),i=_t.of(n.path);return await Ux(i,e,{pretty:t}),r?.(i),(await(0,f5a.readFile)(n.path)).toString()}var f5a,d5a,m5a=h(()=>{"use strict";f5a=require("fs/promises"),d5a=Ae(aI(),1);Rbr();oHi()});async function h5a(e,t){let r=new AbortController;return Promise.race([g5a({filepath:e,controller:r}).then(()=>!0),ufe(t).then(()=>(r.abort(),!1))])}async function g5a({filepath:e,controller:t,delayMs:r=50}){if(!t.signal.aborted&&!await Ut(e))return await ufe(r),g5a({filepath:e,controller:t,delayMs:r*2})}var A5a=h(()=>{"use strict";Ct();kbr()});var y5a={};te(y5a,{AbsoluteFilePath:()=>_t,RelativeFilePath:()=>ye,basename:()=>L1,convertToFernHostAbsoluteFilePath:()=>cIe,convertToFernHostRelativeFilePath:()=>vMt,convertToOsPath:()=>mC,cwd:()=>Za,dirname:()=>un,doesPathExist:()=>Ut,doesPathExistSync:()=>KZ,getAllFilesInDirectory:()=>xMt,getAllFilesInDirectoryRelative:()=>uUa,getDirectoryContents:()=>Gy,getDirectoryContentsForSnapshot:()=>dUa,getFilename:()=>SV,isCI:()=>Qbr,isPathEmpty:()=>Dbr,isURL:()=>P2,join:()=>ke,listFiles:()=>G1,moveFile:()=>EVa,moveFolder:()=>PV,relative:()=>Io,relativize:()=>sI,resolve:()=>Yn,splitPath:()=>zbr,streamObjectFromFile:()=>a0r,streamObjectToFile:()=>Ux,stringifyLargeObject:()=>l0r,waitUntilPathExists:()=>h5a});var er=h(()=>{"use strict";Rbr();tUa();rUa();E7i();kbr();aUa();lUa();v7i();mUa();hUa();gUa();Fbr();yVa();IVa();CVa();uIe();aLe();SVa();TVa();PVa();C7i();GVa();oHi();m5a();A5a()});var b5a=h(()=>{"use strict"});var E5a=h(()=>{"use strict"});var I5a=h(()=>{"use strict"});var v5a=h(()=>{"use strict"});var C5a=h(()=>{"use strict"});var x5a=h(()=>{"use strict"});var S5a=h(()=>{"use strict"});var w5a=h(()=>{"use strict"});var T5a=h(()=>{"use strict"});var O5a=h(()=>{"use strict"});var P5a=h(()=>{"use strict"});var B5a=h(()=>{"use strict"});var R5a=h(()=>{"use strict"});var D5a=h(()=>{"use strict"});var k5a,F5a=h(()=>{"use strict";k5a={ApiKey:"api-key",RefreshToken:"refresh-token"}});var N5a=h(()=>{"use strict"});var j5a=h(()=>{"use strict"});var z5a=h(()=>{"use strict"});var Q5a=h(()=>{"use strict"});var M5a=h(()=>{"use strict"});var L5a,_5a=h(()=>{"use strict";L5a={ClientCredentials:"client-credentials",AuthorizationCode:"authorization-code",DeviceCode:"device-code"}});var U5a=h(()=>{"use strict"});var V5a=h(()=>{"use strict"});var G5a=h(()=>{"use strict"});var q5a=h(()=>{"use strict"});var W5a=h(()=>{"use strict"});var H5a=h(()=>{"use strict"});var K5a=h(()=>{"use strict"});var J5a=h(()=>{"use strict"});var Y5a=h(()=>{"use strict"});var X5a=h(()=>{"use strict"});var Z5a=h(()=>{"use strict"});var $5a=h(()=>{"use strict"});var pHi=h(()=>{"use strict";b5a();E5a();I5a();v5a();C5a();x5a();S5a();w5a();T5a();O5a();P5a();B5a();R5a();D5a();F5a();N5a();j5a();z5a();Q5a();M5a();_5a();U5a();V5a();G5a();q5a();W5a();H5a();K5a();J5a();Y5a();X5a();Z5a();$5a()});var fHi={};te(fHi,{InferredAuthTypeSchema:()=>k5a,OAuthFlowTypeSchema:()=>L5a});var e8a=h(()=>{"use strict";pHi()});var t8a=h(()=>{"use strict"});var r8a,n8a=h(()=>{"use strict";r8a={InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",GenerallyAvailable:"generally-available",Alpha:"alpha",Beta:"beta",Preview:"preview",Legacy:"legacy"}});var i8a=h(()=>{"use strict"});var dHi=h(()=>{"use strict";t8a();n8a();i8a()});var mHi={};te(mHi,{AvailabilityStatusSchema:()=>r8a});var o8a=h(()=>{"use strict";dHi()});var s8a=h(()=>{"use strict"});var a8a=h(()=>{"use strict"});var c8a=h(()=>{"use strict"});var u8a=h(()=>{"use strict"});var l8a=h(()=>{"use strict"});var p8a=h(()=>{"use strict"});var f8a=h(()=>{"use strict"});var d8a=h(()=>{"use strict"});var m8a=h(()=>{"use strict"});var h8a=h(()=>{"use strict"});var hHi=h(()=>{"use strict";s8a();a8a();c8a();u8a();l8a();p8a();f8a();d8a();m8a();h8a()});var g8a={};var A8a=h(()=>{"use strict";hHi()});var y8a=h(()=>{"use strict"});var b8a=h(()=>{"use strict"});var E8a=h(()=>{"use strict"});var gHi=h(()=>{"use strict";y8a();b8a();E8a()});var I8a={};var v8a=h(()=>{"use strict";gHi()});var C8a=h(()=>{"use strict"});var x8a=h(()=>{"use strict"});var S8a=h(()=>{"use strict"});var w8a=h(()=>{"use strict"});var T8a=h(()=>{"use strict"});var AHi=h(()=>{"use strict";C8a();x8a();S8a();w8a();T8a()});var O8a={};var P8a=h(()=>{"use strict";AHi()});var B8a=h(()=>{"use strict"});var R8a=h(()=>{"use strict"});var yHi=h(()=>{"use strict";B8a();R8a()});var D8a={};var k8a=h(()=>{"use strict";yHi()});var F8a=h(()=>{"use strict"});var N8a=h(()=>{"use strict"});var j8a=h(()=>{"use strict"});var z8a=h(()=>{"use strict"});var Q8a=h(()=>{"use strict"});var M8a=h(()=>{"use strict"});var L8a=h(()=>{"use strict"});var _8a=h(()=>{"use strict"});var U8a=h(()=>{"use strict"});var V8a=h(()=>{"use strict"});var G8a=h(()=>{"use strict"});var q8a=h(()=>{"use strict"});var W8a=h(()=>{"use strict"});var H8a=h(()=>{"use strict"});var K8a=h(()=>{"use strict"});var J8a=h(()=>{"use strict"});var Y8a,X8a=h(()=>{"use strict";Y8a={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",Csharp2:"c#"}});var bHi=h(()=>{"use strict";F8a();N8a();j8a();z8a();Q8a();M8a();L8a();_8a();U8a();V8a();G8a();q8a();W8a();H8a();K8a();J8a();X8a()});var EHi={};te(EHi,{SupportedSdkLanguageSchema:()=>Y8a});var Z8a=h(()=>{"use strict";bHi()});var $8a=h(()=>{"use strict"});var eGa=h(()=>{"use strict"});var tGa=h(()=>{"use strict"});var rGa=h(()=>{"use strict"});var nGa=h(()=>{"use strict"});var iGa=h(()=>{"use strict"});var oGa=h(()=>{"use strict"});var sGa=h(()=>{"use strict"});var aGa=h(()=>{"use strict"});var cGa=h(()=>{"use strict"});var IHi=h(()=>{"use strict";$8a();eGa();tGa();rGa();nGa();iGa();oGa();sGa();aGa();cGa()});var uGa={};var lGa=h(()=>{"use strict";IHi()});var pGa=h(()=>{"use strict"});var vHi=h(()=>{"use strict";pGa()});var fGa={};var dGa=h(()=>{"use strict";vHi()});var mGa=h(()=>{"use strict"});var hGa=h(()=>{"use strict"});var gGa=h(()=>{"use strict"});var AGa=h(()=>{"use strict"});var yGa=h(()=>{"use strict"});var bGa=h(()=>{"use strict"});var CHi=h(()=>{"use strict";mGa();hGa();gGa();AGa();yGa();bGa()});var EGa={};var IGa=h(()=>{"use strict";CHi()});var vGa=h(()=>{"use strict"});var CGa=h(()=>{"use strict"});var xGa=h(()=>{"use strict"});var SGa=h(()=>{"use strict"});var wGa=h(()=>{"use strict"});var xHi=h(()=>{"use strict";vGa();CGa();xGa();SGa();wGa()});var TGa={};var OGa=h(()=>{"use strict";xHi()});var PGa,BGa=h(()=>{"use strict";PGa={Json:"json",Exploded:"exploded",Form:"form"}});var RGa=h(()=>{"use strict"});var DGa=h(()=>{"use strict"});var kGa=h(()=>{"use strict"});var FGa=h(()=>{"use strict"});var NGa=h(()=>{"use strict"});var jGa=h(()=>{"use strict"});var zGa=h(()=>{"use strict"});var QGa=h(()=>{"use strict"});var MGa=h(()=>{"use strict"});var LGa,_Ga=h(()=>{"use strict";LGa={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD"}});var UGa=h(()=>{"use strict"});var VGa=h(()=>{"use strict"});var GGa=h(()=>{"use strict"});var qGa=h(()=>{"use strict"});var WGa=h(()=>{"use strict"});var HGa=h(()=>{"use strict"});var KGa=h(()=>{"use strict"});var JGa=h(()=>{"use strict"});var YGa=h(()=>{"use strict"});var XGa=h(()=>{"use strict"});var ZGa=h(()=>{"use strict"});var $Ga=h(()=>{"use strict"});var eqa=h(()=>{"use strict"});var tqa=h(()=>{"use strict"});var rqa=h(()=>{"use strict"});var nqa=h(()=>{"use strict"});var iqa=h(()=>{"use strict"});var oqa=h(()=>{"use strict"});var sqa=h(()=>{"use strict"});var aqa,cqa=h(()=>{"use strict";aqa={Sse:"sse",Json:"json"}});var uqa=h(()=>{"use strict"});var lqa=h(()=>{"use strict"});var SHi=h(()=>{"use strict";BGa();RGa();DGa();kGa();FGa();NGa();jGa();zGa();QGa();MGa();_Ga();UGa();VGa();GGa();qGa();WGa();HGa();KGa();JGa();YGa();XGa();ZGa();$Ga();eqa();tqa();rqa();nqa();iqa();oqa();sqa();cqa();uqa();lqa()});var wHi={};te(wHi,{FormDataBodyEncodingStyle:()=>PGa,HttpMethodSchema:()=>LGa,StreamFormat:()=>aqa});var pqa=h(()=>{"use strict";SHi()});var fqa=h(()=>{"use strict"});var dqa=h(()=>{"use strict"});var mqa=h(()=>{"use strict"});var THi=h(()=>{"use strict";fqa();dqa();mqa()});var hqa={};var gqa=h(()=>{"use strict";THi()});var Aqa=h(()=>{"use strict"});var yqa=h(()=>{"use strict"});var bqa=h(()=>{"use strict"});var Eqa=h(()=>{"use strict"});var Iqa=h(()=>{"use strict"});var vqa=h(()=>{"use strict"});var Cqa=h(()=>{"use strict"});var xqa=h(()=>{"use strict"});var Sqa=h(()=>{"use strict"});var wqa,Tqa=h(()=>{"use strict";wqa={ReadOnly:"read-only",WriteOnly:"write-only"}});var Oqa=h(()=>{"use strict"});var Pqa=h(()=>{"use strict"});var Bqa=h(()=>{"use strict"});var Rqa=h(()=>{"use strict"});var Dqa=h(()=>{"use strict"});var kqa=h(()=>{"use strict"});var Fqa=h(()=>{"use strict"});var Nqa=h(()=>{"use strict"});var jqa=h(()=>{"use strict"});var zqa=h(()=>{"use strict"});var Qqa=h(()=>{"use strict"});var Mqa=h(()=>{"use strict"});var Lqa=h(()=>{"use strict"});var _qa=h(()=>{"use strict"});var Uqa=h(()=>{"use strict"});var Vqa=h(()=>{"use strict"});var Gqa=h(()=>{"use strict"});var qqa,Wqa=h(()=>{"use strict";qqa={Data:"data",Protocol:"protocol"}});var OHi=h(()=>{"use strict";Aqa();yqa();bqa();Eqa();Iqa();vqa();Cqa();xqa();Sqa();Tqa();Oqa();Pqa();Bqa();Rqa();Dqa();kqa();Fqa();Nqa();jqa();zqa();Qqa();Mqa();Lqa();_qa();Uqa();Vqa();Gqa();Wqa()});var PHi={};te(PHi,{ObjectPropertyAccess:()=>wqa,UnionDiscriminatorContext:()=>qqa});var Hqa=h(()=>{"use strict";OHi()});var Kqa=h(()=>{"use strict"});var Jqa=h(()=>{"use strict"});var Yqa=h(()=>{"use strict"});var Xqa=h(()=>{"use strict"});var Zqa=h(()=>{"use strict"});var BHi=h(()=>{"use strict";Kqa();Jqa();Yqa();Xqa();Zqa()});var $qa={};var e9a=h(()=>{"use strict";BHi()});var t9a=h(()=>{"use strict"});var r9a=h(()=>{"use strict"});var n9a=h(()=>{"use strict"});var RHi=h(()=>{"use strict";t9a();r9a();n9a()});var i9a={};var o9a=h(()=>{"use strict";RHi()});var s9a=h(()=>{"use strict"});var a9a=h(()=>{"use strict"});var c9a=h(()=>{"use strict"});var u9a=h(()=>{"use strict"});var l9a=h(()=>{"use strict"});var DHi=h(()=>{"use strict";s9a();a9a();c9a();u9a();l9a()});var p9a={};var f9a=h(()=>{"use strict";DHi()});var d9a,m9a=h(()=>{"use strict";d9a={RsaSha256:"rsa-sha256",RsaSha384:"rsa-sha384",RsaSha512:"rsa-sha512",EcdsaSha256:"ecdsa-sha256",EcdsaSha384:"ecdsa-sha384",EcdsaSha512:"ecdsa-sha512",Ed25519:"ed25519"}});var h9a=h(()=>{"use strict"});var g9a=h(()=>{"use strict"});var A9a=h(()=>{"use strict"});var y9a,b9a=h(()=>{"use strict";y9a={Sha256:"sha256",Sha1:"sha1",Sha384:"sha384",Sha512:"sha512"}});var E9a=h(()=>{"use strict"});var I9a=h(()=>{"use strict"});var v9a=h(()=>{"use strict"});var C9a=h(()=>{"use strict"});var x9a,S9a=h(()=>{"use strict";x9a={Post:"POST",Get:"GET"}});var w9a,T9a=h(()=>{"use strict";w9a={Alphabetical:"alphabetical"}});var O9a,P9a=h(()=>{"use strict";O9a={Body:"body",Timestamp:"timestamp",NotificationUrl:"notification-url",MessageId:"message-id"}});var B9a=h(()=>{"use strict"});var R9a=h(()=>{"use strict"});var D9a=h(()=>{"use strict"});var k9a=h(()=>{"use strict"});var F9a,N9a=h(()=>{"use strict";F9a={Sha256:"sha256",Sha1:"sha1",Sha384:"sha384",Sha512:"sha512"}});var j9a,z9a=h(()=>{"use strict";j9a={Base64:"base64",Hex:"hex"}});var Q9a=h(()=>{"use strict"});var M9a,L9a=h(()=>{"use strict";M9a={UnixSeconds:"unix-seconds",UnixMillis:"unix-millis",Iso8601:"iso8601"}});var _9a=h(()=>{"use strict"});var U9a=h(()=>{"use strict"});var kHi=h(()=>{"use strict";m9a();h9a();g9a();A9a();b9a();E9a();I9a();v9a();C9a();S9a();T9a();P9a();B9a();R9a();D9a();k9a();N9a();z9a();Q9a();L9a();_9a();U9a()});var FHi={};te(FHi,{AsymmetricAlgorithmSchema:()=>d9a,WebhookBodyHashAlgorithmSchema:()=>y9a,WebhookMethodSchema:()=>x9a,WebhookPayloadBodySortSchema:()=>w9a,WebhookPayloadComponentSchema:()=>O9a,WebhookSignatureAlgorithmSchema:()=>F9a,WebhookSignatureEncodingSchema:()=>j9a,WebhookTimestampFormatSchema:()=>M9a});var V9a=h(()=>{"use strict";kHi()});var G9a=h(()=>{"use strict"});var q9a=h(()=>{"use strict"});var W9a=h(()=>{"use strict"});var H9a=h(()=>{"use strict"});var K9a=h(()=>{"use strict"});var J9a,Y9a=h(()=>{"use strict";J9a={Client:"client",Server:"server"}});var NHi=h(()=>{"use strict";G9a();q9a();W9a();H9a();K9a();Y9a()});var jHi={};te(jHi,{WebSocketOrigin:()=>J9a});var X9a=h(()=>{"use strict";NHi()});var Z9a=h(()=>{"use strict";e8a();pHi();o8a();dHi();A8a();hHi();v8a();gHi();P8a();AHi();k8a();yHi();Z8a();bHi();lGa();IHi();dGa();vHi();IGa();CHi();OGa();xHi();pqa();SHi();gqa();THi();Hqa();OHi();e9a();BHi();o9a();RHi();f9a();DHi();V9a();kHi();X9a();NHi()});var $9a=h(()=>{"use strict";Z9a()});var eWa,tWa=h(()=>{"use strict";eWa=(e,t,r)=>JSON.stringify(e,t,r)});var Ife,rWa,zHi,QHi,Oxb,nWa=h(()=>{"use strict";Ife={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},rWa={[Ife.Debug]:1,[Ife.Info]:2,[Ife.Warn]:3,[Ife.Error]:4},zHi=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},QHi=class{level;logger;silent;constructor(t){this.level=rWa[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=rWa[t]}isDebug(){return this.shouldLog(Ife.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(Ife.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(Ife.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(Ife.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},Oxb=new QHi({level:Ife.Info,logger:new zHi,silent:!0})});var iWa=h(()=>{"use strict"});var oWa=h(()=>{"use strict";nWa()});var sWa=h(()=>{"use strict"});var ol,Aw=h(()=>{"use strict";ol={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function Em(e,t){return`Expected ${t}. Received ${Zed(e)}.`}function Zed(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}var D2=h(()=>{"use strict"});function H1(e){return{...e,json:aWa(e.json),parse:aWa(e.parse)}}function aWa(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
98
98
  `)),{ok:!0,value:t}):n}}var e$=h(()=>{"use strict"});function p0r(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var MHi=h(()=>{"use strict"});var R$e,LHi=h(()=>{"use strict";MHi();R$e=class e extends Error{errors;constructor(t){super(t.map(p0r).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}}});var D$e,_Hi=h(()=>{"use strict";MHi();D$e=class e extends Error{errors;constructor(t){super(t.map(p0r).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}}});function ph(e){return{nullable:()=>$ed(e),optional:()=>UHi(e),optionalNullable:()=>etd(e),transform:t=>VHi(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new D$e(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new R$e(n.errors)}}}function $ed(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>ol.NULLABLE};return{...t,...ph(t)}}function UHi(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>ol.OPTIONAL};return{...t,...ph(t)}}function etd(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>ol.OPTIONAL_NULLABLE};return{...t,...ph(t)}}function VHi(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...ph(r)}}var cWa=h(()=>{"use strict";Aw();LHi();_Hi()});var rQ=h(()=>{"use strict";cWa();LHi();_Hi()});function uWa(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:Em(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:Em(t,"bigint")}]}:{ok:!0,value:t},getType:()=>ol.BIGINT};return{...H1(e),...ph(e)}}var lWa=h(()=>{"use strict";Aw();D2();e$();rQ()});var pWa=h(()=>{"use strict";lWa()});function fWa(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Em(t,"string")}]}:ttd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:Em(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:Em(t,"Date object")}]},getType:()=>ol.DATE};return{...H1(e),...ph(e)}}var ttd,dWa=h(()=>{"use strict";Aw();D2();e$();rQ();ttd=/^([+-]?\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)?)?)?)?$/});var mWa=h(()=>{"use strict";dWa()});function K1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...H1(r),...ph(r)}}}var t$=h(()=>{"use strict";rQ();e$()});function f0r(e){let t=new Set(e);return K1(ol.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:Em(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:Em(n,"enum")}]}:{ok:!0,value:n})()}var hWa=h(()=>{"use strict";Aw();t$();D2()});var GHi=h(()=>{"use strict";hWa()});function gWa(e){let t=qHi(e);return{...t,...ph(t)}}function qHi(e){return{parse:(t,r)=>k$e(e).parse(t,r),json:(t,r)=>k$e(e).json(t,r),getType:()=>k$e(e).getType()}}function k$e(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var WHi=h(()=>{"use strict";rQ()});function HHi(e){return Object.entries(e)}var AWa=h(()=>{"use strict"});function qMt(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var KHi=h(()=>{"use strict"});function vfe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var WMt=h(()=>{"use strict"});function HMt(e){return Object.keys(e)}var JHi=h(()=>{"use strict"});function yWa(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var bWa=h(()=>{"use strict"});function OH(e){return{withParsedProperties:t=>YHi(e,t)}}function YHi(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(rtd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!vfe(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:Em(n,"object")}]};let o=new Set(Object.keys(t)),s=qMt(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...ph(r),...OH(r)}}var rtd,EWa=h(()=>{"use strict";KHi();D2();WMt();rQ();rtd=Object.prototype.hasOwnProperty});var KMt=h(()=>{"use strict";EWa()});function IWa(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Cfe(e){return e.isProperty}var XHi=h(()=>{"use strict"});function d0r(e){let t;function r(){if(t==null){t={};for(let[d,f]of HHi(e)){let m=Cfe(f)?f.rawKey:d,g=Cfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of HHi(e)){let m=Cfe(f)?f.rawKey:d,g=Cfe(f)?f.valueSchema:f;itd(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function u(){return o==null&&a(),o}function l(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>Cfe(f)?f.rawKey:d),_getParsedProperties:()=>HMt(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return vWa({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return vWa({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:g=>{let A=e[g];if(A!=null)return Cfe(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>ol.OBJECT};return{...H1(p),...ph(p),...OH(p),...fLe(p)}}function vWa({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!vfe(e))return{ok:!1,errors:[{path:s,message:Em(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!ntd.call(e,l))continue;let p=e[l],d=n(l);if(d!=null){a>0&&r.has(l)&&a--;let f=d.transform(p);f.ok?u[d.transformedKey]=f.value:(u[l]=p,c.push(...f.errors))}else switch(i){case"fail":c.push({path:[...s,l],message:`Unexpected key "${l}"`});break;case"strip":break;case"passthrough":u[l]=p;break}}if(a>0)for(let l of t)l in e||c.push({path:s,message:`Missing required key "${l}"`});return c.length===0||o?{ok:!0,value:u}:{ok:!1,errors:c}}function fLe(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>CWa({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>CWa({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>ol.OBJECT};return{...r,...ph(r),...OH(r),...fLe(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))t.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))r.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},getType:()=>ol.OBJECT};return{...n,...ph(n),...OH(n),...fLe(n)}}}}function CWa({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!vfe(t))return{ok:!1,errors:[{path:i,message:Em(t,"object")}]};let o=new Set(e),[s,a]=yWa(HMt(t),l=>o.has(l)),c=r(qMt(t,a)),u=n(qMt(t,s));return c.ok&&u.ok?{ok:!0,value:{...c.value,...u.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function itd(e){return!otd(e)}function otd(e){switch(e.getType()){case ol.ANY:case ol.UNKNOWN:case ol.OPTIONAL:case ol.OPTIONAL_NULLABLE:return!0;default:return!1}}var ntd,ZHi=h(()=>{"use strict";Aw();AWa();KHi();D2();WMt();JHi();e$();bWa();KMt();rQ();XHi();ntd=Object.prototype.hasOwnProperty});function xWa(e){return d0r(e)}var SWa=h(()=>{"use strict";ZHi()});var $Hi=h(()=>{"use strict";ZHi();SWa();XHi()});function wWa(e){let t={...qHi(e),_getRawProperties:()=>k$e(e)._getRawProperties(),_getParsedProperties:()=>k$e(e)._getParsedProperties()};return{...t,...ph(t),...OH(t),...fLe(t)}}var TWa=h(()=>{"use strict";$Hi();KMt();rQ();WHi()});var OWa=h(()=>{"use strict";WHi();TWa()});function m0r(e){let t={parse:(r,n)=>PWa(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>PWa(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>ol.LIST};return{...H1(t),...ph(t)}}function PWa(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:Em(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);o.ok?r.push(o.value):n.push(...o.errors)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var BWa=h(()=>{"use strict";Aw();D2();e$();rQ()});var eKi=h(()=>{"use strict";BWa()});function RWa(e){return K1(ol.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Em(r,`${e.toString()}`)}]})()}var DWa=h(()=>{"use strict";Aw();t$();D2()});function kWa(e){return K1(ol.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Em(r,`"${e}"`)}]})()}var FWa=h(()=>{"use strict";Aw();t$();D2()});var NWa=h(()=>{"use strict";DWa();FWa()});var jWa,zWa=h(()=>{"use strict";Aw();t$();jWa=K1(ol.ANY,e=>({ok:!0,value:e}))});var QWa,MWa=h(()=>{"use strict";Aw();t$();D2();QWa=K1(ol.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Em(e,"boolean")}]})});var LWa,_Wa=h(()=>{"use strict";Aw();t$();LWa=K1(ol.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var UWa,VWa=h(()=>{"use strict";Aw();t$();D2();UWa=K1(ol.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Em(e,"number")}]})});var GWa,qWa=h(()=>{"use strict";Aw();t$();D2();GWa=K1(ol.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Em(e,"string")}]})});var WWa,HWa=h(()=>{"use strict";Aw();t$();WWa=K1(ol.UNKNOWN,e=>({ok:!0,value:e}))});var KWa=h(()=>{"use strict";zWa();MWa();_Wa();VWa();qWa();HWa()});function YWa(e,t){let r={parse:(n,i)=>JWa({value:n,isKeyNumeric:e.getType()===ol.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>JWa({value:n,isKeyNumeric:e.getType()===ol.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>ol.RECORD};return{...H1(r),...ph(r)}}function JWa({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!vfe(e))return{ok:!1,errors:[{path:i,message:Em(e,"object")}]};let o={},s=[];for(let a in e){if(!std.call(e,a))continue;let c=e[a];if(c===void 0)continue;let u=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(u=d)}let l=r(u),p=n(c,u);l.ok&&p.ok?o[l.value]=p.value:(l.ok||s.push(...l.errors),p.ok||s.push(...p.errors))}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var std,XWa=h(()=>{"use strict";Aw();D2();WMt();e$();rQ();std=Object.prototype.hasOwnProperty});var ZWa=h(()=>{"use strict";XWa()});function $Wa(e){let t=m0r(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:Em(n,"Set")}]},getType:()=>ol.SET};return{...H1(r),...ph(r)}}var e7a=h(()=>{"use strict";Aw();D2();e$();eKi();rQ()});var t7a=h(()=>{"use strict";e7a()});function n7a(e){let t={parse:(r,n)=>r7a((i,o)=>i.parse(r,o),e,n),json:(r,n)=>r7a((i,o)=>i.json(r,o),e,n),getType:()=>ol.UNDISCRIMINATED_UNION};return{...H1(t),...ph(t)}}function r7a(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var i7a=h(()=>{"use strict";Aw();e$();rQ()});var o7a=h(()=>{"use strict";i7a()});function s7a(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var a7a=h(()=>{"use strict"});function u7a(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=f0r(HMt(t)),o={parse:(s,a)=>c7a({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>c7a({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>ol.UNION};return{...H1(o),...ph(o),...OH(o)}}function c7a({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!vfe(e))return{ok:!1,errors:[{path:a,message:Em(e,"object")}]};let c=e[t],u={};for(let f in e)atd.call(e,f)&&f!==t&&(u[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let l=n(c);if(!l.ok)return{ok:!1,errors:l.errors};let p=i(l.value);if(p==null)return o?{ok:!0,value:{[r]:l.value,...u}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(u,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var atd,l7a=h(()=>{"use strict";Aw();D2();WMt();JHi();e$();GHi();KMt();rQ();atd=Object.prototype.hasOwnProperty});var p7a=h(()=>{"use strict";a7a();l7a()});var f7a=h(()=>{"use strict";pWa();mWa();GHi();OWa();eKi();NWa();$Hi();KMt();KWa();ZWa();rQ();t7a();o7a();p7a()});var le={};te(le,{JsonError:()=>R$e,ParseError:()=>D$e,any:()=>jWa,bigint:()=>uWa,boolean:()=>QWa,booleanLiteral:()=>RWa,date:()=>fWa,discriminant:()=>s7a,enum_:()=>f0r,getObjectLikeUtils:()=>OH,getObjectUtils:()=>fLe,getSchemaUtils:()=>ph,isProperty:()=>Cfe,lazy:()=>gWa,lazyObject:()=>wWa,list:()=>m0r,never:()=>LWa,number:()=>UWa,object:()=>d0r,objectWithoutOptionalProperties:()=>xWa,optional:()=>UHi,property:()=>IWa,record:()=>YWa,set:()=>$Wa,string:()=>GWa,stringLiteral:()=>kWa,transform:()=>VHi,undiscriminatedUnion:()=>n7a,union:()=>u7a,unknown:()=>WWa,withParsedProperties:()=>YHi});var d7a=h(()=>{"use strict";f7a()});var m7a=h(()=>{"use strict"});var hr=h(()=>{"use strict";iWa();oWa();sWa();d7a();m7a()});var vo,Xp=h(()=>{"use strict";hr();vo=le.object({docs:le.string().optional()})});var F$e,h0r=h(()=>{"use strict";hr();Xp();F$e=le.object({scheme:le.string()}).extend(vo)});var g0r,tKi=h(()=>{"use strict";hr();h0r();g0r=le.undiscriminatedUnion([le.string(),F$e])});var A0r,rKi=h(()=>{"use strict";hr();Xp();tKi();A0r=le.object({any:le.list(g0r)}).extend(vo)});var y0r,nKi=h(()=>{"use strict";hr();y0r=le.object({})});var b0r,iKi=h(()=>{"use strict";hr();Xp();nKi();b0r=le.object({"endpoint-security":y0r}).extend(vo)});var E0r,oKi=h(()=>{"use strict";hr();rKi();h0r();iKi();E0r=le.undiscriminatedUnion([le.string(),F$e,A0r,b0r])});var Tf,Vx=h(()=>{"use strict";hr();Tf=le.object({name:le.string().optional()})});var N$e,I0r=h(()=>{"use strict";hr();N$e=le.object({env:le.string().optional()})});var dLe,v0r=h(()=>{"use strict";hr();Vx();I0r();dLe=le.object({omit:le.boolean().optional(),placeholder:le.string().optional()}).extend(N$e).extend(Tf)});var RV,mLe=h(()=>{"use strict";hr();RV=le.object({"playground-docs":le.string().optional()})});var C0r,sKi=h(()=>{"use strict";hr();Xp();v0r();mLe();C0r=le.object({scheme:le.stringLiteral("basic"),username:dLe.optional(),password:dLe.optional()}).extend(vo).extend(RV)});var x0r,aKi=h(()=>{"use strict";hr();x0r=le.enum_(["api-key","refresh-token"])});var S0r,cKi=h(()=>{"use strict";hr();S0r=le.object({"response-property":le.string(),"header-name":le.string(),"value-prefix":le.string().optional()})});var w0r,uKi=h(()=>{"use strict";hr();cKi();w0r=le.object({endpoint:le.string(),"expiry-response-property":le.string().optional(),"authenticated-request-headers":le.list(S0r).optional()})});var T0r,lKi=h(()=>{"use strict";hr();uKi();T0r=le.undiscriminatedUnion([le.string(),w0r])});var O0r,pKi=h(()=>{"use strict";hr();Xp();aKi();lKi();mLe();O0r=le.object({scheme:le.stringLiteral("bearer"),"get-token":T0r,type:x0r.optional()}).extend(vo).extend(RV)});var P0r,fKi=h(()=>{"use strict";hr();Xp();v0r();mLe();P0r=le.object({scheme:le.stringLiteral("bearer"),token:dLe.optional()}).extend(vo).extend(RV)});var B0r,dKi=h(()=>{"use strict";hr();pKi();fKi();B0r=le.undiscriminatedUnion([P0r,O0r])});var R0r,mKi=h(()=>{"use strict";hr();Xp();Vx();I0r();mLe();R0r=le.object({header:le.string(),type:le.string().optional(),prefix:le.string().optional(),placeholder:le.string().optional()}).extend(N$e).extend(Tf).extend(vo).extend(RV)});var j$e,D0r=h(()=>{"use strict";hr();j$e=le.string()});var k0r,hKi=h(()=>{"use strict";hr();k0r=le.enum_(["client-credentials","authorization-code","device-code"])});var F0r,gKi=h(()=>{"use strict";hr();F0r=le.object({"client-id":le.string().optional(),"client-secret":le.string().optional(),scopes:le.string().optional()})});var N0r,AKi=h(()=>{"use strict";hr();N0r=le.object({"access-token":le.string().optional(),"expires-in":le.string().optional(),"refresh-token":le.string().optional()})});var j0r,yKi=h(()=>{"use strict";hr();gKi();AKi();j0r=le.object({endpoint:le.string(),"request-properties":F0r.optional(),"response-properties":N0r.optional()})});var z0r,bKi=h(()=>{"use strict";hr();z0r=le.object({method:le.string().optional()})});var Q0r,EKi=h(()=>{"use strict";hr();Q0r=le.object({"refresh-token":le.string()})});var M0r,IKi=h(()=>{"use strict";hr();M0r=le.object({"access-token":le.string().optional(),"expires-in":le.string().optional(),"refresh-token":le.string().optional()})});var L0r,vKi=h(()=>{"use strict";hr();EKi();IKi();L0r=le.object({endpoint:le.string(),"request-properties":Q0r.optional(),"response-properties":M0r.optional()})});var _0r,CKi=h(()=>{"use strict";hr();_0r=le.object({url:le.string(),ports:le.list(le.number()).optional()})});var U0r,xKi=h(()=>{"use strict";hr();CKi();U0r=le.undiscriminatedUnion([le.string(),_0r])});var V0r,SKi=h(()=>{"use strict";hr();Xp();D0r();hKi();yKi();bKi();vKi();xKi();mLe();V0r=le.object({scheme:le.stringLiteral("oauth"),type:k0r,scopes:le.list(j$e).optional(),"token-prefix":le.string().optional(),"token-header":le.string().optional(),"client-id-env":le.string().optional(),"client-secret-env":le.string().optional(),"get-token":j0r.optional(),"refresh-token":L0r.optional(),"client-id":le.string().optional(),"authorization-url":le.string().optional(),"device-authorization-url":le.string().optional(),"token-url":le.string().optional(),"refresh-url":le.string().optional(),"redirect-uri":U0r.optional(),"success-redirect-url":le.string().optional(),"error-redirect-url":le.string().optional(),pkce:z0r.optional(),"authorization-parameters":le.record(le.string(),le.string()).optional(),"device-authorization-parameters":le.record(le.string(),le.string()).optional(),"token-parameters":le.record(le.string(),le.string()).optional(),"refresh-parameters":le.record(le.string(),le.string()).optional()}).extend(vo).extend(RV)});var G0r,wKi=h(()=>{"use strict";hr();sKi();dKi();mKi();SKi();G0r=le.undiscriminatedUnion([V0r,R0r,C0r,B0r])});var z$e,q0r=h(()=>{"use strict";hr();z$e=le.string()});var W0r,TKi=h(()=>{"use strict";hr();oKi();wKi();q0r();W0r=le.object({auth:E0r.optional(),"auth-schemes":le.record(z$e,G0r).optional()})});var OKi=h(()=>{"use strict";tKi();rKi();oKi();wKi();q0r();h0r();D0r();v0r();sKi();dKi();iKi();nKi();mKi();cKi();aKi();pKi();lKi();uKi();gKi();AKi();hKi();yKi();bKi();vKi();EKi();IKi();SKi();xKi();CKi();fKi();TKi();I0r();mLe()});var PKi={};te(PKi,{AnyAuthItem:()=>g0r,AnyAuthSchemesSchema:()=>A0r,ApiAuthSchema:()=>E0r,AuthSchemeDeclarationSchema:()=>G0r,AuthSchemeKey:()=>z$e,AuthSchemeReferenceSchema:()=>F$e,AuthScope:()=>j$e,AuthVariable:()=>dLe,BasicAuthSchemeSchema:()=>C0r,BearerAuthSchemeSchema:()=>B0r,EndpointSecuritySchema:()=>b0r,EndpointSecuritySchemaDetails:()=>y0r,HeaderAuthSchemeSchema:()=>R0r,InferredAuthTypeSchema:()=>x0r,InferredAuthenticatedRequestHeader:()=>S0r,InferredBearerAuthSchema:()=>O0r,InferredGetTokenEndpointSchema:()=>T0r,InferredGetTokenEndpointSchemaObject:()=>w0r,OAuthAccessTokenRequestPropertiesSchema:()=>F0r,OAuthAccessTokenResponsePropertiesSchema:()=>N0r,OAuthFlowTypeSchema:()=>k0r,OAuthGetTokenEndpointSchema:()=>j0r,OAuthPkceSchema:()=>z0r,OAuthRefreshTokenEndpointSchema:()=>L0r,OAuthRefreshTokenRequestPropertiesSchema:()=>Q0r,OAuthRefreshTokenResponsePropertiesSchema:()=>M0r,OAuthSchemeSchema:()=>V0r,RedirectUriSchema:()=>U0r,RedirectUriWithBackupPortsSchema:()=>_0r,TokenBearerAuthSchema:()=>P0r,WithAuthSchema:()=>W0r,WithEnvironmentVariable:()=>N$e,WithPlaygroundDocsSchema:()=>RV});var h7a=h(()=>{"use strict";OKi()});var Q$e,H0r=h(()=>{"use strict";hr();Q$e=le.enum_(["in-development","pre-release","deprecated","generally-available","alpha","beta","preview","legacy"])});var K0r,BKi=h(()=>{"use strict";hr();H0r();K0r=le.object({status:Q$e,message:le.string().optional()})});var J0r,RKi=h(()=>{"use strict";hr();BKi();H0r();J0r=le.undiscriminatedUnion([Q$e,K0r])});var DKi=h(()=>{"use strict";BKi();H0r();RKi()});var kKi={};te(kKi,{AvailabilitySchema:()=>K0r,AvailabilityStatusSchema:()=>Q$e,AvailabilityUnionSchema:()=>J0r});var g7a=h(()=>{"use strict";DKi()});var J1,r$=h(()=>{"use strict";hr();J1=le.object({audiences:le.list(le.string()).optional()})});var oD,xfe=h(()=>{"use strict";hr();RKi();oD=le.object({availability:J0r.optional()})});var n$,M$e=h(()=>{"use strict";hr();r$();xfe();Xp();n$=le.object({}).extend(vo).extend(oD).extend(J1)});var A7a,y7a=h(()=>{"use strict";hr();M$e();Vx();A7a=le.object({}).extend(n$).extend(Tf)});var Y0r,FKi=h(()=>{"use strict";hr();r$();xfe();Y0r=le.object({}).extend(oD).extend(J1)});var Y1,i$=h(()=>{"use strict";hr();Y1=le.object({"display-name":le.string().optional()})});var X0r,NKi=h(()=>{"use strict";hr();X0r=le.object({"method-name":le.string().optional()})});var Z0r,jKi=h(()=>{"use strict";hr();Z0r=le.object({minItems:le.number().optional(),maxItems:le.number().optional()})});var $0r,zKi=h(()=>{"use strict";hr();$0r=le.object({minProperties:le.number().optional(),maxProperties:le.number().optional()})});var eEr,QKi=h(()=>{"use strict";hr();eEr=le.object({min:le.number().optional(),max:le.number().optional(),exclusiveMin:le.boolean().optional(),exclusiveMax:le.boolean().optional(),multipleOf:le.number().optional()})});var tEr,MKi=h(()=>{"use strict";hr();tEr=le.object({minLength:le.number().optional(),maxLength:le.number().optional(),pattern:le.string().optional(),format:le.string().optional()})});var hIe,JMt=h(()=>{"use strict";hr();jKi();zKi();QKi();MKi();hIe=le.undiscriminatedUnion([tEr,eEr,Z0r,$0r])});var L$e,rEr=h(()=>{"use strict";hr();JMt();L$e=le.object({validation:hIe.optional()})});var LKi=h(()=>{"use strict";M$e();y7a();FKi();r$();xfe();i$();Xp();NKi();Vx();rEr()});var _Ki={};te(_Ki,{DeclarationSchema:()=>n$,DeclarationWithNameSchema:()=>A7a,DeclarationWithoutDocsSchema:()=>Y0r,WithAudiences:()=>J1,WithAvailability:()=>oD,WithDisplayName:()=>Y1,WithDocsSchema:()=>vo,WithMethodName:()=>X0r,WithName:()=>Tf,WithValidation:()=>L$e});var b7a=h(()=>{"use strict";LKi()});var nEr,UKi=h(()=>{"use strict";hr();nEr=le.object({type:le.string()})});var iEr,VKi=h(()=>{"use strict";hr();iEr=le.object({name:le.string().optional(),namespace:le.string().optional(),prefix:le.string().optional(),attribute:le.boolean().optional(),text:le.boolean().optional(),wrapped:le.boolean().optional(),separator:le.string().optional()})});var _$e,oEr=h(()=>{"use strict";hr();UKi();VKi();_$e=le.object({proto:nEr.optional(),xml:iEr.optional()})});var GKi=h(()=>{"use strict";oEr();UKi();VKi()});var qKi={};te(qKi,{EncodingSchema:()=>_$e,ProtobufTypeSchema:()=>nEr,XmlEncodingSchema:()=>iEr});var E7a=h(()=>{"use strict";GKi()});var U$e,sEr=h(()=>{"use strict";hr();U$e=le.object({id:le.string(),default:le.string().optional(),values:le.list(le.string()).optional()})});var aEr,WKi=h(()=>{"use strict";hr();r$();Xp();sEr();aEr=le.object({urls:le.record(le.string(),le.string()),"url-templates":le.record(le.string(),le.string()).optional(),"default-urls":le.record(le.string(),le.string()).optional(),variables:le.record(le.string(),le.list(U$e)).optional()}).extend(J1).extend(vo)});var cEr,HKi=h(()=>{"use strict";hr();r$();Xp();sEr();cEr=le.object({url:le.string(),"default-url":le.string().optional(),"url-template":le.string().optional(),variables:le.list(U$e).optional()}).extend(J1).extend(vo)});var uEr,KKi=h(()=>{"use strict";hr();WKi();HKi();uEr=le.undiscriminatedUnion([le.string(),cEr,aEr])});var lEr,JKi=h(()=>{"use strict";hr();KKi();lEr=le.object({"default-url":le.string().optional(),"default-environment":le.string().optional(),"base-url-env":le.string().optional(),environments:le.record(le.string(),uEr).optional()})});var YKi=h(()=>{"use strict";KKi();WKi();sEr();HKi();JKi()});var XKi={};te(XKi,{EnvironmentSchema:()=>uEr,MultipleBaseUrlsEnvironmentSchema:()=>aEr,ServerVariableSchema:()=>U$e,SingleBaseUrlEnvironmentSchema:()=>cEr,WithEnvironmentsSchema:()=>lEr});var I7a=h(()=>{"use strict";YKi()});var pEr,ZKi=h(()=>{"use strict";hr();pEr=le.unknown()});var V$e,fEr=h(()=>{"use strict";hr();Xp();Vx();ZKi();V$e=le.object({value:pEr}).extend(Tf).extend(vo)});var dEr,$Ki=h(()=>{"use strict";hr();dEr=le.undiscriminatedUnion([le.number(),le.string()])});var mEr,eJi=h(()=>{"use strict";hr();Xp();fEr();$Ki();mEr=le.object({"status-code":dEr,type:le.string().optional(),examples:le.list(V$e).optional()}).extend(vo)});var tJi=h(()=>{"use strict";eJi();$Ki()});var rJi={};te(rJi,{ErrorDeclarationSchema:()=>mEr,ErrorStatusCodeSchema:()=>dEr});var v7a=h(()=>{"use strict";tJi()});var yw,gIe=h(()=>{"use strict";hr();yw=le.unknown()});var hEr,nJi=h(()=>{"use strict";hr();gIe();hEr=le.object({error:le.string().optional(),body:yw.optional()})});var gEr,iJi=h(()=>{"use strict";hr();Xp();Vx();gEr=le.object({language:le.string(),code:le.string(),install:le.string().optional()}).extend(vo).extend(Tf)});var AEr,oJi=h(()=>{"use strict";hr();AEr=le.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","dotnet","jvm","c#"])});var yEr,sJi=h(()=>{"use strict";hr();Xp();Vx();oJi();yEr=le.object({sdk:AEr,code:le.string()}).extend(vo).extend(Tf)});var bEr,aJi=h(()=>{"use strict";hr();iJi();sJi();bEr=le.undiscriminatedUnion([yEr,gEr])});var EEr,cJi=h(()=>{"use strict";hr();gIe();EEr=le.object({event:le.string(),data:yw.optional()})});var IEr,uJi=h(()=>{"use strict";hr();cJi();IEr=le.object({stream:le.list(EEr)})});var vEr,lJi=h(()=>{"use strict";hr();gIe();vEr=le.object({stream:le.list(yw)})});var CEr,pJi=h(()=>{"use strict";hr();nJi();uJi();lJi();CEr=le.undiscriminatedUnion([hEr,vEr,IEr])});var G$e,xEr=h(()=>{"use strict";hr();Xp();Vx();aJi();pJi();gIe();G$e=le.object({id:le.string().optional(),"path-parameters":le.record(le.string(),yw).optional(),"query-parameters":le.record(le.string(),yw).optional(),headers:le.record(le.string(),yw).optional(),request:yw.optional(),response:CEr.optional(),"code-samples":le.list(bEr).optional()}).extend(Tf).extend(vo)});var C7a,x7a=h(()=>{"use strict";hr();xEr();C7a=le.list(G$e)});var SEr,fJi=h(()=>{"use strict";hr();Xp();Vx();gIe();SEr=le.object({id:le.string().optional(),payload:yw}).extend(Tf).extend(vo)});var wEr,dJi=h(()=>{"use strict";hr();wEr=le.object({type:le.string(),body:le.unknown()})});var TEr,mJi=h(()=>{"use strict";hr();Xp();Vx();gIe();dJi();TEr=le.object({"path-parameters":le.record(le.string(),yw).optional(),"query-parameters":le.record(le.string(),yw).optional(),headers:le.record(le.string(),yw).optional(),messages:le.list(wEr)}).extend(Tf).extend(vo)});var hJi=h(()=>{"use strict";nJi();aJi();iJi();sJi();x7a();xEr();pJi();cJi();uJi();lJi();gIe();fEr();ZKi();fJi();dJi();mJi();oJi()});var gJi={};te(gJi,{ExampleBodyResponseSchema:()=>hEr,ExampleCodeSampleSchema:()=>bEr,ExampleCodeSampleSchemaLanguage:()=>gEr,ExampleCodeSampleSchemaSdk:()=>yEr,ExampleEndpointCallArraySchema:()=>C7a,ExampleEndpointCallSchema:()=>G$e,ExampleResponseSchema:()=>CEr,ExampleSseEventSchema:()=>EEr,ExampleSseResponseSchema:()=>IEr,ExampleStreamResponseSchema:()=>vEr,ExampleTypeReferenceSchema:()=>yw,ExampleTypeSchema:()=>V$e,ExampleTypeValueSchema:()=>pEr,ExampleWebSocketMessage:()=>wEr,ExampleWebSocketSession:()=>TEr,ExampleWebhookCallSchema:()=>SEr,SupportedSdkLanguageSchema:()=>AEr});var S7a=h(()=>{"use strict";hJi()});var OEr,AJi=h(()=>{"use strict";hr();OEr=le.object({openapi:le.string()})});var PEr,yJi=h(()=>{"use strict";hr();PEr=le.object({proto:le.string()})});var AIe,YMt=h(()=>{"use strict";hr();AJi();yJi();AIe=le.undiscriminatedUnion([OEr,PEr])});var q$e,BEr=h(()=>{"use strict";hr();xfe();Xp();oEr();JMt();q$e=le.object({default:le.unknown().optional(),"client-default":le.unknown().optional(),encoding:_$e.optional(),validation:hIe.optional()}).extend(vo).extend(oD)});var REr,bJi=h(()=>{"use strict";hr();r$();Vx();BEr();REr=le.object({type:le.string()}).extend(q$e).extend(Tf).extend(J1)});var PH,W$e=h(()=>{"use strict";hr();bJi();PH=le.undiscriminatedUnion([le.string(),REr])});var DEr,EJi=h(()=>{"use strict";hr();q0r();D0r();DEr=le.record(z$e,le.list(j$e))});var kEr,IJi=h(()=>{"use strict";hr();EJi();kEr=le.list(DEr)});var FEr,vJi=h(()=>{"use strict";hr();IJi();FEr=le.undiscriminatedUnion([le.boolean(),kEr])});var NEr,CJi=h(()=>{"use strict";hr();NEr=le.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var jEr,xJi=h(()=>{"use strict";hr();xfe();Xp();jEr=le.object({variable:le.string()}).extend(oD).extend(vo)});var o$,H$e=h(()=>{"use strict";hr();W$e();xJi();o$=le.undiscriminatedUnion([PH,jEr])});var DV,hLe=h(()=>{"use strict";hr();r$();Vx();BEr();DV=le.object({type:le.string()}).extend(q$e).extend(Tf).extend(J1)});var zEr,SJi=h(()=>{"use strict";hr();hLe();zEr=le.object({env:le.string().optional()}).extend(DV)});var QEr,wJi=h(()=>{"use strict";hr();SJi();QEr=le.undiscriminatedUnion([le.string(),zEr])});var kV,gLe=h(()=>{"use strict";wJi();kV=QEr});var MEr,TJi=h(()=>{"use strict";hr();hLe();MEr=le.object({"allow-multiple":le.boolean().optional(),explode:le.boolean().optional()}).extend(DV)});var K$e,LEr=h(()=>{"use strict";hr();TJi();K$e=le.undiscriminatedUnion([le.string(),MEr])});var FV,ALe=h(()=>{"use strict";hr();FV=le.undiscriminatedUnion([le.string(),le.list(le.string())])});var _Er,OJi=h(()=>{"use strict";hr();_Er=le.enum_(["json","exploded","form"])});var UEr,PJi=h(()=>{"use strict";hr();hLe();OJi();UEr=le.object({style:_Er.optional(),"content-type":le.string().optional()}).extend(DV)});var VEr,BJi=h(()=>{"use strict";hr();PJi();VEr=le.undiscriminatedUnion([le.string(),UEr])});var GEr,RJi=h(()=>{"use strict";hr();ALe();BJi();GEr=le.object({extends:FV.optional(),"extra-properties":le.boolean().optional(),properties:le.record(le.string(),VEr).optional(),optional:le.boolean().optional()})});var qEr,DJi=h(()=>{"use strict";hr();Xp();qEr=le.object({type:le.string(),optional:le.boolean().optional()}).extend(vo)});var WEr,kJi=h(()=>{"use strict";hr();RJi();DJi();WEr=le.undiscriminatedUnion([le.string(),qEr,GEr])});var HEr,FJi=h(()=>{"use strict";hr();Xp();Vx();gLe();H$e();LEr();kJi();HEr=le.object({"content-type":le.string().optional(),"path-parameters":le.record(le.string(),o$).optional(),"query-parameters":le.record(le.string(),K$e).optional(),headers:le.record(le.string(),kV).optional(),body:WEr.optional()}).extend(Tf).extend(vo)});var KEr,NJi=h(()=>{"use strict";hr();FJi();KEr=le.undiscriminatedUnion([le.string(),HEr])});var JEr,jJi=h(()=>{"use strict";hr();Xp();JEr=le.object({type:le.string().optional(),property:le.string().optional(),"status-code":le.number().optional(),"content-type":le.string().optional()}).extend(vo)});var J$e,YEr=h(()=>{"use strict";hr();jJi();J$e=le.undiscriminatedUnion([le.string(),JEr])});var XEr,zJi=h(()=>{"use strict";hr();XEr=le.enum_(["sse","json"])});var ZEr,QJi=h(()=>{"use strict";hr();Xp();zJi();ZEr=le.object({type:le.string(),format:XEr.optional(),terminator:le.string().optional(),resumable:le.boolean().optional()}).extend(vo)});var Y$e,$Er=h(()=>{"use strict";hr();QJi();Y$e=le.undiscriminatedUnion([le.string(),ZEr])});var eIr,MJi=h(()=>{"use strict";hr();eIr=le.object({cursor:le.string(),next_cursor:le.string(),results:le.string()})});var tIr,LJi=h(()=>{"use strict";hr();tIr=le.object({type:le.stringLiteral("custom"),results:le.string()})});var rIr,_Ji=h(()=>{"use strict";hr();rIr=le.object({offset:le.string(),results:le.string(),step:le.string().optional(),"has-next-page":le.string().optional()})});var nIr,UJi=h(()=>{"use strict";hr();nIr=le.object({next_path:le.string(),results:le.string()})});var iIr,VJi=h(()=>{"use strict";hr();iIr=le.object({next_uri:le.string(),results:le.string()})});var X$e,oIr=h(()=>{"use strict";hr();MJi();LJi();_Ji();UJi();VJi();X$e=le.undiscriminatedUnion([eIr,rIr,tIr,iIr,nIr])});var sIr,GJi=h(()=>{"use strict";hr();oIr();sIr=le.undiscriminatedUnion([X$e,le.boolean()])});var aIr,qJi=h(()=>{"use strict";hr();Xp();aIr=le.object({error:le.string()}).extend(vo)});var cIr,WJi=h(()=>{"use strict";hr();qJi();cIr=le.undiscriminatedUnion([le.string(),aIr])});var uIr,HJi=h(()=>{"use strict";hr();WJi();uIr=le.list(cIr)});var lIr,KJi=h(()=>{"use strict";hr();lIr=le.object({disabled:le.boolean().optional()})});var pIr,JJi=h(()=>{"use strict";hr();KJi();pIr=le.undiscriminatedUnion([lIr])});var fIr,YJi=h(()=>{"use strict";hr();fIr=le.object({"service-name":le.string()})});var Z$e,dIr=h(()=>{"use strict";hr();YJi();Z$e=le.object({grpc:fIr.optional()})});var mIr,XJi=h(()=>{"use strict";hr();M$e();i$();xEr();YMt();vJi();CJi();H$e();NJi();YEr();$Er();GJi();HJi();JJi();dIr();mIr=le.object({method:NEr.optional(),"base-path":le.string().optional(),path:le.string(),url:le.string().optional(),"path-parameters":le.record(le.string(),o$).optional(),auth:FEr.optional(),idempotent:le.boolean().optional(),subtitle:le.string().optional(),"stream-condition":le.string().optional(),request:KEr.optional(),response:J$e.optional(),"response-stream":Y$e.optional(),errors:uIr.optional(),examples:le.list(G$e).optional(),pagination:sIr.optional(),transport:Z$e.optional(),source:AIe.optional(),retries:pIr.optional(),"global-parameters":le.list(le.string()).optional()}).extend(Y1).extend(n$)});var hIr,ZJi=h(()=>{"use strict";hr();FKi();i$();YMt();W$e();XJi();dIr();hIr=le.object({auth:le.boolean().optional(),url:le.string().optional(),"base-path":le.string(),"path-parameters":le.record(le.string(),PH).optional(),idempotent:le.boolean().optional(),headers:le.record(le.string(),PH).optional(),transport:Z$e.optional(),source:AIe.optional(),endpoints:le.record(le.string(),mIr)}).extend(Y0r).extend(Y1)});var NV,yLe=h(()=>{"use strict";hr();r$();xfe();Xp();oEr();fEr();YMt();NV=le.object({examples:le.list(V$e).optional(),encoding:_$e.optional(),source:AIe.optional(),inline:le.boolean().optional()}).extend(vo).extend(oD).extend(J1)});var gIr,$Ji=h(()=>{"use strict";hr();JMt();yLe();gIr=le.object({type:le.string(),validation:hIe.optional()}).extend(NV)});var AIr,eYi=h(()=>{"use strict";hr();Vx();AIr=le.object({value:le.string()}).extend(Tf)});var yIr,tYi=h(()=>{"use strict";hr();eYi();yIr=le.undiscriminatedUnion([le.string(),AIr])});var bIr,rYi=h(()=>{"use strict";hr();xfe();i$();Xp();Vx();rEr();tYi();bIr=le.object({type:le.string().optional(),key:yIr.optional()}).extend(vo).extend(Tf).extend(oD).extend(Y1).extend(L$e)});var EIr,nYi=h(()=>{"use strict";hr();rYi();EIr=le.undiscriminatedUnion([le.string(),bIr])});var IIr,iYi=h(()=>{"use strict";hr();IIr=le.enum_(["data","protocol"])});var vIr,oYi=h(()=>{"use strict";hr();Vx();iYi();vIr=le.object({value:le.string(),context:IIr.optional()}).extend(Tf)});var CIr,sYi=h(()=>{"use strict";hr();oYi();CIr=le.undiscriminatedUnion([le.string(),vIr])});var xIr,aYi=h(()=>{"use strict";hr();yLe();ALe();nYi();W$e();sYi();xIr=le.object({discriminant:CIr.optional(),extends:FV.optional(),"base-properties":le.record(le.string(),PH).optional(),union:le.record(le.string(),EIr),"default-variant":le.string().optional()}).extend(NV)});var SIr,cYi=h(()=>{"use strict";hr();SIr=le.object({camel:le.string().optional(),snake:le.string().optional(),pascal:le.string().optional(),"screaming-snake":le.string().optional()})});var wIr,uYi=h(()=>{"use strict";hr();Xp();Vx();cYi();wIr=le.object({value:le.string(),casing:SIr.optional()}).extend(vo).extend(Tf)});var TIr,lYi=h(()=>{"use strict";hr();uYi();TIr=le.undiscriminatedUnion([le.string(),wIr])});var OIr,pYi=h(()=>{"use strict";hr();yLe();lYi();OIr=le.object({default:le.string().optional(),enum:le.list(TIr),"forward-compatible":le.boolean().optional()}).extend(NV)});var PIr,fYi=h(()=>{"use strict";hr();PIr=le.enum_(["read-only","write-only"])});var BIr,dYi=h(()=>{"use strict";hr();fYi();hLe();BIr=le.object({access:PIr.optional()}).extend(DV)});var yIe,XMt=h(()=>{"use strict";hr();dYi();yIe=le.undiscriminatedUnion([le.string(),BIr])});var RIr,mYi=h(()=>{"use strict";hr();yLe();ALe();XMt();RIr=le.object({extends:FV.optional(),properties:le.record(le.string(),yIe).optional(),"extra-properties":le.boolean().optional()}).extend(NV)});var DIr,hYi=h(()=>{"use strict";hr();i$();Xp();rEr();DIr=le.object({type:le.string()}).extend(vo).extend(Y1).extend(L$e)});var kIr,gYi=h(()=>{"use strict";hr();hYi();kIr=le.undiscriminatedUnion([le.string(),DIr])});var FIr,AYi=h(()=>{"use strict";hr();yLe();gYi();W$e();FIr=le.object({discriminated:le.booleanLiteral(!1),"base-properties":le.record(le.string(),PH).optional(),union:le.list(kIr)}).extend(NV)});var NIr,yYi=h(()=>{"use strict";hr();$Ji();aYi();pYi();mYi();AYi();NIr=le.undiscriminatedUnion([le.string(),RIr,OIr,xIr,FIr,gIr])});var jIr,bYi=h(()=>{"use strict";hr();jIr=le.enum_(["POST","GET"])});var zIr,EYi=h(()=>{"use strict";hr();ALe();XMt();zIr=le.object({name:le.string(),extends:FV.optional(),properties:le.record(le.string(),yIe).optional()})});var QIr,IYi=h(()=>{"use strict";hr();Xp();QIr=le.object({type:le.string()}).extend(vo)});var MIr,vYi=h(()=>{"use strict";hr();EYi();IYi();MIr=le.undiscriminatedUnion([le.string(),QIr,zIr])});var LIr,CYi=h(()=>{"use strict";hr();LIr=le.enum_(["rsa-sha256","rsa-sha384","rsa-sha512","ecdsa-sha256","ecdsa-sha384","ecdsa-sha512","ed25519"])});var _Ir,xYi=h(()=>{"use strict";hr();_Ir=le.enum_(["alphabetical"])});var UIr,SYi=h(()=>{"use strict";hr();UIr=le.enum_(["body","timestamp","notification-url","message-id"])});var $$e,VIr=h(()=>{"use strict";hr();xYi();SYi();$$e=le.object({components:le.list(UIr),delimiter:le.string().optional(),"body-sort":_Ir.optional()})});var bIe,ZMt=h(()=>{"use strict";hr();bIe=le.enum_(["base64","hex"])});var GIr,wYi=h(()=>{"use strict";hr();GIr=le.enum_(["unix-seconds","unix-millis","iso8601"])});var eet,qIr=h(()=>{"use strict";hr();wYi();eet=le.object({header:le.string(),format:GIr.optional(),tolerance:le.number().optional()})});var WIr,TYi=h(()=>{"use strict";hr();CYi();VIr();ZMt();qIr();WIr=le.object({header:le.string(),"asymmetric-algorithm":LIr,encoding:bIe.optional(),"signature-prefix":le.string().optional(),"jwks-url":le.string().optional(),"key-id-header":le.string().optional(),"payload-format":$$e.optional(),timestamp:eet.optional()})});var tet,HIr=h(()=>{"use strict";hr();tet=le.enum_(["sha256","sha1","sha384","sha512"])});var KIr,OYi=h(()=>{"use strict";hr();HIr();KIr=le.object({header:le.string(),"key-id-delimiter":le.string().optional(),"key-id-parameter":le.string().optional(),"algorithm-parameter":le.string().optional(),algorithms:le.record(le.string(),tet)})});var JIr,PYi=h(()=>{"use strict";hr();JIr=le.enum_(["sha256","sha1","sha384","sha512"])});var YIr,BYi=h(()=>{"use strict";hr();YIr=le.object({name:le.string()})});var XIr,RYi=h(()=>{"use strict";hr();BYi();XIr=le.union("type",{"query-parameter":YIr}).transform({transform:e=>e,untransform:e=>e})});var ZIr,DYi=h(()=>{"use strict";hr();PYi();RYi();ZMt();ZIr=le.object({algorithm:JIr,encoding:bIe.optional(),location:XIr})});var $Ir,kYi=h(()=>{"use strict";hr();$Ir=le.object({"port-variants":le.boolean().optional(),"legacy-query-encoding":le.boolean().optional()})});var evr,FYi=h(()=>{"use strict";hr();OYi();DYi();VIr();HIr();ZMt();qIr();kYi();evr=le.object({header:le.string(),algorithm:tet.optional(),encoding:bIe.optional(),"signature-prefix":le.string().optional(),"payload-format":$$e.optional(),timestamp:eet.optional(),"body-hash-binding":ZIr.optional(),"url-normalization":$Ir.optional(),"algorithm-header":KIr.optional()})});var ret,tvr=h(()=>{"use strict";hr();TYi();FYi();ret=le.union("type",{hmac:evr,asymmetric:WIr}).transform({transform:e=>e,untransform:e=>e})});var rvr,NYi=h(()=>{"use strict";hr();r$();xfe();i$();Xp();fJi();gLe();YEr();$Er();bYi();vYi();tvr();rvr=le.object({method:jIr,headers:le.record(le.string(),kV).optional(),payload:MIr,signature:ret.optional(),response:J$e.optional(),"response-stream":Y$e.optional(),examples:le.list(SEr).optional()}).extend(oD).extend(J1).extend(vo).extend(Y1)});var nvr,jYi=h(()=>{"use strict";hr();ALe();XMt();nvr=le.object({name:le.string(),extends:FV.optional(),properties:le.record(le.string(),yIe).optional()})});var ivr,zYi=h(()=>{"use strict";hr();Xp();ivr=le.object({type:le.string()}).extend(vo)});var ovr,QYi=h(()=>{"use strict";hr();jYi();zYi();ovr=le.undiscriminatedUnion([le.string(),ivr,nvr])});var svr,MYi=h(()=>{"use strict";hr();svr=le.enum_(["client","server"])});var avr,LYi=h(()=>{"use strict";hr();M$e();i$();NKi();QYi();MYi();avr=le.object({origin:svr,body:ovr}).extend(n$).extend(Y1).extend(X0r)});var cvr,_Yi=h(()=>{"use strict";hr();M$e();i$();mJi();gLe();H$e();LEr();LYi();cvr=le.object({auth:le.boolean(),url:le.string().optional(),path:le.string(),"connect-method-name":le.string().optional(),headers:le.record(le.string(),kV).optional(),"path-parameters":le.record(le.string(),o$).optional(),"query-parameters":le.record(le.string(),K$e).optional(),messages:le.record(le.string(),avr).optional(),examples:le.list(TEr).optional()}).extend(n$).extend(Y1)});var uvr,UYi=h(()=>{"use strict";hr();Xp();eJi();ZJi();yYi();NYi();tvr();_Yi();uvr=le.object({imports:le.record(le.string(),le.string()).optional(),types:le.record(le.string(),NIr).optional(),service:hIr.optional(),errors:le.record(le.string(),mEr).optional(),webhooks:le.record(le.string(),rvr).optional(),"webhook-signature":ret.optional(),channel:cvr.optional()}).extend(vo)});var lvr,VYi=h(()=>{"use strict";hr();lvr=le.object({strategy:le.stringLiteral("property"),"property-name":le.string()})});var pvr,GYi=h(()=>{"use strict";hr();pvr=le.object({strategy:le.stringLiteral("status-code")})});var fvr,qYi=h(()=>{"use strict";hr();VYi();GYi();fvr=le.undiscriminatedUnion([lvr,pvr])});var dvr,WYi=h(()=>{"use strict";hr();dvr=le.object({dependency:le.string(),url:le.string().optional()})});var mvr,HYi=h(()=>{"use strict";hr();WYi();mvr=le.undiscriminatedUnion([le.string(),dvr])});var hvr,KYi=h(()=>{"use strict";hr();hvr=le.undiscriminatedUnion([le.string(),le.list(le.string())])});var w7a,T7a=h(()=>{"use strict";hr();UYi();HYi();KYi();w7a=le.object({navigation:hvr.optional(),export:mvr.optional()}).extend(uvr)});var gvr,JYi=h(()=>{"use strict";hr();Xp();gvr=le.object({in:le.string().optional(),target:le.string().optional(),type:le.string().optional(),env:le.string().optional(),default:le.unknown().optional(),optional:le.boolean().optional(),apply:le.string().optional(),"parameter-name":le.string().optional()}).extend(vo)});var Avr,YYi=h(()=>{"use strict";hr();Avr=le.object({name:le.string().optional(),env:le.string().optional(),value:le.string()})});var yvr,XYi=h(()=>{"use strict";hr();YYi();yvr=le.undiscriminatedUnion([le.string(),Avr])});var bvr,ZYi=h(()=>{"use strict";hr();bvr=le.object({name:le.string().optional(),env:le.string().optional(),value:le.string()})});var Evr,$Yi=h(()=>{"use strict";hr();ZYi();Evr=le.undiscriminatedUnion([le.string(),bvr])});var Ivr,eXi=h(()=>{"use strict";hr();Xp();Vx();Ivr=le.object({value:le.string()}).extend(vo).extend(Tf)});var vvr,tXi=h(()=>{"use strict";hr();eXi();vvr=le.undiscriminatedUnion([le.string(),Ivr])});var net,Cvr=h(()=>{"use strict";hr();$Yi();tXi();net=le.object({default:le.string().optional(),values:le.list(vvr),header:Evr})});var xvr,rXi=h(()=>{"use strict";hr();Xp();Vx();Cvr();xvr=le.object({value:le.string(),versions:net.optional()}).extend(vo).extend(Tf)});var Svr,nXi=h(()=>{"use strict";hr();rXi();Svr=le.undiscriminatedUnion([le.string(),xvr])});var wvr,iXi=h(()=>{"use strict";hr();XYi();nXi();wvr=le.object({default:le.string().optional(),values:le.list(Svr),header:yvr})});var Tvr,oXi=h(()=>{"use strict";hr();Xp();Tvr=le.object({type:le.string(),env:le.string().optional()}).extend(vo)});var Ovr,sXi=h(()=>{"use strict";hr();oXi();Ovr=le.undiscriminatedUnion([le.string(),Tvr])});var Pvr,aXi=h(()=>{"use strict";hr();gLe();Pvr=le.object({headers:le.record(le.string(),kV).optional()})});var O7a,P7a=h(()=>{"use strict";hr();TKi();i$();Xp();JKi();JYi();oIr();iXi();gLe();H$e();sXi();Cvr();qYi();aXi();O7a=le.object({name:le.string(),imports:le.record(le.string(),le.string()).optional(),"error-discrimination":fvr.optional(),audiences:le.list(le.string()).optional(),errors:le.list(le.string()).optional(),"base-path":le.string().optional(),"path-parameters":le.record(le.string(),o$).optional(),"idempotency-headers":le.record(le.string(),kV).optional(),variables:le.record(le.string(),Ovr).optional(),"global-parameters":le.record(le.string(),gvr).optional(),pagination:X$e.optional(),product:wvr.optional(),version:net.optional()}).extend(vo).extend(Y1).extend(lEr).extend(W0r).extend(Pvr)});var cXi=h(()=>{"use strict";UYi();qYi();HYi();WYi();KYi();T7a();VYi();P7a();GYi();aXi()});var uXi={};te(uXi,{DefinitionFileSchema:()=>uvr,ErrorDiscriminationSchema:()=>fvr,Export:()=>mvr,ExportDetailed:()=>dvr,Navigation:()=>hvr,PackageMarkerFileSchema:()=>w7a,PropertyBasedErrorDiscrimination:()=>lvr,RootApiFileSchema:()=>O7a,StatusCodeBasedErrorDiscrimination:()=>pvr,WithHeadersSchema:()=>Pvr});var B7a=h(()=>{"use strict";cXi()});var lXi=h(()=>{"use strict";JYi()});var pXi={};te(pXi,{GlobalParameterDeclarationSchema:()=>gvr});var R7a=h(()=>{"use strict";lXi()});var fXi=h(()=>{"use strict";MJi();LJi();_Ji();oIr();UJi();VJi()});var dXi={};te(dXi,{CursorPaginationSchema:()=>eIr,CustomPaginationSchema:()=>tIr,OffsetPaginationSchema:()=>rIr,PaginationSchema:()=>X$e,PathPaginationSchema:()=>nIr,UriPaginationSchema:()=>iIr});var D7a=h(()=>{"use strict";fXi()});var mXi=h(()=>{"use strict";YYi();XYi();iXi();nXi();rXi()});var hXi={};te(hXi,{ProductDeclarationHeaderObjectSchema:()=>Avr,ProductDeclarationHeaderSchema:()=>yvr,ProductDeclarationSchema:()=>wvr,ProductValue:()=>Svr,ProductValueDetailed:()=>xvr});var k7a=h(()=>{"use strict";mXi()});var gXi=h(()=>{"use strict";OJi();YJi();vJi();XJi();IJi();EJi();gLe();PJi();BJi();RJi();CJi();H$e();LEr();DJi();NJi();kJi();FJi();YEr();jJi();$Er();QJi();ZJi();GJi();TJi();WJi();HJi();qJi();JJi();KJi();dIr();zJi();wJi();SJi()});var AXi={};te(AXi,{FormDataBodyEncodingStyle:()=>_Er,GrpcTransport:()=>fIr,HttpEndpointAuth:()=>FEr,HttpEndpointSchema:()=>mIr,HttpEndpointSecurity:()=>kEr,HttpEndpointSecurityItem:()=>DEr,HttpHeaderSchema:()=>kV,HttpInlineFileRequestBodyPropertySchema:()=>UEr,HttpInlineRequestBodyPropertySchema:()=>VEr,HttpInlineRequestBodySchema:()=>GEr,HttpMethodSchema:()=>NEr,HttpPathParameterSchema:()=>o$,HttpQueryParameterSchema:()=>K$e,HttpReferencedRequestBodySchema:()=>qEr,HttpRequest:()=>KEr,HttpRequestBodySchema:()=>WEr,HttpRequestSchema:()=>HEr,HttpResponseSchema:()=>J$e,HttpResponseSchemaDetailed:()=>JEr,HttpResponseStreamSchema:()=>Y$e,HttpResponseStreamSchemaDetailed:()=>ZEr,HttpServiceSchema:()=>hIr,Pagination:()=>sIr,QueryParameterTypeReferenceDetailed:()=>MEr,ResponseError:()=>cIr,ResponseErrorWithDocsSchema:()=>aIr,ResponseErrorsSchema:()=>uIr,RetriesConfiguration:()=>pIr,RetriesDisabledSchema:()=>lIr,ServiceTransport:()=>Z$e,StreamFormat:()=>XEr,TypeReferenceDeclarationWithEnvOverride:()=>QEr,TypeReferenceDeclarationWithEnvOverrideSchema:()=>zEr});var F7a=h(()=>{"use strict";gXi()});var yXi=h(()=>{"use strict";AJi();yJi();YMt()});var bXi={};te(bXi,{OpenApiSourceSchema:()=>OEr,ProtobufSourceSchema:()=>PEr,SourceSchema:()=>AIe});var N7a=h(()=>{"use strict";yXi()});var j7a,z7a=h(()=>{"use strict";hr();hLe();j7a=le.undiscriminatedUnion([le.string(),DV])});var EXi=h(()=>{"use strict";$Ji();yLe();BEr();cYi();aYi();pYi();lYi();uYi();ALe();fYi();XMt();dYi();mYi();hYi();gYi();rYi();tYi();eYi();nYi();yYi();hLe();z7a();bJi();W$e();AYi();sYi();oYi();iYi()});var IXi={};te(IXi,{AliasSchema:()=>gIr,BaseTypeDeclarationSchema:()=>NV,BaseTypeReferenceSchema:()=>q$e,CasingOverridesSchema:()=>SIr,DiscriminatedUnionSchema:()=>xIr,EnumSchema:()=>OIr,EnumValue:()=>TIr,EnumValueSchema:()=>wIr,ObjectExtendsSchema:()=>FV,ObjectPropertyAccess:()=>PIr,ObjectPropertySchema:()=>yIe,ObjectPropertyWithAccessSchema:()=>BIr,ObjectSchema:()=>RIr,SingleUndiscriminatedUnionTypeDetailedSchema:()=>DIr,SingleUndiscriminatedUnionTypeSchema:()=>kIr,SingleUnionTypeDetailedSchema:()=>bIr,SingleUnionTypeKey:()=>yIr,SingleUnionTypeKeySchema:()=>AIr,SingleUnionTypeSchema:()=>EIr,TypeDeclarationSchema:()=>NIr,TypeReferenceDeclarationWithName:()=>DV,TypeReferenceDeclarationWithNameSchema:()=>j7a,TypeReferenceDetailedSchema:()=>REr,TypeReferenceSchema:()=>PH,UndiscriminatedUnionSchema:()=>FIr,UnionDiscriminant:()=>CIr,UnionDiscriminantSchema:()=>vIr,UnionDiscriminatorContext:()=>IIr});var Q7a=h(()=>{"use strict";EXi()});var vXi=h(()=>{"use strict";jKi();zKi();QKi();MKi();JMt()});var CXi={};te(CXi,{ListValidationSchema:()=>Z0r,MapValidationSchema:()=>$0r,NumberValidationSchema:()=>eEr,StringValidationSchema:()=>tEr,ValidationSchema:()=>hIe});var M7a=h(()=>{"use strict";vXi()});var xXi=h(()=>{"use strict";oXi();sXi();xJi()});var SXi={};te(SXi,{VariableDeclarationDetailed:()=>Tvr,VariableDeclarationSchema:()=>Ovr,VariableReferenceSchema:()=>jEr});var L7a=h(()=>{"use strict";xXi()});var wXi=h(()=>{"use strict";ZYi();$Yi();Cvr();tXi();eXi()});var TXi={};te(TXi,{VersionDeclarationHeaderObjectSchema:()=>bvr,VersionDeclarationHeaderSchema:()=>Evr,VersionDeclarationSchema:()=>net,VersionValue:()=>vvr,VersionValueDetailed:()=>Ivr});var _7a=h(()=>{"use strict";wXi()});var OXi=h(()=>{"use strict";CYi();TYi();FYi();OYi();PYi();DYi();RYi();BYi();EYi();bYi();xYi();SYi();VIr();vYi();IYi();NYi();HIr();ZMt();tvr();wYi();qIr();kYi()});var PXi={};te(PXi,{AsymmetricAlgorithmSchema:()=>LIr,AsymmetricSignatureSchema:()=>WIr,HmacSignatureSchema:()=>evr,WebhookAlgorithmHeaderSchema:()=>KIr,WebhookBodyHashAlgorithmSchema:()=>JIr,WebhookBodyHashBindingSchema:()=>ZIr,WebhookBodyHashLocationSchema:()=>XIr,WebhookBodyHashQueryParameterLocationSchema:()=>YIr,WebhookInlinedPayloadSchema:()=>zIr,WebhookMethodSchema:()=>jIr,WebhookPayloadBodySortSchema:()=>_Ir,WebhookPayloadComponentSchema:()=>UIr,WebhookPayloadFormatSchema:()=>$$e,WebhookPayloadSchema:()=>MIr,WebhookReferencedPayloadSchema:()=>QIr,WebhookSchema:()=>rvr,WebhookSignatureAlgorithmSchema:()=>tet,WebhookSignatureEncodingSchema:()=>bIe,WebhookSignatureSchema:()=>ret,WebhookTimestampFormatSchema:()=>GIr,WebhookTimestampSchema:()=>eet,WebhookUrlNormalizationSchema:()=>$Ir});var U7a=h(()=>{"use strict";OXi()});var BXi=h(()=>{"use strict";jYi();QYi();LYi();zYi();_Yi();MYi()});var RXi={};te(RXi,{WebSocketChannelInlinedMessageSchema:()=>nvr,WebSocketChannelMessageBodySchema:()=>ovr,WebSocketChannelMessageSchema:()=>avr,WebSocketChannelReferencedMessageSchema:()=>ivr,WebSocketChannelSchema:()=>cvr,WebSocketOrigin:()=>svr});var V7a=h(()=>{"use strict";BXi()});var G7a=h(()=>{"use strict";h7a();OKi();g7a();DKi();b7a();LKi();E7a();GKi();I7a();YKi();v7a();tJi();S7a();hJi();B7a();cXi();R7a();lXi();D7a();fXi();k7a();mXi();F7a();gXi();N7a();yXi();Q7a();EXi();M7a();vXi();L7a();xXi();_7a();wXi();U7a();OXi();V7a();BXi()});var DXi={};te(DXi,{AliasSchema:()=>gIr,AnyAuthItem:()=>g0r,AnyAuthSchemesSchema:()=>A0r,ApiAuthSchema:()=>E0r,AsymmetricAlgorithmSchema:()=>LIr,AsymmetricSignatureSchema:()=>WIr,AuthSchemeDeclarationSchema:()=>G0r,AuthSchemeKey:()=>z$e,AuthSchemeReferenceSchema:()=>F$e,AuthScope:()=>j$e,AuthVariable:()=>dLe,AvailabilitySchema:()=>K0r,AvailabilityStatusSchema:()=>Q$e,AvailabilityUnionSchema:()=>J0r,BaseTypeDeclarationSchema:()=>NV,BaseTypeReferenceSchema:()=>q$e,BasicAuthSchemeSchema:()=>C0r,BearerAuthSchemeSchema:()=>B0r,CasingOverridesSchema:()=>SIr,CursorPaginationSchema:()=>eIr,CustomPaginationSchema:()=>tIr,DeclarationSchema:()=>n$,DeclarationWithNameSchema:()=>A7a,DeclarationWithoutDocsSchema:()=>Y0r,DefinitionFileSchema:()=>uvr,DiscriminatedUnionSchema:()=>xIr,EncodingSchema:()=>_$e,EndpointSecuritySchema:()=>b0r,EndpointSecuritySchemaDetails:()=>y0r,EnumSchema:()=>OIr,EnumValue:()=>TIr,EnumValueSchema:()=>wIr,EnvironmentSchema:()=>uEr,ErrorDeclarationSchema:()=>mEr,ErrorDiscriminationSchema:()=>fvr,ErrorStatusCodeSchema:()=>dEr,ExampleBodyResponseSchema:()=>hEr,ExampleCodeSampleSchema:()=>bEr,ExampleCodeSampleSchemaLanguage:()=>gEr,ExampleCodeSampleSchemaSdk:()=>yEr,ExampleEndpointCallArraySchema:()=>C7a,ExampleEndpointCallSchema:()=>G$e,ExampleResponseSchema:()=>CEr,ExampleSseEventSchema:()=>EEr,ExampleSseResponseSchema:()=>IEr,ExampleStreamResponseSchema:()=>vEr,ExampleTypeReferenceSchema:()=>yw,ExampleTypeSchema:()=>V$e,ExampleTypeValueSchema:()=>pEr,ExampleWebSocketMessage:()=>wEr,ExampleWebSocketSession:()=>TEr,ExampleWebhookCallSchema:()=>SEr,Export:()=>mvr,ExportDetailed:()=>dvr,FormDataBodyEncodingStyle:()=>_Er,GlobalParameterDeclarationSchema:()=>gvr,GrpcTransport:()=>fIr,HeaderAuthSchemeSchema:()=>R0r,HmacSignatureSchema:()=>evr,HttpEndpointAuth:()=>FEr,HttpEndpointSchema:()=>mIr,HttpEndpointSecurity:()=>kEr,HttpEndpointSecurityItem:()=>DEr,HttpHeaderSchema:()=>kV,HttpInlineFileRequestBodyPropertySchema:()=>UEr,HttpInlineRequestBodyPropertySchema:()=>VEr,HttpInlineRequestBodySchema:()=>GEr,HttpMethodSchema:()=>NEr,HttpPathParameterSchema:()=>o$,HttpQueryParameterSchema:()=>K$e,HttpReferencedRequestBodySchema:()=>qEr,HttpRequest:()=>KEr,HttpRequestBodySchema:()=>WEr,HttpRequestSchema:()=>HEr,HttpResponseSchema:()=>J$e,HttpResponseSchemaDetailed:()=>JEr,HttpResponseStreamSchema:()=>Y$e,HttpResponseStreamSchemaDetailed:()=>ZEr,HttpServiceSchema:()=>hIr,InferredAuthTypeSchema:()=>x0r,InferredAuthenticatedRequestHeader:()=>S0r,InferredBearerAuthSchema:()=>O0r,InferredGetTokenEndpointSchema:()=>T0r,InferredGetTokenEndpointSchemaObject:()=>w0r,ListValidationSchema:()=>Z0r,MapValidationSchema:()=>$0r,MultipleBaseUrlsEnvironmentSchema:()=>aEr,Navigation:()=>hvr,NumberValidationSchema:()=>eEr,OAuthAccessTokenRequestPropertiesSchema:()=>F0r,OAuthAccessTokenResponsePropertiesSchema:()=>N0r,OAuthFlowTypeSchema:()=>k0r,OAuthGetTokenEndpointSchema:()=>j0r,OAuthPkceSchema:()=>z0r,OAuthRefreshTokenEndpointSchema:()=>L0r,OAuthRefreshTokenRequestPropertiesSchema:()=>Q0r,OAuthRefreshTokenResponsePropertiesSchema:()=>M0r,OAuthSchemeSchema:()=>V0r,ObjectExtendsSchema:()=>FV,ObjectPropertyAccess:()=>PIr,ObjectPropertySchema:()=>yIe,ObjectPropertyWithAccessSchema:()=>BIr,ObjectSchema:()=>RIr,OffsetPaginationSchema:()=>rIr,OpenApiSourceSchema:()=>OEr,PackageMarkerFileSchema:()=>w7a,Pagination:()=>sIr,PaginationSchema:()=>X$e,PathPaginationSchema:()=>nIr,ProductDeclarationHeaderObjectSchema:()=>Avr,ProductDeclarationHeaderSchema:()=>yvr,ProductDeclarationSchema:()=>wvr,ProductValue:()=>Svr,ProductValueDetailed:()=>xvr,PropertyBasedErrorDiscrimination:()=>lvr,ProtobufSourceSchema:()=>PEr,ProtobufTypeSchema:()=>nEr,QueryParameterTypeReferenceDetailed:()=>MEr,RedirectUriSchema:()=>U0r,RedirectUriWithBackupPortsSchema:()=>_0r,ResponseError:()=>cIr,ResponseErrorWithDocsSchema:()=>aIr,ResponseErrorsSchema:()=>uIr,RetriesConfiguration:()=>pIr,RetriesDisabledSchema:()=>lIr,RootApiFileSchema:()=>O7a,ServerVariableSchema:()=>U$e,ServiceTransport:()=>Z$e,SingleBaseUrlEnvironmentSchema:()=>cEr,SingleUndiscriminatedUnionTypeDetailedSchema:()=>DIr,SingleUndiscriminatedUnionTypeSchema:()=>kIr,SingleUnionTypeDetailedSchema:()=>bIr,SingleUnionTypeKey:()=>yIr,SingleUnionTypeKeySchema:()=>AIr,SingleUnionTypeSchema:()=>EIr,SourceSchema:()=>AIe,StatusCodeBasedErrorDiscrimination:()=>pvr,StreamFormat:()=>XEr,StringValidationSchema:()=>tEr,SupportedSdkLanguageSchema:()=>AEr,TokenBearerAuthSchema:()=>P0r,TypeDeclarationSchema:()=>NIr,TypeReferenceDeclarationWithEnvOverride:()=>QEr,TypeReferenceDeclarationWithEnvOverrideSchema:()=>zEr,TypeReferenceDeclarationWithName:()=>DV,TypeReferenceDeclarationWithNameSchema:()=>j7a,TypeReferenceDetailedSchema:()=>REr,TypeReferenceSchema:()=>PH,UndiscriminatedUnionSchema:()=>FIr,UnionDiscriminant:()=>CIr,UnionDiscriminantSchema:()=>vIr,UnionDiscriminatorContext:()=>IIr,UriPaginationSchema:()=>iIr,ValidationSchema:()=>hIe,VariableDeclarationDetailed:()=>Tvr,VariableDeclarationSchema:()=>Ovr,VariableReferenceSchema:()=>jEr,VersionDeclarationHeaderObjectSchema:()=>bvr,VersionDeclarationHeaderSchema:()=>Evr,VersionDeclarationSchema:()=>net,VersionValue:()=>vvr,VersionValueDetailed:()=>Ivr,WebSocketChannelInlinedMessageSchema:()=>nvr,WebSocketChannelMessageBodySchema:()=>ovr,WebSocketChannelMessageSchema:()=>avr,WebSocketChannelReferencedMessageSchema:()=>ivr,WebSocketChannelSchema:()=>cvr,WebSocketOrigin:()=>svr,WebhookAlgorithmHeaderSchema:()=>KIr,WebhookBodyHashAlgorithmSchema:()=>JIr,WebhookBodyHashBindingSchema:()=>ZIr,WebhookBodyHashLocationSchema:()=>XIr,WebhookBodyHashQueryParameterLocationSchema:()=>YIr,WebhookInlinedPayloadSchema:()=>zIr,WebhookMethodSchema:()=>jIr,WebhookPayloadBodySortSchema:()=>_Ir,WebhookPayloadComponentSchema:()=>UIr,WebhookPayloadFormatSchema:()=>$$e,WebhookPayloadSchema:()=>MIr,WebhookReferencedPayloadSchema:()=>QIr,WebhookSchema:()=>rvr,WebhookSignatureAlgorithmSchema:()=>tet,WebhookSignatureEncodingSchema:()=>bIe,WebhookSignatureSchema:()=>ret,WebhookTimestampFormatSchema:()=>GIr,WebhookTimestampSchema:()=>eet,WebhookUrlNormalizationSchema:()=>$Ir,WithAudiences:()=>J1,WithAuthSchema:()=>W0r,WithAvailability:()=>oD,WithDisplayName:()=>Y1,WithDocsSchema:()=>vo,WithEnvironmentVariable:()=>N$e,WithEnvironmentsSchema:()=>lEr,WithHeadersSchema:()=>Pvr,WithMethodName:()=>X0r,WithName:()=>Tf,WithPlaygroundDocsSchema:()=>RV,WithValidation:()=>L$e,XmlEncodingSchema:()=>iEr,auth:()=>PKi,availability:()=>kKi,commons:()=>_Ki,encoding:()=>qKi,environments:()=>XKi,errors:()=>rJi,examples:()=>gJi,file:()=>uXi,globalParameters:()=>pXi,pagination:()=>dXi,products:()=>hXi,service:()=>AXi,source:()=>bXi,types:()=>IXi,validation:()=>CXi,variables:()=>SXi,versioning:()=>TXi,webhooks:()=>PXi,websocket:()=>RXi});var q7a=h(()=>{"use strict";G7a()});function utd({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: ${eWa(r,void 0,2)}`),n.join(`
99
99
  `)}var $Mt,W7a=h(()=>{"use strict";tWa();$Mt=class extends Error{statusCode;body;rawResponse;constructor({message:t,statusCode:r,body:n,rawResponse:i}){super(utd({message:t,statusCode:r,body:n})),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.statusCode=r,this.body=n,this.rawResponse=i}}});var eLt,H7a=h(()=>{"use strict";eLt=class extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}});var K7a=h(()=>{"use strict";W7a();H7a()});var Yd={};te(Yd,{AsymmetricAlgorithmSchema:()=>d9a,AvailabilityStatusSchema:()=>r8a,FernDefinitionError:()=>$Mt,FernDefinitionTimeoutError:()=>eLt,FormDataBodyEncodingStyle:()=>PGa,HttpMethodSchema:()=>LGa,InferredAuthTypeSchema:()=>k5a,OAuthFlowTypeSchema:()=>L5a,ObjectPropertyAccess:()=>wqa,StreamFormat:()=>aqa,SupportedSdkLanguageSchema:()=>Y8a,UnionDiscriminatorContext:()=>qqa,WebSocketOrigin:()=>J9a,WebhookBodyHashAlgorithmSchema:()=>y9a,WebhookMethodSchema:()=>x9a,WebhookPayloadBodySortSchema:()=>w9a,WebhookPayloadComponentSchema:()=>O9a,WebhookSignatureAlgorithmSchema:()=>F9a,WebhookSignatureEncodingSchema:()=>j9a,WebhookTimestampFormatSchema:()=>M9a,auth:()=>fHi,availability:()=>mHi,commons:()=>g8a,encoding:()=>I8a,environments:()=>O8a,errors:()=>D8a,examples:()=>EHi,file:()=>uGa,globalParameters:()=>fGa,pagination:()=>EGa,products:()=>TGa,serialization:()=>DXi,service:()=>wHi,source:()=>hqa,types:()=>PHi,validation:()=>$qa,variables:()=>i9a,versioning:()=>p9a,webhooks:()=>FHi,websocket:()=>jHi});var J7a=h(()=>{"use strict";$9a();q7a();K7a()});function kXi(e){return e.scheme==="oauth"}var Y7a=h(()=>{"use strict"});var X7a=h(()=>{"use strict";Y7a()});var ltd,Z7a,$7a=h(()=>{"use strict";ltd={optional:"optional",nullable:"nullable",set:"set",list:"list",map:"map",literal:"literal"},Z7a=new Set(Object.values(ltd))});function cI(e){let t=e.match(/([\w.]+)<([\w,\s]+)>/);if(t?.[0]!=null&&t[1]!=null&&t[2]!=null&&!Z7a.has(t[1].trim()))return{name:t[1].trim(),arguments:t[2].split(",").map(r=>r.trim())}}var FXi=h(()=>{"use strict";$7a()});function jV(e){return cI(e)!=null}var eHa=h(()=>{"use strict";FXi()});var tHa=h(()=>{"use strict";eHa();FXi()});function NXi(e){if(e.request!=null)return typeof e.request=="string"?e.request:e.request.body}var rHa=h(()=>{"use strict"});var BH,nHa=h(()=>{"use strict";BH=class{REFERENCE_REGEX=/^(?:(\w+)::)?(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/;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[2]==null||n[3]==null))return{namespace:n[1],method:n[2],path:n[3]}}}});function nA(e){return typeof e=="string"?!1:e?.extends!=null||e?.properties!=null}var jXi=h(()=>{"use strict"});function bLe(e){return e?e.proto!=null:!1}var iHa=h(()=>{"use strict"});function EIe(e){return e===ptd}var ptd,oHa=h(()=>{"use strict";ptd="text"});var sHa=h(()=>{"use strict"});var aHa=h(()=>{"use strict"});var zXi=h(()=>{"use strict";sHa();aHa()});var cHa={};var uHa=h(()=>{"use strict";zXi()});var lHa=h(()=>{"use strict"});var Mp,pHa=h(()=>{"use strict";Xr();Mp={bearer:e=>({...e,type:"bearer",_visit:function(t){return Mp._visit(this,t)}}),basic:e=>({...e,type:"basic",_visit:function(t){return Mp._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return Mp._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return Mp._visit(this,t)}}),inferred:e=>({...e,type:"inferred",_visit:function(t){return Mp._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);case"inferred":return t.inferred(e);default:return t._other(e)}}}});var fHa=h(()=>{"use strict"});var ftd,bw,dHa=h(()=>{"use strict";ftd={All:"ALL",Any:"ANY",EndpointSecurity:"ENDPOINT_SECURITY"},bw={...ftd,_visit:(e,t)=>{switch(e){case bw.All:return t.all();case bw.Any:return t.any();case bw.EndpointSecurity:return t.endpointSecurity();default:return t._other()}}}});var mHa=h(()=>{"use strict"});var hHa=h(()=>{"use strict"});var gHa=h(()=>{"use strict"});var AHa=h(()=>{"use strict"});var yHa=h(()=>{"use strict"});var bHa=h(()=>{"use strict"});var EHa=h(()=>{"use strict"});var IHa=h(()=>{"use strict"});var vHa=h(()=>{"use strict"});var CHa=h(()=>{"use strict"});var xHa=h(()=>{"use strict"});var SHa=h(()=>{"use strict"});var wHa=h(()=>{"use strict"});var THa=h(()=>{"use strict"});var sD,OHa=h(()=>{"use strict";Xr();sD={clientCredentials:e=>({...e,type:"clientCredentials",_visit:function(t){return sD._visit(this,t)}}),authorizationCode:e=>({...e,type:"authorizationCode",_visit:function(t){return sD._visit(this,t)}}),deviceCode:e=>({...e,type:"deviceCode",_visit:function(t){return sD._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"clientCredentials":return t.clientCredentials(e);case"authorizationCode":return t.authorizationCode(e);case"deviceCode":return t.deviceCode(e);default:return t._other(e)}}}});var PHa=h(()=>{"use strict"});var BHa=h(()=>{"use strict"});var dtd,tLt,RHa=h(()=>{"use strict";dtd={S256:"S256"},tLt={...dtd,_visit:(e,t)=>e===tLt.S256?t.s256():t._other()}});var RH,DHa=h(()=>{"use strict";Xr();RH={literal:e=>({value:e,type:"literal",_visit:function(t){return RH._visit(this,t)}}),environmentVariable:e=>({value:e,type:"environmentVariable",_visit:function(t){return RH._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"literal":return t.literal(e.value);case"environmentVariable":return t.environmentVariable(e.value);default:return t._other(e)}}}});var kHa=h(()=>{"use strict"});var FHa=h(()=>{"use strict"});var NHa=h(()=>{"use strict"});var jHa=h(()=>{"use strict"});var QXi=h(()=>{"use strict";lHa();pHa();fHa();dHa();mHa();hHa();gHa();AHa();yHa();bHa();EHa();IHa();vHa();CHa();xHa();SHa();wHa();THa();OHa();PHa();BHa();RHa();DHa();kHa();FHa();NHa();jHa()});var MXi={};te(MXi,{AuthScheme:()=>Mp,AuthSchemesRequirement:()=>bw,OAuthConfiguration:()=>sD,OAuthPkceMethod:()=>tLt,OAuthPublicClientId:()=>RH});var zHa=h(()=>{"use strict";QXi()});var QHa=h(()=>{"use strict"});var mtd,fh,MHa=h(()=>{"use strict";mtd={InDevelopment:"IN_DEVELOPMENT",PreRelease:"PRE_RELEASE",GeneralAvailability:"GENERAL_AVAILABILITY",Deprecated:"DEPRECATED",Alpha:"ALPHA",Beta:"BETA",Preview:"PREVIEW",Legacy:"LEGACY"},fh={...mtd,_visit:(e,t)=>{switch(e){case fh.InDevelopment:return t.inDevelopment();case fh.PreRelease:return t.preRelease();case fh.GeneralAvailability:return t.generalAvailability();case fh.Deprecated:return t.deprecated();case fh.Alpha:return t.alpha();case fh.Beta:return t.beta();case fh.Preview:return t.preview();case fh.Legacy:return t.legacy();default:return t._other()}}}});var LHa=h(()=>{"use strict"});var _Ha=h(()=>{"use strict"});var UHa=h(()=>{"use strict"});var VHa=h(()=>{"use strict"});var GHa=h(()=>{"use strict"});var qHa=h(()=>{"use strict"});var WHa=h(()=>{"use strict"});var HHa=h(()=>{"use strict"});var KHa=h(()=>{"use strict"});var JHa=h(()=>{"use strict"});var YHa=h(()=>{"use strict"});var XHa=h(()=>{"use strict"});var ZHa=h(()=>{"use strict"});var $Ha=h(()=>{"use strict"});var eKa=h(()=>{"use strict"});var tKa=h(()=>{"use strict"});var rKa=h(()=>{"use strict"});var nKa=h(()=>{"use strict"});var iKa=h(()=>{"use strict"});var oKa=h(()=>{"use strict"});var sKa=h(()=>{"use strict"});var aKa=h(()=>{"use strict"});var cKa=h(()=>{"use strict"});var LXi=h(()=>{"use strict";QHa();MHa();LHa();_Ha();UHa();VHa();GHa();qHa();WHa();HHa();KHa();JHa();YHa();XHa();ZHa();$Ha();eKa();tKa();rKa();nKa();iKa();oKa();sKa();aKa();cKa()});var _Xi={};te(_Xi,{AvailabilityStatus:()=>fh});var uKa=h(()=>{"use strict";LXi()});var lKa=h(()=>{"use strict"});var UXi=h(()=>{"use strict";lKa()});var pKa={};var fKa=h(()=>{"use strict";UXi()});var dKa,mKa=h(()=>{"use strict";Xr();dKa={basic:e=>({...e,type:"basic",_visit:function(t){return sr.Auth._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return sr.Auth._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return sr.Auth._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return sr.Auth._visit(this,t)}}),inferred:e=>({...e,type:"inferred",_visit:function(t){return sr.Auth._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"oauth":return t.oauth(e);case"inferred":return t.inferred(e);default:return t._other(e)}}}});var htd,rLt,hKa=h(()=>{"use strict";htd={All:"ALL",Any:"ANY",EndpointSecurity:"ENDPOINT_SECURITY"},rLt={...htd,_visit:(e,t)=>{switch(e){case rLt.All:return t.all();case rLt.Any:return t.any();case rLt.EndpointSecurity:return t.endpointSecurity();default:return t._other()}}}});var gKa,AKa=h(()=>{"use strict";Xr();gKa={basic:e=>({...e,type:"basic",_visit:function(t){return sr.AuthValues._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return sr.AuthValues._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return sr.AuthValues._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return sr.AuthValues._visit(this,t)}}),inferred:e=>({...e,type:"inferred",_visit:function(t){return sr.AuthValues._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"oauth":return t.oauth(e);case"inferred":return t.inferred(e);default:return t._other(e)}}}});var yKa=h(()=>{"use strict"});var bKa=h(()=>{"use strict"});var EKa=h(()=>{"use strict"});var IKa=h(()=>{"use strict"});var vKa=h(()=>{"use strict"});var CKa=h(()=>{"use strict"});var xKa=h(()=>{"use strict"});var SKa=h(()=>{"use strict"});var wKa=h(()=>{"use strict"});var TKa=h(()=>{"use strict"});var OKa=h(()=>{"use strict"});var VXi=h(()=>{"use strict";mKa();hKa();AKa();yKa();bKa();EKa();IKa();vKa();CKa();xKa();SKa();wKa();TKa();OKa()});var GXi={};te(GXi,{Auth:()=>dKa,AuthRequirement:()=>rLt,AuthValues:()=>gKa});var PKa=h(()=>{"use strict";VXi()});var BKa=h(()=>{"use strict"});var RKa=h(()=>{"use strict"});var DKa=h(()=>{"use strict"});var kKa=h(()=>{"use strict"});var FKa=h(()=>{"use strict"});var NKa=h(()=>{"use strict"});var jKa=h(()=>{"use strict"});var zKa=h(()=>{"use strict"});var QKa=h(()=>{"use strict"});var qXi=h(()=>{"use strict";BKa();RKa();DKa();kKa();FKa();NKa();jKa();zKa();QKa()});var MKa={};var LKa=h(()=>{"use strict";qXi()});var _Ka=h(()=>{"use strict"});var WXi=h(()=>{"use strict";_Ka()});var UKa={};var VKa=h(()=>{"use strict";WXi()});var GKa=h(()=>{"use strict"});var qKa=h(()=>{"use strict"});var WKa=h(()=>{"use strict"});var HKa=h(()=>{"use strict"});var KKa=h(()=>{"use strict"});var JKa=h(()=>{"use strict"});var YKa,XKa=h(()=>{"use strict";Xr();YKa={file:e=>({...e,type:"file",_visit:function(t){return sr.FileUploadRequestBodyProperty._visit(this,t)}}),fileArray:e=>({...e,type:"fileArray",_visit:function(t){return sr.FileUploadRequestBodyProperty._visit(this,t)}}),bodyProperty:e=>({...e,type:"bodyProperty",_visit:function(t){return sr.FileUploadRequestBodyProperty._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"fileArray":return t.fileArray(e);case"bodyProperty":return t.bodyProperty(e);default:return t._other(e)}}}});var ZKa=h(()=>{"use strict"});var $Ka,eJa=h(()=>{"use strict";Xr();$Ka={properties:e=>({value:e,type:"properties",_visit:function(t){return sr.InlinedRequestBody._visit(this,t)}}),referenced:e=>({...e,type:"referenced",_visit:function(t){return sr.InlinedRequestBody._visit(this,t)}}),fileUpload:e=>({...e,type:"fileUpload",_visit:function(t){return sr.InlinedRequestBody._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"properties":return t.properties(e.value);case"referenced":return t.referenced(e);case"fileUpload":return t.fileUpload(e);default:return t._other(e)}}}});var tJa=h(()=>{"use strict"});var rJa=h(()=>{"use strict"});var nJa,iJa=h(()=>{"use strict";Xr();nJa={bytes:()=>({type:"bytes",_visit:function(e){return sr.ReferencedRequestBodyType._visit(this,e)}}),typeReference:e=>({value:e,type:"typeReference",_visit:function(t){return sr.ReferencedRequestBodyType._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bytes":return t.bytes();case"typeReference":return t.typeReference(e.value);default:return t._other(e)}}}});var oJa,sJa=h(()=>{"use strict";Xr();oJa={body:e=>({...e,type:"body",_visit:function(t){return sr.Request._visit(this,t)}}),inlined:e=>({...e,type:"inlined",_visit:function(t){return sr.Request._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"body":return t.body(e);case"inlined":return t.inlined(e);default:return t._other(e)}}}});var aJa,cJa=h(()=>{"use strict";Xr();aJa={json:()=>({type:"json",_visit:function(e){return sr.Response._visit(this,e)}}),streaming:()=>({type:"streaming",_visit:function(e){return sr.Response._visit(this,e)}}),streamParameter:()=>({type:"streamParameter",_visit:function(e){return sr.Response._visit(this,e)}}),fileDownload:()=>({type:"fileDownload",_visit:function(e){return sr.Response._visit(this,e)}}),text:()=>({type:"text",_visit:function(e){return sr.Response._visit(this,e)}}),bytes:()=>({type:"bytes",_visit:function(e){return sr.Response._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json();case"streaming":return t.streaming();case"streamParameter":return t.streamParameter();case"fileDownload":return t.fileDownload();case"text":return t.text();case"bytes":return t.bytes();default:return t._other(e)}}}});var HXi=h(()=>{"use strict";GKa();qKa();WKa();HKa();KKa();JKa();XKa();ZKa();eJa();tJa();rJa();iJa();sJa();cJa()});var KXi={};te(KXi,{FileUploadRequestBodyProperty:()=>YKa,InlinedRequestBody:()=>$Ka,ReferencedRequestBodyType:()=>nJa,Request:()=>oJa,Response:()=>aJa});var uJa=h(()=>{"use strict";HXi()});var lJa=h(()=>{"use strict"});var pJa=h(()=>{"use strict"});var fJa=h(()=>{"use strict"});var dJa,mJa=h(()=>{"use strict";Xr();dJa={singleBaseUrl:e=>({...e,type:"singleBaseUrl",_visit:function(t){return sr.Environments._visit(this,t)}}),multipleBaseUrls:e=>({...e,type:"multipleBaseUrls",_visit:function(t){return sr.Environments._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 hJa=h(()=>{"use strict"});var gJa=h(()=>{"use strict"});var AJa=h(()=>{"use strict"});var yJa=h(()=>{"use strict"});var bJa=h(()=>{"use strict"});var EJa=h(()=>{"use strict"});var IJa=h(()=>{"use strict"});var vJa=h(()=>{"use strict"});var JXi=h(()=>{"use strict";lJa();pJa();fJa();mJa();hJa();gJa();AJa();yJa();bJa();EJa();IJa();vJa()});var YXi={};te(YXi,{Environments:()=>dJa});var CJa=h(()=>{"use strict";JXi()});var gtd,IIe,xJa=h(()=>{"use strict";gtd={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD"},IIe={...gtd,_visit:(e,t)=>{switch(e){case IIe.Get:return t.get();case IIe.Post:return t.post();case IIe.Put:return t.put();case IIe.Patch:return t.patch();case IIe.Delete:return t.delete();case IIe.Head:return t.head();default:return t._other()}}}});var XXi=h(()=>{"use strict";xJa()});var ZXi={};te(ZXi,{HttpMethod:()=>IIe});var SJa=h(()=>{"use strict";XXi()});var wJa=h(()=>{"use strict"});var TJa=h(()=>{"use strict"});var OJa=h(()=>{"use strict"});var PJa,BJa=h(()=>{"use strict";Xr();PJa={publish:e=>({value:e,type:"publish",_visit:function(t){return sr.GeneratorOutputConfig._visit(this,t)}}),local:()=>({type:"local",_visit:function(e){return sr.GeneratorOutputConfig._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"publish":return t.publish(e.value);case"local":return t.local();default:return t._other(e)}}}});var RJa=h(()=>{"use strict"});var DJa=h(()=>{"use strict"});var kJa=h(()=>{"use strict"});var FJa=h(()=>{"use strict"});var NJa,jJa=h(()=>{"use strict";Xr();NJa={go:e=>({...e,type:"go",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),swift:e=>({...e,type:"swift",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),maven:e=>({...e,type:"maven",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),npm:e=>({...e,type:"npm",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),crates:e=>({...e,type:"crates",_visit:function(t){return sr.PublishInfo._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"go":return t.go(e);case"swift":return t.swift(e);case"maven":return t.maven(e);case"npm":return t.npm(e);case"nuget":return t.nuget(e);case"pypi":return t.pypi(e);case"rubygems":return t.rubygems(e);case"crates":return t.crates(e);default:return t._other(e)}}}});var zJa=h(()=>{"use strict"});var QJa=h(()=>{"use strict"});var MJa=h(()=>{"use strict"});var $Xi=h(()=>{"use strict";wJa();TJa();OJa();BJa();RJa();DJa();kJa();FJa();jJa();zJa();QJa();MJa()});var eZi={};te(eZi,{GeneratorOutputConfig:()=>PJa,PublishInfo:()=>NJa});var LJa=h(()=>{"use strict";$Xi()});var _Ja=h(()=>{"use strict"});var UJa=h(()=>{"use strict"});var VJa=h(()=>{"use strict"});var Atd,Bvr,GJa=h(()=>{"use strict";Atd={Critical:"CRITICAL",Warning:"WARNING"},Bvr={...Atd,_visit:(e,t)=>{switch(e){case Bvr.Critical:return t.critical();case Bvr.Warning:return t.warning();default:return t._other()}}}});var qJa=h(()=>{"use strict"});var tZi=h(()=>{"use strict";_Ja();UJa();VJa();GJa();qJa()});var rZi={};te(rZi,{ErrorSeverity:()=>Bvr});var WJa=h(()=>{"use strict";tZi()});var HJa=h(()=>{"use strict"});var KJa=h(()=>{"use strict"});var JJa=h(()=>{"use strict"});var YJa,XJa=h(()=>{"use strict";Xr();YJa={boolean:e=>({value:e,type:"boolean",_visit:function(t){return sr.LiteralType._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return sr.LiteralType._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 ZJa=h(()=>{"use strict"});var $Ja=h(()=>{"use strict"});var eYa,tYa=h(()=>{"use strict";Xr();eYa={alias:e=>({...e,type:"alias",_visit:function(t){return sr.NamedType._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return sr.NamedType._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return sr.NamedType._visit(this,t)}}),discriminatedUnion:e=>({...e,type:"discriminatedUnion",_visit:function(t){return sr.NamedType._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return sr.NamedType._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"discriminatedUnion":return t.discriminatedUnion(e);case"undiscriminatedUnion":return t.undiscriminatedUnion(e);default:return t._other(e)}}}});var ytd,Rvr,rYa=h(()=>{"use strict";ytd={ReadOnly:"READ_ONLY",WriteOnly:"WRITE_ONLY"},Rvr={...ytd,_visit:(e,t)=>{switch(e){case Rvr.ReadOnly:return t.readOnly();case Rvr.WriteOnly:return t.writeOnly();default:return t._other()}}}});var nYa=h(()=>{"use strict"});var btd,aD,iYa=h(()=>{"use strict";btd={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",DateTimeRfc2822:"DATE_TIME_RFC_2822",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER"},aD={...btd,_visit:(e,t)=>{switch(e){case aD.Integer:return t.integer();case aD.Long:return t.long();case aD.Uint:return t.uint();case aD.Uint64:return t.uint64();case aD.Float:return t.float();case aD.Double:return t.double();case aD.Boolean:return t.boolean();case aD.String:return t.string();case aD.Date:return t.date();case aD.DateTime:return t.dateTime();case aD.DateTimeRfc2822:return t.dateTimeRfc2822();case aD.Uuid:return t.uuid();case aD.Base64:return t.base64();case aD.BigInteger:return t.bigInteger();default:return t._other()}}}});var oYa,sYa=h(()=>{"use strict";Xr();oYa={samePropertiesAsObject:e=>({...e,type:"samePropertiesAsObject",_visit:function(t){return sr.SingleDiscriminatedUnionType._visit(this,t)}}),singleProperty:e=>({...e,type:"singleProperty",_visit:function(t){return sr.SingleDiscriminatedUnionType._visit(this,t)}}),noProperties:e=>({...e,type:"noProperties",_visit:function(t){return sr.SingleDiscriminatedUnionType._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"samePropertiesAsObject":return t.samePropertiesAsObject(e);case"singleProperty":return t.singleProperty(e);case"noProperties":return t.noProperties(e);default:return t._other(e)}}}});var aYa=h(()=>{"use strict"});var cYa=h(()=>{"use strict"});var uYa=h(()=>{"use strict"});var lYa,pYa=h(()=>{"use strict";Xr();lYa={list:e=>({value:e,type:"list",_visit:function(t){return sr.TypeReference._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return sr.TypeReference._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return sr.TypeReference._visit(this,t)}}),named:e=>({value:e,type:"named",_visit:function(t){return sr.TypeReference._visit(this,t)}}),nullable:e=>({value:e,type:"nullable",_visit:function(t){return sr.TypeReference._visit(this,t)}}),optional:e=>({value:e,type:"optional",_visit:function(t){return sr.TypeReference._visit(this,t)}}),primitive:e=>({value:e,type:"primitive",_visit:function(t){return sr.TypeReference._visit(this,t)}}),set:e=>({value:e,type:"set",_visit:function(t){return sr.TypeReference._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return sr.TypeReference._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.value);case"literal":return t.literal(e.value);case"map":return t.map(e);case"named":return t.named(e.value);case"nullable":return t.nullable(e.value);case"optional":return t.optional(e.value);case"primitive":return t.primitive(e.value);case"set":return t.set(e.value);case"unknown":return t.unknown();default:return t._other(e)}}}});var fYa=h(()=>{"use strict"});var nZi=h(()=>{"use strict";HJa();KJa();JJa();XJa();ZJa();$Ja();tYa();rYa();nYa();iYa();sYa();aYa();cYa();uYa();pYa();fYa()});var iZi={};te(iZi,{LiteralType:()=>YJa,NamedType:()=>eYa,ObjectPropertyAccess:()=>Rvr,PrimitiveTypeV1:()=>aD,SingleDiscriminatedUnionType:()=>oYa,TypeReference:()=>lYa});var dYa=h(()=>{"use strict";nZi()});var mYa=h(()=>{"use strict"});var oZi=h(()=>{"use strict";mYa()});var hYa={};var gYa=h(()=>{"use strict";oZi()});var AYa=h(()=>{"use strict";PKa();VXi();LKa();qXi();VKa();WXi();uJa();HXi();CJa();JXi();SJa();XXi();LJa();$Xi();WJa();tZi();dYa();nZi();gYa();oZi()});var sr={};te(sr,{Auth:()=>dKa,AuthRequirement:()=>rLt,AuthValues:()=>gKa,Environments:()=>dJa,ErrorSeverity:()=>Bvr,FileUploadRequestBodyProperty:()=>YKa,GeneratorOutputConfig:()=>PJa,HttpMethod:()=>IIe,InlinedRequestBody:()=>$Ka,LiteralType:()=>YJa,NamedType:()=>eYa,ObjectPropertyAccess:()=>Rvr,PrimitiveTypeV1:()=>aD,PublishInfo:()=>NJa,ReferencedRequestBodyType:()=>nJa,Request:()=>oJa,Response:()=>aJa,SingleDiscriminatedUnionType:()=>oYa,TypeReference:()=>lYa,auth:()=>GXi,commons:()=>MKa,declaration:()=>UKa,endpoints:()=>KXi,environment:()=>YXi,http:()=>ZXi,ir:()=>eZi,snippets:()=>rZi,types:()=>iZi,variables:()=>hYa});var yYa=h(()=>{"use strict";AYa()});var bYa=h(()=>{"use strict"});var EYa=h(()=>{"use strict"});var IYa=h(()=>{"use strict"});var Z0,vYa=h(()=>{"use strict";Xr();Z0={singleBaseUrl:e=>({...e,type:"singleBaseUrl",_visit:function(t){return Z0._visit(this,t)}}),multipleBaseUrls:e=>({...e,type:"multipleBaseUrls",_visit:function(t){return Z0._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 CYa=h(()=>{"use strict"});var xYa=h(()=>{"use strict"});var SYa=h(()=>{"use strict"});var wYa=h(()=>{"use strict"});var TYa=h(()=>{"use strict"});var OYa=h(()=>{"use strict"});var PYa=h(()=>{"use strict"});var sZi=h(()=>{"use strict";bYa();EYa();IYa();vYa();CYa();xYa();SYa();wYa();TYa();OYa();PYa()});var aZi={};te(aZi,{Environments:()=>Z0});var BYa=h(()=>{"use strict";sZi()});var RYa=h(()=>{"use strict"});var DYa=h(()=>{"use strict"});var vIe,kYa=h(()=>{"use strict";Xr();vIe={property:e=>({value:e,type:"property",_visit:function(t){return vIe._visit(this,t)}}),statusCode:()=>({type:"statusCode",_visit:function(e){return vIe._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"property":return t.property(e.value);case"statusCode":return t.statusCode();default:return t._other(e)}}}});var FYa=h(()=>{"use strict"});var cZi=h(()=>{"use strict";RYa();DYa();kYa();FYa()});var uZi={};te(uZi,{ErrorDeclarationDiscriminantValue:()=>vIe});var NYa=h(()=>{"use strict";cZi()});var jYa=h(()=>{"use strict"});var zYa=h(()=>{"use strict"});var QYa=h(()=>{"use strict"});var MYa=h(()=>{"use strict"});var LYa=h(()=>{"use strict"});var zV,_Ya=h(()=>{"use strict";Xr();zV={basic:e=>({...e,type:"basic",_visit:function(t){return zV._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return zV._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return zV._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return zV._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"oauth":return t.oauth(e);default:return t._other(e)}}}});var UYa=h(()=>{"use strict"});var Etd,s$,VYa=h(()=>{"use strict";Etd={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD"},s$={...Etd,_visit:(e,t)=>{switch(e){case s$.Get:return t.get();case s$.Post:return t.post();case s$.Put:return t.put();case s$.Patch:return t.patch();case s$.Delete:return t.delete();case s$.Head:return t.head();default:return t._other()}}}});var GYa=h(()=>{"use strict"});var qYa=h(()=>{"use strict"});var WYa=h(()=>{"use strict"});var HYa=h(()=>{"use strict"});var KYa=h(()=>{"use strict"});var JYa=h(()=>{"use strict"});var Gx,YYa=h(()=>{"use strict";Xr();Gx={error:e=>({value:e,type:"error",_visit:function(t){return Gx._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return Gx._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return Gx._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"error":return t.error(e.value);case"json":return t.json(e.value);case"stream":return t.stream(e.value);default:return t._other(e)}}}});var XYa=h(()=>{"use strict"});var ZYa=h(()=>{"use strict"});var $Ya=h(()=>{"use strict"});var eXa=h(()=>{"use strict"});var tXa=h(()=>{"use strict"});var rXa=h(()=>{"use strict"});var nXa=h(()=>{"use strict"});var iXa=h(()=>{"use strict"});var oXa=h(()=>{"use strict"});var sXa=h(()=>{"use strict"});var lZi=h(()=>{"use strict";jYa();zYa();QYa();MYa();LYa();_Ya();UYa();VYa();GYa();qYa();WYa();HYa();KYa();JYa();YYa();XYa();ZYa();$Ya();eXa();tXa();rXa();nXa();iXa();oXa();sXa()});var pZi={};te(pZi,{V2AuthValues:()=>zV,V2EndpointLocationHttpMethod:()=>s$,V2HttpEndpointResponseBody:()=>Gx});var aXa=h(()=>{"use strict";lZi()});var cXa=h(()=>{"use strict"});var uXa=h(()=>{"use strict"});var lXa=h(()=>{"use strict"});var pXa=h(()=>{"use strict"});var fXa=h(()=>{"use strict"});var dXa=h(()=>{"use strict"});var mXa,hXa=h(()=>{"use strict";Xr();mXa={local:()=>({type:"local",_visit:function(e){return gc.GeneratorEnvironment._visit(this,e)}}),remote:e=>({...e,type:"remote",_visit:function(t){return gc.GeneratorEnvironment._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"local":return t.local();case"remote":return t.remote(e);default:return t._other(e)}}}});var gXa=h(()=>{"use strict"});var AXa=h(()=>{"use strict"});var yXa,bXa=h(()=>{"use strict";Xr();yXa={maven:e=>({...e,type:"maven",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),npm:e=>({...e,type:"npm",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),postman:e=>({...e,type:"postman",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),crates:e=>({...e,type:"crates",_visit:function(t){return gc.GeneratorPublishTarget._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"maven":return t.maven(e);case"npm":return t.npm(e);case"pypi":return t.pypi(e);case"postman":return t.postman(e);case"rubygems":return t.rubygems(e);case"nuget":return t.nuget(e);case"crates":return t.crates(e);default:return t._other(e)}}}});var EXa=h(()=>{"use strict"});var IXa=h(()=>{"use strict"});var vXa=h(()=>{"use strict"});var CXa,xXa=h(()=>{"use strict";Xr();CXa={npm:e=>({...e,type:"npm",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),maven:e=>({...e,type:"maven",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),postman:e=>({...e,type:"postman",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),crates:e=>({...e,type:"crates",_visit:function(t){return gc.GithubPublishInfo._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"npm":return t.npm(e);case"maven":return t.maven(e);case"postman":return t.postman(e);case"pypi":return t.pypi(e);case"rubygems":return t.rubygems(e);case"nuget":return t.nuget(e);case"crates":return t.crates(e);default:return t._other(e)}}}});var SXa,wXa=h(()=>{"use strict";Xr();SXa={basic:e=>({...e,type:"basic",_visit:function(t){return gc.LicenseConfig._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return gc.LicenseConfig._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"custom":return t.custom(e);default:return t._other(e)}}}});var Itd,Dvr,TXa=h(()=>{"use strict";Itd={Mit:"MIT",Apache2:"Apache-2.0"},Dvr={...Itd,_visit:(e,t)=>{switch(e){case Dvr.Mit:return t.mit();case Dvr.Apache2:return t.apache2();default:return t._other()}}}});var OXa=h(()=>{"use strict"});var PXa=h(()=>{"use strict"});var BXa=h(()=>{"use strict"});var RXa=h(()=>{"use strict"});var DXa=h(()=>{"use strict"});var kXa=h(()=>{"use strict"});var FXa=h(()=>{"use strict"});var NXa=h(()=>{"use strict"});var jXa=h(()=>{"use strict"});var zXa=h(()=>{"use strict"});var QXa=h(()=>{"use strict"});var MXa=h(()=>{"use strict"});var LXa,_Xa=h(()=>{"use strict";Xr();LXa={publish:e=>({...e,type:"publish",_visit:function(t){return gc.OutputMode._visit(this,t)}}),downloadFiles:()=>({type:"downloadFiles",_visit:function(e){return gc.OutputMode._visit(this,e)}}),github:e=>({...e,type:"github",_visit:function(t){return gc.OutputMode._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"publish":return t.publish(e);case"downloadFiles":return t.downloadFiles();case"github":return t.github(e);default:return t._other(e)}}}});var UXa=h(()=>{"use strict"});var VXa=h(()=>{"use strict"});var GXa=h(()=>{"use strict"});var qXa=h(()=>{"use strict"});var WXa=h(()=>{"use strict"});var HXa=h(()=>{"use strict"});var KXa=h(()=>{"use strict"});var JXa=h(()=>{"use strict"});var YXa=h(()=>{"use strict"});var fZi=h(()=>{"use strict";cXa();uXa();lXa();pXa();fXa();dXa();hXa();gXa();AXa();bXa();EXa();IXa();vXa();xXa();wXa();TXa();OXa();PXa();BXa();RXa();DXa();kXa();FXa();NXa();jXa();zXa();QXa();MXa();_Xa();UXa();VXa();GXa();qXa();WXa();HXa();KXa();JXa();YXa()});var dZi={};te(dZi,{GeneratorEnvironment:()=>mXa,GeneratorPublishTarget:()=>yXa,GithubPublishInfo:()=>CXa,LicenseConfig:()=>SXa,LicenseId:()=>Dvr,OutputMode:()=>LXa});var XXa=h(()=>{"use strict";fZi()});var ZXa=h(()=>{"use strict";XXa();fZi()});var gc={};te(gc,{GeneratorEnvironment:()=>mXa,GeneratorPublishTarget:()=>yXa,GithubPublishInfo:()=>CXa,LicenseConfig:()=>SXa,LicenseId:()=>Dvr,OutputMode:()=>LXa,config:()=>dZi});var $Xa=h(()=>{"use strict";ZXa()});var eZa=h(()=>{"use strict"});var vtd,kvr,tZa=h(()=>{"use strict";vtd={Explicit:"explicit",Auto:"auto"},kvr={...vtd,_visit:(e,t)=>{switch(e){case kvr.Explicit:return t.explicit();case kvr.Auto:return t.auto();default:return t._other()}}}});var rZa=h(()=>{"use strict"});var Ctd,iet,nZa=h(()=>{"use strict";Ctd={Header:"header",Query:"query",Body:"body",Path:"path"},iet={...Ctd,_visit:(e,t)=>{switch(e){case iet.Header:return t.header();case iet.Query:return t.query();case iet.Body:return t.body();case iet.Path:return t.path();default:return t._other()}}}});var mZi=h(()=>{"use strict";eZa();tZa();rZa();nZa()});var hZi={};te(hZi,{GlobalParameterApplyMode:()=>kvr,GlobalParameterLocation:()=>iet});var iZa=h(()=>{"use strict";mZi()});var oZa=h(()=>{"use strict"});var sZa=h(()=>{"use strict"});var aZa=h(()=>{"use strict"});var cZa=h(()=>{"use strict"});var uZa=h(()=>{"use strict"});var lZa=h(()=>{"use strict"});var pZa=h(()=>{"use strict"});var F3,fZa=h(()=>{"use strict";Xr();F3={language:e=>({...e,type:"language",_visit:function(t){return F3._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return F3._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 dZa=h(()=>{"use strict"});var mZa=h(()=>{"use strict"});var hZa=h(()=>{"use strict"});var gZa=h(()=>{"use strict"});var uy,AZa=h(()=>{"use strict";Xr();uy={body:e=>({value:e,type:"body",_visit:function(t){return uy._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return uy._visit(this,t)}}),sse:e=>({value:e,type:"sse",_visit:function(t){return uy._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 yZa=h(()=>{"use strict"});var bZa=h(()=>{"use strict"});var EZa=h(()=>{"use strict"});var IZa=h(()=>{"use strict"});var vZa=h(()=>{"use strict"});var CZa=h(()=>{"use strict"});var Ew,xZa=h(()=>{"use strict";Xr();Ew={single:()=>({type:"single",_visit:function(e){return Ew._visit(this,e)}}),exploded:()=>({type:"exploded",_visit:function(e){return Ew._visit(this,e)}}),commaSeparated:()=>({type:"commaSeparated",_visit:function(e){return Ew._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 rB,SZa=h(()=>{"use strict";Xr();rB={inlinedRequestBody:e=>({...e,type:"inlinedRequestBody",_visit:function(t){return rB._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return rB._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 iA,wZa=h(()=>{"use strict";Xr();iA={ok:e=>({value:e,type:"ok",_visit:function(t){return iA._visit(this,t)}}),error:e=>({...e,type:"error",_visit:function(t){return iA._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 TZa=h(()=>{"use strict"});var OZa=h(()=>{"use strict"});var nQ,PZa=h(()=>{"use strict";Xr();nQ={file:e=>({...e,type:"file",_visit:function(t){return nQ._visit(this,t)}}),fileArray:e=>({...e,type:"fileArray",_visit:function(t){return nQ._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 BZa=h(()=>{"use strict"});var RZa=h(()=>{"use strict"});var DZa=h(()=>{"use strict"});var xtd,nLt,kZa=h(()=>{"use strict";xtd={Exploded:"exploded",Json:"json",Form:"form"},nLt={...xtd,_visit:(e,t)=>{switch(e){case nLt.Exploded:return t.exploded();case nLt.Json:return t.json();case nLt.Form:return t.form();default:return t._other()}}}});var FZa=h(()=>{"use strict"});var qx,NZa=h(()=>{"use strict";Xr();qx={file:e=>({value:e,type:"file",_visit:function(t){return qx._visit(this,t)}}),bodyProperty:e=>({...e,type:"bodyProperty",_visit:function(t){return qx._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 jZa=h(()=>{"use strict"});var zZa=h(()=>{"use strict"});var QZa=h(()=>{"use strict"});var cD,MZa=h(()=>{"use strict";Xr();cD={proto:e=>({...e,type:"proto",_visit:function(t){return cD._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return cD._visit(this,e)}}),openrpc:()=>({type:"openrpc",_visit:function(e){return cD._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"proto":return t.proto(e);case"openapi":return t.openapi();case"openrpc":return t.openrpc();default:return t._other(e)}}}});var LZa=h(()=>{"use strict"});var Std,Im,_Za=h(()=>{"use strict";Std={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD"},Im={...Std,_visit:(e,t)=>{switch(e){case Im.Get:return t.get();case Im.Post:return t.post();case Im.Put:return t.put();case Im.Patch:return t.patch();case Im.Delete:return t.delete();case Im.Head:return t.head();default:return t._other()}}}});var UZa=h(()=>{"use strict"});var VZa=h(()=>{"use strict"});var bd,GZa=h(()=>{"use strict";Xr();bd={inlinedRequestBody:e=>({...e,type:"inlinedRequestBody",_visit:function(t){return bd._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return bd._visit(this,t)}}),fileUpload:e=>({...e,type:"fileUpload",_visit:function(t){return bd._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return bd._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 qZa=h(()=>{"use strict"});var WZa=h(()=>{"use strict"});var ju,HZa=h(()=>{"use strict";Xr();ju={json:e=>({value:e,type:"json",_visit:function(t){return ju._visit(this,t)}}),fileDownload:e=>({...e,type:"fileDownload",_visit:function(t){return ju._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return ju._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return ju._visit(this,t)}}),streaming:e=>({value:e,type:"streaming",_visit:function(t){return ju._visit(this,t)}}),streamParameter:e=>({...e,type:"streamParameter",_visit:function(t){return ju._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"bytes":return t.bytes(e);case"streaming":return t.streaming(e.value);case"streamParameter":return t.streamParameter(e);default:return t._other(e)}}}});var KZa=h(()=>{"use strict"});var JZa=h(()=>{"use strict"});var YZa=h(()=>{"use strict"});var uI,XZa=h(()=>{"use strict";Xr();uI={response:e=>({...e,type:"response",_visit:function(t){return uI._visit(this,t)}}),nestedPropertyAsResponse:e=>({...e,type:"nestedPropertyAsResponse",_visit:function(t){return uI._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 ZZa=h(()=>{"use strict"});var $Za=h(()=>{"use strict"});var e$a=h(()=>{"use strict"});var nB,t$a=h(()=>{"use strict";Xr();nB={json:e=>({value:e,type:"json",_visit:function(t){return nB._visit(this,t)}}),fileDownload:e=>({...e,type:"fileDownload",_visit:function(t){return nB._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return nB._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return nB._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"bytes":return t.bytes(e);default:return t._other(e)}}}});var r$a=h(()=>{"use strict"});var $0,n$a=h(()=>{"use strict";Xr();$0={cursor:e=>({...e,type:"cursor",_visit:function(t){return $0._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return $0._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return $0._visit(this,t)}}),uri:e=>({...e,type:"uri",_visit:function(t){return $0._visit(this,t)}}),path:e=>({...e,type:"path",_visit:function(t){return $0._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);case"custom":return t.custom(e);case"uri":return t.uri(e);case"path":return t.path(e);default:return t._other(e)}}}});var i$a=h(()=>{"use strict"});var o$a=h(()=>{"use strict"});var wtd,iLt,s$a=h(()=>{"use strict";wtd={Root:"ROOT",Service:"SERVICE",Endpoint:"ENDPOINT"},iLt={...wtd,_visit:(e,t)=>{switch(e){case iLt.Root:return t.root();case iLt.Service:return t.service();case iLt.Endpoint:return t.endpoint();default:return t._other()}}}});var a$a=h(()=>{"use strict"});var c$a=h(()=>{"use strict"});var u$a=h(()=>{"use strict"});var l$a=h(()=>{"use strict"});var iB,p$a=h(()=>{"use strict";Xr();iB={query:e=>({...e,type:"query",_visit:function(t){return iB._visit(this,t)}}),body:e=>({...e,type:"body",_visit:function(t){return iB._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 f$a=h(()=>{"use strict"});var d$a=h(()=>{"use strict"});var m$a=h(()=>{"use strict"});var h$a=h(()=>{"use strict"});var g$a=h(()=>{"use strict"});var A$a=h(()=>{"use strict"});var DH,y$a=h(()=>{"use strict";Xr();DH={typeReference:e=>({...e,type:"typeReference",_visit:function(t){return DH._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return DH._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 QV,b$a=h(()=>{"use strict";Xr();QV={justRequestBody:e=>({value:e,type:"justRequestBody",_visit:function(t){return QV._visit(this,t)}}),wrapper:e=>({...e,type:"wrapper",_visit:function(t){return QV._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 E$a=h(()=>{"use strict"});var I$a=h(()=>{"use strict"});var dv,v$a=h(()=>{"use strict";Xr();dv={json:e=>({...e,type:"json",_visit:function(t){return dv._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return dv._visit(this,t)}}),sse:e=>({...e,type:"sse",_visit:function(t){return dv._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 C$a=h(()=>{"use strict"});var Ttd,N3,x$a=h(()=>{"use strict";Ttd={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",Php:"php",Rust:"rust",Swift:"swift"},N3={...Ttd,_visit:(e,t)=>{switch(e){case N3.Curl:return t.curl();case N3.Python:return t.python();case N3.Javascript:return t.javascript();case N3.Typescript:return t.typescript();case N3.Go:return t.go();case N3.Ruby:return t.ruby();case N3.Csharp:return t.csharp();case N3.Java:return t.java();case N3.Php:return t.php();case N3.Rust:return t.rust();case N3.Swift:return t.swift();default:return t._other()}}}});var S$a=h(()=>{"use strict"});var w$a=h(()=>{"use strict"});var MV,T$a=h(()=>{"use strict";Xr();MV={http:()=>({type:"http",_visit:function(e){return MV._visit(this,e)}}),grpc:e=>({...e,type:"grpc",_visit:function(t){return MV._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 O$a=h(()=>{"use strict"});var P$a=h(()=>{"use strict"});var B$a=h(()=>{"use strict"});var R$a=h(()=>{"use strict"});var gZi=h(()=>{"use strict";oZa();sZa();aZa();cZa();uZa();lZa();pZa();fZa();dZa();mZa();hZa();gZa();AZa();yZa();bZa();EZa();IZa();vZa();CZa();xZa();SZa();wZa();TZa();OZa();PZa();BZa();RZa();DZa();kZa();FZa();NZa();jZa();zZa();QZa();MZa();LZa();_Za();UZa();VZa();GZa();qZa();WZa();HZa();KZa();JZa();YZa();XZa();ZZa();$Za();e$a();t$a();r$a();n$a();i$a();o$a();s$a();a$a();c$a();u$a();l$a();p$a();f$a();d$a();m$a();h$a();g$a();A$a();y$a();b$a();E$a();I$a();v$a();C$a();x$a();S$a();w$a();T$a();O$a();P$a();B$a();R$a()});var AZi={};te(AZi,{ExampleCodeSample:()=>F3,ExampleEndpointSuccessResponse:()=>uy,ExampleQueryParameterShape:()=>Ew,ExampleRequestBody:()=>rB,ExampleResponse:()=>iA,FileProperty:()=>nQ,FileUploadBodyPropertyEncoding:()=>nLt,FileUploadRequestProperty:()=>qx,HttpEndpointSource:()=>cD,HttpMethod:()=>Im,HttpRequestBody:()=>bd,HttpResponseBody:()=>ju,JsonResponse:()=>uI,NonStreamHttpResponseBody:()=>nB,Pagination:()=>$0,PathParameterLocation:()=>iLt,RequestPropertyValue:()=>iB,SdkRequestBodyType:()=>DH,SdkRequestShape:()=>QV,StreamingResponse:()=>dv,SupportedSdkLanguage:()=>N3,Transport:()=>MV});var D$a=h(()=>{"use strict";gZi()});var iQ,k$a=h(()=>{"use strict";Xr();iQ={proto:e=>({...e,type:"proto",_visit:function(t){return iQ._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return iQ._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 F$a=h(()=>{"use strict"});var CIe,N$a=h(()=>{"use strict";Xr();CIe={header:e=>({...e,type:"header",_visit:function(t){return CIe._visit(this,t)}}),_visit:(e,t)=>e.type==="header"?t.header(e):t._other(e)}});var j$a=h(()=>{"use strict"});var z$a=h(()=>{"use strict"});var j3,Q$a=h(()=>{"use strict";Xr();j3={statusCode:()=>({type:"statusCode",_visit:function(e){return j3._visit(this,e)}}),property:e=>({...e,type:"property",_visit:function(t){return j3._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 Otd,Fvr,M$a=h(()=>{"use strict";Otd={Minimal:"minimal",Comprehensive:"comprehensive"},Fvr={...Otd,_visit:(e,t)=>{switch(e){case Fvr.Minimal:return t.minimal();case Fvr.Comprehensive:return t.comprehensive();default:return t._other()}}}});var L$a=h(()=>{"use strict"});var _$a=h(()=>{"use strict"});var U$a=h(()=>{"use strict"});var V$a=h(()=>{"use strict"});var Ptd,oet,G$a=h(()=>{"use strict";Ptd={Autopilot:"autopilot",Autorelease:"autorelease",Ci:"ci",Manual:"manual"},oet={...Ptd,_visit:(e,t)=>{switch(e){case oet.Autopilot:return t.autopilot();case oet.Autorelease:return t.autorelease();case oet.Ci:return t.ci();case oet.Manual:return t.manual();default:return t._other()}}}});var q$a=h(()=>{"use strict"});var W$a=h(()=>{"use strict"});var H$a=h(()=>{"use strict"});var K$a=h(()=>{"use strict"});var J$a=h(()=>{"use strict"});var Y$a=h(()=>{"use strict"});var X$a=h(()=>{"use strict"});var Z$a=h(()=>{"use strict"});var $$a=h(()=>{"use strict"});var eec=h(()=>{"use strict"});var tec=h(()=>{"use strict"});var yZi=h(()=>{"use strict";k$a();F$a();N$a();j$a();z$a();Q$a();M$a();L$a();_$a();U$a();V$a();G$a();q$a();W$a();H$a();K$a();J$a();Y$a();X$a();Z$a();$$a();eec();tec()});var bZi={};te(bZi,{ApiDefinitionSource:()=>iQ,ApiVersionScheme:()=>CIe,ErrorDiscriminationStrategy:()=>j3,ExampleStyle:()=>Fvr,InvocationSource:()=>oet});var rec=h(()=>{"use strict";yZi()});var nec=h(()=>{"use strict"});var iec=h(()=>{"use strict"});var oec=h(()=>{"use strict"});var Btd,kH,sec=h(()=>{"use strict";Btd={Unary:"UNARY",ClientStream:"CLIENT_STREAM",ServerStream:"SERVER_STREAM",BidirectionalStream:"BIDIRECTIONAL_STREAM"},kH={...Btd,_visit:(e,t)=>{switch(e){case kH.Unary:return t.unary();case kH.ClientStream:return t.clientStream();case kH.ServerStream:return t.serverStream();case kH.BidirectionalStream:return t.bidirectionalStream();default:return t._other()}}}});var aec=h(()=>{"use strict"});var Zp,cec=h(()=>{"use strict";Xr();Zp={wellKnown:e=>({value:e,type:"wellKnown",_visit:function(t){return Zp._visit(this,t)}}),userDefined:e=>({...e,type:"userDefined",_visit:function(t){return Zp._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 uec=h(()=>{"use strict"});var Ci,lec=h(()=>{"use strict";Xr();Ci={any:()=>({type:"any",_visit:function(e){return Ci._visit(this,e)}}),api:()=>({type:"api",_visit:function(e){return Ci._visit(this,e)}}),boolValue:()=>({type:"boolValue",_visit:function(e){return Ci._visit(this,e)}}),bytesValue:()=>({type:"bytesValue",_visit:function(e){return Ci._visit(this,e)}}),doubleValue:()=>({type:"doubleValue",_visit:function(e){return Ci._visit(this,e)}}),duration:()=>({type:"duration",_visit:function(e){return Ci._visit(this,e)}}),empty:()=>({type:"empty",_visit:function(e){return Ci._visit(this,e)}}),enum:()=>({type:"enum",_visit:function(e){return Ci._visit(this,e)}}),enumValue:()=>({type:"enumValue",_visit:function(e){return Ci._visit(this,e)}}),field:()=>({type:"field",_visit:function(e){return Ci._visit(this,e)}}),fieldCardinality:()=>({type:"fieldCardinality",_visit:function(e){return Ci._visit(this,e)}}),fieldKind:()=>({type:"fieldKind",_visit:function(e){return Ci._visit(this,e)}}),fieldMask:()=>({type:"fieldMask",_visit:function(e){return Ci._visit(this,e)}}),floatValue:()=>({type:"floatValue",_visit:function(e){return Ci._visit(this,e)}}),int32Value:()=>({type:"int32Value",_visit:function(e){return Ci._visit(this,e)}}),int64Value:()=>({type:"int64Value",_visit:function(e){return Ci._visit(this,e)}}),listValue:()=>({type:"listValue",_visit:function(e){return Ci._visit(this,e)}}),method:()=>({type:"method",_visit:function(e){return Ci._visit(this,e)}}),mixin:()=>({type:"mixin",_visit:function(e){return Ci._visit(this,e)}}),nullValue:()=>({type:"nullValue",_visit:function(e){return Ci._visit(this,e)}}),option:()=>({type:"option",_visit:function(e){return Ci._visit(this,e)}}),sourceContext:()=>({type:"sourceContext",_visit:function(e){return Ci._visit(this,e)}}),stringValue:()=>({type:"stringValue",_visit:function(e){return Ci._visit(this,e)}}),struct:()=>({type:"struct",_visit:function(e){return Ci._visit(this,e)}}),syntax:()=>({type:"syntax",_visit:function(e){return Ci._visit(this,e)}}),timestamp:()=>({type:"timestamp",_visit:function(e){return Ci._visit(this,e)}}),type:()=>({type:"type",_visit:function(e){return Ci._visit(this,e)}}),uint32Value:()=>({type:"uint32Value",_visit:function(e){return Ci._visit(this,e)}}),uint64Value:()=>({type:"uint64Value",_visit:function(e){return Ci._visit(this,e)}}),value:()=>({type:"value",_visit:function(e){return Ci._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 EZi=h(()=>{"use strict";nec();iec();oec();sec();aec();cec();uec();lec()});var IZi={};te(IZi,{ProtobufMethodType:()=>kH,ProtobufType:()=>Zp,WellKnownProtobufType:()=>Ci});var pec=h(()=>{"use strict";EZi()});var fec=h(()=>{"use strict"});var dec=h(()=>{"use strict"});var mec=h(()=>{"use strict"});var hec=h(()=>{"use strict"});var gec=h(()=>{"use strict"});var Aec=h(()=>{"use strict"});var yec=h(()=>{"use strict"});var bec=h(()=>{"use strict"});var Eec=h(()=>{"use strict"});var Iec=h(()=>{"use strict"});var a$,vec=h(()=>{"use strict";Xr();a$={github:e=>({...e,type:"github",_visit:function(t){return a$._visit(this,t)}}),direct:e=>({...e,type:"direct",_visit:function(t){return a$._visit(this,t)}}),filesystem:e=>({...e,type:"filesystem",_visit:function(t){return a$._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"github":return t.github(e);case"direct":return t.direct(e);case"filesystem":return t.filesystem(e);default:return t._other(e)}}}});var Ed,Cec=h(()=>{"use strict";Xr();Ed={postman:e=>({...e,type:"postman",_visit:function(t){return Ed._visit(this,t)}}),npm:e=>({...e,type:"npm",_visit:function(t){return Ed._visit(this,t)}}),maven:e=>({...e,type:"maven",_visit:function(t){return Ed._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return Ed._visit(this,t)}}),crates:e=>({...e,type:"crates",_visit:function(t){return Ed._visit(this,t)}}),go:e=>({...e,type:"go",_visit:function(t){return Ed._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return Ed._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return Ed._visit(this,t)}}),packagist:e=>({...e,type:"packagist",_visit:function(t){return Ed._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"postman":return t.postman(e);case"npm":return t.npm(e);case"maven":return t.maven(e);case"pypi":return t.pypi(e);case"crates":return t.crates(e);case"go":return t.go(e);case"nuget":return t.nuget(e);case"rubygems":return t.rubygems(e);case"packagist":return t.packagist(e);default:return t._other(e)}}}});var xec=h(()=>{"use strict"});var Sec=h(()=>{"use strict"});var vZi=h(()=>{"use strict";fec();dec();mec();hec();gec();Aec();yec();bec();Eec();Iec();vec();Cec();xec();Sec()});var CZi={};te(CZi,{PublishTarget:()=>Ed,PublishingConfig:()=>a$});var wec=h(()=>{"use strict";vZi()});var Tec=h(()=>{"use strict"});var Oec=h(()=>{"use strict"});var Pec=h(()=>{"use strict"});var Bec=h(()=>{"use strict"});var Is,Rec=h(()=>{"use strict";Xr();Is={list:e=>({list:e,type:"list",_visit:function(t){return Is._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Is._visit(this,t)}}),nullable:e=>({nullable:e,type:"nullable",_visit:function(t){return Is._visit(this,t)}}),optional:e=>({optional:e,type:"optional",_visit:function(t){return Is._visit(this,t)}}),set:e=>({set:e,type:"set",_visit:function(t){return Is._visit(this,t)}}),literal:e=>({literal:e,type:"literal",_visit:function(t){return Is._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.list);case"map":return t.map(e);case"nullable":return t.nullable(e.nullable);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 Dec=h(()=>{"use strict"});var kec=h(()=>{"use strict"});var Fec=h(()=>{"use strict"});var Nec=h(()=>{"use strict"});var jec=h(()=>{"use strict"});var zec=h(()=>{"use strict"});var Qec=h(()=>{"use strict"});var Mec=h(()=>{"use strict"});var Lec=h(()=>{"use strict"});var _ec=h(()=>{"use strict"});var Uec=h(()=>{"use strict"});var Hu,Vec=h(()=>{"use strict";Xr();Hu={list:e=>({...e,type:"list",_visit:function(t){return Hu._visit(this,t)}}),set:e=>({...e,type:"set",_visit:function(t){return Hu._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Hu._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Hu._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Hu._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Hu._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"nullable":return t.nullable(e);case"map":return t.map(e);case"literal":return t.literal(e);default:return t._other(e)}}}});var Gec=h(()=>{"use strict"});var qec=h(()=>{"use strict"});var Wec=h(()=>{"use strict"});var Hec=h(()=>{"use strict"});var Kec=h(()=>{"use strict"});var Jec=h(()=>{"use strict"});var Yec=h(()=>{"use strict"});var Xec=h(()=>{"use strict"});var Zec=h(()=>{"use strict"});var $ec=h(()=>{"use strict"});var etc=h(()=>{"use strict"});var ttc=h(()=>{"use strict"});var rtc=h(()=>{"use strict"});var ntc=h(()=>{"use strict"});var Qi,itc=h(()=>{"use strict";Xr();Qi={integer:e=>({integer:e,type:"integer",_visit:function(t){return Qi._visit(this,t)}}),long:e=>({long:e,type:"long",_visit:function(t){return Qi._visit(this,t)}}),uint:e=>({uint:e,type:"uint",_visit:function(t){return Qi._visit(this,t)}}),uint64:e=>({uint64:e,type:"uint64",_visit:function(t){return Qi._visit(this,t)}}),float:e=>({float:e,type:"float",_visit:function(t){return Qi._visit(this,t)}}),double:e=>({double:e,type:"double",_visit:function(t){return Qi._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return Qi._visit(this,t)}}),string:e=>({string:e,type:"string",_visit:function(t){return Qi._visit(this,t)}}),date:e=>({date:e,type:"date",_visit:function(t){return Qi._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return Qi._visit(this,t)}}),datetimeRfc2822:e=>({...e,type:"datetimeRfc2822",_visit:function(t){return Qi._visit(this,t)}}),uuid:e=>({uuid:e,type:"uuid",_visit:function(t){return Qi._visit(this,t)}}),base64:e=>({base64:e,type:"base64",_visit:function(t){return Qi._visit(this,t)}}),bigInteger:e=>({bigInteger:e,type:"bigInteger",_visit:function(t){return Qi._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"datetimeRfc2822":return t.datetimeRfc2822(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 otc=h(()=>{"use strict"});var stc=h(()=>{"use strict"});var c$,atc=h(()=>{"use strict";Xr();c$={samePropertiesAsObject:e=>({...e,type:"samePropertiesAsObject",_visit:function(t){return c$._visit(this,t)}}),singleProperty:e=>({...e,type:"singleProperty",_visit:function(t){return c$._visit(this,t)}}),noProperties:()=>({type:"noProperties",_visit:function(e){return c$._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 ctc=h(()=>{"use strict"});var utc=h(()=>{"use strict"});var to,ltc=h(()=>{"use strict";Xr();to={primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return to._visit(this,t)}}),container:e=>({container:e,type:"container",_visit:function(t){return to._visit(this,t)}}),unknown:e=>({unknown:e,type:"unknown",_visit:function(t){return to._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return to._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 Ku,ptc=h(()=>{"use strict";Xr();Ku={alias:e=>({...e,type:"alias",_visit:function(t){return Ku._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Ku._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Ku._visit(this,t)}}),union:e=>({...e,type:"union",_visit:function(t){return Ku._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return Ku._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 ftc=h(()=>{"use strict"});var dtc=h(()=>{"use strict"});var mtc=h(()=>{"use strict"});var htc=h(()=>{"use strict"});var gtc=h(()=>{"use strict"});var Atc=h(()=>{"use strict"});var ytc=h(()=>{"use strict"});var btc=h(()=>{"use strict"});var eE,Etc=h(()=>{"use strict";Xr();eE={string:e=>({string:e,type:"string",_visit:function(t){return eE._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return eE._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 Itc=h(()=>{"use strict"});var vtc=h(()=>{"use strict"});var Ctc=h(()=>{"use strict"});var xtc=h(()=>{"use strict"});var set,Stc=h(()=>{"use strict";Xr();set={enum:e=>({...e,type:"enum",_visit:function(t){return set._visit(this,t)}}),_visit:(e,t)=>e.type==="enum"?t.enum(e):t._other(e)}});var wtc=h(()=>{"use strict"});var Rtd,ELe,Ttc=h(()=>{"use strict";Rtd={ReadOnly:"READ_ONLY",WriteOnly:"WRITE_ONLY"},ELe={...Rtd,_visit:(e,t)=>{switch(e){case ELe.ReadOnly:return t.readOnly();case ELe.WriteOnly:return t.writeOnly();default:return t._other()}}}});var Otc=h(()=>{"use strict"});var Ptc=h(()=>{"use strict"});var Dtd,ps,Btc=h(()=>{"use strict";Dtd={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",DateTimeRfc2822:"DATE_TIME_RFC_2822",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER"},ps={...Dtd,_visit:(e,t)=>{switch(e){case ps.Integer:return t.integer();case ps.Long:return t.long();case ps.Uint:return t.uint();case ps.Uint64:return t.uint64();case ps.Float:return t.float();case ps.Double:return t.double();case ps.Boolean:return t.boolean();case ps.String:return t.string();case ps.Date:return t.date();case ps.DateTime:return t.dateTime();case ps.DateTimeRfc2822:return t.dateTimeRfc2822();case ps.Uuid:return t.uuid();case ps.Base64:return t.base64();case ps.BigInteger:return t.bigInteger();default:return t._other()}}}});var Ei,Rtc=h(()=>{"use strict";Xr();Ei={integer:e=>({...e,type:"integer",_visit:function(t){return Ei._visit(this,t)}}),long:e=>({...e,type:"long",_visit:function(t){return Ei._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return Ei._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return Ei._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return Ei._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return Ei._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Ei._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Ei._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return Ei._visit(this,t)}}),dateTime:e=>({...e,type:"dateTime",_visit:function(t){return Ei._visit(this,t)}}),dateTimeRfc2822:e=>({...e,type:"dateTimeRfc2822",_visit:function(t){return Ei._visit(this,t)}}),uuid:e=>({...e,type:"uuid",_visit:function(t){return Ei._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return Ei._visit(this,t)}}),bigInteger:e=>({...e,type:"bigInteger",_visit:function(t){return Ei._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"dateTimeRfc2822":return t.dateTimeRfc2822(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 Dtc=h(()=>{"use strict"});var ktc=h(()=>{"use strict"});var Iw,Ftc=h(()=>{"use strict";Xr();Iw={container:e=>({container:e,type:"container",_visit:function(t){return Iw._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return Iw._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return Iw._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return Iw._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 ktd,uD,Ntc=h(()=>{"use strict";ktd={Enum:"ENUM",Object:"OBJECT",Union:"UNION",UndiscriminatedUnion:"UNDISCRIMINATED_UNION"},uD={...ktd,_visit:(e,t)=>{switch(e){case uD.Enum:return t.enum();case uD.Object:return t.object();case uD.Union:return t.union();case uD.UndiscriminatedUnion:return t.undiscriminatedUnion();default:return t._other()}}}});var jtc=h(()=>{"use strict"});var X1,ztc=h(()=>{"use strict";Xr();X1={samePropertiesAsObject:e=>({...e,propertiesType:"samePropertiesAsObject",_visit:function(t){return X1._visit(this,t)}}),singleProperty:e=>({...e,propertiesType:"singleProperty",_visit:function(t){return X1._visit(this,t)}}),noProperties:()=>({propertiesType:"noProperties",_visit:function(e){return X1._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 Qtc=h(()=>{"use strict"});var Sfe,Mtc=h(()=>{"use strict";Xr();Sfe={proto:e=>({value:e,type:"proto",_visit:function(t){return Sfe._visit(this,t)}}),_visit:(e,t)=>e.type==="proto"?t.proto(e.value):t._other(e)}});var Ltc=h(()=>{"use strict"});var _tc=h(()=>{"use strict"});var uc,Utc=h(()=>{"use strict";Xr();uc={alias:e=>({...e,type:"alias",_visit:function(t){return uc._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return uc._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return uc._visit(this,t)}}),union:e=>({...e,type:"union",_visit:function(t){return uc._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return uc._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 Vtc=h(()=>{"use strict"});var Zr,Gtc=h(()=>{"use strict";Xr();Zr={container:e=>({container:e,type:"container",_visit:function(t){return Zr._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return Zr._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return Zr._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return Zr._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 qtc=h(()=>{"use strict"});var Wtc=h(()=>{"use strict"});var Htc=h(()=>{"use strict"});var Ktc=h(()=>{"use strict"});var Jtc=h(()=>{"use strict"});var Ytc=h(()=>{"use strict"});var Ftd,wfe,Xtc=h(()=>{"use strict";Ftd={Data:"data",Protocol:"protocol"},wfe={...Ftd,_visit:(e,t)=>{switch(e){case wfe.Data:return t.data();case wfe.Protocol:return t.protocol();default:return t._other()}}}});var Ztc=h(()=>{"use strict"});var $tc=h(()=>{"use strict"});var erc=h(()=>{"use strict"});var trc=h(()=>{"use strict"});var Ntd,oQ,rrc=h(()=>{"use strict";Ntd={Attribute:"ATTRIBUTE",Text:"TEXT",Element:"ELEMENT"},oQ={...Ntd,_visit:(e,t)=>{switch(e){case oQ.Attribute:return t.attribute();case oQ.Text:return t.text();case oQ.Element:return t.element();default:return t._other()}}}});var xZi=h(()=>{"use strict";Tec();Oec();Pec();Bec();Rec();Dec();kec();Fec();Nec();jec();zec();Qec();Mec();Lec();_ec();Uec();Vec();Gec();qec();Wec();Hec();Kec();Jec();Yec();Xec();Zec();$ec();etc();ttc();rtc();ntc();itc();otc();stc();atc();ctc();utc();ltc();ptc();ftc();dtc();mtc();htc();gtc();Atc();ytc();btc();Etc();Itc();vtc();Ctc();xtc();Stc();wtc();Ttc();Otc();Ptc();Btc();Rtc();Dtc();ktc();Ftc();Ntc();jtc();ztc();Qtc();Mtc();Ltc();_tc();Utc();Vtc();Gtc();qtc();Wtc();Htc();Ktc();Jtc();Ytc();Xtc();Ztc();$tc();erc();trc();rrc()});var SZi={};te(SZi,{ContainerType:()=>Is,ExampleContainer:()=>Hu,ExamplePrimitive:()=>Qi,ExampleSingleUnionTypeProperties:()=>c$,ExampleTypeReferenceShape:()=>to,ExampleTypeShape:()=>Ku,Literal:()=>eE,NamedTypeDefault:()=>set,ObjectPropertyAccess:()=>ELe,PrimitiveTypeV1:()=>ps,PrimitiveTypeV2:()=>Ei,ResolvedTypeReference:()=>Iw,ShapeType:()=>uD,SingleUnionTypeProperties:()=>X1,Source:()=>Sfe,Type:()=>uc,TypeReference:()=>Zr,UnionDiscriminatorContext:()=>wfe,XmlPropertyKind:()=>oQ});var nrc=h(()=>{"use strict";xZi()});var irc=h(()=>{"use strict"});var orc=h(()=>{"use strict"});var wZi=h(()=>{"use strict";irc();orc()});var src={};var arc=h(()=>{"use strict";wZi()});var jtd,oB,crc=h(()=>{"use strict";jtd={RsaSha256:"RSA_SHA256",RsaSha384:"RSA_SHA384",RsaSha512:"RSA_SHA512",EcdsaSha256:"ECDSA_SHA256",EcdsaSha384:"ECDSA_SHA384",EcdsaSha512:"ECDSA_SHA512",Ed25519:"ED25519"},oB={...jtd,_visit:(e,t)=>{switch(e){case oB.RsaSha256:return t.rsaSha256();case oB.RsaSha384:return t.rsaSha384();case oB.RsaSha512:return t.rsaSha512();case oB.EcdsaSha256:return t.ecdsaSha256();case oB.EcdsaSha384:return t.ecdsaSha384();case oB.EcdsaSha512:return t.ecdsaSha512();case oB.Ed25519:return t.ed25519();default:return t._other()}}}});var urc=h(()=>{"use strict"});var FH,lrc=h(()=>{"use strict";Xr();FH={jwks:e=>({...e,type:"jwks",_visit:function(t){return FH._visit(this,t)}}),static:e=>({...e,type:"static",_visit:function(t){return FH._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"jwks":return t.jwks(e);case"static":return t.static(e);default:return t._other(e)}}}});var prc=h(()=>{"use strict"});var ztd,NH,frc=h(()=>{"use strict";ztd={Sha256:"SHA256",Sha1:"SHA1",Sha384:"SHA384",Sha512:"SHA512"},NH={...ztd,_visit:(e,t)=>{switch(e){case NH.Sha256:return t.sha256();case NH.Sha1:return t.sha1();case NH.Sha384:return t.sha384();case NH.Sha512:return t.sha512();default:return t._other()}}}});var drc=h(()=>{"use strict"});var mrc=h(()=>{"use strict"});var hrc=h(()=>{"use strict"});var grc=h(()=>{"use strict"});var Arc=h(()=>{"use strict"});var yrc=h(()=>{"use strict"});var brc=h(()=>{"use strict"});var Erc=h(()=>{"use strict"});var Qtd,jH,Irc=h(()=>{"use strict";Qtd={Sha256:"SHA256",Sha1:"SHA1",Sha384:"SHA384",Sha512:"SHA512"},jH={...Qtd,_visit:(e,t)=>{switch(e){case jH.Sha256:return t.sha256();case jH.Sha1:return t.sha1();case jH.Sha384:return t.sha384();case jH.Sha512:return t.sha512();default:return t._other()}}}});var vrc=h(()=>{"use strict"});var xIe,Crc=h(()=>{"use strict";Xr();xIe={queryParameter:e=>({...e,type:"queryParameter",_visit:function(t){return xIe._visit(this,t)}}),_visit:(e,t)=>e.type==="queryParameter"?t.queryParameter(e):t._other(e)}});var xrc=h(()=>{"use strict"});var Src=h(()=>{"use strict"});var Mtd,Nvr,wrc=h(()=>{"use strict";Mtd={Get:"GET",Post:"POST"},Nvr={...Mtd,_visit:(e,t)=>{switch(e){case Nvr.Get:return t.get();case Nvr.Post:return t.post();default:return t._other()}}}});var Trc=h(()=>{"use strict"});var Orc=h(()=>{"use strict"});var Z1,Prc=h(()=>{"use strict";Xr();Z1={inlinedPayload:e=>({...e,type:"inlinedPayload",_visit:function(t){return Z1._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return Z1._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 Ltd,oLt,Brc=h(()=>{"use strict";Ltd={Alphabetical:"ALPHABETICAL"},oLt={...Ltd,_visit:(e,t)=>e===oLt.Alphabetical?t.alphabetical():t._other()}});var _td,LV,Rrc=h(()=>{"use strict";_td={Body:"BODY",Timestamp:"TIMESTAMP",NotificationUrl:"NOTIFICATION_URL",MessageId:"MESSAGE_ID"},LV={..._td,_visit:(e,t)=>{switch(e){case LV.Body:return t.body();case LV.Timestamp:return t.timestamp();case LV.NotificationUrl:return t.notificationUrl();case LV.MessageId:return t.messageId();default:return t._other()}}}});var Drc=h(()=>{"use strict"});var krc=h(()=>{"use strict"});var Utd,ILe,Frc=h(()=>{"use strict";Utd={Base64:"BASE64",Hex:"HEX"},ILe={...Utd,_visit:(e,t)=>{switch(e){case ILe.Base64:return t.base64();case ILe.Hex:return t.hex();default:return t._other()}}}});var zH,Nrc=h(()=>{"use strict";Xr();zH={hmac:e=>({...e,type:"hmac",_visit:function(t){return zH._visit(this,t)}}),asymmetric:e=>({...e,type:"asymmetric",_visit:function(t){return zH._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"hmac":return t.hmac(e);case"asymmetric":return t.asymmetric(e);default:return t._other(e)}}}});var jrc=h(()=>{"use strict"});var Vtd,Tfe,zrc=h(()=>{"use strict";Vtd={UnixSeconds:"UNIX_SECONDS",UnixMillis:"UNIX_MILLIS",Iso8601:"ISO8601"},Tfe={...Vtd,_visit:(e,t)=>{switch(e){case Tfe.UnixSeconds:return t.unixSeconds();case Tfe.UnixMillis:return t.unixMillis();case Tfe.Iso8601:return t.iso8601();default:return t._other()}}}});var TZi=h(()=>{"use strict";crc();urc();lrc();prc();frc();drc();mrc();hrc();grc();Arc();yrc();brc();Erc();Irc();vrc();Crc();xrc();Src();wrc();Trc();Orc();Prc();Brc();Rrc();Drc();krc();Frc();Nrc();jrc();zrc()});var OZi={};te(OZi,{AsymmetricAlgorithm:()=>oB,AsymmetricKeySource:()=>FH,HmacAlgorithm:()=>NH,WebhookBodyHashAlgorithm:()=>jH,WebhookBodyHashLocation:()=>xIe,WebhookHttpMethod:()=>Nvr,WebhookPayload:()=>Z1,WebhookPayloadBodySort:()=>oLt,WebhookPayloadComponent:()=>LV,WebhookSignatureEncoding:()=>ILe,WebhookSignatureVerification:()=>zH,WebhookTimestampFormat:()=>Tfe});var Qrc=h(()=>{"use strict";TZi()});var Mrc=h(()=>{"use strict"});var z3,Lrc=h(()=>{"use strict";Xr();z3={inlinedBody:e=>({...e,type:"inlinedBody",_visit:function(t){return z3._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return z3._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 _rc=h(()=>{"use strict"});var Urc=h(()=>{"use strict"});var Vrc=h(()=>{"use strict"});var Grc=h(()=>{"use strict"});var qrc=h(()=>{"use strict"});var sB,Wrc=h(()=>{"use strict";Xr();sB={inlinedBody:e=>({...e,type:"inlinedBody",_visit:function(t){return sB._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return sB._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 Hrc=h(()=>{"use strict"});var Krc=h(()=>{"use strict"});var Gtd,jvr,Jrc=h(()=>{"use strict";Gtd={Client:"client",Server:"server"},jvr={...Gtd,_visit:(e,t)=>{switch(e){case jvr.Client:return t.client();case jvr.Server:return t.server();default:return t._other()}}}});var Yrc=h(()=>{"use strict"});var PZi=h(()=>{"use strict";Mrc();Lrc();_rc();Urc();Vrc();Grc();qrc();Wrc();Hrc();Krc();Jrc();Yrc()});var BZi={};te(BZi,{ExampleWebSocketMessageBody:()=>z3,WebSocketMessageBody:()=>sB,WebSocketMessageOrigin:()=>jvr});var Xrc=h(()=>{"use strict";PZi()});var Zrc=h(()=>{"use strict";uHa();zXi();zHa();QXi();uKa();LXi();fKa();UXi();yYa();BYa();sZi();NYa();cZi();aXa();lZi();$Xa();iZa();mZi();D$a();gZi();rec();yZi();pec();EZi();wec();vZi();nrc();xZi();arc();wZi();Qrc();TZi();Xrc();PZi()});var Xt={};te(Xt,{ApiDefinitionSource:()=>iQ,ApiVersionScheme:()=>CIe,AsymmetricAlgorithm:()=>oB,AsymmetricKeySource:()=>FH,AuthScheme:()=>Mp,AuthSchemesRequirement:()=>bw,AvailabilityStatus:()=>fh,ContainerType:()=>Is,Environments:()=>Z0,ErrorDeclarationDiscriminantValue:()=>vIe,ErrorDiscriminationStrategy:()=>j3,ExampleCodeSample:()=>F3,ExampleContainer:()=>Hu,ExampleEndpointSuccessResponse:()=>uy,ExamplePrimitive:()=>Qi,ExampleQueryParameterShape:()=>Ew,ExampleRequestBody:()=>rB,ExampleResponse:()=>iA,ExampleSingleUnionTypeProperties:()=>c$,ExampleStyle:()=>Fvr,ExampleTypeReferenceShape:()=>to,ExampleTypeShape:()=>Ku,ExampleWebSocketMessageBody:()=>z3,FileProperty:()=>nQ,FileUploadBodyPropertyEncoding:()=>nLt,FileUploadRequestProperty:()=>qx,GlobalParameterApplyMode:()=>kvr,GlobalParameterLocation:()=>iet,HmacAlgorithm:()=>NH,HttpEndpointSource:()=>cD,HttpMethod:()=>Im,HttpRequestBody:()=>bd,HttpResponseBody:()=>ju,InvocationSource:()=>oet,JsonResponse:()=>uI,Literal:()=>eE,NamedTypeDefault:()=>set,NonStreamHttpResponseBody:()=>nB,OAuthConfiguration:()=>sD,OAuthPkceMethod:()=>tLt,OAuthPublicClientId:()=>RH,ObjectPropertyAccess:()=>ELe,Pagination:()=>$0,PathParameterLocation:()=>iLt,PrimitiveTypeV1:()=>ps,PrimitiveTypeV2:()=>Ei,ProtobufMethodType:()=>kH,ProtobufType:()=>Zp,PublishTarget:()=>Ed,PublishingConfig:()=>a$,RequestPropertyValue:()=>iB,ResolvedTypeReference:()=>Iw,SdkRequestBodyType:()=>DH,SdkRequestShape:()=>QV,ShapeType:()=>uD,SingleUnionTypeProperties:()=>X1,Source:()=>Sfe,StreamingResponse:()=>dv,SupportedSdkLanguage:()=>N3,Transport:()=>MV,Type:()=>uc,TypeReference:()=>Zr,UnionDiscriminatorContext:()=>wfe,V2AuthValues:()=>zV,V2EndpointLocationHttpMethod:()=>s$,V2HttpEndpointResponseBody:()=>Gx,WebSocketMessageBody:()=>sB,WebSocketMessageOrigin:()=>jvr,WebhookBodyHashAlgorithm:()=>jH,WebhookBodyHashLocation:()=>xIe,WebhookHttpMethod:()=>Nvr,WebhookPayload:()=>Z1,WebhookPayloadBodySort:()=>oLt,WebhookPayloadComponent:()=>LV,WebhookSignatureEncoding:()=>ILe,WebhookSignatureVerification:()=>zH,WebhookTimestampFormat:()=>Tfe,WellKnownProtobufType:()=>Ci,XmlPropertyKind:()=>oQ,audience:()=>cHa,auth:()=>MXi,commons:()=>_Xi,constants:()=>pKa,dynamic:()=>sr,environment:()=>aZi,errors:()=>uZi,examples:()=>pZi,generatorExec:()=>gc,globalParameters:()=>hZi,http:()=>AZi,ir:()=>bZi,proto:()=>IZi,publish:()=>CZi,types:()=>SZi,variables:()=>src,webhooks:()=>OZi,websocket:()=>BZi});var Xr=h(()=>{"use strict";Zrc()});var QH,$rc,sLt,RZi,h7b,DZi=h(()=>{"use strict";QH={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},$rc={[QH.Debug]:1,[QH.Info]:2,[QH.Warn]:3,[QH.Error]:4},sLt=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},RZi=class{level;logger;silent;constructor(t){this.level=$rc[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=$rc[t]}isDebug(){return this.shouldLog(QH.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(QH.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(QH.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(QH.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},h7b=new RZi({level:QH.Info,logger:new sLt,silent:!0})});var enc,tnc=h(()=>{"use strict";DZi();(function(e){e.LogLevel=QH,e.ConsoleLogger=sLt})(enc||(enc={}))});var rnc=h(()=>{"use strict";tnc()});var nnc=h(()=>{"use strict";rnc()});var inc=h(()=>{"use strict"});var onc=h(()=>{"use strict";DZi()});var snc=h(()=>{"use strict"});var Iu,vw=h(()=>{"use strict";Iu={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function vm(e,t){return`Expected ${t}. Received ${Htd(e)}.`}function Htd(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}var k2=h(()=>{"use strict"});function Cw(e){return{...e,json:anc(e.json),parse:anc(e.parse)}}function anc(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
100
- `)),{ok:!0,value:t}):n}}var u$=h(()=>{"use strict"});function zvr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var kZi=h(()=>{"use strict"});var aet,FZi=h(()=>{"use strict";kZi();aet=class extends Error{errors;constructor(t){super(t.map(zvr).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});var cet,NZi=h(()=>{"use strict";kZi();cet=class extends Error{errors;constructor(t){super(t.map(zvr).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});function Cm(e){return{nullable:()=>Ktd(e),optional:()=>jZi(e),optionalNullable:()=>Jtd(e),transform:t=>zZi(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new cet(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new aet(n.errors)}}}function Ktd(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Iu.NULLABLE};return{...t,...Cm(t)}}function jZi(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Iu.OPTIONAL};return{...t,...Cm(t)}}function Jtd(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>Iu.OPTIONAL_NULLABLE};return{...t,...Cm(t)}}function zZi(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...Cm(r)}}var cnc=h(()=>{"use strict";vw();FZi();NZi()});var sQ=h(()=>{"use strict";cnc();FZi();NZi()});function unc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:vm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:vm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>Iu.BIGINT};return{...Cw(e),...Cm(e)}}var lnc=h(()=>{"use strict";vw();k2();u$();sQ()});var pnc=h(()=>{"use strict";lnc()});function fnc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:vm(t,"string")}]}:Ytd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:vm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:vm(t,"Date object")}]},getType:()=>Iu.DATE};return{...Cw(e),...Cm(e)}}var Ytd,dnc=h(()=>{"use strict";vw();k2();u$();sQ();Ytd=/^([+-]?\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)?)?)?)?$/});var mnc=h(()=>{"use strict";dnc()});function $1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...Cw(r),...Cm(r)}}}var l$=h(()=>{"use strict";sQ();u$()});function aLt(e){let t=new Set(e);return $1(Iu.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:vm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:vm(n,"enum")}]}:{ok:!0,value:n})()}function hnc(e){return aLt(e).transform({transform:t=>t,untransform:t=>t})}var gnc=h(()=>{"use strict";vw();l$();k2()});var QZi=h(()=>{"use strict";gnc()});function Anc(e){let t=MZi(e);return{...t,...Cm(t)}}function MZi(e){return{parse:(t,r)=>uet(e).parse(t,r),json:(t,r)=>uet(e).json(t,r),getType:()=>uet(e).getType()}}function uet(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var LZi=h(()=>{"use strict";sQ()});function _Zi(e){return Object.entries(e)}var ync=h(()=>{"use strict"});function cLt(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var UZi=h(()=>{"use strict"});function Ofe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var uLt=h(()=>{"use strict"});function lLt(e){return Object.keys(e)}var VZi=h(()=>{"use strict"});function bnc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var Enc=h(()=>{"use strict"});function MH(e){return{withParsedProperties:t=>GZi(e,t)}}function GZi(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(Xtd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!Ofe(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:vm(n,"object")}]};let o=new Set(Object.keys(t)),s=cLt(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...Cm(r),...MH(r)}}var Xtd,Inc=h(()=>{"use strict";UZi();k2();uLt();sQ();Xtd=Object.prototype.hasOwnProperty});var pLt=h(()=>{"use strict";Inc()});function vnc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Pfe(e){return e.isProperty}var qZi=h(()=>{"use strict"});function Qvr(e){let t;function r(){if(t==null){t={};for(let[d,f]of _Zi(e)){let m=Pfe(f)?f.rawKey:d,g=Pfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of _Zi(e)){let m=Pfe(f)?f.rawKey:d,g=Pfe(f)?f.valueSchema:f;$td(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function u(){return o==null&&a(),o}function l(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>Pfe(f)?f.rawKey:d),_getParsedProperties:()=>lLt(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return Cnc({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return Cnc({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:g=>{let A=e[g];if(A!=null)return Pfe(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>Iu.OBJECT};return{...Cw(p),...Cm(p),...MH(p),...vLe(p)}}function Cnc({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Ofe(e))return{ok:!1,errors:[{path:s,message:vm(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!Ztd.call(e,l))continue;let p=e[l],d=n(l);if(d!=null){a>0&&r.has(l)&&a--;let f=d.transform(p);f.ok?u[d.transformedKey]=f.value:(u[l]=p,c.push(...f.errors))}else switch(i){case"fail":c.push({path:[...s,l],message:`Unexpected key "${l}"`});break;case"strip":break;case"passthrough":u[l]=p;break}}if(a>0)for(let l of t)l in e||c.push({path:s,message:`Missing required key "${l}"`});return c.length===0||o?{ok:!0,value:u}:{ok:!1,errors:c}}function vLe(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>xnc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>xnc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Iu.OBJECT};return{...r,...Cm(r),...MH(r),...vLe(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))t.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))r.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},getType:()=>Iu.OBJECT};return{...n,...Cm(n),...MH(n),...vLe(n)}}}}function xnc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Ofe(t))return{ok:!1,errors:[{path:i,message:vm(t,"object")}]};let o=new Set(e),[s,a]=bnc(lLt(t),l=>o.has(l)),c=r(cLt(t,a)),u=n(cLt(t,s));return c.ok&&u.ok?{ok:!0,value:{...c.value,...u.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function $td(e){return!erd(e)}function erd(e){switch(e.getType()){case Iu.ANY:case Iu.UNKNOWN:case Iu.OPTIONAL:case Iu.OPTIONAL_NULLABLE:return!0;default:return!1}}var Ztd,WZi=h(()=>{"use strict";vw();ync();UZi();k2();uLt();VZi();u$();Enc();pLt();sQ();qZi();Ztd=Object.prototype.hasOwnProperty});function Snc(e){return Qvr(e)}var wnc=h(()=>{"use strict";WZi()});var HZi=h(()=>{"use strict";WZi();wnc();qZi()});function Tnc(e){let t={...MZi(e),_getRawProperties:()=>uet(e)._getRawProperties(),_getParsedProperties:()=>uet(e)._getParsedProperties()};return{...t,...Cm(t),...MH(t),...vLe(t)}}var Onc=h(()=>{"use strict";HZi();pLt();sQ();LZi()});var Pnc=h(()=>{"use strict";LZi();Onc()});function Mvr(e){let t={parse:(r,n)=>Bnc(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>Bnc(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>Iu.LIST};return{...Cw(t),...Cm(t)}}function Bnc(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:vm(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);o.ok?r.push(o.value):n.push(...o.errors)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var Rnc=h(()=>{"use strict";vw();k2();u$();sQ()});var KZi=h(()=>{"use strict";Rnc()});function Dnc(e){return $1(Iu.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:vm(r,`${e.toString()}`)}]})()}var knc=h(()=>{"use strict";vw();l$();k2()});function Fnc(e){return $1(Iu.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:vm(r,`"${e}"`)}]})()}var Nnc=h(()=>{"use strict";vw();l$();k2()});var jnc=h(()=>{"use strict";knc();Nnc()});var znc,Qnc=h(()=>{"use strict";vw();l$();znc=$1(Iu.ANY,e=>({ok:!0,value:e}))});var Mnc,Lnc=h(()=>{"use strict";vw();l$();k2();Mnc=$1(Iu.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:vm(e,"boolean")}]})});var _nc,Unc=h(()=>{"use strict";vw();l$();_nc=$1(Iu.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var Vnc,Gnc=h(()=>{"use strict";vw();l$();k2();Vnc=$1(Iu.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:vm(e,"number")}]})});var qnc,Wnc=h(()=>{"use strict";vw();l$();k2();qnc=$1(Iu.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:vm(e,"string")}]})});var Hnc,Knc=h(()=>{"use strict";vw();l$();Hnc=$1(Iu.UNKNOWN,e=>({ok:!0,value:e}))});var Jnc=h(()=>{"use strict";Qnc();Lnc();Unc();Gnc();Wnc();Knc()});function Ync(e,t){let r={parse:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Iu.RECORD};return{...Cw(r),...Cm(r)}}function Xnc(e,t){let r={parse:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Iu.RECORD};return{...Cw(r),...Cm(r)}}function Lvr({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Ofe(e))return{ok:!1,errors:[{path:i,message:vm(e,"object")}]};let o={},s=[];for(let a in e){if(!trd.call(e,a))continue;let c=e[a];if(c===void 0)continue;let u=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(u=d)}let l=r(u),p=n(c,u);l.ok&&p.ok?o[l.value]=p.value:(l.ok||s.push(...l.errors),p.ok||s.push(...p.errors))}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var trd,Znc=h(()=>{"use strict";vw();k2();uLt();u$();sQ();trd=Object.prototype.hasOwnProperty});var $nc=h(()=>{"use strict";Znc()});function eic(e){let t=Mvr(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:vm(n,"Set")}]},getType:()=>Iu.SET};return{...Cw(r),...Cm(r)}}var tic=h(()=>{"use strict";vw();k2();u$();KZi();sQ()});var ric=h(()=>{"use strict";tic()});function iic(e){let t={parse:(r,n)=>nic((i,o)=>i.parse(r,o),e,n),json:(r,n)=>nic((i,o)=>i.json(r,o),e,n),getType:()=>Iu.UNDISCRIMINATED_UNION};return{...Cw(t),...Cm(t)}}function nic(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var oic=h(()=>{"use strict";vw();u$();sQ()});var sic=h(()=>{"use strict";oic()});function aic(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var cic=h(()=>{"use strict"});function lic(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=aLt(lLt(t)),o={parse:(s,a)=>uic({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>uic({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>Iu.UNION};return{...Cw(o),...Cm(o),...MH(o)}}function uic({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Ofe(e))return{ok:!1,errors:[{path:a,message:vm(e,"object")}]};let c=e[t],u={};for(let f in e)rrd.call(e,f)&&f!==t&&(u[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let l=n(c);if(!l.ok)return{ok:!1,errors:l.errors};let p=i(l.value);if(p==null)return o?{ok:!0,value:{[r]:l.value,...u}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(u,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var rrd,pic=h(()=>{"use strict";vw();k2();uLt();VZi();u$();QZi();pLt();sQ();rrd=Object.prototype.hasOwnProperty});var fic=h(()=>{"use strict";cic();pic()});var dic=h(()=>{"use strict";pnc();mnc();QZi();Pnc();KZi();jnc();HZi();pLt();Jnc();$nc();sQ();ric();sic();fic()});var P={};te(P,{JsonError:()=>aet,ParseError:()=>cet,any:()=>znc,bigint:()=>unc,boolean:()=>Mnc,booleanLiteral:()=>Dnc,date:()=>fnc,discriminant:()=>aic,enum_:()=>aLt,forwardCompatibleEnum_:()=>hnc,getObjectLikeUtils:()=>MH,getObjectUtils:()=>vLe,getSchemaUtils:()=>Cm,isProperty:()=>Pfe,lazy:()=>Anc,lazyObject:()=>Tnc,list:()=>Mvr,never:()=>_nc,number:()=>Vnc,object:()=>Qvr,objectWithoutOptionalProperties:()=>Snc,optional:()=>jZi,partialRecord:()=>Xnc,property:()=>vnc,record:()=>Ync,set:()=>eic,string:()=>qnc,stringLiteral:()=>Fnc,transform:()=>zZi,undiscriminatedUnion:()=>iic,union:()=>lic,unknown:()=>Hnc,withParsedProperties:()=>GZi});var mic=h(()=>{"use strict";dic()});var hic=h(()=>{"use strict"});var Me=h(()=>{"use strict";inc();onc();snc();mic();hic()});var _vr,JZi=h(()=>{"use strict";Me();_vr=P.string()});var pet,Uvr=h(()=>{"use strict";Me();pet=P.string()});var YZi=h(()=>{"use strict";JZi();Uvr()});var XZi={};te(XZi,{AudienceDefinition:()=>_vr,AudienceReference:()=>pet});var gic=h(()=>{"use strict";YZi()});var ao,fp=h(()=>{"use strict";Me();ao=P.objectWithoutOptionalProperties({docs:P.string().optional()})});var CLe,ZZi=h(()=>{"use strict";Me();CLe=P.objectWithoutOptionalProperties({unsafeName:P.string(),safeName:P.string()})});var fet,Vvr=h(()=>{"use strict";Me();ZZi();fet=P.objectWithoutOptionalProperties({originalName:P.string(),camelCase:CLe,pascalCase:CLe,snakeCase:CLe,screamingSnakeCase:CLe})});var Ro,Mf=h(()=>{"use strict";Me();Vvr();Ro=P.undiscriminatedUnion([P.string(),fet])});var det,Gvr=h(()=>{"use strict";Me();det=P.string()});var _V,xLe=h(()=>{"use strict";Me();fp();Gvr();_V=P.objectWithoutOptionalProperties({key:det,playgroundDocs:P.string().optional()}).extend(ao)});var aQ,SLe=h(()=>{"use strict";Me();aQ=P.string()});var qvr,$Zi=h(()=>{"use strict";Me();Mf();xLe();SLe();qvr=P.objectWithoutOptionalProperties({username:Ro,usernameEnvVar:aQ.optional(),usernameOmit:P.boolean().optional(),usernamePlaceholder:P.string().optional(),password:Ro,passwordEnvVar:aQ.optional(),passwordOmit:P.boolean().optional(),passwordPlaceholder:P.string().optional()}).extend(_V)});var Wvr,e$i=h(()=>{"use strict";Me();Mf();xLe();SLe();Wvr=P.objectWithoutOptionalProperties({token:Ro,tokenEnvVar:aQ.optional(),tokenPlaceholder:P.string().optional()}).extend(_V)});var SIe,fLt=h(()=>{"use strict";Me();Mf();SIe=P.objectWithoutOptionalProperties({wireValue:P.string(),name:Ro})});var fs,Id=h(()=>{"use strict";Me();fLt();fs=P.undiscriminatedUnion([P.string(),SIe])});var Hvr,t$i=h(()=>{"use strict";Me();$o();Id();xLe();SLe();Hvr=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),prefix:P.string().optional(),headerEnvVar:aQ.optional(),headerPlaceholder:P.string().optional()}).extend(_V)});var Bfe,dLt=h(()=>{"use strict";Me();Bfe=P.string()});var p$,met=h(()=>{"use strict";Me();p$=P.string()});var f$,het=h(()=>{"use strict";Me();f$=P.string()});var wIe,mLt=h(()=>{"use strict";Me();dLt();met();het();wIe=P.objectWithoutOptionalProperties({endpointId:Bfe,serviceId:p$,subpackageId:f$.optional()})});var Kvr,r$i=h(()=>{"use strict";Me();Kvr=P.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED","ALPHA","BETA","PREVIEW","LEGACY"])});var d$,get=h(()=>{"use strict";Me();r$i();d$=P.objectWithoutOptionalProperties({status:Kvr,message:P.string().optional()})});var Wx,LH=h(()=>{"use strict";Me();get();fp();Wx=P.objectWithoutOptionalProperties({availability:d$.optional()}).extend(ao)});var hLt,n$i=h(()=>{"use strict";Me();hLt=P.unknown()});var eT,m$=h(()=>{"use strict";Me();n$i();eT=P.objectWithoutOptionalProperties({userSpecifiedExamples:P.record(P.string(),hLt),autogeneratedExamples:P.record(P.string(),hLt)})});var TIe,gLt=h(()=>{"use strict";Me();TIe=P.enum_(["READ_ONLY","WRITE_ONLY"])});var Jvr,i$i=h(()=>{"use strict";Me();Jvr=P.enum_(["ATTRIBUTE","TEXT","ELEMENT"])});var Yvr,o$i=h(()=>{"use strict";Me();i$i();Yvr=P.objectWithoutOptionalProperties({kind:Jvr,name:P.string().optional(),wrapped:P.boolean().optional(),listSeparator:P.string().optional()})});var aB,Rfe=h(()=>{"use strict";Me();$o();LH();Id();m$();gLt();o$i();aB=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),propertyAccess:TIe.optional(),defaultValue:P.unknown().optional(),v2Examples:eT.optional(),xml:Yvr.optional()}).extend(Wx)});var Aet,Xvr=h(()=>{"use strict";Me();$o();Mf();Aet=P.objectWithoutOptionalProperties({name:Ro,type:P.lazy(()=>zs)})});var tE,h$=h(()=>{"use strict";Me();Rfe();Xvr();tE=P.objectWithoutOptionalProperties({propertyPath:P.list(Aet).optional(),property:aB})});var Zvr,s$i=h(()=>{"use strict";Me();h$();Zvr=P.objectWithoutOptionalProperties({responseProperty:tE,headerName:P.string(),valuePrefix:P.string().optional()})});var UV,wLe=h(()=>{"use strict";Xr();Me();UV=P.union("type",{string:P.object({string:P.string()}),boolean:P.object({boolean:P.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return eE.string(e.string);case"boolean":return eE.boolean(e.boolean);default:return e}},untransform:({_visit:e,...t})=>t})});var OIe,ALt=h(()=>{"use strict";Me();$o();LH();Id();m$();wLe();OIe=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),allowMultiple:P.boolean(),clientDefault:UV.optional(),defaultValue:P.unknown().optional(),v2Examples:eT.optional(),explode:P.boolean().optional()}).extend(Wx)});var $vr,a$i=h(()=>{"use strict";Xr();Me();Rfe();ALt();$vr=P.union("type",{query:OIe,body:aB}).transform({transform:e=>{switch(e.type){case"query":return iB.query(e);case"body":return iB.body(e);default:return e}},untransform:({_visit:e,...t})=>t})});var tT,PIe=h(()=>{"use strict";Me();Xvr();a$i();tT=P.objectWithoutOptionalProperties({propertyPath:P.list(Aet).optional(),property:$vr})});var eCr,c$i=h(()=>{"use strict";Me();PIe();eCr=P.objectWithoutOptionalProperties({requestProperty:tT,value:P.string()})});var tCr,u$i=h(()=>{"use strict";Me();mLt();h$();s$i();c$i();tCr=P.objectWithoutOptionalProperties({endpoint:wIe,expiryProperty:tE.optional(),authenticatedRequestHeaders:P.list(Zvr),grantType:eCr.optional()})});var rCr,l$i=h(()=>{"use strict";Me();xLe();u$i();rCr=P.objectWithoutOptionalProperties({tokenEndpoint:tCr}).extend(_V)});var nCr,p$i=h(()=>{"use strict";Me();nCr=P.enum_(["S256"])});var iCr,f$i=h(()=>{"use strict";Me();p$i();iCr=P.objectWithoutOptionalProperties({method:nCr})});var yet,oCr=h(()=>{"use strict";Xr();Me();SLe();yet=P.union("type",{literal:P.object({value:P.string()}),environmentVariable:P.object({value:aQ})}).transform({transform:e=>{switch(e.type){case"literal":return RH.literal(e.value);case"environmentVariable":return RH.environmentVariable(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var sCr,d$i=h(()=>{"use strict";Me();f$i();oCr();sCr=P.objectWithoutOptionalProperties({clientId:yet,authorizationUrl:P.string(),tokenUrl:P.string(),refreshUrl:P.string().optional(),redirectUri:P.string().optional(),redirectUriBackupPorts:P.list(P.number()).optional(),successRedirectUrl:P.string().optional(),errorRedirectUrl:P.string().optional(),scopes:P.list(P.string()).optional(),pkce:iCr,authorizationParameters:P.record(P.string(),P.string()).optional(),tokenParameters:P.record(P.string(),P.string()).optional(),refreshParameters:P.record(P.string(),P.string()).optional(),tokenHeader:P.string().optional(),tokenPrefix:P.string().optional()})});var bet,aCr=h(()=>{"use strict";Me();h$();bet=P.objectWithoutOptionalProperties({accessToken:tE,expiresIn:tE.optional(),refreshToken:tE.optional()})});var cCr,m$i=h(()=>{"use strict";Me();PIe();cCr=P.objectWithoutOptionalProperties({refreshToken:tT})});var uCr,h$i=h(()=>{"use strict";Me();mLt();aCr();m$i();uCr=P.objectWithoutOptionalProperties({endpointReference:wIe,requestProperties:cCr,responseProperties:bet})});var lCr,g$i=h(()=>{"use strict";Me();PIe();lCr=P.objectWithoutOptionalProperties({clientId:tT,clientSecret:tT,scopes:tT.optional(),customProperties:P.list(tT).optional()})});var pCr,A$i=h(()=>{"use strict";Me();mLt();g$i();aCr();pCr=P.objectWithoutOptionalProperties({endpointReference:wIe,requestProperties:lCr,responseProperties:bet})});var fCr,y$i=h(()=>{"use strict";Me();SLe();h$i();A$i();fCr=P.objectWithoutOptionalProperties({clientIdEnvVar:aQ.optional(),clientSecretEnvVar:aQ.optional(),tokenPrefix:P.string().optional(),tokenHeader:P.string().optional(),scopes:P.list(P.string()).optional(),tokenEndpoint:pCr,refreshEndpoint:uCr.optional()})});var dCr,b$i=h(()=>{"use strict";Me();oCr();dCr=P.objectWithoutOptionalProperties({clientId:yet,deviceAuthorizationUrl:P.string(),tokenUrl:P.string(),refreshUrl:P.string().optional(),scopes:P.list(P.string()).optional(),deviceAuthorizationParameters:P.record(P.string(),P.string()).optional(),tokenParameters:P.record(P.string(),P.string()).optional(),refreshParameters:P.record(P.string(),P.string()).optional(),tokenHeader:P.string().optional(),tokenPrefix:P.string().optional()})});var mCr,E$i=h(()=>{"use strict";Xr();Me();d$i();y$i();b$i();mCr=P.union("type",{clientCredentials:fCr,authorizationCode:sCr,deviceCode:dCr}).transform({transform:e=>{switch(e.type){case"clientCredentials":return sD.clientCredentials(e);case"authorizationCode":return sD.authorizationCode(e);case"deviceCode":return sD.deviceCode(e);default:return e}},untransform:({_visit:e,...t})=>t})});var hCr,I$i=h(()=>{"use strict";Me();xLe();E$i();hCr=P.objectWithoutOptionalProperties({configuration:mCr}).extend(_V)});var gCr,v$i=h(()=>{"use strict";Xr();Me();$Zi();e$i();t$i();l$i();I$i();gCr=P.union(P.discriminant("type","_type"),{bearer:Wvr,basic:qvr,header:Hvr,oauth:hCr,inferred:rCr}).transform({transform:e=>{switch(e.type){case"bearer":return Mp.bearer(e);case"basic":return Mp.basic(e);case"header":return Mp.header(e);case"oauth":return Mp.oauth(e);case"inferred":return Mp.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t})});var ACr,C$i=h(()=>{"use strict";Me();ACr=P.enum_(["ALL","ANY","ENDPOINT_SECURITY"])});var yCr,x$i=h(()=>{"use strict";Me();fp();v$i();C$i();yCr=P.objectWithoutOptionalProperties({requirement:ACr,schemes:P.list(gCr)}).extend(ao)});var bCr,S$i=h(()=>{"use strict";Me();bCr=P.string()});var w$i=h(()=>{"use strict";x$i();v$i();Gvr();C$i();S$i();xLe();$Zi();e$i();SLe();t$i();s$i();c$i();l$i();u$i();g$i();aCr();d$i();y$i();E$i();b$i();f$i();p$i();oCr();h$i();m$i();I$i();A$i()});var T$i={};te(T$i,{ApiAuth:()=>yCr,AuthScheme:()=>gCr,AuthSchemeKey:()=>det,AuthSchemesRequirement:()=>ACr,AuthScope:()=>bCr,BaseAuthScheme:()=>_V,BasicAuthScheme:()=>qvr,BearerAuthScheme:()=>Wvr,EnvironmentVariable:()=>aQ,HeaderAuthScheme:()=>Hvr,InferredAuthGrantType:()=>eCr,InferredAuthScheme:()=>rCr,InferredAuthSchemeTokenEndpoint:()=>tCr,InferredAuthenticatedRequestHeader:()=>Zvr,OAuthAccessTokenRequestProperties:()=>lCr,OAuthAccessTokenResponseProperties:()=>bet,OAuthAuthorizationCode:()=>sCr,OAuthClientCredentials:()=>fCr,OAuthConfiguration:()=>mCr,OAuthDeviceCode:()=>dCr,OAuthPkceConfiguration:()=>iCr,OAuthPkceMethod:()=>nCr,OAuthPublicClientId:()=>yet,OAuthRefreshEndpoint:()=>uCr,OAuthRefreshTokenRequestProperties:()=>cCr,OAuthScheme:()=>hCr,OAuthTokenEndpoint:()=>pCr});var Aic=h(()=>{"use strict";w$i()});var BIe,yLt=h(()=>{"use strict";Me();BIe=P.string()});var RIe,bLt=h(()=>{"use strict";Me();RIe=P.string()});var ECr,O$i=h(()=>{"use strict";Me();ECr=P.objectWithoutOptionalProperties({original:P.string()})});var ELt,P$i=h(()=>{"use strict";Me();ELt=P.string()});var VV,TLe=h(()=>{"use strict";Me();Mf();VV=P.objectWithoutOptionalProperties({allParts:P.list(Ro),packagePath:P.list(Ro),file:Ro.optional()})});var cB,Dfe=h(()=>{"use strict";Me();cB=P.string()});var Eet,ICr=h(()=>{"use strict";Me();Eet=P.string()});var vCr,B$i=h(()=>{"use strict";Me();vCr=P.string()});var Iet,CCr=h(()=>{"use strict";Me();Iet=P.string()});var GV,OLe=h(()=>{"use strict";Me();GV=P.objectWithoutOptionalProperties({contentType:P.string().optional()})});var DIe,ILt=h(()=>{"use strict";Me();get();fp();DIe=P.objectWithoutOptionalProperties({availability:d$.optional()}).extend(ao)});var g$,vet=h(()=>{"use strict";Me();g$=P.objectWithoutOptionalProperties({jsonExample:P.unknown()})});var R$i=h(()=>{"use strict";get();r$i();LH();yLt();dLt();mLt();bLt();O$i();P$i();TLe();Vvr();fLt();Id();Mf();ZZi();met();het();Dfe();ICr();B$i();CCr();OLe();fp();ILt();vet()});var D$i={};te(D$i,{Availability:()=>d$,AvailabilityStatus:()=>Kvr,Declaration:()=>Wx,DisplayName:()=>BIe,EndpointId:()=>Bfe,EndpointReference:()=>wIe,ErrorId:()=>RIe,EscapedString:()=>ECr,FeatureId:()=>ELt,FernFilepath:()=>VV,Name:()=>fet,NameAndWireValue:()=>SIe,NameAndWireValueOrString:()=>fs,NameOrString:()=>Ro,SafeAndUnsafeString:()=>CLe,ServiceId:()=>p$,SubpackageId:()=>f$,TypeId:()=>cB,WebSocketChannelId:()=>Iet,WebhookGroupId:()=>Eet,WebhookId:()=>vCr,WithContentType:()=>GV,WithDocs:()=>ao,WithDocsAndAvailability:()=>DIe,WithJsonExample:()=>g$});var yic=h(()=>{"use strict";R$i()});var xCr,k$i=h(()=>{"use strict";Me();Id();xCr=P.objectWithoutOptionalProperties({errorInstanceIdKey:fs})});var F$i=h(()=>{"use strict";k$i()});var N$i={};te(N$i,{Constants:()=>xCr});var bic=h(()=>{"use strict";F$i()});var PLe,j$i=h(()=>{"use strict";Me();PLe=P.objectWithoutOptionalProperties({unsafeName:P.string(),safeName:P.string()})});var hg,cQ=h(()=>{"use strict";Me();j$i();hg=P.objectWithoutOptionalProperties({originalName:P.string(),camelCase:PLe,pascalCase:PLe,snakeCase:PLe,screamingSnakeCase:PLe})});var SCr,z$i=h(()=>{"use strict";Me();SCr=P.enum_(["ALL","ANY","ENDPOINT_SECURITY"])});var qV,BLe=h(()=>{"use strict";Me();cQ();z$i();qV=P.objectWithoutOptionalProperties({wrapperProperty:hg.optional(),requirement:SCr.optional()})});var wCr,Q$i=h(()=>{"use strict";Me();cQ();BLe();wCr=P.objectWithoutOptionalProperties({username:hg,usernameOmit:P.boolean().optional(),password:hg,passwordOmit:P.boolean().optional()}).extend(qV)});var TCr,M$i=h(()=>{"use strict";Me();cQ();BLe();TCr=P.objectWithoutOptionalProperties({token:hg}).extend(qV)});var AC,_H=h(()=>{"use strict";Me();cQ();AC=P.objectWithoutOptionalProperties({wireValue:P.string(),name:hg})});var OCr,L$i=h(()=>{"use strict";Me();OCr=P.enum_(["READ_ONLY","WRITE_ONLY"])});var oA,uQ=h(()=>{"use strict";Me();$o();_H();L$i();oA=P.objectWithoutOptionalProperties({name:AC,typeReference:P.lazy(()=>rE.TypeReference),propertyAccess:OCr.optional(),variable:P.string().optional()})});var PCr,_$i=h(()=>{"use strict";Me();uQ();BLe();PCr=P.objectWithoutOptionalProperties({header:oA}).extend(qV)});var BCr,U$i=h(()=>{"use strict";Me();uQ();BLe();BCr=P.objectWithoutOptionalProperties({parameters:P.list(oA).optional()}).extend(qV)});var RCr,V$i=h(()=>{"use strict";Me();cQ();uQ();BLe();RCr=P.objectWithoutOptionalProperties({clientId:hg,clientSecret:hg,customProperties:P.list(oA).optional()}).extend(qV)});var DCr,G$i=h(()=>{"use strict";Xr();Me();Q$i();M$i();_$i();U$i();V$i();DCr=P.union("type",{basic:wCr,bearer:TCr,header:PCr,oauth:RCr,inferred:BCr}).transform({transform:e=>{switch(e.type){case"basic":return sr.Auth.basic(e);case"bearer":return sr.Auth.bearer(e);case"header":return sr.Auth.header(e);case"oauth":return sr.Auth.oauth(e);case"inferred":return sr.Auth.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t})});var kCr,q$i=h(()=>{"use strict";Me();kCr=P.objectWithoutOptionalProperties({username:P.string(),password:P.string()})});var FCr,W$i=h(()=>{"use strict";Me();FCr=P.objectWithoutOptionalProperties({token:P.string()})});var NCr,H$i=h(()=>{"use strict";Me();NCr=P.objectWithoutOptionalProperties({value:P.unknown()})});var jCr,K$i=h(()=>{"use strict";Me();jCr=P.objectWithoutOptionalProperties({values:P.record(P.string(),P.unknown()).optional()})});var zCr,J$i=h(()=>{"use strict";Me();zCr=P.objectWithoutOptionalProperties({clientId:P.string(),clientSecret:P.string(),customPropertyValues:P.record(P.string(),P.unknown()).optional()})});var QCr,Y$i=h(()=>{"use strict";Xr();Me();q$i();W$i();H$i();K$i();J$i();QCr=P.union("type",{basic:kCr,bearer:FCr,header:NCr,oauth:zCr,inferred:jCr}).transform({transform:e=>{switch(e.type){case"basic":return sr.AuthValues.basic(e);case"bearer":return sr.AuthValues.bearer(e);case"header":return sr.AuthValues.header(e);case"oauth":return sr.AuthValues.oauth(e);case"inferred":return sr.AuthValues.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t})});var X$i=h(()=>{"use strict";G$i();z$i();Y$i();BLe();Q$i();q$i();M$i();W$i();_$i();H$i();U$i();K$i();V$i();J$i()});var Z$i={};te(Z$i,{Auth:()=>DCr,AuthRequirement:()=>SCr,AuthValues:()=>QCr,BaseAuth:()=>qV,BasicAuth:()=>wCr,BasicAuthValues:()=>kCr,BearerAuth:()=>TCr,BearerAuthValues:()=>FCr,HeaderAuth:()=>PCr,HeaderAuthValues:()=>NCr,InferredAuth:()=>BCr,InferredAuthValues:()=>jCr,OAuth:()=>RCr,OAuthValues:()=>zCr});var Eic=h(()=>{"use strict";X$i()});var MCr,$$i=h(()=>{"use strict";Me();MCr=P.string()});var LCr,eeo=h(()=>{"use strict";Me();cQ();LCr=P.objectWithoutOptionalProperties({allParts:P.list(hg),packagePath:P.list(hg),file:hg.optional()})});var Iic,vic=h(()=>{"use strict";Me();_H();Iic=P.undiscriminatedUnion([P.string(),AC])});var Cic,xic=h(()=>{"use strict";Me();cQ();Cic=P.undiscriminatedUnion([P.string(),hg])});var A$,Cet=h(()=>{"use strict";Me();A$=P.string()});var xet,_Cr=h(()=>{"use strict";Me();xet=P.objectWithoutOptionalProperties({docs:P.string().optional()})});var teo=h(()=>{"use strict";$$i();eeo();cQ();_H();vic();xic();j$i();Cet();_Cr()});var reo={};te(reo,{EndpointId:()=>MCr,FernFilepath:()=>LCr,Name:()=>hg,NameAndWireValue:()=>AC,NameAndWireValueOrString:()=>Iic,NameOrString:()=>Cic,SafeAndUnsafeString:()=>PLe,TypeId:()=>A$,WithDocs:()=>xet});var Sic=h(()=>{"use strict";teo()});var lD,kfe=h(()=>{"use strict";Me();eeo();cQ();lD=P.objectWithoutOptionalProperties({fernFilepath:LCr,name:hg})});var neo=h(()=>{"use strict";kfe()});var ieo={};te(ieo,{Declaration:()=>lD});var wic=h(()=>{"use strict";neo()});var wet,UCr=h(()=>{"use strict";Xr();Me();$o();wet=P.union("type",{bytes:P.object({}),typeReference:P.object({value:P.lazy(()=>rE.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return sr.ReferencedRequestBodyType.bytes();case"typeReference":return sr.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var VCr,oeo=h(()=>{"use strict";Me();uQ();UCr();VCr=P.objectWithoutOptionalProperties({pathParameters:P.list(oA).optional(),body:wet.optional(),bodyRequired:P.boolean().optional()})});var GCr,seo=h(()=>{"use strict";Me();GCr=P.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var Tet,qCr=h(()=>{"use strict";Me();seo();Tet=P.objectWithoutOptionalProperties({method:GCr,path:P.string()})});var y$,Oet=h(()=>{"use strict";Me();y$=P.string()});var kIe,vLt=h(()=>{"use strict";Me();kIe=P.string()});var FIe,CLt=h(()=>{"use strict";Me();FIe=P.string()});var WCr,aeo=h(()=>{"use strict";Me();vLt();CLt();WCr=P.record(kIe,FIe)});var HCr,ceo=h(()=>{"use strict";Me();Oet();aeo();HCr=P.undiscriminatedUnion([y$,WCr])});var Pet,ueo=h(()=>{"use strict";Me();Pet=P.record(P.string(),P.unknown())});var KCr,leo=h(()=>{"use strict";Me();Y$i();qCr();ceo();ueo();KCr=P.objectWithoutOptionalProperties({endpoint:Tet,baseUrl:P.property("baseURL",P.string().optional()),environment:HCr.optional(),auth:QCr.optional(),pathParameters:Pet.optional(),queryParameters:Pet.optional(),headers:Pet.optional(),requestBody:P.unknown().optional()})});var JCr,peo=h(()=>{"use strict";Me();leo();JCr=P.objectWithoutOptionalProperties({id:P.string(),name:P.string().optional(),isUserSpecified:P.boolean().optional()}).extend(KCr)});var xLt,feo=h(()=>{"use strict";Me();_H();xLt=P.objectWithoutOptionalProperties({isOptional:P.boolean().optional()}).extend(AC)});var YCr,deo=h(()=>{"use strict";Xr();Me();uQ();feo();YCr=P.union("type",{file:xLt,fileArray:xLt,bodyProperty:oA}).transform({transform:e=>{switch(e.type){case"file":return sr.FileUploadRequestBodyProperty.file(e);case"fileArray":return sr.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return sr.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t})});var XCr,meo=h(()=>{"use strict";Me();deo();XCr=P.objectWithoutOptionalProperties({properties:P.list(YCr)})});var ZCr,heo=h(()=>{"use strict";Me();cQ();UCr();ZCr=P.objectWithoutOptionalProperties({bodyKey:hg,bodyType:wet})});var $Cr,geo=h(()=>{"use strict";Xr();Me();uQ();meo();heo();$Cr=P.union("type",{properties:P.object({value:P.list(oA)}),referenced:ZCr,fileUpload:XCr}).transform({transform:e=>{switch(e.type){case"properties":return sr.InlinedRequestBody.properties(e.value);case"referenced":return sr.InlinedRequestBody.referenced(e);case"fileUpload":return sr.InlinedRequestBody.fileUpload(e);default:return e}},untransform:({_visit:e,...t})=>t})});var exr,Aeo=h(()=>{"use strict";Me();exr=P.objectWithoutOptionalProperties({includePathParameters:P.boolean(),onlyPathParameters:P.boolean()})});var txr,yeo=h(()=>{"use strict";Me();kfe();uQ();geo();Aeo();txr=P.objectWithoutOptionalProperties({declaration:lD,pathParameters:P.list(oA).optional(),queryParameters:P.list(oA).optional(),headers:P.list(oA).optional(),body:$Cr.optional(),metadata:exr.optional()})});var rxr,beo=h(()=>{"use strict";Xr();Me();oeo();yeo();rxr=P.union("type",{body:VCr,inlined:txr}).transform({transform:e=>{switch(e.type){case"body":return sr.Request.body(e);case"inlined":return sr.Request.inlined(e);default:return e}},untransform:({_visit:e,...t})=>t})});var nxr,Eeo=h(()=>{"use strict";Xr();Me();nxr=P.union("type",{json:P.object({}),streaming:P.object({}),streamParameter:P.object({}),fileDownload:P.object({}),text:P.object({}),bytes:P.object({})}).transform({transform:e=>{switch(e.type){case"json":return sr.Response.json();case"streaming":return sr.Response.streaming();case"streamParameter":return sr.Response.streamParameter();case"fileDownload":return sr.Response.fileDownload();case"text":return sr.Response.text();case"bytes":return sr.Response.bytes();default:return e}},untransform:({_visit:e,...t})=>t})});var ixr,Ieo=h(()=>{"use strict";Me();G$i();kfe();peo();qCr();beo();Eeo();ixr=P.objectWithoutOptionalProperties({auth:DCr.optional(),declaration:lD,location:Tet,request:rxr,response:nxr,examples:P.list(JCr).optional()})});var veo=h(()=>{"use strict";oeo();Ieo();peo();qCr();meo();feo();deo();yeo();geo();Aeo();heo();UCr();beo();Eeo()});var Ceo={};te(Ceo,{BodyRequest:()=>VCr,Endpoint:()=>ixr,EndpointExample:()=>JCr,EndpointLocation:()=>Tet,FileUploadRequestBody:()=>XCr,FileUploadRequestBodyFileProperty:()=>xLt,FileUploadRequestBodyProperty:()=>YCr,InlinedRequest:()=>txr,InlinedRequestBody:()=>$Cr,InlinedRequestMetadata:()=>exr,ReferencedRequestBody:()=>ZCr,ReferencedRequestBodyType:()=>wet,Request:()=>rxr,Response:()=>nxr});var Tic=h(()=>{"use strict";veo()});var oxr,xeo=h(()=>{"use strict";Me();cQ();vLt();oxr=P.objectWithoutOptionalProperties({id:kIe,name:hg})});var sxr,Seo=h(()=>{"use strict";Me();cQ();_Cr();vLt();Oet();CLt();sxr=P.objectWithoutOptionalProperties({id:y$,name:hg,urls:P.record(kIe,FIe)}).extend(xet)});var axr,weo=h(()=>{"use strict";Me();xeo();Seo();axr=P.objectWithoutOptionalProperties({baseUrls:P.list(oxr),environments:P.list(sxr)})});var cxr,Teo=h(()=>{"use strict";Me();cQ();_Cr();Oet();CLt();cxr=P.objectWithoutOptionalProperties({id:y$,name:hg,url:FIe}).extend(xet)});var uxr,Oeo=h(()=>{"use strict";Me();Teo();uxr=P.objectWithoutOptionalProperties({environments:P.list(cxr)})});var lxr,Peo=h(()=>{"use strict";Xr();Me();weo();Oeo();lxr=P.union("type",{singleBaseUrl:uxr,multipleBaseUrls:axr}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return sr.Environments.singleBaseUrl(e);case"multipleBaseUrls":return sr.Environments.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t})});var pxr,Beo=h(()=>{"use strict";Me();Oet();Peo();pxr=P.objectWithoutOptionalProperties({defaultEnvironment:y$.optional(),environments:lxr})});var Reo=h(()=>{"use strict";vLt();xeo();Oet();Peo();Beo();CLt();ceo();Seo();weo();aeo();Teo();Oeo()});var Deo={};te(Deo,{EnvironmentBaseUrlId:()=>kIe,EnvironmentBaseUrlWithId:()=>oxr,EnvironmentId:()=>y$,EnvironmentUrl:()=>FIe,EnvironmentValues:()=>HCr,Environments:()=>lxr,EnvironmentsConfig:()=>pxr,MultipleBaseUrlsEnvironment:()=>sxr,MultipleBaseUrlsEnvironments:()=>axr,MultipleEnvironmentUrlValues:()=>WCr,SingleBaseUrlEnvironment:()=>cxr,SingleBaseUrlEnvironments:()=>uxr});var Oic=h(()=>{"use strict";Reo()});var keo=h(()=>{"use strict";seo()});var Feo={};te(Feo,{HttpMethod:()=>GCr});var Pic=h(()=>{"use strict";keo()});var fxr,Neo=h(()=>{"use strict";Me();fxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var dxr,jeo=h(()=>{"use strict";Me();dxr=P.enum_(["explicit","auto"])});var Bet,mxr=h(()=>{"use strict";Me();Bet=P.string()});var hxr,zeo=h(()=>{"use strict";Me();hxr=P.enum_(["header","query","body","path"])});var Ret,gxr=h(()=>{"use strict";Me();$o();Id();fp();wLe();jeo();mxr();zeo();Ret=P.objectWithoutOptionalProperties({id:Bet,name:fs,location:hxr,target:P.string(),valueType:P.lazy(()=>zs),env:P.string().optional(),clientDefault:UV.optional(),optional:P.boolean().optional(),apply:dxr.optional()}).extend(ao)});var Axr,Qeo=h(()=>{"use strict";Me();$o();kfe();Axr=P.objectWithoutOptionalProperties({declaration:lD,typeReference:P.lazy(()=>rE.TypeReference)})});var yxr,Meo=h(()=>{"use strict";Me();_H();uQ();yxr=P.objectWithoutOptionalProperties({discriminantValue:AC,properties:P.list(oA).optional()})});var bxr,Leo=h(()=>{"use strict";Me();_H();Cet();uQ();bxr=P.objectWithoutOptionalProperties({typeId:A$,discriminantValue:AC,properties:P.list(oA)})});var Exr,_eo=h(()=>{"use strict";Me();$o();_H();uQ();Exr=P.objectWithoutOptionalProperties({typeReference:P.lazy(()=>rE.TypeReference),discriminantValue:AC,properties:P.list(oA).optional()})});var Ixr,Ueo=h(()=>{"use strict";Xr();Me();Meo();Leo();_eo();Ixr=P.union("type",{samePropertiesAsObject:bxr,singleProperty:Exr,noProperties:yxr}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return sr.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return sr.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return sr.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:({_visit:e,...t})=>t})});var vxr,Veo=h(()=>{"use strict";Me();_H();kfe();Ueo();vxr=P.objectWithoutOptionalProperties({declaration:lD,discriminant:AC,types:P.record(P.string(),Ixr),inheritedBaseProperties:P.list(AC).optional()})});var Cxr,Geo=h(()=>{"use strict";Me();_H();kfe();Cxr=P.objectWithoutOptionalProperties({declaration:lD,values:P.list(AC)})});var xxr,qeo=h(()=>{"use strict";Me();_H();Cet();kfe();uQ();xxr=P.objectWithoutOptionalProperties({declaration:lD,properties:P.list(oA),extends:P.list(A$).optional(),additionalProperties:P.boolean().optional(),deferredUnionBaseProperties:P.list(AC).optional()})});var Sxr,Weo=h(()=>{"use strict";Me();$o();kfe();Sxr=P.objectWithoutOptionalProperties({declaration:lD,types:P.list(P.lazy(()=>rE.TypeReference))})});var wxr,Heo=h(()=>{"use strict";Xr();Me();Qeo();Veo();Geo();qeo();Weo();wxr=P.union("type",{alias:Axr,enum:Cxr,object:xxr,discriminatedUnion:vxr,undiscriminatedUnion:Sxr}).transform({transform:e=>{switch(e.type){case"alias":return sr.NamedType.alias(e);case"enum":return sr.NamedType.enum(e);case"object":return sr.NamedType.object(e);case"discriminatedUnion":return sr.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return sr.NamedType.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Txr,Keo=h(()=>{"use strict";Me();$o();Vvr();Txr=P.objectWithoutOptionalProperties({id:P.string(),name:fet,typeReference:P.lazy(()=>rE.TypeReference)})});var Oxr,Jeo=h(()=>{"use strict";Me();Oxr=P.objectWithoutOptionalProperties({version:P.string(),repoUrl:P.string()})});var Pxr,Yeo=h(()=>{"use strict";Me();Pxr=P.objectWithoutOptionalProperties({version:P.string(),coordinate:P.string(),repoUrl:P.string().optional()})});var Bxr,Xeo=h(()=>{"use strict";Me();Bxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var Rxr,Zeo=h(()=>{"use strict";Me();Rxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var Dxr,$eo=h(()=>{"use strict";Me();Dxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var kxr,eto=h(()=>{"use strict";Me();kxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var Fxr,tto=h(()=>{"use strict";Me();Fxr=P.objectWithoutOptionalProperties({version:P.string(),repoUrl:P.string()})});var Nxr,rto=h(()=>{"use strict";Xr();Me();Neo();Jeo();Yeo();Xeo();Zeo();$eo();eto();tto();Nxr=P.union("type",{go:Oxr,swift:Fxr,maven:Pxr,npm:Bxr,nuget:Rxr,pypi:Dxr,rubygems:kxr,crates:fxr}).transform({transform:e=>{switch(e.type){case"go":return sr.PublishInfo.go(e);case"swift":return sr.PublishInfo.swift(e);case"maven":return sr.PublishInfo.maven(e);case"npm":return sr.PublishInfo.npm(e);case"nuget":return sr.PublishInfo.nuget(e);case"pypi":return sr.PublishInfo.pypi(e);case"rubygems":return sr.PublishInfo.rubygems(e);case"crates":return sr.PublishInfo.crates(e);default:return e}},untransform:({_visit:e,...t})=>t})});var jxr,nto=h(()=>{"use strict";Xr();Me();rto();jxr=P.union("type",{publish:P.object({value:Nxr}),local:P.object({})}).transform({transform:e=>{switch(e.type){case"publish":return sr.GeneratorOutputConfig.publish(e.value);case"local":return sr.GeneratorOutputConfig.local();default:return e}},untransform:({_visit:e,...t})=>t})});var zxr,ito=h(()=>{"use strict";Me();nto();zxr=P.objectWithoutOptionalProperties({apiName:P.string(),organization:P.string(),customConfig:P.unknown(),outputConfig:jxr})});var Qxr,oto=h(()=>{"use strict";Me();gxr();$$i();Cet();Ieo();Beo();uQ();Heo();Keo();ito();Qxr=P.objectWithoutOptionalProperties({version:P.stringLiteral("1.0.0"),types:P.record(A$,wxr),endpoints:P.record(MCr,ixr),environments:pxr.optional(),headers:P.list(oA).optional(),pathParameters:P.list(oA).optional(),variables:P.list(Txr).optional(),globalParameters:P.list(Ret).optional(),generatorConfig:zxr.optional()})});var sto=h(()=>{"use strict";Neo();oto();ito();nto();Jeo();Yeo();Xeo();Zeo();rto();$eo();eto();tto()});var ato={};te(ato,{CratesPublishInfo:()=>fxr,DynamicIntermediateRepresentation:()=>Qxr,GeneratorConfig:()=>zxr,GeneratorOutputConfig:()=>jxr,GoPublishInfo:()=>Oxr,MavenPublishInfo:()=>Pxr,NpmPublishInfo:()=>Bxr,NugetPublishInfo:()=>Rxr,PublishInfo:()=>Nxr,PypiPublishInfo:()=>Dxr,RubyGemsPublishInfo:()=>kxr,SwiftPublishInfo:()=>Fxr});var Bic=h(()=>{"use strict";sto()});var Mxr,cto=h(()=>{"use strict";Me();Mxr=P.enum_(["CRITICAL","WARNING"])});var Lxr,uto=h(()=>{"use strict";Me();cto();Lxr=P.objectWithoutOptionalProperties({severity:Mxr,message:P.string()})});var Ric,Dic=h(()=>{"use strict";Me();uto();Ric=P.objectWithoutOptionalProperties({snippet:P.string(),errors:P.list(Lxr).optional()})});var lto=h(()=>{"use strict";leo();Dic();uto();cto();ueo()});var pto={};te(pto,{EndpointSnippetRequest:()=>KCr,EndpointSnippetResponse:()=>Ric,ErrorSeverity:()=>Mxr,Error_:()=>Lxr,Values:()=>Pet});var kic=h(()=>{"use strict";lto()});var _xr,fto=h(()=>{"use strict";Xr();Me();_xr=P.union("type",{boolean:P.object({value:P.boolean()}),string:P.object({value:P.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return sr.LiteralType.boolean(e.value);case"string":return sr.LiteralType.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var Fic,Nic=h(()=>{"use strict";Me();$o();Fic=P.objectWithoutOptionalProperties({key:P.lazy(()=>rE.TypeReference),value:P.lazy(()=>rE.TypeReference)})});var Uxr,dto=h(()=>{"use strict";Me();Uxr=P.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","DATE_TIME_RFC_2822","UUID","BASE_64","BIG_INTEGER"])});var jic,zic=h(()=>{"use strict";Xr();Me();$o();Cet();fto();dto();jic=P.union("type",{list:P.object({value:P.lazy(()=>rE.TypeReference)}),literal:P.object({value:_xr}),map:P.lazyObject(()=>rE.MapType),named:P.object({value:A$}),nullable:P.object({value:P.lazy(()=>rE.TypeReference)}),optional:P.object({value:P.lazy(()=>rE.TypeReference)}),primitive:P.object({value:Uxr}),set:P.object({value:P.lazy(()=>rE.TypeReference)}),unknown:P.object({})}).transform({transform:e=>{switch(e.type){case"list":return sr.TypeReference.list(e.value);case"literal":return sr.TypeReference.literal(e.value);case"map":return sr.TypeReference.map(e);case"named":return sr.TypeReference.named(e.value);case"nullable":return sr.TypeReference.nullable(e.value);case"optional":return sr.TypeReference.optional(e.value);case"primitive":return sr.TypeReference.primitive(e.value);case"set":return sr.TypeReference.set(e.value);case"unknown":return sr.TypeReference.unknown();default:return e}},untransform:({_visit:e,...t})=>t})});var mto=h(()=>{"use strict";Qeo();Veo();Geo();fto();Nic();uQ();Heo();L$i();qeo();dto();Ueo();Meo();Leo();_eo();zic();Weo()});var hto={};te(hto,{AliasType:()=>Axr,DiscriminatedUnionType:()=>vxr,EnumType:()=>Cxr,LiteralType:()=>_xr,MapType:()=>Fic,NamedParameter:()=>oA,NamedType:()=>wxr,ObjectPropertyAccess:()=>OCr,ObjectType:()=>xxr,PrimitiveTypeV1:()=>Uxr,SingleDiscriminatedUnionType:()=>Ixr,SingleDiscriminatedUnionTypeNoProperties:()=>yxr,SingleDiscriminatedUnionTypeObject:()=>bxr,SingleDiscriminatedUnionTypeSingleProperty:()=>Exr,TypeReference:()=>jic,UndiscriminatedUnionType:()=>Sxr});var Qic=h(()=>{"use strict";mto()});var gto=h(()=>{"use strict";Keo()});var Ato={};te(Ato,{VariableDeclaration:()=>Txr});var Mic=h(()=>{"use strict";gto()});var Lic=h(()=>{"use strict";Eic();X$i();Sic();teo();wic();neo();Tic();veo();Oic();Reo();Pic();keo();Bic();sto();kic();lto();Qic();mto();Mic();gto()});var rE={};te(rE,{AliasType:()=>Axr,Auth:()=>DCr,AuthRequirement:()=>SCr,AuthValues:()=>QCr,BaseAuth:()=>qV,BasicAuth:()=>wCr,BasicAuthValues:()=>kCr,BearerAuth:()=>TCr,BearerAuthValues:()=>FCr,BodyRequest:()=>VCr,CratesPublishInfo:()=>fxr,Declaration:()=>lD,DiscriminatedUnionType:()=>vxr,DynamicIntermediateRepresentation:()=>Qxr,Endpoint:()=>ixr,EndpointExample:()=>JCr,EndpointId:()=>MCr,EndpointLocation:()=>Tet,EndpointSnippetRequest:()=>KCr,EndpointSnippetResponse:()=>Ric,EnumType:()=>Cxr,EnvironmentBaseUrlId:()=>kIe,EnvironmentBaseUrlWithId:()=>oxr,EnvironmentId:()=>y$,EnvironmentUrl:()=>FIe,EnvironmentValues:()=>HCr,Environments:()=>lxr,EnvironmentsConfig:()=>pxr,ErrorSeverity:()=>Mxr,Error_:()=>Lxr,FernFilepath:()=>LCr,FileUploadRequestBody:()=>XCr,FileUploadRequestBodyFileProperty:()=>xLt,FileUploadRequestBodyProperty:()=>YCr,GeneratorConfig:()=>zxr,GeneratorOutputConfig:()=>jxr,GoPublishInfo:()=>Oxr,HeaderAuth:()=>PCr,HeaderAuthValues:()=>NCr,HttpMethod:()=>GCr,InferredAuth:()=>BCr,InferredAuthValues:()=>jCr,InlinedRequest:()=>txr,InlinedRequestBody:()=>$Cr,InlinedRequestMetadata:()=>exr,LiteralType:()=>_xr,MapType:()=>Fic,MavenPublishInfo:()=>Pxr,MultipleBaseUrlsEnvironment:()=>sxr,MultipleBaseUrlsEnvironments:()=>axr,MultipleEnvironmentUrlValues:()=>WCr,Name:()=>hg,NameAndWireValue:()=>AC,NameAndWireValueOrString:()=>Iic,NameOrString:()=>Cic,NamedParameter:()=>oA,NamedType:()=>wxr,NpmPublishInfo:()=>Bxr,NugetPublishInfo:()=>Rxr,OAuth:()=>RCr,OAuthValues:()=>zCr,ObjectPropertyAccess:()=>OCr,ObjectType:()=>xxr,PrimitiveTypeV1:()=>Uxr,PublishInfo:()=>Nxr,PypiPublishInfo:()=>Dxr,ReferencedRequestBody:()=>ZCr,ReferencedRequestBodyType:()=>wet,Request:()=>rxr,Response:()=>nxr,RubyGemsPublishInfo:()=>kxr,SafeAndUnsafeString:()=>PLe,SingleBaseUrlEnvironment:()=>cxr,SingleBaseUrlEnvironments:()=>uxr,SingleDiscriminatedUnionType:()=>Ixr,SingleDiscriminatedUnionTypeNoProperties:()=>yxr,SingleDiscriminatedUnionTypeObject:()=>bxr,SingleDiscriminatedUnionTypeSingleProperty:()=>Exr,SwiftPublishInfo:()=>Fxr,TypeId:()=>A$,TypeReference:()=>jic,UndiscriminatedUnionType:()=>Sxr,Values:()=>Pet,VariableDeclaration:()=>Txr,WithDocs:()=>xet,auth:()=>Z$i,commons:()=>reo,declaration:()=>ieo,endpoints:()=>Ceo,environment:()=>Deo,http:()=>Feo,ir:()=>ato,snippets:()=>pto,types:()=>hto,variables:()=>Ato});var _ic=h(()=>{"use strict";Lic()});var pD,RLe=h(()=>{"use strict";Me();pD=P.string()});var Vxr,yto=h(()=>{"use strict";Me();Mf();RLe();Vxr=P.objectWithoutOptionalProperties({id:pD,name:Ro})});var b$,Det=h(()=>{"use strict";Me();b$=P.string()});var NIe,SLt=h(()=>{"use strict";Me();NIe=P.string()});var ket,Gxr=h(()=>{"use strict";Me();Mf();ket=P.objectWithoutOptionalProperties({id:P.string(),name:Ro,default:P.string().optional(),values:P.list(P.string()).optional()})});var qxr,bto=h(()=>{"use strict";Me();Mf();fp();RLe();Det();SLt();Gxr();qxr=P.objectWithoutOptionalProperties({id:b$,name:Ro,urls:P.record(pD,NIe),audiences:P.list(P.string()).optional(),defaultUrls:P.record(pD,P.string()).optional(),urlTemplates:P.record(pD,P.string()).optional(),urlVariables:P.record(pD,P.list(ket)).optional()}).extend(ao)});var Wxr,Eto=h(()=>{"use strict";Me();yto();bto();Wxr=P.objectWithoutOptionalProperties({baseUrls:P.list(Vxr),environments:P.list(qxr)})});var Hxr,Ito=h(()=>{"use strict";Me();Mf();fp();Det();SLt();Gxr();Hxr=P.objectWithoutOptionalProperties({id:b$,name:Ro,url:NIe,audiences:P.list(P.string()).optional(),defaultUrl:P.string().optional(),urlTemplate:P.string().optional(),urlVariables:P.list(ket).optional()}).extend(ao)});var Kxr,vto=h(()=>{"use strict";Me();Ito();Kxr=P.objectWithoutOptionalProperties({environments:P.list(Hxr)})});var Jxr,Cto=h(()=>{"use strict";Xr();Me();Eto();vto();Jxr=P.union("type",{singleBaseUrl:Kxr,multipleBaseUrls:Wxr}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return Z0.singleBaseUrl(e);case"multipleBaseUrls":return Z0.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Yxr,xto=h(()=>{"use strict";Me();Det();Cto();Yxr=P.objectWithoutOptionalProperties({defaultEnvironment:b$.optional(),baseUrlEnvVar:P.string().optional(),environments:Jxr})});var Sto=h(()=>{"use strict";RLe();yto();Det();Cto();xto();SLt();bto();Eto();Gxr();Ito();vto()});var wto={};te(wto,{EnvironmentBaseUrlId:()=>pD,EnvironmentBaseUrlWithId:()=>Vxr,EnvironmentId:()=>b$,EnvironmentUrl:()=>NIe,Environments:()=>Jxr,EnvironmentsConfig:()=>Yxr,MultipleBaseUrlsEnvironment:()=>qxr,MultipleBaseUrlsEnvironments:()=>Wxr,ServerVariable:()=>ket,SingleBaseUrlEnvironment:()=>Hxr,SingleBaseUrlEnvironments:()=>Kxr});var Uic=h(()=>{"use strict";Sto()});var jIe,wLt=h(()=>{"use strict";Me();bLt();TLe();Mf();jIe=P.objectWithoutOptionalProperties({errorId:RIe,fernFilepath:VV,name:Ro})});var rT,Ffe=h(()=>{"use strict";Me();$o();LH();Id();m$();wLe();rT=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),env:P.string().optional(),clientDefault:UV.optional(),defaultValue:P.unknown().optional(),v2Examples:eT.optional()}).extend(Wx)});var Xxr,Tto=h(()=>{"use strict";Me();$o();Mf();fp();vet();Xxr=P.objectWithoutOptionalProperties({name:Ro.optional(),shape:P.lazyObject(()=>uu)}).extend(g$).extend(ao)});var Zxr,Oto=h(()=>{"use strict";Me();$o();Id();fp();m$();Ffe();wLt();Tto();Zxr=P.objectWithoutOptionalProperties({name:jIe,displayName:P.string().optional(),discriminantValue:fs,type:P.lazy(()=>zs).optional(),statusCode:P.number(),isWildcardStatusCode:P.boolean().optional(),examples:P.list(Xxr),v2Examples:eT.optional(),headers:P.list(rT).optional()}).extend(ao)});var Vic,Gic=h(()=>{"use strict";Xr();Me();Id();Vic=P.union("type",{property:P.object({value:fs}),statusCode:P.object({})}).transform({transform:e=>{switch(e.type){case"property":return vIe.property(e.value);case"statusCode":return vIe.statusCode();default:return e}},untransform:({_visit:e,...t})=>t})});var Pto=h(()=>{"use strict";wLt();Oto();Gic();Tto()});var Bto={};te(Bto,{DeclaredErrorName:()=>jIe,ErrorDeclaration:()=>Zxr,ErrorDeclarationDiscriminantValue:()=>Vic,ExampleError:()=>Xxr});var qic=h(()=>{"use strict";Pto()});var $xr,Rto=h(()=>{"use strict";Me();$xr=P.objectWithoutOptionalProperties({username:P.string(),password:P.string()})});var eSr,Dto=h(()=>{"use strict";Me();eSr=P.objectWithoutOptionalProperties({token:P.string()})});var tSr,kto=h(()=>{"use strict";Me();tSr=P.objectWithoutOptionalProperties({value:P.unknown()})});var rSr,Fto=h(()=>{"use strict";Me();RLe();SLt();rSr=P.record(pD,NIe)});var nSr,Nto=h(()=>{"use strict";Me();nSr=P.objectWithoutOptionalProperties({clientId:P.string(),clientSecret:P.string()})});var Fet,iSr=h(()=>{"use strict";Xr();Me();Rto();Dto();kto();Nto();Fet=P.union("type",{basic:$xr,bearer:eSr,header:tSr,oauth:nSr}).transform({transform:e=>{switch(e.type){case"basic":return zV.basic(e);case"bearer":return zV.bearer(e);case"header":return zV.header(e);case"oauth":return zV.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t})});var oSr,jto=h(()=>{"use strict";Me();oSr=P.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var sSr,zto=h(()=>{"use strict";Me();jto();sSr=P.objectWithoutOptionalProperties({method:oSr,path:P.string()})});var Net,aSr=h(()=>{"use strict";Me();Det();Fto();Net=P.undiscriminatedUnion([b$,rSr])});var cSr,Qto=h(()=>{"use strict";Me();fp();cSr=P.objectWithoutOptionalProperties({name:P.string().optional(),language:P.string(),code:P.string()}).extend(ao)});var E$,uSr=h(()=>{"use strict";Me();E$=P.record(P.string(),P.unknown())});var lSr,Mto=h(()=>{"use strict";Me();fp();iSr();zto();aSr();uSr();lSr=P.objectWithoutOptionalProperties({endpoint:sSr,baseUrl:P.property("baseURL",P.string().optional()),environment:Net.optional(),auth:Fet.optional(),pathParameters:E$.optional(),queryParameters:E$.optional(),headers:E$.optional(),requestBody:P.unknown().optional()}).extend(ao)});var pSr,Lto=h(()=>{"use strict";Xr();Me();pSr=P.union("type",{error:P.object({value:P.unknown()}),json:P.object({value:P.unknown()}),stream:P.object({value:P.list(P.unknown())})}).transform({transform:e=>{switch(e.type){case"error":return Gx.error(e.value);case"json":return Gx.json(e.value);case"stream":return Gx.stream(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var fSr,_to=h(()=>{"use strict";Me();fp();Lto();fSr=P.objectWithoutOptionalProperties({statusCode:P.number().optional(),body:pSr.optional()}).extend(ao)});var TLt,Uto=h(()=>{"use strict";Me();Qto();Mto();_to();TLt=P.objectWithoutOptionalProperties({displayName:P.string().optional(),contentType:P.string().optional(),request:lSr.optional(),response:fSr.optional(),codeSamples:P.list(cSr).optional()})});var dSr,Vto=h(()=>{"use strict";Me();Uto();dSr=P.objectWithoutOptionalProperties({userSpecifiedExamples:P.record(P.string(),TLt),autogeneratedExamples:P.record(P.string(),TLt)})});var OLt,Gto=h(()=>{"use strict";Me();OLt=P.objectWithoutOptionalProperties({name:P.string().optional(),payload:P.unknown()})});var mSr,qto=h(()=>{"use strict";Me();Gto();mSr=P.objectWithoutOptionalProperties({userSpecifiedExamples:P.record(P.string(),OLt),autogeneratedExamples:P.record(P.string(),OLt)})});var hSr,Wto=h(()=>{"use strict";Me();hSr=P.objectWithoutOptionalProperties({path:P.string()})});var gSr,Hto=h(()=>{"use strict";Me();gSr=P.objectWithoutOptionalProperties({type:P.string(),body:P.unknown()})});var PLt,Kto=h(()=>{"use strict";Me();iSr();aSr();uSr();Wto();Hto();PLt=P.objectWithoutOptionalProperties({channel:hSr,baseUrl:P.property("baseURL",P.string().optional()),environment:Net.optional(),auth:Fet.optional(),pathParameters:E$.optional(),queryParameters:E$.optional(),headers:E$.optional(),messages:P.list(gSr).optional()})});var ASr,Jto=h(()=>{"use strict";Me();Kto();ASr=P.objectWithoutOptionalProperties({autogeneratedExamples:P.record(P.string(),PLt),userSpecifiedExamples:P.record(P.string(),PLt)})});var qy,lQ=h(()=>{"use strict";Me();m$();qy=P.objectWithoutOptionalProperties({v2Examples:eT.optional()})});var Yto=h(()=>{"use strict";Rto();Dto();kto();Fto();Nto();iSr();zto();jto();aSr();Qto();Uto();Vto();Mto();_to();Lto();n$i();m$();uSr();Gto();qto();Wto();Hto();Kto();Jto();lQ()});var Xto={};te(Xto,{BasicAuthValues:()=>$xr,BearerAuthValues:()=>eSr,HeaderAuthValues:()=>tSr,MultipleEnvironmentUrlValues:()=>rSr,OAuthValues:()=>nSr,V2AuthValues:()=>Fet,V2EndpointLocation:()=>sSr,V2EndpointLocationHttpMethod:()=>oSr,V2EnvironmentValues:()=>Net,V2HttpEndpointCodeSample:()=>cSr,V2HttpEndpointExample:()=>TLt,V2HttpEndpointExamples:()=>dSr,V2HttpEndpointRequest:()=>lSr,V2HttpEndpointResponse:()=>fSr,V2HttpEndpointResponseBody:()=>pSr,V2SchemaExample:()=>hLt,V2SchemaExamples:()=>eT,V2ValueExamples:()=>E$,V2WebSocketEndpointLocation:()=>hSr,V2WebSocketMessageExample:()=>gSr,V2WebSocketSessionExample:()=>PLt,V2WebSocketSessionExamples:()=>ASr,V2WebhookExample:()=>OLt,V2WebhookExamples:()=>mSr,WithV2Examples:()=>qy});var Wic=h(()=>{"use strict";Yto()});var ySr,Zto=h(()=>{"use strict";Me();ySr=P.enum_(["MIT","Apache-2.0"])});var bSr,$to=h(()=>{"use strict";Me();Zto();bSr=P.objectWithoutOptionalProperties({id:ySr})});var lI,I$=h(()=>{"use strict";Me();lI=P.string()});var ESr,ero=h(()=>{"use strict";Me();I$();ESr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),tokenEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var jet,ISr=h(()=>{"use strict";Me();jet=P.objectWithoutOptionalProperties({registryUrl:P.string(),token:P.string(),packageName:P.string()})});var vSr,tro=h(()=>{"use strict";Me();vSr=P.objectWithoutOptionalProperties({filename:P.string()})});var CSr,rro=h(()=>{"use strict";Me();CSr=P.objectWithoutOptionalProperties({coordinatorUrl:P.string(),coordinatorUrlV2:P.string(),id:P.string()})});var xSr,nro=h(()=>{"use strict";Xr();Me();rro();xSr=P.union(P.discriminant("type","_type"),{local:P.object({}),remote:CSr}).transform({transform:e=>{switch(e.type){case"local":return gc.GeneratorEnvironment.local();case"remote":return gc.GeneratorEnvironment.remote(e);default:return e}},untransform:({_visit:e,...t})=>t})});var zet,SSr=h(()=>{"use strict";Me();zet=P.objectWithoutOptionalProperties({keyId:P.string(),password:P.string(),secretKey:P.string()})});var Qet,wSr=h(()=>{"use strict";Me();SSr();Qet=P.objectWithoutOptionalProperties({registryUrl:P.string(),username:P.string(),password:P.string(),coordinate:P.string(),signature:zet.optional()})});var Met,TSr=h(()=>{"use strict";Me();Met=P.objectWithoutOptionalProperties({registryUrl:P.string(),token:P.string(),packageName:P.string()})});var Let,OSr=h(()=>{"use strict";Me();Let=P.objectWithoutOptionalProperties({registryUrl:P.string(),apiKey:P.string(),packageName:P.string()})});var PSr,iro=h(()=>{"use strict";Me();PSr=P.objectWithoutOptionalProperties({apiKey:P.string(),workspaceId:P.string()})});var BSr,oro=h(()=>{"use strict";Me();BSr=P.objectWithoutOptionalProperties({name:P.string(),email:P.string()})});var RSr,sro=h(()=>{"use strict";Me();oro();RSr=P.objectWithoutOptionalProperties({description:P.string().optional(),authors:P.list(BSr).optional()})});var _et,DSr=h(()=>{"use strict";Me();sro();_et=P.objectWithoutOptionalProperties({keywords:P.list(P.string()).optional(),documentationLink:P.string().optional(),homepageLink:P.string().optional()}).extend(RSr)});var Uet,kSr=h(()=>{"use strict";Me();DSr();Uet=P.objectWithoutOptionalProperties({registryUrl:P.string(),username:P.string(),password:P.string(),packageName:P.string(),pypiMetadata:_et.optional()})});var Vet,FSr=h(()=>{"use strict";Me();Vet=P.objectWithoutOptionalProperties({registryUrl:P.string(),apiKey:P.string(),packageName:P.string()})});var NSr,aro=h(()=>{"use strict";Xr();Me();ISr();wSr();TSr();OSr();iro();kSr();FSr();NSr=P.union("type",{maven:Qet,npm:Met,pypi:Uet,postman:PSr,rubygems:Vet,nuget:Let,crates:jet}).transform({transform:e=>{switch(e.type){case"maven":return gc.GeneratorPublishTarget.maven(e);case"npm":return gc.GeneratorPublishTarget.npm(e);case"pypi":return gc.GeneratorPublishTarget.pypi(e);case"postman":return gc.GeneratorPublishTarget.postman(e);case"rubygems":return gc.GeneratorPublishTarget.rubygems(e);case"nuget":return gc.GeneratorPublishTarget.nuget(e);case"crates":return gc.GeneratorPublishTarget.crates(e);default:return e}},untransform:({_visit:e,...t})=>t})});var jSr,cro=h(()=>{"use strict";Me();SSr();jSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),username:P.string(),password:P.string(),group:P.string(),signature:zet.optional()})});var zSr,uro=h(()=>{"use strict";Me();zSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),token:P.string(),scope:P.string()})});var QSr,lro=h(()=>{"use strict";Me();cro();uro();QSr=P.objectWithoutOptionalProperties({maven:jSr,npm:zSr})});var MSr,pro=h(()=>{"use strict";Me();ISr();wSr();TSr();OSr();kSr();FSr();MSr=P.objectWithoutOptionalProperties({maven:Qet,npm:Met,pypi:Uet,rubygems:Vet,nuget:Let,crates:jet})});var Get,LSr=h(()=>{"use strict";Me();aro();lro();pro();Get=P.objectWithoutOptionalProperties({registries:QSr,registriesV2:MSr,publishTarget:NSr.optional(),version:P.string()})});var _Sr,fro=h(()=>{"use strict";Me();I$();_Sr=P.objectWithoutOptionalProperties({keyIdEnvironmentVariable:lI,passwordEnvironmentVariable:lI,secretKeyEnvironmentVariable:lI})});var USr,dro=h(()=>{"use strict";Me();I$();fro();USr=P.objectWithoutOptionalProperties({registryUrl:P.string(),coordinate:P.string(),usernameEnvironmentVariable:lI,passwordEnvironmentVariable:lI,signature:_Sr.optional(),shouldGeneratePublishWorkflow:P.boolean().optional()})});var VSr,mro=h(()=>{"use strict";Me();I$();VSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),tokenEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var GSr,hro=h(()=>{"use strict";Me();I$();GSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),apiKeyEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var qSr,gro=h(()=>{"use strict";Me();I$();qSr=P.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:lI,workspaceIdEnvironmentVariable:lI})});var WSr,Aro=h(()=>{"use strict";Me();I$();DSr();WSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),usernameEnvironmentVariable:lI,passwordEnvironmentVariable:lI,pypiMetadata:_et.optional(),shouldGeneratePublishWorkflow:P.boolean().optional()})});var HSr,yro=h(()=>{"use strict";Me();I$();HSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),apiKeyEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var KSr,bro=h(()=>{"use strict";Xr();Me();ero();dro();mro();hro();gro();Aro();yro();KSr=P.union("type",{npm:VSr,maven:USr,postman:qSr,pypi:WSr,rubygems:HSr,nuget:GSr,crates:ESr}).transform({transform:e=>{switch(e.type){case"npm":return gc.GithubPublishInfo.npm(e);case"maven":return gc.GithubPublishInfo.maven(e);case"postman":return gc.GithubPublishInfo.postman(e);case"pypi":return gc.GithubPublishInfo.pypi(e);case"rubygems":return gc.GithubPublishInfo.rubygems(e);case"nuget":return gc.GithubPublishInfo.nuget(e);case"crates":return gc.GithubPublishInfo.crates(e);default:return e}},untransform:({_visit:e,...t})=>t})});var JSr,Ero=h(()=>{"use strict";Me();bro();JSr=P.objectWithoutOptionalProperties({version:P.string(),repoUrl:P.string(),installationToken:P.string().optional(),branch:P.string().optional(),publishInfo:KSr.optional()})});var YSr,Iro=h(()=>{"use strict";Xr();Me();LSr();Ero();YSr=P.union("type",{publish:Get,downloadFiles:P.object({}),github:JSr}).transform({transform:e=>{switch(e.type){case"publish":return gc.OutputMode.publish(e);case"downloadFiles":return gc.OutputMode.downloadFiles();case"github":return gc.OutputMode.github(e);default:return e}},untransform:({_visit:e,...t})=>t})});var XSr,vro=h(()=>{"use strict";Me();XSr=P.objectWithoutOptionalProperties({packageDescription:P.property("package_description",P.string().optional()),publisherEmail:P.property("publisher_email",P.string().optional()),referenceUrl:P.property("reference_url",P.string().optional()),publisherName:P.property("publisher_name",P.string().optional())})});var ZSr,Cro=h(()=>{"use strict";Me();Iro();vro();ZSr=P.objectWithoutOptionalProperties({path:P.string(),snippetFilepath:P.string().optional(),snippetTemplateFilepath:P.string().optional(),publishingMetadata:XSr.optional(),mode:YSr})});var $Sr,xro=h(()=>{"use strict";Xr();Me();$to();tro();$Sr=P.union("type",{basic:bSr,custom:vSr}).transform({transform:e=>{switch(e.type){case"basic":return gc.LicenseConfig.basic(e);case"custom":return gc.LicenseConfig.custom(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Hic,Kic=h(()=>{"use strict";Me();nro();Cro();LSr();xro();Hic=P.objectWithoutOptionalProperties({dryRun:P.boolean(),irFilepath:P.string(),originalReadmeFilepath:P.string().optional(),license:$Sr.optional(),output:ZSr,publish:Get.optional(),workspaceName:P.string(),organization:P.string(),customConfig:P.unknown(),environment:xSr,whitelabel:P.boolean(),writeUnitTests:P.boolean(),generatePaginatedClients:P.boolean().optional(),generateOauthClients:P.boolean()})});var Sro=h(()=>{"use strict";$to();ero();ISr();tro();I$();Kic();nro();Cro();LSr();aro();lro();pro();Ero();bro();xro();Zto();SSr();fro();dro();cro();wSr();mro();uro();TSr();hro();OSr();sro();oro();Iro();iro();gro();vro();Aro();DSr();kSr();rro();yro();FSr()});var wro={};te(wro,{BasicLicense:()=>bSr,CratesGithubPublishInfo:()=>ESr,CratesRegistryConfig:()=>jet,CustomLicense:()=>vSr,EnvironmentVariable:()=>lI,GeneratorConfig:()=>Hic,GeneratorEnvironment:()=>xSr,GeneratorOutputConfig:()=>ZSr,GeneratorPublishConfig:()=>Get,GeneratorPublishTarget:()=>NSr,GeneratorRegistriesConfig:()=>QSr,GeneratorRegistriesConfigV2:()=>MSr,GithubOutputMode:()=>JSr,GithubPublishInfo:()=>KSr,LicenseConfig:()=>$Sr,LicenseId:()=>ySr,MavenCentralSignature:()=>zet,MavenCentralSignatureGithubInfo:()=>_Sr,MavenGithubPublishInfo:()=>USr,MavenRegistryConfig:()=>jSr,MavenRegistryConfigV2:()=>Qet,NpmGithubPublishInfo:()=>VSr,NpmRegistryConfig:()=>zSr,NpmRegistryConfigV2:()=>Met,NugetGithubPublishInfo:()=>GSr,NugetRegistryConfig:()=>Let,OutputMetadata:()=>RSr,OutputMetadataAuthor:()=>BSr,OutputMode:()=>YSr,PostmanConfig:()=>PSr,PostmanGithubPublishInfo:()=>qSr,PublishingMetadata:()=>XSr,PypiGithubPublishInfo:()=>WSr,PypiMetadata:()=>_et,PypiRegistryConfig:()=>Uet,RemoteGeneratorEnvironment:()=>CSr,RubyGemsGithubPublishInfo:()=>HSr,RubyGemsRegistryConfig:()=>Vet});var Jic=h(()=>{"use strict";Sro()});var Yic=h(()=>{"use strict";Jic();Sro()});var Tro={};te(Tro,{BasicLicense:()=>bSr,CratesGithubPublishInfo:()=>ESr,CratesRegistryConfig:()=>jet,CustomLicense:()=>vSr,EnvironmentVariable:()=>lI,GeneratorConfig:()=>Hic,GeneratorEnvironment:()=>xSr,GeneratorOutputConfig:()=>ZSr,GeneratorPublishConfig:()=>Get,GeneratorPublishTarget:()=>NSr,GeneratorRegistriesConfig:()=>QSr,GeneratorRegistriesConfigV2:()=>MSr,GithubOutputMode:()=>JSr,GithubPublishInfo:()=>KSr,LicenseConfig:()=>$Sr,LicenseId:()=>ySr,MavenCentralSignature:()=>zet,MavenCentralSignatureGithubInfo:()=>_Sr,MavenGithubPublishInfo:()=>USr,MavenRegistryConfig:()=>jSr,MavenRegistryConfigV2:()=>Qet,NpmGithubPublishInfo:()=>VSr,NpmRegistryConfig:()=>zSr,NpmRegistryConfigV2:()=>Met,NugetGithubPublishInfo:()=>GSr,NugetRegistryConfig:()=>Let,OutputMetadata:()=>RSr,OutputMetadataAuthor:()=>BSr,OutputMode:()=>YSr,PostmanConfig:()=>PSr,PostmanGithubPublishInfo:()=>qSr,PublishingMetadata:()=>XSr,PypiGithubPublishInfo:()=>WSr,PypiMetadata:()=>_et,PypiRegistryConfig:()=>Uet,RemoteGeneratorEnvironment:()=>CSr,RubyGemsGithubPublishInfo:()=>HSr,RubyGemsRegistryConfig:()=>Vet,config:()=>wro});var Xic=h(()=>{"use strict";Yic()});var Oro=h(()=>{"use strict";gxr();jeo();mxr();zeo()});var Pro={};te(Pro,{GlobalParameter:()=>Ret,GlobalParameterApplyMode:()=>dxr,GlobalParameterId:()=>Bet,GlobalParameterLocation:()=>hxr});var Zic=h(()=>{"use strict";Oro()});var DLe,ewr=h(()=>{"use strict";Me();$o();Id();DLe=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var zIe,twr=h(()=>{"use strict";Me();$o();Mf();zIe=P.objectWithoutOptionalProperties({name:Ro,value:P.lazyObject(()=>uu)})});var rwr,Bro=h(()=>{"use strict";Xr();Me();rwr=P.union("type",{single:P.object({}),exploded:P.object({}),commaSeparated:P.object({})}).transform({transform:e=>{switch(e.type){case"single":return Ew.single();case"exploded":return Ew.exploded();case"commaSeparated":return Ew.commaSeparated();default:return e}},untransform:({_visit:e,...t})=>t})});var qet,nwr=h(()=>{"use strict";Me();$o();Id();Bro();qet=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu),shape:rwr.optional()})});var iwr,Rro=h(()=>{"use strict";Me();$o();Id();iwr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var Wy,pQ=h(()=>{"use strict";Me();yLt();TLe();Mf();Dfe();Wy=P.objectWithoutOptionalProperties({typeId:cB,fernFilepath:VV,name:Ro,displayName:BIe.optional()})});var owr,Dro=h(()=>{"use strict";Me();$o();Id();pQ();owr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu),originalTypeDeclaration:Wy.optional()})});var Wet,swr=h(()=>{"use strict";Me();vet();Rro();Dro();Wet=P.objectWithoutOptionalProperties({properties:P.list(owr),extraProperties:P.list(iwr).optional()}).extend(g$)});var awr,kro=h(()=>{"use strict";Xr();Me();$o();swr();awr=P.union("type",{inlinedRequestBody:Wet,reference:P.lazyObject(()=>uu)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return rB.inlinedRequestBody(e);case"reference":return rB.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var cwr,Fro=h(()=>{"use strict";Me();$o();wLt();cwr=P.objectWithoutOptionalProperties({error:jIe,body:P.lazyObject(()=>uu).optional()})});var uwr,Nro=h(()=>{"use strict";Me();$o();uwr=P.objectWithoutOptionalProperties({event:P.string(),data:P.lazyObject(()=>uu)})});var lwr,jro=h(()=>{"use strict";Xr();Me();$o();Nro();lwr=P.union("type",{body:P.object({value:P.lazyObject(()=>uu).optional()}),stream:P.object({value:P.list(P.lazyObject(()=>uu))}),sse:P.object({value:P.list(uwr)})}).transform({transform:e=>{switch(e.type){case"body":return uy.body(e.value);case"stream":return uy.stream(e.value);case"sse":return uy.sse(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var pwr,zro=h(()=>{"use strict";Xr();Me();Fro();jro();pwr=P.union("type",{ok:P.object({value:lwr}),error:cwr}).transform({transform:e=>{switch(e.type){case"ok":return iA.ok(e.value);case"error":return iA.error(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Het,fwr=h(()=>{"use strict";Me();Mf();fp();ewr();twr();nwr();kro();zro();Het=P.objectWithoutOptionalProperties({id:P.string().optional(),name:Ro.optional(),url:P.string(),rootPathParameters:P.list(zIe),servicePathParameters:P.list(zIe),endpointPathParameters:P.list(zIe),serviceHeaders:P.list(DLe),endpointHeaders:P.list(DLe),queryParameters:P.list(qet),request:awr.optional(),response:pwr}).extend(ao)});var dwr,Qro=h(()=>{"use strict";Me();fwr();dwr=P.objectWithoutOptionalProperties({example:Het})});var Ket,mwr=h(()=>{"use strict";Me();OLe();fp();lQ();Ket=P.objectWithoutOptionalProperties({isOptional:P.boolean()}).extend(ao).extend(qy).extend(GV)});var Jet,hwr=h(()=>{"use strict";Me();fp();lQ();Jet=P.objectWithoutOptionalProperties({}).extend(ao).extend(qy)});var gwr,Mro=h(()=>{"use strict";Me();PIe();h$();gwr=P.objectWithoutOptionalProperties({page:tT,next:tE,results:tE})});var Awr,Lro=h(()=>{"use strict";Me();h$();Awr=P.objectWithoutOptionalProperties({results:tE})});var ywr,_ro=h(()=>{"use strict";Me();TLe();ywr=P.objectWithoutOptionalProperties({fernFilepath:VV})});var bwr,Uro=h(()=>{"use strict";Mf();bwr=Ro});var Ewr,Vro=h(()=>{"use strict";Me();Mf();fp();Ewr=P.objectWithoutOptionalProperties({name:Ro.optional(),language:P.string(),code:P.string(),install:P.string().optional()}).extend(ao)});var QIe,BLt=h(()=>{"use strict";Me();QIe=P.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","php","rust","swift"])});var Iwr,Gro=h(()=>{"use strict";Me();Mf();fp();BLt();Iwr=P.objectWithoutOptionalProperties({name:Ro.optional(),sdk:QIe,code:P.string()}).extend(ao)});var vwr,qro=h(()=>{"use strict";Xr();Me();Vro();Gro();vwr=P.union("type",{language:Ewr,sdk:Iwr}).transform({transform:e=>{switch(e.type){case"language":return F3.language(e);case"sdk":return F3.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Yet,Cwr=h(()=>{"use strict";Me();fp();lQ();Yet=P.objectWithoutOptionalProperties({}).extend(ao).extend(qy)});var xwr,Wro=h(()=>{"use strict";Me();Id();fp();xwr=P.objectWithoutOptionalProperties({key:fs,isOptional:P.boolean(),contentType:P.string().optional()}).extend(ao)});var Swr,Hro=h(()=>{"use strict";Me();Id();fp();Swr=P.objectWithoutOptionalProperties({key:fs,isOptional:P.boolean(),contentType:P.string().optional()}).extend(ao)});var wwr,Kro=h(()=>{"use strict";Xr();Me();Wro();Hro();wwr=P.union("type",{file:Swr,fileArray:xwr}).transform({transform:e=>{switch(e.type){case"file":return nQ.file(e);case"fileArray":return nQ.fileArray(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Twr,Jro=h(()=>{"use strict";Me();Twr=P.enum_(["exploded","json","form"])});var Xet,Owr=h(()=>{"use strict";Me();$o();Id();ILt();m$();gLt();Xet=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),defaultValue:P.unknown().optional(),v2Examples:eT.optional(),propertyAccess:TIe.optional()}).extend(DIe)});var Pwr,Yro=h(()=>{"use strict";Me();OLe();Jro();Owr();Pwr=P.objectWithoutOptionalProperties({style:Twr.optional()}).extend(Xet).extend(GV)});var Bwr,Xro=h(()=>{"use strict";Xr();Me();Kro();Yro();Bwr=P.union("type",{file:P.object({value:wwr}),bodyProperty:Pwr}).transform({transform:e=>{switch(e.type){case"file":return qx.file(e.value);case"bodyProperty":return qx.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Zet,Rwr=h(()=>{"use strict";Me();Mf();OLe();fp();lQ();Xro();Zet=P.objectWithoutOptionalProperties({name:Ro,properties:P.list(Bwr)}).extend(ao).extend(qy).extend(GV)});var Dwr,Zro=h(()=>{"use strict";Me();Dwr=P.objectWithoutOptionalProperties({namespace:P.string()})});var kwr,$ro=h(()=>{"use strict";Me();Zro();kwr=P.objectWithoutOptionalProperties({csharp:Dwr.optional()})});var $et,Fwr=h(()=>{"use strict";Me();$ro();$et=P.objectWithoutOptionalProperties({filepath:P.string(),packageName:P.string().optional(),options:kwr.optional()})});var Nwr,eno=h(()=>{"use strict";Me();Mf();Fwr();Nwr=P.objectWithoutOptionalProperties({file:$et,name:Ro})});var jwr,tno=h(()=>{"use strict";Me();eno();jwr=P.objectWithoutOptionalProperties({service:Nwr})});var zwr,rno=h(()=>{"use strict";Me();Gvr();S$i();zwr=P.record(det,P.list(bCr))});var Qwr,nno=h(()=>{"use strict";Me();Qwr=P.enum_(["UNARY","CLIENT_STREAM","SERVER_STREAM","BIDIRECTIONAL_STREAM"])});var Mwr,ino=h(()=>{"use strict";Me();nno();Mwr=P.objectWithoutOptionalProperties({methodType:Qwr.optional()})});var Lwr,ono=h(()=>{"use strict";Xr();Me();ino();Lwr=P.union("type",{proto:Mwr,openapi:P.object({}),openrpc:P.object({})}).transform({transform:e=>{switch(e.type){case"proto":return cD.proto(e);case"openapi":return cD.openapi();case"openrpc":return cD.openrpc();default:return e}},untransform:({_visit:e,...t})=>t})});var ett,_wr=h(()=>{"use strict";Me();ett=P.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var Uwr,sno=h(()=>{"use strict";Me();Uwr=P.objectWithoutOptionalProperties({pathParameter:P.string(),tail:P.string()})});var WV,ttt=h(()=>{"use strict";Me();sno();WV=P.objectWithoutOptionalProperties({head:P.string(),parts:P.list(Uwr)})});var rtt,Vwr=h(()=>{"use strict";Me();$o();OLe();fp();lQ();rtt=P.objectWithoutOptionalProperties({requestBodyType:P.lazy(()=>zs),required:P.boolean().optional()}).extend(ao).extend(GV).extend(qy)});var Gwr,ano=h(()=>{"use strict";Me();Mf();OLe();fp();lQ();pQ();Rfe();Owr();Gwr=P.objectWithoutOptionalProperties({name:Ro,extends:P.list(Wy),properties:P.list(Xet),extendedProperties:P.list(aB).optional(),extraProperties:P.property("extra-properties",P.boolean())}).extend(ao).extend(qy).extend(GV)});var ntt,qwr=h(()=>{"use strict";Xr();Me();mwr();Rwr();Vwr();ano();ntt=P.union("type",{inlinedRequestBody:Gwr,reference:rtt,fileUpload:Zet,bytes:Ket}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return bd.inlinedRequestBody(e);case"reference":return bd.reference(e);case"fileUpload":return bd.fileUpload(e);case"bytes":return bd.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Wwr,cno=h(()=>{"use strict";Me();$o();fp();lQ();Wwr=P.objectWithoutOptionalProperties({responseBodyType:P.lazy(()=>zs)}).extend(ao).extend(qy)});var Hwr,uno=h(()=>{"use strict";Me();$o();fp();lQ();Rfe();Hwr=P.objectWithoutOptionalProperties({responseBodyType:P.lazy(()=>zs),responseProperty:aB.optional()}).extend(ao).extend(qy)});var itt,Kwr=h(()=>{"use strict";Xr();Me();cno();uno();itt=P.union("type",{response:Wwr,nestedPropertyAsResponse:Hwr}).transform({transform:e=>{switch(e.type){case"response":return uI.response(e);case"nestedPropertyAsResponse":return uI.nestedPropertyAsResponse(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Jwr,lno=h(()=>{"use strict";Me();$o();fp();lQ();Jwr=P.objectWithoutOptionalProperties({payload:P.lazy(()=>zs),terminator:P.string().optional()}).extend(ao).extend(qy)});var Ywr,pno=h(()=>{"use strict";Me();$o();fp();lQ();Ywr=P.objectWithoutOptionalProperties({payload:P.lazy(()=>zs),terminator:P.string().optional(),resumable:P.boolean().optional()}).extend(ao).extend(qy)});var Xwr,fno=h(()=>{"use strict";Me();fp();lQ();Xwr=P.objectWithoutOptionalProperties({}).extend(ao).extend(qy)});var ott,Zwr=h(()=>{"use strict";Xr();Me();lno();pno();fno();ott=P.union("type",{json:Jwr,text:Xwr,sse:Ywr}).transform({transform:e=>{switch(e.type){case"json":return dv.json(e);case"text":return dv.text(e);case"sse":return dv.sse(e);default:return e}},untransform:({_visit:e,...t})=>t})});var stt,$wr=h(()=>{"use strict";Me();fp();lQ();stt=P.objectWithoutOptionalProperties({contentType:P.string().optional()}).extend(ao).extend(qy)});var e1r,dno=h(()=>{"use strict";Xr();Me();hwr();Cwr();Kwr();$wr();e1r=P.union("type",{json:P.object({value:itt}),fileDownload:Yet,text:stt,bytes:Jet}).transform({transform:e=>{switch(e.type){case"json":return nB.json(e.value);case"fileDownload":return nB.fileDownload(e);case"text":return nB.text(e);case"bytes":return nB.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t})});var t1r,mno=h(()=>{"use strict";Me();dno();Zwr();t1r=P.objectWithoutOptionalProperties({nonStreamResponse:e1r,streamResponse:ott})});var r1r,hno=h(()=>{"use strict";Xr();Me();hwr();Cwr();Kwr();Zwr();mno();$wr();r1r=P.union("type",{json:P.object({value:itt}),fileDownload:Yet,text:stt,bytes:Jet,streaming:P.object({value:ott}),streamParameter:t1r}).transform({transform:e=>{switch(e.type){case"json":return ju.json(e.value);case"fileDownload":return ju.fileDownload(e);case"text":return ju.text(e);case"bytes":return ju.bytes(e);case"streaming":return ju.streaming(e.value);case"streamParameter":return ju.streamParameter(e);default:return e}},untransform:({_visit:e,...t})=>t})});var MIe,RLt=h(()=>{"use strict";Me();fp();hno();MIe=P.objectWithoutOptionalProperties({statusCode:P.property("status-code",P.number().optional()),isWildcardStatusCode:P.boolean().optional(),body:r1r.optional()}).extend(ao)});var n1r,gno=h(()=>{"use strict";Me();PIe();h$();n1r=P.objectWithoutOptionalProperties({page:tT,results:tE,hasNextPage:tE.optional(),step:tT.optional()})});var i1r,Ano=h(()=>{"use strict";Me();h$();i1r=P.objectWithoutOptionalProperties({nextPath:tE,results:tE})});var o1r,yno=h(()=>{"use strict";Me();h$();o1r=P.objectWithoutOptionalProperties({nextUri:tE,results:tE})});var s1r,bno=h(()=>{"use strict";Xr();Me();Mro();Lro();gno();Ano();yno();s1r=P.union("type",{cursor:gwr,offset:n1r,custom:Awr,uri:o1r,path:i1r}).transform({transform:e=>{switch(e.type){case"cursor":return $0.cursor(e);case"offset":return $0.offset(e);case"custom":return $0.custom(e);case"uri":return $0.uri(e);case"path":return $0.path(e);default:return e}},untransform:({_visit:e,...t})=>t})});var att,a1r=h(()=>{"use strict";Me();att=P.string()});var c1r,Eno=h(()=>{"use strict";Me();c1r=P.enum_(["ROOT","SERVICE","ENDPOINT"])});var UH,ctt=h(()=>{"use strict";Me();$o();Mf();fp();m$();wLe();a1r();Eno();UH=P.objectWithoutOptionalProperties({name:Ro,valueType:P.lazy(()=>zs),location:c1r,variable:att.optional(),clientDefault:UV.optional(),v2Examples:eT.optional(),explode:P.boolean().optional()}).extend(ao)});var u1r,Ino=h(()=>{"use strict";Me();fp();wLt();u1r=P.objectWithoutOptionalProperties({error:jIe}).extend(ao)});var l1r,vno=h(()=>{"use strict";Me();Ino();l1r=P.list(u1r)});var p1r,Cno=h(()=>{"use strict";Me();p1r=P.objectWithoutOptionalProperties({disabled:P.boolean().optional()})});var f1r,xno=h(()=>{"use strict";Me();Cno();f1r=P.undiscriminatedUnion([p1r])});var d1r,Sno=h(()=>{"use strict";Xr();Me();mwr();Vwr();d1r=P.union("type",{typeReference:rtt,bytes:Ket}).transform({transform:e=>{switch(e.type){case"typeReference":return DH.typeReference(e);case"bytes":return DH.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t})});var m1r,wno=h(()=>{"use strict";Me();Mf();m1r=P.objectWithoutOptionalProperties({wrapperName:Ro,bodyKey:Ro,includePathParameters:P.boolean().optional(),onlyPathParameters:P.boolean().optional()})});var h1r,Tno=h(()=>{"use strict";Xr();Me();Sno();wno();h1r=P.union("type",{justRequestBody:P.object({value:d1r}),wrapper:m1r}).transform({transform:e=>{switch(e.type){case"justRequestBody":return QV.justRequestBody(e.value);case"wrapper":return QV.wrapper(e);default:return e}},untransform:({_visit:e,...t})=>t})});var g1r,Ono=h(()=>{"use strict";Me();Mf();PIe();Tno();g1r=P.objectWithoutOptionalProperties({streamParameter:tT.optional(),requestParameterName:Ro,shape:h1r})});var utt,A1r=h(()=>{"use strict";Xr();Me();tno();utt=P.union("type",{http:P.object({}),grpc:jwr}).transform({transform:e=>{switch(e.type){case"http":return MV.http();case"grpc":return MV.grpc(e);default:return e}},untransform:({_visit:e,...t})=>t})});var y1r,Pno=h(()=>{"use strict";Me();qro();fwr();y1r=P.objectWithoutOptionalProperties({codeSamples:P.list(vwr).optional(),example:Het.optional()})});var b1r,Bno=h(()=>{"use strict";Me();qwr();b1r=P.objectWithoutOptionalProperties({requestBodies:P.list(ntt).optional()})});var E1r,Rno=h(()=>{"use strict";Me();RLt();E1r=P.objectWithoutOptionalProperties({responses:P.list(MIe).optional()})});var I1r,Dno=h(()=>{"use strict";Me();Uvr();LH();dLt();RLe();Vto();mxr();Qro();Uro();rno();ono();Ffe();_wr();ttt();qwr();RLt();bno();ctt();ALt();vno();xno();Ono();A1r();Pno();Bno();Rno();I1r=P.objectWithoutOptionalProperties({id:Bfe,name:bwr,displayName:P.string().optional(),subtitle:P.string().optional(),method:ett,headers:P.list(rT),responseHeaders:P.list(rT).optional(),baseUrl:pD.optional(),v2BaseUrls:P.list(pD).optional(),basePath:WV.optional(),path:WV,fullPath:WV,pathParameters:P.list(UH),allPathParameters:P.list(UH),queryParameters:P.list(OIe),requestBody:ntt.optional(),v2RequestBodies:b1r.optional(),sdkRequest:g1r.optional(),response:MIe.optional(),v2Responses:E1r.optional(),errors:l1r,auth:P.boolean(),security:P.list(zwr).optional(),idempotent:P.boolean(),pagination:s1r.optional(),userSpecifiedExamples:P.list(y1r),autogeneratedExamples:P.list(dwr),v2Examples:dSr.optional(),transport:utt.optional(),source:Lwr.optional(),audiences:P.list(pet).optional(),retries:f1r.optional(),globalParameters:P.list(Bet).optional(),apiPlayground:P.boolean().optional()}).extend(Wx)});var v1r,kno=h(()=>{"use strict";Me();v1r=P.objectWithoutOptionalProperties({})});var C1r,Fno=h(()=>{"use strict";Me();C1r=P.objectWithoutOptionalProperties({})});var x1r,Nno=h(()=>{"use strict";Me();x1r=P.objectWithoutOptionalProperties({name:P.string(),namespace:P.string().optional(),prefix:P.string().optional()})});var ltt,S1r=h(()=>{"use strict";Me();kno();Fno();Nno();ltt=P.objectWithoutOptionalProperties({json:v1r.optional(),proto:C1r.optional(),xml:x1r.optional()})});var w1r,jno=h(()=>{"use strict";Me();Uvr();get();S1r();_ro();Dno();Ffe();ttt();ctt();A1r();w1r=P.objectWithoutOptionalProperties({availability:d$.optional(),name:ywr,displayName:P.string().optional(),basePath:WV,endpoints:P.list(I1r),headers:P.list(rT),pathParameters:P.list(UH),encoding:ltt.optional(),transport:utt.optional(),audiences:P.list(pet).optional()})});var zno=h(()=>{"use strict";Qro();mwr();hwr();Mro();Lro();_ro();Uro();qro();Vro();Gro();fwr();Fro();jro();ewr();swr();Rro();Dro();twr();nwr();Bro();kro();zro();Nro();Cwr();Kro();Wro();Hro();Yro();Jro();Rwr();Xro();tno();Dno();rno();ono();Ffe();_wr();ttt();sno();qwr();Vwr();RLt();hno();jno();ano();Owr();Kwr();cno();uno();lno();dno();gno();bno();Ano();ctt();Eno();Xvr();ino();ALt();PIe();a$i();Ino();vno();h$();xno();Cno();Ono();Sno();Tno();wno();pno();Zwr();mno();BLt();$wr();fno();A1r();yno();Pno();Bno();Rno()});var Qno={};te(Qno,{AutogeneratedEndpointExample:()=>dwr,BytesRequest:()=>Ket,BytesResponse:()=>Jet,CursorPagination:()=>gwr,CustomPagination:()=>Awr,DeclaredServiceName:()=>ywr,EndpointName:()=>bwr,ExampleCodeSample:()=>vwr,ExampleCodeSampleLanguage:()=>Ewr,ExampleCodeSampleSdk:()=>Iwr,ExampleEndpointCall:()=>Het,ExampleEndpointErrorResponse:()=>cwr,ExampleEndpointSuccessResponse:()=>lwr,ExampleHeader:()=>DLe,ExampleInlinedRequestBody:()=>Wet,ExampleInlinedRequestBodyExtraProperty:()=>iwr,ExampleInlinedRequestBodyProperty:()=>owr,ExamplePathParameter:()=>zIe,ExampleQueryParameter:()=>qet,ExampleQueryParameterShape:()=>rwr,ExampleRequestBody:()=>awr,ExampleResponse:()=>pwr,ExampleServerSideEvent:()=>uwr,FileDownloadResponse:()=>Yet,FileProperty:()=>wwr,FilePropertyArray:()=>xwr,FilePropertySingle:()=>Swr,FileUploadBodyProperty:()=>Pwr,FileUploadBodyPropertyEncoding:()=>Twr,FileUploadRequest:()=>Zet,FileUploadRequestProperty:()=>Bwr,GrpcTransport:()=>jwr,HttpEndpoint:()=>I1r,HttpEndpointSecurityItem:()=>zwr,HttpEndpointSource:()=>Lwr,HttpHeader:()=>rT,HttpMethod:()=>ett,HttpPath:()=>WV,HttpPathPart:()=>Uwr,HttpRequestBody:()=>ntt,HttpRequestBodyReference:()=>rtt,HttpResponse:()=>MIe,HttpResponseBody:()=>r1r,HttpService:()=>w1r,InlinedRequestBody:()=>Gwr,InlinedRequestBodyProperty:()=>Xet,JsonResponse:()=>itt,JsonResponseBody:()=>Wwr,JsonResponseBodyWithProperty:()=>Hwr,JsonStreamChunk:()=>Jwr,NonStreamHttpResponseBody:()=>e1r,OffsetPagination:()=>n1r,Pagination:()=>s1r,PathPagination:()=>i1r,PathParameter:()=>UH,PathParameterLocation:()=>c1r,PropertyPathItem:()=>Aet,ProtoSourceInfo:()=>Mwr,QueryParameter:()=>OIe,RequestProperty:()=>tT,RequestPropertyValue:()=>$vr,ResponseError:()=>u1r,ResponseErrors:()=>l1r,ResponseProperty:()=>tE,RetriesConfiguration:()=>f1r,RetriesDisabledSchema:()=>p1r,SdkRequest:()=>g1r,SdkRequestBodyType:()=>d1r,SdkRequestShape:()=>h1r,SdkRequestWrapper:()=>m1r,SseStreamChunk:()=>Ywr,StreamParameterResponse:()=>t1r,StreamingResponse:()=>ott,SupportedSdkLanguage:()=>QIe,TextResponse:()=>stt,TextStreamChunk:()=>Xwr,Transport:()=>utt,UriPagination:()=>o1r,UserSpecifiedEndpointExample:()=>y1r,V2HttpRequestBodies:()=>b1r,V2HttpResponses:()=>E1r});var $ic=h(()=>{"use strict";zno()});var T1r,Mno=h(()=>{"use strict";Me();T1r=P.string()});var O1r,Lno=h(()=>{"use strict";Me();Mno();O1r=P.objectWithoutOptionalProperties({id:T1r,protoRootUrl:P.string()})});var P1r,_no=h(()=>{"use strict";Xr();Me();Lno();P1r=P.union("type",{proto:O1r,openapi:P.object({})}).transform({transform:e=>{switch(e.type){case"proto":return iQ.proto(e);case"openapi":return iQ.openapi();default:return e}},untransform:({_visit:e,...t})=>t})});var Nfe,DLt=h(()=>{"use strict";Me();LH();Id();Nfe=P.objectWithoutOptionalProperties({name:fs}).extend(Wx)});var ptt,B1r=h(()=>{"use strict";Me();DLt();ptt=P.objectWithoutOptionalProperties({default:Nfe.optional(),values:P.list(Nfe),forwardCompatible:P.boolean().optional()})});var R1r,Uno=h(()=>{"use strict";Me();Ffe();B1r();R1r=P.objectWithoutOptionalProperties({header:rT,value:ptt})});var D1r,Vno=h(()=>{"use strict";Xr();Me();Uno();D1r=P.union("type",{header:R1r}).transform({transform:e=>e.type==="header"?CIe.header(e):e,untransform:({_visit:e,...t})=>t})});var k1r,Gno=h(()=>{"use strict";Me();BLt();k1r=P.objectWithoutOptionalProperties({generationLanguage:QIe.optional(),keywords:P.list(P.string()).optional(),smartCasing:P.boolean(),smartCasingDigitWordBoundary:P.boolean().optional()})});var F1r,qno=h(()=>{"use strict";Me();Id();F1r=P.objectWithoutOptionalProperties({discriminant:fs,contentProperty:fs})});var N1r,Wno=h(()=>{"use strict";Xr();Me();qno();N1r=P.union("type",{statusCode:P.object({}),property:F1r}).transform({transform:e=>{switch(e.type){case"statusCode":return j3.statusCode();case"property":return j3.property(e);default:return e}},untransform:({_visit:e,...t})=>t})});var j1r,Hno=h(()=>{"use strict";Me();j1r=P.enum_(["minimal","comprehensive"])});var z1r,Kno=h(()=>{"use strict";Me();z1r=P.enum_(["autopilot","autorelease","ci","manual"])});var Q1r,Jno=h(()=>{"use strict";Me();Kno();Q1r=P.objectWithoutOptionalProperties({cliVersion:P.string(),generatorName:P.string(),generatorVersion:P.string(),generatorConfig:P.unknown().optional(),originGitCommit:P.string().optional(),originGitCommitIsDirty:P.boolean().optional(),invokedBy:z1r.optional(),requestedVersion:P.string().optional(),ciProvider:P.string().optional()})});var M1r,Yno=h(()=>{"use strict";Me();_wr();M1r=P.objectWithoutOptionalProperties({headerName:P.string(),methods:P.list(ett)})});var L1r,Xno=h(()=>{"use strict";Me();L1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var _1r,Zno=h(()=>{"use strict";Me();_1r=P.objectWithoutOptionalProperties({version:P.string().optional(),modulePath:P.string().optional()})});var U1r,$no=h(()=>{"use strict";Me();U1r=P.objectWithoutOptionalProperties({coordinate:P.string().optional(),version:P.string().optional(),usernameEnvironmentVariable:P.string(),passwordEnvironmentVariable:P.string(),mavenUrlEnvironmentVariable:P.string()})});var V1r,eio=h(()=>{"use strict";Me();V1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional(),tokenEnvironmentVariable:P.string()})});var G1r,tio=h(()=>{"use strict";Me();G1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var q1r,rio=h(()=>{"use strict";Me();q1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var W1r,nio=h(()=>{"use strict";Me();W1r=P.objectWithoutOptionalProperties({apiKey:P.string(),workspaceId:P.string(),collectionId:P.string().optional()})});var H1r,iio=h(()=>{"use strict";Me();H1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var K1r,oio=h(()=>{"use strict";Me();K1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var LIe,kLt=h(()=>{"use strict";Xr();Me();Xno();Zno();$no();eio();tio();rio();nio();iio();oio();LIe=P.union("type",{postman:W1r,npm:V1r,maven:U1r,pypi:H1r,crates:L1r,go:_1r,nuget:G1r,rubygems:K1r,packagist:q1r}).transform({transform:e=>{switch(e.type){case"postman":return Ed.postman(e);case"npm":return Ed.npm(e);case"maven":return Ed.maven(e);case"pypi":return Ed.pypi(e);case"crates":return Ed.crates(e);case"go":return Ed.go(e);case"nuget":return Ed.nuget(e);case"rubygems":return Ed.rubygems(e);case"packagist":return Ed.packagist(e);default:return e}},untransform:({_visit:e,...t})=>t})});var J1r,sio=h(()=>{"use strict";Me();kLt();J1r=P.objectWithoutOptionalProperties({target:LIe})});var Y1r,aio=h(()=>{"use strict";Me();kLt();Y1r=P.objectWithoutOptionalProperties({generateFullProject:P.boolean(),publishTarget:LIe.optional()})});var X1r,cio=h(()=>{"use strict";Me();kLt();X1r=P.objectWithoutOptionalProperties({owner:P.string(),repo:P.string(),uri:P.string().optional(),token:P.string().optional(),mode:P.stringLiteral("pull-request").optional(),branch:P.string().optional(),target:LIe})});var Z1r,uio=h(()=>{"use strict";Xr();Me();sio();aio();cio();Z1r=P.union("type",{github:X1r,direct:J1r,filesystem:Y1r}).transform({transform:e=>{switch(e.type){case"github":return a$.github(e);case"direct":return a$.direct(e);case"filesystem":return a$.filesystem(e);default:return e}},untransform:({_visit:e,...t})=>t})});var FLt,lio=h(()=>{"use strict";Me();$o();Mf();fp();vet();FLt=P.objectWithoutOptionalProperties({name:Ro.optional(),shape:P.lazy(()=>ftt)}).extend(g$).extend(ao)});var $1r,pio=h(()=>{"use strict";Me();Mf();Fwr();$1r=P.objectWithoutOptionalProperties({file:$et,name:Ro})});var eTr,fio=h(()=>{"use strict";Xr();Me();eTr=P.union("type",{any:P.object({}),api:P.object({}),boolValue:P.object({}),bytesValue:P.object({}),doubleValue:P.object({}),duration:P.object({}),empty:P.object({}),enum:P.object({}),enumValue:P.object({}),field:P.object({}),fieldCardinality:P.object({}),fieldKind:P.object({}),fieldMask:P.object({}),floatValue:P.object({}),int32Value:P.object({}),int64Value:P.object({}),listValue:P.object({}),method:P.object({}),mixin:P.object({}),nullValue:P.object({}),option:P.object({}),sourceContext:P.object({}),stringValue:P.object({}),struct:P.object({}),syntax:P.object({}),timestamp:P.object({}),type:P.object({}),uint32Value:P.object({}),uint64Value:P.object({}),value:P.object({})}).transform({transform:e=>{switch(e.type){case"any":return Ci.any();case"api":return Ci.api();case"boolValue":return Ci.boolValue();case"bytesValue":return Ci.bytesValue();case"doubleValue":return Ci.doubleValue();case"duration":return Ci.duration();case"empty":return Ci.empty();case"enum":return Ci.enum();case"enumValue":return Ci.enumValue();case"field":return Ci.field();case"fieldCardinality":return Ci.fieldCardinality();case"fieldKind":return Ci.fieldKind();case"fieldMask":return Ci.fieldMask();case"floatValue":return Ci.floatValue();case"int32Value":return Ci.int32Value();case"int64Value":return Ci.int64Value();case"listValue":return Ci.listValue();case"method":return Ci.method();case"mixin":return Ci.mixin();case"nullValue":return Ci.nullValue();case"option":return Ci.option();case"sourceContext":return Ci.sourceContext();case"stringValue":return Ci.stringValue();case"struct":return Ci.struct();case"syntax":return Ci.syntax();case"timestamp":return Ci.timestamp();case"type":return Ci.type();case"uint32Value":return Ci.uint32Value();case"uint64Value":return Ci.uint64Value();case"value":return Ci.value();default:return e}},untransform:({_visit:e,...t})=>t})});var tTr,dio=h(()=>{"use strict";Xr();Me();pio();fio();tTr=P.union("type",{wellKnown:P.object({value:eTr}),userDefined:$1r}).transform({transform:e=>{switch(e.type){case"wellKnown":return Zp.wellKnown(e.value);case"userDefined":return Zp.userDefined(e);default:return e}},untransform:({_visit:e,...t})=>t})});var rTr,mio=h(()=>{"use strict";Xr();Me();dio();rTr=P.union("type",{proto:P.object({value:tTr})}).transform({transform:e=>e.type==="proto"?Sfe.proto(e.value):e,untransform:({_visit:e,...t})=>t})});var nTr,hio=h(()=>{"use strict";Me();nTr=P.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","DATE_TIME_RFC_2822","UUID","BASE_64","BIG_INTEGER"])});var iTr,gio=h(()=>{"use strict";Me();iTr=P.objectWithoutOptionalProperties({})});var oTr,Aio=h(()=>{"use strict";Me();oTr=P.objectWithoutOptionalProperties({default:P.string().optional()})});var sTr,yio=h(()=>{"use strict";Me();sTr=P.objectWithoutOptionalProperties({default:P.boolean().optional()})});var aTr,bio=h(()=>{"use strict";Me();aTr=P.objectWithoutOptionalProperties({})});var cTr,Eio=h(()=>{"use strict";Me();cTr=P.objectWithoutOptionalProperties({})});var uTr,Iio=h(()=>{"use strict";Me();uTr=P.objectWithoutOptionalProperties({})});var lTr,vio=h(()=>{"use strict";Me();lTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var pTr,Cio=h(()=>{"use strict";Me();vio();pTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:lTr.optional()})});var fTr,xio=h(()=>{"use strict";Me();fTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var dTr,Sio=h(()=>{"use strict";Me();xio();dTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:fTr.optional()})});var mTr,wio=h(()=>{"use strict";Me();mTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var hTr,Tio=h(()=>{"use strict";Me();wio();hTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:mTr.optional()})});var gTr,Oio=h(()=>{"use strict";Me();gTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var ATr,Pio=h(()=>{"use strict";Me();Oio();ATr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:gTr.optional()})});var yTr,Bio=h(()=>{"use strict";Me();yTr=P.objectWithoutOptionalProperties({format:P.string().optional(),pattern:P.string().optional(),minLength:P.number().optional(),maxLength:P.number().optional()})});var bTr,Rio=h(()=>{"use strict";Me();Bio();bTr=P.objectWithoutOptionalProperties({default:P.string().optional(),validation:yTr.optional()})});var ETr,Dio=h(()=>{"use strict";Me();ETr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var ITr,kio=h(()=>{"use strict";Me();Dio();ITr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:ETr.optional()})});var vTr,Fio=h(()=>{"use strict";Me();vTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var CTr,Nio=h(()=>{"use strict";Me();Fio();CTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:vTr.optional()})});var xTr,jio=h(()=>{"use strict";Me();xTr=P.objectWithoutOptionalProperties({})});var STr,zio=h(()=>{"use strict";Xr();Me();gio();Aio();yio();bio();Eio();Iio();Cio();Sio();Tio();Pio();Rio();kio();Nio();jio();STr=P.union("type",{integer:hTr,long:ATr,uint:CTr,uint64:ITr,float:dTr,double:pTr,boolean:sTr,string:bTr,date:uTr,dateTime:cTr,dateTimeRfc2822:aTr,uuid:xTr,base64:iTr,bigInteger:oTr}).transform({transform:e=>{switch(e.type){case"integer":return Ei.integer(e);case"long":return Ei.long(e);case"uint":return Ei.uint(e);case"uint64":return Ei.uint64(e);case"float":return Ei.float(e);case"double":return Ei.double(e);case"boolean":return Ei.boolean(e);case"string":return Ei.string(e);case"date":return Ei.date(e);case"dateTime":return Ei.dateTime(e);case"dateTimeRfc2822":return Ei.dateTimeRfc2822(e);case"uuid":return Ei.uuid(e);case"base64":return Ei.base64(e);case"bigInteger":return Ei.bigInteger(e);default:return e}},untransform:({_visit:e,...t})=>t})});var dtt,wTr=h(()=>{"use strict";Me();hio();zio();dtt=P.objectWithoutOptionalProperties({v1:nTr,v2:STr.optional()})});var TTr,Qio=h(()=>{"use strict";Me();TTr=P.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"])});var OTr,Mio=h(()=>{"use strict";Me();pQ();Qio();OTr=P.objectWithoutOptionalProperties({name:Wy,shape:TTr})});var PTr,Lio=h(()=>{"use strict";Xr();Me();$o();wTr();Mio();PTr=P.union(P.discriminant("type","_type"),{container:P.object({container:P.lazy(()=>mtt)}),named:OTr,primitive:P.object({primitive:dtt}),unknown:P.object({})}).transform({transform:e=>{switch(e.type){case"container":return Iw.container(e.container);case"named":return Iw.named(e);case"primitive":return Iw.primitive(e.primitive);case"unknown":return Iw.unknown();default:return e}},untransform:({_visit:e,...t})=>t})});var BTr,_io=h(()=>{"use strict";Me();$o();Lio();BTr=P.objectWithoutOptionalProperties({aliasOf:P.lazy(()=>zs),resolvedType:PTr})});var RTr,Uio=h(()=>{"use strict";Me();fLt();pQ();Rfe();RTr=P.objectWithoutOptionalProperties({extends:P.list(Wy),properties:P.list(aB),extendedProperties:P.list(aB).optional(),extraProperties:P.property("extra-properties",P.boolean()),deferredUnionBaseProperties:P.list(SIe).optional()})});var DTr,Vio=h(()=>{"use strict";Me();$o();fp();DTr=P.objectWithoutOptionalProperties({type:P.lazy(()=>zs)}).extend(ao)});var kTr,Gio=h(()=>{"use strict";Me();Rfe();Vio();kTr=P.objectWithoutOptionalProperties({members:P.list(DTr),baseProperties:P.list(aB).optional()})});var FTr,qio=h(()=>{"use strict";Me();$o();Id();FTr=P.objectWithoutOptionalProperties({name:fs,type:P.lazy(()=>zs)})});var NTr,Wio=h(()=>{"use strict";Xr();Me();pQ();qio();NTr=P.union(P.discriminant("propertiesType","_type"),{samePropertiesAsObject:Wy,singleProperty:FTr,noProperties:P.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return X1.samePropertiesAsObject(e);case"singleProperty":return X1.singleProperty(e);case"noProperties":return X1.noProperties();default:return e}},untransform:({_visit:e,...t})=>t})});var NLt,Hio=h(()=>{"use strict";Me();get();Id();fp();Wio();NLt=P.objectWithoutOptionalProperties({discriminantValue:fs,shape:NTr,displayName:P.string().optional(),availability:d$.optional()}).extend(ao)});var jTr,Kio=h(()=>{"use strict";Me();jTr=P.enum_(["data","protocol"])});var zTr,Jio=h(()=>{"use strict";Me();fLt();Id();pQ();Rfe();Hio();Kio();zTr=P.objectWithoutOptionalProperties({discriminant:fs,extends:P.list(Wy),types:P.list(NLt),baseProperties:P.list(aB),inheritedBaseProperties:P.list(SIe).optional(),default:NLt.optional(),discriminatorContext:jTr.optional()})});var QTr,Yio=h(()=>{"use strict";Xr();Me();_io();B1r();Uio();Gio();Jio();QTr=P.union(P.discriminant("type","_type"),{alias:BTr,enum:ptt,object:RTr,union:zTr,undiscriminatedUnion:kTr}).transform({transform:e=>{switch(e.type){case"alias":return uc.alias(e);case"enum":return uc.enum(e);case"object":return uc.object(e);case"union":return uc.union(e);case"undiscriminatedUnion":return uc.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t})});var MTr,Xio=h(()=>{"use strict";Me();LH();Dfe();m$();pQ();S1r();lio();mio();Yio();MTr=P.objectWithoutOptionalProperties({name:Wy,shape:QTr,autogeneratedExamples:P.list(FLt),userProvidedExamples:P.list(FLt),v2Examples:eT.optional(),referencedTypes:P.set(cB),encoding:ltt.optional(),source:rTr.optional(),inline:P.boolean().optional()}).extend(Wx)});var LTr,Zio=h(()=>{"use strict";Me();$o();Mf();fp();a1r();LTr=P.objectWithoutOptionalProperties({id:att,name:Ro,type:P.lazy(()=>zs),envVar:P.string().optional()}).extend(ao)});var _Tr,$io=h(()=>{"use strict";Me();$o();Mf();fp();_Tr=P.objectWithoutOptionalProperties({name:Ro.optional(),payload:P.lazyObject(()=>uu)}).extend(ao)});var UTr,eoo=h(()=>{"use strict";Me();UTr=P.enum_(["GET","POST"])});var VTr,too=h(()=>{"use strict";Mf();VTr=Ro});var GTr,roo=h(()=>{"use strict";Me();$o();Id();ILt();GTr=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs)}).extend(DIe)});var qTr,noo=h(()=>{"use strict";Me();Mf();pQ();roo();qTr=P.objectWithoutOptionalProperties({name:Ro,extends:P.list(Wy),properties:P.list(GTr)})});var WTr,ioo=h(()=>{"use strict";Me();$o();fp();WTr=P.objectWithoutOptionalProperties({payloadType:P.lazy(()=>zs)}).extend(ao)});var HTr,ooo=h(()=>{"use strict";Xr();Me();noo();ioo();HTr=P.union("type",{inlinedPayload:qTr,reference:WTr}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return Z1.inlinedPayload(e);case"reference":return Z1.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var KTr,soo=h(()=>{"use strict";Me();KTr=P.enum_(["RSA_SHA256","RSA_SHA384","RSA_SHA512","ECDSA_SHA256","ECDSA_SHA384","ECDSA_SHA512","ED25519"])});var JTr,aoo=h(()=>{"use strict";Me();Id();JTr=P.objectWithoutOptionalProperties({url:P.string(),keyIdHeader:fs.optional()})});var YTr,coo=h(()=>{"use strict";Me();YTr=P.objectWithoutOptionalProperties({})});var XTr,uoo=h(()=>{"use strict";Xr();Me();aoo();coo();XTr=P.union("type",{jwks:JTr,static:YTr}).transform({transform:e=>{switch(e.type){case"jwks":return FH.jwks(e);case"static":return FH.static(e);default:return e}},untransform:({_visit:e,...t})=>t})});var ZTr,loo=h(()=>{"use strict";Me();ZTr=P.enum_(["ALPHABETICAL"])});var $Tr,poo=h(()=>{"use strict";Me();$Tr=P.enum_(["BODY","TIMESTAMP","NOTIFICATION_URL","MESSAGE_ID"])});var htt,eOr=h(()=>{"use strict";Me();loo();poo();htt=P.objectWithoutOptionalProperties({components:P.list($Tr),delimiter:P.string(),bodySort:ZTr.optional()})});var _Ie,jLt=h(()=>{"use strict";Me();_Ie=P.enum_(["BASE64","HEX"])});var tOr,foo=h(()=>{"use strict";Me();tOr=P.enum_(["UNIX_SECONDS","UNIX_MILLIS","ISO8601"])});var gtt,rOr=h(()=>{"use strict";Me();Id();foo();gtt=P.objectWithoutOptionalProperties({headerName:fs,format:tOr,tolerance:P.number().optional()})});var nOr,doo=h(()=>{"use strict";Me();Id();soo();uoo();eOr();jLt();rOr();nOr=P.objectWithoutOptionalProperties({signatureHeaderName:fs,algorithm:KTr,encoding:_Ie,signaturePrefix:P.string().optional(),keySource:XTr,payloadFormat:htt.optional(),timestamp:gtt.optional()})});var Att,iOr=h(()=>{"use strict";Me();Att=P.enum_(["SHA256","SHA1","SHA384","SHA512"])});var oOr,moo=h(()=>{"use strict";Me();iOr();oOr=P.objectWithoutOptionalProperties({wireValue:P.string(),algorithm:Att})});var sOr,hoo=h(()=>{"use strict";Me();Id();moo();sOr=P.objectWithoutOptionalProperties({headerName:fs,keyIdDelimiter:P.string().optional(),keyIdParameter:P.string().optional(),algorithmParameter:P.string().optional(),algorithms:P.list(oOr)})});var aOr,goo=h(()=>{"use strict";Me();aOr=P.enum_(["SHA256","SHA1","SHA384","SHA512"])});var cOr,Aoo=h(()=>{"use strict";Me();cOr=P.objectWithoutOptionalProperties({name:P.string()})});var uOr,yoo=h(()=>{"use strict";Xr();Me();Aoo();uOr=P.union("type",{queryParameter:cOr}).transform({transform:e=>e.type==="queryParameter"?xIe.queryParameter(e):e,untransform:({_visit:e,...t})=>t})});var lOr,boo=h(()=>{"use strict";Me();goo();yoo();jLt();lOr=P.objectWithoutOptionalProperties({algorithm:aOr,encoding:_Ie,location:uOr})});var pOr,Eoo=h(()=>{"use strict";Me();pOr=P.objectWithoutOptionalProperties({portVariants:P.boolean(),legacyQueryEncoding:P.boolean()})});var fOr,Ioo=h(()=>{"use strict";Me();Id();iOr();hoo();boo();Eoo();eOr();jLt();rOr();fOr=P.objectWithoutOptionalProperties({signatureHeaderName:fs,algorithm:Att,encoding:_Ie,signaturePrefix:P.string().optional(),payloadFormat:htt,timestamp:gtt.optional(),bodyHashBinding:lOr.optional(),notificationUrlNormalization:pOr.optional(),algorithmHeader:sOr.optional()})});var ytt,dOr=h(()=>{"use strict";Xr();Me();doo();Ioo();ytt=P.union("type",{hmac:fOr,asymmetric:nOr}).transform({transform:e=>{switch(e.type){case"hmac":return zH.hmac(e);case"asymmetric":return zH.asymmetric(e);default:return e}},untransform:({_visit:e,...t})=>t})});var mOr,voo=h(()=>{"use strict";Me();LH();B$i();qto();Rwr();Ffe();RLt();$io();eoo();too();ooo();dOr();mOr=P.objectWithoutOptionalProperties({id:vCr,name:VTr,displayName:P.string().optional(),method:UTr,headers:P.list(rT),payload:HTr,signatureVerification:ytt.optional(),fileUploadPayload:Zet.optional(),responses:P.list(MIe).optional(),examples:P.list(_Tr).optional(),v2Examples:mSr.optional()}).extend(Wx)});var hOr,Coo=h(()=>{"use strict";Me();voo();hOr=P.list(mOr)});var gOr,xoo=h(()=>{"use strict";Xr();Me();$o();swr();gOr=P.union("type",{inlinedBody:Wet,reference:P.lazyObject(()=>uu)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return z3.inlinedBody(e);case"reference":return z3.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var btt,AOr=h(()=>{"use strict";Me();btt=P.string()});var yOr,Soo=h(()=>{"use strict";Me();xoo();AOr();yOr=P.objectWithoutOptionalProperties({type:btt,body:gOr})});var bOr,woo=h(()=>{"use strict";Me();Mf();fp();ewr();twr();nwr();Soo();bOr=P.objectWithoutOptionalProperties({name:Ro.optional(),url:P.string(),pathParameters:P.list(zIe),headers:P.list(DLe),queryParameters:P.list(qet),messages:P.list(yOr)}).extend(ao)});var EOr,Too=h(()=>{"use strict";Me();$o();Id();ILt();EOr=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs)}).extend(DIe)});var IOr,Ooo=h(()=>{"use strict";Me();Mf();pQ();Too();IOr=P.objectWithoutOptionalProperties({name:Ro,extends:P.list(Wy),properties:P.list(EOr)})});var vOr,Poo=h(()=>{"use strict";Me();$o();fp();vOr=P.objectWithoutOptionalProperties({bodyType:P.lazy(()=>zs)}).extend(ao)});var COr,Boo=h(()=>{"use strict";Xr();Me();Ooo();Poo();COr=P.union("type",{inlinedBody:IOr,reference:vOr}).transform({transform:e=>{switch(e.type){case"inlinedBody":return sB.inlinedBody(e);case"reference":return sB.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var xOr,Roo=h(()=>{"use strict";Me();xOr=P.enum_(["client","server"])});var SOr,Doo=h(()=>{"use strict";Me();LH();Boo();AOr();Roo();SOr=P.objectWithoutOptionalProperties({type:btt,displayName:P.string().optional(),methodName:P.string().optional(),origin:xOr,body:COr}).extend(Wx)});var wOr,koo=h(()=>{"use strict";Mf();wOr=Ro});var TOr,Foo=h(()=>{"use strict";Me();LH();RLe();Jto();Ffe();ttt();ctt();ALt();woo();Doo();koo();TOr=P.objectWithoutOptionalProperties({name:wOr,displayName:P.string().optional(),connectMethodName:P.string().optional(),baseUrl:pD.optional(),path:WV,auth:P.boolean(),headers:P.list(rT),queryParameters:P.list(OIe),pathParameters:P.list(UH),messages:P.list(SOr),examples:P.list(bOr),v2Examples:ASr.optional(),apiPlayground:P.boolean().optional()}).extend(Wx)});var OOr,Noo=h(()=>{"use strict";Me();het();OOr=P.objectWithoutOptionalProperties({pointsTo:f$})});var Ett,POr=h(()=>{"use strict";Me();bLt();TLe();met();het();Dfe();ICr();CCr();fp();Noo();Ett=P.objectWithoutOptionalProperties({fernFilepath:VV,service:p$.optional(),types:P.list(cB),errors:P.list(RIe),webhooks:Eet.optional(),websocket:Iet.optional(),subpackages:P.list(f$),hasEndpointsInTree:P.boolean(),hasWebSocketInTree:P.boolean().optional(),navigationConfig:OOr.optional()}).extend(ao)});var BOr,joo=h(()=>{"use strict";Me();BLt();BOr=P.objectWithoutOptionalProperties({title:P.string(),language:QIe,content:P.string()})});var ROr,zoo=h(()=>{"use strict";Me();dLt();P$i();Hno();joo();ROr=P.objectWithoutOptionalProperties({defaultEndpoint:Bfe.optional(),bannerLink:P.string().optional(),introduction:P.string().optional(),apiReferenceLink:P.string().optional(),apiName:P.string().optional(),disabledFeatures:P.list(ELt).optional(),whiteLabel:P.boolean().optional(),features:P.record(ELt,P.list(Bfe)).optional(),customSections:P.list(BOr).optional(),exampleStyle:j1r.optional()})});var DOr,Qoo=h(()=>{"use strict";Me();DOr=P.objectWithoutOptionalProperties({header:P.stringLiteral("User-Agent"),value:P.string()})});var kOr,Moo=h(()=>{"use strict";Me();Qoo();kOr=P.objectWithoutOptionalProperties({language:P.string(),sdkName:P.string(),sdkVersion:P.string(),userAgent:DOr.optional()})});var FOr,Loo=h(()=>{"use strict";Me();dOr();Yno();Moo();FOr=P.objectWithoutOptionalProperties({isAuthMandatory:P.boolean(),hasStreamingEndpoints:P.boolean(),hasPaginatedEndpoints:P.boolean(),hasFileDownloadEndpoints:P.boolean(),platformHeaders:kOr,idempotencyKeyGeneration:M1r.optional(),webhookSignatureVerification:ytt.optional()})});var NOr,_oo=h(()=>{"use strict";Me();met();Dfe();NOr=P.objectWithoutOptionalProperties({typesReferencedOnlyByService:P.record(p$,P.list(cB)),sharedTypes:P.list(cB)})});var jOr,Uoo=h(()=>{"use strict";Me();_no();jOr=P.objectWithoutOptionalProperties({sources:P.list(P1r)})});var zOr,Voo=h(()=>{"use strict";Me();yLt();Mf();POr();zOr=P.objectWithoutOptionalProperties({name:Ro,displayName:BIe.optional()}).extend(Ett)});var eoc,toc=h(()=>{"use strict";Me();JZi();x$i();bLt();Mf();met();het();Dfe();ICr();CCr();k$i();oto();xto();Oto();gxr();Ffe();ttt();jno();ctt();uio();Xio();Zio();Coo();Foo();Vno();Gno();Wno();Jno();POr();zoo();Loo();_oo();Uoo();Voo();eoc=P.objectWithoutOptionalProperties({fdrApiDefinitionId:P.string().optional(),apiVersion:D1r.optional(),specVersion:P.string().optional(),apiName:Ro,apiDisplayName:P.string().optional(),apiDocs:P.string().optional(),auth:yCr,headers:P.list(rT),idempotencyHeaders:P.list(rT),types:P.record(cB,MTr),services:P.record(p$,w1r),webhookGroups:P.record(Eet,hOr),websocketChannels:P.record(Iet,TOr).optional(),errors:P.record(RIe,Zxr),subpackages:P.record(f$,zOr),rootPackage:Ett,constants:xCr,environments:Yxr.optional(),basePath:WV.optional(),pathParameters:P.list(UH),errorDiscriminationStrategy:N1r,sdkConfig:FOr,variables:P.list(LTr),globalParameters:P.list(Ret).optional(),serviceTypeReferenceInfo:NOr,readmeConfig:ROr.optional(),sourceConfig:jOr.optional(),publishConfig:Z1r.optional(),dynamic:Qxr.optional(),selfHosted:P.boolean().optional(),audiences:P.list(_vr).optional(),generationMetadata:Q1r.optional(),apiPlayground:P.boolean().optional(),casingsConfig:k1r.optional()})});var Goo=h(()=>{"use strict";_no();Mno();Vno();Gno();qno();Wno();Hno();Jno();Uno();Yno();toc();Kno();POr();Noo();Moo();Lno();zoo();joo();Loo();_oo();Uoo();Voo();Qoo()});var qoo={};te(qoo,{ApiDefinitionSource:()=>P1r,ApiDefinitionSourceId:()=>T1r,ApiVersionScheme:()=>D1r,CasingsConfig:()=>k1r,ErrorDiscriminationByPropertyStrategy:()=>F1r,ErrorDiscriminationStrategy:()=>N1r,ExampleStyle:()=>j1r,GenerationMetadata:()=>Q1r,HeaderApiVersionScheme:()=>R1r,IdempotencyKeyGeneration:()=>M1r,IntermediateRepresentation:()=>eoc,InvocationSource:()=>z1r,Package:()=>Ett,PackageNavigationConfig:()=>OOr,PlatformHeaders:()=>kOr,ProtoSource:()=>O1r,ReadmeConfig:()=>ROr,ReadmeCustomSection:()=>BOr,SdkConfig:()=>FOr,ServiceTypeReferenceInfo:()=>NOr,SourceConfig:()=>jOr,Subpackage:()=>zOr,UserAgent:()=>DOr});var roc=h(()=>{"use strict";Goo()});var Woo=h(()=>{"use strict";Zro();Fwr();$ro();nno();eno();dio();pio();fio()});var Hoo={};te(Hoo,{CsharpProtobufFileOptions:()=>Dwr,ProtobufFile:()=>$et,ProtobufFileOptions:()=>kwr,ProtobufMethodType:()=>Qwr,ProtobufService:()=>Nwr,ProtobufType:()=>tTr,UserDefinedProtobufType:()=>$1r,WellKnownProtobufType:()=>eTr});var noc=h(()=>{"use strict";Woo()});var Koo=h(()=>{"use strict";Xno();sio();aio();cio();Zno();$no();eio();tio();rio();nio();uio();kLt();iio();oio()});var Joo={};te(Joo,{CratesPublishTarget:()=>L1r,DirectPublish:()=>J1r,Filesystem:()=>Y1r,GithubPublish:()=>X1r,GoPublishTarget:()=>_1r,MavenPublishTarget:()=>U1r,NpmPublishTarget:()=>V1r,NugetPublishTarget:()=>G1r,PackagistPublishTarget:()=>q1r,PostmanPublishTarget:()=>W1r,PublishTarget:()=>LIe,PublishingConfig:()=>Z1r,PypiPublishTarget:()=>H1r,RubyGemsPublishTarget:()=>K1r});var ioc=h(()=>{"use strict";Koo()});var mtt,ooc=h(()=>{"use strict";Xr();Me();$o();wLe();mtt=P.union(P.discriminant("type","_type"),{list:P.object({list:P.lazy(()=>zs)}),map:P.lazyObject(()=>QOr),nullable:P.object({nullable:P.lazy(()=>zs)}),optional:P.object({optional:P.lazy(()=>zs)}),set:P.object({set:P.lazy(()=>zs)}),literal:P.object({literal:UV})}).transform({transform:e=>{switch(e.type){case"list":return Is.list(e.list);case"map":return Is.map(e);case"nullable":return Is.nullable(e.nullable);case"optional":return Is.optional(e.optional);case"set":return Is.set(e.set);case"literal":return Is.literal(e.literal);default:return e}},untransform:({_visit:e,...t})=>t})});var soc,aoc=h(()=>{"use strict";Me();pQ();DLt();soc=P.objectWithoutOptionalProperties({default:Nfe.optional(),name:Wy})});var MOr,coc=h(()=>{"use strict";Me();$o();MOr=P.objectWithoutOptionalProperties({value:P.lazyObject(()=>uu)})});var LOr,Yoo=h(()=>{"use strict";Me();LOr=P.objectWithoutOptionalProperties({datetime:P.date(),raw:P.string().optional()})});var _Or,Xoo=h(()=>{"use strict";Me();_Or=P.objectWithoutOptionalProperties({datetime:P.date(),raw:P.string().optional()})});var Itt,UOr=h(()=>{"use strict";Xr();Me();O$i();Yoo();Xoo();Itt=P.union("type",{integer:P.object({integer:P.number()}),long:P.object({long:P.number()}),uint:P.object({uint:P.number()}),uint64:P.object({uint64:P.number()}),float:P.object({float:P.number()}),double:P.object({double:P.number()}),boolean:P.object({boolean:P.boolean()}),string:P.object({string:ECr}),date:P.object({date:P.string()}),datetime:LOr,datetimeRfc2822:_Or,uuid:P.object({uuid:P.string()}),base64:P.object({base64:P.string()}),bigInteger:P.object({bigInteger:P.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Qi.integer(e.integer);case"long":return Qi.long(e.long);case"uint":return Qi.uint(e.uint);case"uint64":return Qi.uint64(e.uint64);case"float":return Qi.float(e.float);case"double":return Qi.double(e.double);case"boolean":return Qi.boolean(e.boolean);case"string":return Qi.string(e.string);case"date":return Qi.date(e.date);case"datetime":return Qi.datetime(e);case"datetimeRfc2822":return Qi.datetimeRfc2822(e);case"uuid":return Qi.uuid(e.uuid);case"base64":return Qi.base64(e.base64);case"bigInteger":return Qi.bigInteger(e.bigInteger);default:return e}},untransform:({_visit:e,...t})=>t})});var VOr,Zoo=h(()=>{"use strict";Me();UOr();VOr=P.objectWithoutOptionalProperties({literal:Itt})});var GOr,uoc=h(()=>{"use strict";Xr();Me();$o();Zoo();GOr=P.union("type",{list:P.lazyObject(()=>qOr),set:P.lazyObject(()=>JOr),optional:P.lazyObject(()=>KOr),nullable:P.lazyObject(()=>HOr),map:P.lazyObject(()=>WOr),literal:VOr}).transform({transform:e=>{switch(e.type){case"list":return Hu.list(e);case"set":return Hu.set(e);case"optional":return Hu.optional(e);case"nullable":return Hu.nullable(e);case"map":return Hu.map(e);case"literal":return Hu.literal(e);default:return e}},untransform:({_visit:e,...t})=>t})});var YOr,$oo=h(()=>{"use strict";Me();Id();YOr=P.objectWithoutOptionalProperties({value:fs})});var XOr,loc=h(()=>{"use strict";Me();$o();Id();XOr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var ZOr,poc=h(()=>{"use strict";Me();$o();ZOr=P.objectWithoutOptionalProperties({key:P.lazyObject(()=>uu),value:P.lazyObject(()=>uu)})});var qOr,foc=h(()=>{"use strict";Me();$o();qOr=P.objectWithoutOptionalProperties({list:P.list(P.lazyObject(()=>uu)),itemType:P.lazy(()=>zs)})});var WOr,doc=h(()=>{"use strict";Me();$o();WOr=P.objectWithoutOptionalProperties({map:P.list(P.lazyObject(()=>ZOr)),keyType:P.lazy(()=>zs),valueType:P.lazy(()=>zs)})});var $Or,moc=h(()=>{"use strict";Me();$o();pQ();$Or=P.objectWithoutOptionalProperties({typeName:Wy,shape:P.lazy(()=>ftt)})});var HOr,hoc=h(()=>{"use strict";Me();$o();HOr=P.objectWithoutOptionalProperties({nullable:P.lazyObject(()=>uu).optional(),valueType:P.lazy(()=>zs)})});var vtt,goc=h(()=>{"use strict";Me();$o();Id();pQ();gLt();vtt=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu),propertyAccess:TIe.optional(),originalTypeDeclaration:Wy})});var Ctt,Aoc=h(()=>{"use strict";Me();$o();Ctt=P.objectWithoutOptionalProperties({properties:P.list(P.lazyObject(()=>vtt)),extraProperties:P.list(P.lazyObject(()=>XOr)).optional()})});var ePr,yoc=h(()=>{"use strict";Me();$o();Dfe();ePr=P.objectWithoutOptionalProperties({typeId:cB,object:P.lazyObject(()=>Ctt)})});var KOr,boc=h(()=>{"use strict";Me();$o();KOr=P.objectWithoutOptionalProperties({optional:P.lazyObject(()=>uu).optional(),valueType:P.lazy(()=>zs)})});var JOr,Eoc=h(()=>{"use strict";Me();$o();JOr=P.objectWithoutOptionalProperties({set:P.list(P.lazyObject(()=>uu)),itemType:P.lazy(()=>zs)})});var tPr,Ioc=h(()=>{"use strict";Me();$o();Id();tPr=P.objectWithoutOptionalProperties({wireDiscriminantValue:fs,shape:P.lazy(()=>rPr)})});var rPr,voc=h(()=>{"use strict";Xr();Me();$o();rPr=P.union("type",{samePropertiesAsObject:P.lazyObject(()=>ePr),singleProperty:P.lazyObject(()=>uu),noProperties:P.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return c$.samePropertiesAsObject(e);case"singleProperty":return c$.singleProperty(e);case"noProperties":return c$.noProperties();default:return e}},untransform:({_visit:e,...t})=>t})});var uu,Coc=h(()=>{"use strict";Me();$o();vet();uu=P.objectWithoutOptionalProperties({shape:P.lazy(()=>nPr)}).extend(g$)});var nPr,xoc=h(()=>{"use strict";Xr();Me();$o();UOr();nPr=P.union("type",{primitive:P.object({primitive:Itt}),container:P.object({container:P.lazy(()=>GOr)}),unknown:P.object({unknown:P.unknown()}),named:P.lazyObject(()=>$Or)}).transform({transform:e=>{switch(e.type){case"primitive":return to.primitive(e.primitive);case"container":return to.container(e.container);case"unknown":return to.unknown(e.unknown);case"named":return to.named(e);default:return e}},untransform:({_visit:e,...t})=>t})});var ftt,Soc=h(()=>{"use strict";Xr();Me();$o();$oo();ftt=P.union("type",{alias:P.lazyObject(()=>MOr),enum:YOr,object:P.lazyObject(()=>Ctt),union:P.lazyObject(()=>oPr),undiscriminatedUnion:P.lazyObject(()=>iPr)}).transform({transform:e=>{switch(e.type){case"alias":return Ku.alias(e);case"enum":return Ku.enum(e);case"object":return Ku.object(e);case"union":return Ku.union(e);case"undiscriminatedUnion":return Ku.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t})});var iPr,woc=h(()=>{"use strict";Me();$o();iPr=P.objectWithoutOptionalProperties({index:P.number(),singleUnionType:P.lazyObject(()=>uu)})});var sPr,Toc=h(()=>{"use strict";Me();$o();Id();sPr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var oPr,Ooc=h(()=>{"use strict";Me();$o();Id();oPr=P.objectWithoutOptionalProperties({discriminant:fs,singleUnionType:P.lazyObject(()=>tPr),extendProperties:P.list(P.lazyObject(()=>vtt)).optional(),baseProperties:P.list(P.lazyObject(()=>sPr)).optional()})});var QOr,Poc=h(()=>{"use strict";Me();$o();QOr=P.objectWithoutOptionalProperties({keyType:P.lazy(()=>zs),valueType:P.lazy(()=>zs)})});var aPr,eso=h(()=>{"use strict";Xr();Me();DLt();aPr=P.union("type",{enum:Nfe}).transform({transform:e=>e.type==="enum"?set.enum(e):e,untransform:({_visit:e,...t})=>t})});var cPr,tso=h(()=>{"use strict";Me();yLt();TLe();Mf();Dfe();eso();cPr=P.objectWithoutOptionalProperties({typeId:cB,fernFilepath:VV,name:Ro,displayName:BIe.optional(),default:aPr.optional(),inline:P.boolean().optional()})});var zs,Boc=h(()=>{"use strict";Xr();Me();$o();tso();wTr();zs=P.union(P.discriminant("type","_type"),{container:P.object({container:P.lazy(()=>mtt)}),named:cPr,primitive:P.object({primitive:dtt}),unknown:P.object({})}).transform({transform:e=>{switch(e.type){case"container":return Zr.container(e.container);case"named":return Zr.named(e);case"primitive":return Zr.primitive(e.primitive);case"unknown":return Zr.unknown();default:return e}},untransform:({_visit:e,...t})=>t})});var rso=h(()=>{"use strict";_io();gio();Aio();yio();ooc();bio();Eio();Iio();pQ();Cio();vio();S1r();B1r();aoc();DLt();coc();uoc();Yoo();Xoo();$oo();loc();poc();foc();Zoo();doc();moc();hoc();goc();Aoc();yoc();boc();UOr();Eoc();Ioc();voc();lio();Coc();xoc();Soc();woc();Toc();Ooc();Sio();xio();Tio();wio();kno();wLe();Pio();Oio();Poc();tso();eso();Rfe();gLt();Uio();wTr();hio();zio();Fno();Mio();Lio();Qio();Hio();Wio();qio();mio();Rio();Bio();Yio();Xio();Boc();kio();Dio();Nio();Fio();Vio();Gio();Kio();Jio();jio();Nno();o$i();i$i()});var nso={};te(nso,{AliasTypeDeclaration:()=>BTr,Base64Type:()=>iTr,BigIntegerType:()=>oTr,BooleanType:()=>sTr,ContainerType:()=>mtt,DateTimeRfc2822Type:()=>aTr,DateTimeType:()=>cTr,DateType:()=>uTr,DeclaredTypeName:()=>Wy,DoubleType:()=>pTr,DoubleValidationRules:()=>lTr,Encoding:()=>ltt,EnumTypeDeclaration:()=>ptt,EnumTypeReference:()=>soc,EnumValue:()=>Nfe,ExampleAliasType:()=>MOr,ExampleContainer:()=>GOr,ExampleDatetime:()=>LOr,ExampleDatetimeRfc2822:()=>_Or,ExampleEnumType:()=>YOr,ExampleExtraObjectProperty:()=>XOr,ExampleKeyValuePair:()=>ZOr,ExampleListContainer:()=>qOr,ExampleLiteralContainer:()=>VOr,ExampleMapContainer:()=>WOr,ExampleNamedType:()=>$Or,ExampleNullableContainer:()=>HOr,ExampleObjectProperty:()=>vtt,ExampleObjectType:()=>Ctt,ExampleObjectTypeWithTypeId:()=>ePr,ExampleOptionalContainer:()=>KOr,ExamplePrimitive:()=>Itt,ExampleSetContainer:()=>JOr,ExampleSingleUnionType:()=>tPr,ExampleSingleUnionTypeProperties:()=>rPr,ExampleType:()=>FLt,ExampleTypeReference:()=>uu,ExampleTypeReferenceShape:()=>nPr,ExampleTypeShape:()=>ftt,ExampleUndiscriminatedUnionType:()=>iPr,ExampleUnionBaseProperty:()=>sPr,ExampleUnionType:()=>oPr,FloatType:()=>dTr,FloatValidationRules:()=>fTr,IntegerType:()=>hTr,IntegerValidationRules:()=>mTr,JsonEncoding:()=>v1r,Literal:()=>UV,LongType:()=>ATr,LongValidationRules:()=>gTr,MapType:()=>QOr,NamedType:()=>cPr,NamedTypeDefault:()=>aPr,ObjectProperty:()=>aB,ObjectPropertyAccess:()=>TIe,ObjectTypeDeclaration:()=>RTr,PrimitiveType:()=>dtt,PrimitiveTypeV1:()=>nTr,PrimitiveTypeV2:()=>STr,ProtoEncoding:()=>C1r,ResolvedNamedType:()=>OTr,ResolvedTypeReference:()=>PTr,ShapeType:()=>TTr,SingleUnionType:()=>NLt,SingleUnionTypeProperties:()=>NTr,SingleUnionTypeProperty:()=>FTr,Source:()=>rTr,StringType:()=>bTr,StringValidationRules:()=>yTr,Type:()=>QTr,TypeDeclaration:()=>MTr,TypeReference:()=>zs,Uint64Type:()=>ITr,Uint64ValidationRules:()=>ETr,UintType:()=>CTr,UintValidationRules:()=>vTr,UndiscriminatedUnionMember:()=>DTr,UndiscriminatedUnionTypeDeclaration:()=>kTr,UnionDiscriminatorContext:()=>jTr,UnionTypeDeclaration:()=>zTr,UuidType:()=>xTr,XmlEncoding:()=>x1r,XmlPropertyEncoding:()=>Yvr,XmlPropertyKind:()=>Jvr});var Roc=h(()=>{"use strict";rso()});var iso=h(()=>{"use strict";Zio();a1r()});var oso={};te(oso,{VariableDeclaration:()=>LTr,VariableId:()=>att});var Doc=h(()=>{"use strict";iso()});var sso=h(()=>{"use strict";soo();doo();uoo();$io();iOr();Ioo();noo();roo();aoo();coo();voo();hoo();moo();goo();boo();yoo();Aoo();Coo();eoo();too();Eoo();ooo();loo();poo();eOr();ioo();jLt();dOr();rOr();foo()});var aso={};te(aso,{AsymmetricAlgorithm:()=>KTr,AsymmetricKeySignatureVerification:()=>nOr,AsymmetricKeySource:()=>XTr,ExampleWebhookCall:()=>_Tr,HmacAlgorithm:()=>Att,HmacSignatureVerification:()=>fOr,InlinedWebhookPayload:()=>qTr,InlinedWebhookPayloadProperty:()=>GTr,JwksKeySource:()=>JTr,StaticKeySource:()=>YTr,Webhook:()=>mOr,WebhookAlgorithmHeader:()=>sOr,WebhookAlgorithmOption:()=>oOr,WebhookBodyHashAlgorithm:()=>aOr,WebhookBodyHashBinding:()=>lOr,WebhookBodyHashLocation:()=>uOr,WebhookBodyHashQueryParameterLocation:()=>cOr,WebhookGroup:()=>hOr,WebhookHttpMethod:()=>UTr,WebhookName:()=>VTr,WebhookNotificationUrlNormalization:()=>pOr,WebhookPayload:()=>HTr,WebhookPayloadBodySort:()=>ZTr,WebhookPayloadComponent:()=>$Tr,WebhookPayloadFormat:()=>htt,WebhookPayloadReference:()=>WTr,WebhookSignatureEncoding:()=>_Ie,WebhookSignatureVerification:()=>ytt,WebhookTimestampConfig:()=>gtt,WebhookTimestampFormat:()=>tOr});var koc=h(()=>{"use strict";sso()});var cso=h(()=>{"use strict";Soo();xoo();woo();Ooo();Too();Foo();Doo();Boo();Poo();AOr();Roo();koo()});var uso={};te(uso,{ExampleWebSocketMessage:()=>yOr,ExampleWebSocketMessageBody:()=>gOr,ExampleWebSocketSession:()=>bOr,InlinedWebSocketMessageBody:()=>IOr,InlinedWebSocketMessageBodyProperty:()=>EOr,WebSocketChannel:()=>TOr,WebSocketMessage:()=>SOr,WebSocketMessageBody:()=>COr,WebSocketMessageBodyReference:()=>vOr,WebSocketMessageId:()=>btt,WebSocketMessageOrigin:()=>xOr,WebSocketName:()=>wOr});var Foc=h(()=>{"use strict";cso()});var Noc=h(()=>{"use strict";gic();YZi();Aic();w$i();yic();R$i();bic();F$i();_ic();Uic();Sto();qic();Pto();Wic();Yto();Xic();Zic();Oro();$ic();zno();roc();Goo();noc();Woo();ioc();Koo();Roc();rso();Doc();iso();koc();sso();Foc();cso()});var Gi={};te(Gi,{AliasTypeDeclaration:()=>BTr,ApiAuth:()=>yCr,ApiDefinitionSource:()=>P1r,ApiDefinitionSourceId:()=>T1r,ApiVersionScheme:()=>D1r,AsymmetricAlgorithm:()=>KTr,AsymmetricKeySignatureVerification:()=>nOr,AsymmetricKeySource:()=>XTr,AudienceDefinition:()=>_vr,AudienceReference:()=>pet,AuthScheme:()=>gCr,AuthSchemeKey:()=>det,AuthSchemesRequirement:()=>ACr,AuthScope:()=>bCr,AutogeneratedEndpointExample:()=>dwr,Availability:()=>d$,AvailabilityStatus:()=>Kvr,Base64Type:()=>iTr,BaseAuthScheme:()=>_V,BasicAuthScheme:()=>qvr,BasicAuthValues:()=>$xr,BearerAuthScheme:()=>Wvr,BearerAuthValues:()=>eSr,BigIntegerType:()=>oTr,BooleanType:()=>sTr,BytesRequest:()=>Ket,BytesResponse:()=>Jet,CasingsConfig:()=>k1r,Constants:()=>xCr,ContainerType:()=>mtt,CratesPublishTarget:()=>L1r,CsharpProtobufFileOptions:()=>Dwr,CursorPagination:()=>gwr,CustomPagination:()=>Awr,DateTimeRfc2822Type:()=>aTr,DateTimeType:()=>cTr,DateType:()=>uTr,Declaration:()=>Wx,DeclaredErrorName:()=>jIe,DeclaredServiceName:()=>ywr,DeclaredTypeName:()=>Wy,DirectPublish:()=>J1r,DisplayName:()=>BIe,DoubleType:()=>pTr,DoubleValidationRules:()=>lTr,Encoding:()=>ltt,EndpointId:()=>Bfe,EndpointName:()=>bwr,EndpointReference:()=>wIe,EnumTypeDeclaration:()=>ptt,EnumTypeReference:()=>soc,EnumValue:()=>Nfe,EnvironmentBaseUrlId:()=>pD,EnvironmentBaseUrlWithId:()=>Vxr,EnvironmentId:()=>b$,EnvironmentUrl:()=>NIe,EnvironmentVariable:()=>aQ,Environments:()=>Jxr,EnvironmentsConfig:()=>Yxr,ErrorDeclaration:()=>Zxr,ErrorDeclarationDiscriminantValue:()=>Vic,ErrorDiscriminationByPropertyStrategy:()=>F1r,ErrorDiscriminationStrategy:()=>N1r,ErrorId:()=>RIe,EscapedString:()=>ECr,ExampleAliasType:()=>MOr,ExampleCodeSample:()=>vwr,ExampleCodeSampleLanguage:()=>Ewr,ExampleCodeSampleSdk:()=>Iwr,ExampleContainer:()=>GOr,ExampleDatetime:()=>LOr,ExampleDatetimeRfc2822:()=>_Or,ExampleEndpointCall:()=>Het,ExampleEndpointErrorResponse:()=>cwr,ExampleEndpointSuccessResponse:()=>lwr,ExampleEnumType:()=>YOr,ExampleError:()=>Xxr,ExampleExtraObjectProperty:()=>XOr,ExampleHeader:()=>DLe,ExampleInlinedRequestBody:()=>Wet,ExampleInlinedRequestBodyExtraProperty:()=>iwr,ExampleInlinedRequestBodyProperty:()=>owr,ExampleKeyValuePair:()=>ZOr,ExampleListContainer:()=>qOr,ExampleLiteralContainer:()=>VOr,ExampleMapContainer:()=>WOr,ExampleNamedType:()=>$Or,ExampleNullableContainer:()=>HOr,ExampleObjectProperty:()=>vtt,ExampleObjectType:()=>Ctt,ExampleObjectTypeWithTypeId:()=>ePr,ExampleOptionalContainer:()=>KOr,ExamplePathParameter:()=>zIe,ExamplePrimitive:()=>Itt,ExampleQueryParameter:()=>qet,ExampleQueryParameterShape:()=>rwr,ExampleRequestBody:()=>awr,ExampleResponse:()=>pwr,ExampleServerSideEvent:()=>uwr,ExampleSetContainer:()=>JOr,ExampleSingleUnionType:()=>tPr,ExampleSingleUnionTypeProperties:()=>rPr,ExampleStyle:()=>j1r,ExampleType:()=>FLt,ExampleTypeReference:()=>uu,ExampleTypeReferenceShape:()=>nPr,ExampleTypeShape:()=>ftt,ExampleUndiscriminatedUnionType:()=>iPr,ExampleUnionBaseProperty:()=>sPr,ExampleUnionType:()=>oPr,ExampleWebSocketMessage:()=>yOr,ExampleWebSocketMessageBody:()=>gOr,ExampleWebSocketSession:()=>bOr,ExampleWebhookCall:()=>_Tr,FeatureId:()=>ELt,FernFilepath:()=>VV,FileDownloadResponse:()=>Yet,FileProperty:()=>wwr,FilePropertyArray:()=>xwr,FilePropertySingle:()=>Swr,FileUploadBodyProperty:()=>Pwr,FileUploadBodyPropertyEncoding:()=>Twr,FileUploadRequest:()=>Zet,FileUploadRequestProperty:()=>Bwr,Filesystem:()=>Y1r,FloatType:()=>dTr,FloatValidationRules:()=>fTr,GenerationMetadata:()=>Q1r,GithubPublish:()=>X1r,GlobalParameter:()=>Ret,GlobalParameterApplyMode:()=>dxr,GlobalParameterId:()=>Bet,GlobalParameterLocation:()=>hxr,GoPublishTarget:()=>_1r,GrpcTransport:()=>jwr,HeaderApiVersionScheme:()=>R1r,HeaderAuthScheme:()=>Hvr,HeaderAuthValues:()=>tSr,HmacAlgorithm:()=>Att,HmacSignatureVerification:()=>fOr,HttpEndpoint:()=>I1r,HttpEndpointSecurityItem:()=>zwr,HttpEndpointSource:()=>Lwr,HttpHeader:()=>rT,HttpMethod:()=>ett,HttpPath:()=>WV,HttpPathPart:()=>Uwr,HttpRequestBody:()=>ntt,HttpRequestBodyReference:()=>rtt,HttpResponse:()=>MIe,HttpResponseBody:()=>r1r,HttpService:()=>w1r,IdempotencyKeyGeneration:()=>M1r,InferredAuthGrantType:()=>eCr,InferredAuthScheme:()=>rCr,InferredAuthSchemeTokenEndpoint:()=>tCr,InferredAuthenticatedRequestHeader:()=>Zvr,InlinedRequestBody:()=>Gwr,InlinedRequestBodyProperty:()=>Xet,InlinedWebSocketMessageBody:()=>IOr,InlinedWebSocketMessageBodyProperty:()=>EOr,InlinedWebhookPayload:()=>qTr,InlinedWebhookPayloadProperty:()=>GTr,IntegerType:()=>hTr,IntegerValidationRules:()=>mTr,IntermediateRepresentation:()=>eoc,InvocationSource:()=>z1r,JsonEncoding:()=>v1r,JsonResponse:()=>itt,JsonResponseBody:()=>Wwr,JsonResponseBodyWithProperty:()=>Hwr,JsonStreamChunk:()=>Jwr,JwksKeySource:()=>JTr,Literal:()=>UV,LongType:()=>ATr,LongValidationRules:()=>gTr,MapType:()=>QOr,MavenPublishTarget:()=>U1r,MultipleBaseUrlsEnvironment:()=>qxr,MultipleBaseUrlsEnvironments:()=>Wxr,MultipleEnvironmentUrlValues:()=>rSr,Name:()=>fet,NameAndWireValue:()=>SIe,NameAndWireValueOrString:()=>fs,NameOrString:()=>Ro,NamedType:()=>cPr,NamedTypeDefault:()=>aPr,NonStreamHttpResponseBody:()=>e1r,NpmPublishTarget:()=>V1r,NugetPublishTarget:()=>G1r,OAuthAccessTokenRequestProperties:()=>lCr,OAuthAccessTokenResponseProperties:()=>bet,OAuthAuthorizationCode:()=>sCr,OAuthClientCredentials:()=>fCr,OAuthConfiguration:()=>mCr,OAuthDeviceCode:()=>dCr,OAuthPkceConfiguration:()=>iCr,OAuthPkceMethod:()=>nCr,OAuthPublicClientId:()=>yet,OAuthRefreshEndpoint:()=>uCr,OAuthRefreshTokenRequestProperties:()=>cCr,OAuthScheme:()=>hCr,OAuthTokenEndpoint:()=>pCr,OAuthValues:()=>nSr,ObjectProperty:()=>aB,ObjectPropertyAccess:()=>TIe,ObjectTypeDeclaration:()=>RTr,OffsetPagination:()=>n1r,Package:()=>Ett,PackageNavigationConfig:()=>OOr,PackagistPublishTarget:()=>q1r,Pagination:()=>s1r,PathPagination:()=>i1r,PathParameter:()=>UH,PathParameterLocation:()=>c1r,PlatformHeaders:()=>kOr,PostmanPublishTarget:()=>W1r,PrimitiveType:()=>dtt,PrimitiveTypeV1:()=>nTr,PrimitiveTypeV2:()=>STr,PropertyPathItem:()=>Aet,ProtoEncoding:()=>C1r,ProtoSource:()=>O1r,ProtoSourceInfo:()=>Mwr,ProtobufFile:()=>$et,ProtobufFileOptions:()=>kwr,ProtobufMethodType:()=>Qwr,ProtobufService:()=>Nwr,ProtobufType:()=>tTr,PublishTarget:()=>LIe,PublishingConfig:()=>Z1r,PypiPublishTarget:()=>H1r,QueryParameter:()=>OIe,ReadmeConfig:()=>ROr,ReadmeCustomSection:()=>BOr,RequestProperty:()=>tT,RequestPropertyValue:()=>$vr,ResolvedNamedType:()=>OTr,ResolvedTypeReference:()=>PTr,ResponseError:()=>u1r,ResponseErrors:()=>l1r,ResponseProperty:()=>tE,RetriesConfiguration:()=>f1r,RetriesDisabledSchema:()=>p1r,RubyGemsPublishTarget:()=>K1r,SafeAndUnsafeString:()=>CLe,SdkConfig:()=>FOr,SdkRequest:()=>g1r,SdkRequestBodyType:()=>d1r,SdkRequestShape:()=>h1r,SdkRequestWrapper:()=>m1r,ServerVariable:()=>ket,ServiceId:()=>p$,ServiceTypeReferenceInfo:()=>NOr,ShapeType:()=>TTr,SingleBaseUrlEnvironment:()=>Hxr,SingleBaseUrlEnvironments:()=>Kxr,SingleUnionType:()=>NLt,SingleUnionTypeProperties:()=>NTr,SingleUnionTypeProperty:()=>FTr,Source:()=>rTr,SourceConfig:()=>jOr,SseStreamChunk:()=>Ywr,StaticKeySource:()=>YTr,StreamParameterResponse:()=>t1r,StreamingResponse:()=>ott,StringType:()=>bTr,StringValidationRules:()=>yTr,Subpackage:()=>zOr,SubpackageId:()=>f$,SupportedSdkLanguage:()=>QIe,TextResponse:()=>stt,TextStreamChunk:()=>Xwr,Transport:()=>utt,Type:()=>QTr,TypeDeclaration:()=>MTr,TypeId:()=>cB,TypeReference:()=>zs,Uint64Type:()=>ITr,Uint64ValidationRules:()=>ETr,UintType:()=>CTr,UintValidationRules:()=>vTr,UndiscriminatedUnionMember:()=>DTr,UndiscriminatedUnionTypeDeclaration:()=>kTr,UnionDiscriminatorContext:()=>jTr,UnionTypeDeclaration:()=>zTr,UriPagination:()=>o1r,UserAgent:()=>DOr,UserDefinedProtobufType:()=>$1r,UserSpecifiedEndpointExample:()=>y1r,UuidType:()=>xTr,V2AuthValues:()=>Fet,V2EndpointLocation:()=>sSr,V2EndpointLocationHttpMethod:()=>oSr,V2EnvironmentValues:()=>Net,V2HttpEndpointCodeSample:()=>cSr,V2HttpEndpointExample:()=>TLt,V2HttpEndpointExamples:()=>dSr,V2HttpEndpointRequest:()=>lSr,V2HttpEndpointResponse:()=>fSr,V2HttpEndpointResponseBody:()=>pSr,V2HttpRequestBodies:()=>b1r,V2HttpResponses:()=>E1r,V2SchemaExample:()=>hLt,V2SchemaExamples:()=>eT,V2ValueExamples:()=>E$,V2WebSocketEndpointLocation:()=>hSr,V2WebSocketMessageExample:()=>gSr,V2WebSocketSessionExample:()=>PLt,V2WebSocketSessionExamples:()=>ASr,V2WebhookExample:()=>OLt,V2WebhookExamples:()=>mSr,VariableDeclaration:()=>LTr,VariableId:()=>att,WebSocketChannel:()=>TOr,WebSocketChannelId:()=>Iet,WebSocketMessage:()=>SOr,WebSocketMessageBody:()=>COr,WebSocketMessageBodyReference:()=>vOr,WebSocketMessageId:()=>btt,WebSocketMessageOrigin:()=>xOr,WebSocketName:()=>wOr,Webhook:()=>mOr,WebhookAlgorithmHeader:()=>sOr,WebhookAlgorithmOption:()=>oOr,WebhookBodyHashAlgorithm:()=>aOr,WebhookBodyHashBinding:()=>lOr,WebhookBodyHashLocation:()=>uOr,WebhookBodyHashQueryParameterLocation:()=>cOr,WebhookGroup:()=>hOr,WebhookGroupId:()=>Eet,WebhookHttpMethod:()=>UTr,WebhookId:()=>vCr,WebhookName:()=>VTr,WebhookNotificationUrlNormalization:()=>pOr,WebhookPayload:()=>HTr,WebhookPayloadBodySort:()=>ZTr,WebhookPayloadComponent:()=>$Tr,WebhookPayloadFormat:()=>htt,WebhookPayloadReference:()=>WTr,WebhookSignatureEncoding:()=>_Ie,WebhookSignatureVerification:()=>ytt,WebhookTimestampConfig:()=>gtt,WebhookTimestampFormat:()=>tOr,WellKnownProtobufType:()=>eTr,WithContentType:()=>GV,WithDocs:()=>ao,WithDocsAndAvailability:()=>DIe,WithJsonExample:()=>g$,WithV2Examples:()=>qy,XmlEncoding:()=>x1r,XmlPropertyEncoding:()=>Yvr,XmlPropertyKind:()=>Jvr,audience:()=>XZi,auth:()=>T$i,commons:()=>D$i,constants:()=>N$i,dynamic:()=>rE,environment:()=>wto,errors:()=>Bto,examples:()=>Xto,generatorExec:()=>Tro,globalParameters:()=>Pro,http:()=>Qno,ir:()=>qoo,proto:()=>Hoo,publish:()=>Joo,types:()=>nso,variables:()=>oso,webhooks:()=>aso,websocket:()=>uso});var $o=h(()=>{"use strict";Noc()});var joc=h(()=>{"use strict";Xr();nnc();$o()});var Wn=h(()=>{"use strict";joc();Xr();$o()});var fD,zoc=h(()=>{"use strict";fD={integer:"integer",long:"long",uint:"uint",uint64:"uint64",float:"float",double:"double",boolean:"boolean",string:"string",datetime:"datetime",datetimeRfc2822:"datetime-rfc-2822",base64:"base64",uuid:"uuid",date:"date",bigint:"bigint",unknown:"unknown"}});function kLe({type:e,_default:t,validation:r,visitor:n}){switch(e){case fD.integer:{let l=r??void 0;return n.primitive({v1:ps.Integer,v2:Ei.integer({default:t??void 0,validation:l!=null?{min:l.min,max:l.max,exclusiveMin:l.exclusiveMin,exclusiveMax:l.exclusiveMax,multipleOf:l.multipleOf}:void 0})})}case fD.double:{let l=r??void 0;return n.primitive({v1:ps.Double,v2:Ei.double({default:t??void 0,validation:l!=null?{min:l.min,max:l.max,exclusiveMin:l.exclusiveMin,exclusiveMax:l.exclusiveMax,multipleOf:l.multipleOf}:void 0})})}case fD.string:{let l=r??void 0;return n.primitive({v1:ps.String,v2:Ei.string({default:t??void 0,validation:l!=null?{format:l.format,pattern:l.pattern,minLength:l.minLength,maxLength:l.maxLength}:void 0})})}case fD.float:return n.primitive({v1:ps.Float,v2:void 0});case fD.long:{let l=r??void 0;return n.primitive({v1:ps.Long,v2:Ei.long({default:t??void 0,validation:l!=null?{min:l.min,max:l.max,exclusiveMin:l.exclusiveMin,exclusiveMax:l.exclusiveMax,multipleOf:l.multipleOf}:void 0})})}case fD.boolean:return n.primitive({v1:ps.Boolean,v2:Ei.boolean({default:t??void 0})});case fD.datetime:return n.primitive({v1:ps.DateTime,v2:void 0});case fD.datetimeRfc2822:return n.primitive({v1:ps.DateTimeRfc2822,v2:Ei.dateTimeRfc2822({})});case fD.date:return n.primitive({v1:ps.Date,v2:void 0});case fD.uuid:return n.primitive({v1:ps.Uuid,v2:void 0});case fD.base64:return n.primitive({v1:ps.Base64,v2:void 0});case fD.bigint:return n.primitive({v1:ps.BigInteger,v2:Ei.bigInteger({default:t??void 0})});case fD.uint:return n.primitive({v1:ps.Uint,v2:void 0});case fD.uint64:return n.primitive({v1:ps.Uint64,v2:void 0});case fD.unknown:return n.unknown()}let i=e.match(fQ.MAP);if(i?.[1]!=null&&i[2]!=null)return n.map({keyType:i[1],valueType:i[2]});let o=e.match(fQ.LIST);if(o?.[1]!=null)return n.list(o[1]);let s=e.match(fQ.SET);if(s?.[1]!=null)return n.set(s[1]);let a=e.match(fQ.OPTIONAL);if(a?.[1]!=null)return n.optional(a[1]);let c=e.match(fQ.NULLABLE);if(c?.[1]!=null)return n.nullable(c[1]);let u=e.match(fQ.LITERAL);if(u?.[1]!=null)return n.literal(eE.string(u[1]));if(u?.[2]!=null){let l=u[2];switch(l){case"false":return n.literal(eE.boolean(!1));case"true":return n.literal(eE.boolean(!0));default:throw new Error(`Unsupported literal value: ${l}`)}}return n.named(e)}var fQ,xtt=h(()=>{"use strict";Wn();zoc();fQ={MAP:/^map<\s*([^,]*)\s*,\s*(.*)\s*>$/,LIST:/^list<\s*(.*)\s*>$/,SET:/^set<\s*(.*)\s*>$/,OPTIONAL:/^optional<\s*(.*)\s*>$/,NULLABLE:/^nullable<\s*(.*)\s*>$/,LITERAL:/^literal<\s*(?:"(.*)"|(true|false))\s*>$/}});function HV(e){if(e===Qoc)return{isOptional:!1};if(e.match(fQ.OPTIONAL)?.[1]===Qoc)return{isOptional:!0}}var Qoc,lso=h(()=>{"use strict";xtt();Qoc="bytes"});function zLt(e){let t=typeof e=="string"?e:typeof e.body=="string"?e.body:void 0;if(t!=null)return HV(t)}var Moc=h(()=>{"use strict";lso()});function FLe(e){if(typeof e=="number")return Number.isInteger(e)?{statusCode:e,isWildcard:!1}:void 0;switch(e.toUpperCase()){case"4XX":return{statusCode:400,isWildcard:!0};case"5XX":return{statusCode:500,isWildcard:!0};default:{let t=Number(e);return Number.isInteger(t)&&e.trim()!==""?{statusCode:t,isWildcard:!1}:void 0}}}var Loc=h(()=>{"use strict"});function pso({input:e,typeName:t}){for(let r of e.arguments)if(typeof r=="string"){if(r===t)return!0}else if(pso({input:r,typeName:t}))return!0;return!1}var _oc=h(()=>{"use strict"});function Uoc(e){return pso({input:e,typeName:"file"})}var Voc=h(()=>{"use strict";_oc()});function Goc(e){let t=0,r=0;function n(){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)return;let o="";for(;t<e.length&&e[t]!=="<"&&e[t]!==","&&e[t]!==">";)o+=e[t++];if(o.trim()){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t<e.length&&e[t]==="<"){if(t++,r++,r>128)throw new Error("Internal error; Exceeded maximum recursion depth while parsing generics.");let s={name:o.trim(),arguments:[]};for(;t<e.length&&e[t]!==">";){for(;t<e.length&&/[\s,]/.test(e[t]);)t++;if(t<e.length&&e[t]!==">"){let a=n();a&&s.arguments.push(a)}}if(t<e.length&&e[t]===">")t++,r--;else throw new Error("Malformed input: missing closing '>' for generic arguments.");return s}else return o.trim()}}let i=n();if(typeof i=="object")return i}var qoc=h(()=>{"use strict"});function Woc(e){return e.match(fQ.LIST)?.[1]===fso}function dQ(e){if(e===fso)return{isOptional:!1,isArray:!1};let t=e.match(fQ.OPTIONAL);if(t?.[1]!==void 0){if(t[1]===fso)return{isOptional:!0,isArray:!1};if(Woc(t[1]))return{isOptional:!0,isArray:!0}}if(Woc(e))return{isOptional:!1,isArray:!0}}var fso,dso=h(()=>{"use strict";xtt();fso="file"});function ird(e){return typeof e=="string"?!1:Jp.parse(e["content-type"])?.isMultiPartFormData()??!1?!0:e.body==null?!1:!!(nA(e.body)&&Object.values(e.body.properties??[]).some(srd))}function NLe(e){if(!(!ird(e)||e.body==null)&&e.name!=null&&e.body!=null&&nA(e.body))return ord(e.name,e.body)}function ord(e,t){let r=Object.entries(t.properties??[]).reduce((n,[i,o])=>{let s=typeof o!="string"?o.docs:void 0,a=typeof o!="string"?o["content-type"]:void 0,c=typeof o!="string"?o.style:void 0,u=dQ(typeof o=="string"?o:o.type);return u!=null?n.push({isFile:!0,key:i,docs:s,isOptional:u.isOptional,isArray:u.isArray,contentType:a,style:c}):n.push({isFile:!1,key:i,propertyType:o,docs:s,contentType:a,style:c}),n},[]);return t["extra-properties"],{name:e,extends:t.extends,properties:r}}function srd(e){let t=typeof e=="string"?e:e.type;if(t==="file")return!0;if(!t.includes("file"))return!1;let r=Goc(t);return r==null?!1:Uoc(r)}var Hoc=h(()=>{"use strict";Ct();Voc();qoc();jXi();dso()});function jLe(e){if(e===Koc)return{isOptional:!1};if(e.match(fQ.OPTIONAL)?.[1]===Koc)return{isOptional:!0}}var Koc,Joc=h(()=>{"use strict";xtt();Koc="text"});function yC({type:e,_default:t,validation:r,visitor:n}){return kLe({type:e,_default:t,validation:r,visitor:{primitive:n.primitive,map:({keyType:i,valueType:o})=>n.map({keyType:yC({type:i,_default:void 0,validation:void 0,visitor:n}),valueType:yC({type:o,_default:void 0,validation:void 0,visitor:n})}),list:i=>n.list(yC({type:i,_default:void 0,validation:void 0,visitor:n})),set:i=>n.set(yC({type:i,_default:void 0,validation:void 0,visitor:n})),optional:i=>n.optional(yC({type:i,_default:t,validation:r,visitor:n})),nullable:i=>n.nullable(yC({type:i,_default:t,validation:r,visitor:n})),literal:n.literal,named:n.named,unknown:n.unknown}})}var Yoc=h(()=>{"use strict";xtt()});function mso(e,t){if(ard(e))return t.sdk(e);if(crd(e))return t.language(e);Ee(e)}function ard(e){return e.sdk!=null}function crd(e){return e.language!=null}var Xoc=h(()=>{"use strict";Ct()});function Zoc(e){return e["response-stream"]!=null&&(typeof e["response-stream"]=="string"||e["response-stream"].format==null||e["response-stream"].format==="json")}var $oc=h(()=>{"use strict"});function esc(e){return e["response-stream"]!=null&&typeof e["response-stream"]!="string"&&e["response-stream"].format==="sse"}var tsc=h(()=>{"use strict"});function zLe(e,t,r){return urd(e,t)?r.stream(t):lrd(e,t)?r.events(t):r.body(t)}function urd(e,t){return t.stream!==void 0&&Zoc(e)}function lrd(e,t){return t.stream!==void 0&&esc(e)}var rsc=h(()=>{"use strict";$oc();tsc()});function jfe(e,t){if(nsc(e))return t.single(e);if(isc(e))return t.any(e);if(Stt(e))return t.endpointSecurity(e);Ee(e)}function nsc(e){return typeof e=="string"||e.scheme!=null}function isc(e){let[t,...r]=Object.keys(e);return t==="any"&&r.length===0}function Stt(e){let[t,...r]=Object.keys(e);return t==="endpoint-security"&&r.length===0}var osc=h(()=>{"use strict";Ct()});function zfe(e,t){if(ssc(e))return t.header(e);switch(e.scheme){case"basic":return t.basic(e);case"bearer":return"get-token"in e?t.inferredBearer(e):t.tokenBearer(e);case"oauth":return t.oauth(e);default:Ee(e)}}function ssc(e){return e.header!=null}var asc=h(()=>{"use strict";Ct()});function v$(e,t){if(csc(e))return t.singleBaseUrl(e);if(dD(e))return t.multipleBaseUrls(e);Ee(e)}function csc(e){return typeof e=="string"||"url"in e}function dD(e){return typeof e!="string"&&"urls"in e}var usc=h(()=>{"use strict";Ct()});function Qfe(e){return typeof e=="string"?e.startsWith("$"):"variable"in e}var lsc=h(()=>{"use strict"});function bC(e,t){if(UIe(e))return t.alias(e);if(KV(e))return t.discriminatedUnion(e);if(Of(e))return t.object(e);if(wtt(e))return t.undiscriminatedUnion(e);if(VH(e))return t.enum(e);Ee(e)}function UIe(e){return typeof e=="string"||e.type!=null}function Of(e){return e.extends!=null||e.properties!=null}function KV(e){return e.union!=null&&e.discriminated==null}function wtt(e){let t=e;return t.union!=null&&t.discriminated!=null}function VH(e){return e.enum!=null}var psc=h(()=>{"use strict";Ct()});var ho=h(()=>{"use strict";J7a();X7a();tHa();rHa();nHa();jXi();iHa();oHa();Moc();Loc();Hoc();lso();dso();Joc();Yoc();Xoc();rsc();osc();asc();usc();lsc();psc();xtt()});var qH,yso=h(()=>{"use strict";qH=class{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;constructor({generatorsConfiguration:t,workspaceName:r,cliVersion:n,absoluteFilePath:i,changelog:o}){this.generatorsConfiguration=t,this.workspaceName=r,this.cliVersion=n,this.absoluteFilePath=i,this.changelog=o}}});var bsc=h(()=>{"use strict"});var Esc=h(()=>{"use strict"});var NA,ly,VIe,Isc,Ttt,mv,QLe,rd,pPr,zu,x$,WH,vd,vsc,EC,pI,Ott,nT,fPr,Csc,GIe,xsc,Ssc,wsc,Tsc,Osc,mD,MLt,dPr=h(()=>{"use strict";NA="fern",ly="definition",VIe="openapi",Isc="changelog",Ttt="asyncapi",mv="api.yml",QLe="__package__",rd=`${QLe}.yml`,pPr="dependencies.yml",zu="generators.yml",x$="generators.yaml",WH="generators.legacy.yml",vd="sdk-config.yml",vsc="dependencies.yml",EC="docs.yml",pI="fern.config.json",Ott="api",nT=".fernignore",fPr="snippet.json",Csc="snippet-templates.json",GIe="default-group",xsc="spec-origin",Ssc="async-api",wsc="openapi",Tsc="openapi-overrides",Osc="api-settings",mD="apis",MLt="local"});function Or(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let p=0;p<l.length;p++){let d=l[p];d in a||(a[d]=u[d].bind(a))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var c;let u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function hv(e){return e&&Object.assign(LLt,e),LLt}var bso,mPr,HH,qIe,LLt,Ptt=h(()=>{"use strict";bso=Object.freeze({status:"aborted"});mPr=Symbol("zod_brand"),HH=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},qIe=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},LLt={}});var Oi={};te(Oi,{BIGINT_FORMAT_RANGES:()=>Pso,Class:()=>Iso,NUMBER_FORMAT_RANGES:()=>Oso,aborted:()=>JIe,allowsEval:()=>xso,assert:()=>vrd,assertEqual:()=>yrd,assertIs:()=>Erd,assertNever:()=>Ird,assertNotEqual:()=>brd,assignProp:()=>HIe,base64ToUint8Array:()=>Bsc,base64urlToUint8Array:()=>Mrd,cached:()=>Rtt,captureStackTrace:()=>gPr,cleanEnum:()=>Qrd,cleanRegex:()=>VLt,clone:()=>F2,cloneDef:()=>xrd,createTransparentProxy:()=>Brd,defineLazy:()=>$p,esc:()=>hPr,escapeRegex:()=>YV,extend:()=>krd,finalizeIssue:()=>mQ,floatSafeRemainder:()=>vso,getElementAtPath:()=>Srd,getEnumValues:()=>ULt,getLengthableOrigin:()=>WLt,getParsedType:()=>Prd,getSizableOrigin:()=>qLt,hexToUint8Array:()=>_rd,isObject:()=>MLe,isPlainObject:()=>KIe,issue:()=>Dtt,joinValues:()=>ln,jsonStringifyReplacer:()=>Btt,merge:()=>Nrd,mergeDefs:()=>Mfe,normalizeParams:()=>Li,nullish:()=>WIe,numKeys:()=>Ord,objectClone:()=>Crd,omit:()=>Drd,optionalKeys:()=>Tso,parsedType:()=>xi,partial:()=>jrd,pick:()=>Rrd,prefixIssues:()=>Q3,primitiveTypes:()=>wso,promiseAllObject:()=>wrd,propertyKeyTypes:()=>GLt,randomString:()=>Trd,required:()=>zrd,safeExtend:()=>Frd,shallowClone:()=>Sso,slugify:()=>Cso,stringifyPrimitive:()=>hi,uint8ArrayToBase64:()=>Rsc,uint8ArrayToBase64url:()=>Lrd,uint8ArrayToHex:()=>Urd,unwrapMessage:()=>_Lt});function yrd(e){return e}function brd(e){return e}function Erd(e){}function Ird(e){throw new Error("Unexpected value in exhaustive check")}function vrd(e){}function ULt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function ln(e,t="|"){return e.map(r=>hi(r)).join(t)}function Btt(e,t){return typeof t=="bigint"?t.toString():t}function Rtt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function WIe(e){return e==null}function VLt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function vso(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let o=r>i?r:i,s=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return s%a/10**o}function $p(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Psc)return n===void 0&&(n=Psc,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Crd(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function HIe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Mfe(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function xrd(e){return Mfe(e._zod.def)}function Srd(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function wrd(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let i={};for(let o=0;o<t.length;o++)i[t[o]]=n[o];return i})}function Trd(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function hPr(e){return JSON.stringify(e)}function Cso(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function MLe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function KIe(e){if(MLe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(MLe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sso(e){return KIe(e)?{...e}:Array.isArray(e)?[...e]:e}function Ord(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function YV(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F2(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Li(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Brd(e){let t;return new Proxy({},{get(r,n,i){return t??(t=e()),Reflect.get(t,n,i)},set(r,n,i,o){return t??(t=e()),Reflect.set(t,n,i,o)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,i){return t??(t=e()),Reflect.defineProperty(t,n,i)}})}function hi(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Tso(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Rrd(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Mfe(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return HIe(this,"shape",s),s},checks:[]});return F2(e,o)}function Drd(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Mfe(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return HIe(this,"shape",s),s},checks:[]});return F2(e,o)}function krd(e,t){if(!KIe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=Mfe(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return HIe(this,"shape",o),o}});return F2(e,i)}function Frd(e,t){if(!KIe(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Mfe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return HIe(this,"shape",n),n}});return F2(e,r)}function Nrd(e,t){let r=Mfe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return HIe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return F2(e,r)}function jrd(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Mfe(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return HIe(this,"shape",c),c},checks:[]});return F2(t,s)}function zrd(e,t,r){let n=Mfe(t._zod.def,{get shape(){let i=t._zod.def.shape,o={...i};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(let s in i)o[s]=new e({type:"nonoptional",innerType:i[s]});return HIe(this,"shape",o),o}});return F2(t,n)}function JIe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Q3(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function _Lt(e){return typeof e=="string"?e:e?.message}function mQ(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=_Lt(e.inst?._zod.def?.error?.(e))??_Lt(t?.error?.(e))??_Lt(r.customError?.(e))??_Lt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function qLt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function WLt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xi(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Dtt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Qrd(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Bsc(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Rsc(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Mrd(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Bsc(t+r)}function Lrd(e){return Rsc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _rd(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Urd(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Psc,gPr,xso,Prd,GLt,wso,Oso,Pso,Iso,$a=h(()=>{"use strict";Psc=Symbol("evaluating");gPr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};xso=Rtt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});Prd=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},GLt=new Set(["string","number","symbol"]),wso=new Set(["string","number","bigint","boolean","symbol","undefined"]);Oso={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pso={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Iso=class{constructor(...t){}}});function KLt(e,t=r=>r.message){let r={},n=[];for(let i of e.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}}function JLt(e,t=r=>r.message){let r={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return n(e),r}function Bso(e,t=r=>r.message){let r={errors:[]},n=(i,o=[])=>{var s,a;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>n({issues:u},c.path));else if(c.code==="invalid_key")n({issues:c.issues},c.path);else if(c.code==="invalid_element")n({issues:c.issues},c.path);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,p=0;for(;p<u.length;){let d=u[p],f=p===u.length-1;typeof d=="string"?(l.properties??(l.properties={}),(s=l.properties)[d]??(s[d]={errors:[]}),l=l.properties[d]):(l.items??(l.items=[]),(a=l.items)[d]??(a[d]={errors:[]}),l=l.items[d]),f&&l.errors.push(t(c)),p++}}};return n(e),r}function ksc(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function Rso(e){let t=[],r=[...e.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${ksc(n.path)}`);return t.join(`
100
+ `)),{ok:!0,value:t}):n}}var u$=h(()=>{"use strict"});function zvr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var kZi=h(()=>{"use strict"});var aet,FZi=h(()=>{"use strict";kZi();aet=class extends Error{errors;constructor(t){super(t.map(zvr).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});var cet,NZi=h(()=>{"use strict";kZi();cet=class extends Error{errors;constructor(t){super(t.map(zvr).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});function Cm(e){return{nullable:()=>Ktd(e),optional:()=>jZi(e),optionalNullable:()=>Jtd(e),transform:t=>zZi(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new cet(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new aet(n.errors)}}}function Ktd(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Iu.NULLABLE};return{...t,...Cm(t)}}function jZi(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Iu.OPTIONAL};return{...t,...Cm(t)}}function Jtd(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>Iu.OPTIONAL_NULLABLE};return{...t,...Cm(t)}}function zZi(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...Cm(r)}}var cnc=h(()=>{"use strict";vw();FZi();NZi()});var sQ=h(()=>{"use strict";cnc();FZi();NZi()});function unc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:vm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:vm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>Iu.BIGINT};return{...Cw(e),...Cm(e)}}var lnc=h(()=>{"use strict";vw();k2();u$();sQ()});var pnc=h(()=>{"use strict";lnc()});function fnc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:vm(t,"string")}]}:Ytd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:vm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:vm(t,"Date object")}]},getType:()=>Iu.DATE};return{...Cw(e),...Cm(e)}}var Ytd,dnc=h(()=>{"use strict";vw();k2();u$();sQ();Ytd=/^([+-]?\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)?)?)?)?$/});var mnc=h(()=>{"use strict";dnc()});function $1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...Cw(r),...Cm(r)}}}var l$=h(()=>{"use strict";sQ();u$()});function aLt(e){let t=new Set(e);return $1(Iu.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:vm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:vm(n,"enum")}]}:{ok:!0,value:n})()}function hnc(e){return aLt(e).transform({transform:t=>t,untransform:t=>t})}var gnc=h(()=>{"use strict";vw();l$();k2()});var QZi=h(()=>{"use strict";gnc()});function Anc(e){let t=MZi(e);return{...t,...Cm(t)}}function MZi(e){return{parse:(t,r)=>uet(e).parse(t,r),json:(t,r)=>uet(e).json(t,r),getType:()=>uet(e).getType()}}function uet(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var LZi=h(()=>{"use strict";sQ()});function _Zi(e){return Object.entries(e)}var ync=h(()=>{"use strict"});function cLt(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var UZi=h(()=>{"use strict"});function Ofe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var uLt=h(()=>{"use strict"});function lLt(e){return Object.keys(e)}var VZi=h(()=>{"use strict"});function bnc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var Enc=h(()=>{"use strict"});function MH(e){return{withParsedProperties:t=>GZi(e,t)}}function GZi(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(Xtd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!Ofe(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:vm(n,"object")}]};let o=new Set(Object.keys(t)),s=cLt(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...Cm(r),...MH(r)}}var Xtd,Inc=h(()=>{"use strict";UZi();k2();uLt();sQ();Xtd=Object.prototype.hasOwnProperty});var pLt=h(()=>{"use strict";Inc()});function vnc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Pfe(e){return e.isProperty}var qZi=h(()=>{"use strict"});function Qvr(e){let t;function r(){if(t==null){t={};for(let[d,f]of _Zi(e)){let m=Pfe(f)?f.rawKey:d,g=Pfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of _Zi(e)){let m=Pfe(f)?f.rawKey:d,g=Pfe(f)?f.valueSchema:f;$td(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function u(){return o==null&&a(),o}function l(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>Pfe(f)?f.rawKey:d),_getParsedProperties:()=>lLt(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return Cnc({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return Cnc({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:g=>{let A=e[g];if(A!=null)return Pfe(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>Iu.OBJECT};return{...Cw(p),...Cm(p),...MH(p),...vLe(p)}}function Cnc({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Ofe(e))return{ok:!1,errors:[{path:s,message:vm(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!Ztd.call(e,l))continue;let p=e[l],d=n(l);if(d!=null){a>0&&r.has(l)&&a--;let f=d.transform(p);f.ok?u[d.transformedKey]=f.value:(u[l]=p,c.push(...f.errors))}else switch(i){case"fail":c.push({path:[...s,l],message:`Unexpected key "${l}"`});break;case"strip":break;case"passthrough":u[l]=p;break}}if(a>0)for(let l of t)l in e||c.push({path:s,message:`Missing required key "${l}"`});return c.length===0||o?{ok:!0,value:u}:{ok:!1,errors:c}}function vLe(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>xnc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>xnc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Iu.OBJECT};return{...r,...Cm(r),...MH(r),...vLe(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))t.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))r.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},getType:()=>Iu.OBJECT};return{...n,...Cm(n),...MH(n),...vLe(n)}}}}function xnc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Ofe(t))return{ok:!1,errors:[{path:i,message:vm(t,"object")}]};let o=new Set(e),[s,a]=bnc(lLt(t),l=>o.has(l)),c=r(cLt(t,a)),u=n(cLt(t,s));return c.ok&&u.ok?{ok:!0,value:{...c.value,...u.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function $td(e){return!erd(e)}function erd(e){switch(e.getType()){case Iu.ANY:case Iu.UNKNOWN:case Iu.OPTIONAL:case Iu.OPTIONAL_NULLABLE:return!0;default:return!1}}var Ztd,WZi=h(()=>{"use strict";vw();ync();UZi();k2();uLt();VZi();u$();Enc();pLt();sQ();qZi();Ztd=Object.prototype.hasOwnProperty});function Snc(e){return Qvr(e)}var wnc=h(()=>{"use strict";WZi()});var HZi=h(()=>{"use strict";WZi();wnc();qZi()});function Tnc(e){let t={...MZi(e),_getRawProperties:()=>uet(e)._getRawProperties(),_getParsedProperties:()=>uet(e)._getParsedProperties()};return{...t,...Cm(t),...MH(t),...vLe(t)}}var Onc=h(()=>{"use strict";HZi();pLt();sQ();LZi()});var Pnc=h(()=>{"use strict";LZi();Onc()});function Mvr(e){let t={parse:(r,n)=>Bnc(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>Bnc(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>Iu.LIST};return{...Cw(t),...Cm(t)}}function Bnc(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:vm(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);o.ok?r.push(o.value):n.push(...o.errors)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var Rnc=h(()=>{"use strict";vw();k2();u$();sQ()});var KZi=h(()=>{"use strict";Rnc()});function Dnc(e){return $1(Iu.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:vm(r,`${e.toString()}`)}]})()}var knc=h(()=>{"use strict";vw();l$();k2()});function Fnc(e){return $1(Iu.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:vm(r,`"${e}"`)}]})()}var Nnc=h(()=>{"use strict";vw();l$();k2()});var jnc=h(()=>{"use strict";knc();Nnc()});var znc,Qnc=h(()=>{"use strict";vw();l$();znc=$1(Iu.ANY,e=>({ok:!0,value:e}))});var Mnc,Lnc=h(()=>{"use strict";vw();l$();k2();Mnc=$1(Iu.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:vm(e,"boolean")}]})});var _nc,Unc=h(()=>{"use strict";vw();l$();_nc=$1(Iu.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var Vnc,Gnc=h(()=>{"use strict";vw();l$();k2();Vnc=$1(Iu.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:vm(e,"number")}]})});var qnc,Wnc=h(()=>{"use strict";vw();l$();k2();qnc=$1(Iu.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:vm(e,"string")}]})});var Hnc,Knc=h(()=>{"use strict";vw();l$();Hnc=$1(Iu.UNKNOWN,e=>({ok:!0,value:e}))});var Jnc=h(()=>{"use strict";Qnc();Lnc();Unc();Gnc();Wnc();Knc()});function Ync(e,t){let r={parse:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Iu.RECORD};return{...Cw(r),...Cm(r)}}function Xnc(e,t){let r={parse:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Lvr({value:n,isKeyNumeric:e.getType()===Iu.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Iu.RECORD};return{...Cw(r),...Cm(r)}}function Lvr({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Ofe(e))return{ok:!1,errors:[{path:i,message:vm(e,"object")}]};let o={},s=[];for(let a in e){if(!trd.call(e,a))continue;let c=e[a];if(c===void 0)continue;let u=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(u=d)}let l=r(u),p=n(c,u);l.ok&&p.ok?o[l.value]=p.value:(l.ok||s.push(...l.errors),p.ok||s.push(...p.errors))}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var trd,Znc=h(()=>{"use strict";vw();k2();uLt();u$();sQ();trd=Object.prototype.hasOwnProperty});var $nc=h(()=>{"use strict";Znc()});function eic(e){let t=Mvr(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:vm(n,"Set")}]},getType:()=>Iu.SET};return{...Cw(r),...Cm(r)}}var tic=h(()=>{"use strict";vw();k2();u$();KZi();sQ()});var ric=h(()=>{"use strict";tic()});function iic(e){let t={parse:(r,n)=>nic((i,o)=>i.parse(r,o),e,n),json:(r,n)=>nic((i,o)=>i.json(r,o),e,n),getType:()=>Iu.UNDISCRIMINATED_UNION};return{...Cw(t),...Cm(t)}}function nic(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var oic=h(()=>{"use strict";vw();u$();sQ()});var sic=h(()=>{"use strict";oic()});function aic(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var cic=h(()=>{"use strict"});function lic(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=aLt(lLt(t)),o={parse:(s,a)=>uic({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>uic({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>Iu.UNION};return{...Cw(o),...Cm(o),...MH(o)}}function uic({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Ofe(e))return{ok:!1,errors:[{path:a,message:vm(e,"object")}]};let c=e[t],u={};for(let f in e)rrd.call(e,f)&&f!==t&&(u[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let l=n(c);if(!l.ok)return{ok:!1,errors:l.errors};let p=i(l.value);if(p==null)return o?{ok:!0,value:{[r]:l.value,...u}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(u,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var rrd,pic=h(()=>{"use strict";vw();k2();uLt();VZi();u$();QZi();pLt();sQ();rrd=Object.prototype.hasOwnProperty});var fic=h(()=>{"use strict";cic();pic()});var dic=h(()=>{"use strict";pnc();mnc();QZi();Pnc();KZi();jnc();HZi();pLt();Jnc();$nc();sQ();ric();sic();fic()});var P={};te(P,{JsonError:()=>aet,ParseError:()=>cet,any:()=>znc,bigint:()=>unc,boolean:()=>Mnc,booleanLiteral:()=>Dnc,date:()=>fnc,discriminant:()=>aic,enum_:()=>aLt,forwardCompatibleEnum_:()=>hnc,getObjectLikeUtils:()=>MH,getObjectUtils:()=>vLe,getSchemaUtils:()=>Cm,isProperty:()=>Pfe,lazy:()=>Anc,lazyObject:()=>Tnc,list:()=>Mvr,never:()=>_nc,number:()=>Vnc,object:()=>Qvr,objectWithoutOptionalProperties:()=>Snc,optional:()=>jZi,partialRecord:()=>Xnc,property:()=>vnc,record:()=>Ync,set:()=>eic,string:()=>qnc,stringLiteral:()=>Fnc,transform:()=>zZi,undiscriminatedUnion:()=>iic,union:()=>lic,unknown:()=>Hnc,withParsedProperties:()=>GZi});var mic=h(()=>{"use strict";dic()});var hic=h(()=>{"use strict"});var Me=h(()=>{"use strict";inc();onc();snc();mic();hic()});var _vr,JZi=h(()=>{"use strict";Me();_vr=P.string()});var pet,Uvr=h(()=>{"use strict";Me();pet=P.string()});var YZi=h(()=>{"use strict";JZi();Uvr()});var XZi={};te(XZi,{AudienceDefinition:()=>_vr,AudienceReference:()=>pet});var gic=h(()=>{"use strict";YZi()});var ao,fp=h(()=>{"use strict";Me();ao=P.objectWithoutOptionalProperties({docs:P.string().optional()})});var CLe,ZZi=h(()=>{"use strict";Me();CLe=P.objectWithoutOptionalProperties({unsafeName:P.string(),safeName:P.string()})});var fet,Vvr=h(()=>{"use strict";Me();ZZi();fet=P.objectWithoutOptionalProperties({originalName:P.string(),camelCase:CLe,pascalCase:CLe,snakeCase:CLe,screamingSnakeCase:CLe})});var Ro,Mf=h(()=>{"use strict";Me();Vvr();Ro=P.undiscriminatedUnion([P.string(),fet])});var det,Gvr=h(()=>{"use strict";Me();det=P.string()});var _V,xLe=h(()=>{"use strict";Me();fp();Gvr();_V=P.objectWithoutOptionalProperties({key:det,playgroundDocs:P.string().optional()}).extend(ao)});var aQ,SLe=h(()=>{"use strict";Me();aQ=P.string()});var qvr,$Zi=h(()=>{"use strict";Me();Mf();xLe();SLe();qvr=P.objectWithoutOptionalProperties({username:Ro,usernameEnvVar:aQ.optional(),usernameOmit:P.boolean().optional(),usernamePlaceholder:P.string().optional(),password:Ro,passwordEnvVar:aQ.optional(),passwordOmit:P.boolean().optional(),passwordPlaceholder:P.string().optional()}).extend(_V)});var Wvr,e$i=h(()=>{"use strict";Me();Mf();xLe();SLe();Wvr=P.objectWithoutOptionalProperties({token:Ro,tokenEnvVar:aQ.optional(),tokenPlaceholder:P.string().optional()}).extend(_V)});var SIe,fLt=h(()=>{"use strict";Me();Mf();SIe=P.objectWithoutOptionalProperties({wireValue:P.string(),name:Ro})});var fs,Id=h(()=>{"use strict";Me();fLt();fs=P.undiscriminatedUnion([P.string(),SIe])});var Hvr,t$i=h(()=>{"use strict";Me();$o();Id();xLe();SLe();Hvr=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),prefix:P.string().optional(),headerEnvVar:aQ.optional(),headerPlaceholder:P.string().optional()}).extend(_V)});var Bfe,dLt=h(()=>{"use strict";Me();Bfe=P.string()});var p$,met=h(()=>{"use strict";Me();p$=P.string()});var f$,het=h(()=>{"use strict";Me();f$=P.string()});var wIe,mLt=h(()=>{"use strict";Me();dLt();met();het();wIe=P.objectWithoutOptionalProperties({endpointId:Bfe,serviceId:p$,subpackageId:f$.optional()})});var Kvr,r$i=h(()=>{"use strict";Me();Kvr=P.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED","ALPHA","BETA","PREVIEW","LEGACY"])});var d$,get=h(()=>{"use strict";Me();r$i();d$=P.objectWithoutOptionalProperties({status:Kvr,message:P.string().optional()})});var Wx,LH=h(()=>{"use strict";Me();get();fp();Wx=P.objectWithoutOptionalProperties({availability:d$.optional()}).extend(ao)});var hLt,n$i=h(()=>{"use strict";Me();hLt=P.unknown()});var eT,m$=h(()=>{"use strict";Me();n$i();eT=P.objectWithoutOptionalProperties({userSpecifiedExamples:P.record(P.string(),hLt),autogeneratedExamples:P.record(P.string(),hLt)})});var TIe,gLt=h(()=>{"use strict";Me();TIe=P.enum_(["READ_ONLY","WRITE_ONLY"])});var Jvr,i$i=h(()=>{"use strict";Me();Jvr=P.enum_(["ATTRIBUTE","TEXT","ELEMENT"])});var Yvr,o$i=h(()=>{"use strict";Me();i$i();Yvr=P.objectWithoutOptionalProperties({kind:Jvr,name:P.string().optional(),wrapped:P.boolean().optional(),listSeparator:P.string().optional()})});var aB,Rfe=h(()=>{"use strict";Me();$o();LH();Id();m$();gLt();o$i();aB=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),propertyAccess:TIe.optional(),defaultValue:P.unknown().optional(),v2Examples:eT.optional(),xml:Yvr.optional()}).extend(Wx)});var Aet,Xvr=h(()=>{"use strict";Me();$o();Mf();Aet=P.objectWithoutOptionalProperties({name:Ro,type:P.lazy(()=>zs)})});var tE,h$=h(()=>{"use strict";Me();Rfe();Xvr();tE=P.objectWithoutOptionalProperties({propertyPath:P.list(Aet).optional(),property:aB})});var Zvr,s$i=h(()=>{"use strict";Me();h$();Zvr=P.objectWithoutOptionalProperties({responseProperty:tE,headerName:P.string(),valuePrefix:P.string().optional()})});var UV,wLe=h(()=>{"use strict";Xr();Me();UV=P.union("type",{string:P.object({string:P.string()}),boolean:P.object({boolean:P.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return eE.string(e.string);case"boolean":return eE.boolean(e.boolean);default:return e}},untransform:({_visit:e,...t})=>t})});var OIe,ALt=h(()=>{"use strict";Me();$o();LH();Id();m$();wLe();OIe=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),allowMultiple:P.boolean(),clientDefault:UV.optional(),defaultValue:P.unknown().optional(),v2Examples:eT.optional(),explode:P.boolean().optional()}).extend(Wx)});var $vr,a$i=h(()=>{"use strict";Xr();Me();Rfe();ALt();$vr=P.union("type",{query:OIe,body:aB}).transform({transform:e=>{switch(e.type){case"query":return iB.query(e);case"body":return iB.body(e);default:return e}},untransform:({_visit:e,...t})=>t})});var tT,PIe=h(()=>{"use strict";Me();Xvr();a$i();tT=P.objectWithoutOptionalProperties({propertyPath:P.list(Aet).optional(),property:$vr})});var eCr,c$i=h(()=>{"use strict";Me();PIe();eCr=P.objectWithoutOptionalProperties({requestProperty:tT,value:P.string()})});var tCr,u$i=h(()=>{"use strict";Me();mLt();h$();s$i();c$i();tCr=P.objectWithoutOptionalProperties({endpoint:wIe,expiryProperty:tE.optional(),authenticatedRequestHeaders:P.list(Zvr),grantType:eCr.optional()})});var rCr,l$i=h(()=>{"use strict";Me();xLe();u$i();rCr=P.objectWithoutOptionalProperties({tokenEndpoint:tCr}).extend(_V)});var nCr,p$i=h(()=>{"use strict";Me();nCr=P.enum_(["S256"])});var iCr,f$i=h(()=>{"use strict";Me();p$i();iCr=P.objectWithoutOptionalProperties({method:nCr})});var yet,oCr=h(()=>{"use strict";Xr();Me();SLe();yet=P.union("type",{literal:P.object({value:P.string()}),environmentVariable:P.object({value:aQ})}).transform({transform:e=>{switch(e.type){case"literal":return RH.literal(e.value);case"environmentVariable":return RH.environmentVariable(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var sCr,d$i=h(()=>{"use strict";Me();f$i();oCr();sCr=P.objectWithoutOptionalProperties({clientId:yet,authorizationUrl:P.string(),tokenUrl:P.string(),refreshUrl:P.string().optional(),redirectUri:P.string().optional(),redirectUriBackupPorts:P.list(P.number()).optional(),successRedirectUrl:P.string().optional(),errorRedirectUrl:P.string().optional(),scopes:P.list(P.string()).optional(),pkce:iCr,authorizationParameters:P.record(P.string(),P.string()).optional(),tokenParameters:P.record(P.string(),P.string()).optional(),refreshParameters:P.record(P.string(),P.string()).optional(),tokenHeader:P.string().optional(),tokenPrefix:P.string().optional()})});var bet,aCr=h(()=>{"use strict";Me();h$();bet=P.objectWithoutOptionalProperties({accessToken:tE,expiresIn:tE.optional(),refreshToken:tE.optional()})});var cCr,m$i=h(()=>{"use strict";Me();PIe();cCr=P.objectWithoutOptionalProperties({refreshToken:tT})});var uCr,h$i=h(()=>{"use strict";Me();mLt();aCr();m$i();uCr=P.objectWithoutOptionalProperties({endpointReference:wIe,requestProperties:cCr,responseProperties:bet})});var lCr,g$i=h(()=>{"use strict";Me();PIe();lCr=P.objectWithoutOptionalProperties({clientId:tT,clientSecret:tT,scopes:tT.optional(),customProperties:P.list(tT).optional()})});var pCr,A$i=h(()=>{"use strict";Me();mLt();g$i();aCr();pCr=P.objectWithoutOptionalProperties({endpointReference:wIe,requestProperties:lCr,responseProperties:bet})});var fCr,y$i=h(()=>{"use strict";Me();SLe();h$i();A$i();fCr=P.objectWithoutOptionalProperties({clientIdEnvVar:aQ.optional(),clientSecretEnvVar:aQ.optional(),tokenPrefix:P.string().optional(),tokenHeader:P.string().optional(),scopes:P.list(P.string()).optional(),tokenEndpoint:pCr,refreshEndpoint:uCr.optional()})});var dCr,b$i=h(()=>{"use strict";Me();oCr();dCr=P.objectWithoutOptionalProperties({clientId:yet,deviceAuthorizationUrl:P.string(),tokenUrl:P.string(),refreshUrl:P.string().optional(),scopes:P.list(P.string()).optional(),deviceAuthorizationParameters:P.record(P.string(),P.string()).optional(),tokenParameters:P.record(P.string(),P.string()).optional(),refreshParameters:P.record(P.string(),P.string()).optional(),tokenHeader:P.string().optional(),tokenPrefix:P.string().optional()})});var mCr,E$i=h(()=>{"use strict";Xr();Me();d$i();y$i();b$i();mCr=P.union("type",{clientCredentials:fCr,authorizationCode:sCr,deviceCode:dCr}).transform({transform:e=>{switch(e.type){case"clientCredentials":return sD.clientCredentials(e);case"authorizationCode":return sD.authorizationCode(e);case"deviceCode":return sD.deviceCode(e);default:return e}},untransform:({_visit:e,...t})=>t})});var hCr,I$i=h(()=>{"use strict";Me();xLe();E$i();hCr=P.objectWithoutOptionalProperties({configuration:mCr}).extend(_V)});var gCr,v$i=h(()=>{"use strict";Xr();Me();$Zi();e$i();t$i();l$i();I$i();gCr=P.union(P.discriminant("type","_type"),{bearer:Wvr,basic:qvr,header:Hvr,oauth:hCr,inferred:rCr}).transform({transform:e=>{switch(e.type){case"bearer":return Mp.bearer(e);case"basic":return Mp.basic(e);case"header":return Mp.header(e);case"oauth":return Mp.oauth(e);case"inferred":return Mp.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t})});var ACr,C$i=h(()=>{"use strict";Me();ACr=P.enum_(["ALL","ANY","ENDPOINT_SECURITY"])});var yCr,x$i=h(()=>{"use strict";Me();fp();v$i();C$i();yCr=P.objectWithoutOptionalProperties({requirement:ACr,schemes:P.list(gCr)}).extend(ao)});var bCr,S$i=h(()=>{"use strict";Me();bCr=P.string()});var w$i=h(()=>{"use strict";x$i();v$i();Gvr();C$i();S$i();xLe();$Zi();e$i();SLe();t$i();s$i();c$i();l$i();u$i();g$i();aCr();d$i();y$i();E$i();b$i();f$i();p$i();oCr();h$i();m$i();I$i();A$i()});var T$i={};te(T$i,{ApiAuth:()=>yCr,AuthScheme:()=>gCr,AuthSchemeKey:()=>det,AuthSchemesRequirement:()=>ACr,AuthScope:()=>bCr,BaseAuthScheme:()=>_V,BasicAuthScheme:()=>qvr,BearerAuthScheme:()=>Wvr,EnvironmentVariable:()=>aQ,HeaderAuthScheme:()=>Hvr,InferredAuthGrantType:()=>eCr,InferredAuthScheme:()=>rCr,InferredAuthSchemeTokenEndpoint:()=>tCr,InferredAuthenticatedRequestHeader:()=>Zvr,OAuthAccessTokenRequestProperties:()=>lCr,OAuthAccessTokenResponseProperties:()=>bet,OAuthAuthorizationCode:()=>sCr,OAuthClientCredentials:()=>fCr,OAuthConfiguration:()=>mCr,OAuthDeviceCode:()=>dCr,OAuthPkceConfiguration:()=>iCr,OAuthPkceMethod:()=>nCr,OAuthPublicClientId:()=>yet,OAuthRefreshEndpoint:()=>uCr,OAuthRefreshTokenRequestProperties:()=>cCr,OAuthScheme:()=>hCr,OAuthTokenEndpoint:()=>pCr});var Aic=h(()=>{"use strict";w$i()});var BIe,yLt=h(()=>{"use strict";Me();BIe=P.string()});var RIe,bLt=h(()=>{"use strict";Me();RIe=P.string()});var ECr,O$i=h(()=>{"use strict";Me();ECr=P.objectWithoutOptionalProperties({original:P.string()})});var ELt,P$i=h(()=>{"use strict";Me();ELt=P.string()});var VV,TLe=h(()=>{"use strict";Me();Mf();VV=P.objectWithoutOptionalProperties({allParts:P.list(Ro),packagePath:P.list(Ro),file:Ro.optional()})});var cB,Dfe=h(()=>{"use strict";Me();cB=P.string()});var Eet,ICr=h(()=>{"use strict";Me();Eet=P.string()});var vCr,B$i=h(()=>{"use strict";Me();vCr=P.string()});var Iet,CCr=h(()=>{"use strict";Me();Iet=P.string()});var GV,OLe=h(()=>{"use strict";Me();GV=P.objectWithoutOptionalProperties({contentType:P.string().optional()})});var DIe,ILt=h(()=>{"use strict";Me();get();fp();DIe=P.objectWithoutOptionalProperties({availability:d$.optional()}).extend(ao)});var g$,vet=h(()=>{"use strict";Me();g$=P.objectWithoutOptionalProperties({jsonExample:P.unknown()})});var R$i=h(()=>{"use strict";get();r$i();LH();yLt();dLt();mLt();bLt();O$i();P$i();TLe();Vvr();fLt();Id();Mf();ZZi();met();het();Dfe();ICr();B$i();CCr();OLe();fp();ILt();vet()});var D$i={};te(D$i,{Availability:()=>d$,AvailabilityStatus:()=>Kvr,Declaration:()=>Wx,DisplayName:()=>BIe,EndpointId:()=>Bfe,EndpointReference:()=>wIe,ErrorId:()=>RIe,EscapedString:()=>ECr,FeatureId:()=>ELt,FernFilepath:()=>VV,Name:()=>fet,NameAndWireValue:()=>SIe,NameAndWireValueOrString:()=>fs,NameOrString:()=>Ro,SafeAndUnsafeString:()=>CLe,ServiceId:()=>p$,SubpackageId:()=>f$,TypeId:()=>cB,WebSocketChannelId:()=>Iet,WebhookGroupId:()=>Eet,WebhookId:()=>vCr,WithContentType:()=>GV,WithDocs:()=>ao,WithDocsAndAvailability:()=>DIe,WithJsonExample:()=>g$});var yic=h(()=>{"use strict";R$i()});var xCr,k$i=h(()=>{"use strict";Me();Id();xCr=P.objectWithoutOptionalProperties({errorInstanceIdKey:fs})});var F$i=h(()=>{"use strict";k$i()});var N$i={};te(N$i,{Constants:()=>xCr});var bic=h(()=>{"use strict";F$i()});var PLe,j$i=h(()=>{"use strict";Me();PLe=P.objectWithoutOptionalProperties({unsafeName:P.string(),safeName:P.string()})});var hg,cQ=h(()=>{"use strict";Me();j$i();hg=P.objectWithoutOptionalProperties({originalName:P.string(),camelCase:PLe,pascalCase:PLe,snakeCase:PLe,screamingSnakeCase:PLe})});var SCr,z$i=h(()=>{"use strict";Me();SCr=P.enum_(["ALL","ANY","ENDPOINT_SECURITY"])});var qV,BLe=h(()=>{"use strict";Me();cQ();z$i();qV=P.objectWithoutOptionalProperties({wrapperProperty:hg.optional(),requirement:SCr.optional()})});var wCr,Q$i=h(()=>{"use strict";Me();cQ();BLe();wCr=P.objectWithoutOptionalProperties({username:hg,usernameOmit:P.boolean().optional(),password:hg,passwordOmit:P.boolean().optional()}).extend(qV)});var TCr,M$i=h(()=>{"use strict";Me();cQ();BLe();TCr=P.objectWithoutOptionalProperties({token:hg}).extend(qV)});var AC,_H=h(()=>{"use strict";Me();cQ();AC=P.objectWithoutOptionalProperties({wireValue:P.string(),name:hg})});var OCr,L$i=h(()=>{"use strict";Me();OCr=P.enum_(["READ_ONLY","WRITE_ONLY"])});var oA,uQ=h(()=>{"use strict";Me();$o();_H();L$i();oA=P.objectWithoutOptionalProperties({name:AC,typeReference:P.lazy(()=>rE.TypeReference),propertyAccess:OCr.optional(),variable:P.string().optional()})});var PCr,_$i=h(()=>{"use strict";Me();uQ();BLe();PCr=P.objectWithoutOptionalProperties({header:oA}).extend(qV)});var BCr,U$i=h(()=>{"use strict";Me();uQ();BLe();BCr=P.objectWithoutOptionalProperties({parameters:P.list(oA).optional()}).extend(qV)});var RCr,V$i=h(()=>{"use strict";Me();cQ();uQ();BLe();RCr=P.objectWithoutOptionalProperties({clientId:hg,clientSecret:hg,customProperties:P.list(oA).optional()}).extend(qV)});var DCr,G$i=h(()=>{"use strict";Xr();Me();Q$i();M$i();_$i();U$i();V$i();DCr=P.union("type",{basic:wCr,bearer:TCr,header:PCr,oauth:RCr,inferred:BCr}).transform({transform:e=>{switch(e.type){case"basic":return sr.Auth.basic(e);case"bearer":return sr.Auth.bearer(e);case"header":return sr.Auth.header(e);case"oauth":return sr.Auth.oauth(e);case"inferred":return sr.Auth.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t})});var kCr,q$i=h(()=>{"use strict";Me();kCr=P.objectWithoutOptionalProperties({username:P.string(),password:P.string()})});var FCr,W$i=h(()=>{"use strict";Me();FCr=P.objectWithoutOptionalProperties({token:P.string()})});var NCr,H$i=h(()=>{"use strict";Me();NCr=P.objectWithoutOptionalProperties({value:P.unknown()})});var jCr,K$i=h(()=>{"use strict";Me();jCr=P.objectWithoutOptionalProperties({values:P.record(P.string(),P.unknown()).optional()})});var zCr,J$i=h(()=>{"use strict";Me();zCr=P.objectWithoutOptionalProperties({clientId:P.string(),clientSecret:P.string(),customPropertyValues:P.record(P.string(),P.unknown()).optional()})});var QCr,Y$i=h(()=>{"use strict";Xr();Me();q$i();W$i();H$i();K$i();J$i();QCr=P.union("type",{basic:kCr,bearer:FCr,header:NCr,oauth:zCr,inferred:jCr}).transform({transform:e=>{switch(e.type){case"basic":return sr.AuthValues.basic(e);case"bearer":return sr.AuthValues.bearer(e);case"header":return sr.AuthValues.header(e);case"oauth":return sr.AuthValues.oauth(e);case"inferred":return sr.AuthValues.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t})});var X$i=h(()=>{"use strict";G$i();z$i();Y$i();BLe();Q$i();q$i();M$i();W$i();_$i();H$i();U$i();K$i();V$i();J$i()});var Z$i={};te(Z$i,{Auth:()=>DCr,AuthRequirement:()=>SCr,AuthValues:()=>QCr,BaseAuth:()=>qV,BasicAuth:()=>wCr,BasicAuthValues:()=>kCr,BearerAuth:()=>TCr,BearerAuthValues:()=>FCr,HeaderAuth:()=>PCr,HeaderAuthValues:()=>NCr,InferredAuth:()=>BCr,InferredAuthValues:()=>jCr,OAuth:()=>RCr,OAuthValues:()=>zCr});var Eic=h(()=>{"use strict";X$i()});var MCr,$$i=h(()=>{"use strict";Me();MCr=P.string()});var LCr,eeo=h(()=>{"use strict";Me();cQ();LCr=P.objectWithoutOptionalProperties({allParts:P.list(hg),packagePath:P.list(hg),file:hg.optional()})});var Iic,vic=h(()=>{"use strict";Me();_H();Iic=P.undiscriminatedUnion([P.string(),AC])});var Cic,xic=h(()=>{"use strict";Me();cQ();Cic=P.undiscriminatedUnion([P.string(),hg])});var A$,Cet=h(()=>{"use strict";Me();A$=P.string()});var xet,_Cr=h(()=>{"use strict";Me();xet=P.objectWithoutOptionalProperties({docs:P.string().optional()})});var teo=h(()=>{"use strict";$$i();eeo();cQ();_H();vic();xic();j$i();Cet();_Cr()});var reo={};te(reo,{EndpointId:()=>MCr,FernFilepath:()=>LCr,Name:()=>hg,NameAndWireValue:()=>AC,NameAndWireValueOrString:()=>Iic,NameOrString:()=>Cic,SafeAndUnsafeString:()=>PLe,TypeId:()=>A$,WithDocs:()=>xet});var Sic=h(()=>{"use strict";teo()});var lD,kfe=h(()=>{"use strict";Me();eeo();cQ();lD=P.objectWithoutOptionalProperties({fernFilepath:LCr,name:hg})});var neo=h(()=>{"use strict";kfe()});var ieo={};te(ieo,{Declaration:()=>lD});var wic=h(()=>{"use strict";neo()});var wet,UCr=h(()=>{"use strict";Xr();Me();$o();wet=P.union("type",{bytes:P.object({}),typeReference:P.object({value:P.lazy(()=>rE.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return sr.ReferencedRequestBodyType.bytes();case"typeReference":return sr.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var VCr,oeo=h(()=>{"use strict";Me();uQ();UCr();VCr=P.objectWithoutOptionalProperties({pathParameters:P.list(oA).optional(),body:wet.optional(),bodyRequired:P.boolean().optional()})});var GCr,seo=h(()=>{"use strict";Me();GCr=P.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var Tet,qCr=h(()=>{"use strict";Me();seo();Tet=P.objectWithoutOptionalProperties({method:GCr,path:P.string()})});var y$,Oet=h(()=>{"use strict";Me();y$=P.string()});var kIe,vLt=h(()=>{"use strict";Me();kIe=P.string()});var FIe,CLt=h(()=>{"use strict";Me();FIe=P.string()});var WCr,aeo=h(()=>{"use strict";Me();vLt();CLt();WCr=P.record(kIe,FIe)});var HCr,ceo=h(()=>{"use strict";Me();Oet();aeo();HCr=P.undiscriminatedUnion([y$,WCr])});var Pet,ueo=h(()=>{"use strict";Me();Pet=P.record(P.string(),P.unknown())});var KCr,leo=h(()=>{"use strict";Me();Y$i();qCr();ceo();ueo();KCr=P.objectWithoutOptionalProperties({endpoint:Tet,baseUrl:P.property("baseURL",P.string().optional()),environment:HCr.optional(),auth:QCr.optional(),pathParameters:Pet.optional(),queryParameters:Pet.optional(),headers:Pet.optional(),requestBody:P.unknown().optional()})});var JCr,peo=h(()=>{"use strict";Me();leo();JCr=P.objectWithoutOptionalProperties({id:P.string(),name:P.string().optional(),isUserSpecified:P.boolean().optional()}).extend(KCr)});var xLt,feo=h(()=>{"use strict";Me();_H();xLt=P.objectWithoutOptionalProperties({isOptional:P.boolean().optional()}).extend(AC)});var YCr,deo=h(()=>{"use strict";Xr();Me();uQ();feo();YCr=P.union("type",{file:xLt,fileArray:xLt,bodyProperty:oA}).transform({transform:e=>{switch(e.type){case"file":return sr.FileUploadRequestBodyProperty.file(e);case"fileArray":return sr.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return sr.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t})});var XCr,meo=h(()=>{"use strict";Me();deo();XCr=P.objectWithoutOptionalProperties({properties:P.list(YCr)})});var ZCr,heo=h(()=>{"use strict";Me();cQ();UCr();ZCr=P.objectWithoutOptionalProperties({bodyKey:hg,bodyType:wet})});var $Cr,geo=h(()=>{"use strict";Xr();Me();uQ();meo();heo();$Cr=P.union("type",{properties:P.object({value:P.list(oA)}),referenced:ZCr,fileUpload:XCr}).transform({transform:e=>{switch(e.type){case"properties":return sr.InlinedRequestBody.properties(e.value);case"referenced":return sr.InlinedRequestBody.referenced(e);case"fileUpload":return sr.InlinedRequestBody.fileUpload(e);default:return e}},untransform:({_visit:e,...t})=>t})});var exr,Aeo=h(()=>{"use strict";Me();exr=P.objectWithoutOptionalProperties({includePathParameters:P.boolean(),onlyPathParameters:P.boolean()})});var txr,yeo=h(()=>{"use strict";Me();kfe();uQ();geo();Aeo();txr=P.objectWithoutOptionalProperties({declaration:lD,pathParameters:P.list(oA).optional(),queryParameters:P.list(oA).optional(),headers:P.list(oA).optional(),body:$Cr.optional(),metadata:exr.optional()})});var rxr,beo=h(()=>{"use strict";Xr();Me();oeo();yeo();rxr=P.union("type",{body:VCr,inlined:txr}).transform({transform:e=>{switch(e.type){case"body":return sr.Request.body(e);case"inlined":return sr.Request.inlined(e);default:return e}},untransform:({_visit:e,...t})=>t})});var nxr,Eeo=h(()=>{"use strict";Xr();Me();nxr=P.union("type",{json:P.object({}),streaming:P.object({}),streamParameter:P.object({}),fileDownload:P.object({}),text:P.object({}),bytes:P.object({})}).transform({transform:e=>{switch(e.type){case"json":return sr.Response.json();case"streaming":return sr.Response.streaming();case"streamParameter":return sr.Response.streamParameter();case"fileDownload":return sr.Response.fileDownload();case"text":return sr.Response.text();case"bytes":return sr.Response.bytes();default:return e}},untransform:({_visit:e,...t})=>t})});var ixr,Ieo=h(()=>{"use strict";Me();G$i();kfe();peo();qCr();beo();Eeo();ixr=P.objectWithoutOptionalProperties({auth:DCr.optional(),declaration:lD,location:Tet,request:rxr,response:nxr,hasResponseBody:P.boolean().optional(),examples:P.list(JCr).optional()})});var veo=h(()=>{"use strict";oeo();Ieo();peo();qCr();meo();feo();deo();yeo();geo();Aeo();heo();UCr();beo();Eeo()});var Ceo={};te(Ceo,{BodyRequest:()=>VCr,Endpoint:()=>ixr,EndpointExample:()=>JCr,EndpointLocation:()=>Tet,FileUploadRequestBody:()=>XCr,FileUploadRequestBodyFileProperty:()=>xLt,FileUploadRequestBodyProperty:()=>YCr,InlinedRequest:()=>txr,InlinedRequestBody:()=>$Cr,InlinedRequestMetadata:()=>exr,ReferencedRequestBody:()=>ZCr,ReferencedRequestBodyType:()=>wet,Request:()=>rxr,Response:()=>nxr});var Tic=h(()=>{"use strict";veo()});var oxr,xeo=h(()=>{"use strict";Me();cQ();vLt();oxr=P.objectWithoutOptionalProperties({id:kIe,name:hg})});var sxr,Seo=h(()=>{"use strict";Me();cQ();_Cr();vLt();Oet();CLt();sxr=P.objectWithoutOptionalProperties({id:y$,name:hg,urls:P.record(kIe,FIe)}).extend(xet)});var axr,weo=h(()=>{"use strict";Me();xeo();Seo();axr=P.objectWithoutOptionalProperties({baseUrls:P.list(oxr),environments:P.list(sxr)})});var cxr,Teo=h(()=>{"use strict";Me();cQ();_Cr();Oet();CLt();cxr=P.objectWithoutOptionalProperties({id:y$,name:hg,url:FIe}).extend(xet)});var uxr,Oeo=h(()=>{"use strict";Me();Teo();uxr=P.objectWithoutOptionalProperties({environments:P.list(cxr)})});var lxr,Peo=h(()=>{"use strict";Xr();Me();weo();Oeo();lxr=P.union("type",{singleBaseUrl:uxr,multipleBaseUrls:axr}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return sr.Environments.singleBaseUrl(e);case"multipleBaseUrls":return sr.Environments.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t})});var pxr,Beo=h(()=>{"use strict";Me();Oet();Peo();pxr=P.objectWithoutOptionalProperties({defaultEnvironment:y$.optional(),environments:lxr})});var Reo=h(()=>{"use strict";vLt();xeo();Oet();Peo();Beo();CLt();ceo();Seo();weo();aeo();Teo();Oeo()});var Deo={};te(Deo,{EnvironmentBaseUrlId:()=>kIe,EnvironmentBaseUrlWithId:()=>oxr,EnvironmentId:()=>y$,EnvironmentUrl:()=>FIe,EnvironmentValues:()=>HCr,Environments:()=>lxr,EnvironmentsConfig:()=>pxr,MultipleBaseUrlsEnvironment:()=>sxr,MultipleBaseUrlsEnvironments:()=>axr,MultipleEnvironmentUrlValues:()=>WCr,SingleBaseUrlEnvironment:()=>cxr,SingleBaseUrlEnvironments:()=>uxr});var Oic=h(()=>{"use strict";Reo()});var keo=h(()=>{"use strict";seo()});var Feo={};te(Feo,{HttpMethod:()=>GCr});var Pic=h(()=>{"use strict";keo()});var fxr,Neo=h(()=>{"use strict";Me();fxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var dxr,jeo=h(()=>{"use strict";Me();dxr=P.enum_(["explicit","auto"])});var Bet,mxr=h(()=>{"use strict";Me();Bet=P.string()});var hxr,zeo=h(()=>{"use strict";Me();hxr=P.enum_(["header","query","body","path"])});var Ret,gxr=h(()=>{"use strict";Me();$o();Id();fp();wLe();jeo();mxr();zeo();Ret=P.objectWithoutOptionalProperties({id:Bet,name:fs,location:hxr,target:P.string(),valueType:P.lazy(()=>zs),env:P.string().optional(),clientDefault:UV.optional(),optional:P.boolean().optional(),apply:dxr.optional()}).extend(ao)});var Axr,Qeo=h(()=>{"use strict";Me();$o();kfe();Axr=P.objectWithoutOptionalProperties({declaration:lD,typeReference:P.lazy(()=>rE.TypeReference)})});var yxr,Meo=h(()=>{"use strict";Me();_H();uQ();yxr=P.objectWithoutOptionalProperties({discriminantValue:AC,properties:P.list(oA).optional()})});var bxr,Leo=h(()=>{"use strict";Me();_H();Cet();uQ();bxr=P.objectWithoutOptionalProperties({typeId:A$,discriminantValue:AC,properties:P.list(oA)})});var Exr,_eo=h(()=>{"use strict";Me();$o();_H();uQ();Exr=P.objectWithoutOptionalProperties({typeReference:P.lazy(()=>rE.TypeReference),discriminantValue:AC,properties:P.list(oA).optional()})});var Ixr,Ueo=h(()=>{"use strict";Xr();Me();Meo();Leo();_eo();Ixr=P.union("type",{samePropertiesAsObject:bxr,singleProperty:Exr,noProperties:yxr}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return sr.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return sr.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return sr.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:({_visit:e,...t})=>t})});var vxr,Veo=h(()=>{"use strict";Me();_H();kfe();Ueo();vxr=P.objectWithoutOptionalProperties({declaration:lD,discriminant:AC,types:P.record(P.string(),Ixr),inheritedBaseProperties:P.list(AC).optional()})});var Cxr,Geo=h(()=>{"use strict";Me();_H();kfe();Cxr=P.objectWithoutOptionalProperties({declaration:lD,values:P.list(AC)})});var xxr,qeo=h(()=>{"use strict";Me();_H();Cet();kfe();uQ();xxr=P.objectWithoutOptionalProperties({declaration:lD,properties:P.list(oA),extends:P.list(A$).optional(),additionalProperties:P.boolean().optional(),deferredUnionBaseProperties:P.list(AC).optional()})});var Sxr,Weo=h(()=>{"use strict";Me();$o();kfe();Sxr=P.objectWithoutOptionalProperties({declaration:lD,types:P.list(P.lazy(()=>rE.TypeReference))})});var wxr,Heo=h(()=>{"use strict";Xr();Me();Qeo();Veo();Geo();qeo();Weo();wxr=P.union("type",{alias:Axr,enum:Cxr,object:xxr,discriminatedUnion:vxr,undiscriminatedUnion:Sxr}).transform({transform:e=>{switch(e.type){case"alias":return sr.NamedType.alias(e);case"enum":return sr.NamedType.enum(e);case"object":return sr.NamedType.object(e);case"discriminatedUnion":return sr.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return sr.NamedType.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Txr,Keo=h(()=>{"use strict";Me();$o();Vvr();Txr=P.objectWithoutOptionalProperties({id:P.string(),name:fet,typeReference:P.lazy(()=>rE.TypeReference)})});var Oxr,Jeo=h(()=>{"use strict";Me();Oxr=P.objectWithoutOptionalProperties({version:P.string(),repoUrl:P.string()})});var Pxr,Yeo=h(()=>{"use strict";Me();Pxr=P.objectWithoutOptionalProperties({version:P.string(),coordinate:P.string(),repoUrl:P.string().optional()})});var Bxr,Xeo=h(()=>{"use strict";Me();Bxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var Rxr,Zeo=h(()=>{"use strict";Me();Rxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var Dxr,$eo=h(()=>{"use strict";Me();Dxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var kxr,eto=h(()=>{"use strict";Me();kxr=P.objectWithoutOptionalProperties({version:P.string(),packageName:P.string(),repoUrl:P.string().optional()})});var Fxr,tto=h(()=>{"use strict";Me();Fxr=P.objectWithoutOptionalProperties({version:P.string(),repoUrl:P.string()})});var Nxr,rto=h(()=>{"use strict";Xr();Me();Neo();Jeo();Yeo();Xeo();Zeo();$eo();eto();tto();Nxr=P.union("type",{go:Oxr,swift:Fxr,maven:Pxr,npm:Bxr,nuget:Rxr,pypi:Dxr,rubygems:kxr,crates:fxr}).transform({transform:e=>{switch(e.type){case"go":return sr.PublishInfo.go(e);case"swift":return sr.PublishInfo.swift(e);case"maven":return sr.PublishInfo.maven(e);case"npm":return sr.PublishInfo.npm(e);case"nuget":return sr.PublishInfo.nuget(e);case"pypi":return sr.PublishInfo.pypi(e);case"rubygems":return sr.PublishInfo.rubygems(e);case"crates":return sr.PublishInfo.crates(e);default:return e}},untransform:({_visit:e,...t})=>t})});var jxr,nto=h(()=>{"use strict";Xr();Me();rto();jxr=P.union("type",{publish:P.object({value:Nxr}),local:P.object({})}).transform({transform:e=>{switch(e.type){case"publish":return sr.GeneratorOutputConfig.publish(e.value);case"local":return sr.GeneratorOutputConfig.local();default:return e}},untransform:({_visit:e,...t})=>t})});var zxr,ito=h(()=>{"use strict";Me();nto();zxr=P.objectWithoutOptionalProperties({apiName:P.string(),organization:P.string(),customConfig:P.unknown(),outputConfig:jxr})});var Qxr,oto=h(()=>{"use strict";Me();gxr();$$i();Cet();Ieo();Beo();uQ();Heo();Keo();ito();Qxr=P.objectWithoutOptionalProperties({version:P.stringLiteral("1.0.0"),types:P.record(A$,wxr),endpoints:P.record(MCr,ixr),environments:pxr.optional(),headers:P.list(oA).optional(),pathParameters:P.list(oA).optional(),variables:P.list(Txr).optional(),globalParameters:P.list(Ret).optional(),generatorConfig:zxr.optional()})});var sto=h(()=>{"use strict";Neo();oto();ito();nto();Jeo();Yeo();Xeo();Zeo();rto();$eo();eto();tto()});var ato={};te(ato,{CratesPublishInfo:()=>fxr,DynamicIntermediateRepresentation:()=>Qxr,GeneratorConfig:()=>zxr,GeneratorOutputConfig:()=>jxr,GoPublishInfo:()=>Oxr,MavenPublishInfo:()=>Pxr,NpmPublishInfo:()=>Bxr,NugetPublishInfo:()=>Rxr,PublishInfo:()=>Nxr,PypiPublishInfo:()=>Dxr,RubyGemsPublishInfo:()=>kxr,SwiftPublishInfo:()=>Fxr});var Bic=h(()=>{"use strict";sto()});var Mxr,cto=h(()=>{"use strict";Me();Mxr=P.enum_(["CRITICAL","WARNING"])});var Lxr,uto=h(()=>{"use strict";Me();cto();Lxr=P.objectWithoutOptionalProperties({severity:Mxr,message:P.string()})});var Ric,Dic=h(()=>{"use strict";Me();uto();Ric=P.objectWithoutOptionalProperties({snippet:P.string(),errors:P.list(Lxr).optional()})});var lto=h(()=>{"use strict";leo();Dic();uto();cto();ueo()});var pto={};te(pto,{EndpointSnippetRequest:()=>KCr,EndpointSnippetResponse:()=>Ric,ErrorSeverity:()=>Mxr,Error_:()=>Lxr,Values:()=>Pet});var kic=h(()=>{"use strict";lto()});var _xr,fto=h(()=>{"use strict";Xr();Me();_xr=P.union("type",{boolean:P.object({value:P.boolean()}),string:P.object({value:P.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return sr.LiteralType.boolean(e.value);case"string":return sr.LiteralType.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var Fic,Nic=h(()=>{"use strict";Me();$o();Fic=P.objectWithoutOptionalProperties({key:P.lazy(()=>rE.TypeReference),value:P.lazy(()=>rE.TypeReference)})});var Uxr,dto=h(()=>{"use strict";Me();Uxr=P.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","DATE_TIME_RFC_2822","UUID","BASE_64","BIG_INTEGER"])});var jic,zic=h(()=>{"use strict";Xr();Me();$o();Cet();fto();dto();jic=P.union("type",{list:P.object({value:P.lazy(()=>rE.TypeReference)}),literal:P.object({value:_xr}),map:P.lazyObject(()=>rE.MapType),named:P.object({value:A$}),nullable:P.object({value:P.lazy(()=>rE.TypeReference)}),optional:P.object({value:P.lazy(()=>rE.TypeReference)}),primitive:P.object({value:Uxr}),set:P.object({value:P.lazy(()=>rE.TypeReference)}),unknown:P.object({})}).transform({transform:e=>{switch(e.type){case"list":return sr.TypeReference.list(e.value);case"literal":return sr.TypeReference.literal(e.value);case"map":return sr.TypeReference.map(e);case"named":return sr.TypeReference.named(e.value);case"nullable":return sr.TypeReference.nullable(e.value);case"optional":return sr.TypeReference.optional(e.value);case"primitive":return sr.TypeReference.primitive(e.value);case"set":return sr.TypeReference.set(e.value);case"unknown":return sr.TypeReference.unknown();default:return e}},untransform:({_visit:e,...t})=>t})});var mto=h(()=>{"use strict";Qeo();Veo();Geo();fto();Nic();uQ();Heo();L$i();qeo();dto();Ueo();Meo();Leo();_eo();zic();Weo()});var hto={};te(hto,{AliasType:()=>Axr,DiscriminatedUnionType:()=>vxr,EnumType:()=>Cxr,LiteralType:()=>_xr,MapType:()=>Fic,NamedParameter:()=>oA,NamedType:()=>wxr,ObjectPropertyAccess:()=>OCr,ObjectType:()=>xxr,PrimitiveTypeV1:()=>Uxr,SingleDiscriminatedUnionType:()=>Ixr,SingleDiscriminatedUnionTypeNoProperties:()=>yxr,SingleDiscriminatedUnionTypeObject:()=>bxr,SingleDiscriminatedUnionTypeSingleProperty:()=>Exr,TypeReference:()=>jic,UndiscriminatedUnionType:()=>Sxr});var Qic=h(()=>{"use strict";mto()});var gto=h(()=>{"use strict";Keo()});var Ato={};te(Ato,{VariableDeclaration:()=>Txr});var Mic=h(()=>{"use strict";gto()});var Lic=h(()=>{"use strict";Eic();X$i();Sic();teo();wic();neo();Tic();veo();Oic();Reo();Pic();keo();Bic();sto();kic();lto();Qic();mto();Mic();gto()});var rE={};te(rE,{AliasType:()=>Axr,Auth:()=>DCr,AuthRequirement:()=>SCr,AuthValues:()=>QCr,BaseAuth:()=>qV,BasicAuth:()=>wCr,BasicAuthValues:()=>kCr,BearerAuth:()=>TCr,BearerAuthValues:()=>FCr,BodyRequest:()=>VCr,CratesPublishInfo:()=>fxr,Declaration:()=>lD,DiscriminatedUnionType:()=>vxr,DynamicIntermediateRepresentation:()=>Qxr,Endpoint:()=>ixr,EndpointExample:()=>JCr,EndpointId:()=>MCr,EndpointLocation:()=>Tet,EndpointSnippetRequest:()=>KCr,EndpointSnippetResponse:()=>Ric,EnumType:()=>Cxr,EnvironmentBaseUrlId:()=>kIe,EnvironmentBaseUrlWithId:()=>oxr,EnvironmentId:()=>y$,EnvironmentUrl:()=>FIe,EnvironmentValues:()=>HCr,Environments:()=>lxr,EnvironmentsConfig:()=>pxr,ErrorSeverity:()=>Mxr,Error_:()=>Lxr,FernFilepath:()=>LCr,FileUploadRequestBody:()=>XCr,FileUploadRequestBodyFileProperty:()=>xLt,FileUploadRequestBodyProperty:()=>YCr,GeneratorConfig:()=>zxr,GeneratorOutputConfig:()=>jxr,GoPublishInfo:()=>Oxr,HeaderAuth:()=>PCr,HeaderAuthValues:()=>NCr,HttpMethod:()=>GCr,InferredAuth:()=>BCr,InferredAuthValues:()=>jCr,InlinedRequest:()=>txr,InlinedRequestBody:()=>$Cr,InlinedRequestMetadata:()=>exr,LiteralType:()=>_xr,MapType:()=>Fic,MavenPublishInfo:()=>Pxr,MultipleBaseUrlsEnvironment:()=>sxr,MultipleBaseUrlsEnvironments:()=>axr,MultipleEnvironmentUrlValues:()=>WCr,Name:()=>hg,NameAndWireValue:()=>AC,NameAndWireValueOrString:()=>Iic,NameOrString:()=>Cic,NamedParameter:()=>oA,NamedType:()=>wxr,NpmPublishInfo:()=>Bxr,NugetPublishInfo:()=>Rxr,OAuth:()=>RCr,OAuthValues:()=>zCr,ObjectPropertyAccess:()=>OCr,ObjectType:()=>xxr,PrimitiveTypeV1:()=>Uxr,PublishInfo:()=>Nxr,PypiPublishInfo:()=>Dxr,ReferencedRequestBody:()=>ZCr,ReferencedRequestBodyType:()=>wet,Request:()=>rxr,Response:()=>nxr,RubyGemsPublishInfo:()=>kxr,SafeAndUnsafeString:()=>PLe,SingleBaseUrlEnvironment:()=>cxr,SingleBaseUrlEnvironments:()=>uxr,SingleDiscriminatedUnionType:()=>Ixr,SingleDiscriminatedUnionTypeNoProperties:()=>yxr,SingleDiscriminatedUnionTypeObject:()=>bxr,SingleDiscriminatedUnionTypeSingleProperty:()=>Exr,SwiftPublishInfo:()=>Fxr,TypeId:()=>A$,TypeReference:()=>jic,UndiscriminatedUnionType:()=>Sxr,Values:()=>Pet,VariableDeclaration:()=>Txr,WithDocs:()=>xet,auth:()=>Z$i,commons:()=>reo,declaration:()=>ieo,endpoints:()=>Ceo,environment:()=>Deo,http:()=>Feo,ir:()=>ato,snippets:()=>pto,types:()=>hto,variables:()=>Ato});var _ic=h(()=>{"use strict";Lic()});var pD,RLe=h(()=>{"use strict";Me();pD=P.string()});var Vxr,yto=h(()=>{"use strict";Me();Mf();RLe();Vxr=P.objectWithoutOptionalProperties({id:pD,name:Ro})});var b$,Det=h(()=>{"use strict";Me();b$=P.string()});var NIe,SLt=h(()=>{"use strict";Me();NIe=P.string()});var ket,Gxr=h(()=>{"use strict";Me();Mf();ket=P.objectWithoutOptionalProperties({id:P.string(),name:Ro,default:P.string().optional(),values:P.list(P.string()).optional()})});var qxr,bto=h(()=>{"use strict";Me();Mf();fp();RLe();Det();SLt();Gxr();qxr=P.objectWithoutOptionalProperties({id:b$,name:Ro,urls:P.record(pD,NIe),audiences:P.list(P.string()).optional(),defaultUrls:P.record(pD,P.string()).optional(),urlTemplates:P.record(pD,P.string()).optional(),urlVariables:P.record(pD,P.list(ket)).optional()}).extend(ao)});var Wxr,Eto=h(()=>{"use strict";Me();yto();bto();Wxr=P.objectWithoutOptionalProperties({baseUrls:P.list(Vxr),environments:P.list(qxr)})});var Hxr,Ito=h(()=>{"use strict";Me();Mf();fp();Det();SLt();Gxr();Hxr=P.objectWithoutOptionalProperties({id:b$,name:Ro,url:NIe,audiences:P.list(P.string()).optional(),defaultUrl:P.string().optional(),urlTemplate:P.string().optional(),urlVariables:P.list(ket).optional()}).extend(ao)});var Kxr,vto=h(()=>{"use strict";Me();Ito();Kxr=P.objectWithoutOptionalProperties({environments:P.list(Hxr)})});var Jxr,Cto=h(()=>{"use strict";Xr();Me();Eto();vto();Jxr=P.union("type",{singleBaseUrl:Kxr,multipleBaseUrls:Wxr}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return Z0.singleBaseUrl(e);case"multipleBaseUrls":return Z0.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Yxr,xto=h(()=>{"use strict";Me();Det();Cto();Yxr=P.objectWithoutOptionalProperties({defaultEnvironment:b$.optional(),baseUrlEnvVar:P.string().optional(),environments:Jxr})});var Sto=h(()=>{"use strict";RLe();yto();Det();Cto();xto();SLt();bto();Eto();Gxr();Ito();vto()});var wto={};te(wto,{EnvironmentBaseUrlId:()=>pD,EnvironmentBaseUrlWithId:()=>Vxr,EnvironmentId:()=>b$,EnvironmentUrl:()=>NIe,Environments:()=>Jxr,EnvironmentsConfig:()=>Yxr,MultipleBaseUrlsEnvironment:()=>qxr,MultipleBaseUrlsEnvironments:()=>Wxr,ServerVariable:()=>ket,SingleBaseUrlEnvironment:()=>Hxr,SingleBaseUrlEnvironments:()=>Kxr});var Uic=h(()=>{"use strict";Sto()});var jIe,wLt=h(()=>{"use strict";Me();bLt();TLe();Mf();jIe=P.objectWithoutOptionalProperties({errorId:RIe,fernFilepath:VV,name:Ro})});var rT,Ffe=h(()=>{"use strict";Me();$o();LH();Id();m$();wLe();rT=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),env:P.string().optional(),clientDefault:UV.optional(),defaultValue:P.unknown().optional(),v2Examples:eT.optional()}).extend(Wx)});var Xxr,Tto=h(()=>{"use strict";Me();$o();Mf();fp();vet();Xxr=P.objectWithoutOptionalProperties({name:Ro.optional(),shape:P.lazyObject(()=>uu)}).extend(g$).extend(ao)});var Zxr,Oto=h(()=>{"use strict";Me();$o();Id();fp();m$();Ffe();wLt();Tto();Zxr=P.objectWithoutOptionalProperties({name:jIe,displayName:P.string().optional(),discriminantValue:fs,type:P.lazy(()=>zs).optional(),statusCode:P.number(),isWildcardStatusCode:P.boolean().optional(),examples:P.list(Xxr),v2Examples:eT.optional(),headers:P.list(rT).optional()}).extend(ao)});var Vic,Gic=h(()=>{"use strict";Xr();Me();Id();Vic=P.union("type",{property:P.object({value:fs}),statusCode:P.object({})}).transform({transform:e=>{switch(e.type){case"property":return vIe.property(e.value);case"statusCode":return vIe.statusCode();default:return e}},untransform:({_visit:e,...t})=>t})});var Pto=h(()=>{"use strict";wLt();Oto();Gic();Tto()});var Bto={};te(Bto,{DeclaredErrorName:()=>jIe,ErrorDeclaration:()=>Zxr,ErrorDeclarationDiscriminantValue:()=>Vic,ExampleError:()=>Xxr});var qic=h(()=>{"use strict";Pto()});var $xr,Rto=h(()=>{"use strict";Me();$xr=P.objectWithoutOptionalProperties({username:P.string(),password:P.string()})});var eSr,Dto=h(()=>{"use strict";Me();eSr=P.objectWithoutOptionalProperties({token:P.string()})});var tSr,kto=h(()=>{"use strict";Me();tSr=P.objectWithoutOptionalProperties({value:P.unknown()})});var rSr,Fto=h(()=>{"use strict";Me();RLe();SLt();rSr=P.record(pD,NIe)});var nSr,Nto=h(()=>{"use strict";Me();nSr=P.objectWithoutOptionalProperties({clientId:P.string(),clientSecret:P.string()})});var Fet,iSr=h(()=>{"use strict";Xr();Me();Rto();Dto();kto();Nto();Fet=P.union("type",{basic:$xr,bearer:eSr,header:tSr,oauth:nSr}).transform({transform:e=>{switch(e.type){case"basic":return zV.basic(e);case"bearer":return zV.bearer(e);case"header":return zV.header(e);case"oauth":return zV.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t})});var oSr,jto=h(()=>{"use strict";Me();oSr=P.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var sSr,zto=h(()=>{"use strict";Me();jto();sSr=P.objectWithoutOptionalProperties({method:oSr,path:P.string()})});var Net,aSr=h(()=>{"use strict";Me();Det();Fto();Net=P.undiscriminatedUnion([b$,rSr])});var cSr,Qto=h(()=>{"use strict";Me();fp();cSr=P.objectWithoutOptionalProperties({name:P.string().optional(),language:P.string(),code:P.string()}).extend(ao)});var E$,uSr=h(()=>{"use strict";Me();E$=P.record(P.string(),P.unknown())});var lSr,Mto=h(()=>{"use strict";Me();fp();iSr();zto();aSr();uSr();lSr=P.objectWithoutOptionalProperties({endpoint:sSr,baseUrl:P.property("baseURL",P.string().optional()),environment:Net.optional(),auth:Fet.optional(),pathParameters:E$.optional(),queryParameters:E$.optional(),headers:E$.optional(),requestBody:P.unknown().optional()}).extend(ao)});var pSr,Lto=h(()=>{"use strict";Xr();Me();pSr=P.union("type",{error:P.object({value:P.unknown()}),json:P.object({value:P.unknown()}),stream:P.object({value:P.list(P.unknown())})}).transform({transform:e=>{switch(e.type){case"error":return Gx.error(e.value);case"json":return Gx.json(e.value);case"stream":return Gx.stream(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var fSr,_to=h(()=>{"use strict";Me();fp();Lto();fSr=P.objectWithoutOptionalProperties({statusCode:P.number().optional(),body:pSr.optional()}).extend(ao)});var TLt,Uto=h(()=>{"use strict";Me();Qto();Mto();_to();TLt=P.objectWithoutOptionalProperties({displayName:P.string().optional(),contentType:P.string().optional(),request:lSr.optional(),response:fSr.optional(),codeSamples:P.list(cSr).optional()})});var dSr,Vto=h(()=>{"use strict";Me();Uto();dSr=P.objectWithoutOptionalProperties({userSpecifiedExamples:P.record(P.string(),TLt),autogeneratedExamples:P.record(P.string(),TLt)})});var OLt,Gto=h(()=>{"use strict";Me();OLt=P.objectWithoutOptionalProperties({name:P.string().optional(),payload:P.unknown()})});var mSr,qto=h(()=>{"use strict";Me();Gto();mSr=P.objectWithoutOptionalProperties({userSpecifiedExamples:P.record(P.string(),OLt),autogeneratedExamples:P.record(P.string(),OLt)})});var hSr,Wto=h(()=>{"use strict";Me();hSr=P.objectWithoutOptionalProperties({path:P.string()})});var gSr,Hto=h(()=>{"use strict";Me();gSr=P.objectWithoutOptionalProperties({type:P.string(),body:P.unknown()})});var PLt,Kto=h(()=>{"use strict";Me();iSr();aSr();uSr();Wto();Hto();PLt=P.objectWithoutOptionalProperties({channel:hSr,baseUrl:P.property("baseURL",P.string().optional()),environment:Net.optional(),auth:Fet.optional(),pathParameters:E$.optional(),queryParameters:E$.optional(),headers:E$.optional(),messages:P.list(gSr).optional()})});var ASr,Jto=h(()=>{"use strict";Me();Kto();ASr=P.objectWithoutOptionalProperties({autogeneratedExamples:P.record(P.string(),PLt),userSpecifiedExamples:P.record(P.string(),PLt)})});var qy,lQ=h(()=>{"use strict";Me();m$();qy=P.objectWithoutOptionalProperties({v2Examples:eT.optional()})});var Yto=h(()=>{"use strict";Rto();Dto();kto();Fto();Nto();iSr();zto();jto();aSr();Qto();Uto();Vto();Mto();_to();Lto();n$i();m$();uSr();Gto();qto();Wto();Hto();Kto();Jto();lQ()});var Xto={};te(Xto,{BasicAuthValues:()=>$xr,BearerAuthValues:()=>eSr,HeaderAuthValues:()=>tSr,MultipleEnvironmentUrlValues:()=>rSr,OAuthValues:()=>nSr,V2AuthValues:()=>Fet,V2EndpointLocation:()=>sSr,V2EndpointLocationHttpMethod:()=>oSr,V2EnvironmentValues:()=>Net,V2HttpEndpointCodeSample:()=>cSr,V2HttpEndpointExample:()=>TLt,V2HttpEndpointExamples:()=>dSr,V2HttpEndpointRequest:()=>lSr,V2HttpEndpointResponse:()=>fSr,V2HttpEndpointResponseBody:()=>pSr,V2SchemaExample:()=>hLt,V2SchemaExamples:()=>eT,V2ValueExamples:()=>E$,V2WebSocketEndpointLocation:()=>hSr,V2WebSocketMessageExample:()=>gSr,V2WebSocketSessionExample:()=>PLt,V2WebSocketSessionExamples:()=>ASr,V2WebhookExample:()=>OLt,V2WebhookExamples:()=>mSr,WithV2Examples:()=>qy});var Wic=h(()=>{"use strict";Yto()});var ySr,Zto=h(()=>{"use strict";Me();ySr=P.enum_(["MIT","Apache-2.0"])});var bSr,$to=h(()=>{"use strict";Me();Zto();bSr=P.objectWithoutOptionalProperties({id:ySr})});var lI,I$=h(()=>{"use strict";Me();lI=P.string()});var ESr,ero=h(()=>{"use strict";Me();I$();ESr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),tokenEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var jet,ISr=h(()=>{"use strict";Me();jet=P.objectWithoutOptionalProperties({registryUrl:P.string(),token:P.string(),packageName:P.string()})});var vSr,tro=h(()=>{"use strict";Me();vSr=P.objectWithoutOptionalProperties({filename:P.string()})});var CSr,rro=h(()=>{"use strict";Me();CSr=P.objectWithoutOptionalProperties({coordinatorUrl:P.string(),coordinatorUrlV2:P.string(),id:P.string()})});var xSr,nro=h(()=>{"use strict";Xr();Me();rro();xSr=P.union(P.discriminant("type","_type"),{local:P.object({}),remote:CSr}).transform({transform:e=>{switch(e.type){case"local":return gc.GeneratorEnvironment.local();case"remote":return gc.GeneratorEnvironment.remote(e);default:return e}},untransform:({_visit:e,...t})=>t})});var zet,SSr=h(()=>{"use strict";Me();zet=P.objectWithoutOptionalProperties({keyId:P.string(),password:P.string(),secretKey:P.string()})});var Qet,wSr=h(()=>{"use strict";Me();SSr();Qet=P.objectWithoutOptionalProperties({registryUrl:P.string(),username:P.string(),password:P.string(),coordinate:P.string(),signature:zet.optional()})});var Met,TSr=h(()=>{"use strict";Me();Met=P.objectWithoutOptionalProperties({registryUrl:P.string(),token:P.string(),packageName:P.string()})});var Let,OSr=h(()=>{"use strict";Me();Let=P.objectWithoutOptionalProperties({registryUrl:P.string(),apiKey:P.string(),packageName:P.string()})});var PSr,iro=h(()=>{"use strict";Me();PSr=P.objectWithoutOptionalProperties({apiKey:P.string(),workspaceId:P.string()})});var BSr,oro=h(()=>{"use strict";Me();BSr=P.objectWithoutOptionalProperties({name:P.string(),email:P.string()})});var RSr,sro=h(()=>{"use strict";Me();oro();RSr=P.objectWithoutOptionalProperties({description:P.string().optional(),authors:P.list(BSr).optional()})});var _et,DSr=h(()=>{"use strict";Me();sro();_et=P.objectWithoutOptionalProperties({keywords:P.list(P.string()).optional(),documentationLink:P.string().optional(),homepageLink:P.string().optional()}).extend(RSr)});var Uet,kSr=h(()=>{"use strict";Me();DSr();Uet=P.objectWithoutOptionalProperties({registryUrl:P.string(),username:P.string(),password:P.string(),packageName:P.string(),pypiMetadata:_et.optional()})});var Vet,FSr=h(()=>{"use strict";Me();Vet=P.objectWithoutOptionalProperties({registryUrl:P.string(),apiKey:P.string(),packageName:P.string()})});var NSr,aro=h(()=>{"use strict";Xr();Me();ISr();wSr();TSr();OSr();iro();kSr();FSr();NSr=P.union("type",{maven:Qet,npm:Met,pypi:Uet,postman:PSr,rubygems:Vet,nuget:Let,crates:jet}).transform({transform:e=>{switch(e.type){case"maven":return gc.GeneratorPublishTarget.maven(e);case"npm":return gc.GeneratorPublishTarget.npm(e);case"pypi":return gc.GeneratorPublishTarget.pypi(e);case"postman":return gc.GeneratorPublishTarget.postman(e);case"rubygems":return gc.GeneratorPublishTarget.rubygems(e);case"nuget":return gc.GeneratorPublishTarget.nuget(e);case"crates":return gc.GeneratorPublishTarget.crates(e);default:return e}},untransform:({_visit:e,...t})=>t})});var jSr,cro=h(()=>{"use strict";Me();SSr();jSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),username:P.string(),password:P.string(),group:P.string(),signature:zet.optional()})});var zSr,uro=h(()=>{"use strict";Me();zSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),token:P.string(),scope:P.string()})});var QSr,lro=h(()=>{"use strict";Me();cro();uro();QSr=P.objectWithoutOptionalProperties({maven:jSr,npm:zSr})});var MSr,pro=h(()=>{"use strict";Me();ISr();wSr();TSr();OSr();kSr();FSr();MSr=P.objectWithoutOptionalProperties({maven:Qet,npm:Met,pypi:Uet,rubygems:Vet,nuget:Let,crates:jet})});var Get,LSr=h(()=>{"use strict";Me();aro();lro();pro();Get=P.objectWithoutOptionalProperties({registries:QSr,registriesV2:MSr,publishTarget:NSr.optional(),version:P.string()})});var _Sr,fro=h(()=>{"use strict";Me();I$();_Sr=P.objectWithoutOptionalProperties({keyIdEnvironmentVariable:lI,passwordEnvironmentVariable:lI,secretKeyEnvironmentVariable:lI})});var USr,dro=h(()=>{"use strict";Me();I$();fro();USr=P.objectWithoutOptionalProperties({registryUrl:P.string(),coordinate:P.string(),usernameEnvironmentVariable:lI,passwordEnvironmentVariable:lI,signature:_Sr.optional(),shouldGeneratePublishWorkflow:P.boolean().optional()})});var VSr,mro=h(()=>{"use strict";Me();I$();VSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),tokenEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var GSr,hro=h(()=>{"use strict";Me();I$();GSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),apiKeyEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var qSr,gro=h(()=>{"use strict";Me();I$();qSr=P.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:lI,workspaceIdEnvironmentVariable:lI})});var WSr,Aro=h(()=>{"use strict";Me();I$();DSr();WSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),usernameEnvironmentVariable:lI,passwordEnvironmentVariable:lI,pypiMetadata:_et.optional(),shouldGeneratePublishWorkflow:P.boolean().optional()})});var HSr,yro=h(()=>{"use strict";Me();I$();HSr=P.objectWithoutOptionalProperties({registryUrl:P.string(),packageName:P.string(),apiKeyEnvironmentVariable:lI,shouldGeneratePublishWorkflow:P.boolean().optional()})});var KSr,bro=h(()=>{"use strict";Xr();Me();ero();dro();mro();hro();gro();Aro();yro();KSr=P.union("type",{npm:VSr,maven:USr,postman:qSr,pypi:WSr,rubygems:HSr,nuget:GSr,crates:ESr}).transform({transform:e=>{switch(e.type){case"npm":return gc.GithubPublishInfo.npm(e);case"maven":return gc.GithubPublishInfo.maven(e);case"postman":return gc.GithubPublishInfo.postman(e);case"pypi":return gc.GithubPublishInfo.pypi(e);case"rubygems":return gc.GithubPublishInfo.rubygems(e);case"nuget":return gc.GithubPublishInfo.nuget(e);case"crates":return gc.GithubPublishInfo.crates(e);default:return e}},untransform:({_visit:e,...t})=>t})});var JSr,Ero=h(()=>{"use strict";Me();bro();JSr=P.objectWithoutOptionalProperties({version:P.string(),repoUrl:P.string(),installationToken:P.string().optional(),branch:P.string().optional(),publishInfo:KSr.optional()})});var YSr,Iro=h(()=>{"use strict";Xr();Me();LSr();Ero();YSr=P.union("type",{publish:Get,downloadFiles:P.object({}),github:JSr}).transform({transform:e=>{switch(e.type){case"publish":return gc.OutputMode.publish(e);case"downloadFiles":return gc.OutputMode.downloadFiles();case"github":return gc.OutputMode.github(e);default:return e}},untransform:({_visit:e,...t})=>t})});var XSr,vro=h(()=>{"use strict";Me();XSr=P.objectWithoutOptionalProperties({packageDescription:P.property("package_description",P.string().optional()),publisherEmail:P.property("publisher_email",P.string().optional()),referenceUrl:P.property("reference_url",P.string().optional()),publisherName:P.property("publisher_name",P.string().optional())})});var ZSr,Cro=h(()=>{"use strict";Me();Iro();vro();ZSr=P.objectWithoutOptionalProperties({path:P.string(),snippetFilepath:P.string().optional(),snippetTemplateFilepath:P.string().optional(),publishingMetadata:XSr.optional(),mode:YSr})});var $Sr,xro=h(()=>{"use strict";Xr();Me();$to();tro();$Sr=P.union("type",{basic:bSr,custom:vSr}).transform({transform:e=>{switch(e.type){case"basic":return gc.LicenseConfig.basic(e);case"custom":return gc.LicenseConfig.custom(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Hic,Kic=h(()=>{"use strict";Me();nro();Cro();LSr();xro();Hic=P.objectWithoutOptionalProperties({dryRun:P.boolean(),irFilepath:P.string(),originalReadmeFilepath:P.string().optional(),license:$Sr.optional(),output:ZSr,publish:Get.optional(),workspaceName:P.string(),organization:P.string(),customConfig:P.unknown(),environment:xSr,whitelabel:P.boolean(),writeUnitTests:P.boolean(),generatePaginatedClients:P.boolean().optional(),generateOauthClients:P.boolean()})});var Sro=h(()=>{"use strict";$to();ero();ISr();tro();I$();Kic();nro();Cro();LSr();aro();lro();pro();Ero();bro();xro();Zto();SSr();fro();dro();cro();wSr();mro();uro();TSr();hro();OSr();sro();oro();Iro();iro();gro();vro();Aro();DSr();kSr();rro();yro();FSr()});var wro={};te(wro,{BasicLicense:()=>bSr,CratesGithubPublishInfo:()=>ESr,CratesRegistryConfig:()=>jet,CustomLicense:()=>vSr,EnvironmentVariable:()=>lI,GeneratorConfig:()=>Hic,GeneratorEnvironment:()=>xSr,GeneratorOutputConfig:()=>ZSr,GeneratorPublishConfig:()=>Get,GeneratorPublishTarget:()=>NSr,GeneratorRegistriesConfig:()=>QSr,GeneratorRegistriesConfigV2:()=>MSr,GithubOutputMode:()=>JSr,GithubPublishInfo:()=>KSr,LicenseConfig:()=>$Sr,LicenseId:()=>ySr,MavenCentralSignature:()=>zet,MavenCentralSignatureGithubInfo:()=>_Sr,MavenGithubPublishInfo:()=>USr,MavenRegistryConfig:()=>jSr,MavenRegistryConfigV2:()=>Qet,NpmGithubPublishInfo:()=>VSr,NpmRegistryConfig:()=>zSr,NpmRegistryConfigV2:()=>Met,NugetGithubPublishInfo:()=>GSr,NugetRegistryConfig:()=>Let,OutputMetadata:()=>RSr,OutputMetadataAuthor:()=>BSr,OutputMode:()=>YSr,PostmanConfig:()=>PSr,PostmanGithubPublishInfo:()=>qSr,PublishingMetadata:()=>XSr,PypiGithubPublishInfo:()=>WSr,PypiMetadata:()=>_et,PypiRegistryConfig:()=>Uet,RemoteGeneratorEnvironment:()=>CSr,RubyGemsGithubPublishInfo:()=>HSr,RubyGemsRegistryConfig:()=>Vet});var Jic=h(()=>{"use strict";Sro()});var Yic=h(()=>{"use strict";Jic();Sro()});var Tro={};te(Tro,{BasicLicense:()=>bSr,CratesGithubPublishInfo:()=>ESr,CratesRegistryConfig:()=>jet,CustomLicense:()=>vSr,EnvironmentVariable:()=>lI,GeneratorConfig:()=>Hic,GeneratorEnvironment:()=>xSr,GeneratorOutputConfig:()=>ZSr,GeneratorPublishConfig:()=>Get,GeneratorPublishTarget:()=>NSr,GeneratorRegistriesConfig:()=>QSr,GeneratorRegistriesConfigV2:()=>MSr,GithubOutputMode:()=>JSr,GithubPublishInfo:()=>KSr,LicenseConfig:()=>$Sr,LicenseId:()=>ySr,MavenCentralSignature:()=>zet,MavenCentralSignatureGithubInfo:()=>_Sr,MavenGithubPublishInfo:()=>USr,MavenRegistryConfig:()=>jSr,MavenRegistryConfigV2:()=>Qet,NpmGithubPublishInfo:()=>VSr,NpmRegistryConfig:()=>zSr,NpmRegistryConfigV2:()=>Met,NugetGithubPublishInfo:()=>GSr,NugetRegistryConfig:()=>Let,OutputMetadata:()=>RSr,OutputMetadataAuthor:()=>BSr,OutputMode:()=>YSr,PostmanConfig:()=>PSr,PostmanGithubPublishInfo:()=>qSr,PublishingMetadata:()=>XSr,PypiGithubPublishInfo:()=>WSr,PypiMetadata:()=>_et,PypiRegistryConfig:()=>Uet,RemoteGeneratorEnvironment:()=>CSr,RubyGemsGithubPublishInfo:()=>HSr,RubyGemsRegistryConfig:()=>Vet,config:()=>wro});var Xic=h(()=>{"use strict";Yic()});var Oro=h(()=>{"use strict";gxr();jeo();mxr();zeo()});var Pro={};te(Pro,{GlobalParameter:()=>Ret,GlobalParameterApplyMode:()=>dxr,GlobalParameterId:()=>Bet,GlobalParameterLocation:()=>hxr});var Zic=h(()=>{"use strict";Oro()});var DLe,ewr=h(()=>{"use strict";Me();$o();Id();DLe=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var zIe,twr=h(()=>{"use strict";Me();$o();Mf();zIe=P.objectWithoutOptionalProperties({name:Ro,value:P.lazyObject(()=>uu)})});var rwr,Bro=h(()=>{"use strict";Xr();Me();rwr=P.union("type",{single:P.object({}),exploded:P.object({}),commaSeparated:P.object({})}).transform({transform:e=>{switch(e.type){case"single":return Ew.single();case"exploded":return Ew.exploded();case"commaSeparated":return Ew.commaSeparated();default:return e}},untransform:({_visit:e,...t})=>t})});var qet,nwr=h(()=>{"use strict";Me();$o();Id();Bro();qet=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu),shape:rwr.optional()})});var iwr,Rro=h(()=>{"use strict";Me();$o();Id();iwr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var Wy,pQ=h(()=>{"use strict";Me();yLt();TLe();Mf();Dfe();Wy=P.objectWithoutOptionalProperties({typeId:cB,fernFilepath:VV,name:Ro,displayName:BIe.optional()})});var owr,Dro=h(()=>{"use strict";Me();$o();Id();pQ();owr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu),originalTypeDeclaration:Wy.optional()})});var Wet,swr=h(()=>{"use strict";Me();vet();Rro();Dro();Wet=P.objectWithoutOptionalProperties({properties:P.list(owr),extraProperties:P.list(iwr).optional()}).extend(g$)});var awr,kro=h(()=>{"use strict";Xr();Me();$o();swr();awr=P.union("type",{inlinedRequestBody:Wet,reference:P.lazyObject(()=>uu)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return rB.inlinedRequestBody(e);case"reference":return rB.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var cwr,Fro=h(()=>{"use strict";Me();$o();wLt();cwr=P.objectWithoutOptionalProperties({error:jIe,body:P.lazyObject(()=>uu).optional()})});var uwr,Nro=h(()=>{"use strict";Me();$o();uwr=P.objectWithoutOptionalProperties({event:P.string(),data:P.lazyObject(()=>uu)})});var lwr,jro=h(()=>{"use strict";Xr();Me();$o();Nro();lwr=P.union("type",{body:P.object({value:P.lazyObject(()=>uu).optional()}),stream:P.object({value:P.list(P.lazyObject(()=>uu))}),sse:P.object({value:P.list(uwr)})}).transform({transform:e=>{switch(e.type){case"body":return uy.body(e.value);case"stream":return uy.stream(e.value);case"sse":return uy.sse(e.value);default:return e}},untransform:({_visit:e,...t})=>t})});var pwr,zro=h(()=>{"use strict";Xr();Me();Fro();jro();pwr=P.union("type",{ok:P.object({value:lwr}),error:cwr}).transform({transform:e=>{switch(e.type){case"ok":return iA.ok(e.value);case"error":return iA.error(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Het,fwr=h(()=>{"use strict";Me();Mf();fp();ewr();twr();nwr();kro();zro();Het=P.objectWithoutOptionalProperties({id:P.string().optional(),name:Ro.optional(),url:P.string(),rootPathParameters:P.list(zIe),servicePathParameters:P.list(zIe),endpointPathParameters:P.list(zIe),serviceHeaders:P.list(DLe),endpointHeaders:P.list(DLe),queryParameters:P.list(qet),request:awr.optional(),response:pwr}).extend(ao)});var dwr,Qro=h(()=>{"use strict";Me();fwr();dwr=P.objectWithoutOptionalProperties({example:Het})});var Ket,mwr=h(()=>{"use strict";Me();OLe();fp();lQ();Ket=P.objectWithoutOptionalProperties({isOptional:P.boolean()}).extend(ao).extend(qy).extend(GV)});var Jet,hwr=h(()=>{"use strict";Me();fp();lQ();Jet=P.objectWithoutOptionalProperties({}).extend(ao).extend(qy)});var gwr,Mro=h(()=>{"use strict";Me();PIe();h$();gwr=P.objectWithoutOptionalProperties({page:tT,next:tE,results:tE})});var Awr,Lro=h(()=>{"use strict";Me();h$();Awr=P.objectWithoutOptionalProperties({results:tE})});var ywr,_ro=h(()=>{"use strict";Me();TLe();ywr=P.objectWithoutOptionalProperties({fernFilepath:VV})});var bwr,Uro=h(()=>{"use strict";Mf();bwr=Ro});var Ewr,Vro=h(()=>{"use strict";Me();Mf();fp();Ewr=P.objectWithoutOptionalProperties({name:Ro.optional(),language:P.string(),code:P.string(),install:P.string().optional()}).extend(ao)});var QIe,BLt=h(()=>{"use strict";Me();QIe=P.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","php","rust","swift"])});var Iwr,Gro=h(()=>{"use strict";Me();Mf();fp();BLt();Iwr=P.objectWithoutOptionalProperties({name:Ro.optional(),sdk:QIe,code:P.string()}).extend(ao)});var vwr,qro=h(()=>{"use strict";Xr();Me();Vro();Gro();vwr=P.union("type",{language:Ewr,sdk:Iwr}).transform({transform:e=>{switch(e.type){case"language":return F3.language(e);case"sdk":return F3.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Yet,Cwr=h(()=>{"use strict";Me();fp();lQ();Yet=P.objectWithoutOptionalProperties({}).extend(ao).extend(qy)});var xwr,Wro=h(()=>{"use strict";Me();Id();fp();xwr=P.objectWithoutOptionalProperties({key:fs,isOptional:P.boolean(),contentType:P.string().optional()}).extend(ao)});var Swr,Hro=h(()=>{"use strict";Me();Id();fp();Swr=P.objectWithoutOptionalProperties({key:fs,isOptional:P.boolean(),contentType:P.string().optional()}).extend(ao)});var wwr,Kro=h(()=>{"use strict";Xr();Me();Wro();Hro();wwr=P.union("type",{file:Swr,fileArray:xwr}).transform({transform:e=>{switch(e.type){case"file":return nQ.file(e);case"fileArray":return nQ.fileArray(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Twr,Jro=h(()=>{"use strict";Me();Twr=P.enum_(["exploded","json","form"])});var Xet,Owr=h(()=>{"use strict";Me();$o();Id();ILt();m$();gLt();Xet=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs),defaultValue:P.unknown().optional(),v2Examples:eT.optional(),propertyAccess:TIe.optional()}).extend(DIe)});var Pwr,Yro=h(()=>{"use strict";Me();OLe();Jro();Owr();Pwr=P.objectWithoutOptionalProperties({style:Twr.optional()}).extend(Xet).extend(GV)});var Bwr,Xro=h(()=>{"use strict";Xr();Me();Kro();Yro();Bwr=P.union("type",{file:P.object({value:wwr}),bodyProperty:Pwr}).transform({transform:e=>{switch(e.type){case"file":return qx.file(e.value);case"bodyProperty":return qx.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Zet,Rwr=h(()=>{"use strict";Me();Mf();OLe();fp();lQ();Xro();Zet=P.objectWithoutOptionalProperties({name:Ro,properties:P.list(Bwr)}).extend(ao).extend(qy).extend(GV)});var Dwr,Zro=h(()=>{"use strict";Me();Dwr=P.objectWithoutOptionalProperties({namespace:P.string()})});var kwr,$ro=h(()=>{"use strict";Me();Zro();kwr=P.objectWithoutOptionalProperties({csharp:Dwr.optional()})});var $et,Fwr=h(()=>{"use strict";Me();$ro();$et=P.objectWithoutOptionalProperties({filepath:P.string(),packageName:P.string().optional(),options:kwr.optional()})});var Nwr,eno=h(()=>{"use strict";Me();Mf();Fwr();Nwr=P.objectWithoutOptionalProperties({file:$et,name:Ro})});var jwr,tno=h(()=>{"use strict";Me();eno();jwr=P.objectWithoutOptionalProperties({service:Nwr})});var zwr,rno=h(()=>{"use strict";Me();Gvr();S$i();zwr=P.record(det,P.list(bCr))});var Qwr,nno=h(()=>{"use strict";Me();Qwr=P.enum_(["UNARY","CLIENT_STREAM","SERVER_STREAM","BIDIRECTIONAL_STREAM"])});var Mwr,ino=h(()=>{"use strict";Me();nno();Mwr=P.objectWithoutOptionalProperties({methodType:Qwr.optional()})});var Lwr,ono=h(()=>{"use strict";Xr();Me();ino();Lwr=P.union("type",{proto:Mwr,openapi:P.object({}),openrpc:P.object({})}).transform({transform:e=>{switch(e.type){case"proto":return cD.proto(e);case"openapi":return cD.openapi();case"openrpc":return cD.openrpc();default:return e}},untransform:({_visit:e,...t})=>t})});var ett,_wr=h(()=>{"use strict";Me();ett=P.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"])});var Uwr,sno=h(()=>{"use strict";Me();Uwr=P.objectWithoutOptionalProperties({pathParameter:P.string(),tail:P.string()})});var WV,ttt=h(()=>{"use strict";Me();sno();WV=P.objectWithoutOptionalProperties({head:P.string(),parts:P.list(Uwr)})});var rtt,Vwr=h(()=>{"use strict";Me();$o();OLe();fp();lQ();rtt=P.objectWithoutOptionalProperties({requestBodyType:P.lazy(()=>zs),required:P.boolean().optional()}).extend(ao).extend(GV).extend(qy)});var Gwr,ano=h(()=>{"use strict";Me();Mf();OLe();fp();lQ();pQ();Rfe();Owr();Gwr=P.objectWithoutOptionalProperties({name:Ro,extends:P.list(Wy),properties:P.list(Xet),extendedProperties:P.list(aB).optional(),extraProperties:P.property("extra-properties",P.boolean())}).extend(ao).extend(qy).extend(GV)});var ntt,qwr=h(()=>{"use strict";Xr();Me();mwr();Rwr();Vwr();ano();ntt=P.union("type",{inlinedRequestBody:Gwr,reference:rtt,fileUpload:Zet,bytes:Ket}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return bd.inlinedRequestBody(e);case"reference":return bd.reference(e);case"fileUpload":return bd.fileUpload(e);case"bytes":return bd.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Wwr,cno=h(()=>{"use strict";Me();$o();fp();lQ();Wwr=P.objectWithoutOptionalProperties({responseBodyType:P.lazy(()=>zs)}).extend(ao).extend(qy)});var Hwr,uno=h(()=>{"use strict";Me();$o();fp();lQ();Rfe();Hwr=P.objectWithoutOptionalProperties({responseBodyType:P.lazy(()=>zs),responseProperty:aB.optional()}).extend(ao).extend(qy)});var itt,Kwr=h(()=>{"use strict";Xr();Me();cno();uno();itt=P.union("type",{response:Wwr,nestedPropertyAsResponse:Hwr}).transform({transform:e=>{switch(e.type){case"response":return uI.response(e);case"nestedPropertyAsResponse":return uI.nestedPropertyAsResponse(e);default:return e}},untransform:({_visit:e,...t})=>t})});var Jwr,lno=h(()=>{"use strict";Me();$o();fp();lQ();Jwr=P.objectWithoutOptionalProperties({payload:P.lazy(()=>zs),terminator:P.string().optional()}).extend(ao).extend(qy)});var Ywr,pno=h(()=>{"use strict";Me();$o();fp();lQ();Ywr=P.objectWithoutOptionalProperties({payload:P.lazy(()=>zs),terminator:P.string().optional(),resumable:P.boolean().optional()}).extend(ao).extend(qy)});var Xwr,fno=h(()=>{"use strict";Me();fp();lQ();Xwr=P.objectWithoutOptionalProperties({}).extend(ao).extend(qy)});var ott,Zwr=h(()=>{"use strict";Xr();Me();lno();pno();fno();ott=P.union("type",{json:Jwr,text:Xwr,sse:Ywr}).transform({transform:e=>{switch(e.type){case"json":return dv.json(e);case"text":return dv.text(e);case"sse":return dv.sse(e);default:return e}},untransform:({_visit:e,...t})=>t})});var stt,$wr=h(()=>{"use strict";Me();fp();lQ();stt=P.objectWithoutOptionalProperties({contentType:P.string().optional()}).extend(ao).extend(qy)});var e1r,dno=h(()=>{"use strict";Xr();Me();hwr();Cwr();Kwr();$wr();e1r=P.union("type",{json:P.object({value:itt}),fileDownload:Yet,text:stt,bytes:Jet}).transform({transform:e=>{switch(e.type){case"json":return nB.json(e.value);case"fileDownload":return nB.fileDownload(e);case"text":return nB.text(e);case"bytes":return nB.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t})});var t1r,mno=h(()=>{"use strict";Me();dno();Zwr();t1r=P.objectWithoutOptionalProperties({nonStreamResponse:e1r,streamResponse:ott})});var r1r,hno=h(()=>{"use strict";Xr();Me();hwr();Cwr();Kwr();Zwr();mno();$wr();r1r=P.union("type",{json:P.object({value:itt}),fileDownload:Yet,text:stt,bytes:Jet,streaming:P.object({value:ott}),streamParameter:t1r}).transform({transform:e=>{switch(e.type){case"json":return ju.json(e.value);case"fileDownload":return ju.fileDownload(e);case"text":return ju.text(e);case"bytes":return ju.bytes(e);case"streaming":return ju.streaming(e.value);case"streamParameter":return ju.streamParameter(e);default:return e}},untransform:({_visit:e,...t})=>t})});var MIe,RLt=h(()=>{"use strict";Me();fp();hno();MIe=P.objectWithoutOptionalProperties({statusCode:P.property("status-code",P.number().optional()),isWildcardStatusCode:P.boolean().optional(),body:r1r.optional()}).extend(ao)});var n1r,gno=h(()=>{"use strict";Me();PIe();h$();n1r=P.objectWithoutOptionalProperties({page:tT,results:tE,hasNextPage:tE.optional(),step:tT.optional()})});var i1r,Ano=h(()=>{"use strict";Me();h$();i1r=P.objectWithoutOptionalProperties({nextPath:tE,results:tE})});var o1r,yno=h(()=>{"use strict";Me();h$();o1r=P.objectWithoutOptionalProperties({nextUri:tE,results:tE})});var s1r,bno=h(()=>{"use strict";Xr();Me();Mro();Lro();gno();Ano();yno();s1r=P.union("type",{cursor:gwr,offset:n1r,custom:Awr,uri:o1r,path:i1r}).transform({transform:e=>{switch(e.type){case"cursor":return $0.cursor(e);case"offset":return $0.offset(e);case"custom":return $0.custom(e);case"uri":return $0.uri(e);case"path":return $0.path(e);default:return e}},untransform:({_visit:e,...t})=>t})});var att,a1r=h(()=>{"use strict";Me();att=P.string()});var c1r,Eno=h(()=>{"use strict";Me();c1r=P.enum_(["ROOT","SERVICE","ENDPOINT"])});var UH,ctt=h(()=>{"use strict";Me();$o();Mf();fp();m$();wLe();a1r();Eno();UH=P.objectWithoutOptionalProperties({name:Ro,valueType:P.lazy(()=>zs),location:c1r,variable:att.optional(),clientDefault:UV.optional(),v2Examples:eT.optional(),explode:P.boolean().optional()}).extend(ao)});var u1r,Ino=h(()=>{"use strict";Me();fp();wLt();u1r=P.objectWithoutOptionalProperties({error:jIe}).extend(ao)});var l1r,vno=h(()=>{"use strict";Me();Ino();l1r=P.list(u1r)});var p1r,Cno=h(()=>{"use strict";Me();p1r=P.objectWithoutOptionalProperties({disabled:P.boolean().optional()})});var f1r,xno=h(()=>{"use strict";Me();Cno();f1r=P.undiscriminatedUnion([p1r])});var d1r,Sno=h(()=>{"use strict";Xr();Me();mwr();Vwr();d1r=P.union("type",{typeReference:rtt,bytes:Ket}).transform({transform:e=>{switch(e.type){case"typeReference":return DH.typeReference(e);case"bytes":return DH.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t})});var m1r,wno=h(()=>{"use strict";Me();Mf();m1r=P.objectWithoutOptionalProperties({wrapperName:Ro,bodyKey:Ro,includePathParameters:P.boolean().optional(),onlyPathParameters:P.boolean().optional()})});var h1r,Tno=h(()=>{"use strict";Xr();Me();Sno();wno();h1r=P.union("type",{justRequestBody:P.object({value:d1r}),wrapper:m1r}).transform({transform:e=>{switch(e.type){case"justRequestBody":return QV.justRequestBody(e.value);case"wrapper":return QV.wrapper(e);default:return e}},untransform:({_visit:e,...t})=>t})});var g1r,Ono=h(()=>{"use strict";Me();Mf();PIe();Tno();g1r=P.objectWithoutOptionalProperties({streamParameter:tT.optional(),requestParameterName:Ro,shape:h1r})});var utt,A1r=h(()=>{"use strict";Xr();Me();tno();utt=P.union("type",{http:P.object({}),grpc:jwr}).transform({transform:e=>{switch(e.type){case"http":return MV.http();case"grpc":return MV.grpc(e);default:return e}},untransform:({_visit:e,...t})=>t})});var y1r,Pno=h(()=>{"use strict";Me();qro();fwr();y1r=P.objectWithoutOptionalProperties({codeSamples:P.list(vwr).optional(),example:Het.optional()})});var b1r,Bno=h(()=>{"use strict";Me();qwr();b1r=P.objectWithoutOptionalProperties({requestBodies:P.list(ntt).optional()})});var E1r,Rno=h(()=>{"use strict";Me();RLt();E1r=P.objectWithoutOptionalProperties({responses:P.list(MIe).optional()})});var I1r,Dno=h(()=>{"use strict";Me();Uvr();LH();dLt();RLe();Vto();mxr();Qro();Uro();rno();ono();Ffe();_wr();ttt();qwr();RLt();bno();ctt();ALt();vno();xno();Ono();A1r();Pno();Bno();Rno();I1r=P.objectWithoutOptionalProperties({id:Bfe,name:bwr,displayName:P.string().optional(),subtitle:P.string().optional(),method:ett,headers:P.list(rT),responseHeaders:P.list(rT).optional(),baseUrl:pD.optional(),v2BaseUrls:P.list(pD).optional(),basePath:WV.optional(),path:WV,fullPath:WV,pathParameters:P.list(UH),allPathParameters:P.list(UH),queryParameters:P.list(OIe),requestBody:ntt.optional(),v2RequestBodies:b1r.optional(),sdkRequest:g1r.optional(),response:MIe.optional(),v2Responses:E1r.optional(),errors:l1r,auth:P.boolean(),security:P.list(zwr).optional(),idempotent:P.boolean(),pagination:s1r.optional(),userSpecifiedExamples:P.list(y1r),autogeneratedExamples:P.list(dwr),v2Examples:dSr.optional(),transport:utt.optional(),source:Lwr.optional(),audiences:P.list(pet).optional(),retries:f1r.optional(),globalParameters:P.list(Bet).optional(),apiPlayground:P.boolean().optional()}).extend(Wx)});var v1r,kno=h(()=>{"use strict";Me();v1r=P.objectWithoutOptionalProperties({})});var C1r,Fno=h(()=>{"use strict";Me();C1r=P.objectWithoutOptionalProperties({})});var x1r,Nno=h(()=>{"use strict";Me();x1r=P.objectWithoutOptionalProperties({name:P.string(),namespace:P.string().optional(),prefix:P.string().optional()})});var ltt,S1r=h(()=>{"use strict";Me();kno();Fno();Nno();ltt=P.objectWithoutOptionalProperties({json:v1r.optional(),proto:C1r.optional(),xml:x1r.optional()})});var w1r,jno=h(()=>{"use strict";Me();Uvr();get();S1r();_ro();Dno();Ffe();ttt();ctt();A1r();w1r=P.objectWithoutOptionalProperties({availability:d$.optional(),name:ywr,displayName:P.string().optional(),basePath:WV,endpoints:P.list(I1r),headers:P.list(rT),pathParameters:P.list(UH),encoding:ltt.optional(),transport:utt.optional(),audiences:P.list(pet).optional()})});var zno=h(()=>{"use strict";Qro();mwr();hwr();Mro();Lro();_ro();Uro();qro();Vro();Gro();fwr();Fro();jro();ewr();swr();Rro();Dro();twr();nwr();Bro();kro();zro();Nro();Cwr();Kro();Wro();Hro();Yro();Jro();Rwr();Xro();tno();Dno();rno();ono();Ffe();_wr();ttt();sno();qwr();Vwr();RLt();hno();jno();ano();Owr();Kwr();cno();uno();lno();dno();gno();bno();Ano();ctt();Eno();Xvr();ino();ALt();PIe();a$i();Ino();vno();h$();xno();Cno();Ono();Sno();Tno();wno();pno();Zwr();mno();BLt();$wr();fno();A1r();yno();Pno();Bno();Rno()});var Qno={};te(Qno,{AutogeneratedEndpointExample:()=>dwr,BytesRequest:()=>Ket,BytesResponse:()=>Jet,CursorPagination:()=>gwr,CustomPagination:()=>Awr,DeclaredServiceName:()=>ywr,EndpointName:()=>bwr,ExampleCodeSample:()=>vwr,ExampleCodeSampleLanguage:()=>Ewr,ExampleCodeSampleSdk:()=>Iwr,ExampleEndpointCall:()=>Het,ExampleEndpointErrorResponse:()=>cwr,ExampleEndpointSuccessResponse:()=>lwr,ExampleHeader:()=>DLe,ExampleInlinedRequestBody:()=>Wet,ExampleInlinedRequestBodyExtraProperty:()=>iwr,ExampleInlinedRequestBodyProperty:()=>owr,ExamplePathParameter:()=>zIe,ExampleQueryParameter:()=>qet,ExampleQueryParameterShape:()=>rwr,ExampleRequestBody:()=>awr,ExampleResponse:()=>pwr,ExampleServerSideEvent:()=>uwr,FileDownloadResponse:()=>Yet,FileProperty:()=>wwr,FilePropertyArray:()=>xwr,FilePropertySingle:()=>Swr,FileUploadBodyProperty:()=>Pwr,FileUploadBodyPropertyEncoding:()=>Twr,FileUploadRequest:()=>Zet,FileUploadRequestProperty:()=>Bwr,GrpcTransport:()=>jwr,HttpEndpoint:()=>I1r,HttpEndpointSecurityItem:()=>zwr,HttpEndpointSource:()=>Lwr,HttpHeader:()=>rT,HttpMethod:()=>ett,HttpPath:()=>WV,HttpPathPart:()=>Uwr,HttpRequestBody:()=>ntt,HttpRequestBodyReference:()=>rtt,HttpResponse:()=>MIe,HttpResponseBody:()=>r1r,HttpService:()=>w1r,InlinedRequestBody:()=>Gwr,InlinedRequestBodyProperty:()=>Xet,JsonResponse:()=>itt,JsonResponseBody:()=>Wwr,JsonResponseBodyWithProperty:()=>Hwr,JsonStreamChunk:()=>Jwr,NonStreamHttpResponseBody:()=>e1r,OffsetPagination:()=>n1r,Pagination:()=>s1r,PathPagination:()=>i1r,PathParameter:()=>UH,PathParameterLocation:()=>c1r,PropertyPathItem:()=>Aet,ProtoSourceInfo:()=>Mwr,QueryParameter:()=>OIe,RequestProperty:()=>tT,RequestPropertyValue:()=>$vr,ResponseError:()=>u1r,ResponseErrors:()=>l1r,ResponseProperty:()=>tE,RetriesConfiguration:()=>f1r,RetriesDisabledSchema:()=>p1r,SdkRequest:()=>g1r,SdkRequestBodyType:()=>d1r,SdkRequestShape:()=>h1r,SdkRequestWrapper:()=>m1r,SseStreamChunk:()=>Ywr,StreamParameterResponse:()=>t1r,StreamingResponse:()=>ott,SupportedSdkLanguage:()=>QIe,TextResponse:()=>stt,TextStreamChunk:()=>Xwr,Transport:()=>utt,UriPagination:()=>o1r,UserSpecifiedEndpointExample:()=>y1r,V2HttpRequestBodies:()=>b1r,V2HttpResponses:()=>E1r});var $ic=h(()=>{"use strict";zno()});var T1r,Mno=h(()=>{"use strict";Me();T1r=P.string()});var O1r,Lno=h(()=>{"use strict";Me();Mno();O1r=P.objectWithoutOptionalProperties({id:T1r,protoRootUrl:P.string()})});var P1r,_no=h(()=>{"use strict";Xr();Me();Lno();P1r=P.union("type",{proto:O1r,openapi:P.object({})}).transform({transform:e=>{switch(e.type){case"proto":return iQ.proto(e);case"openapi":return iQ.openapi();default:return e}},untransform:({_visit:e,...t})=>t})});var Nfe,DLt=h(()=>{"use strict";Me();LH();Id();Nfe=P.objectWithoutOptionalProperties({name:fs}).extend(Wx)});var ptt,B1r=h(()=>{"use strict";Me();DLt();ptt=P.objectWithoutOptionalProperties({default:Nfe.optional(),values:P.list(Nfe),forwardCompatible:P.boolean().optional()})});var R1r,Uno=h(()=>{"use strict";Me();Ffe();B1r();R1r=P.objectWithoutOptionalProperties({header:rT,value:ptt})});var D1r,Vno=h(()=>{"use strict";Xr();Me();Uno();D1r=P.union("type",{header:R1r}).transform({transform:e=>e.type==="header"?CIe.header(e):e,untransform:({_visit:e,...t})=>t})});var k1r,Gno=h(()=>{"use strict";Me();BLt();k1r=P.objectWithoutOptionalProperties({generationLanguage:QIe.optional(),keywords:P.list(P.string()).optional(),smartCasing:P.boolean(),smartCasingDigitWordBoundary:P.boolean().optional()})});var F1r,qno=h(()=>{"use strict";Me();Id();F1r=P.objectWithoutOptionalProperties({discriminant:fs,contentProperty:fs})});var N1r,Wno=h(()=>{"use strict";Xr();Me();qno();N1r=P.union("type",{statusCode:P.object({}),property:F1r}).transform({transform:e=>{switch(e.type){case"statusCode":return j3.statusCode();case"property":return j3.property(e);default:return e}},untransform:({_visit:e,...t})=>t})});var j1r,Hno=h(()=>{"use strict";Me();j1r=P.enum_(["minimal","comprehensive"])});var z1r,Kno=h(()=>{"use strict";Me();z1r=P.enum_(["autopilot","autorelease","ci","manual"])});var Q1r,Jno=h(()=>{"use strict";Me();Kno();Q1r=P.objectWithoutOptionalProperties({cliVersion:P.string(),generatorName:P.string(),generatorVersion:P.string(),generatorConfig:P.unknown().optional(),originGitCommit:P.string().optional(),originGitCommitIsDirty:P.boolean().optional(),invokedBy:z1r.optional(),requestedVersion:P.string().optional(),ciProvider:P.string().optional()})});var M1r,Yno=h(()=>{"use strict";Me();_wr();M1r=P.objectWithoutOptionalProperties({headerName:P.string(),methods:P.list(ett)})});var L1r,Xno=h(()=>{"use strict";Me();L1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var _1r,Zno=h(()=>{"use strict";Me();_1r=P.objectWithoutOptionalProperties({version:P.string().optional(),modulePath:P.string().optional()})});var U1r,$no=h(()=>{"use strict";Me();U1r=P.objectWithoutOptionalProperties({coordinate:P.string().optional(),version:P.string().optional(),usernameEnvironmentVariable:P.string(),passwordEnvironmentVariable:P.string(),mavenUrlEnvironmentVariable:P.string()})});var V1r,eio=h(()=>{"use strict";Me();V1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional(),tokenEnvironmentVariable:P.string()})});var G1r,tio=h(()=>{"use strict";Me();G1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var q1r,rio=h(()=>{"use strict";Me();q1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var W1r,nio=h(()=>{"use strict";Me();W1r=P.objectWithoutOptionalProperties({apiKey:P.string(),workspaceId:P.string(),collectionId:P.string().optional()})});var H1r,iio=h(()=>{"use strict";Me();H1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var K1r,oio=h(()=>{"use strict";Me();K1r=P.objectWithoutOptionalProperties({version:P.string().optional(),packageName:P.string().optional()})});var LIe,kLt=h(()=>{"use strict";Xr();Me();Xno();Zno();$no();eio();tio();rio();nio();iio();oio();LIe=P.union("type",{postman:W1r,npm:V1r,maven:U1r,pypi:H1r,crates:L1r,go:_1r,nuget:G1r,rubygems:K1r,packagist:q1r}).transform({transform:e=>{switch(e.type){case"postman":return Ed.postman(e);case"npm":return Ed.npm(e);case"maven":return Ed.maven(e);case"pypi":return Ed.pypi(e);case"crates":return Ed.crates(e);case"go":return Ed.go(e);case"nuget":return Ed.nuget(e);case"rubygems":return Ed.rubygems(e);case"packagist":return Ed.packagist(e);default:return e}},untransform:({_visit:e,...t})=>t})});var J1r,sio=h(()=>{"use strict";Me();kLt();J1r=P.objectWithoutOptionalProperties({target:LIe})});var Y1r,aio=h(()=>{"use strict";Me();kLt();Y1r=P.objectWithoutOptionalProperties({generateFullProject:P.boolean(),publishTarget:LIe.optional()})});var X1r,cio=h(()=>{"use strict";Me();kLt();X1r=P.objectWithoutOptionalProperties({owner:P.string(),repo:P.string(),uri:P.string().optional(),token:P.string().optional(),mode:P.stringLiteral("pull-request").optional(),branch:P.string().optional(),target:LIe})});var Z1r,uio=h(()=>{"use strict";Xr();Me();sio();aio();cio();Z1r=P.union("type",{github:X1r,direct:J1r,filesystem:Y1r}).transform({transform:e=>{switch(e.type){case"github":return a$.github(e);case"direct":return a$.direct(e);case"filesystem":return a$.filesystem(e);default:return e}},untransform:({_visit:e,...t})=>t})});var FLt,lio=h(()=>{"use strict";Me();$o();Mf();fp();vet();FLt=P.objectWithoutOptionalProperties({name:Ro.optional(),shape:P.lazy(()=>ftt)}).extend(g$).extend(ao)});var $1r,pio=h(()=>{"use strict";Me();Mf();Fwr();$1r=P.objectWithoutOptionalProperties({file:$et,name:Ro})});var eTr,fio=h(()=>{"use strict";Xr();Me();eTr=P.union("type",{any:P.object({}),api:P.object({}),boolValue:P.object({}),bytesValue:P.object({}),doubleValue:P.object({}),duration:P.object({}),empty:P.object({}),enum:P.object({}),enumValue:P.object({}),field:P.object({}),fieldCardinality:P.object({}),fieldKind:P.object({}),fieldMask:P.object({}),floatValue:P.object({}),int32Value:P.object({}),int64Value:P.object({}),listValue:P.object({}),method:P.object({}),mixin:P.object({}),nullValue:P.object({}),option:P.object({}),sourceContext:P.object({}),stringValue:P.object({}),struct:P.object({}),syntax:P.object({}),timestamp:P.object({}),type:P.object({}),uint32Value:P.object({}),uint64Value:P.object({}),value:P.object({})}).transform({transform:e=>{switch(e.type){case"any":return Ci.any();case"api":return Ci.api();case"boolValue":return Ci.boolValue();case"bytesValue":return Ci.bytesValue();case"doubleValue":return Ci.doubleValue();case"duration":return Ci.duration();case"empty":return Ci.empty();case"enum":return Ci.enum();case"enumValue":return Ci.enumValue();case"field":return Ci.field();case"fieldCardinality":return Ci.fieldCardinality();case"fieldKind":return Ci.fieldKind();case"fieldMask":return Ci.fieldMask();case"floatValue":return Ci.floatValue();case"int32Value":return Ci.int32Value();case"int64Value":return Ci.int64Value();case"listValue":return Ci.listValue();case"method":return Ci.method();case"mixin":return Ci.mixin();case"nullValue":return Ci.nullValue();case"option":return Ci.option();case"sourceContext":return Ci.sourceContext();case"stringValue":return Ci.stringValue();case"struct":return Ci.struct();case"syntax":return Ci.syntax();case"timestamp":return Ci.timestamp();case"type":return Ci.type();case"uint32Value":return Ci.uint32Value();case"uint64Value":return Ci.uint64Value();case"value":return Ci.value();default:return e}},untransform:({_visit:e,...t})=>t})});var tTr,dio=h(()=>{"use strict";Xr();Me();pio();fio();tTr=P.union("type",{wellKnown:P.object({value:eTr}),userDefined:$1r}).transform({transform:e=>{switch(e.type){case"wellKnown":return Zp.wellKnown(e.value);case"userDefined":return Zp.userDefined(e);default:return e}},untransform:({_visit:e,...t})=>t})});var rTr,mio=h(()=>{"use strict";Xr();Me();dio();rTr=P.union("type",{proto:P.object({value:tTr})}).transform({transform:e=>e.type==="proto"?Sfe.proto(e.value):e,untransform:({_visit:e,...t})=>t})});var nTr,hio=h(()=>{"use strict";Me();nTr=P.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","DATE_TIME_RFC_2822","UUID","BASE_64","BIG_INTEGER"])});var iTr,gio=h(()=>{"use strict";Me();iTr=P.objectWithoutOptionalProperties({})});var oTr,Aio=h(()=>{"use strict";Me();oTr=P.objectWithoutOptionalProperties({default:P.string().optional()})});var sTr,yio=h(()=>{"use strict";Me();sTr=P.objectWithoutOptionalProperties({default:P.boolean().optional()})});var aTr,bio=h(()=>{"use strict";Me();aTr=P.objectWithoutOptionalProperties({})});var cTr,Eio=h(()=>{"use strict";Me();cTr=P.objectWithoutOptionalProperties({})});var uTr,Iio=h(()=>{"use strict";Me();uTr=P.objectWithoutOptionalProperties({})});var lTr,vio=h(()=>{"use strict";Me();lTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var pTr,Cio=h(()=>{"use strict";Me();vio();pTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:lTr.optional()})});var fTr,xio=h(()=>{"use strict";Me();fTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var dTr,Sio=h(()=>{"use strict";Me();xio();dTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:fTr.optional()})});var mTr,wio=h(()=>{"use strict";Me();mTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var hTr,Tio=h(()=>{"use strict";Me();wio();hTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:mTr.optional()})});var gTr,Oio=h(()=>{"use strict";Me();gTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var ATr,Pio=h(()=>{"use strict";Me();Oio();ATr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:gTr.optional()})});var yTr,Bio=h(()=>{"use strict";Me();yTr=P.objectWithoutOptionalProperties({format:P.string().optional(),pattern:P.string().optional(),minLength:P.number().optional(),maxLength:P.number().optional()})});var bTr,Rio=h(()=>{"use strict";Me();Bio();bTr=P.objectWithoutOptionalProperties({default:P.string().optional(),validation:yTr.optional()})});var ETr,Dio=h(()=>{"use strict";Me();ETr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var ITr,kio=h(()=>{"use strict";Me();Dio();ITr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:ETr.optional()})});var vTr,Fio=h(()=>{"use strict";Me();vTr=P.objectWithoutOptionalProperties({min:P.number().optional(),max:P.number().optional(),exclusiveMin:P.boolean().optional(),exclusiveMax:P.boolean().optional(),multipleOf:P.number().optional()})});var CTr,Nio=h(()=>{"use strict";Me();Fio();CTr=P.objectWithoutOptionalProperties({default:P.number().optional(),validation:vTr.optional()})});var xTr,jio=h(()=>{"use strict";Me();xTr=P.objectWithoutOptionalProperties({})});var STr,zio=h(()=>{"use strict";Xr();Me();gio();Aio();yio();bio();Eio();Iio();Cio();Sio();Tio();Pio();Rio();kio();Nio();jio();STr=P.union("type",{integer:hTr,long:ATr,uint:CTr,uint64:ITr,float:dTr,double:pTr,boolean:sTr,string:bTr,date:uTr,dateTime:cTr,dateTimeRfc2822:aTr,uuid:xTr,base64:iTr,bigInteger:oTr}).transform({transform:e=>{switch(e.type){case"integer":return Ei.integer(e);case"long":return Ei.long(e);case"uint":return Ei.uint(e);case"uint64":return Ei.uint64(e);case"float":return Ei.float(e);case"double":return Ei.double(e);case"boolean":return Ei.boolean(e);case"string":return Ei.string(e);case"date":return Ei.date(e);case"dateTime":return Ei.dateTime(e);case"dateTimeRfc2822":return Ei.dateTimeRfc2822(e);case"uuid":return Ei.uuid(e);case"base64":return Ei.base64(e);case"bigInteger":return Ei.bigInteger(e);default:return e}},untransform:({_visit:e,...t})=>t})});var dtt,wTr=h(()=>{"use strict";Me();hio();zio();dtt=P.objectWithoutOptionalProperties({v1:nTr,v2:STr.optional()})});var TTr,Qio=h(()=>{"use strict";Me();TTr=P.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"])});var OTr,Mio=h(()=>{"use strict";Me();pQ();Qio();OTr=P.objectWithoutOptionalProperties({name:Wy,shape:TTr})});var PTr,Lio=h(()=>{"use strict";Xr();Me();$o();wTr();Mio();PTr=P.union(P.discriminant("type","_type"),{container:P.object({container:P.lazy(()=>mtt)}),named:OTr,primitive:P.object({primitive:dtt}),unknown:P.object({})}).transform({transform:e=>{switch(e.type){case"container":return Iw.container(e.container);case"named":return Iw.named(e);case"primitive":return Iw.primitive(e.primitive);case"unknown":return Iw.unknown();default:return e}},untransform:({_visit:e,...t})=>t})});var BTr,_io=h(()=>{"use strict";Me();$o();Lio();BTr=P.objectWithoutOptionalProperties({aliasOf:P.lazy(()=>zs),resolvedType:PTr})});var RTr,Uio=h(()=>{"use strict";Me();fLt();pQ();Rfe();RTr=P.objectWithoutOptionalProperties({extends:P.list(Wy),properties:P.list(aB),extendedProperties:P.list(aB).optional(),extraProperties:P.property("extra-properties",P.boolean()),deferredUnionBaseProperties:P.list(SIe).optional()})});var DTr,Vio=h(()=>{"use strict";Me();$o();fp();DTr=P.objectWithoutOptionalProperties({type:P.lazy(()=>zs)}).extend(ao)});var kTr,Gio=h(()=>{"use strict";Me();Rfe();Vio();kTr=P.objectWithoutOptionalProperties({members:P.list(DTr),baseProperties:P.list(aB).optional()})});var FTr,qio=h(()=>{"use strict";Me();$o();Id();FTr=P.objectWithoutOptionalProperties({name:fs,type:P.lazy(()=>zs)})});var NTr,Wio=h(()=>{"use strict";Xr();Me();pQ();qio();NTr=P.union(P.discriminant("propertiesType","_type"),{samePropertiesAsObject:Wy,singleProperty:FTr,noProperties:P.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return X1.samePropertiesAsObject(e);case"singleProperty":return X1.singleProperty(e);case"noProperties":return X1.noProperties();default:return e}},untransform:({_visit:e,...t})=>t})});var NLt,Hio=h(()=>{"use strict";Me();get();Id();fp();Wio();NLt=P.objectWithoutOptionalProperties({discriminantValue:fs,shape:NTr,displayName:P.string().optional(),availability:d$.optional()}).extend(ao)});var jTr,Kio=h(()=>{"use strict";Me();jTr=P.enum_(["data","protocol"])});var zTr,Jio=h(()=>{"use strict";Me();fLt();Id();pQ();Rfe();Hio();Kio();zTr=P.objectWithoutOptionalProperties({discriminant:fs,extends:P.list(Wy),types:P.list(NLt),baseProperties:P.list(aB),inheritedBaseProperties:P.list(SIe).optional(),default:NLt.optional(),discriminatorContext:jTr.optional()})});var QTr,Yio=h(()=>{"use strict";Xr();Me();_io();B1r();Uio();Gio();Jio();QTr=P.union(P.discriminant("type","_type"),{alias:BTr,enum:ptt,object:RTr,union:zTr,undiscriminatedUnion:kTr}).transform({transform:e=>{switch(e.type){case"alias":return uc.alias(e);case"enum":return uc.enum(e);case"object":return uc.object(e);case"union":return uc.union(e);case"undiscriminatedUnion":return uc.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t})});var MTr,Xio=h(()=>{"use strict";Me();LH();Dfe();m$();pQ();S1r();lio();mio();Yio();MTr=P.objectWithoutOptionalProperties({name:Wy,shape:QTr,autogeneratedExamples:P.list(FLt),userProvidedExamples:P.list(FLt),v2Examples:eT.optional(),referencedTypes:P.set(cB),encoding:ltt.optional(),source:rTr.optional(),inline:P.boolean().optional()}).extend(Wx)});var LTr,Zio=h(()=>{"use strict";Me();$o();Mf();fp();a1r();LTr=P.objectWithoutOptionalProperties({id:att,name:Ro,type:P.lazy(()=>zs),envVar:P.string().optional()}).extend(ao)});var _Tr,$io=h(()=>{"use strict";Me();$o();Mf();fp();_Tr=P.objectWithoutOptionalProperties({name:Ro.optional(),payload:P.lazyObject(()=>uu)}).extend(ao)});var UTr,eoo=h(()=>{"use strict";Me();UTr=P.enum_(["GET","POST"])});var VTr,too=h(()=>{"use strict";Mf();VTr=Ro});var GTr,roo=h(()=>{"use strict";Me();$o();Id();ILt();GTr=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs)}).extend(DIe)});var qTr,noo=h(()=>{"use strict";Me();Mf();pQ();roo();qTr=P.objectWithoutOptionalProperties({name:Ro,extends:P.list(Wy),properties:P.list(GTr)})});var WTr,ioo=h(()=>{"use strict";Me();$o();fp();WTr=P.objectWithoutOptionalProperties({payloadType:P.lazy(()=>zs)}).extend(ao)});var HTr,ooo=h(()=>{"use strict";Xr();Me();noo();ioo();HTr=P.union("type",{inlinedPayload:qTr,reference:WTr}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return Z1.inlinedPayload(e);case"reference":return Z1.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var KTr,soo=h(()=>{"use strict";Me();KTr=P.enum_(["RSA_SHA256","RSA_SHA384","RSA_SHA512","ECDSA_SHA256","ECDSA_SHA384","ECDSA_SHA512","ED25519"])});var JTr,aoo=h(()=>{"use strict";Me();Id();JTr=P.objectWithoutOptionalProperties({url:P.string(),keyIdHeader:fs.optional()})});var YTr,coo=h(()=>{"use strict";Me();YTr=P.objectWithoutOptionalProperties({})});var XTr,uoo=h(()=>{"use strict";Xr();Me();aoo();coo();XTr=P.union("type",{jwks:JTr,static:YTr}).transform({transform:e=>{switch(e.type){case"jwks":return FH.jwks(e);case"static":return FH.static(e);default:return e}},untransform:({_visit:e,...t})=>t})});var ZTr,loo=h(()=>{"use strict";Me();ZTr=P.enum_(["ALPHABETICAL"])});var $Tr,poo=h(()=>{"use strict";Me();$Tr=P.enum_(["BODY","TIMESTAMP","NOTIFICATION_URL","MESSAGE_ID"])});var htt,eOr=h(()=>{"use strict";Me();loo();poo();htt=P.objectWithoutOptionalProperties({components:P.list($Tr),delimiter:P.string(),bodySort:ZTr.optional()})});var _Ie,jLt=h(()=>{"use strict";Me();_Ie=P.enum_(["BASE64","HEX"])});var tOr,foo=h(()=>{"use strict";Me();tOr=P.enum_(["UNIX_SECONDS","UNIX_MILLIS","ISO8601"])});var gtt,rOr=h(()=>{"use strict";Me();Id();foo();gtt=P.objectWithoutOptionalProperties({headerName:fs,format:tOr,tolerance:P.number().optional()})});var nOr,doo=h(()=>{"use strict";Me();Id();soo();uoo();eOr();jLt();rOr();nOr=P.objectWithoutOptionalProperties({signatureHeaderName:fs,algorithm:KTr,encoding:_Ie,signaturePrefix:P.string().optional(),keySource:XTr,payloadFormat:htt.optional(),timestamp:gtt.optional()})});var Att,iOr=h(()=>{"use strict";Me();Att=P.enum_(["SHA256","SHA1","SHA384","SHA512"])});var oOr,moo=h(()=>{"use strict";Me();iOr();oOr=P.objectWithoutOptionalProperties({wireValue:P.string(),algorithm:Att})});var sOr,hoo=h(()=>{"use strict";Me();Id();moo();sOr=P.objectWithoutOptionalProperties({headerName:fs,keyIdDelimiter:P.string().optional(),keyIdParameter:P.string().optional(),algorithmParameter:P.string().optional(),algorithms:P.list(oOr)})});var aOr,goo=h(()=>{"use strict";Me();aOr=P.enum_(["SHA256","SHA1","SHA384","SHA512"])});var cOr,Aoo=h(()=>{"use strict";Me();cOr=P.objectWithoutOptionalProperties({name:P.string()})});var uOr,yoo=h(()=>{"use strict";Xr();Me();Aoo();uOr=P.union("type",{queryParameter:cOr}).transform({transform:e=>e.type==="queryParameter"?xIe.queryParameter(e):e,untransform:({_visit:e,...t})=>t})});var lOr,boo=h(()=>{"use strict";Me();goo();yoo();jLt();lOr=P.objectWithoutOptionalProperties({algorithm:aOr,encoding:_Ie,location:uOr})});var pOr,Eoo=h(()=>{"use strict";Me();pOr=P.objectWithoutOptionalProperties({portVariants:P.boolean(),legacyQueryEncoding:P.boolean()})});var fOr,Ioo=h(()=>{"use strict";Me();Id();iOr();hoo();boo();Eoo();eOr();jLt();rOr();fOr=P.objectWithoutOptionalProperties({signatureHeaderName:fs,algorithm:Att,encoding:_Ie,signaturePrefix:P.string().optional(),payloadFormat:htt,timestamp:gtt.optional(),bodyHashBinding:lOr.optional(),notificationUrlNormalization:pOr.optional(),algorithmHeader:sOr.optional()})});var ytt,dOr=h(()=>{"use strict";Xr();Me();doo();Ioo();ytt=P.union("type",{hmac:fOr,asymmetric:nOr}).transform({transform:e=>{switch(e.type){case"hmac":return zH.hmac(e);case"asymmetric":return zH.asymmetric(e);default:return e}},untransform:({_visit:e,...t})=>t})});var mOr,voo=h(()=>{"use strict";Me();LH();B$i();qto();Rwr();Ffe();RLt();$io();eoo();too();ooo();dOr();mOr=P.objectWithoutOptionalProperties({id:vCr,name:VTr,displayName:P.string().optional(),method:UTr,headers:P.list(rT),payload:HTr,signatureVerification:ytt.optional(),fileUploadPayload:Zet.optional(),responses:P.list(MIe).optional(),examples:P.list(_Tr).optional(),v2Examples:mSr.optional()}).extend(Wx)});var hOr,Coo=h(()=>{"use strict";Me();voo();hOr=P.list(mOr)});var gOr,xoo=h(()=>{"use strict";Xr();Me();$o();swr();gOr=P.union("type",{inlinedBody:Wet,reference:P.lazyObject(()=>uu)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return z3.inlinedBody(e);case"reference":return z3.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var btt,AOr=h(()=>{"use strict";Me();btt=P.string()});var yOr,Soo=h(()=>{"use strict";Me();xoo();AOr();yOr=P.objectWithoutOptionalProperties({type:btt,body:gOr})});var bOr,woo=h(()=>{"use strict";Me();Mf();fp();ewr();twr();nwr();Soo();bOr=P.objectWithoutOptionalProperties({name:Ro.optional(),url:P.string(),pathParameters:P.list(zIe),headers:P.list(DLe),queryParameters:P.list(qet),messages:P.list(yOr)}).extend(ao)});var EOr,Too=h(()=>{"use strict";Me();$o();Id();ILt();EOr=P.objectWithoutOptionalProperties({name:fs,valueType:P.lazy(()=>zs)}).extend(DIe)});var IOr,Ooo=h(()=>{"use strict";Me();Mf();pQ();Too();IOr=P.objectWithoutOptionalProperties({name:Ro,extends:P.list(Wy),properties:P.list(EOr)})});var vOr,Poo=h(()=>{"use strict";Me();$o();fp();vOr=P.objectWithoutOptionalProperties({bodyType:P.lazy(()=>zs)}).extend(ao)});var COr,Boo=h(()=>{"use strict";Xr();Me();Ooo();Poo();COr=P.union("type",{inlinedBody:IOr,reference:vOr}).transform({transform:e=>{switch(e.type){case"inlinedBody":return sB.inlinedBody(e);case"reference":return sB.reference(e);default:return e}},untransform:({_visit:e,...t})=>t})});var xOr,Roo=h(()=>{"use strict";Me();xOr=P.enum_(["client","server"])});var SOr,Doo=h(()=>{"use strict";Me();LH();Boo();AOr();Roo();SOr=P.objectWithoutOptionalProperties({type:btt,displayName:P.string().optional(),methodName:P.string().optional(),origin:xOr,body:COr}).extend(Wx)});var wOr,koo=h(()=>{"use strict";Mf();wOr=Ro});var TOr,Foo=h(()=>{"use strict";Me();LH();RLe();Jto();Ffe();ttt();ctt();ALt();woo();Doo();koo();TOr=P.objectWithoutOptionalProperties({name:wOr,displayName:P.string().optional(),connectMethodName:P.string().optional(),baseUrl:pD.optional(),path:WV,auth:P.boolean(),headers:P.list(rT),queryParameters:P.list(OIe),pathParameters:P.list(UH),messages:P.list(SOr),examples:P.list(bOr),v2Examples:ASr.optional(),apiPlayground:P.boolean().optional()}).extend(Wx)});var OOr,Noo=h(()=>{"use strict";Me();het();OOr=P.objectWithoutOptionalProperties({pointsTo:f$})});var Ett,POr=h(()=>{"use strict";Me();bLt();TLe();met();het();Dfe();ICr();CCr();fp();Noo();Ett=P.objectWithoutOptionalProperties({fernFilepath:VV,service:p$.optional(),types:P.list(cB),errors:P.list(RIe),webhooks:Eet.optional(),websocket:Iet.optional(),subpackages:P.list(f$),hasEndpointsInTree:P.boolean(),hasWebSocketInTree:P.boolean().optional(),navigationConfig:OOr.optional()}).extend(ao)});var BOr,joo=h(()=>{"use strict";Me();BLt();BOr=P.objectWithoutOptionalProperties({title:P.string(),language:QIe,content:P.string()})});var ROr,zoo=h(()=>{"use strict";Me();dLt();P$i();Hno();joo();ROr=P.objectWithoutOptionalProperties({defaultEndpoint:Bfe.optional(),bannerLink:P.string().optional(),introduction:P.string().optional(),apiReferenceLink:P.string().optional(),apiName:P.string().optional(),disabledFeatures:P.list(ELt).optional(),whiteLabel:P.boolean().optional(),features:P.record(ELt,P.list(Bfe)).optional(),customSections:P.list(BOr).optional(),exampleStyle:j1r.optional()})});var DOr,Qoo=h(()=>{"use strict";Me();DOr=P.objectWithoutOptionalProperties({header:P.stringLiteral("User-Agent"),value:P.string()})});var kOr,Moo=h(()=>{"use strict";Me();Qoo();kOr=P.objectWithoutOptionalProperties({language:P.string(),sdkName:P.string(),sdkVersion:P.string(),userAgent:DOr.optional()})});var FOr,Loo=h(()=>{"use strict";Me();dOr();Yno();Moo();FOr=P.objectWithoutOptionalProperties({isAuthMandatory:P.boolean(),hasStreamingEndpoints:P.boolean(),hasPaginatedEndpoints:P.boolean(),hasFileDownloadEndpoints:P.boolean(),platformHeaders:kOr,idempotencyKeyGeneration:M1r.optional(),webhookSignatureVerification:ytt.optional()})});var NOr,_oo=h(()=>{"use strict";Me();met();Dfe();NOr=P.objectWithoutOptionalProperties({typesReferencedOnlyByService:P.record(p$,P.list(cB)),sharedTypes:P.list(cB)})});var jOr,Uoo=h(()=>{"use strict";Me();_no();jOr=P.objectWithoutOptionalProperties({sources:P.list(P1r)})});var zOr,Voo=h(()=>{"use strict";Me();yLt();Mf();POr();zOr=P.objectWithoutOptionalProperties({name:Ro,displayName:BIe.optional()}).extend(Ett)});var eoc,toc=h(()=>{"use strict";Me();JZi();x$i();bLt();Mf();met();het();Dfe();ICr();CCr();k$i();oto();xto();Oto();gxr();Ffe();ttt();jno();ctt();uio();Xio();Zio();Coo();Foo();Vno();Gno();Wno();Jno();POr();zoo();Loo();_oo();Uoo();Voo();eoc=P.objectWithoutOptionalProperties({fdrApiDefinitionId:P.string().optional(),apiVersion:D1r.optional(),specVersion:P.string().optional(),apiName:Ro,apiDisplayName:P.string().optional(),apiDocs:P.string().optional(),auth:yCr,headers:P.list(rT),idempotencyHeaders:P.list(rT),types:P.record(cB,MTr),services:P.record(p$,w1r),webhookGroups:P.record(Eet,hOr),websocketChannels:P.record(Iet,TOr).optional(),errors:P.record(RIe,Zxr),subpackages:P.record(f$,zOr),rootPackage:Ett,constants:xCr,environments:Yxr.optional(),basePath:WV.optional(),pathParameters:P.list(UH),errorDiscriminationStrategy:N1r,sdkConfig:FOr,variables:P.list(LTr),globalParameters:P.list(Ret).optional(),serviceTypeReferenceInfo:NOr,readmeConfig:ROr.optional(),sourceConfig:jOr.optional(),publishConfig:Z1r.optional(),dynamic:Qxr.optional(),selfHosted:P.boolean().optional(),audiences:P.list(_vr).optional(),generationMetadata:Q1r.optional(),apiPlayground:P.boolean().optional(),casingsConfig:k1r.optional()})});var Goo=h(()=>{"use strict";_no();Mno();Vno();Gno();qno();Wno();Hno();Jno();Uno();Yno();toc();Kno();POr();Noo();Moo();Lno();zoo();joo();Loo();_oo();Uoo();Voo();Qoo()});var qoo={};te(qoo,{ApiDefinitionSource:()=>P1r,ApiDefinitionSourceId:()=>T1r,ApiVersionScheme:()=>D1r,CasingsConfig:()=>k1r,ErrorDiscriminationByPropertyStrategy:()=>F1r,ErrorDiscriminationStrategy:()=>N1r,ExampleStyle:()=>j1r,GenerationMetadata:()=>Q1r,HeaderApiVersionScheme:()=>R1r,IdempotencyKeyGeneration:()=>M1r,IntermediateRepresentation:()=>eoc,InvocationSource:()=>z1r,Package:()=>Ett,PackageNavigationConfig:()=>OOr,PlatformHeaders:()=>kOr,ProtoSource:()=>O1r,ReadmeConfig:()=>ROr,ReadmeCustomSection:()=>BOr,SdkConfig:()=>FOr,ServiceTypeReferenceInfo:()=>NOr,SourceConfig:()=>jOr,Subpackage:()=>zOr,UserAgent:()=>DOr});var roc=h(()=>{"use strict";Goo()});var Woo=h(()=>{"use strict";Zro();Fwr();$ro();nno();eno();dio();pio();fio()});var Hoo={};te(Hoo,{CsharpProtobufFileOptions:()=>Dwr,ProtobufFile:()=>$et,ProtobufFileOptions:()=>kwr,ProtobufMethodType:()=>Qwr,ProtobufService:()=>Nwr,ProtobufType:()=>tTr,UserDefinedProtobufType:()=>$1r,WellKnownProtobufType:()=>eTr});var noc=h(()=>{"use strict";Woo()});var Koo=h(()=>{"use strict";Xno();sio();aio();cio();Zno();$no();eio();tio();rio();nio();uio();kLt();iio();oio()});var Joo={};te(Joo,{CratesPublishTarget:()=>L1r,DirectPublish:()=>J1r,Filesystem:()=>Y1r,GithubPublish:()=>X1r,GoPublishTarget:()=>_1r,MavenPublishTarget:()=>U1r,NpmPublishTarget:()=>V1r,NugetPublishTarget:()=>G1r,PackagistPublishTarget:()=>q1r,PostmanPublishTarget:()=>W1r,PublishTarget:()=>LIe,PublishingConfig:()=>Z1r,PypiPublishTarget:()=>H1r,RubyGemsPublishTarget:()=>K1r});var ioc=h(()=>{"use strict";Koo()});var mtt,ooc=h(()=>{"use strict";Xr();Me();$o();wLe();mtt=P.union(P.discriminant("type","_type"),{list:P.object({list:P.lazy(()=>zs)}),map:P.lazyObject(()=>QOr),nullable:P.object({nullable:P.lazy(()=>zs)}),optional:P.object({optional:P.lazy(()=>zs)}),set:P.object({set:P.lazy(()=>zs)}),literal:P.object({literal:UV})}).transform({transform:e=>{switch(e.type){case"list":return Is.list(e.list);case"map":return Is.map(e);case"nullable":return Is.nullable(e.nullable);case"optional":return Is.optional(e.optional);case"set":return Is.set(e.set);case"literal":return Is.literal(e.literal);default:return e}},untransform:({_visit:e,...t})=>t})});var soc,aoc=h(()=>{"use strict";Me();pQ();DLt();soc=P.objectWithoutOptionalProperties({default:Nfe.optional(),name:Wy})});var MOr,coc=h(()=>{"use strict";Me();$o();MOr=P.objectWithoutOptionalProperties({value:P.lazyObject(()=>uu)})});var LOr,Yoo=h(()=>{"use strict";Me();LOr=P.objectWithoutOptionalProperties({datetime:P.date(),raw:P.string().optional()})});var _Or,Xoo=h(()=>{"use strict";Me();_Or=P.objectWithoutOptionalProperties({datetime:P.date(),raw:P.string().optional()})});var Itt,UOr=h(()=>{"use strict";Xr();Me();O$i();Yoo();Xoo();Itt=P.union("type",{integer:P.object({integer:P.number()}),long:P.object({long:P.number()}),uint:P.object({uint:P.number()}),uint64:P.object({uint64:P.number()}),float:P.object({float:P.number()}),double:P.object({double:P.number()}),boolean:P.object({boolean:P.boolean()}),string:P.object({string:ECr}),date:P.object({date:P.string()}),datetime:LOr,datetimeRfc2822:_Or,uuid:P.object({uuid:P.string()}),base64:P.object({base64:P.string()}),bigInteger:P.object({bigInteger:P.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Qi.integer(e.integer);case"long":return Qi.long(e.long);case"uint":return Qi.uint(e.uint);case"uint64":return Qi.uint64(e.uint64);case"float":return Qi.float(e.float);case"double":return Qi.double(e.double);case"boolean":return Qi.boolean(e.boolean);case"string":return Qi.string(e.string);case"date":return Qi.date(e.date);case"datetime":return Qi.datetime(e);case"datetimeRfc2822":return Qi.datetimeRfc2822(e);case"uuid":return Qi.uuid(e.uuid);case"base64":return Qi.base64(e.base64);case"bigInteger":return Qi.bigInteger(e.bigInteger);default:return e}},untransform:({_visit:e,...t})=>t})});var VOr,Zoo=h(()=>{"use strict";Me();UOr();VOr=P.objectWithoutOptionalProperties({literal:Itt})});var GOr,uoc=h(()=>{"use strict";Xr();Me();$o();Zoo();GOr=P.union("type",{list:P.lazyObject(()=>qOr),set:P.lazyObject(()=>JOr),optional:P.lazyObject(()=>KOr),nullable:P.lazyObject(()=>HOr),map:P.lazyObject(()=>WOr),literal:VOr}).transform({transform:e=>{switch(e.type){case"list":return Hu.list(e);case"set":return Hu.set(e);case"optional":return Hu.optional(e);case"nullable":return Hu.nullable(e);case"map":return Hu.map(e);case"literal":return Hu.literal(e);default:return e}},untransform:({_visit:e,...t})=>t})});var YOr,$oo=h(()=>{"use strict";Me();Id();YOr=P.objectWithoutOptionalProperties({value:fs})});var XOr,loc=h(()=>{"use strict";Me();$o();Id();XOr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var ZOr,poc=h(()=>{"use strict";Me();$o();ZOr=P.objectWithoutOptionalProperties({key:P.lazyObject(()=>uu),value:P.lazyObject(()=>uu)})});var qOr,foc=h(()=>{"use strict";Me();$o();qOr=P.objectWithoutOptionalProperties({list:P.list(P.lazyObject(()=>uu)),itemType:P.lazy(()=>zs)})});var WOr,doc=h(()=>{"use strict";Me();$o();WOr=P.objectWithoutOptionalProperties({map:P.list(P.lazyObject(()=>ZOr)),keyType:P.lazy(()=>zs),valueType:P.lazy(()=>zs)})});var $Or,moc=h(()=>{"use strict";Me();$o();pQ();$Or=P.objectWithoutOptionalProperties({typeName:Wy,shape:P.lazy(()=>ftt)})});var HOr,hoc=h(()=>{"use strict";Me();$o();HOr=P.objectWithoutOptionalProperties({nullable:P.lazyObject(()=>uu).optional(),valueType:P.lazy(()=>zs)})});var vtt,goc=h(()=>{"use strict";Me();$o();Id();pQ();gLt();vtt=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu),propertyAccess:TIe.optional(),originalTypeDeclaration:Wy})});var Ctt,Aoc=h(()=>{"use strict";Me();$o();Ctt=P.objectWithoutOptionalProperties({properties:P.list(P.lazyObject(()=>vtt)),extraProperties:P.list(P.lazyObject(()=>XOr)).optional()})});var ePr,yoc=h(()=>{"use strict";Me();$o();Dfe();ePr=P.objectWithoutOptionalProperties({typeId:cB,object:P.lazyObject(()=>Ctt)})});var KOr,boc=h(()=>{"use strict";Me();$o();KOr=P.objectWithoutOptionalProperties({optional:P.lazyObject(()=>uu).optional(),valueType:P.lazy(()=>zs)})});var JOr,Eoc=h(()=>{"use strict";Me();$o();JOr=P.objectWithoutOptionalProperties({set:P.list(P.lazyObject(()=>uu)),itemType:P.lazy(()=>zs)})});var tPr,Ioc=h(()=>{"use strict";Me();$o();Id();tPr=P.objectWithoutOptionalProperties({wireDiscriminantValue:fs,shape:P.lazy(()=>rPr)})});var rPr,voc=h(()=>{"use strict";Xr();Me();$o();rPr=P.union("type",{samePropertiesAsObject:P.lazyObject(()=>ePr),singleProperty:P.lazyObject(()=>uu),noProperties:P.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return c$.samePropertiesAsObject(e);case"singleProperty":return c$.singleProperty(e);case"noProperties":return c$.noProperties();default:return e}},untransform:({_visit:e,...t})=>t})});var uu,Coc=h(()=>{"use strict";Me();$o();vet();uu=P.objectWithoutOptionalProperties({shape:P.lazy(()=>nPr)}).extend(g$)});var nPr,xoc=h(()=>{"use strict";Xr();Me();$o();UOr();nPr=P.union("type",{primitive:P.object({primitive:Itt}),container:P.object({container:P.lazy(()=>GOr)}),unknown:P.object({unknown:P.unknown()}),named:P.lazyObject(()=>$Or)}).transform({transform:e=>{switch(e.type){case"primitive":return to.primitive(e.primitive);case"container":return to.container(e.container);case"unknown":return to.unknown(e.unknown);case"named":return to.named(e);default:return e}},untransform:({_visit:e,...t})=>t})});var ftt,Soc=h(()=>{"use strict";Xr();Me();$o();$oo();ftt=P.union("type",{alias:P.lazyObject(()=>MOr),enum:YOr,object:P.lazyObject(()=>Ctt),union:P.lazyObject(()=>oPr),undiscriminatedUnion:P.lazyObject(()=>iPr)}).transform({transform:e=>{switch(e.type){case"alias":return Ku.alias(e);case"enum":return Ku.enum(e);case"object":return Ku.object(e);case"union":return Ku.union(e);case"undiscriminatedUnion":return Ku.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t})});var iPr,woc=h(()=>{"use strict";Me();$o();iPr=P.objectWithoutOptionalProperties({index:P.number(),singleUnionType:P.lazyObject(()=>uu)})});var sPr,Toc=h(()=>{"use strict";Me();$o();Id();sPr=P.objectWithoutOptionalProperties({name:fs,value:P.lazyObject(()=>uu)})});var oPr,Ooc=h(()=>{"use strict";Me();$o();Id();oPr=P.objectWithoutOptionalProperties({discriminant:fs,singleUnionType:P.lazyObject(()=>tPr),extendProperties:P.list(P.lazyObject(()=>vtt)).optional(),baseProperties:P.list(P.lazyObject(()=>sPr)).optional()})});var QOr,Poc=h(()=>{"use strict";Me();$o();QOr=P.objectWithoutOptionalProperties({keyType:P.lazy(()=>zs),valueType:P.lazy(()=>zs)})});var aPr,eso=h(()=>{"use strict";Xr();Me();DLt();aPr=P.union("type",{enum:Nfe}).transform({transform:e=>e.type==="enum"?set.enum(e):e,untransform:({_visit:e,...t})=>t})});var cPr,tso=h(()=>{"use strict";Me();yLt();TLe();Mf();Dfe();eso();cPr=P.objectWithoutOptionalProperties({typeId:cB,fernFilepath:VV,name:Ro,displayName:BIe.optional(),default:aPr.optional(),inline:P.boolean().optional()})});var zs,Boc=h(()=>{"use strict";Xr();Me();$o();tso();wTr();zs=P.union(P.discriminant("type","_type"),{container:P.object({container:P.lazy(()=>mtt)}),named:cPr,primitive:P.object({primitive:dtt}),unknown:P.object({})}).transform({transform:e=>{switch(e.type){case"container":return Zr.container(e.container);case"named":return Zr.named(e);case"primitive":return Zr.primitive(e.primitive);case"unknown":return Zr.unknown();default:return e}},untransform:({_visit:e,...t})=>t})});var rso=h(()=>{"use strict";_io();gio();Aio();yio();ooc();bio();Eio();Iio();pQ();Cio();vio();S1r();B1r();aoc();DLt();coc();uoc();Yoo();Xoo();$oo();loc();poc();foc();Zoo();doc();moc();hoc();goc();Aoc();yoc();boc();UOr();Eoc();Ioc();voc();lio();Coc();xoc();Soc();woc();Toc();Ooc();Sio();xio();Tio();wio();kno();wLe();Pio();Oio();Poc();tso();eso();Rfe();gLt();Uio();wTr();hio();zio();Fno();Mio();Lio();Qio();Hio();Wio();qio();mio();Rio();Bio();Yio();Xio();Boc();kio();Dio();Nio();Fio();Vio();Gio();Kio();Jio();jio();Nno();o$i();i$i()});var nso={};te(nso,{AliasTypeDeclaration:()=>BTr,Base64Type:()=>iTr,BigIntegerType:()=>oTr,BooleanType:()=>sTr,ContainerType:()=>mtt,DateTimeRfc2822Type:()=>aTr,DateTimeType:()=>cTr,DateType:()=>uTr,DeclaredTypeName:()=>Wy,DoubleType:()=>pTr,DoubleValidationRules:()=>lTr,Encoding:()=>ltt,EnumTypeDeclaration:()=>ptt,EnumTypeReference:()=>soc,EnumValue:()=>Nfe,ExampleAliasType:()=>MOr,ExampleContainer:()=>GOr,ExampleDatetime:()=>LOr,ExampleDatetimeRfc2822:()=>_Or,ExampleEnumType:()=>YOr,ExampleExtraObjectProperty:()=>XOr,ExampleKeyValuePair:()=>ZOr,ExampleListContainer:()=>qOr,ExampleLiteralContainer:()=>VOr,ExampleMapContainer:()=>WOr,ExampleNamedType:()=>$Or,ExampleNullableContainer:()=>HOr,ExampleObjectProperty:()=>vtt,ExampleObjectType:()=>Ctt,ExampleObjectTypeWithTypeId:()=>ePr,ExampleOptionalContainer:()=>KOr,ExamplePrimitive:()=>Itt,ExampleSetContainer:()=>JOr,ExampleSingleUnionType:()=>tPr,ExampleSingleUnionTypeProperties:()=>rPr,ExampleType:()=>FLt,ExampleTypeReference:()=>uu,ExampleTypeReferenceShape:()=>nPr,ExampleTypeShape:()=>ftt,ExampleUndiscriminatedUnionType:()=>iPr,ExampleUnionBaseProperty:()=>sPr,ExampleUnionType:()=>oPr,FloatType:()=>dTr,FloatValidationRules:()=>fTr,IntegerType:()=>hTr,IntegerValidationRules:()=>mTr,JsonEncoding:()=>v1r,Literal:()=>UV,LongType:()=>ATr,LongValidationRules:()=>gTr,MapType:()=>QOr,NamedType:()=>cPr,NamedTypeDefault:()=>aPr,ObjectProperty:()=>aB,ObjectPropertyAccess:()=>TIe,ObjectTypeDeclaration:()=>RTr,PrimitiveType:()=>dtt,PrimitiveTypeV1:()=>nTr,PrimitiveTypeV2:()=>STr,ProtoEncoding:()=>C1r,ResolvedNamedType:()=>OTr,ResolvedTypeReference:()=>PTr,ShapeType:()=>TTr,SingleUnionType:()=>NLt,SingleUnionTypeProperties:()=>NTr,SingleUnionTypeProperty:()=>FTr,Source:()=>rTr,StringType:()=>bTr,StringValidationRules:()=>yTr,Type:()=>QTr,TypeDeclaration:()=>MTr,TypeReference:()=>zs,Uint64Type:()=>ITr,Uint64ValidationRules:()=>ETr,UintType:()=>CTr,UintValidationRules:()=>vTr,UndiscriminatedUnionMember:()=>DTr,UndiscriminatedUnionTypeDeclaration:()=>kTr,UnionDiscriminatorContext:()=>jTr,UnionTypeDeclaration:()=>zTr,UuidType:()=>xTr,XmlEncoding:()=>x1r,XmlPropertyEncoding:()=>Yvr,XmlPropertyKind:()=>Jvr});var Roc=h(()=>{"use strict";rso()});var iso=h(()=>{"use strict";Zio();a1r()});var oso={};te(oso,{VariableDeclaration:()=>LTr,VariableId:()=>att});var Doc=h(()=>{"use strict";iso()});var sso=h(()=>{"use strict";soo();doo();uoo();$io();iOr();Ioo();noo();roo();aoo();coo();voo();hoo();moo();goo();boo();yoo();Aoo();Coo();eoo();too();Eoo();ooo();loo();poo();eOr();ioo();jLt();dOr();rOr();foo()});var aso={};te(aso,{AsymmetricAlgorithm:()=>KTr,AsymmetricKeySignatureVerification:()=>nOr,AsymmetricKeySource:()=>XTr,ExampleWebhookCall:()=>_Tr,HmacAlgorithm:()=>Att,HmacSignatureVerification:()=>fOr,InlinedWebhookPayload:()=>qTr,InlinedWebhookPayloadProperty:()=>GTr,JwksKeySource:()=>JTr,StaticKeySource:()=>YTr,Webhook:()=>mOr,WebhookAlgorithmHeader:()=>sOr,WebhookAlgorithmOption:()=>oOr,WebhookBodyHashAlgorithm:()=>aOr,WebhookBodyHashBinding:()=>lOr,WebhookBodyHashLocation:()=>uOr,WebhookBodyHashQueryParameterLocation:()=>cOr,WebhookGroup:()=>hOr,WebhookHttpMethod:()=>UTr,WebhookName:()=>VTr,WebhookNotificationUrlNormalization:()=>pOr,WebhookPayload:()=>HTr,WebhookPayloadBodySort:()=>ZTr,WebhookPayloadComponent:()=>$Tr,WebhookPayloadFormat:()=>htt,WebhookPayloadReference:()=>WTr,WebhookSignatureEncoding:()=>_Ie,WebhookSignatureVerification:()=>ytt,WebhookTimestampConfig:()=>gtt,WebhookTimestampFormat:()=>tOr});var koc=h(()=>{"use strict";sso()});var cso=h(()=>{"use strict";Soo();xoo();woo();Ooo();Too();Foo();Doo();Boo();Poo();AOr();Roo();koo()});var uso={};te(uso,{ExampleWebSocketMessage:()=>yOr,ExampleWebSocketMessageBody:()=>gOr,ExampleWebSocketSession:()=>bOr,InlinedWebSocketMessageBody:()=>IOr,InlinedWebSocketMessageBodyProperty:()=>EOr,WebSocketChannel:()=>TOr,WebSocketMessage:()=>SOr,WebSocketMessageBody:()=>COr,WebSocketMessageBodyReference:()=>vOr,WebSocketMessageId:()=>btt,WebSocketMessageOrigin:()=>xOr,WebSocketName:()=>wOr});var Foc=h(()=>{"use strict";cso()});var Noc=h(()=>{"use strict";gic();YZi();Aic();w$i();yic();R$i();bic();F$i();_ic();Uic();Sto();qic();Pto();Wic();Yto();Xic();Zic();Oro();$ic();zno();roc();Goo();noc();Woo();ioc();Koo();Roc();rso();Doc();iso();koc();sso();Foc();cso()});var Gi={};te(Gi,{AliasTypeDeclaration:()=>BTr,ApiAuth:()=>yCr,ApiDefinitionSource:()=>P1r,ApiDefinitionSourceId:()=>T1r,ApiVersionScheme:()=>D1r,AsymmetricAlgorithm:()=>KTr,AsymmetricKeySignatureVerification:()=>nOr,AsymmetricKeySource:()=>XTr,AudienceDefinition:()=>_vr,AudienceReference:()=>pet,AuthScheme:()=>gCr,AuthSchemeKey:()=>det,AuthSchemesRequirement:()=>ACr,AuthScope:()=>bCr,AutogeneratedEndpointExample:()=>dwr,Availability:()=>d$,AvailabilityStatus:()=>Kvr,Base64Type:()=>iTr,BaseAuthScheme:()=>_V,BasicAuthScheme:()=>qvr,BasicAuthValues:()=>$xr,BearerAuthScheme:()=>Wvr,BearerAuthValues:()=>eSr,BigIntegerType:()=>oTr,BooleanType:()=>sTr,BytesRequest:()=>Ket,BytesResponse:()=>Jet,CasingsConfig:()=>k1r,Constants:()=>xCr,ContainerType:()=>mtt,CratesPublishTarget:()=>L1r,CsharpProtobufFileOptions:()=>Dwr,CursorPagination:()=>gwr,CustomPagination:()=>Awr,DateTimeRfc2822Type:()=>aTr,DateTimeType:()=>cTr,DateType:()=>uTr,Declaration:()=>Wx,DeclaredErrorName:()=>jIe,DeclaredServiceName:()=>ywr,DeclaredTypeName:()=>Wy,DirectPublish:()=>J1r,DisplayName:()=>BIe,DoubleType:()=>pTr,DoubleValidationRules:()=>lTr,Encoding:()=>ltt,EndpointId:()=>Bfe,EndpointName:()=>bwr,EndpointReference:()=>wIe,EnumTypeDeclaration:()=>ptt,EnumTypeReference:()=>soc,EnumValue:()=>Nfe,EnvironmentBaseUrlId:()=>pD,EnvironmentBaseUrlWithId:()=>Vxr,EnvironmentId:()=>b$,EnvironmentUrl:()=>NIe,EnvironmentVariable:()=>aQ,Environments:()=>Jxr,EnvironmentsConfig:()=>Yxr,ErrorDeclaration:()=>Zxr,ErrorDeclarationDiscriminantValue:()=>Vic,ErrorDiscriminationByPropertyStrategy:()=>F1r,ErrorDiscriminationStrategy:()=>N1r,ErrorId:()=>RIe,EscapedString:()=>ECr,ExampleAliasType:()=>MOr,ExampleCodeSample:()=>vwr,ExampleCodeSampleLanguage:()=>Ewr,ExampleCodeSampleSdk:()=>Iwr,ExampleContainer:()=>GOr,ExampleDatetime:()=>LOr,ExampleDatetimeRfc2822:()=>_Or,ExampleEndpointCall:()=>Het,ExampleEndpointErrorResponse:()=>cwr,ExampleEndpointSuccessResponse:()=>lwr,ExampleEnumType:()=>YOr,ExampleError:()=>Xxr,ExampleExtraObjectProperty:()=>XOr,ExampleHeader:()=>DLe,ExampleInlinedRequestBody:()=>Wet,ExampleInlinedRequestBodyExtraProperty:()=>iwr,ExampleInlinedRequestBodyProperty:()=>owr,ExampleKeyValuePair:()=>ZOr,ExampleListContainer:()=>qOr,ExampleLiteralContainer:()=>VOr,ExampleMapContainer:()=>WOr,ExampleNamedType:()=>$Or,ExampleNullableContainer:()=>HOr,ExampleObjectProperty:()=>vtt,ExampleObjectType:()=>Ctt,ExampleObjectTypeWithTypeId:()=>ePr,ExampleOptionalContainer:()=>KOr,ExamplePathParameter:()=>zIe,ExamplePrimitive:()=>Itt,ExampleQueryParameter:()=>qet,ExampleQueryParameterShape:()=>rwr,ExampleRequestBody:()=>awr,ExampleResponse:()=>pwr,ExampleServerSideEvent:()=>uwr,ExampleSetContainer:()=>JOr,ExampleSingleUnionType:()=>tPr,ExampleSingleUnionTypeProperties:()=>rPr,ExampleStyle:()=>j1r,ExampleType:()=>FLt,ExampleTypeReference:()=>uu,ExampleTypeReferenceShape:()=>nPr,ExampleTypeShape:()=>ftt,ExampleUndiscriminatedUnionType:()=>iPr,ExampleUnionBaseProperty:()=>sPr,ExampleUnionType:()=>oPr,ExampleWebSocketMessage:()=>yOr,ExampleWebSocketMessageBody:()=>gOr,ExampleWebSocketSession:()=>bOr,ExampleWebhookCall:()=>_Tr,FeatureId:()=>ELt,FernFilepath:()=>VV,FileDownloadResponse:()=>Yet,FileProperty:()=>wwr,FilePropertyArray:()=>xwr,FilePropertySingle:()=>Swr,FileUploadBodyProperty:()=>Pwr,FileUploadBodyPropertyEncoding:()=>Twr,FileUploadRequest:()=>Zet,FileUploadRequestProperty:()=>Bwr,Filesystem:()=>Y1r,FloatType:()=>dTr,FloatValidationRules:()=>fTr,GenerationMetadata:()=>Q1r,GithubPublish:()=>X1r,GlobalParameter:()=>Ret,GlobalParameterApplyMode:()=>dxr,GlobalParameterId:()=>Bet,GlobalParameterLocation:()=>hxr,GoPublishTarget:()=>_1r,GrpcTransport:()=>jwr,HeaderApiVersionScheme:()=>R1r,HeaderAuthScheme:()=>Hvr,HeaderAuthValues:()=>tSr,HmacAlgorithm:()=>Att,HmacSignatureVerification:()=>fOr,HttpEndpoint:()=>I1r,HttpEndpointSecurityItem:()=>zwr,HttpEndpointSource:()=>Lwr,HttpHeader:()=>rT,HttpMethod:()=>ett,HttpPath:()=>WV,HttpPathPart:()=>Uwr,HttpRequestBody:()=>ntt,HttpRequestBodyReference:()=>rtt,HttpResponse:()=>MIe,HttpResponseBody:()=>r1r,HttpService:()=>w1r,IdempotencyKeyGeneration:()=>M1r,InferredAuthGrantType:()=>eCr,InferredAuthScheme:()=>rCr,InferredAuthSchemeTokenEndpoint:()=>tCr,InferredAuthenticatedRequestHeader:()=>Zvr,InlinedRequestBody:()=>Gwr,InlinedRequestBodyProperty:()=>Xet,InlinedWebSocketMessageBody:()=>IOr,InlinedWebSocketMessageBodyProperty:()=>EOr,InlinedWebhookPayload:()=>qTr,InlinedWebhookPayloadProperty:()=>GTr,IntegerType:()=>hTr,IntegerValidationRules:()=>mTr,IntermediateRepresentation:()=>eoc,InvocationSource:()=>z1r,JsonEncoding:()=>v1r,JsonResponse:()=>itt,JsonResponseBody:()=>Wwr,JsonResponseBodyWithProperty:()=>Hwr,JsonStreamChunk:()=>Jwr,JwksKeySource:()=>JTr,Literal:()=>UV,LongType:()=>ATr,LongValidationRules:()=>gTr,MapType:()=>QOr,MavenPublishTarget:()=>U1r,MultipleBaseUrlsEnvironment:()=>qxr,MultipleBaseUrlsEnvironments:()=>Wxr,MultipleEnvironmentUrlValues:()=>rSr,Name:()=>fet,NameAndWireValue:()=>SIe,NameAndWireValueOrString:()=>fs,NameOrString:()=>Ro,NamedType:()=>cPr,NamedTypeDefault:()=>aPr,NonStreamHttpResponseBody:()=>e1r,NpmPublishTarget:()=>V1r,NugetPublishTarget:()=>G1r,OAuthAccessTokenRequestProperties:()=>lCr,OAuthAccessTokenResponseProperties:()=>bet,OAuthAuthorizationCode:()=>sCr,OAuthClientCredentials:()=>fCr,OAuthConfiguration:()=>mCr,OAuthDeviceCode:()=>dCr,OAuthPkceConfiguration:()=>iCr,OAuthPkceMethod:()=>nCr,OAuthPublicClientId:()=>yet,OAuthRefreshEndpoint:()=>uCr,OAuthRefreshTokenRequestProperties:()=>cCr,OAuthScheme:()=>hCr,OAuthTokenEndpoint:()=>pCr,OAuthValues:()=>nSr,ObjectProperty:()=>aB,ObjectPropertyAccess:()=>TIe,ObjectTypeDeclaration:()=>RTr,OffsetPagination:()=>n1r,Package:()=>Ett,PackageNavigationConfig:()=>OOr,PackagistPublishTarget:()=>q1r,Pagination:()=>s1r,PathPagination:()=>i1r,PathParameter:()=>UH,PathParameterLocation:()=>c1r,PlatformHeaders:()=>kOr,PostmanPublishTarget:()=>W1r,PrimitiveType:()=>dtt,PrimitiveTypeV1:()=>nTr,PrimitiveTypeV2:()=>STr,PropertyPathItem:()=>Aet,ProtoEncoding:()=>C1r,ProtoSource:()=>O1r,ProtoSourceInfo:()=>Mwr,ProtobufFile:()=>$et,ProtobufFileOptions:()=>kwr,ProtobufMethodType:()=>Qwr,ProtobufService:()=>Nwr,ProtobufType:()=>tTr,PublishTarget:()=>LIe,PublishingConfig:()=>Z1r,PypiPublishTarget:()=>H1r,QueryParameter:()=>OIe,ReadmeConfig:()=>ROr,ReadmeCustomSection:()=>BOr,RequestProperty:()=>tT,RequestPropertyValue:()=>$vr,ResolvedNamedType:()=>OTr,ResolvedTypeReference:()=>PTr,ResponseError:()=>u1r,ResponseErrors:()=>l1r,ResponseProperty:()=>tE,RetriesConfiguration:()=>f1r,RetriesDisabledSchema:()=>p1r,RubyGemsPublishTarget:()=>K1r,SafeAndUnsafeString:()=>CLe,SdkConfig:()=>FOr,SdkRequest:()=>g1r,SdkRequestBodyType:()=>d1r,SdkRequestShape:()=>h1r,SdkRequestWrapper:()=>m1r,ServerVariable:()=>ket,ServiceId:()=>p$,ServiceTypeReferenceInfo:()=>NOr,ShapeType:()=>TTr,SingleBaseUrlEnvironment:()=>Hxr,SingleBaseUrlEnvironments:()=>Kxr,SingleUnionType:()=>NLt,SingleUnionTypeProperties:()=>NTr,SingleUnionTypeProperty:()=>FTr,Source:()=>rTr,SourceConfig:()=>jOr,SseStreamChunk:()=>Ywr,StaticKeySource:()=>YTr,StreamParameterResponse:()=>t1r,StreamingResponse:()=>ott,StringType:()=>bTr,StringValidationRules:()=>yTr,Subpackage:()=>zOr,SubpackageId:()=>f$,SupportedSdkLanguage:()=>QIe,TextResponse:()=>stt,TextStreamChunk:()=>Xwr,Transport:()=>utt,Type:()=>QTr,TypeDeclaration:()=>MTr,TypeId:()=>cB,TypeReference:()=>zs,Uint64Type:()=>ITr,Uint64ValidationRules:()=>ETr,UintType:()=>CTr,UintValidationRules:()=>vTr,UndiscriminatedUnionMember:()=>DTr,UndiscriminatedUnionTypeDeclaration:()=>kTr,UnionDiscriminatorContext:()=>jTr,UnionTypeDeclaration:()=>zTr,UriPagination:()=>o1r,UserAgent:()=>DOr,UserDefinedProtobufType:()=>$1r,UserSpecifiedEndpointExample:()=>y1r,UuidType:()=>xTr,V2AuthValues:()=>Fet,V2EndpointLocation:()=>sSr,V2EndpointLocationHttpMethod:()=>oSr,V2EnvironmentValues:()=>Net,V2HttpEndpointCodeSample:()=>cSr,V2HttpEndpointExample:()=>TLt,V2HttpEndpointExamples:()=>dSr,V2HttpEndpointRequest:()=>lSr,V2HttpEndpointResponse:()=>fSr,V2HttpEndpointResponseBody:()=>pSr,V2HttpRequestBodies:()=>b1r,V2HttpResponses:()=>E1r,V2SchemaExample:()=>hLt,V2SchemaExamples:()=>eT,V2ValueExamples:()=>E$,V2WebSocketEndpointLocation:()=>hSr,V2WebSocketMessageExample:()=>gSr,V2WebSocketSessionExample:()=>PLt,V2WebSocketSessionExamples:()=>ASr,V2WebhookExample:()=>OLt,V2WebhookExamples:()=>mSr,VariableDeclaration:()=>LTr,VariableId:()=>att,WebSocketChannel:()=>TOr,WebSocketChannelId:()=>Iet,WebSocketMessage:()=>SOr,WebSocketMessageBody:()=>COr,WebSocketMessageBodyReference:()=>vOr,WebSocketMessageId:()=>btt,WebSocketMessageOrigin:()=>xOr,WebSocketName:()=>wOr,Webhook:()=>mOr,WebhookAlgorithmHeader:()=>sOr,WebhookAlgorithmOption:()=>oOr,WebhookBodyHashAlgorithm:()=>aOr,WebhookBodyHashBinding:()=>lOr,WebhookBodyHashLocation:()=>uOr,WebhookBodyHashQueryParameterLocation:()=>cOr,WebhookGroup:()=>hOr,WebhookGroupId:()=>Eet,WebhookHttpMethod:()=>UTr,WebhookId:()=>vCr,WebhookName:()=>VTr,WebhookNotificationUrlNormalization:()=>pOr,WebhookPayload:()=>HTr,WebhookPayloadBodySort:()=>ZTr,WebhookPayloadComponent:()=>$Tr,WebhookPayloadFormat:()=>htt,WebhookPayloadReference:()=>WTr,WebhookSignatureEncoding:()=>_Ie,WebhookSignatureVerification:()=>ytt,WebhookTimestampConfig:()=>gtt,WebhookTimestampFormat:()=>tOr,WellKnownProtobufType:()=>eTr,WithContentType:()=>GV,WithDocs:()=>ao,WithDocsAndAvailability:()=>DIe,WithJsonExample:()=>g$,WithV2Examples:()=>qy,XmlEncoding:()=>x1r,XmlPropertyEncoding:()=>Yvr,XmlPropertyKind:()=>Jvr,audience:()=>XZi,auth:()=>T$i,commons:()=>D$i,constants:()=>N$i,dynamic:()=>rE,environment:()=>wto,errors:()=>Bto,examples:()=>Xto,generatorExec:()=>Tro,globalParameters:()=>Pro,http:()=>Qno,ir:()=>qoo,proto:()=>Hoo,publish:()=>Joo,types:()=>nso,variables:()=>oso,webhooks:()=>aso,websocket:()=>uso});var $o=h(()=>{"use strict";Noc()});var joc=h(()=>{"use strict";Xr();nnc();$o()});var Wn=h(()=>{"use strict";joc();Xr();$o()});var fD,zoc=h(()=>{"use strict";fD={integer:"integer",long:"long",uint:"uint",uint64:"uint64",float:"float",double:"double",boolean:"boolean",string:"string",datetime:"datetime",datetimeRfc2822:"datetime-rfc-2822",base64:"base64",uuid:"uuid",date:"date",bigint:"bigint",unknown:"unknown"}});function kLe({type:e,_default:t,validation:r,visitor:n}){switch(e){case fD.integer:{let l=r??void 0;return n.primitive({v1:ps.Integer,v2:Ei.integer({default:t??void 0,validation:l!=null?{min:l.min,max:l.max,exclusiveMin:l.exclusiveMin,exclusiveMax:l.exclusiveMax,multipleOf:l.multipleOf}:void 0})})}case fD.double:{let l=r??void 0;return n.primitive({v1:ps.Double,v2:Ei.double({default:t??void 0,validation:l!=null?{min:l.min,max:l.max,exclusiveMin:l.exclusiveMin,exclusiveMax:l.exclusiveMax,multipleOf:l.multipleOf}:void 0})})}case fD.string:{let l=r??void 0;return n.primitive({v1:ps.String,v2:Ei.string({default:t??void 0,validation:l!=null?{format:l.format,pattern:l.pattern,minLength:l.minLength,maxLength:l.maxLength}:void 0})})}case fD.float:return n.primitive({v1:ps.Float,v2:void 0});case fD.long:{let l=r??void 0;return n.primitive({v1:ps.Long,v2:Ei.long({default:t??void 0,validation:l!=null?{min:l.min,max:l.max,exclusiveMin:l.exclusiveMin,exclusiveMax:l.exclusiveMax,multipleOf:l.multipleOf}:void 0})})}case fD.boolean:return n.primitive({v1:ps.Boolean,v2:Ei.boolean({default:t??void 0})});case fD.datetime:return n.primitive({v1:ps.DateTime,v2:void 0});case fD.datetimeRfc2822:return n.primitive({v1:ps.DateTimeRfc2822,v2:Ei.dateTimeRfc2822({})});case fD.date:return n.primitive({v1:ps.Date,v2:void 0});case fD.uuid:return n.primitive({v1:ps.Uuid,v2:void 0});case fD.base64:return n.primitive({v1:ps.Base64,v2:void 0});case fD.bigint:return n.primitive({v1:ps.BigInteger,v2:Ei.bigInteger({default:t??void 0})});case fD.uint:return n.primitive({v1:ps.Uint,v2:void 0});case fD.uint64:return n.primitive({v1:ps.Uint64,v2:void 0});case fD.unknown:return n.unknown()}let i=e.match(fQ.MAP);if(i?.[1]!=null&&i[2]!=null)return n.map({keyType:i[1],valueType:i[2]});let o=e.match(fQ.LIST);if(o?.[1]!=null)return n.list(o[1]);let s=e.match(fQ.SET);if(s?.[1]!=null)return n.set(s[1]);let a=e.match(fQ.OPTIONAL);if(a?.[1]!=null)return n.optional(a[1]);let c=e.match(fQ.NULLABLE);if(c?.[1]!=null)return n.nullable(c[1]);let u=e.match(fQ.LITERAL);if(u?.[1]!=null)return n.literal(eE.string(u[1]));if(u?.[2]!=null){let l=u[2];switch(l){case"false":return n.literal(eE.boolean(!1));case"true":return n.literal(eE.boolean(!0));default:throw new Error(`Unsupported literal value: ${l}`)}}return n.named(e)}var fQ,xtt=h(()=>{"use strict";Wn();zoc();fQ={MAP:/^map<\s*([^,]*)\s*,\s*(.*)\s*>$/,LIST:/^list<\s*(.*)\s*>$/,SET:/^set<\s*(.*)\s*>$/,OPTIONAL:/^optional<\s*(.*)\s*>$/,NULLABLE:/^nullable<\s*(.*)\s*>$/,LITERAL:/^literal<\s*(?:"(.*)"|(true|false))\s*>$/}});function HV(e){if(e===Qoc)return{isOptional:!1};if(e.match(fQ.OPTIONAL)?.[1]===Qoc)return{isOptional:!0}}var Qoc,lso=h(()=>{"use strict";xtt();Qoc="bytes"});function zLt(e){let t=typeof e=="string"?e:typeof e.body=="string"?e.body:void 0;if(t!=null)return HV(t)}var Moc=h(()=>{"use strict";lso()});function FLe(e){if(typeof e=="number")return Number.isInteger(e)?{statusCode:e,isWildcard:!1}:void 0;switch(e.toUpperCase()){case"4XX":return{statusCode:400,isWildcard:!0};case"5XX":return{statusCode:500,isWildcard:!0};default:{let t=Number(e);return Number.isInteger(t)&&e.trim()!==""?{statusCode:t,isWildcard:!1}:void 0}}}var Loc=h(()=>{"use strict"});function pso({input:e,typeName:t}){for(let r of e.arguments)if(typeof r=="string"){if(r===t)return!0}else if(pso({input:r,typeName:t}))return!0;return!1}var _oc=h(()=>{"use strict"});function Uoc(e){return pso({input:e,typeName:"file"})}var Voc=h(()=>{"use strict";_oc()});function Goc(e){let t=0,r=0;function n(){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)return;let o="";for(;t<e.length&&e[t]!=="<"&&e[t]!==","&&e[t]!==">";)o+=e[t++];if(o.trim()){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t<e.length&&e[t]==="<"){if(t++,r++,r>128)throw new Error("Internal error; Exceeded maximum recursion depth while parsing generics.");let s={name:o.trim(),arguments:[]};for(;t<e.length&&e[t]!==">";){for(;t<e.length&&/[\s,]/.test(e[t]);)t++;if(t<e.length&&e[t]!==">"){let a=n();a&&s.arguments.push(a)}}if(t<e.length&&e[t]===">")t++,r--;else throw new Error("Malformed input: missing closing '>' for generic arguments.");return s}else return o.trim()}}let i=n();if(typeof i=="object")return i}var qoc=h(()=>{"use strict"});function Woc(e){return e.match(fQ.LIST)?.[1]===fso}function dQ(e){if(e===fso)return{isOptional:!1,isArray:!1};let t=e.match(fQ.OPTIONAL);if(t?.[1]!==void 0){if(t[1]===fso)return{isOptional:!0,isArray:!1};if(Woc(t[1]))return{isOptional:!0,isArray:!0}}if(Woc(e))return{isOptional:!1,isArray:!0}}var fso,dso=h(()=>{"use strict";xtt();fso="file"});function ird(e){return typeof e=="string"?!1:Jp.parse(e["content-type"])?.isMultiPartFormData()??!1?!0:e.body==null?!1:!!(nA(e.body)&&Object.values(e.body.properties??[]).some(srd))}function NLe(e){if(!(!ird(e)||e.body==null)&&e.name!=null&&e.body!=null&&nA(e.body))return ord(e.name,e.body)}function ord(e,t){let r=Object.entries(t.properties??[]).reduce((n,[i,o])=>{let s=typeof o!="string"?o.docs:void 0,a=typeof o!="string"?o["content-type"]:void 0,c=typeof o!="string"?o.style:void 0,u=dQ(typeof o=="string"?o:o.type);return u!=null?n.push({isFile:!0,key:i,docs:s,isOptional:u.isOptional,isArray:u.isArray,contentType:a,style:c}):n.push({isFile:!1,key:i,propertyType:o,docs:s,contentType:a,style:c}),n},[]);return t["extra-properties"],{name:e,extends:t.extends,properties:r}}function srd(e){let t=typeof e=="string"?e:e.type;if(t==="file")return!0;if(!t.includes("file"))return!1;let r=Goc(t);return r==null?!1:Uoc(r)}var Hoc=h(()=>{"use strict";Ct();Voc();qoc();jXi();dso()});function jLe(e){if(e===Koc)return{isOptional:!1};if(e.match(fQ.OPTIONAL)?.[1]===Koc)return{isOptional:!0}}var Koc,Joc=h(()=>{"use strict";xtt();Koc="text"});function yC({type:e,_default:t,validation:r,visitor:n}){return kLe({type:e,_default:t,validation:r,visitor:{primitive:n.primitive,map:({keyType:i,valueType:o})=>n.map({keyType:yC({type:i,_default:void 0,validation:void 0,visitor:n}),valueType:yC({type:o,_default:void 0,validation:void 0,visitor:n})}),list:i=>n.list(yC({type:i,_default:void 0,validation:void 0,visitor:n})),set:i=>n.set(yC({type:i,_default:void 0,validation:void 0,visitor:n})),optional:i=>n.optional(yC({type:i,_default:t,validation:r,visitor:n})),nullable:i=>n.nullable(yC({type:i,_default:t,validation:r,visitor:n})),literal:n.literal,named:n.named,unknown:n.unknown}})}var Yoc=h(()=>{"use strict";xtt()});function mso(e,t){if(ard(e))return t.sdk(e);if(crd(e))return t.language(e);Ee(e)}function ard(e){return e.sdk!=null}function crd(e){return e.language!=null}var Xoc=h(()=>{"use strict";Ct()});function Zoc(e){return e["response-stream"]!=null&&(typeof e["response-stream"]=="string"||e["response-stream"].format==null||e["response-stream"].format==="json")}var $oc=h(()=>{"use strict"});function esc(e){return e["response-stream"]!=null&&typeof e["response-stream"]!="string"&&e["response-stream"].format==="sse"}var tsc=h(()=>{"use strict"});function zLe(e,t,r){return urd(e,t)?r.stream(t):lrd(e,t)?r.events(t):r.body(t)}function urd(e,t){return t.stream!==void 0&&Zoc(e)}function lrd(e,t){return t.stream!==void 0&&esc(e)}var rsc=h(()=>{"use strict";$oc();tsc()});function jfe(e,t){if(nsc(e))return t.single(e);if(isc(e))return t.any(e);if(Stt(e))return t.endpointSecurity(e);Ee(e)}function nsc(e){return typeof e=="string"||e.scheme!=null}function isc(e){let[t,...r]=Object.keys(e);return t==="any"&&r.length===0}function Stt(e){let[t,...r]=Object.keys(e);return t==="endpoint-security"&&r.length===0}var osc=h(()=>{"use strict";Ct()});function zfe(e,t){if(ssc(e))return t.header(e);switch(e.scheme){case"basic":return t.basic(e);case"bearer":return"get-token"in e?t.inferredBearer(e):t.tokenBearer(e);case"oauth":return t.oauth(e);default:Ee(e)}}function ssc(e){return e.header!=null}var asc=h(()=>{"use strict";Ct()});function v$(e,t){if(csc(e))return t.singleBaseUrl(e);if(dD(e))return t.multipleBaseUrls(e);Ee(e)}function csc(e){return typeof e=="string"||"url"in e}function dD(e){return typeof e!="string"&&"urls"in e}var usc=h(()=>{"use strict";Ct()});function Qfe(e){return typeof e=="string"?e.startsWith("$"):"variable"in e}var lsc=h(()=>{"use strict"});function bC(e,t){if(UIe(e))return t.alias(e);if(KV(e))return t.discriminatedUnion(e);if(Of(e))return t.object(e);if(wtt(e))return t.undiscriminatedUnion(e);if(VH(e))return t.enum(e);Ee(e)}function UIe(e){return typeof e=="string"||e.type!=null}function Of(e){return e.extends!=null||e.properties!=null}function KV(e){return e.union!=null&&e.discriminated==null}function wtt(e){let t=e;return t.union!=null&&t.discriminated!=null}function VH(e){return e.enum!=null}var psc=h(()=>{"use strict";Ct()});var ho=h(()=>{"use strict";J7a();X7a();tHa();rHa();nHa();jXi();iHa();oHa();Moc();Loc();Hoc();lso();dso();Joc();Yoc();Xoc();rsc();osc();asc();usc();lsc();psc();xtt()});var qH,yso=h(()=>{"use strict";qH=class{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;constructor({generatorsConfiguration:t,workspaceName:r,cliVersion:n,absoluteFilePath:i,changelog:o}){this.generatorsConfiguration=t,this.workspaceName=r,this.cliVersion=n,this.absoluteFilePath=i,this.changelog=o}}});var bsc=h(()=>{"use strict"});var Esc=h(()=>{"use strict"});var NA,ly,VIe,Isc,Ttt,mv,QLe,rd,pPr,zu,x$,WH,vd,vsc,EC,pI,Ott,nT,fPr,Csc,GIe,xsc,Ssc,wsc,Tsc,Osc,mD,MLt,dPr=h(()=>{"use strict";NA="fern",ly="definition",VIe="openapi",Isc="changelog",Ttt="asyncapi",mv="api.yml",QLe="__package__",rd=`${QLe}.yml`,pPr="dependencies.yml",zu="generators.yml",x$="generators.yaml",WH="generators.legacy.yml",vd="sdk-config.yml",vsc="dependencies.yml",EC="docs.yml",pI="fern.config.json",Ott="api",nT=".fernignore",fPr="snippet.json",Csc="snippet-templates.json",GIe="default-group",xsc="spec-origin",Ssc="async-api",wsc="openapi",Tsc="openapi-overrides",Osc="api-settings",mD="apis",MLt="local"});function Or(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let p=0;p<l.length;p++){let d=l[p];d in a||(a[d]=u[d].bind(a))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var c;let u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function hv(e){return e&&Object.assign(LLt,e),LLt}var bso,mPr,HH,qIe,LLt,Ptt=h(()=>{"use strict";bso=Object.freeze({status:"aborted"});mPr=Symbol("zod_brand"),HH=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},qIe=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},LLt={}});var Oi={};te(Oi,{BIGINT_FORMAT_RANGES:()=>Pso,Class:()=>Iso,NUMBER_FORMAT_RANGES:()=>Oso,aborted:()=>JIe,allowsEval:()=>xso,assert:()=>vrd,assertEqual:()=>yrd,assertIs:()=>Erd,assertNever:()=>Ird,assertNotEqual:()=>brd,assignProp:()=>HIe,base64ToUint8Array:()=>Bsc,base64urlToUint8Array:()=>Mrd,cached:()=>Rtt,captureStackTrace:()=>gPr,cleanEnum:()=>Qrd,cleanRegex:()=>VLt,clone:()=>F2,cloneDef:()=>xrd,createTransparentProxy:()=>Brd,defineLazy:()=>$p,esc:()=>hPr,escapeRegex:()=>YV,extend:()=>krd,finalizeIssue:()=>mQ,floatSafeRemainder:()=>vso,getElementAtPath:()=>Srd,getEnumValues:()=>ULt,getLengthableOrigin:()=>WLt,getParsedType:()=>Prd,getSizableOrigin:()=>qLt,hexToUint8Array:()=>_rd,isObject:()=>MLe,isPlainObject:()=>KIe,issue:()=>Dtt,joinValues:()=>ln,jsonStringifyReplacer:()=>Btt,merge:()=>Nrd,mergeDefs:()=>Mfe,normalizeParams:()=>Li,nullish:()=>WIe,numKeys:()=>Ord,objectClone:()=>Crd,omit:()=>Drd,optionalKeys:()=>Tso,parsedType:()=>xi,partial:()=>jrd,pick:()=>Rrd,prefixIssues:()=>Q3,primitiveTypes:()=>wso,promiseAllObject:()=>wrd,propertyKeyTypes:()=>GLt,randomString:()=>Trd,required:()=>zrd,safeExtend:()=>Frd,shallowClone:()=>Sso,slugify:()=>Cso,stringifyPrimitive:()=>hi,uint8ArrayToBase64:()=>Rsc,uint8ArrayToBase64url:()=>Lrd,uint8ArrayToHex:()=>Urd,unwrapMessage:()=>_Lt});function yrd(e){return e}function brd(e){return e}function Erd(e){}function Ird(e){throw new Error("Unexpected value in exhaustive check")}function vrd(e){}function ULt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function ln(e,t="|"){return e.map(r=>hi(r)).join(t)}function Btt(e,t){return typeof t=="bigint"?t.toString():t}function Rtt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function WIe(e){return e==null}function VLt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function vso(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let o=r>i?r:i,s=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return s%a/10**o}function $p(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Psc)return n===void 0&&(n=Psc,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Crd(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function HIe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Mfe(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function xrd(e){return Mfe(e._zod.def)}function Srd(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function wrd(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let i={};for(let o=0;o<t.length;o++)i[t[o]]=n[o];return i})}function Trd(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function hPr(e){return JSON.stringify(e)}function Cso(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function MLe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function KIe(e){if(MLe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(MLe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sso(e){return KIe(e)?{...e}:Array.isArray(e)?[...e]:e}function Ord(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function YV(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F2(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Li(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Brd(e){let t;return new Proxy({},{get(r,n,i){return t??(t=e()),Reflect.get(t,n,i)},set(r,n,i,o){return t??(t=e()),Reflect.set(t,n,i,o)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,i){return t??(t=e()),Reflect.defineProperty(t,n,i)}})}function hi(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Tso(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Rrd(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Mfe(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return HIe(this,"shape",s),s},checks:[]});return F2(e,o)}function Drd(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Mfe(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return HIe(this,"shape",s),s},checks:[]});return F2(e,o)}function krd(e,t){if(!KIe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=Mfe(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return HIe(this,"shape",o),o}});return F2(e,i)}function Frd(e,t){if(!KIe(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Mfe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return HIe(this,"shape",n),n}});return F2(e,r)}function Nrd(e,t){let r=Mfe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return HIe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return F2(e,r)}function jrd(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Mfe(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return HIe(this,"shape",c),c},checks:[]});return F2(t,s)}function zrd(e,t,r){let n=Mfe(t._zod.def,{get shape(){let i=t._zod.def.shape,o={...i};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(let s in i)o[s]=new e({type:"nonoptional",innerType:i[s]});return HIe(this,"shape",o),o}});return F2(t,n)}function JIe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Q3(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function _Lt(e){return typeof e=="string"?e:e?.message}function mQ(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=_Lt(e.inst?._zod.def?.error?.(e))??_Lt(t?.error?.(e))??_Lt(r.customError?.(e))??_Lt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function qLt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function WLt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xi(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Dtt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Qrd(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Bsc(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Rsc(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Mrd(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Bsc(t+r)}function Lrd(e){return Rsc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _rd(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Urd(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Psc,gPr,xso,Prd,GLt,wso,Oso,Pso,Iso,$a=h(()=>{"use strict";Psc=Symbol("evaluating");gPr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};xso=Rtt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});Prd=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},GLt=new Set(["string","number","symbol"]),wso=new Set(["string","number","bigint","boolean","symbol","undefined"]);Oso={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pso={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Iso=class{constructor(...t){}}});function KLt(e,t=r=>r.message){let r={},n=[];for(let i of e.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}}function JLt(e,t=r=>r.message){let r={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return n(e),r}function Bso(e,t=r=>r.message){let r={errors:[]},n=(i,o=[])=>{var s,a;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>n({issues:u},c.path));else if(c.code==="invalid_key")n({issues:c.issues},c.path);else if(c.code==="invalid_element")n({issues:c.issues},c.path);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,p=0;for(;p<u.length;){let d=u[p],f=p===u.length-1;typeof d=="string"?(l.properties??(l.properties={}),(s=l.properties)[d]??(s[d]={errors:[]}),l=l.properties[d]):(l.items??(l.items=[]),(a=l.items)[d]??(a[d]={errors:[]}),l=l.items[d]),f&&l.errors.push(t(c)),p++}}};return n(e),r}function ksc(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function Rso(e){let t=[],r=[...e.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${ksc(n.path)}`);return t.join(`
101
101
  `)}var Dsc,HLt,hQ,Dso=h(()=>{"use strict";Ptt();$a();Dsc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Btt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},HLt=Or("$ZodError",Dsc),hQ=Or("$ZodError",Dsc,{Parent:Error})});var ktt,APr,Ftt,yPr,Ntt,kso,jtt,Fso,bPr,Grd,EPr,qrd,IPr,Wrd,vPr,Hrd,CPr,Krd,xPr,Jrd,SPr,Yrd,wPr,Xrd,Nso=h(()=>{"use strict";Ptt();Dso();$a();ktt=e=>(t,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new HH;if(s.issues.length){let a=new(i?.Err??e)(s.issues.map(c=>mQ(c,o,hv())));throw gPr(a,i?.callee),a}return s.value},APr=ktt(hQ),Ftt=e=>async(t,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??e)(s.issues.map(c=>mQ(c,o,hv())));throw gPr(a,i?.callee),a}return s.value},yPr=Ftt(hQ),Ntt=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new HH;return o.issues.length?{success:!1,error:new(e??HLt)(o.issues.map(s=>mQ(s,i,hv())))}:{success:!0,data:o.value}},kso=Ntt(hQ),jtt=e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>mQ(s,i,hv())))}:{success:!0,data:o.value}},Fso=jtt(hQ),bPr=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ktt(e)(t,r,i)},Grd=bPr(hQ),EPr=e=>(t,r,n)=>ktt(e)(t,r,n),qrd=EPr(hQ),IPr=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ftt(e)(t,r,i)},Wrd=IPr(hQ),vPr=e=>async(t,r,n)=>Ftt(e)(t,r,n),Hrd=vPr(hQ),CPr=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ntt(e)(t,r,i)},Krd=CPr(hQ),xPr=e=>(t,r,n)=>Ntt(e)(t,r,n),Jrd=xPr(hQ),SPr=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return jtt(e)(t,r,i)},Yrd=SPr(hQ),wPr=e=>async(t,r,n)=>jtt(e)(t,r,n),Xrd=wPr(hQ)});var XV={};te(XV,{base64:()=>Xso,base64url:()=>TPr,bigint:()=>nao,boolean:()=>oao,browserEmail:()=>ond,cidrv4:()=>Jso,cidrv6:()=>Yso,cuid:()=>jso,cuid2:()=>zso,date:()=>$so,datetime:()=>tao,domain:()=>cnd,duration:()=>Uso,e164:()=>Zso,email:()=>Gso,emoji:()=>qso,extendedDuration:()=>Zrd,guid:()=>Vso,hex:()=>und,hostname:()=>and,html5Email:()=>rnd,idnEmail:()=>ind,integer:()=>iao,ipv4:()=>Wso,ipv6:()=>Hso,ksuid:()=>Lso,lowercase:()=>cao,mac:()=>Kso,md5_base64:()=>pnd,md5_base64url:()=>fnd,md5_hex:()=>lnd,nanoid:()=>_so,null:()=>sao,number:()=>OPr,rfc5322Email:()=>nnd,sha1_base64:()=>mnd,sha1_base64url:()=>hnd,sha1_hex:()=>dnd,sha256_base64:()=>And,sha256_base64url:()=>ynd,sha256_hex:()=>gnd,sha384_base64:()=>End,sha384_base64url:()=>Ind,sha384_hex:()=>bnd,sha512_base64:()=>Cnd,sha512_base64url:()=>xnd,sha512_hex:()=>vnd,string:()=>rao,time:()=>eao,ulid:()=>Qso,undefined:()=>aao,unicodeEmail:()=>Fsc,uppercase:()=>uao,uuid:()=>LLe,uuid4:()=>$rd,uuid6:()=>end,uuid7:()=>tnd,xid:()=>Mso});function qso(){return new RegExp(snd,"u")}function jsc(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eao(e){return new RegExp(`^${jsc(e)}$`)}function tao(e){let t=jsc({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Nsc}T(?:${n})$`)}function YLt(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function XLt(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var jso,zso,Qso,Mso,Lso,_so,Uso,Zrd,Vso,LLe,$rd,end,tnd,Gso,rnd,nnd,Fsc,ind,ond,snd,Wso,Hso,Kso,Jso,Yso,Xso,TPr,and,cnd,Zso,Nsc,$so,rao,nao,iao,OPr,oao,sao,aao,cao,uao,und,lnd,pnd,fnd,dnd,mnd,hnd,gnd,And,ynd,bnd,End,Ind,vnd,Cnd,xnd,PPr=h(()=>{"use strict";$a();jso=/^[cC][^\s-]{8,}$/,zso=/^[0-9a-z]+$/,Qso=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mso=/^[0-9a-vA-V]{20}$/,Lso=/^[A-Za-z0-9]{27}$/,_so=/^[a-zA-Z0-9_-]{21}$/,Uso=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zrd=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vso=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,LLe=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$rd=LLe(4),end=LLe(6),tnd=LLe(7),Gso=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rnd=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nnd=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Fsc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ind=Fsc,ond=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,snd="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Wso=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hso=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Kso=e=>{let t=YV(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Jso=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yso=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xso=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,TPr=/^[A-Za-z0-9_-]*$/,and=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,cnd=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Zso=/^\+[1-9]\d{6,14}$/,Nsc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",$so=new RegExp(`^${Nsc}$`);rao=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},nao=/^-?\d+n?$/,iao=/^-?\d+$/,OPr=/^-?\d+(?:\.\d+)?$/,oao=/^(?:true|false)$/i,sao=/^null$/i,aao=/^undefined$/i,cao=/^[^A-Z]*$/,uao=/^[^a-z]*$/,und=/^[0-9a-fA-F]*$/;lnd=/^[0-9a-fA-F]{32}$/,pnd=YLt(22,"=="),fnd=XLt(22),dnd=/^[0-9a-fA-F]{40}$/,mnd=YLt(27,"="),hnd=XLt(27),gnd=/^[0-9a-fA-F]{64}$/,And=YLt(43,"="),ynd=XLt(43),bnd=/^[0-9a-fA-F]{96}$/,End=YLt(64,""),Ind=XLt(64),vnd=/^[0-9a-fA-F]{128}$/,Cnd=YLt(86,"=="),xnd=XLt(86)});function zsc(e,t,r){e.issues.length&&t.issues.push(...Q3(r,e.issues))}var py,Qsc,BPr,RPr,lao,pao,fao,dao,mao,hao,gao,Aao,yao,ztt,bao,Eao,Iao,vao,Cao,xao,Sao,wao,Tao,DPr=h(()=>{"use strict";Ptt();PPr();$a();py=Or("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Qsc={number:"number",bigint:"bigint",object:"date"},BPr=Or("$ZodCheckLessThan",(e,t)=>{py.init(e,t);let r=Qsc[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),RPr=Or("$ZodCheckGreaterThan",(e,t)=>{py.init(e,t);let r=Qsc[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),lao=Or("$ZodCheckMultipleOf",(e,t)=>{py.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):vso(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),pao=Or("$ZodCheckNumberFormat",(e,t)=>{py.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=Oso[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=i,a.maximum=o,r&&(a.pattern=iao)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),fao=Or("$ZodCheckBigIntFormat",(e,t)=>{py.init(e,t);let[r,n]=Pso[t.format];e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,o.minimum=r,o.maximum=n}),e._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),dao=Or("$ZodCheckMaxSize",(e,t)=>{var r;py.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!WIe(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;i.size<=t.maximum||n.issues.push({origin:qLt(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),mao=Or("$ZodCheckMinSize",(e,t)=>{var r;py.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!WIe(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;i.size>=t.minimum||n.issues.push({origin:qLt(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),hao=Or("$ZodCheckSizeEquals",(e,t)=>{var r;py.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!WIe(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=n=>{let i=n.value,o=i.size;if(o===t.size)return;let s=o>t.size;n.issues.push({origin:qLt(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),gao=Or("$ZodCheckMaxLength",(e,t)=>{var r;py.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!WIe(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;if(i.length<=t.maximum)return;let s=WLt(i);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Aao=Or("$ZodCheckMinLength",(e,t)=>{var r;py.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!WIe(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let s=WLt(i);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),yao=Or("$ZodCheckLengthEquals",(e,t)=>{var r;py.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!WIe(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{let i=n.value,o=i.length;if(o===t.length)return;let s=WLt(i),a=o>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ztt=Or("$ZodCheckStringFormat",(e,t)=>{var r,n;py.init(e,t),e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),bao=Or("$ZodCheckRegex",(e,t)=>{ztt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Eao=Or("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cao),ztt.init(e,t)}),Iao=Or("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=uao),ztt.init(e,t)}),vao=Or("$ZodCheckIncludes",(e,t)=>{py.init(e,t);let r=YV(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Cao=Or("$ZodCheckStartsWith",(e,t)=>{py.init(e,t);let r=new RegExp(`^${YV(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),xao=Or("$ZodCheckEndsWith",(e,t)=>{py.init(e,t);let r=new RegExp(`.*${YV(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});Sao=Or("$ZodCheckProperty",(e,t)=>{py.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>zsc(i,r,t.property));zsc(n,r,t.property)}}),wao=Or("$ZodCheckMimeType",(e,t)=>{py.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),Tao=Or("$ZodCheckOverwrite",(e,t)=>{py.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var ZLt,Oao=h(()=>{"use strict";ZLt=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
102
102
  `).filter(s=>s),i=Math.min(...n.map(s=>s.length-s.trimStart().length)),o=n.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,i.join(`
103
103
  `))}}});var Pao,Bao=h(()=>{"use strict";Pao={major:4,minor:3,patch:6}});function Zao(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Xsc(e){if(!TPr.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Zao(r)}function Zsc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}function Lsc(e,t,r){e.issues.length&&t.issues.push(...Q3(r,e.issues)),t.value[r]=e.value}function zPr(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Q3(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function $sc(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Tso(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function eac(e,t,r,n,i,o){let s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let p in t){if(a.has(p))continue;if(u==="never"){s.push(p);continue}let d=c.run({value:t[p],issues:[]},n);d instanceof Promise?e.push(d.then(f=>zPr(f,r,p,t,l))):zPr(d,r,p,t,l)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}function _sc(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!JIe(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>mQ(s,n,hv())))}),t)}function Usc(e,t,r,n){let i=e.filter(o=>o.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>mQ(s,n,hv())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function Rao(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(KIe(e)&&KIe(t)){let r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),i={...e,...t};for(let o of n){let s=Rao(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t[n],s=Rao(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Vsc(e,t,r){let n=new Map,i;for(let a of t.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);let o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&i&&e.issues.push({...i,keys:o}),JIe(e))return e;let s=Rao(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}function kPr(e,t,r){e.issues.length&&t.issues.push(...Q3(r,e.issues)),t.value[r]=e.value}function Gsc(e,t,r,n,i,o,s){e.issues.length&&(GLt.has(typeof n)?r.issues.push(...Q3(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(a=>mQ(a,s,hv()))})),t.issues.length&&(GLt.has(typeof n)?r.issues.push(...Q3(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:t.issues.map(a=>mQ(a,s,hv()))})),r.value.set(e.value,t.value)}function qsc(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Wsc(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}function Hsc(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Ksc(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function FPr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function NPr(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>jPr(e,o,t.out,r)):jPr(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>jPr(e,o,t.in,r)):jPr(e,i,t.in,r)}}function jPr(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}function Jsc(e){return e.value=Object.freeze(e.value),e}function Ysc(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(Dtt(i))}}var sl,_Le,jA,Dao,kao,Fao,Nao,jao,zao,Qao,Mao,Lao,_ao,Uao,Vao,Gao,qao,Wao,Hao,Kao,Jao,Yao,Xao,$ao,eco,tco,rco,nco,QPr,ico,$Lt,MPr,oco,sco,aco,cco,uco,lco,pco,fco,dco,mco,tac,hco,e6t,gco,Aco,yco,LPr,bco,Eco,Ico,vco,Cco,xco,Sco,_Pr,wco,Tco,Oco,Pco,Bco,Rco,Dco,kco,Fco,t6t,Nco,jco,zco,Qco,Mco,Lco,_co=h(()=>{"use strict";DPr();Ptt();Oao();Nso();PPr();$a();Bao();$a();sl=Or("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Pao;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let o of i._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,a,c)=>{let u=JIe(s),l;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;let d=s.issues.length,f=p._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new HH;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==d&&(u||(u=JIe(s,d)))});else{if(s.issues.length===d)continue;u||(u=JIe(s,d))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(JIe(s))return s.aborted=!0,s;let u=i(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new HH;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,s,a)):o(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new HH;return c.then(u=>i(u,n,a))}return i(c,n,a)}}$p(e,"~standard",()=>({validate:i=>{try{let o=kso(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Fso(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),_Le=Or("$ZodString",(e,t)=>{sl.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rao(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),jA=Or("$ZodStringFormat",(e,t)=>{ztt.init(e,t),_Le.init(e,t)}),Dao=Or("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Vso),jA.init(e,t)}),kao=Or("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=LLe(n))}else t.pattern??(t.pattern=LLe());jA.init(e,t)}),Fao=Or("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Gso),jA.init(e,t)}),Nao=Or("$ZodURL",(e,t)=>{jA.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),jao=Or("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qso()),jA.init(e,t)}),zao=Or("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_so),jA.init(e,t)}),Qao=Or("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jso),jA.init(e,t)}),Mao=Or("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zso),jA.init(e,t)}),Lao=Or("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Qso),jA.init(e,t)}),_ao=Or("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mso),jA.init(e,t)}),Uao=Or("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Lso),jA.init(e,t)}),Vao=Or("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tao(t)),jA.init(e,t)}),Gao=Or("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$so),jA.init(e,t)}),qao=Or("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eao(t)),jA.init(e,t)}),Wao=Or("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Uso),jA.init(e,t)}),Hao=Or("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wso),jA.init(e,t),e._zod.bag.format="ipv4"}),Kao=Or("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Hso),jA.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Jao=Or("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Kso(t.delimiter)),jA.init(e,t),e._zod.bag.format="mac"}),Yao=Or("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jso),jA.init(e,t)}),Xao=Or("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yso),jA.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});$ao=Or("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Xso),jA.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Zao(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});eco=Or("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=TPr),jA.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Xsc(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tco=Or("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zso),jA.init(e,t)});rco=Or("$ZodJWT",(e,t)=>{jA.init(e,t),e._zod.check=r=>{Zsc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),nco=Or("$ZodCustomStringFormat",(e,t)=>{jA.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),QPr=Or("$ZodNumber",(e,t)=>{sl.init(e,t),e._zod.pattern=e._zod.bag.pattern??OPr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),ico=Or("$ZodNumberFormat",(e,t)=>{pao.init(e,t),QPr.init(e,t)}),$Lt=Or("$ZodBoolean",(e,t)=>{sl.init(e,t),e._zod.pattern=oao,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),MPr=Or("$ZodBigInt",(e,t)=>{sl.init(e,t),e._zod.pattern=nao,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),oco=Or("$ZodBigIntFormat",(e,t)=>{fao.init(e,t),MPr.init(e,t)}),sco=Or("$ZodSymbol",(e,t)=>{sl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),aco=Or("$ZodUndefined",(e,t)=>{sl.init(e,t),e._zod.pattern=aao,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),cco=Or("$ZodNull",(e,t)=>{sl.init(e,t),e._zod.pattern=sao,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),uco=Or("$ZodAny",(e,t)=>{sl.init(e,t),e._zod.parse=r=>r}),lco=Or("$ZodUnknown",(e,t)=>{sl.init(e,t),e._zod.parse=r=>r}),pco=Or("$ZodNever",(e,t)=>{sl.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),fco=Or("$ZodVoid",(e,t)=>{sl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),dco=Or("$ZodDate",(e,t)=>{sl.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});mco=Or("$ZodArray",(e,t)=>{sl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Lsc(u,r,s))):Lsc(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});tac=Or("$ZodObject",(e,t)=>{if(sl.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let n=Rtt(()=>$sc(t));$p(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let p of l.values)c[u].add(p)}}return c});let i=MLe,o=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=n.value);let u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let l=[],p=s.shape;for(let d of s.keys){let f=p[d],m=f._zod.optout==="optional",g=f._zod.run({value:u[d],issues:[]},c);g instanceof Promise?l.push(g.then(A=>zPr(A,a,d,u,m))):zPr(g,a,d,u,m)}return o?eac(l,u,a,c,n.value,e):l.length?Promise.all(l).then(()=>a):a}}),hco=Or("$ZodObjectJIT",(e,t)=>{tac.init(e,t);let r=e._zod.parse,n=Rtt(()=>$sc(t)),i=d=>{let f=new ZLt(["shape","payload","ctx"]),m=n.value,g=x=>{let v=hPr(x);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};f.write("const input = payload.value;");let A=Object.create(null),y=0;for(let x of m.keys)A[x]=`key_${y++}`;f.write("const newResult = {};");for(let x of m.keys){let v=A[x],S=hPr(x),R=d[x]?._zod?.optout==="optional";f.write(`const ${v} = ${g(x)};`),R?f.write(`
@@ -504,7 +504,7 @@ Hint: Values starting with "@" (such as scoped npm packages) must be wrapped in
504
504
  `)}];let f=typeof d=="string"?d:d.type;if(typeof f!="string")return tEu(p);let m=n.resolveType({type:f,file:o});if(m==null)return[];let g=typeof t.extends>"u"?[]:typeof t.extends=="string"?[t.extends]:t.extends;if(t["base-properties"]!=null||g.length>0){let v={properties:t["base-properties"],extends:g},S=b4({typeName:void 0,objectDeclaration:v,typeResolver:n,definitionFile:o.definitionFile,workspace:s,filepathOfDeclaration:o.relativeFilepath,smartCasing:!1}),B=new Set(S.map(O=>O.wireKey)),D=cUe({typeName:e,typeNameForBreadcrumb:e,rawObject:v,file:o,example:p,typeResolver:n,exampleResolver:i,workspace:s,breadcrumbs:a,depth:c+1}).filter(O=>{let z=O.message.toLowerCase();if(z.includes("unexpected property")){let Y=z.match(/unexpected property "([^"]+)"/);if(Y&&Y[1]&&!B.has(Y[1]))return!1}return!0});if(D.length>0)return D}if(m._type==="named"&&Of(m.declaration)){let v=new Set(b4({typeName:f,objectDeclaration:m.declaration,typeResolver:n,definitionFile:m.file.definitionFile,workspace:s,filepathOfDeclaration:m.file.relativeFilepath,smartCasing:!1}).map(D=>D.wireKey)),S=Object.fromEntries(Object.entries(p).filter(([D])=>v.has(D)?!0:!(t["base-properties"]?.[D]!=null||g.some(O=>{let z=n.resolveNamedType({referenceToNamedType:O,file:o});return z?._type==="named"&&Of(z.declaration)?z.declaration.properties?.[D]!=null:!1})))),R=m.declaration.properties?.[u]!=null||(typeof m.declaration.extends>"u"?[]:typeof m.declaration.extends=="string"?[m.declaration.extends]:m.declaration.extends).some(O=>{let z=n.resolveNamedType({referenceToNamedType:O,file:m.file});return z?._type==="named"&&Of(z.declaration)?z.declaration.properties?.[u]!=null:!1})?{[u]:l,...S}:S;return cUe({typeName:e,typeNameForBreadcrumb:e,rawObject:m.declaration,file:m.file,example:R,typeResolver:n,exampleResolver:i,workspace:s,breadcrumbs:a,depth:c+1})}let A=typeof d!="string"&&typeof d.key=="string"?d.key:void 0;if(A==null)return[];let{[A]:y,...I}=p,x=[];return typeof y>"u"?x.push({message:`Missing property "${A}"`}):x.push(...QT({rawTypeReference:f,example:y,typeResolver:n,exampleResolver:i,file:o,workspace:s,breadcrumbs:a,depth:c+1})),x.push(...tEu(I)),x}function tEu(e){return Object.keys(e).map(t=>({severity:"fatal",message:`Unexpected property "${t}"`}))}var nEu=h(()=>{"use strict";Ct();ho();kct();Fct();zGt();UWr();aUe()});function VWr({typeName:e,typeDeclaration:t,file:r,typeResolver:n,exampleResolver:i,example:o,workspace:s,breadcrumbs:a,depth:c}){return bC(t,{alias:u=>J0u({rawAlias:u,file:r,typeResolver:n,exampleResolver:i,example:o,workspace:s,breadcrumbs:a,depth:c}),enum:u=>X0u({rawEnum:u,example:o,breadcrumbs:a}),object:u=>cUe({typeName:e,typeNameForBreadcrumb:e,rawObject:u,example:o,file:r,typeResolver:n,exampleResolver:i,workspace:s,breadcrumbs:a,depth:c}),discriminatedUnion:u=>rEu({typeName:e,rawUnion:u,example:o,file:r,typeResolver:n,exampleResolver:i,workspace:s,breadcrumbs:a,depth:c}),undiscriminatedUnion:u=>$0u({rawUnion:u,example:o,file:r,typeResolver:n,exampleResolver:i,workspace:s,breadcrumbs:a,depth:c})})}var WMo=h(()=>{"use strict";ho();Y0u();Z0u();UWr();eEu();nEu()});function QT({rawTypeReference:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:s,depth:a}){if(a>oAm)return[{message:"Example is too deeply nested. This may indicate a circular reference. Example generation was truncated.",severity:"warning"}];if(typeof t=="string"&&t.startsWith("$")){let c=r.resolveType({type:e,file:i});if(c==null)return[];let u=n.parseExampleReference(t);if(u==null)return[];let l=r.resolveNamedType({referenceToNamedType:u.rawTypeReference,file:i});return l==null?[]:jct({expected:c,actual:l})?[]:[{message:`Expected example to be: ${e}. Example is ${t}.`}]}return kLe({type:e,_default:void 0,validation:void 0,visitor:{primitive:c=>sAm({primitiveType:c,example:t}),named:c=>{let u=r.getDeclarationOfNamedType({referenceToNamedType:c,file:i});return u==null?[]:VWr({typeName:u.typeName,typeDeclaration:u.declaration,file:u.file,example:t,typeResolver:r,exampleResolver:n,workspace:o,breadcrumbs:s,depth:a+1})},map:({keyType:c,valueType:u})=>ki(t)?Object.entries(t).flatMap(([l,p])=>[...QT({rawTypeReference:c,example:l,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:[...s,l],depth:a+1}),...QT({rawTypeReference:u,example:p,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:[...s,l],depth:a+1})]):o8(t,"a map"),list:c=>Array.isArray(t)?t.flatMap((u,l)=>QT({rawTypeReference:c,example:u,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:[...s,`${l}`],depth:a+1})):o8(t,"a list"),set:c=>{if(!Array.isArray(t))return o8(t,"a list");let u=vyr(t);return u.length>0?[{severity:"fatal",message:`Set has duplicate elements:
505
505
  `+u.map(l=>` - ${JSON.stringify(l)}`).join(`
506
506
  `)}]:t.flatMap((l,p)=>QT({rawTypeReference:c,example:l,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:[...s,`${p}`],depth:a+1}))},optional:c=>t==null?[]:QT({rawTypeReference:c,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:s,depth:a+1}),nullable:c=>t===null?[]:QT({rawTypeReference:c,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o,breadcrumbs:s,depth:a+1}),unknown:()=>[],literal:c=>{switch(c.type){case"boolean":return oM(u=>u===c.boolean,c.boolean.toString())(t);case"string":return oM(u=>u===c.string||pAm(c.string,u),`"${c.string}"`)(t);default:Ee(c)}}}})}function sAm({primitiveType:e,example:t}){return e.v2!=null?Ei._visit(e.v2,{integer:r=>aAm({example:t,rules:r.validation}),long:()=>aEu(t),uint:()=>iEu(t),uint64:()=>oEu(t),double:r=>cAm({example:t,rules:r.validation}),float:()=>sEu(t),boolean:()=>cEu(t),string:r=>uAm({example:t,rules:r.validation}),uuid:()=>uEu(t),date:()=>pEu(t),dateTime:()=>lEu(t),dateTimeRfc2822:()=>fEu(t),base64:()=>Nct(t),bigInteger:()=>Nct(t),_other:()=>{throw new T({message:"Unknown primitive type v2: "+e.v2,code:T.Code.InternalError})}}):ps._visit(e.v1,{integer:()=>dEu(t),long:()=>aEu(t),uint:()=>iEu(t),uint64:()=>oEu(t),double:()=>mEu(t),float:()=>sEu(t),boolean:()=>cEu(t),string:()=>Nct(t),uuid:()=>uEu(t),dateTime:()=>lEu(t),dateTimeRfc2822:()=>fEu(t),date:()=>pEu(t),base64:()=>Nct(t),bigInteger:()=>Nct(t),_other:()=>{throw new T({message:"Unknown primitive type: "+e.v1,code:T.Code.InternalError})}})}function aAm({example:e,rules:t}){let r=dEu(e);if(r.length>0||t==null)return r;let n=e;return t.min!=null&&(t.exclusiveMin&&n<=t.min||!t.exclusiveMin&&n<t.min)?[{message:`Expected integer to be greater than or equal to ${t.min}. Example is ${e}.`}]:t.max!=null&&(t.exclusiveMax&&n>=t.max||!t.exclusiveMax&&n>t.max)?[{message:`Expected integer to be less than or equal to ${t.max}. Example is ${e}.`}]:t.multipleOf!=null&&n%t.multipleOf!==0?[{message:`Expected integer to be a multiple of ${t.multipleOf}. Example is ${e}.`}]:[]}function cAm({example:e,rules:t}){let r=mEu(e);if(r.length>0||t==null)return r;let n=e;return t.min!=null&&(t.exclusiveMin&&n<=t.min||!t.exclusiveMin&&n<t.min)?[{message:`Expected double to be greater than or equal to ${t.min}. Example is ${e}.`}]:t.max!=null&&(t.exclusiveMax&&n>=t.max||!t.exclusiveMax&&n>t.max)?[{message:`Expected double to be less than or equal to ${t.max}. Example is ${e}.`}]:t.multipleOf!=null&&n%t.multipleOf!==0?[{message:`Expected double to be a multiple of ${t.multipleOf}. Example is ${e}.`}]:[]}function uAm({example:e,rules:t}){let r=Nct(e);if(r.length>0||t==null)return r;let n=e;return t.minLength!=null&&n.length<t.minLength?[{message:`Expected string length to be greater than or equal to ${t.minLength}. Example is ${e}, which is of length ${n.length}.`}]:t.maxLength!=null&&n.length>t.maxLength?[{message:`Expected string length to be less than or equal to ${t.maxLength}. Example is ${e}, which is of length ${n.length}.`}]:t.pattern!=null&&!new RegExp(t.pattern).test(n)?[{message:`Expected string to match pattern ${t.pattern}. Example is ${e}.`}]:[]}function oM(e,t){return r=>e(r)?[]:o8(r,t)}function jct({expected:e,actual:t}){if(e._type==="unknown")return!0;if(e._type==="primitive")return t._type==="primitive"&&e.primitive.v1===t.primitive.v1;if(e._type==="container")switch(e.container._type){case"list":case"set":return t._type==="container"&&t.container._type===e.container._type&&jct({expected:e.container.itemType,actual:t.container.itemType});case"optional":return jct({expected:e.container.itemType,actual:t._type==="container"&&t.container._type==="optional"?t.container.itemType:t});case"nullable":return jct({expected:e.container.itemType,actual:t._type==="container"&&t.container._type==="nullable"?t.container.itemType:t});case"map":return t._type==="container"&&t.container._type===e.container._type&&jct({expected:e.container.keyType,actual:t.container.keyType})&&jct({expected:e.container.valueType,actual:t.container.valueType});case"literal":return t._type!=="container"||t.container._type!==e.container._type?!1:lAm({expected:e.container.literal,actual:t.container.literal});default:Ee(e.container)}if(e._type==="named")return t._type==="named"&&t.filepath===e.filepath&&t.rawName===e.rawName;Ee(e)}function lAm({expected:e,actual:t}){switch(e.type){case"boolean":return t.type==="boolean"?e.boolean===t.boolean:!1;case"string":return t.type==="string"?e.string===t.string:!1;default:Ee(e)}}function pAm(e,t){if(typeof t!="string")return!1;let r=Jp.parse(e),n=Jp.parse(t);return r==null||n==null?!1:!!(r.isJSON()&&n.isJSON())}var HMo,rAm,nAm,iAm,oAm,Nct,dEu,iEu,oEu,sEu,mEu,aEu,cEu,uEu,lEu,pEu,fEu,aUe=h(()=>{"use strict";Ct();ho();Wn();kt();zGt();WMo();HMo=/^([+-]?\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)?)?)?)?$/,rAm=/^[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}$/,nAm=/^\d{4}-\d{2}-\d{2}$/,iAm=/^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s+)?\d{1,2}\s+(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+\d{2,4}\s+\d{2}:\d{2}(?::\d{2})?\s+(?:[+-]\d{4}|[A-Z]{2,3})$/i,oAm=128;Nct=oM(e=>typeof e=="string","a string"),dEu=oM(e=>Number.isInteger(e),"an integer"),iEu=oM(e=>Number.isInteger(e)&&typeof e=="number"&&e>=0,"a uint"),oEu=oM(e=>Number.isInteger(e)&&typeof e=="number"&&e>=0,"a uint64"),sEu=oM(e=>typeof e=="number","a float"),mEu=oM(e=>typeof e=="number","a double"),aEu=oM(e=>Number.isInteger(e),"an integer"),cEu=oM(e=>typeof e=="boolean","a boolean"),uEu=oM(e=>typeof e=="string"&&rAm.test(e),"a UUID"),lEu=oM(e=>typeof e=="string"&&HMo.test(e),"an ISO 8601 timestamp"),pEu=oM(e=>typeof e=="string"&&nAm.test(e)&&HMo.test(e),"a date"),fEu=oM(e=>typeof e=="string"&&(iAm.test(e)||HMo.test(e)),"an RFC 2822 or ISO 8601 timestamp")});function GWr({_enum:e,file:t}){let r=e.enum.map(i=>({...zT(i),name:t.casingsGenerator.generateNameAndWireValue({wireValue:typeof i=="string"?i:i.value,name:zct(i).name,opts:{casingOverrides:typeof i!="string"?i.casing:void 0}})})),n;if(e.default!=null&&(n=r.find(i=>ar(i.name)===e.default),n==null))throw new T({message:`Default value ${e.default} not found in enum values`,code:T.Code.ValidationError});return{default:n,values:r,forwardCompatible:e["forward-compatible"]||void 0}}function hEu(e,t){let r=t.enum.find(n=>typeof n=="string"?!1:n.value===e);return{name:typeof r=="string"?e:r?.name??e,wasExplicitlySet:!1}}function zct(e){return typeof e=="string"?{name:e,wasExplicitlySet:!1}:e.name==null?{name:e.value,wasExplicitlySet:!1}:{name:e.name,wasExplicitlySet:!0}}var _Gt=h(()=>{"use strict";lc();kt();A4()});function KMo({typeName:e,typeDeclaration:t,example:r,typeResolver:n,exampleResolver:i,fileContainingType:o,fileContainingExample:s,workspace:a,recursionContext:c}){return bC(t,{alias:u=>Ku.alias({value:Wf({example:r,rawTypeBeingExemplified:typeof u=="string"?u:u.type,fileContainingRawTypeReference:o,fileContainingExample:s,typeResolver:n,exampleResolver:i,workspace:a,recursionContext:c})}),object:u=>gEu({typeName:e,rawObject:u,example:r,fileContainingType:o,fileContainingExample:s,typeResolver:n,exampleResolver:i,workspace:a,recursionContext:c}),discriminatedUnion:u=>{let l=jme(u);if(!ki(r))throw new T({message:"Example is not an object",code:T.Code.ValidationError});let p=r[l];if(p==null)throw new T({message:"Example is missing discriminant: "+l,code:T.Code.ValidationError});if(typeof p!="string")throw new T({message:"Discriminant value is not a string",code:T.Code.ValidationError});let d=u.union[p];if(d==null)throw new T({message:`${p} is not one of the specified discriminant values.`,code:T.Code.ValidationError});let f=typeof d=="string"?d:typeof d.type=="string"?d.type:void 0,m=Object.entries(u["base-properties"]??{}).map(([A,y])=>{let I=r[A];if(I!=null)return{name:s.casingsGenerator.generateNameAndWireValue({name:A,wireValue:A}),value:Wf({example:I,rawTypeBeingExemplified:typeof y=="string"?y:y.type,fileContainingRawTypeReference:o,fileContainingExample:s,typeResolver:n,exampleResolver:i,workspace:a,recursionContext:c})}}).filter(A=>A!=null),g=(typeof u.extends>"u"?[]:typeof u.extends=="string"?[u.extends]:u.extends).flatMap(A=>{let y=n.resolveNamedTypeOrThrow({file:o,referenceToNamedType:A});if(y._type!=="named"||!Of(y.declaration))throw new T({message:"Extended type is not a named object",code:T.Code.InternalError});let I=y.declaration;return Object.entries(I.properties??{}).map(([v,S])=>{let B=r[v];if(B!=null)return{name:s.casingsGenerator.generateNameAndWireValue({name:typeof S=="string"?v:S.name??v,wireValue:v}),value:Wf({example:B,rawTypeBeingExemplified:typeof S=="string"?S:S.type,fileContainingRawTypeReference:o,fileContainingExample:s,typeResolver:n,exampleResolver:i,workspace:a,recursionContext:c}),propertyAccess:bSe({property:S}),originalTypeDeclaration:e}}).filter(v=>v!=null)});return Ku.union({discriminant:s.casingsGenerator.generateNameAndWireValue({name:Rct(u).name,wireValue:l}),singleUnionType:mAm({rawValueType:f,rawSingleUnionType:d,fileContainingType:o,fileContainingExample:s,typeResolver:n,exampleResolver:i,example:r,discriminantValueForExample:p,workspace:a,recursionContext:c}),baseProperties:m,extendProperties:g})},enum:u=>{if(typeof r!="string"){let l=u.enum.map(p=>typeof p=="string"?p:p.value).join(", ");throw new T({message:`Expected one of ${l}. Received ${r}`,code:T.Code.ValidationError})}return Ku.enum({value:s.casingsGenerator.generateNameAndWireValue({name:hEu(r,u).name,wireValue:r})})},undiscriminatedUnion:u=>{for(let[d,f]of u.union.entries())if(QT({rawTypeReference:typeof f=="string"?f:f.type,example:r,typeResolver:n,exampleResolver:i,file:o,workspace:a,breadcrumbs:[],depth:0}).length===0)return Ku.undiscriminatedUnion({index:d,singleUnionType:Wf({example:r,rawTypeBeingExemplified:typeof f=="string"?f:f.type,fileContainingRawTypeReference:o,fileContainingExample:s,typeResolver:n,exampleResolver:i,workspace:a,recursionContext:c})});let p=u.union.map(d=>typeof d=="string"?d:d.type).join(", ");throw new T({message:`Expected one of ${p}. Received ${r}`,code:T.Code.ValidationError})}})}function Wf({example:e,fileContainingExample:t,rawTypeBeingExemplified:r,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:a}){let c=a??{depth:0,seenTypeIds:new Set},{resolvedExample:u,file:l}=o.resolveExampleOrThrow({example:e,file:t}),p=o.resolveAllReferencesInExampleOrThrow({example:e,file:t}).resolvedExample;return{shape:kLe({type:r,_default:void 0,validation:void 0,visitor:{primitive:f=>dAm({example:u,typeBeingExemplified:f.v1}),map:({keyType:f,valueType:m})=>{if(!ki(u))throw new T({message:"Example is not an object",code:T.Code.ValidationError});let g={depth:c.depth+1,seenTypeIds:c.seenTypeIds};return to.container(Hu.map({map:Object.entries(u).map(([A,y])=>({key:Wf({example:A,fileContainingExample:l,rawTypeBeingExemplified:f,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:g}),value:Wf({example:y,fileContainingExample:l,rawTypeBeingExemplified:m,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:g})})),keyType:n.parseTypeReference(f),valueType:n.parseTypeReference(m)}))},list:f=>{if(!Array.isArray(u))throw new T({message:"Example is not a list",code:T.Code.ValidationError});let m={depth:c.depth+1,seenTypeIds:c.seenTypeIds};return to.container(Hu.list({list:u.map(g=>Wf({example:g,fileContainingExample:l,rawTypeBeingExemplified:f,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:m})),itemType:n.parseTypeReference(f)}))},set:f=>{if(!Array.isArray(u))throw new T({message:"Example is not a list",code:T.Code.ValidationError});let m={depth:c.depth+1,seenTypeIds:c.seenTypeIds};return to.container(Hu.set({set:u.map(g=>Wf({example:g,fileContainingExample:l,rawTypeBeingExemplified:f,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:m})),itemType:n.parseTypeReference(f)}))},optional:f=>{let m={depth:c.depth+1,seenTypeIds:c.seenTypeIds};return to.container(Hu.optional({optional:u!=null?Wf({example:u,fileContainingExample:l,rawTypeBeingExemplified:f,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:m}):void 0,valueType:n.parseTypeReference(f)}))},nullable:f=>{let m={depth:c.depth+1,seenTypeIds:c.seenTypeIds};return to.container(Hu.nullable({nullable:u!=null?Wf({example:u,fileContainingExample:l,rawTypeBeingExemplified:f,fileContainingRawTypeReference:n,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:m}):void 0,valueType:n.parseTypeReference(f)}))},literal:f=>{switch(f.type){case"boolean":return to.container(Hu.literal({literal:Qi.boolean(f.boolean)}));case"string":return to.container(Hu.literal({literal:Qi.string({original:f.string})}));default:Ee(f)}},named:f=>{let m=i.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:r,file:n}),g=n.parseTypeReference(f);if(g.type!=="named")throw new T({message:"Type reference is not to a named type.",code:T.Code.InternalError});let A={typeId:g.typeId,fernFilepath:g.fernFilepath,name:g.name,displayName:g.displayName};if(c.depth>fAm||c.seenTypeIds.has(g.typeId))return to.unknown(p);let y={depth:c.depth+1,seenTypeIds:new Set(c.seenTypeIds).add(g.typeId)};return to.named({typeName:A,shape:KMo({typeName:A,typeDeclaration:m.declaration,fileContainingType:m.file,fileContainingExample:l,example:u,typeResolver:i,exampleResolver:o,workspace:s,recursionContext:y})})},unknown:()=>to.unknown(p)}}),jsonExample:p}}function JMo({example:e}){return to.unknown(e)}function dAm({example:e,typeBeingExemplified:t}){return ps._visit(t,{string:()=>{if(typeof e!="string")return to.primitive(Qi.string({original:Vo.STRING}));let r=e.startsWith(`\\${"$"}`)?e.slice(1):e;return to.primitive(Qi.string({original:r}))},dateTime:()=>typeof e!="string"?to.primitive(Qi.string({original:Vo.DATE_TIME})):to.primitive(Qi.datetime({datetime:new Date(e),raw:e})),date:()=>typeof e!="string"?to.primitive(Qi.string({original:Vo.DATE})):to.primitive(Qi.date(e)),base64:()=>typeof e!="string"?to.primitive(Qi.string({original:Vo.BASE64})):to.primitive(Qi.string({original:e})),uint:()=>typeof e!="number"?to.primitive(Qi.uint(Vo.UINT)):to.primitive(Qi.uint(e)),uint64:()=>typeof e!="number"?to.primitive(Qi.uint64(Vo.UINT64)):to.primitive(Qi.uint64(e)),integer:()=>typeof e!="number"?to.primitive(Qi.integer(Vo.INT)):to.primitive(Qi.integer(e)),float:()=>typeof e!="number"?to.primitive(Qi.float(Vo.FLOAT)):to.primitive(Qi.float(e)),double:()=>typeof e!="number"?to.primitive(Qi.double(Vo.DOUBLE)):to.primitive(Qi.double(e)),long:()=>typeof e!="number"?to.primitive(Qi.long(Vo.UINT)):to.primitive(Qi.long(e)),boolean:()=>typeof e!="boolean"?to.primitive(Qi.boolean(Vo.BOOLEAN)):to.primitive(Qi.boolean(e)),uuid:()=>typeof e!="string"?to.primitive(Qi.string({original:Vo.UUID})):to.primitive(Qi.uuid(e)),bigInteger:()=>typeof e!="string"?to.primitive(Qi.string({original:Vo.BIG_INTEGER})):to.primitive(Qi.string({original:e})),dateTimeRfc2822:()=>typeof e!="string"?to.primitive(Qi.datetime({datetime:new Date(Vo.DATE_TIME),raw:Vo.DATE_TIME})):to.primitive(Qi.datetime({datetime:new Date(e),raw:e})),_other:()=>{throw new T({message:"Unknown primitive type: "+t,code:T.Code.InternalError})}})}function gEu({typeName:e,rawObject:t,example:r,fileContainingType:n,fileContainingExample:i,typeResolver:o,exampleResolver:s,workspace:a,recursionContext:c}){if(!ki(r))throw new T({message:`Example is not an object. Got: ${JSON.stringify(r)}`,code:T.Code.ValidationError});let u=Object.entries(r).map(([d,f])=>{let m=AEu({typeName:e,wirePropertyKey:d,rawObject:t,typeResolver:o,file:n});return[d,f,m]}),l=u.filter(([,,d])=>d!=null),p=u.filter(([,,d])=>d==null);return Ku.object({properties:t.properties!=null||t.extends!=null?l.map(([d,f,m])=>{let g=Wf({example:f,fileContainingExample:i,rawTypeBeingExemplified:typeof m.rawPropertyType=="string"?m.rawPropertyType:m.rawPropertyType.type,fileContainingRawTypeReference:m.file,typeResolver:o,exampleResolver:s,workspace:a,recursionContext:c});return{name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:d,property:m.rawPropertyType}).name,wireValue:d}),value:g,originalTypeDeclaration:m.typeName,propertyAccess:bSe({property:m.rawPropertyType})}}):[],extraProperties:t["extra-properties"]!==!0||p.length===0?void 0:p.map(([d,f])=>({name:i.casingsGenerator.generateNameAndWireValue({name:d,wireValue:d}),value:{shape:JMo({example:f}),jsonExample:f}}))})}function AEu({typeName:e,wirePropertyKey:t,rawObject:r,typeResolver:n,file:i}){let o=r.properties?.[t];return o!=null?{typeName:e,rawPropertyType:o,file:i}:UGt({wirePropertyKey:t,extends_:r.extends,typeResolver:n,file:i})}function UGt({wirePropertyKey:e,extends_:t,typeResolver:r,file:n}){if(t!=null){let i=typeof t=="string"?[t]:t;for(let o of i){let s=r.resolveNamedTypeOrThrow({referenceToNamedType:o,file:n});if(s._type!=="named"||!Of(s.declaration))throw new T({message:"Extension is not of a named object",code:T.Code.InternalError});let a=AEu({wirePropertyKey:e,rawObject:s.declaration,typeResolver:r,typeName:s.name,file:s.file});if(a!=null)return a}}}function mAm({rawValueType:e,rawSingleUnionType:t,fileContainingType:r,fileContainingExample:n,typeResolver:i,exampleResolver:o,example:s,discriminantValueForExample:a,workspace:c,recursionContext:u}){let l=n.casingsGenerator.generateNameAndWireValue({name:Dct({unionKey:a,rawSingleUnionType:t}).name,wireValue:a});if(e==null)return{wireDiscriminantValue:l,shape:Xt.ExampleSingleUnionTypeProperties.noProperties()};let p=GMo({rawSingleUnionType:t,rawValueType:e,parsedValueType:r.parseTypeReference(e),file:r,typeResolver:i});switch(p.propertiesType){case"singleProperty":{if(!ki(s))throw new T({message:"Example is not an object",code:T.Code.ValidationError});return{wireDiscriminantValue:l,shape:Xt.ExampleSingleUnionTypeProperties.singleProperty(Wf({example:s[ar(p.name)],rawTypeBeingExemplified:e,typeResolver:i,exampleResolver:o,fileContainingRawTypeReference:r,fileContainingExample:n,workspace:c,recursionContext:u}))}}case"samePropertiesAsObject":{if(!ki(s))throw new T({message:"Example is not an object",code:T.Code.ValidationError});let d=i.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:e,file:r});for(;UIe(d.declaration);)d=i.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:typeof d.declaration=="string"?d.declaration:d.declaration.type,file:r});if(!Of(d.declaration))throw new T({message:`${e} is not an object`,code:T.Code.ValidationError});let f={typeId:p.typeId,fernFilepath:p.fernFilepath,name:p.name,displayName:p.displayName};return{wireDiscriminantValue:l,shape:Xt.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeId:Xu.generateTypeId(f),object:gEu({rawObject:d.declaration,example:s,fileContainingType:d.file,fileContainingExample:n,typeResolver:i,exampleResolver:o,typeName:f,workspace:c,recursionContext:u})})}}default:Ee(p)}}var fAm,Qct=h(()=>{"use strict";Ct();ho();Wn();lc();kt();aUe();kct();_Gt();i8();fAm=128});function qWr({file:e,queryParameterKey:t,queryParameter:r}){let{name:n}=Mme({queryParameterKey:t,queryParameter:r}),i=typeof r!="string"?r["client-default"]:void 0,o=typeof r!="string"?r.default:void 0,s=typeof r!="string"&&r["allow-multiple"]===!0&&Array.isArray(r.default)?{...r,default:void 0}:r,a=e.parseTypeReference(s);return{...zT(r),name:e.casingsGenerator.generateNameAndWireValue({wireValue:t,name:n}),valueType:a,allowMultiple:typeof r!="string"&&r["allow-multiple"]!=null?r["allow-multiple"]:!1,clientDefault:NGt(i),defaultValue:o,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},explode:typeof r!="string"&&r.explode!=null?r.explode:void 0}}function Mme({queryParameterKey:e,queryParameter:t}){return typeof t!="string"&&t.name!=null?{name:t.name,wasExplicitlySet:!0}:{name:e,wasExplicitlySet:!1}}var Mct=h(()=>{"use strict";A4();UMo()});function bEu({service:e,endpoint:t,example:r,typeResolver:n,errorResolver:i,exampleResolver:o,variableResolver:s,file:a,workspace:c}){let u=gAm({service:e,endpoint:t,example:r,typeResolver:n,exampleResolver:o,variableResolver:s,file:a,workspace:c});return{id:r.name??mSe(r),name:r.name!=null?a.casingsGenerator.generateName(r.name):void 0,docs:r.docs,url:vAm({file:a,service:e,endpoint:t,example:r,pathParams:u}),...u,...AAm({service:e,endpoint:t,example:r,typeResolver:n,exampleResolver:o,file:a,workspace:c}),queryParameters:r["query-parameters"]!=null?Object.entries(r["query-parameters"]).map(([l,p])=>{let d=typeof t.request!="string"?t.request?.["query-parameters"]?.[l]:void 0;if(d==null)throw new T({message:`Query parameter ${l} does not exist`,code:T.Code.ReferenceError});let f=typeof d!="string"&&d["allow-multiple"]===!0,m=typeof d=="string"?d:d.type,g;if(f&&Array.isArray(p)){let A=p.map(y=>Wf({example:y,rawTypeBeingExemplified:m,typeResolver:n,exampleResolver:o,fileContainingRawTypeReference:a,fileContainingExample:a,workspace:c}));g={jsonExample:p,shape:to.container(Hu.list({list:A,itemType:a.parseTypeReference(m)}))}}else g=Wf({example:p,rawTypeBeingExemplified:m,typeResolver:n,exampleResolver:o,fileContainingRawTypeReference:a,fileContainingExample:a,workspace:c});return{name:a.casingsGenerator.generateNameAndWireValue({name:Mme({queryParameterKey:l,queryParameter:d}).name,wireValue:l}),value:g,shape:hAm({queryParameter:d})}}):[],request:bAm({endpoint:t,example:r,typeResolver:n,exampleResolver:o,file:a,workspace:c}),response:EAm({endpoint:t,example:r,typeResolver:n,errorResolver:i,exampleResolver:o,file:a,workspace:c})}}function hAm({queryParameter:e}){return(typeof e!="string"&&e["allow-multiple"]!=null?e["allow-multiple"]:!1)?Ew.exploded():Ew.single()}function gAm({service:e,endpoint:t,example:r,typeResolver:n,exampleResolver:i,variableResolver:o,file:s,workspace:a}){let c=[],u=[],l=[],p=({name:d,pathParameterDeclaration:f,examplePathParameter:m})=>{let g=VGt({parameter:f,variableResolver:o,file:s});return{name:d,value:Wf({example:m,rawTypeBeingExemplified:g.rawType,typeResolver:n,exampleResolver:i,fileContainingRawTypeReference:g.file,fileContainingExample:s,workspace:a})}};if(r["path-parameters"]!=null){let d=y4(t);for(let[f,m]of Object.entries(r["path-parameters"])){let g=s.rootApiFile["path-parameters"]?.[f],A=e["path-parameters"]?.[f],y=d[f];if(g!=null)c.push(p({name:s.casingsGenerator.generateName(f),pathParameterDeclaration:g,examplePathParameter:m}));else if(y!=null)l.push(p({name:s.casingsGenerator.generateName(f),pathParameterDeclaration:y,examplePathParameter:m}));else if(A!=null)u.push(p({name:s.casingsGenerator.generateName(f),pathParameterDeclaration:A,examplePathParameter:m}));else throw new T({message:`Path parameter ${f} does not exist`,code:T.Code.ReferenceError})}}return{rootPathParameters:c,endpointPathParameters:l,servicePathParameters:u}}function AAm({service:e,endpoint:t,example:r,typeResolver:n,exampleResolver:i,file:o,workspace:s}){let a=[],c=[];if(r.headers!=null)for(let[u,l]of Object.entries(r.headers)){let p=typeof t.request!="string"?t.request?.headers?.[u]:void 0,d=e.headers?.[u];p!=null?c.push({name:o.casingsGenerator.generateNameAndWireValue({name:wre({headerKey:u,header:p}).name,wireValue:u}),value:Wf({example:l,rawTypeBeingExemplified:typeof p=="string"?p:p.type,typeResolver:n,exampleResolver:i,fileContainingRawTypeReference:o,fileContainingExample:o,workspace:s})}):d!=null&&a.push({name:o.casingsGenerator.generateNameAndWireValue({name:wre({headerKey:u,header:d}).name,wireValue:u}),value:Wf({example:l,rawTypeBeingExemplified:typeof d=="string"?d:d.type,typeResolver:n,exampleResolver:i,fileContainingRawTypeReference:o,fileContainingExample:o,workspace:s})})}return{endpointHeaders:c,serviceHeaders:a}}function yAm({rawType:e,typeResolver:t,file:r}){let n=t.resolveType({type:e,file:r});return n?._type==="container"&&n.container._type==="optional"}function bAm({endpoint:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o}){let s=typeof e.request!="string"?e.request?.body:e.request;if(s==null||typeof s=="string"&&zLt(s)!=null)return;if(!nA(s)){let u=typeof s!="string"?s.type:s,l=typeof s!="string"&&s.optional===!0||yAm({rawType:u,typeResolver:r,file:i});return t.request===void 0&&l?void 0:rB.reference(Wf({example:t.request,rawTypeBeingExemplified:u,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}))}if(!t.request)return;if(!ki(t.request))throw new T({message:`Example is not an object. Got: ${JSON.stringify(t.request)}`,code:T.Code.ValidationError});let a=[],c=[];for(let[u,l]of Object.entries(t.request)){let p=s.properties?.[u],d=typeof p=="string"?p:p?.type;if(!(d!=null&&dQ(d)!=null))if(p!=null)a.push({name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:u,property:p}).name,wireValue:u}),value:Wf({example:l,rawTypeBeingExemplified:typeof p!="string"?p.type:p,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}),originalTypeDeclaration:void 0});else{let f=UGt({extends_:s.extends,wirePropertyKey:u,typeResolver:r,file:i});if(f==null){if(s["extra-properties"]===!0){c.push({name:i.casingsGenerator.generateNameAndWireValue({name:u,wireValue:u}),value:{jsonExample:l,shape:JMo({example:l})}});continue}throw new T({message:"Could not find original type declaration for property: "+u,code:T.Code.ResolutionError})}a.push({name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:u,property:f.rawPropertyType}).name,wireValue:u}),value:Wf({example:l,rawTypeBeingExemplified:typeof f.rawPropertyType=="string"?f.rawPropertyType:f.rawPropertyType.type,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:f.file,fileContainingExample:i,workspace:o}),originalTypeDeclaration:f.typeName})}}return rB.inlinedRequestBody({jsonExample:n.resolveAllReferencesInExampleOrThrow({example:t.request,file:i}).resolvedExample,properties:a,extraProperties:c.length>0?c:void 0})}function EAm({endpoint:e,example:t,typeResolver:r,errorResolver:n,exampleResolver:i,file:o,workspace:s}){return t.response==null?iA.ok(uy.body(void 0)):zLe(e,t.response,{body:a=>{if(a.error!=null){let c=n.getDeclarationOrThrow(a.error,o);return iA.error({error:ESe({errorName:a.error,file:o}),body:c.declaration.type!=null?Wf({example:a.body,rawTypeBeingExemplified:c.declaration.type,typeResolver:r,exampleResolver:i,fileContainingRawTypeReference:c.file,fileContainingExample:o,workspace:s}):void 0})}return iA.ok(uy.body(IAm({endpoint:e,example:a,typeResolver:r,exampleResolver:i,file:o,workspace:s})))},stream:a=>{let c=typeof e["response-stream"]=="string"?e["response-stream"]:e["response-stream"]?.type;return iA.ok(uy.stream(a.stream.map(u=>{if(c!=null)return Wf({example:u,rawTypeBeingExemplified:c,typeResolver:r,exampleResolver:i,fileContainingRawTypeReference:o,fileContainingExample:o,workspace:s})}).filter(la)))},events:a=>{let c=typeof e["response-stream"]=="string"?e["response-stream"]:e["response-stream"]?.type;return iA.ok(uy.sse(a.stream.map(({event:u,data:l})=>{if(c==null)return;let p=l,d=r.resolveType({type:c,file:o});if(d?._type==="named"&&KV(d.declaration)&&typeof d.declaration.discriminant=="object"&&d.declaration.discriminant?.context==="protocol"){let m=jme(d.declaration);ki(l)&&l[m]==null&&(p={[m]:u,...l})}let f=Wf({example:p,rawTypeBeingExemplified:c,typeResolver:r,exampleResolver:i,fileContainingRawTypeReference:o,fileContainingExample:o,workspace:s});return{event:u,data:f}}).filter(la)))}})}function IAm({endpoint:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o}){let s=typeof e.response!="string"?e.response?.type:e.response;if(s!=null&&t.body!=null)return Wf({example:t.body,rawTypeBeingExemplified:s,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o})}function vAm({file:e,service:t,endpoint:r,pathParams:n}){let i=(0,yEu.default)(e.rootApiFile["base-path"]??"",t["base-path"],r.path);for(let o of[...n.endpointPathParameters,...n.servicePathParameters,...n.rootPathParameters])i=i.replaceAll(`{${Vr(o.name)}}`,encodeURIComponent(`${o.value.jsonExample}`));return i=i.replace(/\{([^}]+)\}/g,(o,s)=>encodeURIComponent(s)),i=i.replaceAll("//","/"),i.startsWith("/")||(i=`/${i}`),i}var yEu,EEu=h(()=>{"use strict";Ct();ho();Wn();lc();kt();yEu=Ae(qf(),1);FGt();jGt();kct();Qct();i8();uUe();Mct()});function IEu({endpoint:e,file:t,typeResolver:r}){let n=CAm({endpoint:e,file:t,typeResolver:r}),i=typeof e.response!="string"?e.response?.docs:void 0;return{body:n,statusCode:typeof e.response!="string"?e.response?.["status-code"]:void 0,isWildcardStatusCode:void 0,docs:i}}function CAm({endpoint:e,file:t,typeResolver:r}){let n=xAm({endpoint:e,file:t,typeResolver:r}),i=SAm({endpoint:e,file:t,typeResolver:r});if(n!=null&&i!=null){let o;switch(n.type){case"fileDownload":{o=nB.fileDownload({...n});break}case"json":{o=nB.json({...n.value});break}case"text":{o=nB.text({...n});break}case"bytes":{o=nB.bytes({...n});break}default:Ee(n)}return ju.streamParameter({nonStreamResponse:o,streamResponse:i})}else{if(n!=null)return n;if(i!=null)return ju.streaming(i)}}function xAm({endpoint:e,file:t,typeResolver:r}){let{response:n}=e;if(n!=null){let i=typeof n!="string"?n.docs:void 0,o=typeof n=="string"?n:n.type;if(o!=null){if(dQ(o)!=null)return ju.fileDownload({docs:i,v2Examples:void 0});if(jLe(o)!=null){let s=typeof n!="string"?n["content-type"]:void 0;return ju.text({docs:i,v2Examples:void 0,contentType:s??void 0})}else return HV(o)!=null?ju.bytes({docs:i,v2Examples:void 0}):wAm(n,i,t,r)}}}function SAm({endpoint:e,file:t,typeResolver:r}){let{["response-stream"]:n}=e;if(n!=null){let i=typeof n!="string"?n.docs:void 0,o=typeof n=="string"?n:n.type,s=typeof n=="string"?"json":n.format??"json";return EIe(o)?dv.text({docs:i,v2Examples:void 0}):typeof n!="string"&&s==="sse"?dv.sse({docs:i,payload:t.parseTypeReference(o),terminator:typeof n!="string"?n.terminator:void 0,resumable:typeof n!="string"?n.resumable:void 0,v2Examples:void 0}):dv.json({docs:i,payload:t.parseTypeReference(o),terminator:typeof n!="string"?n.terminator:void 0,v2Examples:void 0})}}function wAm(e,t,r,n){let i=typeof e!="string"?e.type:e;if(i==null)return;let o=TAm({response:e,responseTypeReference:i,file:r}),s=OAm({responseTypeReference:i,file:r,typeResolver:n}),a=typeof e!="string"?e.property:void 0;return a!=null?ju.json(uI.nestedPropertyAsResponse({docs:t,responseBodyType:o,responseProperty:sUe({typeResolver:n,file:r,resolvedType:s,property:a}),v2Examples:void 0})):ju.json(uI.response({docs:t,responseBodyType:o,v2Examples:void 0}))}function TAm({response:e,responseTypeReference:t,file:r}){try{return r.parseTypeReference(typeof e=="string"?e:{...e,type:t})}catch(n){throw vEu({error:n,responseTypeReference:t})}}function OAm({responseTypeReference:e,file:t,typeResolver:r}){try{return r.resolveTypeOrThrow({type:e,file:t})}catch(n){throw vEu({error:n,responseTypeReference:e})}}function vEu({error:e,responseTypeReference:t}){return e instanceof T&&e.code===T.Code.ResolutionError?new T({message:`Response type ${t} is not defined.`,code:T.Code.ValidationError}):e}var CEu=h(()=>{"use strict";Ct();ho();Wn();kt();jWr()});function xEu({propertyResolver:e,file:t,endpointName:r,endpointSchema:n,paginationPropertyComponents:i}){return $0.cursor({page:e.resolveRequestPropertyOrThrow({file:t,endpoint:r,propertyComponents:i.cursor}),next:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:i.next_cursor}),results:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:i.results})})}var SEu=h(()=>{"use strict";Wn()});function wEu({propertyResolver:e,file:t,endpointName:r,paginationPropertyComponents:n}){return $0.custom({results:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n.results})})}var TEu=h(()=>{"use strict";Wn()});function OEu({propertyResolver:e,file:t,endpointName:r,endpointSchema:n,paginationPropertyComponents:i}){return $0.offset({page:e.resolveRequestPropertyOrThrow({file:t,endpoint:r,propertyComponents:i.offset}),results:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:i.results}),step:i.step!=null?e.resolveRequestPropertyOrThrow({file:t,endpoint:r,propertyComponents:i.step}):void 0,hasNextPage:i.hasNextPage!=null?e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:i.hasNextPage}):void 0})}var PEu=h(()=>{"use strict";Wn()});function BEu(e){if(WWr(e))return{type:"uri",nextUri:UB(e.next_uri),results:UB(e.results)};if(HWr(e))return{type:"path",nextPath:UB(e.next_path),results:UB(e.results)};if(BAm(e))return{type:"offset",offset:KK(e.offset),results:UB(e.results),step:e.step!=null?KK(e.step):void 0,hasNextPage:e["has-next-page"]!=null?UB(e["has-next-page"]):void 0};if(PAm(e))return{type:"cursor",cursor:KK(e.cursor),next_cursor:UB(e.next_cursor),results:UB(e.results)};if(RAm(e))return{type:"custom",results:UB(e.results)};throw new T({message:"Invalid pagination schema",code:T.Code.ValidationError})}function PAm(e){return e.cursor!=null}function WWr(e){return e.next_uri!=null}function HWr(e){return e.next_path!=null}function BAm(e){return e.offset!=null&&e.results!=null}function RAm(e){return"type"in e&&e.type==="custom"}var YMo=h(()=>{"use strict";kt();Bct()});function REu({propertyResolver:e,file:t,endpointName:r,paginationPropertyComponents:n}){return $0.path({nextPath:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n.nextPath}),results:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n.results})})}var DEu=h(()=>{"use strict";Wn()});function kEu({propertyResolver:e,file:t,endpointName:r,paginationPropertyComponents:n}){return $0.uri({nextUri:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n.nextUri}),results:e.resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n.results})})}var FEu=h(()=>{"use strict";Wn()});function NEu({propertyResolver:e,file:t,endpointName:r,endpointSchema:n}){let i=typeof n.pagination=="boolean"?t.rootApiFile.pagination:n.pagination;if(!i)return;let o=BEu(i);switch(o.type){case"cursor":return xEu({propertyResolver:e,file:t,endpointName:r,endpointSchema:n,paginationPropertyComponents:o});case"offset":return OEu({propertyResolver:e,file:t,endpointName:r,endpointSchema:n,paginationPropertyComponents:o});case"custom":return wEu({propertyResolver:e,file:t,endpointName:r,paginationPropertyComponents:o});case"uri":return kEu({propertyResolver:e,file:t,endpointName:r,paginationPropertyComponents:o});case"path":return REu({propertyResolver:e,file:t,endpointName:r,paginationPropertyComponents:o});default:Ee(o)}}var jEu=h(()=>{"use strict";Ct();SEu();TEu();PEu();YMo();DEu();FEu()});function zEu({errors:e,file:t}){return e==null?[]:Object.values(e).map(r=>{let n=typeof r=="string"?r:r.error,i=ESe({errorName:n,file:t});return{docs:typeof r!="string"?r.docs:void 0,error:i}})}var QEu=h(()=>{"use strict";jGt()});function MEu({endpointSchema:e}){if(e.retries&&e.retries.disabled!==void 0)return{disabled:e.retries.disabled}}var LEu=h(()=>{"use strict"});function KWr({source:e}){return{filepath:e.relativeFilePath,packageName:e.packageName,options:e.csharpNamespace!=null?{csharp:{namespace:e.csharpNamespace}}:void 0}}var XMo=h(()=>{"use strict"});function _Eu({source:e,serviceNameOverride:t}){let r=t??e.serviceName;if(r!=null)return{file:KWr({source:e}),name:MGt.generateName(r)}}var UEu=h(()=>{"use strict";Fct();XMo()});function VEu({file:e,serviceDeclaration:t,sourceResolver:r}){return bLe(t.source)?qEu(e,t.source,r,t.transport?.grpc?.["service-name"]):MV.http()}function GEu({file:e,serviceTransport:t,endpointDeclaration:r,sourceResolver:n}){let i=t.type==="grpc",o=t.type==="http",s=bLe(r.source),a=!s;if(i){if(o&&s)throw new T({message:"Cannot have a grpc endpoint on an http service",code:T.Code.ValidationError});if(i&&a)return MV.http();if(i&&s){let c=r.source,u=r.transport?.grpc?.["service-name"];return u?qEu(e,c,n,u):void 0}throw new T({message:`Internal error; failed to determine endpoint transport for
507
- ${JSON.stringify(r)}"`,code:T.Code.InternalError})}}function qEu(e,t,r,n){let i=r.resolveSourceOrThrow({source:t,relativeFilepath:e.relativeFilepath});if(i==null||i.type!=="protobuf")throw new T({message:`Expected a protobuf source for ${t.proto}.`,code:T.Code.ResolutionError});let o=_Eu({source:i,serviceNameOverride:n});if(o==null)throw new T({message:`Failed to resolve service name from ${i.relativeFilePath}.`,code:T.Code.IrConversionError});return MV.grpc({service:o})}var WEu=h(()=>{"use strict";ho();Wn();kt();UEu()});function HEu({rootDefaultUrl:e,rootPathParameters:t,serviceDefinition:r,file:n,errorResolver:i,typeResolver:o,propertyResolver:s,exampleResolver:a,variableResolver:c,sourceResolver:u,globalErrors:l,workspace:p,auth:d,irSettings:f}){let m=Lct({pathParameters:r["path-parameters"],location:Xt.PathParameterLocation.Service,file:n,variableResolver:c}),g=f.pathParameterOrder,A=(()=>{switch(g){case Hr.PathParameterOrder.UrlOrder:return r["base-path"]?_Wr(r["base-path"],m):m;case Hr.PathParameterOrder.SpecOrder:return m;default:Ee(g)}})(),y=VEu({file:n,serviceDeclaration:r,sourceResolver:u}),I={fernFilepath:n.fernFilepath};return{availability:iM(r.availability),name:I,displayName:r["display-name"]??void 0,basePath:eb(r["base-path"]),headers:r.headers!=null?Object.entries(r.headers).map(([v,S])=>s8({headerKey:v,header:S,file:n})):[],pathParameters:A,encoding:NAm(y,r),transport:y,endpoints:Object.entries(r.endpoints).map(([v,S])=>{let B=S["base-path"]!=null?(0,JWr.default)(S["base-path"],S.path):n.rootApiFile["base-path"]!=null?(0,JWr.default)(n.rootApiFile["base-path"],r["base-path"],S.path):(0,JWr.default)(r["base-path"],S.path),R=Lct({pathParameters:y4(S),location:Xt.PathParameterLocation.Endpoint,file:n,variableResolver:c}),D=(()=>{switch(g){case Hr.PathParameterOrder.UrlOrder:return _Wr(S.path,R);case Hr.PathParameterOrder.SpecOrder:return R;default:Ee(g)}})(),O=S["base-path"]!=null?D:[...t,...A,...D],z=(()=>{switch(g){case Hr.PathParameterOrder.UrlOrder:return _Wr(B,O);case Hr.PathParameterOrder.SpecOrder:return O;default:Ee(g)}})(),Y={...zT(S),id:"",name:n.casingsGenerator.generateName(v),displayName:S["display-name"],subtitle:S.subtitle,auth:typeof S.auth=="boolean"?S.auth:S.auth!=null?S.auth.length>0:r.auth??d.schemes.length>0,security:typeof S.auth>"u"||typeof S.auth=="boolean"?S.auth??(r.auth??d.schemes.length>0)===!0?bw._visit(d.requirement,{any:()=>d.schemes.map($=>({[$.key]:[]})),all:()=>[d.schemes.reduce(($,ee)=>({...$,[ee.key]:[]}),{})],endpointSecurity:()=>{},_other:()=>{}}):void 0:S.auth,docs:S.docs,idempotent:S.idempotent??r.idempotent??!1,baseUrl:S.url??r.url??e,v2BaseUrls:void 0,method:S.method!=null?FAm(S.method):Im.Post,basePath:S["base-path"]!=null?eb(S["base-path"]):void 0,path:eb(S.path),fullPath:eb(B),pathParameters:D,allPathParameters:z,queryParameters:typeof S.request!="string"&&S.request?.["query-parameters"]!=null?Object.entries(S.request["query-parameters"]).map(([$,ee])=>qWr({file:n,queryParameterKey:$,queryParameter:ee})):[],headers:typeof S.request!="string"&&S.request?.headers!=null?Object.entries(S.request.headers).map(([$,ee])=>s8({headerKey:$,header:ee,file:n})):[],requestBody:D0u({request:S.request,file:n}),v2RequestBodies:void 0,sdkRequest:z0u({service:r,request:S.request,endpoint:S,endpointKey:v,file:n,typeResolver:o,propertyResolver:s}),response:IEu({endpoint:S,file:n,typeResolver:o}),v2Responses:void 0,errors:[...zEu({errors:S.errors,file:n}),...l],userSpecifiedExamples:S.examples!=null?S.examples.map($=>{try{let ee=bEu({service:r,endpoint:S,example:$,typeResolver:o,errorResolver:i,exampleResolver:a,variableResolver:c,file:n,workspace:p});return ee===void 0?void 0:{example:ee,codeSamples:$["code-samples"]?.map(ae=>M0u({codeSample:ae,file:n}))}}catch{return}}).filter($=>$!==void 0):[],autogeneratedExamples:[],pagination:NEu({propertyResolver:s,file:n,endpointName:v,endpointSchema:S}),transport:GEu({file:n,serviceTransport:y,endpointDeclaration:S,sourceResolver:u}),v2Examples:void 0,source:void 0,audiences:S.audiences,retries:MEu({endpointSchema:S}),globalParameters:S["global-parameters"]??void 0,apiPlayground:void 0,responseHeaders:[]};return Y.id=Xu.generateEndpointId(I,Y),Y}),audiences:r.audiences}}function Lct({pathParameters:e,location:t,file:r,variableResolver:n}){return e==null?[]:Object.entries(e).map(([i,o])=>DAm({parameterName:i,parameter:o,location:t,file:r,variableResolver:n}))}function DAm({parameterName:e,parameter:t,location:r,file:n,variableResolver:i}){let o=typeof t!="string"&&"type"in t?t["client-default"]:void 0;return{...zT(t),name:n.casingsGenerator.generateName(e),valueType:kAm({parameter:t,variableResolver:i,file:n}),location:r,variable:Qfe(t)?i.getVariableIdOrThrow(typeof t=="string"?t:t.variable):void 0,clientDefault:NGt(o),v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},explode:void 0}}function kAm({parameter:e,variableResolver:t,file:r}){let n=VGt({parameter:e,variableResolver:t,file:r});return n.file.parseTypeReference(n.rawType)}function VGt({parameter:e,variableResolver:t,file:r}){let n=YWr({parameter:e,variableResolver:t,file:r});if(n==null)throw new T({message:"Cannot resolve path parameter",code:T.Code.InternalError});return n}function YWr({parameter:e,variableResolver:t,file:r}){if(Qfe(e)){let n=typeof e=="string"?e:e.variable,i=t.getDeclaration(n,r);return i==null?void 0:{rawType:typeof i.declaration=="string"?i.declaration:i.declaration.type,file:i.file}}else return{file:r,rawType:typeof e=="string"?e:e.type}}function FAm(e){switch(e){case"GET":return Im.Get;case"POST":return Im.Post;case"PUT":return Im.Put;case"PATCH":return Im.Patch;case"DELETE":return Im.Delete;case"HEAD":return Im.Head;default:Ee(e)}}function s8({headerKey:e,header:t,file:r}){let{name:n}=wre({headerKey:e,header:t}),i=typeof t!="string"?t["client-default"]:void 0,o=typeof t!="string"?t.default:void 0;return{...zT(t),name:r.casingsGenerator.generateNameAndWireValue({wireValue:e,name:n}),valueType:r.parseTypeReference(t),env:typeof t=="string"?void 0:t.env,clientDefault:NGt(i),defaultValue:o,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}}}}function wre({headerKey:e,header:t}){return typeof t!="string"&&t.name!=null?{name:t.name,wasExplicitlySet:!0}:{name:e,wasExplicitlySet:!1}}function NAm(e,t){switch(e.type){case"http":return{json:{},proto:void 0,xml:void 0};case"grpc":return{json:void 0,proto:{},xml:void 0};default:Ee(e)}}var JWr,uUe=h(()=>{"use strict";ls();Ct();ho();Wn();lc();kt();JWr=Ae(qf(),1);FGt();Q0u();A4();L0u();UMo();EEu();QMo();CEu();_Mo();jEu();Mct();QEu();LEu();WEu()});var KEu,JEu=h(()=>{"use strict";KEu="1.0.0"});function XWr(e){return e.type!=="container"?!1:e.container.type==="literal"||e.container.type==="optional"}var ZWr,$Wr,YEu=h(()=>{"use strict";r8();Ct();Wn();lc();kt();ZWr=Ae(qf(),1);JEu();$Wr=class{ir;casingsGenerator;fullCasingsGenerator;auth;authValues;generatorConfig;extendedTypeIds;constructor(t){this.ir=t.ir,this.generatorConfig=t.generatorConfig,this.casingsGenerator=Lw({generationLanguage:t.generationLanguage,smartCasing:t.smartCasing??t.ir.casingsConfig?.smartCasing??!0,smartCasingDigitWordBoundary:t.smartCasingDigitWordBoundary??t.ir.casingsConfig?.smartCasingDigitWordBoundary??!1,keywords:t.ir.casingsConfig?.keywords}),this.fullCasingsGenerator=dSe({generationLanguage:t.generationLanguage,smartCasing:t.smartCasing??t.ir.casingsConfig?.smartCasing??!0,smartCasingDigitWordBoundary:t.smartCasingDigitWordBoundary??t.ir.casingsConfig?.smartCasingDigitWordBoundary??!1,keywords:t.ir.casingsConfig?.keywords}),this.auth=this.convertAuth(this.ir.auth),this.authValues=this.getAuthValues(this.ir.auth),this.extendedTypeIds=this.computeExtendedTypeIds()}inflateName(t){return typeof t=="string"?this.fullCasingsGenerator.generateName(t):t}inflateNameAndWireValue(t){return typeof t=="string"?this.fullCasingsGenerator.generateNameAndWireValue(t):{wireValue:t.wireValue,name:this.inflateName(t.name)}}inflateFernFilepath(t){return{allParts:t.allParts.map(r=>this.inflateName(r)),packagePath:t.packagePath.map(r=>this.inflateName(r)),file:t.file!=null?this.inflateName(t.file):void 0}}computeExtendedTypeIds(){let t=new Set;for(let r of Object.values(this.ir.types))if(r.shape.type==="object")for(let n of r.shape.extends)t.add(n.typeId);return t}convert({disableExamples:t}){return{version:KEu,types:this.convertNamedTypes(),headers:this.convertHeaders(),endpoints:this.convertEndpoints({disableExamples:t}),pathParameters:this.convertPathParameters({pathParameters:this.ir.pathParameters}),environments:this.ir.environments!=null?this.convertEnvironments(this.ir.environments):void 0,variables:this.convertVariables(),globalParameters:this.ir.globalParameters,generatorConfig:this.generatorConfig}}convertNamedTypes(){return Object.fromEntries(Object.entries(this.ir.types).map(([t,r])=>[t,this.convertTypeDeclaration(r)]))}convertHeaders(){return this.convertWireValueParameters({wireValueParameters:this.ir.headers})}convertVariables(){if(this.ir.variables.length!==0)return this.ir.variables.map(t=>({id:t.id,name:this.inflateName(t.name),typeReference:this.convertTypeReference(t.type)}))}convertEndpoints({disableExamples:t}){let r=this.getAllHttpEndpoints();return Object.fromEntries(r.map(n=>[n.id,this.convertEndpoint({endpoint:n,disableExamples:t})]))}convertEndpoint({endpoint:t,disableExamples:r}){let n=this.convertEndpointLocation({endpoint:t});return{auth:this.auth,declaration:this.convertDeclaration({name:t.name,fernFilepath:t.fernFilepath}),location:n,request:this.convertRequest({endpoint:t}),response:t.response?.body?._visit({json:()=>sr.Response.json(),streaming:()=>sr.Response.streaming(),streamParameter:()=>sr.Response.streamParameter(),fileDownload:()=>sr.Response.fileDownload(),text:()=>sr.Response.text(),bytes:()=>sr.Response.bytes(),_other:()=>sr.Response.json()})??sr.Response.json(),examples:r?void 0:this.getEndpointSnippetRequests({endpoint:t,location:n})}}convertRequest({endpoint:t}){let r=this.convertPathParameters({pathParameters:[...t.servicePathParameters,...t.pathParameters]});if(t.sdkRequest==null&&t.requestBody==null)return sr.Request.body({pathParameters:r,body:void 0,bodyRequired:void 0});if(t.sdkRequest==null)throw new T({message:`Internal error; endpoint "${t.id}" has a request body but no SDK request`,code:T.Code.InternalError});switch(t.sdkRequest.shape.type){case"justRequestBody":return sr.Request.body({pathParameters:r,body:this.convertReferencedRequestBodyType({body:t.sdkRequest.shape.value}),bodyRequired:t.requestBody?.type==="reference"?t.requestBody.required:void 0});case"wrapper":return this.convertInlinedRequest({fernFilepath:t.fernFilepath,wrapper:t.sdkRequest.shape,pathParameters:r,queryParameters:this.convertQueryParameters({queryParameters:t.queryParameters}),headers:this.convertWireValueParameters({wireValueParameters:[...t.serviceHeaders,...t.headers]}),body:t.requestBody});default:Ee(t.sdkRequest.shape)}}convertReferencedRequestBodyType({body:t}){switch(t.type){case"bytes":return sr.ReferencedRequestBodyType.bytes();case"typeReference":return sr.ReferencedRequestBodyType.typeReference(this.convertTypeReference(t.requestBodyType));default:Ee(t)}}convertInlinedRequest({fernFilepath:t,wrapper:r,pathParameters:n,queryParameters:i,headers:o,body:s}){return sr.Request.inlined({declaration:this.convertDeclaration({name:r.wrapperName,fernFilepath:t}),pathParameters:n,queryParameters:i,headers:o,body:s!=null?this.convertInlinedRequestBody({wrapper:r,body:s}):void 0,metadata:this.convertInlinedRequestMetadata({wrapper:r})})}convertInlinedRequestMetadata({wrapper:t}){return{includePathParameters:t.includePathParameters??!1,onlyPathParameters:t.onlyPathParameters??!1}}convertInlinedRequestBody({wrapper:t,body:r}){switch(r.type){case"inlinedRequestBody":{let n=[...r.extendedProperties??[],...r.properties];return sr.InlinedRequestBody.properties(this.convertBodyPropertiesToParameters({properties:n}))}case"reference":return sr.InlinedRequestBody.referenced({bodyKey:this.inflateName(t.bodyKey),bodyType:sr.ReferencedRequestBodyType.typeReference(this.convertTypeReference(r.requestBodyType))});case"bytes":return sr.InlinedRequestBody.referenced({bodyKey:this.inflateName(t.bodyKey),bodyType:sr.ReferencedRequestBodyType.bytes()});case"fileUpload":return this.convertFileUploadRequestBody({properties:r.properties});default:Ee(r)}}convertFileUploadRequestBody({properties:t}){return sr.InlinedRequestBody.fileUpload({properties:this.convertFileUploadRequestBodyProperties({properties:t})})}convertFileUploadRequestBodyProperties({properties:t}){return t.map(r=>{switch(r.type){case"file":return this.convertFileUploadRequestBodyFileProperty({fileProperty:r.value});case"bodyProperty":return sr.FileUploadRequestBodyProperty.bodyProperty({name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:r.propertyAccess,variable:void 0});default:Ee(r)}})}convertFileUploadRequestBodyFileProperty({fileProperty:t}){let r=t.key,n=typeof r=="string"?{wireValue:r,name:this.fullCasingsGenerator.generateName(r)}:{wireValue:r.wireValue,name:this.fullCasingsGenerator.generateName(r.name)};switch(t.type){case"file":return sr.FileUploadRequestBodyProperty.file({...n,isOptional:t.isOptional});case"fileArray":return sr.FileUploadRequestBodyProperty.fileArray({...n,isOptional:t.isOptional});default:Ee(t)}}getAuthWrapperProperty(t,r){switch(t.requirement){case"ANY":case"ENDPOINT_SECURITY":return this.fullCasingsGenerator.generateName(r.key);case"ALL":return;default:Ee(t.requirement)}}convertPathParameters({pathParameters:t}){return t.map(r=>({name:{name:this.inflateName(r.name),wireValue:Vr(r.name)},typeReference:this.convertTypeReference(r.valueType),propertyAccess:void 0,variable:r.variable}))}convertBodyPropertiesToParameters({properties:t}){return t.map(r=>({name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:r.propertyAccess,variable:void 0}))}convertWireValueParameters({wireValueParameters:t}){return t.map(r=>({name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:void 0,variable:void 0}))}convertQueryParameters({queryParameters:t}){let r=[];for(let n of t){let i=this.convertTypeReference(n.valueType);n.allowMultiple&&(i=sr.TypeReference.list(i)),r.push({name:this.inflateNameAndWireValue(n.name),typeReference:i,propertyAccess:void 0,variable:void 0})}return r}convertTypeReference(t){switch(t.type){case"container":return this.convertContainerType(t.container);case"named":return this.convertNamedType(t);case"primitive":return this.convertPrimitiveType(t.primitive);case"unknown":return this.convertUnknownType();default:Ee(t)}}convertContainerType(t){switch(t.type){case"list":return sr.TypeReference.list(this.convertTypeReference(t.list));case"map":return sr.TypeReference.map({key:this.convertTypeReference(t.keyType),value:this.convertTypeReference(t.valueType)});case"optional":return sr.TypeReference.optional(this.convertTypeReference(t.optional));case"nullable":return sr.TypeReference.nullable(this.convertTypeReference(t.nullable));case"set":return sr.TypeReference.set(this.convertTypeReference(t.set));case"literal":return sr.TypeReference.literal(this.convertLiteral(t.literal));default:Ee(t)}}convertNamedType(t){return sr.TypeReference.named(t.typeId)}convertTypeDeclaration(t){let r=this.convertDeclaration(t.name);switch(t.shape.type){case"alias":return this.convertAlias({declaration:r,alias:t.shape});case"enum":return this.convertEnum({declaration:r,enum_:t.shape});case"object":return this.convertObject({declaration:r,object:t.shape,typeId:t.name.typeId});case"union":return this.convertDiscriminatedUnion({declaration:r,union:t.shape});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({declaration:r,union:t.shape});default:Ee(t.shape)}}convertAlias({declaration:t,alias:r}){return sr.NamedType.alias({declaration:t,typeReference:this.convertTypeReference(r.aliasOf)})}convertEnum({declaration:t,enum_:r}){return sr.NamedType.enum({declaration:t,values:r.values.map(n=>this.inflateNameAndWireValue(n.name))})}convertObject({declaration:t,object:r,typeId:n}){let o=this.extendedTypeIds.has(n)?[...r.properties,...r.extendedProperties??[]]:[...r.extendedProperties??[],...r.properties],s=r.extends.length>0?r.extends.map(a=>a.typeId):void 0;return this.convertObjectProperties({declaration:t,properties:o,extends_:s,additionalProperties:r.extraProperties,deferredUnionBaseProperties:r.deferredUnionBaseProperties})}convertObjectProperties({declaration:t,properties:r,extends_:n,additionalProperties:i,deferredUnionBaseProperties:o}){return sr.NamedType.object({declaration:t,properties:this.convertBodyPropertiesToParameters({properties:r}),extends:n,additionalProperties:i,deferredUnionBaseProperties:o?.map(s=>this.inflateNameAndWireValue(s))})}convertDiscriminatedUnion({declaration:t,union:r}){let n=[...this.resolveProperties(r.extends),...r.baseProperties];return sr.NamedType.discriminatedUnion({declaration:t,discriminant:this.inflateNameAndWireValue(r.discriminant),inheritedBaseProperties:(r.inheritedBaseProperties??[]).map(i=>this.inflateNameAndWireValue(i)),types:Object.fromEntries(r.types.map(i=>[ar(i.discriminantValue),this.convertDiscriminatedUnionType({inheritedProperties:n,discriminantValue:i.discriminantValue,singleUnionTypeProperties:i.shape})]))})}convertDiscriminatedUnionType({inheritedProperties:t,discriminantValue:r,singleUnionTypeProperties:n}){switch(n.propertiesType){case"samePropertiesAsObject":return this.convertDiscriminatedUnionTypeObject({inheritedProperties:t,discriminantValue:r,declaredTypeName:n});case"singleProperty":return this.convertDiscriminatedUnionTypeSingleProperty({inheritedProperties:t,discriminantValue:r,singleUnionTypeProperty:n});case"noProperties":return this.convertDiscriminatedUnionTypeNoProperties({inheritedProperties:t,discriminantValue:r});default:Ee(n)}}convertDiscriminatedUnionTypeObject({inheritedProperties:t,discriminantValue:r,declaredTypeName:n}){return sr.SingleDiscriminatedUnionType.samePropertiesAsObject({typeId:n.typeId,discriminantValue:this.inflateNameAndWireValue(r),properties:this.convertBodyPropertiesToParameters({properties:t})})}convertDiscriminatedUnionTypeSingleProperty({inheritedProperties:t,discriminantValue:r,singleUnionTypeProperty:n}){return sr.SingleDiscriminatedUnionType.singleProperty({typeReference:this.convertTypeReference(n.type),discriminantValue:this.inflateNameAndWireValue(r),properties:t.length>0?this.convertBodyPropertiesToParameters({properties:t}):void 0})}convertDiscriminatedUnionTypeNoProperties({inheritedProperties:t,discriminantValue:r}){return sr.SingleDiscriminatedUnionType.noProperties({discriminantValue:this.inflateNameAndWireValue(r),properties:t.length>0?this.convertBodyPropertiesToParameters({properties:t}):void 0})}convertUndiscriminatedUnion({declaration:t,union:r}){return sr.NamedType.undiscriminatedUnion({declaration:t,types:r.members.map(n=>this.convertTypeReference(n.type))})}convertLiteral(t){switch(t.type){case"boolean":return sr.LiteralType.boolean(t.boolean);case"string":return sr.LiteralType.string(t.string);default:Ee(t)}}convertPrimitiveType(t){return sr.TypeReference.primitive(t.v1)}convertUnknownType(){return sr.TypeReference.unknown()}convertAuth(t){if(t.schemes[0]==null)return;let r=t.schemes[0],n=this.getAuthWrapperProperty(t,r),i=t.requirement;switch(r.type){case"basic":{let o={wrapperProperty:n,requirement:i,username:this.inflateName(r.username),usernameOmit:r.usernameOmit,password:this.inflateName(r.password),passwordOmit:r.passwordOmit};return sr.Auth.basic(o)}case"bearer":{let o={wrapperProperty:n,requirement:i,token:this.inflateName(r.token)};return sr.Auth.bearer(o)}case"header":{let o={wrapperProperty:n,requirement:i,header:{name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:void 0,variable:void 0}};return sr.Auth.header(o)}case"oauth":{let o=this.getOAuthCustomProperties(r),s={wrapperProperty:n,requirement:i,clientId:this.fullCasingsGenerator.generateName("clientId"),clientSecret:this.fullCasingsGenerator.generateName("clientSecret"),customProperties:o.length>0?o:void 0};return sr.Auth.oauth(s)}case"inferred":{let o={wrapperProperty:n,requirement:i,parameters:this.getInferredAuthParameters(r)};return sr.Auth.inferred(o)}default:Ee(r)}}getAuthValues(t){let r=t.schemes[0];if(r!=null)switch(r.type){case"bearer":return sr.AuthValues.bearer({token:r.tokenPlaceholder??"<token>"});case"basic":return sr.AuthValues.basic({username:r.usernameOmit?"":r.usernamePlaceholder??"<username>",password:r.passwordOmit?"":r.passwordPlaceholder??"<password>"});case"header":return sr.AuthValues.header({value:r.headerPlaceholder??"<value>"});case"oauth":{let n=this.getOAuthCustomPropertyValues(r);return sr.AuthValues.oauth({clientId:"<clientId>",clientSecret:"<clientSecret>",customPropertyValues:Object.keys(n).length>0?n:void 0})}case"inferred":return sr.AuthValues.inferred({values:this.getInferredAuthValues(r)});default:Ee(r)}}getInferredAuthParameters(t){let r=[],n=Object.values(this.ir.services).flatMap(i=>i.endpoints).find(i=>i.id===t.tokenEndpoint.endpoint.endpointId);if(n==null)return r;for(let i of n.headers)(i.valueType.type!=="container"||i.valueType.container.type!=="literal")&&r.push({name:this.inflateNameAndWireValue(i.name),typeReference:this.convertTypeReference(i.valueType),propertyAccess:void 0,variable:void 0});if(n.requestBody!=null){let i=this.getInferredAuthRequestBodyProperties(t,n.requestBody);for(let o of i)(o.valueType.type!=="container"||o.valueType.container.type!=="literal")&&r.push({name:this.inflateNameAndWireValue(o.name),typeReference:this.convertTypeReference(o.valueType),propertyAccess:void 0,variable:void 0})}return r}getInferredAuthValues(t){let r={},n=Object.values(this.ir.services).flatMap(i=>i.endpoints).find(i=>i.id===t.tokenEndpoint.endpoint.endpointId);if(n==null)return r;for(let i of n.headers)if(i.valueType.type!=="container"||i.valueType.container.type!=="literal"){let o=ar(i.name);r[o]=o}if(n.requestBody!=null){let i=this.getInferredAuthRequestBodyProperties(t,n.requestBody);for(let o of i)if(o.valueType.type!=="container"||o.valueType.container.type!=="literal"){let s=ar(o.name);r[s]=s}}return r}getInferredAuthRequestBodyProperties(t,r){let n=this.getRequestBodyProperties(r),i=t.tokenEndpoint.grantType?.requestProperty;if(i==null||i.property.type!=="body"||(i.propertyPath?.length??0)>0)return n;let o=ar(i.property.name);return n.filter(s=>ar(s.name)!==o)}getRequestBodyProperties(t){let r=[];if(t.type==="inlinedRequestBody")r.push(...t.properties);else if(t.type==="reference"){let n=t.requestBodyType;if(n.type==="named"){let i=this.ir.types[n.typeId];i!=null&&i.shape.type==="object"&&r.push(...i.shape.properties)}}return r}getOAuthCustomProperties(t){let r=[];if(t.configuration.type!=="clientCredentials")return r;let n=t.configuration.tokenEndpoint.requestProperties.customProperties??[];for(let o of n)XWr(o.property.valueType)||r.push({name:this.inflateNameAndWireValue(o.property.name),typeReference:this.convertTypeReference(o.property.valueType),propertyAccess:void 0,variable:void 0});let i=t.configuration.tokenEndpoint.requestProperties.scopes;return i!=null&&!XWr(i.property.valueType)&&r.push({name:this.inflateNameAndWireValue(i.property.name),typeReference:this.convertTypeReference(i.property.valueType),propertyAccess:void 0,variable:void 0}),r}getOAuthCustomPropertyValues(t){let r={};if(t.configuration.type!=="clientCredentials")return r;let n=t.configuration.tokenEndpoint.requestProperties.customProperties??[];for(let o of n){if(XWr(o.property.valueType))continue;let s=ar(o.property.name);r[s]=`<${s}>`}let i=t.configuration.tokenEndpoint.requestProperties.scopes;if(i!=null&&!XWr(i.property.valueType)){let o=ar(i.property.name);r[o]=`<${o}>`}return r}convertEnvironments(t){return{defaultEnvironment:t.defaultEnvironment,environments:t.environments._visit({singleBaseUrl:r=>sr.Environments.singleBaseUrl({environments:r.environments.map(n=>({docs:n.docs,id:n.id,name:this.inflateName(n.name),url:n.url}))}),multipleBaseUrls:r=>sr.Environments.multipleBaseUrls({baseUrls:r.baseUrls.map(n=>({id:n.id,name:this.inflateName(n.name)})),environments:r.environments.map(n=>({docs:n.docs,id:n.id,name:this.inflateName(n.name),urls:n.urls}))}),_other:()=>{throw new T({message:"Unknown environments type",code:T.Code.InternalError})}})}}convertDeclaration({name:t,fernFilepath:r}){return{name:this.inflateName(t),fernFilepath:this.inflateFernFilepath(r)}}convertEndpointLocation({endpoint:t}){return{method:t.method,path:this.getFullPathForEndpoint(t)}}getAllHttpEndpoints(){return Object.values(this.ir.services).flatMap(t=>t.endpoints.map(r=>({...r,servicePathParameters:t.pathParameters,serviceHeaders:t.headers,fernFilepath:t.name.fernFilepath})))}resolveProperties(t){let r=[];for(let n of t){let i=this.resolveObjectTypeOrThrow(n.typeId);r.push(...this.resolveProperties(i.extends)),r.push(...i.properties)}return Object.values(r)}resolveObjectTypeOrThrow(t){let r=this.ir.types[t];if(r==null)throw new T({message:`Internal error; type "${t}" not found`,code:T.Code.InternalError});if(r.shape.type!=="object")throw new T({message:`Internal error; type "${t}" is not an object`,code:T.Code.InternalError});return r.shape}getFullPathForEndpoint(t){let r="";t.fullPath.head.length>0&&(r=(0,ZWr.default)(r,t.fullPath.head));for(let n of t.fullPath.parts)r=(0,ZWr.default)(r,"{"+n.pathParameter+"}"),n.tail.length>0&&(r=(0,ZWr.default)(r,n.tail));return r.startsWith("/")?r:`/${r}`}getGlobalHeaderExampleValues(){let t={};for(let r of this.ir.headers){if(r.valueType.type==="container"&&r.valueType.container.type==="literal"||r.valueType.type==="container"&&r.valueType.container.type==="optional")continue;let n=ar(r.name);t[n]=`<${n}>`}return t}getEndpointSnippetRequests({endpoint:t,location:r}){let n=[],i=[...t.userSpecifiedExamples.map((o,s)=>({example:o,isUserSpecified:!0,index:s})),...t.autogeneratedExamples.map((o,s)=>({example:o,isUserSpecified:!1,index:s}))];for(let{example:o,isUserSpecified:s,index:a}of i){let c=new Set;[...this.ir.pathParameters,...t.pathParameters].forEach(p=>{p.variable!=null&&c.add(Vr(p.name))});let u=[...o.example?.rootPathParameters??[],...o.example?.servicePathParameters??[],...o.example?.endpointPathParameters??[]].filter(p=>!c.has(Vr(p.name))),l=`${t.id}-${s?"user":"auto"}-${a}`;n.push({id:o?.example?.id??l,name:o?.example?.name!=null?Vr(o.example.name):void 0,isUserSpecified:s,endpoint:r,baseUrl:void 0,environment:void 0,auth:this.authValues,headers:{...this.getGlobalHeaderExampleValues(),...Object.fromEntries([...o.example?.serviceHeaders??[],...o.example?.endpointHeaders??[]].map(p=>[ar(p.name),p.value.jsonExample]))},pathParameters:Object.fromEntries(u.map(p=>[Vr(p.name),p.value.jsonExample])),queryParameters:Object.fromEntries([...o.example?.queryParameters??[]].map(p=>[ar(p.name),p.value.jsonExample])),requestBody:o.example?.request?.jsonExample})}return n}}});function lUe({ir:e,generationLanguage:t,smartCasing:r,smartCasingDigitWordBoundary:n,disableExamples:i,generatorConfig:o}){return new $Wr({ir:e,generationLanguage:t,smartCasing:r,smartCasingDigitWordBoundary:n,generatorConfig:o}).convert({disableExamples:i})}var ZMo=h(()=>{"use strict";YEu()});var UD={};te(UD,{validateObjectExample:()=>cUe,validateTypeExample:()=>VWr,validateTypeReferenceExample:()=>QT});var XEu=h(()=>{"use strict";UWr();WMo();aUe()});function ZEu(e){return{errorInstanceIdKey:e.generateNameAndWireValue({wireValue:"errorInstanceId",name:"errorInstanceId"})}}var $Eu=h(()=>{"use strict"});var e7r,$Mo=h(()=>{"use strict";lc();e7r=e=>{let t=h4(e.file.fernFilepath),r=e.endpointId;return`endpoint_${t}.${r}`}});function t7r({fernFilePath:e}){return e.packagePath.length===0&&e.file==null}var eLo=h(()=>{"use strict"});function r7r({resolvedEndpoint:e}){return{endpointId:e7r(e),serviceId:Xu.generateServiceIdFromFernFilepath(e.file.fernFilepath),subpackageId:t7r({fernFilePath:e.file.fernFilepath})?void 0:Xu.generateSubpackageId(e.file.fernFilepath)}}var tLo=h(()=>{"use strict";lc();$Mo();eLo()});function eIu({endpointResolver:e,propertyResolver:t,file:r,refreshTokenEndpoint:n}){let i=e.resolveEndpointOrThrow({endpoint:n.endpoint,file:r}),o;try{o=n.responseProperties.expires_in!=null?t.resolveResponsePropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.responseProperties.expires_in}):void 0}catch{}return{endpointReference:{endpointId:e7r(i),serviceId:Xu.generateServiceIdFromFernFilepath(i.file.fernFilepath),subpackageId:t7r({fernFilePath:i.file.fernFilepath})?void 0:Xu.generateSubpackageId(i.file.fernFilepath)},requestProperties:{refreshToken:t.resolveRequestPropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.requestProperties.refresh_token})},responseProperties:{accessToken:t.resolveResponsePropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.responseProperties.access_token}),expiresIn:o,refreshToken:n.responseProperties.refresh_token!=null?t.resolveResponsePropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.responseProperties.refresh_token}):void 0}}}var tIu=h(()=>{"use strict";lc();$Mo();eLo()});function rIu({endpointResolver:e,propertyResolver:t,typeResolver:r,file:n,tokenEndpoint:i}){let o=e.resolveEndpointOrThrow({endpoint:i.endpoint,file:n}),s=zAm({endpoint:o.endpoint,file:o.file,typeResolver:r}),a;try{a=i.responseProperties.expires_in!=null?t.resolveResponsePropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.responseProperties.expires_in}):void 0}catch{}return{endpointReference:r7r({resolvedEndpoint:o}),requestProperties:{clientId:t.resolveRequestPropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.requestProperties.client_id}),clientSecret:t.resolveRequestPropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.requestProperties.client_secret}),scopes:i.requestProperties.scopes!=null?t.resolveRequestPropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.requestProperties.scopes}):void 0,customProperties:jAm({requestBodyPropertyNames:s,tokenEndpoint:i,file:n,propertyResolver:t})},responseProperties:{accessToken:t.resolveResponsePropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.responseProperties.access_token}),expiresIn:a,refreshToken:i.responseProperties.refresh_token!=null?t.resolveResponsePropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.responseProperties.refresh_token}):void 0}}}function zAm({endpoint:e,file:t,typeResolver:r}){let n=e.request;if(n==null)return[];if(typeof n=="string")return n7r({typeName:n,file:t,typeResolver:r});let i=n.body;if(i==null)return[];if(typeof i=="string")return n7r({typeName:i,file:t,typeResolver:r});if(nA(i)){let o=Object.keys(i.properties??{});if(i.extends!=null){let s=typeof i.extends=="string"?[i.extends]:i.extends;for(let a of s)o.push(...n7r({typeName:a,file:t,typeResolver:r}))}return o}return n7r({typeName:i.type,file:t,typeResolver:r})}function n7r({typeName:e,file:t,typeResolver:r}){let n=r.resolveType({type:e,file:t});if(n==null||n._type!=="named")return[];let i=n.declaration,o=[];return"properties"in i&&i.properties!=null&&o.push(...Object.keys(i.properties)),"base-properties"in i&&i["base-properties"]!=null&&o.push(...Object.keys(i["base-properties"])),o}var jAm,nIu=h(()=>{"use strict";ho();tLo();jAm=({requestBodyPropertyNames:e,tokenEndpoint:t,file:r,propertyResolver:n})=>{let i=e.filter(o=>!t.requestProperties.client_id.includes(o)&&!t.requestProperties.client_secret.includes(o)&&(t.requestProperties.scopes==null||!t.requestProperties.scopes.includes(o)));return i.length>0?i.map(o=>n.resolveRequestPropertyOrThrow({file:r,endpoint:t.endpoint,propertyComponents:[o]})):void 0}});function iIu({propertyResolver:e,endpointResolver:t,typeResolver:r,file:n,oauthScheme:i,tokenEndpoint:o,refreshTokenEndpoint:s}){let a=rIu({propertyResolver:e,endpointResolver:t,typeResolver:r,file:n,tokenEndpoint:o});if(a==null)throw new T({message:"Failed to convert OAuth token endpoint.",code:T.Code.IrConversionError});let c=s!=null?eIu({propertyResolver:e,endpointResolver:t,file:n,refreshTokenEndpoint:s}):void 0;return{clientIdEnvVar:i["client-id-env"],clientSecretEnvVar:i["client-secret-env"],tokenPrefix:i["token-prefix"],tokenHeader:i["token-header"],scopes:i.scopes,tokenEndpoint:a,refreshEndpoint:c}}var oIu=h(()=>{"use strict";kt();tIu();nIu()});function sIu(e){let t=e["get-token"];if(t==null)throw new Error("OAuth client-credentials flow is missing the required `get-token` endpoint");return{endpoint:t.endpoint,requestProperties:QAm({requestProperties:t["request-properties"]}),responseProperties:MAm({responseProperties:t["response-properties"]})}}function aIu(e){if(e["refresh-token"]!=null)return{endpoint:e["refresh-token"].endpoint,requestProperties:LAm({requestProperties:e["refresh-token"]?.["request-properties"]}),responseProperties:_Am({responseProperties:e["refresh-token"]?.["response-properties"]})}}function QAm({requestProperties:e}){if(e==null)return GGt.requestProperties;let t=e["client-id"],r=e["client-secret"],n=e.scopes;return{type:"access_token",client_id:t!=null?KK(t):GGt.requestProperties.client_id,client_secret:r!=null?KK(r):GGt.requestProperties.client_secret,scopes:n!=null?KK(n):GGt.requestProperties.scopes}}function MAm({responseProperties:e}){return cIu({responseProperties:e,defaultValue:GGt.responseProperties})}function LAm({requestProperties:e}){if(e==null)return rLo.requestProperties;let t=e["refresh-token"];return{type:"refresh_token",refresh_token:t!=null?KK(t):rLo.requestProperties.refresh_token}}function _Am({responseProperties:e}){return cIu({responseProperties:e,defaultValue:rLo.responseProperties})}function cIu({responseProperties:e,defaultValue:t}){if(e==null)return t;let r=e["access-token"],n=e["expires-in"],i=e["refresh-token"];return{type:"access_token",access_token:r!=null?UB(r):t.access_token,expires_in:n!=null?UB(n):t.expires_in,refresh_token:i!=null?UB(i):t.refresh_token}}var GGt,rLo,uIu=h(()=>{"use strict";Bct();GGt={requestProperties:{type:"access_token",client_id:["client_id"],client_secret:["client_secret"],scopes:void 0},responseProperties:{type:"access_token",access_token:["access_token"],expires_in:["expires_in"],refresh_token:void 0}},rLo={requestProperties:{type:"refresh_token",refresh_token:["refresh_token"]},responseProperties:{type:"access_token",access_token:["access_token"],refresh_token:void 0,expires_in:["expires_in"]}}});function mIu({rawApiFileSchema:e,file:t,propertyResolver:r,endpointResolver:n,typeResolver:i}){if(e.auth==null)return{docs:void 0,requirement:bw.All,schemes:[]};let o=typeof e.auth!="string"?e.auth.docs:void 0;return jfe(e.auth,{single:s=>{let a=nLo({reference:s,authSchemeDeclarations:e["auth-schemes"],file:t,propertyResolver:r,endpointResolver:n,typeResolver:i});return{docs:o,requirement:bw.All,schemes:[a]}},any:({any:s})=>({docs:o,requirement:bw.Any,schemes:s.map(a=>nLo({reference:a,authSchemeDeclarations:e["auth-schemes"],file:t,propertyResolver:r,endpointResolver:n,typeResolver:i}))}),endpointSecurity:()=>({docs:o,requirement:bw.EndpointSecurity,schemes:Object.keys(e["auth-schemes"]??{}).map(s=>nLo({reference:s,authSchemeDeclarations:e["auth-schemes"],file:t,propertyResolver:r,endpointResolver:n,typeResolver:i}))})})}function nLo({reference:e,authSchemeDeclarations:t,file:r,propertyResolver:n,endpointResolver:i,typeResolver:o}){let s=(c,u)=>{let l=t?.[c];if(l==null)throw new T({message:"Unknown auth scheme: "+c,code:T.Code.ReferenceError});let p=u??(typeof l=="object"?l.docs:void 0),d=typeof l=="object"?l["playground-docs"]:void 0;return zfe(l,{header:f=>Mp.header({key:c,docs:p,playgroundDocs:d,name:r.casingsGenerator.generateNameAndWireValue({name:f.name??c,wireValue:f.header}),valueType:r.parseTypeReference(f.type??"string"),prefix:f.prefix,headerEnvVar:f.env,headerPlaceholder:f.placeholder}),basic:f=>pIu({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f}),tokenBearer:f=>lIu({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f}),inferredBearer:f=>GAm({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f,propertyResolver:n,endpointResolver:i}),oauth:f=>fIu({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f,propertyResolver:n,endpointResolver:i,typeResolver:o})})},a=typeof e=="string"?e:e.scheme;if(t?.[a]!=null)return s(a,typeof e!="string"?e.docs:void 0);switch(a){case"bearer":return lIu({key:a,file:r,docs:void 0,playgroundDocs:void 0,rawScheme:void 0});case"basic":return pIu({key:a,file:r,docs:void 0,playgroundDocs:void 0,rawScheme:void 0});case"oauth":return fIu({key:a,file:r,docs:void 0,playgroundDocs:void 0,rawScheme:void 0,propertyResolver:n,endpointResolver:i,typeResolver:o});default:return s(a,typeof e!="string"?e.docs:void 0)}}function lIu({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i}){return Mp.bearer({key:e,docs:r,playgroundDocs:n,token:t.casingsGenerator.generateName(i?.token?.name??"token"),tokenEnvVar:i?.token?.env,tokenPlaceholder:i?.token?.placeholder})}function pIu({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i}){return Mp.basic({key:e,docs:r,playgroundDocs:n,username:t.casingsGenerator.generateName(i?.username?.name??"username"),usernameEnvVar:i?.username?.env,usernameOmit:i?.username?.omit,usernamePlaceholder:i?.username?.placeholder,password:t.casingsGenerator.generateName(i?.password?.name??"password"),passwordEnvVar:i?.password?.env,passwordOmit:i?.password?.omit,passwordPlaceholder:i?.password?.placeholder})}function fIu({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i,propertyResolver:o,endpointResolver:s,typeResolver:a}){switch(i?.type){case"client-credentials":return Mp.oauth({key:e,docs:r,playgroundDocs:n,configuration:sD.clientCredentials(iIu({propertyResolver:o,endpointResolver:s,typeResolver:a,file:t,oauthScheme:i,tokenEndpoint:sIu(i),refreshTokenEndpoint:aIu(i)}))});case"authorization-code":return Mp.oauth({key:e,docs:r,playgroundDocs:n,configuration:sD.authorizationCode({clientId:dIu(i),authorizationUrl:i7r(i,"authorization-url"),tokenUrl:i7r(i,"token-url"),refreshUrl:i["refresh-url"],redirectUri:UAm(i["redirect-uri"]),redirectUriBackupPorts:VAm(i["redirect-uri"]),successRedirectUrl:i["success-redirect-url"],errorRedirectUrl:i["error-redirect-url"],scopes:i.scopes,pkce:{method:tLt.S256},authorizationParameters:i["authorization-parameters"],tokenParameters:i["token-parameters"],refreshParameters:i["refresh-parameters"],tokenHeader:i["token-header"],tokenPrefix:i["token-prefix"]})});case"device-code":return Mp.oauth({key:e,docs:r,playgroundDocs:n,configuration:sD.deviceCode({clientId:dIu(i),deviceAuthorizationUrl:i7r(i,"device-authorization-url"),tokenUrl:i7r(i,"token-url"),refreshUrl:i["refresh-url"],scopes:i.scopes,deviceAuthorizationParameters:i["device-authorization-parameters"],tokenParameters:i["token-parameters"],refreshParameters:i["refresh-parameters"],tokenHeader:i["token-header"],tokenPrefix:i["token-prefix"]})});default:throw new T({message:`Unknown OAuth type: '${i?.type}'`,code:T.Code.ValidationError})}}function dIu(e){let t=e["client-id-env"];return e["client-id"]==null&&t!=null?RH.environmentVariable(t):RH.literal(e["client-id"]??"")}function UAm(e){if(e!=null)return typeof e=="string"?e:e.url}function VAm(e){if(!(e==null||typeof e=="string"))return e.ports}function i7r(e,t){let r=e[t];if(typeof r!="string")throw new T({message:`OAuth ${e.type} flow is missing required field '${t}'`,code:T.Code.ValidationError});return r}function GAm({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i,propertyResolver:o,endpointResolver:s}){return Mp.inferred({key:e,docs:r,playgroundDocs:n,tokenEndpoint:qAm({file:t,rawScheme:i,propertyResolver:o,endpointResolver:s})})}function qAm({file:e,rawScheme:t,propertyResolver:r,endpointResolver:n}){let i=t["get-token"],o=typeof i=="string"?{endpoint:i}:i,s=n.resolveEndpointOrThrow({endpoint:o.endpoint,file:e});return{endpoint:r7r({resolvedEndpoint:s}),expiryProperty:XAm({tokenEndpoint:s,getTokenEndpointConfig:o,propertyResolver:r}),authenticatedRequestHeaders:KAm({tokenEndpoint:s,getTokenEndpointConfig:o,propertyResolver:r}),grantType:t.type==="refresh-token"?WAm({tokenEndpoint:s,endpoint:o.endpoint,propertyResolver:r}):void 0}}function WAm({tokenEndpoint:e,endpoint:t,propertyResolver:r}){let n;try{n=r.resolveRequestProperty({file:e.file,endpoint:e.endpointId,propertyComponents:[iLo]})}catch{n=void 0}if(n==null)throw new T({message:`Inferred auth with type 'refresh-token' requires the get-token endpoint '${t}' to have a '${iLo}' request property`,code:T.Code.ValidationError});let i=n.property.valueType;if(i.type==="container"&&i.container.type==="literal"&&(i.container.literal.type!=="string"||i.container.literal.string!==oLo))throw new T({message:`Inferred auth with type 'refresh-token' requires '${iLo}' on the get-token endpoint '${t}' to accept '${oLo}'`,code:T.Code.ValidationError});return{requestProperty:n,value:oLo}}function KAm({tokenEndpoint:e,getTokenEndpointConfig:t,propertyResolver:r}){let n=new Map,i=t["authenticated-request-headers"]??[];if(i.length>0&&i.forEach(o=>{n.set(o["header-name"].toLowerCase(),{headerName:o["header-name"],responseProperty:r.resolveResponsePropertyOrThrow({file:e.file,endpoint:e.endpointId,propertyComponents:UB(o["response-property"])}),valuePrefix:o["value-prefix"]})}),!n.has("authorization")){let o=JAm({tokenEndpoint:e,propertyResolver:r});o&&n.set("authorization",{headerName:"Authorization",responseProperty:o,valuePrefix:"Bearer "})}return Array.from(n.values())}function JAm({tokenEndpoint:e,propertyResolver:t}){for(let r of HAm)try{let n=t.resolveResponseProperty({file:e.file,endpoint:e.endpointId,propertyComponents:[r]});if(n)return n}catch{}}function XAm({tokenEndpoint:e,getTokenEndpointConfig:t,propertyResolver:r}){if(t["expiry-response-property"])return r.resolveResponsePropertyOrThrow({file:e.file,endpoint:e.endpointId,propertyComponents:UB(t["expiry-response-property"])});for(let n of YAm)try{let i=r.resolveResponseProperty({file:e.file,endpoint:e.endpointId,propertyComponents:[n]});if(i)return i}catch{}}var iLo,oLo,HAm,YAm,hIu=h(()=>{"use strict";ho();Wn();kt();tLo();oIu();uIu();Bct();iLo="grant_type",oLo="refresh_token";HAm=["access_token","accessToken","AccessToken","token","Token","auth_token","authToken","AuthToken","bearer_token","bearerToken","BearerToken","jwt","Jwt","authentication_token","authenticationToken","AuthenticationToken"];YAm=["expires_in","expiresIn","ExpiresIn","exp","Exp","expiry","Expiry","expires","Expires","expires_at","expiresAt","ExpiresAt","expiration","Expiration","valid_until","validUntil","ValidUntil"]});function gIu({file:e,rawApiFileSchema:t}){if(t.version!=null)return CIe.header({header:ZAm({file:e,header:t.version.header}),value:$Am({file:e,versionDeclaration:t.version})})}function ZAm({file:e,header:t}){return typeof t=="string"?s8({file:e,headerKey:t,header:{type:"string"}}):s8({file:e,headerKey:t.value,header:{type:"string",name:t.name,env:t.env}})}function $Am({file:e,versionDeclaration:t}){return GWr({_enum:{default:t.default,enum:t.values},file:e})}var AIu=h(()=>{"use strict";Wn();uUe();_Gt()});function yIu({channel:e,typeResolver:t,exampleResolver:r,variableResolver:n,file:i,workspace:o}){let s=[];for(let[a,c]of Object.entries(e.messages??{}))s.push({type:a,availability:iM(c.availability),docs:c.docs,origin:c.origin,body:rym({body:c.body,file:i}),displayName:c["display-name"],methodName:c["method-name"]});return{availability:iM(e.availability),path:eb(e.path),baseUrl:e.url,auth:e.auth,name:i.fernFilepath.file??i.casingsGenerator.generateName(e["display-name"]??e.path),displayName:e["display-name"],connectMethodName:e["connect-method-name"],headers:e.headers!=null?Object.entries(e.headers).map(([a,c])=>s8({headerKey:a,header:c,file:i})):[],docs:e.docs,pathParameters:e["path-parameters"]!=null?Lct({pathParameters:e["path-parameters"],location:Xt.PathParameterLocation.Endpoint,file:i,variableResolver:n}):[],queryParameters:e["query-parameters"]!=null?Object.entries(e["query-parameters"]).map(([a,c])=>{let{name:u}=Mme({queryParameterKey:a,queryParameter:c}),l=i.parseTypeReference(c);return{...zT(c),name:i.casingsGenerator.generateNameAndWireValue({wireValue:a,name:u}),valueType:l,allowMultiple:typeof c!="string"&&c["allow-multiple"]!=null?c["allow-multiple"]:!1,clientDefault:void 0,defaultValue:typeof c!="string"?c.default:void 0,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},explode:void 0}}):[],messages:Object.values(s),examples:(e.examples??[]).map(a=>{let c=iym({channel:e,example:a,typeResolver:t,exampleResolver:r,variableResolver:n,file:i,workspace:o});return{name:a.name!=null?i.casingsGenerator.generateName(a.name):void 0,docs:a.docs,url:sym({channel:e,example:a,pathParams:c}),...c,...oym({channel:e,example:a,typeResolver:t,exampleResolver:r,file:i,workspace:o}),queryParameters:a["query-parameters"]!=null?Object.entries(a["query-parameters"]).map(([u,l])=>{let p=e["query-parameters"]?.[u];if(p==null)throw new T({message:`Query parameter ${u} does not exist`,code:T.Code.ReferenceError});return{name:i.casingsGenerator.generateNameAndWireValue({name:Mme({queryParameterKey:u,queryParameter:p}).name,wireValue:u}),value:Wf({example:l,rawTypeBeingExemplified:typeof p=="string"?p:p.type,typeResolver:t,exampleResolver:r,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}),shape:eym({queryParameter:p})}}):[],messages:a.messages.map(u=>{let l=e.messages?.[u.type];if(l==null)throw new T({message:`Message ${u.type} does not exist`,code:T.Code.ReferenceError});return{type:u.type,body:tym({message:l,example:u.body,typeResolver:t,exampleResolver:r,file:i,workspace:o})}})}}),v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},apiPlayground:void 0}}function eym({queryParameter:e}){return(typeof e!="string"&&e["allow-multiple"]!=null?e["allow-multiple"]:!1)?Ew.exploded():Ew.single()}function tym({message:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o}){if(!aym(e.body))return z3.reference(Wf({example:t,rawTypeBeingExemplified:typeof e.body!="string"?e.body.type:e.body,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}));if(!ki(t))throw new T({message:"Example must be an object",code:T.Code.ValidationError});let s=[];for(let[a,c]of Object.entries(t)){let u=e.body.properties?.[a];if(u!=null)s.push({name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:a,property:u}).name,wireValue:a}),value:Wf({example:c,rawTypeBeingExemplified:typeof u!="string"?u.type:u,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}),originalTypeDeclaration:void 0});else{let l=UGt({extends_:e.body.extends,wirePropertyKey:a,typeResolver:r,file:i});if(l==null)throw new T({message:"Could not find original type declaration for property: "+a,code:T.Code.ResolutionError});s.push({name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:a,property:l.rawPropertyType}).name,wireValue:a}),value:Wf({example:c,rawTypeBeingExemplified:typeof l.rawPropertyType=="string"?l.rawPropertyType:l.rawPropertyType.type,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:l.file,fileContainingExample:i,workspace:o}),originalTypeDeclaration:l.typeName})}}return z3.inlinedBody({jsonExample:n.resolveAllReferencesInExampleOrThrow({example:t,file:i}).resolvedExample,properties:s,extraProperties:void 0})}function rym({body:e,file:t}){return typeof e=="string"||nym(e)?sB.reference({docs:void 0,bodyType:t.parseTypeReference(e)}):sB.inlinedBody({name:t.casingsGenerator.generateName(e.name),extends:HK(e.extends??[]).map(r=>jT({typeName:r,file:t})),properties:Object.entries(e.properties??{}).map(([r,n])=>({name:t.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:r,property:n}).name,wireValue:r}),value:t.parseTypeReference(n),valueType:t.parseTypeReference(n),availability:void 0,docs:void 0}))})}function nym(e){return e.type!=null}function iym({channel:e,example:t,typeResolver:r,exampleResolver:n,variableResolver:i,file:o,workspace:s}){let a=[],c=({name:u,pathParameterDeclaration:l,examplePathParameter:p})=>{let d=VGt({parameter:l,variableResolver:i,file:o});return{name:u,value:Wf({example:p,rawTypeBeingExemplified:d.rawType,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:d.file,fileContainingExample:o,workspace:s})}};if(t["path-parameters"]!=null){let u=y4(e);for(let[l,p]of Object.entries(t["path-parameters"])){let d=u[l];if(d!=null)a.push(c({name:o.casingsGenerator.generateName(l),pathParameterDeclaration:d,examplePathParameter:p}));else throw new T({message:`Path parameter ${l} does not exist`,code:T.Code.ReferenceError})}}return{pathParameters:a}}function oym({channel:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o}){let s=[];if(t.headers!=null)for(let[a,c]of Object.entries(t.headers)){let u=e.headers?.[a];u!=null&&s.push({name:i.casingsGenerator.generateNameAndWireValue({name:wre({headerKey:a,header:u}).name,wireValue:a}),value:Wf({example:c,rawTypeBeingExemplified:typeof u=="string"?u:u.type,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o})})}return{headers:s}}function sym({channel:e,example:t,pathParams:r}){let n=e.path;if(t["path-parameters"]!=null)for(let i of[...r.pathParameters])n=n.replaceAll(`{${Vr(i.name)}}`,encodeURIComponent(`${i.value.jsonExample}`));return n}function aym(e){return typeof e=="string"?!1:e.extends!=null||e.properties!=null}var bIu=h(()=>{"use strict";Ct();Wn();lc();kt();gp();FGt();Sre();A4();uUe();Mct();Qct();i8()});function EIu({errorName:e,errorDeclaration:t,file:r,typeResolver:n,exampleResolver:i,workspace:o}){let s=[];if(t.type!=null&&t.examples!=null)for(let c of t.examples)s.push({name:c.name!=null?r.casingsGenerator.generateName(c.name):void 0,docs:c.docs,jsonExample:i.resolveAllReferencesInExampleOrThrow({example:c.value,file:r}).resolvedExample,shape:Wf({example:c.value,rawTypeBeingExemplified:t.type,fileContainingRawTypeReference:r,fileContainingExample:r,typeResolver:n,exampleResolver:i,workspace:o})});let a=FLe(t["status-code"]);if(a==null)throw new Error(`Error ${e} has an invalid status-code "${t["status-code"]}". Expected an integer, "4XX", or "5XX".`);return{name:ESe({errorName:e,file:r}),discriminantValue:r.casingsGenerator.generateNameAndWireValue({wireValue:e,name:e}),docs:typeof t!="string"?t.docs:void 0,statusCode:a.statusCode,isWildcardStatusCode:a.isWildcard?!0:void 0,type:t.type!=null?r.parseTypeReference(t.type):void 0,examples:s,v2Examples:void 0,displayName:void 0,headers:[]}}var IIu=h(()=>{"use strict";ho();jGt();Qct()});function CIu(e,t){if(e==null||e.strategy==="status-code")return j3.statusCode();if(e.strategy==="property")return j3.property({discriminant:t.casingsGenerator.generateNameAndWireValue({name:e["property-name"],wireValue:e["property-name"]}),contentProperty:t.casingsGenerator.generateNameAndWireValue({name:vIu,wireValue:vIu})});Ee(e)}var vIu,xIu=h(()=>{"use strict";Ct();Wn();vIu="content"});function cym(e){switch(e){case"header":return Xt.GlobalParameterLocation.Header;case"query":return Xt.GlobalParameterLocation.Query;case"path":return Xt.GlobalParameterLocation.Path;default:return Xt.GlobalParameterLocation.Body}}function uym(e){switch(e){case"explicit":return Xt.GlobalParameterApplyMode.Explicit;case"auto":return Xt.GlobalParameterApplyMode.Auto;case void 0:return;default:return}}function lym(e,t){let r=pym(e);return t===!0?Xt.TypeReference.container(Xt.ContainerType.optional(r)):r}function pym(e){switch(e){case"boolean":return Xt.TypeReference.primitive({v1:"BOOLEAN",v2:Xt.PrimitiveTypeV2.boolean({default:void 0})});case"integer":return Xt.TypeReference.primitive({v1:"INTEGER",v2:Xt.PrimitiveTypeV2.integer({default:void 0,validation:void 0})});case"double":case"number":return Xt.TypeReference.primitive({v1:"DOUBLE",v2:Xt.PrimitiveTypeV2.double({default:void 0,validation:void 0})});default:return Xt.TypeReference.primitive({v1:"STRING",v2:Xt.PrimitiveTypeV2.string({default:void 0,validation:void 0})})}}function fym(e,t){if(e!=null){if(typeof e=="boolean")return t!=null&&t!=="boolean"?void 0:Xt.Literal.boolean(e);if(typeof e=="string")return t==="boolean"||t==="integer"||t==="double"||t==="number"?void 0:Xt.Literal.string(e);if(typeof e=="number")return t==="boolean"||t==="string"||t==="integer"&&!Number.isInteger(e)?void 0:Xt.Literal.string(String(e))}}function SIu({globalParameters:e,file:t}){return Object.entries(e).map(([r,n])=>{let i=n["parameter-name"]??r;return{id:r,name:t.casingsGenerator.generateNameAndWireValue({name:i,wireValue:r}),location:cym(n.in),target:n.target??r,valueType:lym(n.type,n.optional),env:n.env,clientDefault:fym(n.default,n.type),optional:n.optional,apply:uym(n.apply),docs:n.docs}})}var wIu=h(()=>{"use strict";Wn()});function TIu({readme:e,services:t}){let r=new sLo(t);return{apiName:e.apiName,disabledFeatures:e.disabledSections?.map(n=>n.toUpperCase()),apiReferenceLink:e.apiReferenceLink,bannerLink:e.bannerLink,introduction:e.introduction,customSections:e.customSections,exampleStyle:e.exampleStyle,whiteLabel:!1,defaultEndpoint:e.defaultEndpoint!=null?r.getEndpointForReadmeOrThrow(e.defaultEndpoint).id:void 0,features:e.features!=null?Object.fromEntries(Object.entries(e.features).map(([n,i])=>[n,i.map(o=>r.getEndpointForReadmeOrThrow(o).id)])):void 0}}function dym(e){let t="";e.fullPath.head.length>0&&(t=(0,o7r.default)(t,e.fullPath.head));for(let r of e.fullPath.parts)t=(0,o7r.default)(t,"{"+r.pathParameter+"}"),r.tail.length>0&&(t=(0,o7r.default)(t,r.tail));return t.startsWith("/")?t:`/${t}`}function mym({endpoint:e}){if(typeof e=="string"){let t=e.split(" ");if(t.length!==2||t[0]==null||t[1]==null)throw new T({message:`invalid endpoint string: ${e}`,code:T.Code.ParseError});return{method:t[0],path:t[1]}}return e}function hym(e){return typeof e=="string"?e:JSON.stringify(e)}var o7r,sLo,OIu=h(()=>{"use strict";kt();o7r=Ae(qf(),1);sLo=class{endpoints={};constructor(t){this.endpoints=this.buildEndpoints(t)}getEndpointForReadme(t){let r=mym({endpoint:t}),n=this.getEndpointKeyForReadmeEndpoint(r);return this.endpoints[n]}getEndpointForReadmeOrThrow(t){let r=this.getEndpointForReadme(t);if(r==null)throw new T({message:`Endpoint not found in generators.yml readme config for ${hym(t)}`,code:T.Code.ConfigError});return r}buildEndpoints(t){let r={};for(let n of Object.values(t))for(let i of n.endpoints)r[this.getEndpointKeyForHttpEndpoint(i)]=i;return r}getEndpointKeyForReadmeEndpoint(t){return this.getEndpointKey({method:t.method,path:t.path,stream:t.stream??!1})}getEndpointKeyForHttpEndpoint(t){return this.getEndpointKey({method:t.method,path:dym(t),stream:t.response?.body?.type==="streaming"})}getEndpointKey({method:t,path:r,stream:n}){return`${t}|${r}|${n}`}}});function PIu({webhooks:e,file:t,typeResolver:r,exampleResolver:n,workspace:i,defaultSignature:o}){let s=[];for(let[a,c]of Object.entries(e))s.push({id:Xu.generateWebhookId(t.fernFilepath,a),availability:iM(c.availability),displayName:c["display-name"],docs:c.docs,method:c.method,name:t.casingsGenerator.generateName(a),headers:c.headers!=null?Object.entries(c.headers).map(([u,l])=>s8({headerKey:u,header:l,file:t})):[],payload:gym({payload:c.payload,file:t}),signatureVerification:aLo({signature:c.signature??o,file:t}),fileUploadPayload:void 0,responses:bym({webhook:c,file:t,typeResolver:r}),examples:c.examples!=null?yym({webhook:c,examples:c.examples,file:t,typeResolver:r,exampleResolver:n,workspace:i}):void 0,v2Examples:void 0});return s}function gym({payload:e,file:t}){return typeof e=="string"?Z1.reference({docs:void 0,payloadType:t.parseTypeReference(e)}):wct(e)?Z1.reference({docs:void 0,payloadType:t.parseTypeReference(e.type)}):Z1.inlinedPayload({name:t.casingsGenerator.generateName(e.name),extends:HK(e.extends).map(r=>jT({typeName:r,file:t})),properties:e.properties!=null?Object.entries(e.properties).map(([r,n])=>Aym({propertyKey:r,propertyDefinition:n,docs:typeof n!="string"?n.docs:void 0,availability:typeof n!="string"?iM(n.availability):void 0,file:t})):[]})}function Aym({propertyKey:e,propertyDefinition:t,docs:r,availability:n,file:i}){return{docs:r,availability:n,name:i.casingsGenerator.generateNameAndWireValue({wireValue:e,name:pS({propertyKey:e,property:t}).name}),valueType:i.parseTypeReference(t)}}function yym({webhook:e,examples:t,file:r,typeResolver:n,exampleResolver:i,workspace:o}){let s=typeof e.payload=="string"?e.payload:wct(e.payload)?e.payload.type:void 0;if(s!=null)return t.map(a=>({docs:e.docs,name:a.name!=null?r.casingsGenerator.generateName(a.name):void 0,payload:Wf({example:a.payload,rawTypeBeingExemplified:s,fileContainingRawTypeReference:r,fileContainingExample:r,typeResolver:n,exampleResolver:i,workspace:o})}));if(!ki(e.payload))throw new T({message:`Example webhook payload is not an object. Got: ${JSON.stringify(e.payload)}`,code:T.Code.ValidationError});return t.map(a=>({docs:e.docs,name:a.name!=null?r.casingsGenerator.generateName(a.name):void 0,payload:Wf({example:a.payload,rawTypeBeingExemplified:"map<string, unknown>",fileContainingRawTypeReference:r,fileContainingExample:r,typeResolver:n,exampleResolver:i,workspace:o})}))}function bym({webhook:e,file:t,typeResolver:r}){let n=[];if(e.response!=null){let i=Eym({response:e.response,file:t,typeResolver:r}),o=typeof e.response!="string"?e.response["status-code"]:void 0,s=typeof e.response!="string"?e.response.docs:void 0;n.push({body:i,statusCode:o,isWildcardStatusCode:void 0,docs:s})}if(e["response-stream"]!=null){let i=Iym({responseStream:e["response-stream"],file:t,typeResolver:r});if(i!=null){let o=typeof e["response-stream"]!="string"?e["response-stream"].docs:void 0;n.push({body:ju.streaming(i),statusCode:void 0,isWildcardStatusCode:void 0,docs:o})}}return n.length>0?n:void 0}function Eym({response:e,file:t,typeResolver:r}){let n=typeof e!="string"?e.docs:void 0,i=typeof e=="string"?e:e.type;if(i!=null){if(dQ(i)!=null)return ju.fileDownload({docs:n,v2Examples:void 0});if(jLe(i)!=null){let o=typeof e!="string"?e["content-type"]:void 0;return ju.text({docs:n,v2Examples:void 0,contentType:o??void 0})}else return HV(i)!=null?ju.bytes({docs:n,v2Examples:void 0}):vym(e,n,t,r)}}function Iym({responseStream:e,file:t,typeResolver:r}){let n=typeof e!="string"?e.docs:void 0,i=typeof e=="string"?e:e.type,o=typeof e=="string"?"json":e.format??"json";return EIe(i)?dv.text({docs:n,v2Examples:void 0}):typeof e!="string"&&o==="sse"?dv.sse({docs:n,payload:t.parseTypeReference(i),terminator:typeof e!="string"?e.terminator:void 0,resumable:typeof e!="string"?e.resumable:void 0,v2Examples:void 0}):dv.json({docs:n,payload:t.parseTypeReference(i),terminator:typeof e!="string"?e.terminator:void 0,v2Examples:void 0})}function vym(e,t,r,n){let i=typeof e!="string"?e.type:e;if(i==null)return;let o=r.parseTypeReference(typeof e=="string"?e:{...e,type:i}),s=n.resolveTypeOrThrow({type:i,file:r}),a=typeof e!="string"?e.property:void 0;return a!=null?ju.json(uI.nestedPropertyAsResponse({docs:t,responseBodyType:o,responseProperty:sUe({typeResolver:n,file:r,resolvedType:s,property:a}),v2Examples:void 0})):ju.json(uI.response({docs:t,responseBodyType:o,v2Examples:void 0}))}function aLo({signature:e,file:t}){if(e!=null)switch(e.type){case"hmac":return zH.hmac(Cym({hmac:e,file:t}));case"asymmetric":return zH.asymmetric(Pym({asymmetric:e,file:t}));default:return}}function Cym({hmac:e,file:t}){return{signatureHeaderName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),algorithm:BIu(e.algorithm),encoding:cLo(e.encoding),signaturePrefix:e["signature-prefix"],payloadFormat:RIu(e["payload-format"]),timestamp:DIu({timestamp:e.timestamp,file:t}),bodyHashBinding:wym(e["body-hash-binding"]),notificationUrlNormalization:Sym(e["url-normalization"]),algorithmHeader:xym({algorithmHeader:e["algorithm-header"],file:t})}}function xym({algorithmHeader:e,file:t}){if(e==null)return;let r=Object.entries(e.algorithms);if(r.length===0)throw new T({message:`webhook-signature algorithm-header "${e.header}" must list at least one entry under "algorithms" (e.g. HMAC_SHA256: sha256).`,code:T.Code.ValidationError});return{headerName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),keyIdDelimiter:e["key-id-delimiter"],keyIdParameter:e["key-id-parameter"],algorithmParameter:e["algorithm-parameter"],algorithms:r.map(([n,i])=>({wireValue:n,algorithm:BIu(i)}))}}function Sym(e){if(e!=null)return{portVariants:e["port-variants"]??!1,legacyQueryEncoding:e["legacy-query-encoding"]??!1}}function wym(e){if(e!=null)return{algorithm:Tym(e.algorithm),encoding:cLo(e.encoding),location:Oym(e.location)}}function Tym(e){switch(e){case"sha1":return jH.Sha1;case"sha384":return jH.Sha384;case"sha512":return jH.Sha512;case"sha256":return jH.Sha256;default:Ee(e)}}function Oym(e){if(e.type==="query-parameter")return xIe.queryParameter({name:e.name});Ee(e.type)}function Pym({asymmetric:e,file:t}){return{signatureHeaderName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),algorithm:Bym(e["asymmetric-algorithm"]),encoding:cLo(e.encoding),signaturePrefix:e["signature-prefix"],keySource:Rym({asymmetric:e,file:t}),payloadFormat:e["payload-format"]!=null?RIu(e["payload-format"]):void 0,timestamp:DIu({timestamp:e.timestamp,file:t})}}function BIu(e){switch(e){case"sha1":return NH.Sha1;case"sha384":return NH.Sha384;case"sha512":return NH.Sha512;case"sha256":case void 0:return NH.Sha256}}function cLo(e){switch(e){case"hex":return ILe.Hex;case"base64":case void 0:return ILe.Base64}}function Bym(e){switch(e){case"rsa-sha256":return oB.RsaSha256;case"rsa-sha384":return oB.RsaSha384;case"rsa-sha512":return oB.RsaSha512;case"ecdsa-sha256":return oB.EcdsaSha256;case"ecdsa-sha384":return oB.EcdsaSha384;case"ecdsa-sha512":return oB.EcdsaSha512;case"ed25519":return oB.Ed25519}}function Rym({asymmetric:e,file:t}){return e["jwks-url"]!=null?FH.jwks({url:e["jwks-url"],keyIdHeader:e["key-id-header"]!=null?t.casingsGenerator.generateNameAndWireValue({wireValue:e["key-id-header"],name:e["key-id-header"]}):void 0}):FH.static({})}function RIu(e){return e==null?{components:[LV.Body],delimiter:"",bodySort:void 0}:{components:e.components.map(kym),delimiter:e.delimiter??"",bodySort:Dym(e["body-sort"])}}function Dym(e){switch(e){case"alphabetical":return oLt.Alphabetical;case void 0:return}}function kym(e){switch(e){case"body":return LV.Body;case"timestamp":return LV.Timestamp;case"notification-url":return LV.NotificationUrl;case"message-id":return LV.MessageId}}function DIu({timestamp:e,file:t}){if(e!=null)return{headerName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),format:Fym(e.format),tolerance:e.tolerance}}function Fym(e){switch(e){case"unix-millis":return Tfe.UnixMillis;case"iso8601":return Tfe.Iso8601;case"unix-seconds":case void 0:return Tfe.UnixSeconds}}var kIu=h(()=>{"use strict";Ct();ho();Wn();lc();kt();Sre();A4();uUe();jWr();Qct();i8()});function FIu({name:e,source:t}){return Zp.userDefined({file:KWr({source:t}),name:MGt.generateName(e)})}function NIu({encoding:e}){if(e.proto!=null&&e.proto.type!=null){let t=Nym({type:e.proto.type});if(t!=null)return t}}function Nym({type:e}){switch(e){case"google.protobuf.Any":return Zp.wellKnown(Ci.any());case"google.protobuf.Api":return Zp.wellKnown(Ci.api());case"google.protobuf.BoolValue":return Zp.wellKnown(Ci.boolValue());case"google.protobuf.BytesValue":return Zp.wellKnown(Ci.bytesValue());case"google.protobuf.DoubleValue":return Zp.wellKnown(Ci.doubleValue());case"google.protobuf.Duration":return Zp.wellKnown(Ci.duration());case"google.protobuf.Empty":return Zp.wellKnown(Ci.empty());case"google.protobuf.Enum":return Zp.wellKnown(Ci.enum());case"google.protobuf.EnumValue":return Zp.wellKnown(Ci.enumValue());case"google.protobuf.Field":return Zp.wellKnown(Ci.field());case"google.protobuf.FieldCardinality":return Zp.wellKnown(Ci.fieldCardinality());case"google.protobuf.FieldKind":return Zp.wellKnown(Ci.fieldKind());case"google.protobuf.FieldMask":return Zp.wellKnown(Ci.fieldMask());case"google.protobuf.FloatVlaue":return Zp.wellKnown(Ci.floatValue());case"google.protobuf.Int32Value":return Zp.wellKnown(Ci.int32Value());case"google.protobuf.Int64Value":return Zp.wellKnown(Ci.int64Value());case"google.protobuf.ListValue":return Zp.wellKnown(Ci.listValue());case"google.protobuf.Method":return Zp.wellKnown(Ci.method());case"google.protobuf.Mixin":return Zp.wellKnown(Ci.mixin());case"google.protobuf.NullValue":return Zp.wellKnown(Ci.nullValue());case"google.protobuf.Option":return Zp.wellKnown(Ci.option());case"google.protobuf.SourceContext":return Zp.wellKnown(Ci.sourceContext());case"google.protobuf.StringValue":return Zp.wellKnown(Ci.stringValue());case"google.protobuf.Struct":return Zp.wellKnown(Ci.struct());case"google.protobuf.Syntax":return Zp.wellKnown(Ci.syntax());case"google.protobuf.Timestamp":return Zp.wellKnown(Ci.timestamp());case"google.protobuf.Type":return Zp.wellKnown(Ci.type());case"google.protobuf.Uint32Value":return Zp.wellKnown(Ci.uint32Value());case"google.protobuf.Uint64Value":return Zp.wellKnown(Ci.uint64Value());case"google.protobuf.Value":return Zp.wellKnown(Ci.value())}}var jIu=h(()=>{"use strict";Wn();Fct();XMo()});function jym(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _ct(e,t,r){if(t.length===0)return e;let n=new Map;for(let o=0;o<t.length;o++){let s=t[o],a=r[o];s!=null&&a!=null&&n.set(s,a)}if(n.size===0)return e;let i=Array.from(n.keys()).map(o=>`\\b${jym(o)}\\b`).join("|");return e.replace(new RegExp(i,"g"),o=>n.get(o)??o)}var uLo=h(()=>{"use strict"});function zIu({generic:e,file:t,typeResolver:r}){let n=typeof e=="string"?e:e.type,i=cI(n);if(i==null)throw new T({message:`Invalid generic type definition: ${n}`,code:T.Code.ValidationError});let o=r.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:n,file:t});if(i.arguments&&Of(o.declaration)){let s=cI(o.typeName)?.arguments??[],a=Object.entries(o.declaration.properties??{}).map(([u,l])=>{let p=l;return typeof l=="string"?p=_ct(l,s,i.arguments):typeof l=="object"&&l!=null&&"type"in l&&(p={...l,type:_ct(l.type,s,i.arguments)}),[u,p]}),c=HK(o.declaration.extends).map(u=>{let l=_ct(u,s,i.arguments);return jT({typeName:l,file:t})});return uc.object({extends:c,properties:DGt({properties:Object.fromEntries(a)},t),extraProperties:o.declaration["extra-properties"]??!1,extendedProperties:void 0,deferredUnionBaseProperties:void 0})}throw new T({message:`Generic type definition not supported: ${n}`,code:T.Code.ValidationError})}var QIu=h(()=>{"use strict";ho();Wn();kt();Sre();uLo();i8()});function MIu({alias:e,file:t,typeResolver:r}){let n=typeof e=="string"?e:e.type;return jV(n)?zIu({generic:n,file:t,typeResolver:r}):uc.alias({aliasOf:t.parseTypeReference(e),resolvedType:zym({aliasOf:n,file:t,typeResolver:r})})}function zym({aliasOf:e,file:t,typeResolver:r}){let n=r.resolveTypeOrThrow({type:e,file:t});switch(n._type){case"primitive":return Iw.primitive(n.originalTypeReference.primitive);case"container":return Iw.container(n.originalTypeReference.container);case"unknown":return Iw.unknown();case"named":{let i=Of(n.declaration)?uD.Object:KV(n.declaration)?uD.Union:VH(n.declaration)?uD.Enum:wtt(n.declaration)?uD.UndiscriminatedUnion:Ee(n.declaration);return Iw.named({name:n.name,shape:i})}}}var LIu=h(()=>{"use strict";Ct();ho();Wn();QIu()});function _Iu({union:e,file:t}){let r=e.union.filter((n,i)=>{let o=typeof n=="string"?n:n.type;return e.union.findIndex(s=>(typeof s=="string"?s:s.type)===o)===i});return uc.undiscriminatedUnion({baseProperties:e["base-properties"]!=null?Object.entries(e["base-properties"]).map(([n,i])=>({...zT(i),name:t.casingsGenerator.generateNameAndWireValue({wireValue:n,name:pS({propertyKey:n,property:i}).name}),valueType:t.parseTypeReference(i),propertyAccess:bSe({property:i}),defaultValue:typeof i!="string"?i.default:void 0,xml:void 0,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}}})):void 0,members:r.map(n=>{let i=t.parseTypeReference(typeof n=="string"?n:n.type);return{type:i.type==="named"?{...i,displayName:typeof n=="string"?YP(Vr(i.name)):n["display-name"]??YP(Vr(i.name))}:i,docs:typeof n=="string"?void 0:n.docs}})})}var UIu=h(()=>{"use strict";Ct();Wn();lc();A4();i8()});function VIu(e){let t=[];if(e.extends!=null){let r=typeof e.extends=="string"?[e.extends]:e.extends;t.push(...r)}return e.properties!=null&&t.push(...Object.values(e.properties).map(r=>typeof r=="string"?r:r.type)),t}function pLo({typeDeclaration:e,file:t,typeResolver:r,seenTypeNames:n=new lLo}){let i=bC(e,{alias:s=>{let a=typeof s=="string"?s:s.type,c=cI(a);if(c!=null){let u=new Set(c.arguments??[]),l=r.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:a,file:t}),p=cI(l.typeName)?.arguments;if(Of(l.declaration)){let d=VIu(l.declaration);p&&d.filter(f=>!p.includes(f)).map(f=>_ct(f,p,c.arguments)).forEach(f=>u.add(f))}return Array.from(u)}return[a]},object:s=>VIu(s),discriminatedUnion:s=>{let a=[];return s["base-properties"]!=null&&a.push(...Object.values(s["base-properties"]).map(c=>typeof c=="string"?c:c.type)),a.push(...Object.values(s.union).reduce((c,u)=>{let l=typeof u=="string"?u:u.type;return typeof l=="string"&&c.push(l),c},[])),a},undiscriminatedUnion:s=>{let a=[];return s["base-properties"]!=null&&a.push(...Object.values(s["base-properties"]).map(c=>typeof c=="string"?c:c.type)),a.push(...Object.values(s.union).reduce((c,u)=>{let l=typeof u=="string"?u:u.type;return typeof l=="string"&&c.push(l),c},[])),a},enum:()=>[]}),o=[];for(let s of i){let a=yC({type:s,_default:void 0,validation:void 0,visitor:{primitive:()=>[],map:({keyType:c,valueType:u})=>[...c,...u],list:c=>c,optional:c=>c,nullable:c=>c,set:c=>c,named:c=>[c],literal:()=>[],unknown:()=>[]}});for(let c of a){let u=jT({typeName:c,file:t});if(!n.hasTypeNameBeenSeen(u)){n.addTypeName(u),o.push(u);let l=r.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:c,file:t});if(jV(l.typeName))continue;o.push(...pLo({typeDeclaration:l.declaration,file:l.file,typeResolver:r,seenTypeNames:n}))}}}return o}var lLo,GIu=h(()=>{"use strict";ho();lc();Sre();uLo();lLo=class{cache=new Set;addTypeName(t){this.cache.add(this.computeCacheKey(t))}hasTypeNameBeenSeen(t){return this.cache.has(this.computeCacheKey(t))}computeCacheKey(t){return t.fernFilepath.allParts.map(r=>Vr(r)).join("/")+":"+Vr(t.name)}}});function qIu({typeName:e,typeDeclaration:t,file:r,typeResolver:n,exampleResolver:i,sourceResolver:o,workspace:s}){let a=zT(t),c=jT({typeName:e,file:r}),u=pLo({typeDeclaration:t,file:r,typeResolver:n}),l={};Of(t)&&(l=nUe(t.properties??{}));let p=Mym({file:r,typeDeclaration:t,typeName:e,sourceResolver:o});return{propertiesByAudience:l,typeDeclaration:{...a,inline:Gym(t),name:c,shape:Qym({typeDeclaration:t,file:r,typeResolver:n}),referencedTypes:new Set(u.map(d=>d.typeId)),encoding:Lym({typeDeclaration:t,typeName:e,source:p}),source:p,userProvidedExamples:typeof t!="string"&&t.examples!=null?t.examples.map(d=>({name:d.name!=null?r.casingsGenerator.generateName(d.name):void 0,docs:d.docs,jsonExample:i.resolveAllReferencesInExampleOrThrow({example:d.value,file:r}).resolvedExample,shape:KMo({typeName:c,example:d.value,typeResolver:n,exampleResolver:i,typeDeclaration:t,fileContainingType:r,fileContainingExample:r,workspace:s})})):[],autogeneratedExamples:[],v2Examples:void 0},descendantFilepaths:new Set(u.map(d=>d.fernFilepath))}}function Qym({typeDeclaration:e,file:t,typeResolver:r}){return bC(e,{alias:n=>MIu({alias:n,file:t,typeResolver:r}),object:n=>B0u({object:n,file:t,withinXmlElement:Uym(e)}),discriminatedUnion:n=>H0u({union:n,file:t,typeResolver:r}),undiscriminatedUnion:n=>_Iu({union:n,file:t}),enum:n=>uc.enum(GWr({_enum:n,file:t}))})}function Mym({file:e,typeDeclaration:t,typeName:r,sourceResolver:n}){if(typeof t=="string"||t.source==null&&t.encoding==null)return;if(t.encoding!=null){let o=NIu({encoding:t.encoding});if(o!=null)return Sfe.proto(o)}if(t.source==null)return;let i=n.resolveSourceOrThrow({source:t.source,relativeFilepath:e.relativeFilepath});if(!(i==null||i.type!=="protobuf"))return Sfe.proto(FIu({source:i,name:r}))}function Lym({typeDeclaration:e,typeName:t,source:r}){return typeof e!="string"&&e.encoding!=null?_ym({encodingSchema:e.encoding,typeName:t}):Vym(r)}function _ym({encodingSchema:e,typeName:t}){return e.proto!=null?{json:void 0,proto:{},xml:void 0}:e.xml!=null?{json:void 0,proto:void 0,xml:{name:e.xml.name??t,namespace:e.xml.namespace,prefix:e.xml.prefix}}:{json:{},proto:void 0,xml:void 0}}function Uym(e){return typeof e!="string"&&e.encoding?.xml!=null}function Vym(e){return e!=null&&e.type==="proto"?{json:void 0,proto:{},xml:void 0}:{json:{},proto:void 0,xml:void 0}}function Gym(e){if(typeof e!="string"&&"inline"in e)return e.inline}var WIu=h(()=>{"use strict";ho();Wn();lc();Sre();A4();jIu();LIu();kct();_Gt();Qct();i8();UIu();GIu()});function HIu(e,t){let r=t[e];if(r==null)throw T.internalError(`Failed to load type declaration for type ${e}`);return r}var KIu=h(()=>{"use strict";kt()});function JIu(e){e.types=Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Wym({typeDeclaration:r,ir:e})])),e.services=Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>qym({endpoint:n,ir:e}))}]))}function qym({endpoint:e,ir:t}){return e.requestBody?.type!=="inlinedRequestBody"?e:{...e,requestBody:{...e.requestBody,extendedProperties:e.requestBody.extends.flatMap(r=>YIu(r,t))}}}function Wym({typeDeclaration:e,ir:t}){return e.shape.type==="object"?{...e,shape:{...e.shape,extendedProperties:e.shape.extends.flatMap(r=>YIu(r,t))}}:e}function YIu(e,t){let r=fLo(e.typeId,t);return XIu({objectTypeDeclaration:r,ir:t})}function fLo(e,t){let r=HIu(e,t.types);switch(r.shape.type){case"object":return r.shape;case"alias":if(r.shape.resolvedType.type==="named")return fLo(r.shape.resolvedType.name.typeId,t)}throw T.internalError(`Unexpected error: ${e} is extended but has shape ${r.shape.type}`)}function XIu({objectTypeDeclaration:e,ir:t}){let r=e.extends.flatMap(n=>{let i=fLo(n.typeId,t);return XIu({objectTypeDeclaration:i,ir:t})});return[...e.properties,...r]}var ZIu=h(()=>{"use strict";kt();KIu()});function $Iu(e,t){if(e.length!==t.length)return!1;let r=new Set(e);for(let n of t)if(!r.has(n))return!1;return!0}var s7r,evu=h(()=>{"use strict";lc();kt();Vi();s7r=class{subpackages={};rootPackage={docs:void 0,fernFilepath:{allParts:[],packagePath:[],file:void 0},websocket:void 0,service:void 0,types:[],errors:[],subpackages:[],webhooks:void 0,navigationConfig:void 0};addPackageRedirection({from:t,to:r}){let n=this.getPackageForFernFilepath(t);if(n.navigationConfig!=null)throw new T({message:"Found duplicate navigationConfig for package",code:T.Code.InternalError});n.navigationConfig={pointsTo:Xu.generateSubpackageId(r)}}addDocs(t,r){let n=this.getPackageForFernFilepath(t);if(n.docs!=null)throw new T({message:"Found duplicate docs for package",code:T.Code.InternalError});n.docs=r}addSubpackage(t){this.getPackageForFernFilepath(t)}addType(t,r){this.getPackageForFernFilepath(r.name.fernFilepath).types.push(t)}addError(t,r){this.getPackageForFernFilepath(r.name.fernFilepath).errors.push(t)}addService(t,r){let n=this.getPackageForFernFilepath(r.name.fernFilepath);if(n.service!=null)throw new T({message:"Found duplicate service for "+t,code:T.Code.InternalError});n.service=t}addWebhookGroup(t,r){let n=this.getPackageForFernFilepath(r);if(n.webhooks!=null)throw new T({message:"Found duplicate webhook group for "+t,code:T.Code.InternalError});n.webhooks=t}addWebSocketChannel(t,r){let n=this.getPackageForFernFilepath(r);if(n.webhooks!=null)throw new T({message:"Found duplicate webhook group for "+t,code:T.Code.InternalError});n.websocket=t}build(t){t!=null&&(Object.entries(this.subpackages).forEach(([i,o])=>{t.hasSubpackageId(i)?this.subpackages[i]={...o,types:o.types.filter(s=>t.hasTypeId(s)),errors:o.errors.filter(s=>t.hasErrorId(s)),service:o.service!=null&&t.hasServiceId(o.service)?o.service:void 0,websocket:o.websocket!=null&&t.hasChannel(o.websocket)?o.websocket:void 0,subpackages:o.subpackages.filter(s=>t.hasSubpackageId(s))}:delete this.subpackages[i]}),this.rootPackage={...this.rootPackage,types:this.rootPackage.types.filter(i=>t.hasTypeId(i)),errors:this.rootPackage.errors.filter(i=>t.hasErrorId(i)),service:this.rootPackage.service!=null&&t.hasServiceId(this.rootPackage.service)?this.rootPackage.service:void 0,subpackages:this.rootPackage.subpackages.filter(i=>t.hasSubpackageId(i)),webhooks:this.rootPackage.webhooks!=null?this.rootPackage.webhooks:void 0});let r=new Set(this.getAllChildrenWithEndpoints(this.rootPackage)),n=new Set(this.getAllChildrenWithWebSocket(this.rootPackage));return{subpackages:Cp(this.subpackages,(i,o)=>({...i,hasEndpointsInTree:r.has(o),hasWebSocketInTree:n.has(o)||i.websocket!=null})),rootPackage:{...this.rootPackage,hasEndpointsInTree:r.size>0||this.rootPackage.service!=null,hasWebSocketInTree:n.size>0||this.rootPackage.websocket!=null||Object.values(this.subpackages).some(i=>i.websocket!=null)}}}sortRootPackage(t){if(!$Iu(this.rootPackage.subpackages,t))throw new T({message:"Sorted subpackages differ from unsorted packages in root",code:T.Code.InternalError});this.rootPackage.subpackages=t}sortSubpackage(t,r){let n=this.subpackages[t];if(n==null)throw new T({message:"Subpackage does not exist: "+t,code:T.Code.ResolutionError});if(!$Iu(n.subpackages,r))throw new T({message:"Sorted subpackages differ from unsorted packages",code:T.Code.InternalError});n.subpackages=r}getAllSubpackagesWithEndpoints(t){let r=this.subpackages[t];if(r==null)throw new T({message:"Subpackage does not exist: "+t,code:T.Code.ResolutionError});let n=this.getAllChildrenWithEndpoints(r);return(n.length>0||r.service!=null)&&n.push(t),n}getAllChildrenWithEndpoints(t){return t.subpackages.flatMap(r=>[...this.getAllSubpackagesWithEndpoints(r)])}getAllSubpackagesWithWebSocket(t){let r=this.subpackages[t];if(r==null)throw new T({message:"Subpackage does not exist: "+t,code:T.Code.ResolutionError});let n=this.getAllChildrenWithWebSocket(r);return(n.length>0||r.websocket!=null)&&n.push(t),n}getAllChildrenWithWebSocket(t){return t.subpackages.flatMap(r=>[...this.getAllSubpackagesWithWebSocket(r)])}getPackageForFernFilepath(t,r=0,n=this.rootPackage){let i=t.allParts[r];if(i==null)return n;let o=n.subpackages.map(l=>{let p=this.subpackages[l];if(p==null)throw new T({message:"Subpackage ID is invalid: "+l,code:T.Code.InternalError});return p}),s=r+1,a={allParts:t.allParts.slice(0,s),packagePath:t.packagePath.slice(0,s),file:s===t.allParts.length?t.file:void 0},c=Vr(i),u=o.find(l=>Vr(l.name)===c);if(u==null){let l=Xu.generateSubpackageId(a),p={docs:void 0,fernFilepath:a,name:i,displayName:void 0,service:void 0,types:[],errors:[],subpackages:[],navigationConfig:void 0,webhooks:void 0,websocket:void 0};this.subpackages[l]=p,n.subpackages.push(l),u=p}return this.getPackageForFernFilepath(t,s,u)}}});function tvu({reference:e,referencedIn:t,imports:r}){let[n,i,...o]=e.split(".");if(n==null||o.length>0)return;if(i==null)return{endpointName:n,relativeFilepath:t};let a=r[n];if(a!=null)return{endpointName:i,relativeFilepath:ySe({referencedIn:t,importPath:a})}}var rvu=h(()=>{"use strict";FWr()});var pUe,dLo=h(()=>{"use strict";Bc();ho();kt();Qme();rvu();pUe=class{workspace;constructor(t){this.workspace=t}resolveEndpointOrThrow({endpoint:t,file:r}){let n=this.resolveEndpoint({endpoint:t,file:r});if(n==null)throw new T({message:"Cannot resolve endpoint: "+t+" in file "+r.relativeFilepath,code:T.Code.ResolutionError});return n}resolveEndpointByMethodAndPath({method:t,path:r,namespace:n,casingsGenerator:i}){let o;return wC(this.workspace,(s,a,c)=>{if(n!=null&&this.getNamespaceFromFilepath(s)!==n)return;let u=wu({relativeFilepath:s,definitionFile:a,casingsGenerator:i,rootApiFile:this.workspace.definition.rootApiFile.contents,defaultUrl:c.defaultUrl});for(let[l,p]of Object.entries(a.service?.endpoints??{}))p.method===t&&p.path===r&&(o={endpointId:l,endpoint:p,file:u})}),z3e(this.workspace,(s,a)=>{if(n!=null&&this.getNamespaceFromFilepath(s)!==n)return;let c=wu({relativeFilepath:s,definitionFile:a,casingsGenerator:i,rootApiFile:this.workspace.definition.rootApiFile.contents});for(let[u,l]of Object.entries(a.service?.endpoints??{}))l.method===t&&l.path===r&&(o={endpointId:u,endpoint:l,file:c})}),o}getNamespaceFromFilepath(t){let r=t.split("/");if(r.length>1)return r[0]}resolveEndpoint({endpoint:t,file:r}){let i=new BH().tryParse(t);if(i!=null)return this.resolveEndpointByMethodAndPath({method:i.method,path:i.path,namespace:i.namespace,casingsGenerator:r.casingsGenerator});let o=this.getDeclarationOfEndpoint({referenceToEndpoint:t,file:r});if(o==null)return;let s=o.file.definitionFile.service?.endpoints?.[o.endpointName];if(s!=null)return{endpointId:o.endpointName,endpoint:s,file:o.file}}getDeclarationOfEndpoint({referenceToEndpoint:t,file:r}){let n=tvu({reference:t,referencedIn:r.relativeFilepath,imports:r.imports});if(n==null)return;let i=Rde(this.workspace,n.relativeFilepath);if(!(i==null||i.service?.endpoints?.[n.endpointName]==null))return{endpointName:n.endpointName,file:wu({relativeFilepath:n.relativeFilepath,definitionFile:i,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}}}});var fUe,mLo=h(()=>{"use strict";Bc();kt();Qme();Oct();fUe=class{workspace;constructor(t){this.workspace=t}getDeclarationOrThrow(t,r){let n=this.getDeclaration(t,r);if(n==null)throw new T({message:"Error does not exist: "+t,code:T.Code.ResolutionError});return n}getDeclaration(t,r){let n=g4({reference:t,referencedIn:r.relativeFilepath,imports:r.imports});if(n==null)return;let i=Rde(this.workspace,n.relativeFilepath);if(i==null)return;let o=i.errors?.[n.typeName];if(o!=null)return{declaration:o,file:wu({definitionFile:i,relativeFilepath:n.relativeFilepath,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}}}});function hLo(e){if(e.length===0)return!1;let t=e.charAt(0);return t>="a"&&t<="z"||t>="A"&&t<="Z"}var E4,gLo=h(()=>{"use strict";Ct();kt();E4=class{typeResolver;constructor(t){this.typeResolver=t}resolveAllReferencesInExample({example:t,file:r}){if(typeof t=="string"){let n=this.resolveExample({example:t,file:r});return n==null?n:typeof n.resolvedExample=="string"?(n.resolvedExample.startsWith(`\\${"$"}`)&&(n.resolvedExample=n.resolvedExample.slice(1)),n):this.resolveAllReferencesInExample({example:n.resolvedExample,file:n.file})}else if(ki(t)){let n={};for(let[i,o]of Object.entries(t)){let s=this.resolveAllReferencesInExample({example:o,file:r});if(s==null)return;let a=i.startsWith(`\\${"$"}`)?i.slice(1):i;n[a]=s.resolvedExample}return{resolvedExample:n}}else if(Array.isArray(t)){let n=[];for(let i of t){let o=this.resolveAllReferencesInExample({example:i,file:r});if(o==null)return;n.push(o.resolvedExample)}return{resolvedExample:n}}return{resolvedExample:t}}resolveAllReferencesInExampleOrThrow({example:t,file:r}){let n=this.resolveAllReferencesInExample({example:t,file:r});if(n==null)throw new T({message:"Failed to resolve examples",code:T.Code.ResolutionError});return n}resolveExample({example:t,file:r}){return typeof t!="string"?{resolvedExample:t,file:r}:t.startsWith("$")?this.parseExampleReference(t)==null?{resolvedExample:t,file:r}:this.resolveExampleReference(t,r):{resolvedExample:t,file:r}}resolveExampleReference(t,r){let n=this.parseExampleReference(t);if(n==null)return;let i=this.typeResolver.getDeclarationOfNamedType({referenceToNamedType:n.rawTypeReference,file:r});if(i==null||typeof i.declaration=="string"||i.declaration.examples==null)return;let o=i.declaration.examples.find(s=>s.name===n.exampleName);if(o!=null)return this.resolveExample({example:o.value,file:i.file})}resolveExampleOrThrow({example:t,file:r}){let n=this.resolveExample({example:t,file:r});if(n==null)throw new T({message:"Cannot resolve example: "+t,code:T.Code.ResolutionError});return n}parseExampleReference(t){let[r,n,i,...o]=t.split(".");if(r==null||n==null||o.length>0)return;if(i==null){let a=r.slice("$".length);return hLo(a)?{rawTypeReference:a,exampleName:n}:void 0}let s=r.slice("$".length);if(!(!hLo(s)||!hLo(n)))return{rawTypeReference:`${s}.${n}`,exampleName:i}}}});function Hym({typeResolver:e,file:t,resolvedType:r,propertyName:n,breadcrumbs:i,rootTypeTitle:o}){let s=Uct({typeResolver:e,file:t,resolvedType:r,propertyName:n});if(!s)throw new T({message:`Cannot find property '${i.join(".")}' in ${o}`,code:T.Code.InternalError});return s}function Uct({typeResolver:e,file:t,resolvedType:r,propertyName:n}){switch(r._type){case"container":switch(r.container._type){case"list":return;case"literal":return;case"map":return;case"nullable":{let i=Uct({typeResolver:e,file:t,resolvedType:r.container.itemType,propertyName:n});return i||void 0}case"optional":{let i=Uct({typeResolver:e,file:t,resolvedType:r.container.itemType,propertyName:n});return i||void 0}case"set":return;default:Ee(r.container)}break;case"primitive":return;case"unknown":return;case"named":{let i=r.declaration;if("properties"in i&&i.properties!=null){for(let[o,s]of Object.entries(i.properties))if(o===n)return e.resolveTypeOrThrow({type:typeof s=="string"?s:s.type,file:r.file})}if("base-properties"in i&&i["base-properties"]!=null){for(let[o,s]of Object.entries(i["base-properties"]))if(o===n)return e.resolveTypeOrThrow({type:typeof s=="string"?s:s.type,file:r.file})}if("extends"in i&&i.extends!=null){let o=Array.isArray(i.extends)?i.extends:[i.extends];for(let s of o){let a=e.resolveTypeOrThrow({type:s,file:r.file}),c=Uct({file:"file"in a?a.file:t,typeResolver:e,resolvedType:a,propertyName:n});if(c)return c}}if("union"in i&&i.union!=null)if(Array.isArray(i.union))for(let o of i.union){let s=e.resolveTypeOrThrow({type:typeof o=="string"?o:o.type,file:r.file}),a=Uct({file:"file"in s?s.file:t,typeResolver:e,resolvedType:s,propertyName:n});if(a)return a}else for(let[,o]of Object.entries(i.union)){let s=typeof o=="string"?o:o.type;if(!s)continue;let a=e.resolveTypeOrThrow({type:s,file:r.file}),c=Uct({file:"file"in a?a.file:t,typeResolver:e,resolvedType:a,propertyName:n});if(c)return c}return}default:Ee(r)}}function dUe(e){switch(e._type){case"container":switch(e.container._type){case"list":return`list<${dUe(e.container.itemType)}>}`;case"literal":return`literal<${e.container.literal._visit({boolean:t=>t.toString(),string:t=>t,_other:t=>t.type})}>`;case"map":return`map<${dUe(e.container.keyType)}, ${dUe(e.container.valueType)}>}`;case"nullable":return`nullable<${dUe(e.container.itemType)}>}`;case"optional":return`optional<${dUe(e.container.itemType)}>}`;case"set":return`set<${dUe(e.container.itemType)}>}`;default:Ee(e.container)}break;case"named":return Vr(e.name.name);case"primitive":return e.primitive.v1;case"unknown":return"unknown";default:Ee(e)}}var a7r,nvu=h(()=>{"use strict";Ct();ho();Wn();lc();kt();Bct();Mct();a7r=class{typeResolver;endpointResolver;constructor(t,r){this.typeResolver=t,this.endpointResolver=r,this.typeResolver=t,this.endpointResolver=r}resolveRequestPropertyOrThrow({file:t,endpoint:r,propertyComponents:n}){let i=this.resolveRequestProperty({file:t,endpoint:r,propertyComponents:n});if(i==null)throw new T({message:"Cannot resolve request property from endpoint: "+r+" in file "+t.relativeFilepath,code:T.Code.ResolutionError});return i}resolveRequestProperty({file:t,endpoint:r,propertyComponents:n}){let i=this.endpointResolver.resolveEndpointOrThrow({endpoint:r,file:t});if(i.endpoint.request==null)return;if(typeof i.endpoint.request!="string")return this.resolveRequestPropertyFromInlinedRequest({typeResolver:this.typeResolver,file:i.file,requestType:i.endpoint.request,propertyComponents:n});let o=this.typeResolver.resolveTypeOrThrow({type:i.endpoint.request,file:i.file}),s=this.resolveObjectProperty({file:i.file,resolvedType:o,propertyComponents:n});if(s!=null)return{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:n,file:t,resolvedType:o}),property:iB.body(s)}}resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n}){let i=this.resolveResponseProperty({file:t,endpoint:r,propertyComponents:n});if(i==null)throw new T({message:"Cannot resolve response property from endpoint: "+r+" in file "+t.relativeFilepath,code:T.Code.ResolutionError});return i}resolveResponseProperty({file:t,endpoint:r,propertyComponents:n}){let i=this.endpointResolver.resolveEndpointOrThrow({endpoint:r,file:t}),o=this.typeResolver.resolveTypeOrThrow({type:(typeof i.endpoint.response!="string"?i.endpoint.response?.type:i.endpoint.response)??"",file:i.file}),s=this.resolveObjectProperty({file:i.file,resolvedType:o,propertyComponents:n});if(s!=null)return{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:n,resolvedType:o,file:t}),property:s}}resolveRequestPropertyFromInlinedRequest({typeResolver:t,file:r,requestType:n,propertyComponents:i}){if(i.length===1){let o=i[0]??"",s=n["query-parameters"]?.[o]??void 0;if(s!=null)return{property:iB.query(qWr({file:r,queryParameterKey:o,queryParameter:s})),propertyPath:void 0}}return this.resolveRequestPropertyFromInlinedRequestBody({typeResolver:t,file:r,requestType:n,propertyComponents:i})}resolveRequestPropertyFromInlinedRequestBody({typeResolver:t,file:r,requestType:n,propertyComponents:i}){if(n.body==null)return;if(typeof n.body=="string"){let a=t.resolveTypeOrThrow({type:n.body,file:r}),c=this.resolveObjectProperty({file:r,resolvedType:a,propertyComponents:i});return c==null?void 0:{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:i,file:r,resolvedType:a}),property:iB.body(c)}}if(nA(n.body)){let a=QWr({typeResolver:t,file:r,objectSchema:n.body,propertyComponents:i});return a==null?void 0:{propertyPath:this.propertyPathFromPropertyComponentsFromInlineRequestBody({propertyComponents:i,file:r,body:n.body}),property:iB.body(a)}}let o=t.resolveTypeOrThrow({type:n.body.type,file:r}),s=zWr({typeResolver:t,file:Pct(o)??r,resolvedType:o,propertyComponents:i});if(s!=null)return{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:i,file:r,resolvedType:o}),property:iB.body(s)}}resolveObjectProperty({file:t,resolvedType:r,propertyComponents:n}){return zWr({typeResolver:this.typeResolver,file:Pct(r)??t,resolvedType:r,propertyComponents:n})}propertyPathFromPropertyComponents({propertyComponents:t,file:r,resolvedType:n}){if(t.length<=1)return[];let i=dUe(n),o=n,s=[],a=[];for(let c of t.slice(0,-1))a.push(c),o=Hym({typeResolver:this.typeResolver,file:r,resolvedType:o,propertyName:c,breadcrumbs:a,rootTypeTitle:i}),s.push({name:r.casingsGenerator.generateName(c),type:o.originalTypeReference});return s}propertyPathFromPropertyComponentsFromInlineRequestBody({propertyComponents:t,file:r,body:n}){if(t.length<=1)return[];let i=[],o=[];for(let s of t.slice(0,-1)){o.push(s);let a=QWr({typeResolver:this.typeResolver,file:r,objectSchema:n,propertyComponents:o});if(!a)throw new T({message:`Cannot find property '${o.join(".")}' in inline request body in file ${r.relativeFilepath}`,code:T.Code.InternalError});i.push({name:r.casingsGenerator.generateName(s),type:a.valueType})}return i}}});var Pf,ALo=h(()=>{"use strict";Bc();ho();Wn();kt();Qme();qMo();Oct();Pf=class{workspace;definitionFiles;constructor(t){this.workspace=t}getDefinitionFile(t){return this.definitionFiles??=r4(this.workspace.definition),this.definitionFiles[t]?.contents}resolveTypeOrThrow({type:t,file:r}){let n=this.resolveType({type:t,file:r});if(n==null)throw new T({message:"Cannot resolve type: "+t+" in file "+r.relativeFilepath,code:T.Code.ResolutionError});return n}getDeclarationOfNamedTypeOrThrow({referenceToNamedType:t,file:r}){let n=this.getDeclarationOfNamedType({referenceToNamedType:t,file:r});if(n==null)throw new T({message:"Cannot find declaration of type: "+t+" in file "+r.relativeFilepath,code:T.Code.ReferenceError});return n}getDeclarationOfNamedType({referenceToNamedType:t,file:r}){let n=g4({reference:t,referencedIn:r.relativeFilepath,imports:r.imports});if(n==null)return;let i=this.getDefinitionFile(n.relativeFilepath);if(i==null)return;let o=i.types?.[n.typeName];if(o==null){let s=cI(n.typeName);if(s!=null){for(let a of Object.keys(i.types??{})??[])if(s.name&&a.startsWith(s.name)&&a.endsWith(">")){let c=i.types?.[a];return c!=null?{typeName:a,declaration:c,file:wu({relativeFilepath:n.relativeFilepath,definitionFile:i,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}:void 0}}return}return{typeName:n.typeName,declaration:o,file:wu({relativeFilepath:n.relativeFilepath,definitionFile:i,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}}resolveType({type:t,file:r,objectPath:n=[]}){return yC({type:t,_default:void 0,validation:void 0,visitor:{primitive:i=>({_type:"primitive",primitive:i,originalTypeReference:Zr.primitive(i)}),unknown:()=>({_type:"unknown",originalTypeReference:Zr.unknown()}),map:({keyType:i,valueType:o})=>i!=null&&o!=null?{_type:"container",container:{_type:"map",keyType:i,valueType:o},originalTypeReference:Zr.container(Is.map({keyType:i.originalTypeReference,valueType:o.originalTypeReference}))}:void 0,list:i=>i!=null?{_type:"container",container:{_type:"list",itemType:i},originalTypeReference:Zr.container(Is.list(i.originalTypeReference))}:void 0,optional:i=>i!=null?{_type:"container",container:{_type:"optional",itemType:i},originalTypeReference:Zr.container(Is.optional(i.originalTypeReference))}:void 0,nullable:i=>i!=null?{_type:"container",container:{_type:"nullable",itemType:i},originalTypeReference:Zr.container(Is.nullable(i.originalTypeReference))}:void 0,set:i=>i!=null?{_type:"container",container:{_type:"set",itemType:i},originalTypeReference:Zr.container(Is.set(i.originalTypeReference))}:void 0,literal:i=>({_type:"container",container:{_type:"literal",literal:i},originalTypeReference:Zr.container(Is.literal(i))}),named:i=>{let o=this.getDeclarationOfNamedType({referenceToNamedType:i,file:r});if(o==null)return;let s={typeName:o.typeName,file:o.file.relativeFilepath,reference:i};if(!n.some(a=>a.file===s.file&&a.typeName===s.typeName))return this.resolveNamedTypeFromDeclaration({referenceToNamedType:i,referencedIn:r,rawDeclaration:o,objectPath:[...n,s]})}}})}resolveNamedTypeOrThrow({referenceToNamedType:t,file:r}){let n=this.resolveNamedType({referenceToNamedType:t,file:r});if(n==null)throw new T({message:"Cannot resolve type: "+t,code:T.Code.ResolutionError});return n}resolveNamedType({referenceToNamedType:t,file:r}){let n=this.getDeclarationOfNamedType({referenceToNamedType:t,file:r});if(n!=null)return this.resolveNamedTypeFromDeclaration({referenceToNamedType:t,referencedIn:r,rawDeclaration:n})}resolveNamedTypeFromDeclaration({referenceToNamedType:t,referencedIn:r,rawDeclaration:n,objectPath:i=[]}){let{declaration:o,file:s}=n;if(UIe(o))return this.resolveType({type:typeof o=="string"?o:o.type,file:s,objectPath:i});let a=QGt({type:t,_default:void 0,validation:void 0,file:r});if(!(a.type!=="named"||this.getDefinitionFile(s.relativeFilepath)==null))return{_type:"named",rawName:n.typeName,name:a,declaration:o,filepath:s.relativeFilepath,objectPath:i,originalTypeReference:a,file:s}}}});var JK,yLo=h(()=>{"use strict";kt();Qme();JK=class e{static VARIABLE_PREFIX="$";getDeclarationOrThrow(t,r){let n=this.getDeclaration(t,r);if(n==null)throw new T({message:"Variable does not exist: "+t,code:T.Code.ResolutionError});return n}getDeclaration(t,r){if(!t.startsWith(e.VARIABLE_PREFIX))return;let n=r.rootApiFile.variables?.[t.substring(1)];if(n!=null)return{declaration:n,file:zme({casingsGenerator:r.casingsGenerator,rootApiFile:r.rootApiFile})}}getVariableIdOrThrow(t){let r=this.getVariableId(t);if(r==null)throw new T({message:"Variable reference does not start with "+e.VARIABLE_PREFIX,code:T.Code.ResolutionError});return r}getVariableId(t){if(t.startsWith(e.VARIABLE_PREFIX))return t.substring(e.VARIABLE_PREFIX.length)}}});function bLo(e,t){if(Array.isArray(e)){for(let r of e)bLo(r,t);return}if(!(e==null||typeof e!="object")){for(let[r,n]of Object.entries(e))if(!Kym.has(r)){if(r==="typeId"&&typeof n=="string"){t.add(n);continue}bLo(n,t)}}}function ISe(e,t,r){switch(e.type){case"named":{let n=[e.typeId],i=t[e.typeId];return i?.shape.type==="alias"&&!r.has(e.typeId)&&(r.add(e.typeId),n.push(...ISe(i.shape.aliasOf,t,r))),n}case"container":switch(e.container.type){case"list":return ISe(e.container.list,t,r);case"set":return ISe(e.container.set,t,r);case"map":return[...ISe(e.container.keyType,t,r),...ISe(e.container.valueType,t,r)];case"optional":return ISe(e.container.optional,t,r);case"nullable":return ISe(e.container.nullable,t,r);case"literal":return[];default:return[]}case"primitive":case"unknown":return[];default:return[]}}function Jym(e,t){let r=[],n=[],i=o=>{n.push(...ISe(o,t,new Set))};return e.shape._visit({alias:o=>{i(o.aliasOf)},enum:()=>{},object:o=>{for(let s of o.extends)n.push(s.typeId);for(let s of[...o.properties,...o.extendedProperties??[]])i(s.valueType)},union:o=>{for(let s of o.extends)n.push(s.typeId);for(let s of o.baseProperties)i(s.valueType);for(let s of o.types)s.shape._visit({samePropertiesAsObject:a=>{r.push(a.typeId)},singleProperty:a=>{i(a.type)},noProperties:()=>{},_other:()=>{}})},undiscriminatedUnion:o=>{for(let s of o.members)i(s.type)},_other:()=>{}}),{variantEdges:r,nonVariantEdges:n}}function Yym(e){let t=new Map,r=new Set;for(let[n,i]of Object.entries(e.types)){let{variantEdges:o,nonVariantEdges:s}=Jym(i,e.types);for(let a of o){let c=t.get(a)??new Set;c.add(n),t.set(a,c)}for(let a of s)r.add(a)}for(let n of[e.services,e.webhookGroups,e.websocketChannels,e.errors,e.headers,e.idempotencyHeaders,e.pathParameters,e.variables])bLo(n,r);return{variantReferrers:t,nonVariantReferenced:r}}function Xym(e,t){let r=t[e];if(r!=null)switch(r.shape.type){case"object":return e;case"alias":{let n=r.shape.resolvedType;return n.type==="named"&&n.shape==="OBJECT"?n.name.typeId:void 0}default:return}}function ivu(e,t){let r=new Map,n=Xym(e,t);if(n==null)return r;let i=t[n];if(i==null||i.shape.type!=="object")return r;for(let o of[...i.shape.properties,...i.shape.extendedProperties??[]])r.set(ar(o.name),{valueType:o.valueType,name:svu(o.name)});return r}function ovu(e,t){return JSON.stringify(e)===JSON.stringify(t)}function svu(e){return typeof e=="string"?{wireValue:e,name:e}:e}function Zym(e){let{types:t}=e,r=new Map,n=new Map,i=new Map;for(let[a,c]of Object.entries(t)){if(c.shape.type!=="union")continue;let u=c.shape;if(u.baseProperties.length===0)continue;let l=new Map;for(let m of u.baseProperties)l.set(ar(m.name),m.valueType);if(i.set(a,l),!u.types.every(m=>m.shape.propertiesType==="samePropertiesAsObject")){r.set(a,[]);continue}let d=u.types.map(m=>m.shape.propertiesType==="samePropertiesAsObject"?ivu(m.shape.typeId,t):new Map),f=[];for(let m of u.baseProperties){let g=ar(m.name);d.every(y=>{let I=y.get(g);return I!=null&&ovu(I.valueType,m.valueType)})&&f.push(svu(m.name))}r.set(a,f)}let{variantReferrers:o,nonVariantReferenced:s}=Yym(e);for(let[a,c]of o){let u=t[a];if(u==null||u.shape.type!=="object"||s.has(a))continue;let l=ivu(a,t);if(l.size===0)continue;let p=[];for(let[d,f]of l)[...c].every(g=>{let A=i.get(g)?.get(d);return A!=null&&ovu(A,f.valueType)})&&p.push(f.name);p.length>0&&n.set(a,p)}return{inheritedBasePropertiesByUnion:r,deferredUnionBasePropertiesByObject:n}}function avu(e){let{inheritedBasePropertiesByUnion:t,deferredUnionBasePropertiesByObject:r}=Zym(e);e.types=Object.fromEntries(Object.entries(e.types).map(([n,i])=>{switch(i.shape.type){case"union":return[n,{...i,shape:{...i.shape,inheritedBaseProperties:t.get(n)??[]}}];case"object":{let o=r.get(n);return[n,{...i,shape:{...i.shape,deferredUnionBaseProperties:o}}]}default:return[n,i]}}))}var Kym,cvu=h(()=>{"use strict";lc();Kym=new Set(["v2Examples","autogeneratedExamples","userSpecifiedExamples","userProvidedExamples","examples","example"])});function c7r(e,t){if(t){for(let[r,n]of Object.entries(t))if(typeof n!="string"&&r===e)return n.audiences}}var uvu=h(()=>{"use strict"});function pvu({workspace:e}){let t=e.generatorsConfiguration?.api?.settings,r={...lvu};for(let n of Object.keys(lvu)){let i=t?.[n];i!==void 0&&(r[n]=i)}return r}var lvu,fvu=h(()=>{"use strict";ls();lvu={pathParameterOrder:Hr.PathParameterOrder.UrlOrder}});function fA({workspace:e,generationLanguage:t,keywords:r,smartCasing:n,smartCasingDigitWordBoundary:i,exampleGeneration:o,audiences:s,readme:a,packageName:c,userAgentTemplate:u,idempotencyKeyGeneration:l,webhookSignature:p,organization:d,version:f,context:m,fdrApiDefinitionId:g,sourceResolver:A,disableDynamicExamples:y,dynamicGeneratorConfig:I,generationMetadata:x}){let v=t===Hr.GenerationLanguage.CLI?void 0:t,S=pvu({workspace:e}),B=Lw({generationLanguage:v,keywords:r,smartCasing:n,smartCasingDigitWordBoundary:i}),R=new iUe(s),D=zme({casingsGenerator:B,rootApiFile:e.definition.rootApiFile.contents}),O=(e.definition.rootApiFile.contents.errors??[]).map(Se=>({error:ESe({errorName:Se,file:D}),docs:void 0})),z=new Pf(e),Y=new pUe(e),$=new a7r(z,Y),ee=new fUe(e),ae=new E4(z),pe=new JK,me=IGt({casingsGenerator:B,rawApiFileSchema:e.definition.rootApiFile.contents})?.environmentsConfig,xe={selfHosted:!1,fdrApiDefinitionId:g,apiVersion:gIu({file:D,rawApiFileSchema:e.definition.rootApiFile.contents}),specVersion:e.definition.specVersion,apiName:B.generateName(e.definition.rootApiFile.contents.name),apiDisplayName:e.definition.rootApiFile.contents["display-name"],apiDocs:RGt(e.definition.rootApiFile.contents.docs),auth:mIu({rawApiFileSchema:e.definition.rootApiFile.contents,file:D,propertyResolver:$,endpointResolver:Y,typeResolver:z}),headers:e.definition.rootApiFile.contents.headers!=null?Object.entries(e.definition.rootApiFile.contents.headers).map(([Se,Te])=>s8({headerKey:Se,header:Te,file:D})):[],idempotencyHeaders:e.definition.rootApiFile.contents["idempotency-headers"]!=null?Object.entries(e.definition.rootApiFile.contents["idempotency-headers"]).map(([Se,Te])=>s8({headerKey:Se,header:Te,file:D})):[],types:{},errors:{},services:{},constants:ZEu(B),environments:me,errorDiscriminationStrategy:CIu(e.definition.rootApiFile.contents["error-discrimination"],D),basePath:e.definition.rootApiFile.contents["base-path"]!=null?eb(e.definition.rootApiFile.contents["base-path"]):void 0,pathParameters:Lct({pathParameters:e.definition.rootApiFile.contents["path-parameters"],file:D,location:Xt.PathParameterLocation.Root,variableResolver:pe}),variables:e.definition.rootApiFile.contents.variables!=null?Object.entries(e.definition.rootApiFile.contents.variables).map(([Se,Te])=>({docs:typeof Te!="string"?Te.docs:void 0,id:Se,name:D.casingsGenerator.generateName(Se),type:D.parseTypeReference(Te),envVar:typeof Te!="string"?tbm(Te.env):void 0})):[],globalParameters:e.definition.rootApiFile.contents["global-parameters"]!=null?SIu({globalParameters:e.definition.rootApiFile.contents["global-parameters"],file:D}):void 0,serviceTypeReferenceInfo:{typesReferencedOnlyByService:{},sharedTypes:[]},webhookGroups:{},websocketChannels:{},readmeConfig:void 0,sourceConfig:void 0,publishConfig:void 0,dynamic:void 0,audiences:e.definition.rootApiFile.contents.audiences,generationMetadata:x,apiPlayground:!0,casingsConfig:{generationLanguage:v,keywords:r,smartCasing:n,smartCasingDigitWordBoundary:i}},Re=new s7r,ce=Se=>{Re.addSubpackage(Se.fernFilepath),Yp(Se.definitionFile,{imports:It,docs:Te=>{Te!=null&&Re.addDocs(Se.fernFilepath,Te)},types:Te=>{if(Te!=null)for(let[ut,Ye]of Object.entries(Te)){if(jV(ut))continue;let qe=qIu({typeName:ut,typeDeclaration:Ye,file:Se,typeResolver:z,exampleResolver:ae,sourceResolver:A,workspace:e}),at=qe.typeDeclaration;o.disabled&&(at.userProvidedExamples=[],at.autogeneratedExamples=[]);let vt=qe.descendantFilepaths,or=Xu.generateTypeId(at.name);xe.types[or]=at,Re.addType(or,at),R.addType({declaredTypeName:at.name,descendantTypeIds:at.referencedTypes,descendantTypeIdsByAudience:{},propertiesByAudience:qe.propertiesByAudience,descendantFilepaths:vt}),R.markTypeForAudiences(at.name,P0u(Ye))}},errors:Te=>{if(Te==null)return;if(e.definition.rootApiFile.contents["error-discrimination"]==null)throw new T({message:"error-discrimination is missing in api.yml but there are declared errors.",code:T.Code.ConfigError});for(let[Ye,qe]of Object.entries(Te)){let at=EIu({errorName:Ye,errorDeclaration:qe,file:Se,typeResolver:z,exampleResolver:ae,workspace:e}),vt=Xu.generateErrorId(at.name);xe.errors[vt]=at,Re.addError(vt,at),R.addError(at)}},service:Te=>{if(Te==null)return;let ut=HEu({rootDefaultUrl:Se.defaultUrl??e.definition.rootApiFile.contents["default-url"],rootPathParameters:xe.pathParameters,serviceDefinition:Te,file:Se,errorResolver:ee,typeResolver:z,propertyResolver:$,exampleResolver:ae,sourceResolver:A,globalErrors:O,variableResolver:pe,workspace:e,auth:xe.auth,irSettings:S}),Ye=Xu.generateServiceId(ut.name);xe.services[Ye]=ut,Re.addService(Ye,ut);let qe={};ut.endpoints.forEach(at=>{o.disabled&&(at.autogeneratedExamples=[],at.userSpecifiedExamples=[]);let vt=Vr(at.name),or=Te.endpoints[vt];R.addEndpoint(ut,at,or),qe[vt]=at}),Te.audiences!=null&&R.markEndpointForAudience(ut.name,ut.endpoints,Te.audiences),Object.entries(Te.endpoints).map(([at,vt])=>{let or=qe[at];or!=null&&vt.audiences!=null&&R.markEndpointForAudience(ut.name,[or],vt.audiences)})},webhooks:Te=>{if(Te==null)return;let ut=Xu.generateWebhookGroupId(Se.fernFilepath),Ye=PIu({webhooks:Te,file:Se,typeResolver:z,exampleResolver:ae,workspace:e,defaultSignature:Se.definitionFile["webhook-signature"]??p}),qe={};for(let at of Ye)qe[Vr(at.name)]=at;Object.entries(Te).forEach(([at,vt])=>{let or=qe[at];or!=null&&(R.addWebhook(Se.fernFilepath,or,vt),vt.audiences!=null&&R.markWebhookForAudiences(Se.fernFilepath,or,vt.audiences))}),xe.webhookGroups[ut]=Ye,Re.addWebhookGroup(ut,Se.fernFilepath)},"webhook-signature":It,channel:Te=>{if(Te==null)return;let ut=Xu.generateWebSocketChannelId(Se.fernFilepath),Ye=yIu({channel:Te,file:Se,variableResolver:pe,typeResolver:z,exampleResolver:ae,workspace:e});R.addChannel(Se.fernFilepath,ut,Ye,Te),Te.audiences!=null&&R.markChannelForAudiences(Se.fernFilepath,ut,Te.audiences),xe.websocketChannels!=null&&(xe.websocketChannels[ut]=Ye,Re.addWebSocketChannel(ut,Se.fernFilepath))}})};wC(e,(Se,Te,ut)=>{ce(wu({relativeFilepath:Se,definitionFile:Te,casingsGenerator:B,rootApiFile:e.definition.rootApiFile.contents,defaultUrl:ut.defaultUrl}))}),z3e(e,(Se,Te)=>{if(Te.navigation!=null)if(typeof Te.navigation=="string")Re.addPackageRedirection({from:nM({relativeFilepath:Se,casingsGenerator:B}),to:nM({relativeFilepath:fv(xV(Se),Ws.of(Te.navigation)),casingsGenerator:B})});else{let ut=Te.navigation.map(Ye=>Xu.generateSubpackageId(nM({relativeFilepath:fv(xV(Se),Ws.of(Ye)),casingsGenerator:B})));Se===rd?Re.sortRootPackage(ut):Re.sortSubpackage(Xu.generateSubpackageId(nM({relativeFilepath:Se,casingsGenerator:B})),ut)}}),xe.serviceTypeReferenceInfo=ebm(R),JIu(xe),avu(xe),PGt(xe,{onWarning:Se=>m.logger.warn(Se)}),xGt({ir:xe});let ue=o.disabled?xe:wGt({ir:xe,exampleGeneration:o}),Pe=e.definition.rootApiFile.contents,Ie=me?.environments._visit({singleBaseUrl:Se=>Se.environments.filter(Te=>c7r(Te.id,Pe.environments)!=null).length===0,multipleBaseUrls:Se=>Se.environments.filter(Te=>c7r(Te.id,Pe.environments)!=null).length===0,_other:()=>!1});me?.environments.environments.forEach(Se=>{R.markEnvironmentForAudiences(Se,c7r(Se.id,Pe.environments)??[],Ie)});let Be=R.hasNoAudiences()?void 0:R.build(),_e=OGt(ue,Be),$e=e.definition.rootApiFile.contents.auth!=null&&Object.values(_e.services).every(Se=>Se.endpoints.every(Te=>Te.auth)),Et=Object.values(_e.services).some(Se=>Se.endpoints.some(Te=>Te.response?.body?.type==="streaming")),mt=Object.values(_e.services).some(Se=>Se.endpoints.some(Te=>Te.pagination!=null)),Ht=Object.values(_e.services).some(Se=>Se.endpoints.some(Te=>Te.response?.body?.type==="fileDownload")),ur=_e.headers.some(Se=>(typeof Se.name=="string"?Se.name:Se.name.wireValue).toLowerCase()==="user-agent"),Ce={isAuthMandatory:$e,hasStreamingEndpoints:Et,hasPaginatedEndpoints:mt,hasFileDownloadEndpoints:Ht,idempotencyKeyGeneration:l,webhookSignatureVerification:aLo({signature:p,file:D}),platformHeaders:{language:"X-Fern-Language",sdkName:"X-Fern-SDK-Name",sdkVersion:"X-Fern-SDK-Version",userAgent:(()=>{if(!ur){if(u!=null&&f!=null){let Se={version:f,packageName:c??"",language:v??"",generatorVersion:x?.generatorVersion??"",organization:d??"",apiName:e.definition.rootApiFile.contents.name??""};return{header:"User-Agent",value:u.replace(/\{(\w+)\}/g,(ut,Ye)=>Se[Ye]??"")}}if(f!=null&&c!=null)return{header:"User-Agent",value:`${c}/${f}`}}})()}},ge=a??e.generatorsConfiguration?.rawConfiguration.readme,ot=ge!=null?TIu({readme:ge,services:xe.services}):void 0,ht=$ym({..._e,...Re.build(Be),sdkConfig:Ce,readmeConfig:ot});return{...ht,dynamic:lUe({ir:ht,generatorConfig:I,disableExamples:y,generationLanguage:v,smartCasing:n,smartCasingDigitWordBoundary:i})}}function $ym(e){let t=r=>{if(!r||typeof r!="object")return r;if(Array.isArray(r))return r.map(t);for(let n in r){let i=r[n];n==="docs"&&typeof i=="string"?r[n]=RGt(i):i&&typeof i=="object"&&t(i)}return r};return t(e)}function ebm(e){let t={},r=[],n=e.getTypesReferencedByService();for(let[i,o]of Object.entries(n)){if(o.size===1){let s=o.values().next().value;if(s==null)break;t[s]===void 0&&(t[s]=[]),t[s]?.push(i);continue}r.push(i)}return{typesReferencedOnlyByService:t,sharedTypes:r}}function tbm(e){let t=e?.trim();return t!=null&&t.length>0?t:void 0}var dvu=h(()=>{"use strict";Bc();r8();ls();Ct();ho();Wn();lc();Vy();kt();$Eu();hIu();AIu();bIu();A4();IIu();xIu();wIu();OIu();kIu();uUe();WIu();ZMo();ZIu();Qme();zMo();evu();dLo();mLo();gLo();nvu();ALo();yLo();cvu();Tct();uvu();fvu();jGt()});var gp=h(()=>{"use strict";_Mo();uUe();YMo();Mct();kct();_Gt();ZMo();XEu();Qme();dvu();dLo();mLo();gLo();ALo();yLo();Tct();Fct();FGt();FWr();Oct()});var sCu=h(()=>{"use strict"});var w6o=h(()=>{"use strict";sCu()});var aCu=h(()=>{"use strict";w6o()});var cCu=h(()=>{"use strict"});var uCu=h(()=>{"use strict"});var T6o=h(()=>{"use strict";cCu();uCu()});var lCu=h(()=>{"use strict";T6o()});var pCu=h(()=>{"use strict"});var fCu=h(()=>{"use strict"});var dCu=h(()=>{"use strict"});var mCu,hCu=h(()=>{"use strict";mCu={None:"none",Header:"header"}});var gCu=h(()=>{"use strict"});var ACu=h(()=>{"use strict"});var yCu=h(()=>{"use strict"});var O6o=h(()=>{"use strict";pCu();fCu();dCu();hCu();gCu();ACu();yCu()});var bCu=h(()=>{"use strict";O6o()});var ECu=h(()=>{"use strict"});var ICu=h(()=>{"use strict"});var vCu=h(()=>{"use strict"});var CCu=h(()=>{"use strict"});var xCu=h(()=>{"use strict"});var SCu=h(()=>{"use strict"});var wCu=h(()=>{"use strict"});var TCu=h(()=>{"use strict"});var OCu=h(()=>{"use strict"});var PCu=h(()=>{"use strict"});var BCu=h(()=>{"use strict"});var RCu=h(()=>{"use strict"});var DCu=h(()=>{"use strict"});var P6o=h(()=>{"use strict";ECu();ICu();vCu();CCu();xCu();SCu();wCu();TCu();OCu();PCu();BCu();RCu();DCu()});var kCu=h(()=>{"use strict";P6o()});var FCu=h(()=>{"use strict";aCu();w6o();lCu();T6o();bCu();O6o();kCu();P6o()});var B6o=h(()=>{"use strict";FCu()});var YK,NCu,YGt,R6o,SUI,D6o=h(()=>{"use strict";YK={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},NCu={[YK.Debug]:1,[YK.Info]:2,[YK.Warn]:3,[YK.Error]:4},YGt=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},R6o=class{level;logger;silent;constructor(t){this.level=NCu[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=NCu[t]}isDebug(){return this.shouldLog(YK.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(YK.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(YK.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(YK.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},SUI=new R6o({level:YK.Info,logger:new YGt,silent:!0})});var jCu,zCu=h(()=>{"use strict";D6o();(function(e){e.LogLevel=YK,e.ConsoleLogger=YGt})(jCu||(jCu={}))});var QCu=h(()=>{"use strict";zCu()});var MCu=h(()=>{"use strict";QCu()});var LCu=h(()=>{"use strict"});var _Cu=h(()=>{"use strict";D6o()});var UCu=h(()=>{"use strict"});var ml,_w=h(()=>{"use strict";ml={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function jm(e,t){return`Expected ${t}. Received ${O0m(e)}.`}function O0m(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}var AN=h(()=>{"use strict"});function MT(e){return{...e,json:VCu(e.json),parse:VCu(e.parse)}}function VCu(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
507
+ ${JSON.stringify(r)}"`,code:T.Code.InternalError})}}function qEu(e,t,r,n){let i=r.resolveSourceOrThrow({source:t,relativeFilepath:e.relativeFilepath});if(i==null||i.type!=="protobuf")throw new T({message:`Expected a protobuf source for ${t.proto}.`,code:T.Code.ResolutionError});let o=_Eu({source:i,serviceNameOverride:n});if(o==null)throw new T({message:`Failed to resolve service name from ${i.relativeFilePath}.`,code:T.Code.IrConversionError});return MV.grpc({service:o})}var WEu=h(()=>{"use strict";ho();Wn();kt();UEu()});function HEu({rootDefaultUrl:e,rootPathParameters:t,serviceDefinition:r,file:n,errorResolver:i,typeResolver:o,propertyResolver:s,exampleResolver:a,variableResolver:c,sourceResolver:u,globalErrors:l,workspace:p,auth:d,irSettings:f}){let m=Lct({pathParameters:r["path-parameters"],location:Xt.PathParameterLocation.Service,file:n,variableResolver:c}),g=f.pathParameterOrder,A=(()=>{switch(g){case Hr.PathParameterOrder.UrlOrder:return r["base-path"]?_Wr(r["base-path"],m):m;case Hr.PathParameterOrder.SpecOrder:return m;default:Ee(g)}})(),y=VEu({file:n,serviceDeclaration:r,sourceResolver:u}),I={fernFilepath:n.fernFilepath};return{availability:iM(r.availability),name:I,displayName:r["display-name"]??void 0,basePath:eb(r["base-path"]),headers:r.headers!=null?Object.entries(r.headers).map(([v,S])=>s8({headerKey:v,header:S,file:n})):[],pathParameters:A,encoding:NAm(y,r),transport:y,endpoints:Object.entries(r.endpoints).map(([v,S])=>{let B=S["base-path"]!=null?(0,JWr.default)(S["base-path"],S.path):n.rootApiFile["base-path"]!=null?(0,JWr.default)(n.rootApiFile["base-path"],r["base-path"],S.path):(0,JWr.default)(r["base-path"],S.path),R=Lct({pathParameters:y4(S),location:Xt.PathParameterLocation.Endpoint,file:n,variableResolver:c}),D=(()=>{switch(g){case Hr.PathParameterOrder.UrlOrder:return _Wr(S.path,R);case Hr.PathParameterOrder.SpecOrder:return R;default:Ee(g)}})(),O=S["base-path"]!=null?D:[...t,...A,...D],z=(()=>{switch(g){case Hr.PathParameterOrder.UrlOrder:return _Wr(B,O);case Hr.PathParameterOrder.SpecOrder:return O;default:Ee(g)}})(),Y={...zT(S),id:"",name:n.casingsGenerator.generateName(v),displayName:S["display-name"],subtitle:S.subtitle,auth:typeof S.auth=="boolean"?S.auth:S.auth!=null?S.auth.length>0:r.auth??d.schemes.length>0,security:typeof S.auth>"u"||typeof S.auth=="boolean"?S.auth??(r.auth??d.schemes.length>0)===!0?bw._visit(d.requirement,{any:()=>d.schemes.map($=>({[$.key]:[]})),all:()=>[d.schemes.reduce(($,ee)=>({...$,[ee.key]:[]}),{})],endpointSecurity:()=>{},_other:()=>{}}):void 0:S.auth,docs:S.docs,idempotent:S.idempotent??r.idempotent??!1,baseUrl:S.url??r.url??e,v2BaseUrls:void 0,method:S.method!=null?FAm(S.method):Im.Post,basePath:S["base-path"]!=null?eb(S["base-path"]):void 0,path:eb(S.path),fullPath:eb(B),pathParameters:D,allPathParameters:z,queryParameters:typeof S.request!="string"&&S.request?.["query-parameters"]!=null?Object.entries(S.request["query-parameters"]).map(([$,ee])=>qWr({file:n,queryParameterKey:$,queryParameter:ee})):[],headers:typeof S.request!="string"&&S.request?.headers!=null?Object.entries(S.request.headers).map(([$,ee])=>s8({headerKey:$,header:ee,file:n})):[],requestBody:D0u({request:S.request,file:n}),v2RequestBodies:void 0,sdkRequest:z0u({service:r,request:S.request,endpoint:S,endpointKey:v,file:n,typeResolver:o,propertyResolver:s}),response:IEu({endpoint:S,file:n,typeResolver:o}),v2Responses:void 0,errors:[...zEu({errors:S.errors,file:n}),...l],userSpecifiedExamples:S.examples!=null?S.examples.map($=>{try{let ee=bEu({service:r,endpoint:S,example:$,typeResolver:o,errorResolver:i,exampleResolver:a,variableResolver:c,file:n,workspace:p});return ee===void 0?void 0:{example:ee,codeSamples:$["code-samples"]?.map(ae=>M0u({codeSample:ae,file:n}))}}catch{return}}).filter($=>$!==void 0):[],autogeneratedExamples:[],pagination:NEu({propertyResolver:s,file:n,endpointName:v,endpointSchema:S}),transport:GEu({file:n,serviceTransport:y,endpointDeclaration:S,sourceResolver:u}),v2Examples:void 0,source:void 0,audiences:S.audiences,retries:MEu({endpointSchema:S}),globalParameters:S["global-parameters"]??void 0,apiPlayground:void 0,responseHeaders:[]};return Y.id=Xu.generateEndpointId(I,Y),Y}),audiences:r.audiences}}function Lct({pathParameters:e,location:t,file:r,variableResolver:n}){return e==null?[]:Object.entries(e).map(([i,o])=>DAm({parameterName:i,parameter:o,location:t,file:r,variableResolver:n}))}function DAm({parameterName:e,parameter:t,location:r,file:n,variableResolver:i}){let o=typeof t!="string"&&"type"in t?t["client-default"]:void 0;return{...zT(t),name:n.casingsGenerator.generateName(e),valueType:kAm({parameter:t,variableResolver:i,file:n}),location:r,variable:Qfe(t)?i.getVariableIdOrThrow(typeof t=="string"?t:t.variable):void 0,clientDefault:NGt(o),v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},explode:void 0}}function kAm({parameter:e,variableResolver:t,file:r}){let n=VGt({parameter:e,variableResolver:t,file:r});return n.file.parseTypeReference(n.rawType)}function VGt({parameter:e,variableResolver:t,file:r}){let n=YWr({parameter:e,variableResolver:t,file:r});if(n==null)throw new T({message:"Cannot resolve path parameter",code:T.Code.InternalError});return n}function YWr({parameter:e,variableResolver:t,file:r}){if(Qfe(e)){let n=typeof e=="string"?e:e.variable,i=t.getDeclaration(n,r);return i==null?void 0:{rawType:typeof i.declaration=="string"?i.declaration:i.declaration.type,file:i.file}}else return{file:r,rawType:typeof e=="string"?e:e.type}}function FAm(e){switch(e){case"GET":return Im.Get;case"POST":return Im.Post;case"PUT":return Im.Put;case"PATCH":return Im.Patch;case"DELETE":return Im.Delete;case"HEAD":return Im.Head;default:Ee(e)}}function s8({headerKey:e,header:t,file:r}){let{name:n}=wre({headerKey:e,header:t}),i=typeof t!="string"?t["client-default"]:void 0,o=typeof t!="string"?t.default:void 0;return{...zT(t),name:r.casingsGenerator.generateNameAndWireValue({wireValue:e,name:n}),valueType:r.parseTypeReference(t),env:typeof t=="string"?void 0:t.env,clientDefault:NGt(i),defaultValue:o,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}}}}function wre({headerKey:e,header:t}){return typeof t!="string"&&t.name!=null?{name:t.name,wasExplicitlySet:!0}:{name:e,wasExplicitlySet:!1}}function NAm(e,t){switch(e.type){case"http":return{json:{},proto:void 0,xml:void 0};case"grpc":return{json:void 0,proto:{},xml:void 0};default:Ee(e)}}var JWr,uUe=h(()=>{"use strict";ls();Ct();ho();Wn();lc();kt();JWr=Ae(qf(),1);FGt();Q0u();A4();L0u();UMo();EEu();QMo();CEu();_Mo();jEu();Mct();QEu();LEu();WEu()});var KEu,JEu=h(()=>{"use strict";KEu="1.0.0"});function XWr(e){return e.type!=="container"?!1:e.container.type==="literal"||e.container.type==="optional"}var ZWr,$Wr,YEu=h(()=>{"use strict";r8();Ct();Wn();lc();kt();ZWr=Ae(qf(),1);JEu();$Wr=class{ir;casingsGenerator;fullCasingsGenerator;auth;authValues;generatorConfig;extendedTypeIds;constructor(t){this.ir=t.ir,this.generatorConfig=t.generatorConfig,this.casingsGenerator=Lw({generationLanguage:t.generationLanguage,smartCasing:t.smartCasing??t.ir.casingsConfig?.smartCasing??!0,smartCasingDigitWordBoundary:t.smartCasingDigitWordBoundary??t.ir.casingsConfig?.smartCasingDigitWordBoundary??!1,keywords:t.ir.casingsConfig?.keywords}),this.fullCasingsGenerator=dSe({generationLanguage:t.generationLanguage,smartCasing:t.smartCasing??t.ir.casingsConfig?.smartCasing??!0,smartCasingDigitWordBoundary:t.smartCasingDigitWordBoundary??t.ir.casingsConfig?.smartCasingDigitWordBoundary??!1,keywords:t.ir.casingsConfig?.keywords}),this.auth=this.convertAuth(this.ir.auth),this.authValues=this.getAuthValues(this.ir.auth),this.extendedTypeIds=this.computeExtendedTypeIds()}inflateName(t){return typeof t=="string"?this.fullCasingsGenerator.generateName(t):t}inflateNameAndWireValue(t){return typeof t=="string"?this.fullCasingsGenerator.generateNameAndWireValue(t):{wireValue:t.wireValue,name:this.inflateName(t.name)}}inflateFernFilepath(t){return{allParts:t.allParts.map(r=>this.inflateName(r)),packagePath:t.packagePath.map(r=>this.inflateName(r)),file:t.file!=null?this.inflateName(t.file):void 0}}computeExtendedTypeIds(){let t=new Set;for(let r of Object.values(this.ir.types))if(r.shape.type==="object")for(let n of r.shape.extends)t.add(n.typeId);return t}convert({disableExamples:t}){return{version:KEu,types:this.convertNamedTypes(),headers:this.convertHeaders(),endpoints:this.convertEndpoints({disableExamples:t}),pathParameters:this.convertPathParameters({pathParameters:this.ir.pathParameters}),environments:this.ir.environments!=null?this.convertEnvironments(this.ir.environments):void 0,variables:this.convertVariables(),globalParameters:this.ir.globalParameters,generatorConfig:this.generatorConfig}}convertNamedTypes(){return Object.fromEntries(Object.entries(this.ir.types).map(([t,r])=>[t,this.convertTypeDeclaration(r)]))}convertHeaders(){return this.convertWireValueParameters({wireValueParameters:this.ir.headers})}convertVariables(){if(this.ir.variables.length!==0)return this.ir.variables.map(t=>({id:t.id,name:this.inflateName(t.name),typeReference:this.convertTypeReference(t.type)}))}convertEndpoints({disableExamples:t}){let r=this.getAllHttpEndpoints();return Object.fromEntries(r.map(n=>[n.id,this.convertEndpoint({endpoint:n,disableExamples:t})]))}convertEndpoint({endpoint:t,disableExamples:r}){let n=this.convertEndpointLocation({endpoint:t});return{auth:this.auth,declaration:this.convertDeclaration({name:t.name,fernFilepath:t.fernFilepath}),location:n,request:this.convertRequest({endpoint:t}),response:t.response?.body?._visit({json:()=>sr.Response.json(),streaming:()=>sr.Response.streaming(),streamParameter:()=>sr.Response.streamParameter(),fileDownload:()=>sr.Response.fileDownload(),text:()=>sr.Response.text(),bytes:()=>sr.Response.bytes(),_other:()=>sr.Response.json()})??sr.Response.json(),hasResponseBody:t.response?.body!=null,examples:r?void 0:this.getEndpointSnippetRequests({endpoint:t,location:n})}}convertRequest({endpoint:t}){let r=this.convertPathParameters({pathParameters:[...t.servicePathParameters,...t.pathParameters]});if(t.sdkRequest==null&&t.requestBody==null)return sr.Request.body({pathParameters:r,body:void 0,bodyRequired:void 0});if(t.sdkRequest==null)throw new T({message:`Internal error; endpoint "${t.id}" has a request body but no SDK request`,code:T.Code.InternalError});switch(t.sdkRequest.shape.type){case"justRequestBody":return sr.Request.body({pathParameters:r,body:this.convertReferencedRequestBodyType({body:t.sdkRequest.shape.value}),bodyRequired:t.requestBody?.type==="reference"?t.requestBody.required:void 0});case"wrapper":return this.convertInlinedRequest({fernFilepath:t.fernFilepath,wrapper:t.sdkRequest.shape,pathParameters:r,queryParameters:this.convertQueryParameters({queryParameters:t.queryParameters}),headers:this.convertWireValueParameters({wireValueParameters:[...t.serviceHeaders,...t.headers]}),body:t.requestBody});default:Ee(t.sdkRequest.shape)}}convertReferencedRequestBodyType({body:t}){switch(t.type){case"bytes":return sr.ReferencedRequestBodyType.bytes();case"typeReference":return sr.ReferencedRequestBodyType.typeReference(this.convertTypeReference(t.requestBodyType));default:Ee(t)}}convertInlinedRequest({fernFilepath:t,wrapper:r,pathParameters:n,queryParameters:i,headers:o,body:s}){return sr.Request.inlined({declaration:this.convertDeclaration({name:r.wrapperName,fernFilepath:t}),pathParameters:n,queryParameters:i,headers:o,body:s!=null?this.convertInlinedRequestBody({wrapper:r,body:s}):void 0,metadata:this.convertInlinedRequestMetadata({wrapper:r})})}convertInlinedRequestMetadata({wrapper:t}){return{includePathParameters:t.includePathParameters??!1,onlyPathParameters:t.onlyPathParameters??!1}}convertInlinedRequestBody({wrapper:t,body:r}){switch(r.type){case"inlinedRequestBody":{let n=[...r.extendedProperties??[],...r.properties];return sr.InlinedRequestBody.properties(this.convertBodyPropertiesToParameters({properties:n}))}case"reference":return sr.InlinedRequestBody.referenced({bodyKey:this.inflateName(t.bodyKey),bodyType:sr.ReferencedRequestBodyType.typeReference(this.convertTypeReference(r.requestBodyType))});case"bytes":return sr.InlinedRequestBody.referenced({bodyKey:this.inflateName(t.bodyKey),bodyType:sr.ReferencedRequestBodyType.bytes()});case"fileUpload":return this.convertFileUploadRequestBody({properties:r.properties});default:Ee(r)}}convertFileUploadRequestBody({properties:t}){return sr.InlinedRequestBody.fileUpload({properties:this.convertFileUploadRequestBodyProperties({properties:t})})}convertFileUploadRequestBodyProperties({properties:t}){return t.map(r=>{switch(r.type){case"file":return this.convertFileUploadRequestBodyFileProperty({fileProperty:r.value});case"bodyProperty":return sr.FileUploadRequestBodyProperty.bodyProperty({name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:r.propertyAccess,variable:void 0});default:Ee(r)}})}convertFileUploadRequestBodyFileProperty({fileProperty:t}){let r=t.key,n=typeof r=="string"?{wireValue:r,name:this.fullCasingsGenerator.generateName(r)}:{wireValue:r.wireValue,name:this.fullCasingsGenerator.generateName(r.name)};switch(t.type){case"file":return sr.FileUploadRequestBodyProperty.file({...n,isOptional:t.isOptional});case"fileArray":return sr.FileUploadRequestBodyProperty.fileArray({...n,isOptional:t.isOptional});default:Ee(t)}}getAuthWrapperProperty(t,r){switch(t.requirement){case"ANY":case"ENDPOINT_SECURITY":return this.fullCasingsGenerator.generateName(r.key);case"ALL":return;default:Ee(t.requirement)}}convertPathParameters({pathParameters:t}){return t.map(r=>({name:{name:this.inflateName(r.name),wireValue:Vr(r.name)},typeReference:this.convertTypeReference(r.valueType),propertyAccess:void 0,variable:r.variable}))}convertBodyPropertiesToParameters({properties:t}){return t.map(r=>({name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:r.propertyAccess,variable:void 0}))}convertWireValueParameters({wireValueParameters:t}){return t.map(r=>({name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:void 0,variable:void 0}))}convertQueryParameters({queryParameters:t}){let r=[];for(let n of t){let i=this.convertTypeReference(n.valueType);n.allowMultiple&&(i=sr.TypeReference.list(i)),r.push({name:this.inflateNameAndWireValue(n.name),typeReference:i,propertyAccess:void 0,variable:void 0})}return r}convertTypeReference(t){switch(t.type){case"container":return this.convertContainerType(t.container);case"named":return this.convertNamedType(t);case"primitive":return this.convertPrimitiveType(t.primitive);case"unknown":return this.convertUnknownType();default:Ee(t)}}convertContainerType(t){switch(t.type){case"list":return sr.TypeReference.list(this.convertTypeReference(t.list));case"map":return sr.TypeReference.map({key:this.convertTypeReference(t.keyType),value:this.convertTypeReference(t.valueType)});case"optional":return sr.TypeReference.optional(this.convertTypeReference(t.optional));case"nullable":return sr.TypeReference.nullable(this.convertTypeReference(t.nullable));case"set":return sr.TypeReference.set(this.convertTypeReference(t.set));case"literal":return sr.TypeReference.literal(this.convertLiteral(t.literal));default:Ee(t)}}convertNamedType(t){return sr.TypeReference.named(t.typeId)}convertTypeDeclaration(t){let r=this.convertDeclaration(t.name);switch(t.shape.type){case"alias":return this.convertAlias({declaration:r,alias:t.shape});case"enum":return this.convertEnum({declaration:r,enum_:t.shape});case"object":return this.convertObject({declaration:r,object:t.shape,typeId:t.name.typeId});case"union":return this.convertDiscriminatedUnion({declaration:r,union:t.shape});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({declaration:r,union:t.shape});default:Ee(t.shape)}}convertAlias({declaration:t,alias:r}){return sr.NamedType.alias({declaration:t,typeReference:this.convertTypeReference(r.aliasOf)})}convertEnum({declaration:t,enum_:r}){return sr.NamedType.enum({declaration:t,values:r.values.map(n=>this.inflateNameAndWireValue(n.name))})}convertObject({declaration:t,object:r,typeId:n}){let o=this.extendedTypeIds.has(n)?[...r.properties,...r.extendedProperties??[]]:[...r.extendedProperties??[],...r.properties],s=r.extends.length>0?r.extends.map(a=>a.typeId):void 0;return this.convertObjectProperties({declaration:t,properties:o,extends_:s,additionalProperties:r.extraProperties,deferredUnionBaseProperties:r.deferredUnionBaseProperties})}convertObjectProperties({declaration:t,properties:r,extends_:n,additionalProperties:i,deferredUnionBaseProperties:o}){return sr.NamedType.object({declaration:t,properties:this.convertBodyPropertiesToParameters({properties:r}),extends:n,additionalProperties:i,deferredUnionBaseProperties:o?.map(s=>this.inflateNameAndWireValue(s))})}convertDiscriminatedUnion({declaration:t,union:r}){let n=[...this.resolveProperties(r.extends),...r.baseProperties];return sr.NamedType.discriminatedUnion({declaration:t,discriminant:this.inflateNameAndWireValue(r.discriminant),inheritedBaseProperties:(r.inheritedBaseProperties??[]).map(i=>this.inflateNameAndWireValue(i)),types:Object.fromEntries(r.types.map(i=>[ar(i.discriminantValue),this.convertDiscriminatedUnionType({inheritedProperties:n,discriminantValue:i.discriminantValue,singleUnionTypeProperties:i.shape})]))})}convertDiscriminatedUnionType({inheritedProperties:t,discriminantValue:r,singleUnionTypeProperties:n}){switch(n.propertiesType){case"samePropertiesAsObject":return this.convertDiscriminatedUnionTypeObject({inheritedProperties:t,discriminantValue:r,declaredTypeName:n});case"singleProperty":return this.convertDiscriminatedUnionTypeSingleProperty({inheritedProperties:t,discriminantValue:r,singleUnionTypeProperty:n});case"noProperties":return this.convertDiscriminatedUnionTypeNoProperties({inheritedProperties:t,discriminantValue:r});default:Ee(n)}}convertDiscriminatedUnionTypeObject({inheritedProperties:t,discriminantValue:r,declaredTypeName:n}){return sr.SingleDiscriminatedUnionType.samePropertiesAsObject({typeId:n.typeId,discriminantValue:this.inflateNameAndWireValue(r),properties:this.convertBodyPropertiesToParameters({properties:t})})}convertDiscriminatedUnionTypeSingleProperty({inheritedProperties:t,discriminantValue:r,singleUnionTypeProperty:n}){return sr.SingleDiscriminatedUnionType.singleProperty({typeReference:this.convertTypeReference(n.type),discriminantValue:this.inflateNameAndWireValue(r),properties:t.length>0?this.convertBodyPropertiesToParameters({properties:t}):void 0})}convertDiscriminatedUnionTypeNoProperties({inheritedProperties:t,discriminantValue:r}){return sr.SingleDiscriminatedUnionType.noProperties({discriminantValue:this.inflateNameAndWireValue(r),properties:t.length>0?this.convertBodyPropertiesToParameters({properties:t}):void 0})}convertUndiscriminatedUnion({declaration:t,union:r}){return sr.NamedType.undiscriminatedUnion({declaration:t,types:r.members.map(n=>this.convertTypeReference(n.type))})}convertLiteral(t){switch(t.type){case"boolean":return sr.LiteralType.boolean(t.boolean);case"string":return sr.LiteralType.string(t.string);default:Ee(t)}}convertPrimitiveType(t){return sr.TypeReference.primitive(t.v1)}convertUnknownType(){return sr.TypeReference.unknown()}convertAuth(t){if(t.schemes[0]==null)return;let r=t.schemes[0],n=this.getAuthWrapperProperty(t,r),i=t.requirement;switch(r.type){case"basic":{let o={wrapperProperty:n,requirement:i,username:this.inflateName(r.username),usernameOmit:r.usernameOmit,password:this.inflateName(r.password),passwordOmit:r.passwordOmit};return sr.Auth.basic(o)}case"bearer":{let o={wrapperProperty:n,requirement:i,token:this.inflateName(r.token)};return sr.Auth.bearer(o)}case"header":{let o={wrapperProperty:n,requirement:i,header:{name:this.inflateNameAndWireValue(r.name),typeReference:this.convertTypeReference(r.valueType),propertyAccess:void 0,variable:void 0}};return sr.Auth.header(o)}case"oauth":{let o=this.getOAuthCustomProperties(r),s={wrapperProperty:n,requirement:i,clientId:this.fullCasingsGenerator.generateName("clientId"),clientSecret:this.fullCasingsGenerator.generateName("clientSecret"),customProperties:o.length>0?o:void 0};return sr.Auth.oauth(s)}case"inferred":{let o={wrapperProperty:n,requirement:i,parameters:this.getInferredAuthParameters(r)};return sr.Auth.inferred(o)}default:Ee(r)}}getAuthValues(t){let r=t.schemes[0];if(r!=null)switch(r.type){case"bearer":return sr.AuthValues.bearer({token:r.tokenPlaceholder??"<token>"});case"basic":return sr.AuthValues.basic({username:r.usernameOmit?"":r.usernamePlaceholder??"<username>",password:r.passwordOmit?"":r.passwordPlaceholder??"<password>"});case"header":return sr.AuthValues.header({value:r.headerPlaceholder??"<value>"});case"oauth":{let n=this.getOAuthCustomPropertyValues(r);return sr.AuthValues.oauth({clientId:"<clientId>",clientSecret:"<clientSecret>",customPropertyValues:Object.keys(n).length>0?n:void 0})}case"inferred":return sr.AuthValues.inferred({values:this.getInferredAuthValues(r)});default:Ee(r)}}getInferredAuthParameters(t){let r=[],n=Object.values(this.ir.services).flatMap(i=>i.endpoints).find(i=>i.id===t.tokenEndpoint.endpoint.endpointId);if(n==null)return r;for(let i of n.headers)(i.valueType.type!=="container"||i.valueType.container.type!=="literal")&&r.push({name:this.inflateNameAndWireValue(i.name),typeReference:this.convertTypeReference(i.valueType),propertyAccess:void 0,variable:void 0});if(n.requestBody!=null){let i=this.getInferredAuthRequestBodyProperties(t,n.requestBody);for(let o of i)(o.valueType.type!=="container"||o.valueType.container.type!=="literal")&&r.push({name:this.inflateNameAndWireValue(o.name),typeReference:this.convertTypeReference(o.valueType),propertyAccess:void 0,variable:void 0})}return r}getInferredAuthValues(t){let r={},n=Object.values(this.ir.services).flatMap(i=>i.endpoints).find(i=>i.id===t.tokenEndpoint.endpoint.endpointId);if(n==null)return r;for(let i of n.headers)if(i.valueType.type!=="container"||i.valueType.container.type!=="literal"){let o=ar(i.name);r[o]=o}if(n.requestBody!=null){let i=this.getInferredAuthRequestBodyProperties(t,n.requestBody);for(let o of i)if(o.valueType.type!=="container"||o.valueType.container.type!=="literal"){let s=ar(o.name);r[s]=s}}return r}getInferredAuthRequestBodyProperties(t,r){let n=this.getRequestBodyProperties(r),i=t.tokenEndpoint.grantType?.requestProperty;if(i==null||i.property.type!=="body"||(i.propertyPath?.length??0)>0)return n;let o=ar(i.property.name);return n.filter(s=>ar(s.name)!==o)}getRequestBodyProperties(t){let r=[];if(t.type==="inlinedRequestBody")r.push(...t.properties);else if(t.type==="reference"){let n=t.requestBodyType;if(n.type==="named"){let i=this.ir.types[n.typeId];i!=null&&i.shape.type==="object"&&r.push(...i.shape.properties)}}return r}getOAuthCustomProperties(t){let r=[];if(t.configuration.type!=="clientCredentials")return r;let n=t.configuration.tokenEndpoint.requestProperties.customProperties??[];for(let o of n)XWr(o.property.valueType)||r.push({name:this.inflateNameAndWireValue(o.property.name),typeReference:this.convertTypeReference(o.property.valueType),propertyAccess:void 0,variable:void 0});let i=t.configuration.tokenEndpoint.requestProperties.scopes;return i!=null&&!XWr(i.property.valueType)&&r.push({name:this.inflateNameAndWireValue(i.property.name),typeReference:this.convertTypeReference(i.property.valueType),propertyAccess:void 0,variable:void 0}),r}getOAuthCustomPropertyValues(t){let r={};if(t.configuration.type!=="clientCredentials")return r;let n=t.configuration.tokenEndpoint.requestProperties.customProperties??[];for(let o of n){if(XWr(o.property.valueType))continue;let s=ar(o.property.name);r[s]=`<${s}>`}let i=t.configuration.tokenEndpoint.requestProperties.scopes;if(i!=null&&!XWr(i.property.valueType)){let o=ar(i.property.name);r[o]=`<${o}>`}return r}convertEnvironments(t){return{defaultEnvironment:t.defaultEnvironment,environments:t.environments._visit({singleBaseUrl:r=>sr.Environments.singleBaseUrl({environments:r.environments.map(n=>({docs:n.docs,id:n.id,name:this.inflateName(n.name),url:n.url}))}),multipleBaseUrls:r=>sr.Environments.multipleBaseUrls({baseUrls:r.baseUrls.map(n=>({id:n.id,name:this.inflateName(n.name)})),environments:r.environments.map(n=>({docs:n.docs,id:n.id,name:this.inflateName(n.name),urls:n.urls}))}),_other:()=>{throw new T({message:"Unknown environments type",code:T.Code.InternalError})}})}}convertDeclaration({name:t,fernFilepath:r}){return{name:this.inflateName(t),fernFilepath:this.inflateFernFilepath(r)}}convertEndpointLocation({endpoint:t}){return{method:t.method,path:this.getFullPathForEndpoint(t)}}getAllHttpEndpoints(){return Object.values(this.ir.services).flatMap(t=>t.endpoints.map(r=>({...r,servicePathParameters:t.pathParameters,serviceHeaders:t.headers,fernFilepath:t.name.fernFilepath})))}resolveProperties(t){let r=[];for(let n of t){let i=this.resolveObjectTypeOrThrow(n.typeId);r.push(...this.resolveProperties(i.extends)),r.push(...i.properties)}return Object.values(r)}resolveObjectTypeOrThrow(t){let r=this.ir.types[t];if(r==null)throw new T({message:`Internal error; type "${t}" not found`,code:T.Code.InternalError});if(r.shape.type!=="object")throw new T({message:`Internal error; type "${t}" is not an object`,code:T.Code.InternalError});return r.shape}getFullPathForEndpoint(t){let r="";t.fullPath.head.length>0&&(r=(0,ZWr.default)(r,t.fullPath.head));for(let n of t.fullPath.parts)r=(0,ZWr.default)(r,"{"+n.pathParameter+"}"),n.tail.length>0&&(r=(0,ZWr.default)(r,n.tail));return r.startsWith("/")?r:`/${r}`}getGlobalHeaderExampleValues(){let t={};for(let r of this.ir.headers){if(r.valueType.type==="container"&&r.valueType.container.type==="literal"||r.valueType.type==="container"&&r.valueType.container.type==="optional")continue;let n=ar(r.name);t[n]=`<${n}>`}return t}getEndpointSnippetRequests({endpoint:t,location:r}){let n=[],i=[...t.userSpecifiedExamples.map((o,s)=>({example:o,isUserSpecified:!0,index:s})),...t.autogeneratedExamples.map((o,s)=>({example:o,isUserSpecified:!1,index:s}))];for(let{example:o,isUserSpecified:s,index:a}of i){let c=new Set;[...this.ir.pathParameters,...t.pathParameters].forEach(p=>{p.variable!=null&&c.add(Vr(p.name))});let u=[...o.example?.rootPathParameters??[],...o.example?.servicePathParameters??[],...o.example?.endpointPathParameters??[]].filter(p=>!c.has(Vr(p.name))),l=`${t.id}-${s?"user":"auto"}-${a}`;n.push({id:o?.example?.id??l,name:o?.example?.name!=null?Vr(o.example.name):void 0,isUserSpecified:s,endpoint:r,baseUrl:void 0,environment:void 0,auth:this.authValues,headers:{...this.getGlobalHeaderExampleValues(),...Object.fromEntries([...o.example?.serviceHeaders??[],...o.example?.endpointHeaders??[]].map(p=>[ar(p.name),p.value.jsonExample]))},pathParameters:Object.fromEntries(u.map(p=>[Vr(p.name),p.value.jsonExample])),queryParameters:Object.fromEntries([...o.example?.queryParameters??[]].map(p=>[ar(p.name),p.value.jsonExample])),requestBody:o.example?.request?.jsonExample})}return n}}});function lUe({ir:e,generationLanguage:t,smartCasing:r,smartCasingDigitWordBoundary:n,disableExamples:i,generatorConfig:o}){return new $Wr({ir:e,generationLanguage:t,smartCasing:r,smartCasingDigitWordBoundary:n,generatorConfig:o}).convert({disableExamples:i})}var ZMo=h(()=>{"use strict";YEu()});var UD={};te(UD,{validateObjectExample:()=>cUe,validateTypeExample:()=>VWr,validateTypeReferenceExample:()=>QT});var XEu=h(()=>{"use strict";UWr();WMo();aUe()});function ZEu(e){return{errorInstanceIdKey:e.generateNameAndWireValue({wireValue:"errorInstanceId",name:"errorInstanceId"})}}var $Eu=h(()=>{"use strict"});var e7r,$Mo=h(()=>{"use strict";lc();e7r=e=>{let t=h4(e.file.fernFilepath),r=e.endpointId;return`endpoint_${t}.${r}`}});function t7r({fernFilePath:e}){return e.packagePath.length===0&&e.file==null}var eLo=h(()=>{"use strict"});function r7r({resolvedEndpoint:e}){return{endpointId:e7r(e),serviceId:Xu.generateServiceIdFromFernFilepath(e.file.fernFilepath),subpackageId:t7r({fernFilePath:e.file.fernFilepath})?void 0:Xu.generateSubpackageId(e.file.fernFilepath)}}var tLo=h(()=>{"use strict";lc();$Mo();eLo()});function eIu({endpointResolver:e,propertyResolver:t,file:r,refreshTokenEndpoint:n}){let i=e.resolveEndpointOrThrow({endpoint:n.endpoint,file:r}),o;try{o=n.responseProperties.expires_in!=null?t.resolveResponsePropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.responseProperties.expires_in}):void 0}catch{}return{endpointReference:{endpointId:e7r(i),serviceId:Xu.generateServiceIdFromFernFilepath(i.file.fernFilepath),subpackageId:t7r({fernFilePath:i.file.fernFilepath})?void 0:Xu.generateSubpackageId(i.file.fernFilepath)},requestProperties:{refreshToken:t.resolveRequestPropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.requestProperties.refresh_token})},responseProperties:{accessToken:t.resolveResponsePropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.responseProperties.access_token}),expiresIn:o,refreshToken:n.responseProperties.refresh_token!=null?t.resolveResponsePropertyOrThrow({file:r,endpoint:n.endpoint,propertyComponents:n.responseProperties.refresh_token}):void 0}}}var tIu=h(()=>{"use strict";lc();$Mo();eLo()});function rIu({endpointResolver:e,propertyResolver:t,typeResolver:r,file:n,tokenEndpoint:i}){let o=e.resolveEndpointOrThrow({endpoint:i.endpoint,file:n}),s=zAm({endpoint:o.endpoint,file:o.file,typeResolver:r}),a;try{a=i.responseProperties.expires_in!=null?t.resolveResponsePropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.responseProperties.expires_in}):void 0}catch{}return{endpointReference:r7r({resolvedEndpoint:o}),requestProperties:{clientId:t.resolveRequestPropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.requestProperties.client_id}),clientSecret:t.resolveRequestPropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.requestProperties.client_secret}),scopes:i.requestProperties.scopes!=null?t.resolveRequestPropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.requestProperties.scopes}):void 0,customProperties:jAm({requestBodyPropertyNames:s,tokenEndpoint:i,file:n,propertyResolver:t})},responseProperties:{accessToken:t.resolveResponsePropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.responseProperties.access_token}),expiresIn:a,refreshToken:i.responseProperties.refresh_token!=null?t.resolveResponsePropertyOrThrow({file:n,endpoint:i.endpoint,propertyComponents:i.responseProperties.refresh_token}):void 0}}}function zAm({endpoint:e,file:t,typeResolver:r}){let n=e.request;if(n==null)return[];if(typeof n=="string")return n7r({typeName:n,file:t,typeResolver:r});let i=n.body;if(i==null)return[];if(typeof i=="string")return n7r({typeName:i,file:t,typeResolver:r});if(nA(i)){let o=Object.keys(i.properties??{});if(i.extends!=null){let s=typeof i.extends=="string"?[i.extends]:i.extends;for(let a of s)o.push(...n7r({typeName:a,file:t,typeResolver:r}))}return o}return n7r({typeName:i.type,file:t,typeResolver:r})}function n7r({typeName:e,file:t,typeResolver:r}){let n=r.resolveType({type:e,file:t});if(n==null||n._type!=="named")return[];let i=n.declaration,o=[];return"properties"in i&&i.properties!=null&&o.push(...Object.keys(i.properties)),"base-properties"in i&&i["base-properties"]!=null&&o.push(...Object.keys(i["base-properties"])),o}var jAm,nIu=h(()=>{"use strict";ho();tLo();jAm=({requestBodyPropertyNames:e,tokenEndpoint:t,file:r,propertyResolver:n})=>{let i=e.filter(o=>!t.requestProperties.client_id.includes(o)&&!t.requestProperties.client_secret.includes(o)&&(t.requestProperties.scopes==null||!t.requestProperties.scopes.includes(o)));return i.length>0?i.map(o=>n.resolveRequestPropertyOrThrow({file:r,endpoint:t.endpoint,propertyComponents:[o]})):void 0}});function iIu({propertyResolver:e,endpointResolver:t,typeResolver:r,file:n,oauthScheme:i,tokenEndpoint:o,refreshTokenEndpoint:s}){let a=rIu({propertyResolver:e,endpointResolver:t,typeResolver:r,file:n,tokenEndpoint:o});if(a==null)throw new T({message:"Failed to convert OAuth token endpoint.",code:T.Code.IrConversionError});let c=s!=null?eIu({propertyResolver:e,endpointResolver:t,file:n,refreshTokenEndpoint:s}):void 0;return{clientIdEnvVar:i["client-id-env"],clientSecretEnvVar:i["client-secret-env"],tokenPrefix:i["token-prefix"],tokenHeader:i["token-header"],scopes:i.scopes,tokenEndpoint:a,refreshEndpoint:c}}var oIu=h(()=>{"use strict";kt();tIu();nIu()});function sIu(e){let t=e["get-token"];if(t==null)throw new Error("OAuth client-credentials flow is missing the required `get-token` endpoint");return{endpoint:t.endpoint,requestProperties:QAm({requestProperties:t["request-properties"]}),responseProperties:MAm({responseProperties:t["response-properties"]})}}function aIu(e){if(e["refresh-token"]!=null)return{endpoint:e["refresh-token"].endpoint,requestProperties:LAm({requestProperties:e["refresh-token"]?.["request-properties"]}),responseProperties:_Am({responseProperties:e["refresh-token"]?.["response-properties"]})}}function QAm({requestProperties:e}){if(e==null)return GGt.requestProperties;let t=e["client-id"],r=e["client-secret"],n=e.scopes;return{type:"access_token",client_id:t!=null?KK(t):GGt.requestProperties.client_id,client_secret:r!=null?KK(r):GGt.requestProperties.client_secret,scopes:n!=null?KK(n):GGt.requestProperties.scopes}}function MAm({responseProperties:e}){return cIu({responseProperties:e,defaultValue:GGt.responseProperties})}function LAm({requestProperties:e}){if(e==null)return rLo.requestProperties;let t=e["refresh-token"];return{type:"refresh_token",refresh_token:t!=null?KK(t):rLo.requestProperties.refresh_token}}function _Am({responseProperties:e}){return cIu({responseProperties:e,defaultValue:rLo.responseProperties})}function cIu({responseProperties:e,defaultValue:t}){if(e==null)return t;let r=e["access-token"],n=e["expires-in"],i=e["refresh-token"];return{type:"access_token",access_token:r!=null?UB(r):t.access_token,expires_in:n!=null?UB(n):t.expires_in,refresh_token:i!=null?UB(i):t.refresh_token}}var GGt,rLo,uIu=h(()=>{"use strict";Bct();GGt={requestProperties:{type:"access_token",client_id:["client_id"],client_secret:["client_secret"],scopes:void 0},responseProperties:{type:"access_token",access_token:["access_token"],expires_in:["expires_in"],refresh_token:void 0}},rLo={requestProperties:{type:"refresh_token",refresh_token:["refresh_token"]},responseProperties:{type:"access_token",access_token:["access_token"],refresh_token:void 0,expires_in:["expires_in"]}}});function mIu({rawApiFileSchema:e,file:t,propertyResolver:r,endpointResolver:n,typeResolver:i}){if(e.auth==null)return{docs:void 0,requirement:bw.All,schemes:[]};let o=typeof e.auth!="string"?e.auth.docs:void 0;return jfe(e.auth,{single:s=>{let a=nLo({reference:s,authSchemeDeclarations:e["auth-schemes"],file:t,propertyResolver:r,endpointResolver:n,typeResolver:i});return{docs:o,requirement:bw.All,schemes:[a]}},any:({any:s})=>({docs:o,requirement:bw.Any,schemes:s.map(a=>nLo({reference:a,authSchemeDeclarations:e["auth-schemes"],file:t,propertyResolver:r,endpointResolver:n,typeResolver:i}))}),endpointSecurity:()=>({docs:o,requirement:bw.EndpointSecurity,schemes:Object.keys(e["auth-schemes"]??{}).map(s=>nLo({reference:s,authSchemeDeclarations:e["auth-schemes"],file:t,propertyResolver:r,endpointResolver:n,typeResolver:i}))})})}function nLo({reference:e,authSchemeDeclarations:t,file:r,propertyResolver:n,endpointResolver:i,typeResolver:o}){let s=(c,u)=>{let l=t?.[c];if(l==null)throw new T({message:"Unknown auth scheme: "+c,code:T.Code.ReferenceError});let p=u??(typeof l=="object"?l.docs:void 0),d=typeof l=="object"?l["playground-docs"]:void 0;return zfe(l,{header:f=>Mp.header({key:c,docs:p,playgroundDocs:d,name:r.casingsGenerator.generateNameAndWireValue({name:f.name??c,wireValue:f.header}),valueType:r.parseTypeReference(f.type??"string"),prefix:f.prefix,headerEnvVar:f.env,headerPlaceholder:f.placeholder}),basic:f=>pIu({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f}),tokenBearer:f=>lIu({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f}),inferredBearer:f=>GAm({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f,propertyResolver:n,endpointResolver:i}),oauth:f=>fIu({key:c,file:r,docs:p,playgroundDocs:d,rawScheme:f,propertyResolver:n,endpointResolver:i,typeResolver:o})})},a=typeof e=="string"?e:e.scheme;if(t?.[a]!=null)return s(a,typeof e!="string"?e.docs:void 0);switch(a){case"bearer":return lIu({key:a,file:r,docs:void 0,playgroundDocs:void 0,rawScheme:void 0});case"basic":return pIu({key:a,file:r,docs:void 0,playgroundDocs:void 0,rawScheme:void 0});case"oauth":return fIu({key:a,file:r,docs:void 0,playgroundDocs:void 0,rawScheme:void 0,propertyResolver:n,endpointResolver:i,typeResolver:o});default:return s(a,typeof e!="string"?e.docs:void 0)}}function lIu({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i}){return Mp.bearer({key:e,docs:r,playgroundDocs:n,token:t.casingsGenerator.generateName(i?.token?.name??"token"),tokenEnvVar:i?.token?.env,tokenPlaceholder:i?.token?.placeholder})}function pIu({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i}){return Mp.basic({key:e,docs:r,playgroundDocs:n,username:t.casingsGenerator.generateName(i?.username?.name??"username"),usernameEnvVar:i?.username?.env,usernameOmit:i?.username?.omit,usernamePlaceholder:i?.username?.placeholder,password:t.casingsGenerator.generateName(i?.password?.name??"password"),passwordEnvVar:i?.password?.env,passwordOmit:i?.password?.omit,passwordPlaceholder:i?.password?.placeholder})}function fIu({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i,propertyResolver:o,endpointResolver:s,typeResolver:a}){switch(i?.type){case"client-credentials":return Mp.oauth({key:e,docs:r,playgroundDocs:n,configuration:sD.clientCredentials(iIu({propertyResolver:o,endpointResolver:s,typeResolver:a,file:t,oauthScheme:i,tokenEndpoint:sIu(i),refreshTokenEndpoint:aIu(i)}))});case"authorization-code":return Mp.oauth({key:e,docs:r,playgroundDocs:n,configuration:sD.authorizationCode({clientId:dIu(i),authorizationUrl:i7r(i,"authorization-url"),tokenUrl:i7r(i,"token-url"),refreshUrl:i["refresh-url"],redirectUri:UAm(i["redirect-uri"]),redirectUriBackupPorts:VAm(i["redirect-uri"]),successRedirectUrl:i["success-redirect-url"],errorRedirectUrl:i["error-redirect-url"],scopes:i.scopes,pkce:{method:tLt.S256},authorizationParameters:i["authorization-parameters"],tokenParameters:i["token-parameters"],refreshParameters:i["refresh-parameters"],tokenHeader:i["token-header"],tokenPrefix:i["token-prefix"]})});case"device-code":return Mp.oauth({key:e,docs:r,playgroundDocs:n,configuration:sD.deviceCode({clientId:dIu(i),deviceAuthorizationUrl:i7r(i,"device-authorization-url"),tokenUrl:i7r(i,"token-url"),refreshUrl:i["refresh-url"],scopes:i.scopes,deviceAuthorizationParameters:i["device-authorization-parameters"],tokenParameters:i["token-parameters"],refreshParameters:i["refresh-parameters"],tokenHeader:i["token-header"],tokenPrefix:i["token-prefix"]})});default:throw new T({message:`Unknown OAuth type: '${i?.type}'`,code:T.Code.ValidationError})}}function dIu(e){let t=e["client-id-env"];return e["client-id"]==null&&t!=null?RH.environmentVariable(t):RH.literal(e["client-id"]??"")}function UAm(e){if(e!=null)return typeof e=="string"?e:e.url}function VAm(e){if(!(e==null||typeof e=="string"))return e.ports}function i7r(e,t){let r=e[t];if(typeof r!="string")throw new T({message:`OAuth ${e.type} flow is missing required field '${t}'`,code:T.Code.ValidationError});return r}function GAm({key:e,file:t,docs:r,playgroundDocs:n,rawScheme:i,propertyResolver:o,endpointResolver:s}){return Mp.inferred({key:e,docs:r,playgroundDocs:n,tokenEndpoint:qAm({file:t,rawScheme:i,propertyResolver:o,endpointResolver:s})})}function qAm({file:e,rawScheme:t,propertyResolver:r,endpointResolver:n}){let i=t["get-token"],o=typeof i=="string"?{endpoint:i}:i,s=n.resolveEndpointOrThrow({endpoint:o.endpoint,file:e});return{endpoint:r7r({resolvedEndpoint:s}),expiryProperty:XAm({tokenEndpoint:s,getTokenEndpointConfig:o,propertyResolver:r}),authenticatedRequestHeaders:KAm({tokenEndpoint:s,getTokenEndpointConfig:o,propertyResolver:r}),grantType:t.type==="refresh-token"?WAm({tokenEndpoint:s,endpoint:o.endpoint,propertyResolver:r}):void 0}}function WAm({tokenEndpoint:e,endpoint:t,propertyResolver:r}){let n;try{n=r.resolveRequestProperty({file:e.file,endpoint:e.endpointId,propertyComponents:[iLo]})}catch{n=void 0}if(n==null)throw new T({message:`Inferred auth with type 'refresh-token' requires the get-token endpoint '${t}' to have a '${iLo}' request property`,code:T.Code.ValidationError});let i=n.property.valueType;if(i.type==="container"&&i.container.type==="literal"&&(i.container.literal.type!=="string"||i.container.literal.string!==oLo))throw new T({message:`Inferred auth with type 'refresh-token' requires '${iLo}' on the get-token endpoint '${t}' to accept '${oLo}'`,code:T.Code.ValidationError});return{requestProperty:n,value:oLo}}function KAm({tokenEndpoint:e,getTokenEndpointConfig:t,propertyResolver:r}){let n=new Map,i=t["authenticated-request-headers"]??[];if(i.length>0&&i.forEach(o=>{n.set(o["header-name"].toLowerCase(),{headerName:o["header-name"],responseProperty:r.resolveResponsePropertyOrThrow({file:e.file,endpoint:e.endpointId,propertyComponents:UB(o["response-property"])}),valuePrefix:o["value-prefix"]})}),!n.has("authorization")){let o=JAm({tokenEndpoint:e,propertyResolver:r});o&&n.set("authorization",{headerName:"Authorization",responseProperty:o,valuePrefix:"Bearer "})}return Array.from(n.values())}function JAm({tokenEndpoint:e,propertyResolver:t}){for(let r of HAm)try{let n=t.resolveResponseProperty({file:e.file,endpoint:e.endpointId,propertyComponents:[r]});if(n)return n}catch{}}function XAm({tokenEndpoint:e,getTokenEndpointConfig:t,propertyResolver:r}){if(t["expiry-response-property"])return r.resolveResponsePropertyOrThrow({file:e.file,endpoint:e.endpointId,propertyComponents:UB(t["expiry-response-property"])});for(let n of YAm)try{let i=r.resolveResponseProperty({file:e.file,endpoint:e.endpointId,propertyComponents:[n]});if(i)return i}catch{}}var iLo,oLo,HAm,YAm,hIu=h(()=>{"use strict";ho();Wn();kt();tLo();oIu();uIu();Bct();iLo="grant_type",oLo="refresh_token";HAm=["access_token","accessToken","AccessToken","token","Token","auth_token","authToken","AuthToken","bearer_token","bearerToken","BearerToken","jwt","Jwt","authentication_token","authenticationToken","AuthenticationToken"];YAm=["expires_in","expiresIn","ExpiresIn","exp","Exp","expiry","Expiry","expires","Expires","expires_at","expiresAt","ExpiresAt","expiration","Expiration","valid_until","validUntil","ValidUntil"]});function gIu({file:e,rawApiFileSchema:t}){if(t.version!=null)return CIe.header({header:ZAm({file:e,header:t.version.header}),value:$Am({file:e,versionDeclaration:t.version})})}function ZAm({file:e,header:t}){return typeof t=="string"?s8({file:e,headerKey:t,header:{type:"string"}}):s8({file:e,headerKey:t.value,header:{type:"string",name:t.name,env:t.env}})}function $Am({file:e,versionDeclaration:t}){return GWr({_enum:{default:t.default,enum:t.values},file:e})}var AIu=h(()=>{"use strict";Wn();uUe();_Gt()});function yIu({channel:e,typeResolver:t,exampleResolver:r,variableResolver:n,file:i,workspace:o}){let s=[];for(let[a,c]of Object.entries(e.messages??{}))s.push({type:a,availability:iM(c.availability),docs:c.docs,origin:c.origin,body:rym({body:c.body,file:i}),displayName:c["display-name"],methodName:c["method-name"]});return{availability:iM(e.availability),path:eb(e.path),baseUrl:e.url,auth:e.auth,name:i.fernFilepath.file??i.casingsGenerator.generateName(e["display-name"]??e.path),displayName:e["display-name"],connectMethodName:e["connect-method-name"],headers:e.headers!=null?Object.entries(e.headers).map(([a,c])=>s8({headerKey:a,header:c,file:i})):[],docs:e.docs,pathParameters:e["path-parameters"]!=null?Lct({pathParameters:e["path-parameters"],location:Xt.PathParameterLocation.Endpoint,file:i,variableResolver:n}):[],queryParameters:e["query-parameters"]!=null?Object.entries(e["query-parameters"]).map(([a,c])=>{let{name:u}=Mme({queryParameterKey:a,queryParameter:c}),l=i.parseTypeReference(c);return{...zT(c),name:i.casingsGenerator.generateNameAndWireValue({wireValue:a,name:u}),valueType:l,allowMultiple:typeof c!="string"&&c["allow-multiple"]!=null?c["allow-multiple"]:!1,clientDefault:void 0,defaultValue:typeof c!="string"?c.default:void 0,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},explode:void 0}}):[],messages:Object.values(s),examples:(e.examples??[]).map(a=>{let c=iym({channel:e,example:a,typeResolver:t,exampleResolver:r,variableResolver:n,file:i,workspace:o});return{name:a.name!=null?i.casingsGenerator.generateName(a.name):void 0,docs:a.docs,url:sym({channel:e,example:a,pathParams:c}),...c,...oym({channel:e,example:a,typeResolver:t,exampleResolver:r,file:i,workspace:o}),queryParameters:a["query-parameters"]!=null?Object.entries(a["query-parameters"]).map(([u,l])=>{let p=e["query-parameters"]?.[u];if(p==null)throw new T({message:`Query parameter ${u} does not exist`,code:T.Code.ReferenceError});return{name:i.casingsGenerator.generateNameAndWireValue({name:Mme({queryParameterKey:u,queryParameter:p}).name,wireValue:u}),value:Wf({example:l,rawTypeBeingExemplified:typeof p=="string"?p:p.type,typeResolver:t,exampleResolver:r,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}),shape:eym({queryParameter:p})}}):[],messages:a.messages.map(u=>{let l=e.messages?.[u.type];if(l==null)throw new T({message:`Message ${u.type} does not exist`,code:T.Code.ReferenceError});return{type:u.type,body:tym({message:l,example:u.body,typeResolver:t,exampleResolver:r,file:i,workspace:o})}})}}),v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}},apiPlayground:void 0}}function eym({queryParameter:e}){return(typeof e!="string"&&e["allow-multiple"]!=null?e["allow-multiple"]:!1)?Ew.exploded():Ew.single()}function tym({message:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o}){if(!aym(e.body))return z3.reference(Wf({example:t,rawTypeBeingExemplified:typeof e.body!="string"?e.body.type:e.body,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}));if(!ki(t))throw new T({message:"Example must be an object",code:T.Code.ValidationError});let s=[];for(let[a,c]of Object.entries(t)){let u=e.body.properties?.[a];if(u!=null)s.push({name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:a,property:u}).name,wireValue:a}),value:Wf({example:c,rawTypeBeingExemplified:typeof u!="string"?u.type:u,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o}),originalTypeDeclaration:void 0});else{let l=UGt({extends_:e.body.extends,wirePropertyKey:a,typeResolver:r,file:i});if(l==null)throw new T({message:"Could not find original type declaration for property: "+a,code:T.Code.ResolutionError});s.push({name:i.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:a,property:l.rawPropertyType}).name,wireValue:a}),value:Wf({example:c,rawTypeBeingExemplified:typeof l.rawPropertyType=="string"?l.rawPropertyType:l.rawPropertyType.type,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:l.file,fileContainingExample:i,workspace:o}),originalTypeDeclaration:l.typeName})}}return z3.inlinedBody({jsonExample:n.resolveAllReferencesInExampleOrThrow({example:t,file:i}).resolvedExample,properties:s,extraProperties:void 0})}function rym({body:e,file:t}){return typeof e=="string"||nym(e)?sB.reference({docs:void 0,bodyType:t.parseTypeReference(e)}):sB.inlinedBody({name:t.casingsGenerator.generateName(e.name),extends:HK(e.extends??[]).map(r=>jT({typeName:r,file:t})),properties:Object.entries(e.properties??{}).map(([r,n])=>({name:t.casingsGenerator.generateNameAndWireValue({name:pS({propertyKey:r,property:n}).name,wireValue:r}),value:t.parseTypeReference(n),valueType:t.parseTypeReference(n),availability:void 0,docs:void 0}))})}function nym(e){return e.type!=null}function iym({channel:e,example:t,typeResolver:r,exampleResolver:n,variableResolver:i,file:o,workspace:s}){let a=[],c=({name:u,pathParameterDeclaration:l,examplePathParameter:p})=>{let d=VGt({parameter:l,variableResolver:i,file:o});return{name:u,value:Wf({example:p,rawTypeBeingExemplified:d.rawType,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:d.file,fileContainingExample:o,workspace:s})}};if(t["path-parameters"]!=null){let u=y4(e);for(let[l,p]of Object.entries(t["path-parameters"])){let d=u[l];if(d!=null)a.push(c({name:o.casingsGenerator.generateName(l),pathParameterDeclaration:d,examplePathParameter:p}));else throw new T({message:`Path parameter ${l} does not exist`,code:T.Code.ReferenceError})}}return{pathParameters:a}}function oym({channel:e,example:t,typeResolver:r,exampleResolver:n,file:i,workspace:o}){let s=[];if(t.headers!=null)for(let[a,c]of Object.entries(t.headers)){let u=e.headers?.[a];u!=null&&s.push({name:i.casingsGenerator.generateNameAndWireValue({name:wre({headerKey:a,header:u}).name,wireValue:a}),value:Wf({example:c,rawTypeBeingExemplified:typeof u=="string"?u:u.type,typeResolver:r,exampleResolver:n,fileContainingRawTypeReference:i,fileContainingExample:i,workspace:o})})}return{headers:s}}function sym({channel:e,example:t,pathParams:r}){let n=e.path;if(t["path-parameters"]!=null)for(let i of[...r.pathParameters])n=n.replaceAll(`{${Vr(i.name)}}`,encodeURIComponent(`${i.value.jsonExample}`));return n}function aym(e){return typeof e=="string"?!1:e.extends!=null||e.properties!=null}var bIu=h(()=>{"use strict";Ct();Wn();lc();kt();gp();FGt();Sre();A4();uUe();Mct();Qct();i8()});function EIu({errorName:e,errorDeclaration:t,file:r,typeResolver:n,exampleResolver:i,workspace:o}){let s=[];if(t.type!=null&&t.examples!=null)for(let c of t.examples)s.push({name:c.name!=null?r.casingsGenerator.generateName(c.name):void 0,docs:c.docs,jsonExample:i.resolveAllReferencesInExampleOrThrow({example:c.value,file:r}).resolvedExample,shape:Wf({example:c.value,rawTypeBeingExemplified:t.type,fileContainingRawTypeReference:r,fileContainingExample:r,typeResolver:n,exampleResolver:i,workspace:o})});let a=FLe(t["status-code"]);if(a==null)throw new Error(`Error ${e} has an invalid status-code "${t["status-code"]}". Expected an integer, "4XX", or "5XX".`);return{name:ESe({errorName:e,file:r}),discriminantValue:r.casingsGenerator.generateNameAndWireValue({wireValue:e,name:e}),docs:typeof t!="string"?t.docs:void 0,statusCode:a.statusCode,isWildcardStatusCode:a.isWildcard?!0:void 0,type:t.type!=null?r.parseTypeReference(t.type):void 0,examples:s,v2Examples:void 0,displayName:void 0,headers:[]}}var IIu=h(()=>{"use strict";ho();jGt();Qct()});function CIu(e,t){if(e==null||e.strategy==="status-code")return j3.statusCode();if(e.strategy==="property")return j3.property({discriminant:t.casingsGenerator.generateNameAndWireValue({name:e["property-name"],wireValue:e["property-name"]}),contentProperty:t.casingsGenerator.generateNameAndWireValue({name:vIu,wireValue:vIu})});Ee(e)}var vIu,xIu=h(()=>{"use strict";Ct();Wn();vIu="content"});function cym(e){switch(e){case"header":return Xt.GlobalParameterLocation.Header;case"query":return Xt.GlobalParameterLocation.Query;case"path":return Xt.GlobalParameterLocation.Path;default:return Xt.GlobalParameterLocation.Body}}function uym(e){switch(e){case"explicit":return Xt.GlobalParameterApplyMode.Explicit;case"auto":return Xt.GlobalParameterApplyMode.Auto;case void 0:return;default:return}}function lym(e,t){let r=pym(e);return t===!0?Xt.TypeReference.container(Xt.ContainerType.optional(r)):r}function pym(e){switch(e){case"boolean":return Xt.TypeReference.primitive({v1:"BOOLEAN",v2:Xt.PrimitiveTypeV2.boolean({default:void 0})});case"integer":return Xt.TypeReference.primitive({v1:"INTEGER",v2:Xt.PrimitiveTypeV2.integer({default:void 0,validation:void 0})});case"double":case"number":return Xt.TypeReference.primitive({v1:"DOUBLE",v2:Xt.PrimitiveTypeV2.double({default:void 0,validation:void 0})});default:return Xt.TypeReference.primitive({v1:"STRING",v2:Xt.PrimitiveTypeV2.string({default:void 0,validation:void 0})})}}function fym(e,t){if(e!=null){if(typeof e=="boolean")return t!=null&&t!=="boolean"?void 0:Xt.Literal.boolean(e);if(typeof e=="string")return t==="boolean"||t==="integer"||t==="double"||t==="number"?void 0:Xt.Literal.string(e);if(typeof e=="number")return t==="boolean"||t==="string"||t==="integer"&&!Number.isInteger(e)?void 0:Xt.Literal.string(String(e))}}function SIu({globalParameters:e,file:t}){return Object.entries(e).map(([r,n])=>{let i=n["parameter-name"]??r;return{id:r,name:t.casingsGenerator.generateNameAndWireValue({name:i,wireValue:r}),location:cym(n.in),target:n.target??r,valueType:lym(n.type,n.optional),env:n.env,clientDefault:fym(n.default,n.type),optional:n.optional,apply:uym(n.apply),docs:n.docs}})}var wIu=h(()=>{"use strict";Wn()});function TIu({readme:e,services:t}){let r=new sLo(t);return{apiName:e.apiName,disabledFeatures:e.disabledSections?.map(n=>n.toUpperCase()),apiReferenceLink:e.apiReferenceLink,bannerLink:e.bannerLink,introduction:e.introduction,customSections:e.customSections,exampleStyle:e.exampleStyle,whiteLabel:!1,defaultEndpoint:e.defaultEndpoint!=null?r.getEndpointForReadmeOrThrow(e.defaultEndpoint).id:void 0,features:e.features!=null?Object.fromEntries(Object.entries(e.features).map(([n,i])=>[n,i.map(o=>r.getEndpointForReadmeOrThrow(o).id)])):void 0}}function dym(e){let t="";e.fullPath.head.length>0&&(t=(0,o7r.default)(t,e.fullPath.head));for(let r of e.fullPath.parts)t=(0,o7r.default)(t,"{"+r.pathParameter+"}"),r.tail.length>0&&(t=(0,o7r.default)(t,r.tail));return t.startsWith("/")?t:`/${t}`}function mym({endpoint:e}){if(typeof e=="string"){let t=e.split(" ");if(t.length!==2||t[0]==null||t[1]==null)throw new T({message:`invalid endpoint string: ${e}`,code:T.Code.ParseError});return{method:t[0],path:t[1]}}return e}function hym(e){return typeof e=="string"?e:JSON.stringify(e)}var o7r,sLo,OIu=h(()=>{"use strict";kt();o7r=Ae(qf(),1);sLo=class{endpoints={};constructor(t){this.endpoints=this.buildEndpoints(t)}getEndpointForReadme(t){let r=mym({endpoint:t}),n=this.getEndpointKeyForReadmeEndpoint(r);return this.endpoints[n]}getEndpointForReadmeOrThrow(t){let r=this.getEndpointForReadme(t);if(r==null)throw new T({message:`Endpoint not found in generators.yml readme config for ${hym(t)}`,code:T.Code.ConfigError});return r}buildEndpoints(t){let r={};for(let n of Object.values(t))for(let i of n.endpoints)r[this.getEndpointKeyForHttpEndpoint(i)]=i;return r}getEndpointKeyForReadmeEndpoint(t){return this.getEndpointKey({method:t.method,path:t.path,stream:t.stream??!1})}getEndpointKeyForHttpEndpoint(t){return this.getEndpointKey({method:t.method,path:dym(t),stream:t.response?.body?.type==="streaming"})}getEndpointKey({method:t,path:r,stream:n}){return`${t}|${r}|${n}`}}});function PIu({webhooks:e,file:t,typeResolver:r,exampleResolver:n,workspace:i,defaultSignature:o}){let s=[];for(let[a,c]of Object.entries(e))s.push({id:Xu.generateWebhookId(t.fernFilepath,a),availability:iM(c.availability),displayName:c["display-name"],docs:c.docs,method:c.method,name:t.casingsGenerator.generateName(a),headers:c.headers!=null?Object.entries(c.headers).map(([u,l])=>s8({headerKey:u,header:l,file:t})):[],payload:gym({payload:c.payload,file:t}),signatureVerification:aLo({signature:c.signature??o,file:t}),fileUploadPayload:void 0,responses:bym({webhook:c,file:t,typeResolver:r}),examples:c.examples!=null?yym({webhook:c,examples:c.examples,file:t,typeResolver:r,exampleResolver:n,workspace:i}):void 0,v2Examples:void 0});return s}function gym({payload:e,file:t}){return typeof e=="string"?Z1.reference({docs:void 0,payloadType:t.parseTypeReference(e)}):wct(e)?Z1.reference({docs:void 0,payloadType:t.parseTypeReference(e.type)}):Z1.inlinedPayload({name:t.casingsGenerator.generateName(e.name),extends:HK(e.extends).map(r=>jT({typeName:r,file:t})),properties:e.properties!=null?Object.entries(e.properties).map(([r,n])=>Aym({propertyKey:r,propertyDefinition:n,docs:typeof n!="string"?n.docs:void 0,availability:typeof n!="string"?iM(n.availability):void 0,file:t})):[]})}function Aym({propertyKey:e,propertyDefinition:t,docs:r,availability:n,file:i}){return{docs:r,availability:n,name:i.casingsGenerator.generateNameAndWireValue({wireValue:e,name:pS({propertyKey:e,property:t}).name}),valueType:i.parseTypeReference(t)}}function yym({webhook:e,examples:t,file:r,typeResolver:n,exampleResolver:i,workspace:o}){let s=typeof e.payload=="string"?e.payload:wct(e.payload)?e.payload.type:void 0;if(s!=null)return t.map(a=>({docs:e.docs,name:a.name!=null?r.casingsGenerator.generateName(a.name):void 0,payload:Wf({example:a.payload,rawTypeBeingExemplified:s,fileContainingRawTypeReference:r,fileContainingExample:r,typeResolver:n,exampleResolver:i,workspace:o})}));if(!ki(e.payload))throw new T({message:`Example webhook payload is not an object. Got: ${JSON.stringify(e.payload)}`,code:T.Code.ValidationError});return t.map(a=>({docs:e.docs,name:a.name!=null?r.casingsGenerator.generateName(a.name):void 0,payload:Wf({example:a.payload,rawTypeBeingExemplified:"map<string, unknown>",fileContainingRawTypeReference:r,fileContainingExample:r,typeResolver:n,exampleResolver:i,workspace:o})}))}function bym({webhook:e,file:t,typeResolver:r}){let n=[];if(e.response!=null){let i=Eym({response:e.response,file:t,typeResolver:r}),o=typeof e.response!="string"?e.response["status-code"]:void 0,s=typeof e.response!="string"?e.response.docs:void 0;n.push({body:i,statusCode:o,isWildcardStatusCode:void 0,docs:s})}if(e["response-stream"]!=null){let i=Iym({responseStream:e["response-stream"],file:t,typeResolver:r});if(i!=null){let o=typeof e["response-stream"]!="string"?e["response-stream"].docs:void 0;n.push({body:ju.streaming(i),statusCode:void 0,isWildcardStatusCode:void 0,docs:o})}}return n.length>0?n:void 0}function Eym({response:e,file:t,typeResolver:r}){let n=typeof e!="string"?e.docs:void 0,i=typeof e=="string"?e:e.type;if(i!=null){if(dQ(i)!=null)return ju.fileDownload({docs:n,v2Examples:void 0});if(jLe(i)!=null){let o=typeof e!="string"?e["content-type"]:void 0;return ju.text({docs:n,v2Examples:void 0,contentType:o??void 0})}else return HV(i)!=null?ju.bytes({docs:n,v2Examples:void 0}):vym(e,n,t,r)}}function Iym({responseStream:e,file:t,typeResolver:r}){let n=typeof e!="string"?e.docs:void 0,i=typeof e=="string"?e:e.type,o=typeof e=="string"?"json":e.format??"json";return EIe(i)?dv.text({docs:n,v2Examples:void 0}):typeof e!="string"&&o==="sse"?dv.sse({docs:n,payload:t.parseTypeReference(i),terminator:typeof e!="string"?e.terminator:void 0,resumable:typeof e!="string"?e.resumable:void 0,v2Examples:void 0}):dv.json({docs:n,payload:t.parseTypeReference(i),terminator:typeof e!="string"?e.terminator:void 0,v2Examples:void 0})}function vym(e,t,r,n){let i=typeof e!="string"?e.type:e;if(i==null)return;let o=r.parseTypeReference(typeof e=="string"?e:{...e,type:i}),s=n.resolveTypeOrThrow({type:i,file:r}),a=typeof e!="string"?e.property:void 0;return a!=null?ju.json(uI.nestedPropertyAsResponse({docs:t,responseBodyType:o,responseProperty:sUe({typeResolver:n,file:r,resolvedType:s,property:a}),v2Examples:void 0})):ju.json(uI.response({docs:t,responseBodyType:o,v2Examples:void 0}))}function aLo({signature:e,file:t}){if(e!=null)switch(e.type){case"hmac":return zH.hmac(Cym({hmac:e,file:t}));case"asymmetric":return zH.asymmetric(Pym({asymmetric:e,file:t}));default:return}}function Cym({hmac:e,file:t}){return{signatureHeaderName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),algorithm:BIu(e.algorithm),encoding:cLo(e.encoding),signaturePrefix:e["signature-prefix"],payloadFormat:RIu(e["payload-format"]),timestamp:DIu({timestamp:e.timestamp,file:t}),bodyHashBinding:wym(e["body-hash-binding"]),notificationUrlNormalization:Sym(e["url-normalization"]),algorithmHeader:xym({algorithmHeader:e["algorithm-header"],file:t})}}function xym({algorithmHeader:e,file:t}){if(e==null)return;let r=Object.entries(e.algorithms);if(r.length===0)throw new T({message:`webhook-signature algorithm-header "${e.header}" must list at least one entry under "algorithms" (e.g. HMAC_SHA256: sha256).`,code:T.Code.ValidationError});return{headerName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),keyIdDelimiter:e["key-id-delimiter"],keyIdParameter:e["key-id-parameter"],algorithmParameter:e["algorithm-parameter"],algorithms:r.map(([n,i])=>({wireValue:n,algorithm:BIu(i)}))}}function Sym(e){if(e!=null)return{portVariants:e["port-variants"]??!1,legacyQueryEncoding:e["legacy-query-encoding"]??!1}}function wym(e){if(e!=null)return{algorithm:Tym(e.algorithm),encoding:cLo(e.encoding),location:Oym(e.location)}}function Tym(e){switch(e){case"sha1":return jH.Sha1;case"sha384":return jH.Sha384;case"sha512":return jH.Sha512;case"sha256":return jH.Sha256;default:Ee(e)}}function Oym(e){if(e.type==="query-parameter")return xIe.queryParameter({name:e.name});Ee(e.type)}function Pym({asymmetric:e,file:t}){return{signatureHeaderName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),algorithm:Bym(e["asymmetric-algorithm"]),encoding:cLo(e.encoding),signaturePrefix:e["signature-prefix"],keySource:Rym({asymmetric:e,file:t}),payloadFormat:e["payload-format"]!=null?RIu(e["payload-format"]):void 0,timestamp:DIu({timestamp:e.timestamp,file:t})}}function BIu(e){switch(e){case"sha1":return NH.Sha1;case"sha384":return NH.Sha384;case"sha512":return NH.Sha512;case"sha256":case void 0:return NH.Sha256}}function cLo(e){switch(e){case"hex":return ILe.Hex;case"base64":case void 0:return ILe.Base64}}function Bym(e){switch(e){case"rsa-sha256":return oB.RsaSha256;case"rsa-sha384":return oB.RsaSha384;case"rsa-sha512":return oB.RsaSha512;case"ecdsa-sha256":return oB.EcdsaSha256;case"ecdsa-sha384":return oB.EcdsaSha384;case"ecdsa-sha512":return oB.EcdsaSha512;case"ed25519":return oB.Ed25519}}function Rym({asymmetric:e,file:t}){return e["jwks-url"]!=null?FH.jwks({url:e["jwks-url"],keyIdHeader:e["key-id-header"]!=null?t.casingsGenerator.generateNameAndWireValue({wireValue:e["key-id-header"],name:e["key-id-header"]}):void 0}):FH.static({})}function RIu(e){return e==null?{components:[LV.Body],delimiter:"",bodySort:void 0}:{components:e.components.map(kym),delimiter:e.delimiter??"",bodySort:Dym(e["body-sort"])}}function Dym(e){switch(e){case"alphabetical":return oLt.Alphabetical;case void 0:return}}function kym(e){switch(e){case"body":return LV.Body;case"timestamp":return LV.Timestamp;case"notification-url":return LV.NotificationUrl;case"message-id":return LV.MessageId}}function DIu({timestamp:e,file:t}){if(e!=null)return{headerName:t.casingsGenerator.generateNameAndWireValue({wireValue:e.header,name:e.header}),format:Fym(e.format),tolerance:e.tolerance}}function Fym(e){switch(e){case"unix-millis":return Tfe.UnixMillis;case"iso8601":return Tfe.Iso8601;case"unix-seconds":case void 0:return Tfe.UnixSeconds}}var kIu=h(()=>{"use strict";Ct();ho();Wn();lc();kt();Sre();A4();uUe();jWr();Qct();i8()});function FIu({name:e,source:t}){return Zp.userDefined({file:KWr({source:t}),name:MGt.generateName(e)})}function NIu({encoding:e}){if(e.proto!=null&&e.proto.type!=null){let t=Nym({type:e.proto.type});if(t!=null)return t}}function Nym({type:e}){switch(e){case"google.protobuf.Any":return Zp.wellKnown(Ci.any());case"google.protobuf.Api":return Zp.wellKnown(Ci.api());case"google.protobuf.BoolValue":return Zp.wellKnown(Ci.boolValue());case"google.protobuf.BytesValue":return Zp.wellKnown(Ci.bytesValue());case"google.protobuf.DoubleValue":return Zp.wellKnown(Ci.doubleValue());case"google.protobuf.Duration":return Zp.wellKnown(Ci.duration());case"google.protobuf.Empty":return Zp.wellKnown(Ci.empty());case"google.protobuf.Enum":return Zp.wellKnown(Ci.enum());case"google.protobuf.EnumValue":return Zp.wellKnown(Ci.enumValue());case"google.protobuf.Field":return Zp.wellKnown(Ci.field());case"google.protobuf.FieldCardinality":return Zp.wellKnown(Ci.fieldCardinality());case"google.protobuf.FieldKind":return Zp.wellKnown(Ci.fieldKind());case"google.protobuf.FieldMask":return Zp.wellKnown(Ci.fieldMask());case"google.protobuf.FloatVlaue":return Zp.wellKnown(Ci.floatValue());case"google.protobuf.Int32Value":return Zp.wellKnown(Ci.int32Value());case"google.protobuf.Int64Value":return Zp.wellKnown(Ci.int64Value());case"google.protobuf.ListValue":return Zp.wellKnown(Ci.listValue());case"google.protobuf.Method":return Zp.wellKnown(Ci.method());case"google.protobuf.Mixin":return Zp.wellKnown(Ci.mixin());case"google.protobuf.NullValue":return Zp.wellKnown(Ci.nullValue());case"google.protobuf.Option":return Zp.wellKnown(Ci.option());case"google.protobuf.SourceContext":return Zp.wellKnown(Ci.sourceContext());case"google.protobuf.StringValue":return Zp.wellKnown(Ci.stringValue());case"google.protobuf.Struct":return Zp.wellKnown(Ci.struct());case"google.protobuf.Syntax":return Zp.wellKnown(Ci.syntax());case"google.protobuf.Timestamp":return Zp.wellKnown(Ci.timestamp());case"google.protobuf.Type":return Zp.wellKnown(Ci.type());case"google.protobuf.Uint32Value":return Zp.wellKnown(Ci.uint32Value());case"google.protobuf.Uint64Value":return Zp.wellKnown(Ci.uint64Value());case"google.protobuf.Value":return Zp.wellKnown(Ci.value())}}var jIu=h(()=>{"use strict";Wn();Fct();XMo()});function jym(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _ct(e,t,r){if(t.length===0)return e;let n=new Map;for(let o=0;o<t.length;o++){let s=t[o],a=r[o];s!=null&&a!=null&&n.set(s,a)}if(n.size===0)return e;let i=Array.from(n.keys()).map(o=>`\\b${jym(o)}\\b`).join("|");return e.replace(new RegExp(i,"g"),o=>n.get(o)??o)}var uLo=h(()=>{"use strict"});function zIu({generic:e,file:t,typeResolver:r}){let n=typeof e=="string"?e:e.type,i=cI(n);if(i==null)throw new T({message:`Invalid generic type definition: ${n}`,code:T.Code.ValidationError});let o=r.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:n,file:t});if(i.arguments&&Of(o.declaration)){let s=cI(o.typeName)?.arguments??[],a=Object.entries(o.declaration.properties??{}).map(([u,l])=>{let p=l;return typeof l=="string"?p=_ct(l,s,i.arguments):typeof l=="object"&&l!=null&&"type"in l&&(p={...l,type:_ct(l.type,s,i.arguments)}),[u,p]}),c=HK(o.declaration.extends).map(u=>{let l=_ct(u,s,i.arguments);return jT({typeName:l,file:t})});return uc.object({extends:c,properties:DGt({properties:Object.fromEntries(a)},t),extraProperties:o.declaration["extra-properties"]??!1,extendedProperties:void 0,deferredUnionBaseProperties:void 0})}throw new T({message:`Generic type definition not supported: ${n}`,code:T.Code.ValidationError})}var QIu=h(()=>{"use strict";ho();Wn();kt();Sre();uLo();i8()});function MIu({alias:e,file:t,typeResolver:r}){let n=typeof e=="string"?e:e.type;return jV(n)?zIu({generic:n,file:t,typeResolver:r}):uc.alias({aliasOf:t.parseTypeReference(e),resolvedType:zym({aliasOf:n,file:t,typeResolver:r})})}function zym({aliasOf:e,file:t,typeResolver:r}){let n=r.resolveTypeOrThrow({type:e,file:t});switch(n._type){case"primitive":return Iw.primitive(n.originalTypeReference.primitive);case"container":return Iw.container(n.originalTypeReference.container);case"unknown":return Iw.unknown();case"named":{let i=Of(n.declaration)?uD.Object:KV(n.declaration)?uD.Union:VH(n.declaration)?uD.Enum:wtt(n.declaration)?uD.UndiscriminatedUnion:Ee(n.declaration);return Iw.named({name:n.name,shape:i})}}}var LIu=h(()=>{"use strict";Ct();ho();Wn();QIu()});function _Iu({union:e,file:t}){let r=e.union.filter((n,i)=>{let o=typeof n=="string"?n:n.type;return e.union.findIndex(s=>(typeof s=="string"?s:s.type)===o)===i});return uc.undiscriminatedUnion({baseProperties:e["base-properties"]!=null?Object.entries(e["base-properties"]).map(([n,i])=>({...zT(i),name:t.casingsGenerator.generateNameAndWireValue({wireValue:n,name:pS({propertyKey:n,property:i}).name}),valueType:t.parseTypeReference(i),propertyAccess:bSe({property:i}),defaultValue:typeof i!="string"?i.default:void 0,xml:void 0,v2Examples:{userSpecifiedExamples:{},autogeneratedExamples:{}}})):void 0,members:r.map(n=>{let i=t.parseTypeReference(typeof n=="string"?n:n.type);return{type:i.type==="named"?{...i,displayName:typeof n=="string"?YP(Vr(i.name)):n["display-name"]??YP(Vr(i.name))}:i,docs:typeof n=="string"?void 0:n.docs}})})}var UIu=h(()=>{"use strict";Ct();Wn();lc();A4();i8()});function VIu(e){let t=[];if(e.extends!=null){let r=typeof e.extends=="string"?[e.extends]:e.extends;t.push(...r)}return e.properties!=null&&t.push(...Object.values(e.properties).map(r=>typeof r=="string"?r:r.type)),t}function pLo({typeDeclaration:e,file:t,typeResolver:r,seenTypeNames:n=new lLo}){let i=bC(e,{alias:s=>{let a=typeof s=="string"?s:s.type,c=cI(a);if(c!=null){let u=new Set(c.arguments??[]),l=r.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:a,file:t}),p=cI(l.typeName)?.arguments;if(Of(l.declaration)){let d=VIu(l.declaration);p&&d.filter(f=>!p.includes(f)).map(f=>_ct(f,p,c.arguments)).forEach(f=>u.add(f))}return Array.from(u)}return[a]},object:s=>VIu(s),discriminatedUnion:s=>{let a=[];return s["base-properties"]!=null&&a.push(...Object.values(s["base-properties"]).map(c=>typeof c=="string"?c:c.type)),a.push(...Object.values(s.union).reduce((c,u)=>{let l=typeof u=="string"?u:u.type;return typeof l=="string"&&c.push(l),c},[])),a},undiscriminatedUnion:s=>{let a=[];return s["base-properties"]!=null&&a.push(...Object.values(s["base-properties"]).map(c=>typeof c=="string"?c:c.type)),a.push(...Object.values(s.union).reduce((c,u)=>{let l=typeof u=="string"?u:u.type;return typeof l=="string"&&c.push(l),c},[])),a},enum:()=>[]}),o=[];for(let s of i){let a=yC({type:s,_default:void 0,validation:void 0,visitor:{primitive:()=>[],map:({keyType:c,valueType:u})=>[...c,...u],list:c=>c,optional:c=>c,nullable:c=>c,set:c=>c,named:c=>[c],literal:()=>[],unknown:()=>[]}});for(let c of a){let u=jT({typeName:c,file:t});if(!n.hasTypeNameBeenSeen(u)){n.addTypeName(u),o.push(u);let l=r.getDeclarationOfNamedTypeOrThrow({referenceToNamedType:c,file:t});if(jV(l.typeName))continue;o.push(...pLo({typeDeclaration:l.declaration,file:l.file,typeResolver:r,seenTypeNames:n}))}}}return o}var lLo,GIu=h(()=>{"use strict";ho();lc();Sre();uLo();lLo=class{cache=new Set;addTypeName(t){this.cache.add(this.computeCacheKey(t))}hasTypeNameBeenSeen(t){return this.cache.has(this.computeCacheKey(t))}computeCacheKey(t){return t.fernFilepath.allParts.map(r=>Vr(r)).join("/")+":"+Vr(t.name)}}});function qIu({typeName:e,typeDeclaration:t,file:r,typeResolver:n,exampleResolver:i,sourceResolver:o,workspace:s}){let a=zT(t),c=jT({typeName:e,file:r}),u=pLo({typeDeclaration:t,file:r,typeResolver:n}),l={};Of(t)&&(l=nUe(t.properties??{}));let p=Mym({file:r,typeDeclaration:t,typeName:e,sourceResolver:o});return{propertiesByAudience:l,typeDeclaration:{...a,inline:Gym(t),name:c,shape:Qym({typeDeclaration:t,file:r,typeResolver:n}),referencedTypes:new Set(u.map(d=>d.typeId)),encoding:Lym({typeDeclaration:t,typeName:e,source:p}),source:p,userProvidedExamples:typeof t!="string"&&t.examples!=null?t.examples.map(d=>({name:d.name!=null?r.casingsGenerator.generateName(d.name):void 0,docs:d.docs,jsonExample:i.resolveAllReferencesInExampleOrThrow({example:d.value,file:r}).resolvedExample,shape:KMo({typeName:c,example:d.value,typeResolver:n,exampleResolver:i,typeDeclaration:t,fileContainingType:r,fileContainingExample:r,workspace:s})})):[],autogeneratedExamples:[],v2Examples:void 0},descendantFilepaths:new Set(u.map(d=>d.fernFilepath))}}function Qym({typeDeclaration:e,file:t,typeResolver:r}){return bC(e,{alias:n=>MIu({alias:n,file:t,typeResolver:r}),object:n=>B0u({object:n,file:t,withinXmlElement:Uym(e)}),discriminatedUnion:n=>H0u({union:n,file:t,typeResolver:r}),undiscriminatedUnion:n=>_Iu({union:n,file:t}),enum:n=>uc.enum(GWr({_enum:n,file:t}))})}function Mym({file:e,typeDeclaration:t,typeName:r,sourceResolver:n}){if(typeof t=="string"||t.source==null&&t.encoding==null)return;if(t.encoding!=null){let o=NIu({encoding:t.encoding});if(o!=null)return Sfe.proto(o)}if(t.source==null)return;let i=n.resolveSourceOrThrow({source:t.source,relativeFilepath:e.relativeFilepath});if(!(i==null||i.type!=="protobuf"))return Sfe.proto(FIu({source:i,name:r}))}function Lym({typeDeclaration:e,typeName:t,source:r}){return typeof e!="string"&&e.encoding!=null?_ym({encodingSchema:e.encoding,typeName:t}):Vym(r)}function _ym({encodingSchema:e,typeName:t}){return e.proto!=null?{json:void 0,proto:{},xml:void 0}:e.xml!=null?{json:void 0,proto:void 0,xml:{name:e.xml.name??t,namespace:e.xml.namespace,prefix:e.xml.prefix}}:{json:{},proto:void 0,xml:void 0}}function Uym(e){return typeof e!="string"&&e.encoding?.xml!=null}function Vym(e){return e!=null&&e.type==="proto"?{json:void 0,proto:{},xml:void 0}:{json:{},proto:void 0,xml:void 0}}function Gym(e){if(typeof e!="string"&&"inline"in e)return e.inline}var WIu=h(()=>{"use strict";ho();Wn();lc();Sre();A4();jIu();LIu();kct();_Gt();Qct();i8();UIu();GIu()});function HIu(e,t){let r=t[e];if(r==null)throw T.internalError(`Failed to load type declaration for type ${e}`);return r}var KIu=h(()=>{"use strict";kt()});function JIu(e){e.types=Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Wym({typeDeclaration:r,ir:e})])),e.services=Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(n=>qym({endpoint:n,ir:e}))}]))}function qym({endpoint:e,ir:t}){return e.requestBody?.type!=="inlinedRequestBody"?e:{...e,requestBody:{...e.requestBody,extendedProperties:e.requestBody.extends.flatMap(r=>YIu(r,t))}}}function Wym({typeDeclaration:e,ir:t}){return e.shape.type==="object"?{...e,shape:{...e.shape,extendedProperties:e.shape.extends.flatMap(r=>YIu(r,t))}}:e}function YIu(e,t){let r=fLo(e.typeId,t);return XIu({objectTypeDeclaration:r,ir:t})}function fLo(e,t){let r=HIu(e,t.types);switch(r.shape.type){case"object":return r.shape;case"alias":if(r.shape.resolvedType.type==="named")return fLo(r.shape.resolvedType.name.typeId,t)}throw T.internalError(`Unexpected error: ${e} is extended but has shape ${r.shape.type}`)}function XIu({objectTypeDeclaration:e,ir:t}){let r=e.extends.flatMap(n=>{let i=fLo(n.typeId,t);return XIu({objectTypeDeclaration:i,ir:t})});return[...e.properties,...r]}var ZIu=h(()=>{"use strict";kt();KIu()});function $Iu(e,t){if(e.length!==t.length)return!1;let r=new Set(e);for(let n of t)if(!r.has(n))return!1;return!0}var s7r,evu=h(()=>{"use strict";lc();kt();Vi();s7r=class{subpackages={};rootPackage={docs:void 0,fernFilepath:{allParts:[],packagePath:[],file:void 0},websocket:void 0,service:void 0,types:[],errors:[],subpackages:[],webhooks:void 0,navigationConfig:void 0};addPackageRedirection({from:t,to:r}){let n=this.getPackageForFernFilepath(t);if(n.navigationConfig!=null)throw new T({message:"Found duplicate navigationConfig for package",code:T.Code.InternalError});n.navigationConfig={pointsTo:Xu.generateSubpackageId(r)}}addDocs(t,r){let n=this.getPackageForFernFilepath(t);if(n.docs!=null)throw new T({message:"Found duplicate docs for package",code:T.Code.InternalError});n.docs=r}addSubpackage(t){this.getPackageForFernFilepath(t)}addType(t,r){this.getPackageForFernFilepath(r.name.fernFilepath).types.push(t)}addError(t,r){this.getPackageForFernFilepath(r.name.fernFilepath).errors.push(t)}addService(t,r){let n=this.getPackageForFernFilepath(r.name.fernFilepath);if(n.service!=null)throw new T({message:"Found duplicate service for "+t,code:T.Code.InternalError});n.service=t}addWebhookGroup(t,r){let n=this.getPackageForFernFilepath(r);if(n.webhooks!=null)throw new T({message:"Found duplicate webhook group for "+t,code:T.Code.InternalError});n.webhooks=t}addWebSocketChannel(t,r){let n=this.getPackageForFernFilepath(r);if(n.webhooks!=null)throw new T({message:"Found duplicate webhook group for "+t,code:T.Code.InternalError});n.websocket=t}build(t){t!=null&&(Object.entries(this.subpackages).forEach(([i,o])=>{t.hasSubpackageId(i)?this.subpackages[i]={...o,types:o.types.filter(s=>t.hasTypeId(s)),errors:o.errors.filter(s=>t.hasErrorId(s)),service:o.service!=null&&t.hasServiceId(o.service)?o.service:void 0,websocket:o.websocket!=null&&t.hasChannel(o.websocket)?o.websocket:void 0,subpackages:o.subpackages.filter(s=>t.hasSubpackageId(s))}:delete this.subpackages[i]}),this.rootPackage={...this.rootPackage,types:this.rootPackage.types.filter(i=>t.hasTypeId(i)),errors:this.rootPackage.errors.filter(i=>t.hasErrorId(i)),service:this.rootPackage.service!=null&&t.hasServiceId(this.rootPackage.service)?this.rootPackage.service:void 0,subpackages:this.rootPackage.subpackages.filter(i=>t.hasSubpackageId(i)),webhooks:this.rootPackage.webhooks!=null?this.rootPackage.webhooks:void 0});let r=new Set(this.getAllChildrenWithEndpoints(this.rootPackage)),n=new Set(this.getAllChildrenWithWebSocket(this.rootPackage));return{subpackages:Cp(this.subpackages,(i,o)=>({...i,hasEndpointsInTree:r.has(o),hasWebSocketInTree:n.has(o)||i.websocket!=null})),rootPackage:{...this.rootPackage,hasEndpointsInTree:r.size>0||this.rootPackage.service!=null,hasWebSocketInTree:n.size>0||this.rootPackage.websocket!=null||Object.values(this.subpackages).some(i=>i.websocket!=null)}}}sortRootPackage(t){if(!$Iu(this.rootPackage.subpackages,t))throw new T({message:"Sorted subpackages differ from unsorted packages in root",code:T.Code.InternalError});this.rootPackage.subpackages=t}sortSubpackage(t,r){let n=this.subpackages[t];if(n==null)throw new T({message:"Subpackage does not exist: "+t,code:T.Code.ResolutionError});if(!$Iu(n.subpackages,r))throw new T({message:"Sorted subpackages differ from unsorted packages",code:T.Code.InternalError});n.subpackages=r}getAllSubpackagesWithEndpoints(t){let r=this.subpackages[t];if(r==null)throw new T({message:"Subpackage does not exist: "+t,code:T.Code.ResolutionError});let n=this.getAllChildrenWithEndpoints(r);return(n.length>0||r.service!=null)&&n.push(t),n}getAllChildrenWithEndpoints(t){return t.subpackages.flatMap(r=>[...this.getAllSubpackagesWithEndpoints(r)])}getAllSubpackagesWithWebSocket(t){let r=this.subpackages[t];if(r==null)throw new T({message:"Subpackage does not exist: "+t,code:T.Code.ResolutionError});let n=this.getAllChildrenWithWebSocket(r);return(n.length>0||r.websocket!=null)&&n.push(t),n}getAllChildrenWithWebSocket(t){return t.subpackages.flatMap(r=>[...this.getAllSubpackagesWithWebSocket(r)])}getPackageForFernFilepath(t,r=0,n=this.rootPackage){let i=t.allParts[r];if(i==null)return n;let o=n.subpackages.map(l=>{let p=this.subpackages[l];if(p==null)throw new T({message:"Subpackage ID is invalid: "+l,code:T.Code.InternalError});return p}),s=r+1,a={allParts:t.allParts.slice(0,s),packagePath:t.packagePath.slice(0,s),file:s===t.allParts.length?t.file:void 0},c=Vr(i),u=o.find(l=>Vr(l.name)===c);if(u==null){let l=Xu.generateSubpackageId(a),p={docs:void 0,fernFilepath:a,name:i,displayName:void 0,service:void 0,types:[],errors:[],subpackages:[],navigationConfig:void 0,webhooks:void 0,websocket:void 0};this.subpackages[l]=p,n.subpackages.push(l),u=p}return this.getPackageForFernFilepath(t,s,u)}}});function tvu({reference:e,referencedIn:t,imports:r}){let[n,i,...o]=e.split(".");if(n==null||o.length>0)return;if(i==null)return{endpointName:n,relativeFilepath:t};let a=r[n];if(a!=null)return{endpointName:i,relativeFilepath:ySe({referencedIn:t,importPath:a})}}var rvu=h(()=>{"use strict";FWr()});var pUe,dLo=h(()=>{"use strict";Bc();ho();kt();Qme();rvu();pUe=class{workspace;constructor(t){this.workspace=t}resolveEndpointOrThrow({endpoint:t,file:r}){let n=this.resolveEndpoint({endpoint:t,file:r});if(n==null)throw new T({message:"Cannot resolve endpoint: "+t+" in file "+r.relativeFilepath,code:T.Code.ResolutionError});return n}resolveEndpointByMethodAndPath({method:t,path:r,namespace:n,casingsGenerator:i}){let o;return wC(this.workspace,(s,a,c)=>{if(n!=null&&this.getNamespaceFromFilepath(s)!==n)return;let u=wu({relativeFilepath:s,definitionFile:a,casingsGenerator:i,rootApiFile:this.workspace.definition.rootApiFile.contents,defaultUrl:c.defaultUrl});for(let[l,p]of Object.entries(a.service?.endpoints??{}))p.method===t&&p.path===r&&(o={endpointId:l,endpoint:p,file:u})}),z3e(this.workspace,(s,a)=>{if(n!=null&&this.getNamespaceFromFilepath(s)!==n)return;let c=wu({relativeFilepath:s,definitionFile:a,casingsGenerator:i,rootApiFile:this.workspace.definition.rootApiFile.contents});for(let[u,l]of Object.entries(a.service?.endpoints??{}))l.method===t&&l.path===r&&(o={endpointId:u,endpoint:l,file:c})}),o}getNamespaceFromFilepath(t){let r=t.split("/");if(r.length>1)return r[0]}resolveEndpoint({endpoint:t,file:r}){let i=new BH().tryParse(t);if(i!=null)return this.resolveEndpointByMethodAndPath({method:i.method,path:i.path,namespace:i.namespace,casingsGenerator:r.casingsGenerator});let o=this.getDeclarationOfEndpoint({referenceToEndpoint:t,file:r});if(o==null)return;let s=o.file.definitionFile.service?.endpoints?.[o.endpointName];if(s!=null)return{endpointId:o.endpointName,endpoint:s,file:o.file}}getDeclarationOfEndpoint({referenceToEndpoint:t,file:r}){let n=tvu({reference:t,referencedIn:r.relativeFilepath,imports:r.imports});if(n==null)return;let i=Rde(this.workspace,n.relativeFilepath);if(!(i==null||i.service?.endpoints?.[n.endpointName]==null))return{endpointName:n.endpointName,file:wu({relativeFilepath:n.relativeFilepath,definitionFile:i,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}}}});var fUe,mLo=h(()=>{"use strict";Bc();kt();Qme();Oct();fUe=class{workspace;constructor(t){this.workspace=t}getDeclarationOrThrow(t,r){let n=this.getDeclaration(t,r);if(n==null)throw new T({message:"Error does not exist: "+t,code:T.Code.ResolutionError});return n}getDeclaration(t,r){let n=g4({reference:t,referencedIn:r.relativeFilepath,imports:r.imports});if(n==null)return;let i=Rde(this.workspace,n.relativeFilepath);if(i==null)return;let o=i.errors?.[n.typeName];if(o!=null)return{declaration:o,file:wu({definitionFile:i,relativeFilepath:n.relativeFilepath,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}}}});function hLo(e){if(e.length===0)return!1;let t=e.charAt(0);return t>="a"&&t<="z"||t>="A"&&t<="Z"}var E4,gLo=h(()=>{"use strict";Ct();kt();E4=class{typeResolver;constructor(t){this.typeResolver=t}resolveAllReferencesInExample({example:t,file:r}){if(typeof t=="string"){let n=this.resolveExample({example:t,file:r});return n==null?n:typeof n.resolvedExample=="string"?(n.resolvedExample.startsWith(`\\${"$"}`)&&(n.resolvedExample=n.resolvedExample.slice(1)),n):this.resolveAllReferencesInExample({example:n.resolvedExample,file:n.file})}else if(ki(t)){let n={};for(let[i,o]of Object.entries(t)){let s=this.resolveAllReferencesInExample({example:o,file:r});if(s==null)return;let a=i.startsWith(`\\${"$"}`)?i.slice(1):i;n[a]=s.resolvedExample}return{resolvedExample:n}}else if(Array.isArray(t)){let n=[];for(let i of t){let o=this.resolveAllReferencesInExample({example:i,file:r});if(o==null)return;n.push(o.resolvedExample)}return{resolvedExample:n}}return{resolvedExample:t}}resolveAllReferencesInExampleOrThrow({example:t,file:r}){let n=this.resolveAllReferencesInExample({example:t,file:r});if(n==null)throw new T({message:"Failed to resolve examples",code:T.Code.ResolutionError});return n}resolveExample({example:t,file:r}){return typeof t!="string"?{resolvedExample:t,file:r}:t.startsWith("$")?this.parseExampleReference(t)==null?{resolvedExample:t,file:r}:this.resolveExampleReference(t,r):{resolvedExample:t,file:r}}resolveExampleReference(t,r){let n=this.parseExampleReference(t);if(n==null)return;let i=this.typeResolver.getDeclarationOfNamedType({referenceToNamedType:n.rawTypeReference,file:r});if(i==null||typeof i.declaration=="string"||i.declaration.examples==null)return;let o=i.declaration.examples.find(s=>s.name===n.exampleName);if(o!=null)return this.resolveExample({example:o.value,file:i.file})}resolveExampleOrThrow({example:t,file:r}){let n=this.resolveExample({example:t,file:r});if(n==null)throw new T({message:"Cannot resolve example: "+t,code:T.Code.ResolutionError});return n}parseExampleReference(t){let[r,n,i,...o]=t.split(".");if(r==null||n==null||o.length>0)return;if(i==null){let a=r.slice("$".length);return hLo(a)?{rawTypeReference:a,exampleName:n}:void 0}let s=r.slice("$".length);if(!(!hLo(s)||!hLo(n)))return{rawTypeReference:`${s}.${n}`,exampleName:i}}}});function Hym({typeResolver:e,file:t,resolvedType:r,propertyName:n,breadcrumbs:i,rootTypeTitle:o}){let s=Uct({typeResolver:e,file:t,resolvedType:r,propertyName:n});if(!s)throw new T({message:`Cannot find property '${i.join(".")}' in ${o}`,code:T.Code.InternalError});return s}function Uct({typeResolver:e,file:t,resolvedType:r,propertyName:n}){switch(r._type){case"container":switch(r.container._type){case"list":return;case"literal":return;case"map":return;case"nullable":{let i=Uct({typeResolver:e,file:t,resolvedType:r.container.itemType,propertyName:n});return i||void 0}case"optional":{let i=Uct({typeResolver:e,file:t,resolvedType:r.container.itemType,propertyName:n});return i||void 0}case"set":return;default:Ee(r.container)}break;case"primitive":return;case"unknown":return;case"named":{let i=r.declaration;if("properties"in i&&i.properties!=null){for(let[o,s]of Object.entries(i.properties))if(o===n)return e.resolveTypeOrThrow({type:typeof s=="string"?s:s.type,file:r.file})}if("base-properties"in i&&i["base-properties"]!=null){for(let[o,s]of Object.entries(i["base-properties"]))if(o===n)return e.resolveTypeOrThrow({type:typeof s=="string"?s:s.type,file:r.file})}if("extends"in i&&i.extends!=null){let o=Array.isArray(i.extends)?i.extends:[i.extends];for(let s of o){let a=e.resolveTypeOrThrow({type:s,file:r.file}),c=Uct({file:"file"in a?a.file:t,typeResolver:e,resolvedType:a,propertyName:n});if(c)return c}}if("union"in i&&i.union!=null)if(Array.isArray(i.union))for(let o of i.union){let s=e.resolveTypeOrThrow({type:typeof o=="string"?o:o.type,file:r.file}),a=Uct({file:"file"in s?s.file:t,typeResolver:e,resolvedType:s,propertyName:n});if(a)return a}else for(let[,o]of Object.entries(i.union)){let s=typeof o=="string"?o:o.type;if(!s)continue;let a=e.resolveTypeOrThrow({type:s,file:r.file}),c=Uct({file:"file"in a?a.file:t,typeResolver:e,resolvedType:a,propertyName:n});if(c)return c}return}default:Ee(r)}}function dUe(e){switch(e._type){case"container":switch(e.container._type){case"list":return`list<${dUe(e.container.itemType)}>}`;case"literal":return`literal<${e.container.literal._visit({boolean:t=>t.toString(),string:t=>t,_other:t=>t.type})}>`;case"map":return`map<${dUe(e.container.keyType)}, ${dUe(e.container.valueType)}>}`;case"nullable":return`nullable<${dUe(e.container.itemType)}>}`;case"optional":return`optional<${dUe(e.container.itemType)}>}`;case"set":return`set<${dUe(e.container.itemType)}>}`;default:Ee(e.container)}break;case"named":return Vr(e.name.name);case"primitive":return e.primitive.v1;case"unknown":return"unknown";default:Ee(e)}}var a7r,nvu=h(()=>{"use strict";Ct();ho();Wn();lc();kt();Bct();Mct();a7r=class{typeResolver;endpointResolver;constructor(t,r){this.typeResolver=t,this.endpointResolver=r,this.typeResolver=t,this.endpointResolver=r}resolveRequestPropertyOrThrow({file:t,endpoint:r,propertyComponents:n}){let i=this.resolveRequestProperty({file:t,endpoint:r,propertyComponents:n});if(i==null)throw new T({message:"Cannot resolve request property from endpoint: "+r+" in file "+t.relativeFilepath,code:T.Code.ResolutionError});return i}resolveRequestProperty({file:t,endpoint:r,propertyComponents:n}){let i=this.endpointResolver.resolveEndpointOrThrow({endpoint:r,file:t});if(i.endpoint.request==null)return;if(typeof i.endpoint.request!="string")return this.resolveRequestPropertyFromInlinedRequest({typeResolver:this.typeResolver,file:i.file,requestType:i.endpoint.request,propertyComponents:n});let o=this.typeResolver.resolveTypeOrThrow({type:i.endpoint.request,file:i.file}),s=this.resolveObjectProperty({file:i.file,resolvedType:o,propertyComponents:n});if(s!=null)return{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:n,file:t,resolvedType:o}),property:iB.body(s)}}resolveResponsePropertyOrThrow({file:t,endpoint:r,propertyComponents:n}){let i=this.resolveResponseProperty({file:t,endpoint:r,propertyComponents:n});if(i==null)throw new T({message:"Cannot resolve response property from endpoint: "+r+" in file "+t.relativeFilepath,code:T.Code.ResolutionError});return i}resolveResponseProperty({file:t,endpoint:r,propertyComponents:n}){let i=this.endpointResolver.resolveEndpointOrThrow({endpoint:r,file:t}),o=this.typeResolver.resolveTypeOrThrow({type:(typeof i.endpoint.response!="string"?i.endpoint.response?.type:i.endpoint.response)??"",file:i.file}),s=this.resolveObjectProperty({file:i.file,resolvedType:o,propertyComponents:n});if(s!=null)return{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:n,resolvedType:o,file:t}),property:s}}resolveRequestPropertyFromInlinedRequest({typeResolver:t,file:r,requestType:n,propertyComponents:i}){if(i.length===1){let o=i[0]??"",s=n["query-parameters"]?.[o]??void 0;if(s!=null)return{property:iB.query(qWr({file:r,queryParameterKey:o,queryParameter:s})),propertyPath:void 0}}return this.resolveRequestPropertyFromInlinedRequestBody({typeResolver:t,file:r,requestType:n,propertyComponents:i})}resolveRequestPropertyFromInlinedRequestBody({typeResolver:t,file:r,requestType:n,propertyComponents:i}){if(n.body==null)return;if(typeof n.body=="string"){let a=t.resolveTypeOrThrow({type:n.body,file:r}),c=this.resolveObjectProperty({file:r,resolvedType:a,propertyComponents:i});return c==null?void 0:{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:i,file:r,resolvedType:a}),property:iB.body(c)}}if(nA(n.body)){let a=QWr({typeResolver:t,file:r,objectSchema:n.body,propertyComponents:i});return a==null?void 0:{propertyPath:this.propertyPathFromPropertyComponentsFromInlineRequestBody({propertyComponents:i,file:r,body:n.body}),property:iB.body(a)}}let o=t.resolveTypeOrThrow({type:n.body.type,file:r}),s=zWr({typeResolver:t,file:Pct(o)??r,resolvedType:o,propertyComponents:i});if(s!=null)return{propertyPath:this.propertyPathFromPropertyComponents({propertyComponents:i,file:r,resolvedType:o}),property:iB.body(s)}}resolveObjectProperty({file:t,resolvedType:r,propertyComponents:n}){return zWr({typeResolver:this.typeResolver,file:Pct(r)??t,resolvedType:r,propertyComponents:n})}propertyPathFromPropertyComponents({propertyComponents:t,file:r,resolvedType:n}){if(t.length<=1)return[];let i=dUe(n),o=n,s=[],a=[];for(let c of t.slice(0,-1))a.push(c),o=Hym({typeResolver:this.typeResolver,file:r,resolvedType:o,propertyName:c,breadcrumbs:a,rootTypeTitle:i}),s.push({name:r.casingsGenerator.generateName(c),type:o.originalTypeReference});return s}propertyPathFromPropertyComponentsFromInlineRequestBody({propertyComponents:t,file:r,body:n}){if(t.length<=1)return[];let i=[],o=[];for(let s of t.slice(0,-1)){o.push(s);let a=QWr({typeResolver:this.typeResolver,file:r,objectSchema:n,propertyComponents:o});if(!a)throw new T({message:`Cannot find property '${o.join(".")}' in inline request body in file ${r.relativeFilepath}`,code:T.Code.InternalError});i.push({name:r.casingsGenerator.generateName(s),type:a.valueType})}return i}}});var Pf,ALo=h(()=>{"use strict";Bc();ho();Wn();kt();Qme();qMo();Oct();Pf=class{workspace;definitionFiles;constructor(t){this.workspace=t}getDefinitionFile(t){return this.definitionFiles??=r4(this.workspace.definition),this.definitionFiles[t]?.contents}resolveTypeOrThrow({type:t,file:r}){let n=this.resolveType({type:t,file:r});if(n==null)throw new T({message:"Cannot resolve type: "+t+" in file "+r.relativeFilepath,code:T.Code.ResolutionError});return n}getDeclarationOfNamedTypeOrThrow({referenceToNamedType:t,file:r}){let n=this.getDeclarationOfNamedType({referenceToNamedType:t,file:r});if(n==null)throw new T({message:"Cannot find declaration of type: "+t+" in file "+r.relativeFilepath,code:T.Code.ReferenceError});return n}getDeclarationOfNamedType({referenceToNamedType:t,file:r}){let n=g4({reference:t,referencedIn:r.relativeFilepath,imports:r.imports});if(n==null)return;let i=this.getDefinitionFile(n.relativeFilepath);if(i==null)return;let o=i.types?.[n.typeName];if(o==null){let s=cI(n.typeName);if(s!=null){for(let a of Object.keys(i.types??{})??[])if(s.name&&a.startsWith(s.name)&&a.endsWith(">")){let c=i.types?.[a];return c!=null?{typeName:a,declaration:c,file:wu({relativeFilepath:n.relativeFilepath,definitionFile:i,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}:void 0}}return}return{typeName:n.typeName,declaration:o,file:wu({relativeFilepath:n.relativeFilepath,definitionFile:i,casingsGenerator:r.casingsGenerator,rootApiFile:this.workspace.definition.rootApiFile.contents})}}resolveType({type:t,file:r,objectPath:n=[]}){return yC({type:t,_default:void 0,validation:void 0,visitor:{primitive:i=>({_type:"primitive",primitive:i,originalTypeReference:Zr.primitive(i)}),unknown:()=>({_type:"unknown",originalTypeReference:Zr.unknown()}),map:({keyType:i,valueType:o})=>i!=null&&o!=null?{_type:"container",container:{_type:"map",keyType:i,valueType:o},originalTypeReference:Zr.container(Is.map({keyType:i.originalTypeReference,valueType:o.originalTypeReference}))}:void 0,list:i=>i!=null?{_type:"container",container:{_type:"list",itemType:i},originalTypeReference:Zr.container(Is.list(i.originalTypeReference))}:void 0,optional:i=>i!=null?{_type:"container",container:{_type:"optional",itemType:i},originalTypeReference:Zr.container(Is.optional(i.originalTypeReference))}:void 0,nullable:i=>i!=null?{_type:"container",container:{_type:"nullable",itemType:i},originalTypeReference:Zr.container(Is.nullable(i.originalTypeReference))}:void 0,set:i=>i!=null?{_type:"container",container:{_type:"set",itemType:i},originalTypeReference:Zr.container(Is.set(i.originalTypeReference))}:void 0,literal:i=>({_type:"container",container:{_type:"literal",literal:i},originalTypeReference:Zr.container(Is.literal(i))}),named:i=>{let o=this.getDeclarationOfNamedType({referenceToNamedType:i,file:r});if(o==null)return;let s={typeName:o.typeName,file:o.file.relativeFilepath,reference:i};if(!n.some(a=>a.file===s.file&&a.typeName===s.typeName))return this.resolveNamedTypeFromDeclaration({referenceToNamedType:i,referencedIn:r,rawDeclaration:o,objectPath:[...n,s]})}}})}resolveNamedTypeOrThrow({referenceToNamedType:t,file:r}){let n=this.resolveNamedType({referenceToNamedType:t,file:r});if(n==null)throw new T({message:"Cannot resolve type: "+t,code:T.Code.ResolutionError});return n}resolveNamedType({referenceToNamedType:t,file:r}){let n=this.getDeclarationOfNamedType({referenceToNamedType:t,file:r});if(n!=null)return this.resolveNamedTypeFromDeclaration({referenceToNamedType:t,referencedIn:r,rawDeclaration:n})}resolveNamedTypeFromDeclaration({referenceToNamedType:t,referencedIn:r,rawDeclaration:n,objectPath:i=[]}){let{declaration:o,file:s}=n;if(UIe(o))return this.resolveType({type:typeof o=="string"?o:o.type,file:s,objectPath:i});let a=QGt({type:t,_default:void 0,validation:void 0,file:r});if(!(a.type!=="named"||this.getDefinitionFile(s.relativeFilepath)==null))return{_type:"named",rawName:n.typeName,name:a,declaration:o,filepath:s.relativeFilepath,objectPath:i,originalTypeReference:a,file:s}}}});var JK,yLo=h(()=>{"use strict";kt();Qme();JK=class e{static VARIABLE_PREFIX="$";getDeclarationOrThrow(t,r){let n=this.getDeclaration(t,r);if(n==null)throw new T({message:"Variable does not exist: "+t,code:T.Code.ResolutionError});return n}getDeclaration(t,r){if(!t.startsWith(e.VARIABLE_PREFIX))return;let n=r.rootApiFile.variables?.[t.substring(1)];if(n!=null)return{declaration:n,file:zme({casingsGenerator:r.casingsGenerator,rootApiFile:r.rootApiFile})}}getVariableIdOrThrow(t){let r=this.getVariableId(t);if(r==null)throw new T({message:"Variable reference does not start with "+e.VARIABLE_PREFIX,code:T.Code.ResolutionError});return r}getVariableId(t){if(t.startsWith(e.VARIABLE_PREFIX))return t.substring(e.VARIABLE_PREFIX.length)}}});function bLo(e,t){if(Array.isArray(e)){for(let r of e)bLo(r,t);return}if(!(e==null||typeof e!="object")){for(let[r,n]of Object.entries(e))if(!Kym.has(r)){if(r==="typeId"&&typeof n=="string"){t.add(n);continue}bLo(n,t)}}}function ISe(e,t,r){switch(e.type){case"named":{let n=[e.typeId],i=t[e.typeId];return i?.shape.type==="alias"&&!r.has(e.typeId)&&(r.add(e.typeId),n.push(...ISe(i.shape.aliasOf,t,r))),n}case"container":switch(e.container.type){case"list":return ISe(e.container.list,t,r);case"set":return ISe(e.container.set,t,r);case"map":return[...ISe(e.container.keyType,t,r),...ISe(e.container.valueType,t,r)];case"optional":return ISe(e.container.optional,t,r);case"nullable":return ISe(e.container.nullable,t,r);case"literal":return[];default:return[]}case"primitive":case"unknown":return[];default:return[]}}function Jym(e,t){let r=[],n=[],i=o=>{n.push(...ISe(o,t,new Set))};return e.shape._visit({alias:o=>{i(o.aliasOf)},enum:()=>{},object:o=>{for(let s of o.extends)n.push(s.typeId);for(let s of[...o.properties,...o.extendedProperties??[]])i(s.valueType)},union:o=>{for(let s of o.extends)n.push(s.typeId);for(let s of o.baseProperties)i(s.valueType);for(let s of o.types)s.shape._visit({samePropertiesAsObject:a=>{r.push(a.typeId)},singleProperty:a=>{i(a.type)},noProperties:()=>{},_other:()=>{}})},undiscriminatedUnion:o=>{for(let s of o.members)i(s.type)},_other:()=>{}}),{variantEdges:r,nonVariantEdges:n}}function Yym(e){let t=new Map,r=new Set;for(let[n,i]of Object.entries(e.types)){let{variantEdges:o,nonVariantEdges:s}=Jym(i,e.types);for(let a of o){let c=t.get(a)??new Set;c.add(n),t.set(a,c)}for(let a of s)r.add(a)}for(let n of[e.services,e.webhookGroups,e.websocketChannels,e.errors,e.headers,e.idempotencyHeaders,e.pathParameters,e.variables])bLo(n,r);return{variantReferrers:t,nonVariantReferenced:r}}function Xym(e,t){let r=t[e];if(r!=null)switch(r.shape.type){case"object":return e;case"alias":{let n=r.shape.resolvedType;return n.type==="named"&&n.shape==="OBJECT"?n.name.typeId:void 0}default:return}}function ivu(e,t){let r=new Map,n=Xym(e,t);if(n==null)return r;let i=t[n];if(i==null||i.shape.type!=="object")return r;for(let o of[...i.shape.properties,...i.shape.extendedProperties??[]])r.set(ar(o.name),{valueType:o.valueType,name:svu(o.name)});return r}function ovu(e,t){return JSON.stringify(e)===JSON.stringify(t)}function svu(e){return typeof e=="string"?{wireValue:e,name:e}:e}function Zym(e){let{types:t}=e,r=new Map,n=new Map,i=new Map;for(let[a,c]of Object.entries(t)){if(c.shape.type!=="union")continue;let u=c.shape;if(u.baseProperties.length===0)continue;let l=new Map;for(let m of u.baseProperties)l.set(ar(m.name),m.valueType);if(i.set(a,l),!u.types.every(m=>m.shape.propertiesType==="samePropertiesAsObject")){r.set(a,[]);continue}let d=u.types.map(m=>m.shape.propertiesType==="samePropertiesAsObject"?ivu(m.shape.typeId,t):new Map),f=[];for(let m of u.baseProperties){let g=ar(m.name);d.every(y=>{let I=y.get(g);return I!=null&&ovu(I.valueType,m.valueType)})&&f.push(svu(m.name))}r.set(a,f)}let{variantReferrers:o,nonVariantReferenced:s}=Yym(e);for(let[a,c]of o){let u=t[a];if(u==null||u.shape.type!=="object"||s.has(a))continue;let l=ivu(a,t);if(l.size===0)continue;let p=[];for(let[d,f]of l)[...c].every(g=>{let A=i.get(g)?.get(d);return A!=null&&ovu(A,f.valueType)})&&p.push(f.name);p.length>0&&n.set(a,p)}return{inheritedBasePropertiesByUnion:r,deferredUnionBasePropertiesByObject:n}}function avu(e){let{inheritedBasePropertiesByUnion:t,deferredUnionBasePropertiesByObject:r}=Zym(e);e.types=Object.fromEntries(Object.entries(e.types).map(([n,i])=>{switch(i.shape.type){case"union":return[n,{...i,shape:{...i.shape,inheritedBaseProperties:t.get(n)??[]}}];case"object":{let o=r.get(n);return[n,{...i,shape:{...i.shape,deferredUnionBaseProperties:o}}]}default:return[n,i]}}))}var Kym,cvu=h(()=>{"use strict";lc();Kym=new Set(["v2Examples","autogeneratedExamples","userSpecifiedExamples","userProvidedExamples","examples","example"])});function c7r(e,t){if(t){for(let[r,n]of Object.entries(t))if(typeof n!="string"&&r===e)return n.audiences}}var uvu=h(()=>{"use strict"});function pvu({workspace:e}){let t=e.generatorsConfiguration?.api?.settings,r={...lvu};for(let n of Object.keys(lvu)){let i=t?.[n];i!==void 0&&(r[n]=i)}return r}var lvu,fvu=h(()=>{"use strict";ls();lvu={pathParameterOrder:Hr.PathParameterOrder.UrlOrder}});function fA({workspace:e,generationLanguage:t,keywords:r,smartCasing:n,smartCasingDigitWordBoundary:i,exampleGeneration:o,audiences:s,readme:a,packageName:c,userAgentTemplate:u,idempotencyKeyGeneration:l,webhookSignature:p,organization:d,version:f,context:m,fdrApiDefinitionId:g,sourceResolver:A,disableDynamicExamples:y,dynamicGeneratorConfig:I,generationMetadata:x}){let v=t===Hr.GenerationLanguage.CLI?void 0:t,S=pvu({workspace:e}),B=Lw({generationLanguage:v,keywords:r,smartCasing:n,smartCasingDigitWordBoundary:i}),R=new iUe(s),D=zme({casingsGenerator:B,rootApiFile:e.definition.rootApiFile.contents}),O=(e.definition.rootApiFile.contents.errors??[]).map(Se=>({error:ESe({errorName:Se,file:D}),docs:void 0})),z=new Pf(e),Y=new pUe(e),$=new a7r(z,Y),ee=new fUe(e),ae=new E4(z),pe=new JK,me=IGt({casingsGenerator:B,rawApiFileSchema:e.definition.rootApiFile.contents})?.environmentsConfig,xe={selfHosted:!1,fdrApiDefinitionId:g,apiVersion:gIu({file:D,rawApiFileSchema:e.definition.rootApiFile.contents}),specVersion:e.definition.specVersion,apiName:B.generateName(e.definition.rootApiFile.contents.name),apiDisplayName:e.definition.rootApiFile.contents["display-name"],apiDocs:RGt(e.definition.rootApiFile.contents.docs),auth:mIu({rawApiFileSchema:e.definition.rootApiFile.contents,file:D,propertyResolver:$,endpointResolver:Y,typeResolver:z}),headers:e.definition.rootApiFile.contents.headers!=null?Object.entries(e.definition.rootApiFile.contents.headers).map(([Se,Te])=>s8({headerKey:Se,header:Te,file:D})):[],idempotencyHeaders:e.definition.rootApiFile.contents["idempotency-headers"]!=null?Object.entries(e.definition.rootApiFile.contents["idempotency-headers"]).map(([Se,Te])=>s8({headerKey:Se,header:Te,file:D})):[],types:{},errors:{},services:{},constants:ZEu(B),environments:me,errorDiscriminationStrategy:CIu(e.definition.rootApiFile.contents["error-discrimination"],D),basePath:e.definition.rootApiFile.contents["base-path"]!=null?eb(e.definition.rootApiFile.contents["base-path"]):void 0,pathParameters:Lct({pathParameters:e.definition.rootApiFile.contents["path-parameters"],file:D,location:Xt.PathParameterLocation.Root,variableResolver:pe}),variables:e.definition.rootApiFile.contents.variables!=null?Object.entries(e.definition.rootApiFile.contents.variables).map(([Se,Te])=>({docs:typeof Te!="string"?Te.docs:void 0,id:Se,name:D.casingsGenerator.generateName(Se),type:D.parseTypeReference(Te),envVar:typeof Te!="string"?tbm(Te.env):void 0})):[],globalParameters:e.definition.rootApiFile.contents["global-parameters"]!=null?SIu({globalParameters:e.definition.rootApiFile.contents["global-parameters"],file:D}):void 0,serviceTypeReferenceInfo:{typesReferencedOnlyByService:{},sharedTypes:[]},webhookGroups:{},websocketChannels:{},readmeConfig:void 0,sourceConfig:void 0,publishConfig:void 0,dynamic:void 0,audiences:e.definition.rootApiFile.contents.audiences,generationMetadata:x,apiPlayground:!0,casingsConfig:{generationLanguage:v,keywords:r,smartCasing:n,smartCasingDigitWordBoundary:i}},Re=new s7r,ce=Se=>{Re.addSubpackage(Se.fernFilepath),Yp(Se.definitionFile,{imports:It,docs:Te=>{Te!=null&&Re.addDocs(Se.fernFilepath,Te)},types:Te=>{if(Te!=null)for(let[ut,Ye]of Object.entries(Te)){if(jV(ut))continue;let qe=qIu({typeName:ut,typeDeclaration:Ye,file:Se,typeResolver:z,exampleResolver:ae,sourceResolver:A,workspace:e}),at=qe.typeDeclaration;o.disabled&&(at.userProvidedExamples=[],at.autogeneratedExamples=[]);let vt=qe.descendantFilepaths,or=Xu.generateTypeId(at.name);xe.types[or]=at,Re.addType(or,at),R.addType({declaredTypeName:at.name,descendantTypeIds:at.referencedTypes,descendantTypeIdsByAudience:{},propertiesByAudience:qe.propertiesByAudience,descendantFilepaths:vt}),R.markTypeForAudiences(at.name,P0u(Ye))}},errors:Te=>{if(Te==null)return;if(e.definition.rootApiFile.contents["error-discrimination"]==null)throw new T({message:"error-discrimination is missing in api.yml but there are declared errors.",code:T.Code.ConfigError});for(let[Ye,qe]of Object.entries(Te)){let at=EIu({errorName:Ye,errorDeclaration:qe,file:Se,typeResolver:z,exampleResolver:ae,workspace:e}),vt=Xu.generateErrorId(at.name);xe.errors[vt]=at,Re.addError(vt,at),R.addError(at)}},service:Te=>{if(Te==null)return;let ut=HEu({rootDefaultUrl:Se.defaultUrl??e.definition.rootApiFile.contents["default-url"],rootPathParameters:xe.pathParameters,serviceDefinition:Te,file:Se,errorResolver:ee,typeResolver:z,propertyResolver:$,exampleResolver:ae,sourceResolver:A,globalErrors:O,variableResolver:pe,workspace:e,auth:xe.auth,irSettings:S}),Ye=Xu.generateServiceId(ut.name);xe.services[Ye]=ut,Re.addService(Ye,ut);let qe={};ut.endpoints.forEach(at=>{o.disabled&&(at.autogeneratedExamples=[],at.userSpecifiedExamples=[]);let vt=Vr(at.name),or=Te.endpoints[vt];R.addEndpoint(ut,at,or),qe[vt]=at}),Te.audiences!=null&&R.markEndpointForAudience(ut.name,ut.endpoints,Te.audiences),Object.entries(Te.endpoints).map(([at,vt])=>{let or=qe[at];or!=null&&vt.audiences!=null&&R.markEndpointForAudience(ut.name,[or],vt.audiences)})},webhooks:Te=>{if(Te==null)return;let ut=Xu.generateWebhookGroupId(Se.fernFilepath),Ye=PIu({webhooks:Te,file:Se,typeResolver:z,exampleResolver:ae,workspace:e,defaultSignature:Se.definitionFile["webhook-signature"]??p}),qe={};for(let at of Ye)qe[Vr(at.name)]=at;Object.entries(Te).forEach(([at,vt])=>{let or=qe[at];or!=null&&(R.addWebhook(Se.fernFilepath,or,vt),vt.audiences!=null&&R.markWebhookForAudiences(Se.fernFilepath,or,vt.audiences))}),xe.webhookGroups[ut]=Ye,Re.addWebhookGroup(ut,Se.fernFilepath)},"webhook-signature":It,channel:Te=>{if(Te==null)return;let ut=Xu.generateWebSocketChannelId(Se.fernFilepath),Ye=yIu({channel:Te,file:Se,variableResolver:pe,typeResolver:z,exampleResolver:ae,workspace:e});R.addChannel(Se.fernFilepath,ut,Ye,Te),Te.audiences!=null&&R.markChannelForAudiences(Se.fernFilepath,ut,Te.audiences),xe.websocketChannels!=null&&(xe.websocketChannels[ut]=Ye,Re.addWebSocketChannel(ut,Se.fernFilepath))}})};wC(e,(Se,Te,ut)=>{ce(wu({relativeFilepath:Se,definitionFile:Te,casingsGenerator:B,rootApiFile:e.definition.rootApiFile.contents,defaultUrl:ut.defaultUrl}))}),z3e(e,(Se,Te)=>{if(Te.navigation!=null)if(typeof Te.navigation=="string")Re.addPackageRedirection({from:nM({relativeFilepath:Se,casingsGenerator:B}),to:nM({relativeFilepath:fv(xV(Se),Ws.of(Te.navigation)),casingsGenerator:B})});else{let ut=Te.navigation.map(Ye=>Xu.generateSubpackageId(nM({relativeFilepath:fv(xV(Se),Ws.of(Ye)),casingsGenerator:B})));Se===rd?Re.sortRootPackage(ut):Re.sortSubpackage(Xu.generateSubpackageId(nM({relativeFilepath:Se,casingsGenerator:B})),ut)}}),xe.serviceTypeReferenceInfo=ebm(R),JIu(xe),avu(xe),PGt(xe,{onWarning:Se=>m.logger.warn(Se)}),xGt({ir:xe});let ue=o.disabled?xe:wGt({ir:xe,exampleGeneration:o}),Pe=e.definition.rootApiFile.contents,Ie=me?.environments._visit({singleBaseUrl:Se=>Se.environments.filter(Te=>c7r(Te.id,Pe.environments)!=null).length===0,multipleBaseUrls:Se=>Se.environments.filter(Te=>c7r(Te.id,Pe.environments)!=null).length===0,_other:()=>!1});me?.environments.environments.forEach(Se=>{R.markEnvironmentForAudiences(Se,c7r(Se.id,Pe.environments)??[],Ie)});let Be=R.hasNoAudiences()?void 0:R.build(),_e=OGt(ue,Be),$e=e.definition.rootApiFile.contents.auth!=null&&Object.values(_e.services).every(Se=>Se.endpoints.every(Te=>Te.auth)),Et=Object.values(_e.services).some(Se=>Se.endpoints.some(Te=>Te.response?.body?.type==="streaming")),mt=Object.values(_e.services).some(Se=>Se.endpoints.some(Te=>Te.pagination!=null)),Ht=Object.values(_e.services).some(Se=>Se.endpoints.some(Te=>Te.response?.body?.type==="fileDownload")),ur=_e.headers.some(Se=>(typeof Se.name=="string"?Se.name:Se.name.wireValue).toLowerCase()==="user-agent"),Ce={isAuthMandatory:$e,hasStreamingEndpoints:Et,hasPaginatedEndpoints:mt,hasFileDownloadEndpoints:Ht,idempotencyKeyGeneration:l,webhookSignatureVerification:aLo({signature:p,file:D}),platformHeaders:{language:"X-Fern-Language",sdkName:"X-Fern-SDK-Name",sdkVersion:"X-Fern-SDK-Version",userAgent:(()=>{if(!ur){if(u!=null&&f!=null){let Se={version:f,packageName:c??"",language:v??"",generatorVersion:x?.generatorVersion??"",organization:d??"",apiName:e.definition.rootApiFile.contents.name??""};return{header:"User-Agent",value:u.replace(/\{(\w+)\}/g,(ut,Ye)=>Se[Ye]??"")}}if(f!=null&&c!=null)return{header:"User-Agent",value:`${c}/${f}`}}})()}},ge=a??e.generatorsConfiguration?.rawConfiguration.readme,ot=ge!=null?TIu({readme:ge,services:xe.services}):void 0,ht=$ym({..._e,...Re.build(Be),sdkConfig:Ce,readmeConfig:ot});return{...ht,dynamic:lUe({ir:ht,generatorConfig:I,disableExamples:y,generationLanguage:v,smartCasing:n,smartCasingDigitWordBoundary:i})}}function $ym(e){let t=r=>{if(!r||typeof r!="object")return r;if(Array.isArray(r))return r.map(t);for(let n in r){let i=r[n];n==="docs"&&typeof i=="string"?r[n]=RGt(i):i&&typeof i=="object"&&t(i)}return r};return t(e)}function ebm(e){let t={},r=[],n=e.getTypesReferencedByService();for(let[i,o]of Object.entries(n)){if(o.size===1){let s=o.values().next().value;if(s==null)break;t[s]===void 0&&(t[s]=[]),t[s]?.push(i);continue}r.push(i)}return{typesReferencedOnlyByService:t,sharedTypes:r}}function tbm(e){let t=e?.trim();return t!=null&&t.length>0?t:void 0}var dvu=h(()=>{"use strict";Bc();r8();ls();Ct();ho();Wn();lc();Vy();kt();$Eu();hIu();AIu();bIu();A4();IIu();xIu();wIu();OIu();kIu();uUe();WIu();ZMo();ZIu();Qme();zMo();evu();dLo();mLo();gLo();nvu();ALo();yLo();cvu();Tct();uvu();fvu();jGt()});var gp=h(()=>{"use strict";_Mo();uUe();YMo();Mct();kct();_Gt();ZMo();XEu();Qme();dvu();dLo();mLo();gLo();ALo();yLo();Tct();Fct();FGt();FWr();Oct()});var sCu=h(()=>{"use strict"});var w6o=h(()=>{"use strict";sCu()});var aCu=h(()=>{"use strict";w6o()});var cCu=h(()=>{"use strict"});var uCu=h(()=>{"use strict"});var T6o=h(()=>{"use strict";cCu();uCu()});var lCu=h(()=>{"use strict";T6o()});var pCu=h(()=>{"use strict"});var fCu=h(()=>{"use strict"});var dCu=h(()=>{"use strict"});var mCu,hCu=h(()=>{"use strict";mCu={None:"none",Header:"header"}});var gCu=h(()=>{"use strict"});var ACu=h(()=>{"use strict"});var yCu=h(()=>{"use strict"});var O6o=h(()=>{"use strict";pCu();fCu();dCu();hCu();gCu();ACu();yCu()});var bCu=h(()=>{"use strict";O6o()});var ECu=h(()=>{"use strict"});var ICu=h(()=>{"use strict"});var vCu=h(()=>{"use strict"});var CCu=h(()=>{"use strict"});var xCu=h(()=>{"use strict"});var SCu=h(()=>{"use strict"});var wCu=h(()=>{"use strict"});var TCu=h(()=>{"use strict"});var OCu=h(()=>{"use strict"});var PCu=h(()=>{"use strict"});var BCu=h(()=>{"use strict"});var RCu=h(()=>{"use strict"});var DCu=h(()=>{"use strict"});var P6o=h(()=>{"use strict";ECu();ICu();vCu();CCu();xCu();SCu();wCu();TCu();OCu();PCu();BCu();RCu();DCu()});var kCu=h(()=>{"use strict";P6o()});var FCu=h(()=>{"use strict";aCu();w6o();lCu();T6o();bCu();O6o();kCu();P6o()});var B6o=h(()=>{"use strict";FCu()});var YK,NCu,YGt,R6o,SUI,D6o=h(()=>{"use strict";YK={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},NCu={[YK.Debug]:1,[YK.Info]:2,[YK.Warn]:3,[YK.Error]:4},YGt=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},R6o=class{level;logger;silent;constructor(t){this.level=NCu[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=NCu[t]}isDebug(){return this.shouldLog(YK.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(YK.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(YK.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(YK.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},SUI=new R6o({level:YK.Info,logger:new YGt,silent:!0})});var jCu,zCu=h(()=>{"use strict";D6o();(function(e){e.LogLevel=YK,e.ConsoleLogger=YGt})(jCu||(jCu={}))});var QCu=h(()=>{"use strict";zCu()});var MCu=h(()=>{"use strict";QCu()});var LCu=h(()=>{"use strict"});var _Cu=h(()=>{"use strict";D6o()});var UCu=h(()=>{"use strict"});var ml,_w=h(()=>{"use strict";ml={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function jm(e,t){return`Expected ${t}. Received ${O0m(e)}.`}function O0m(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}var AN=h(()=>{"use strict"});function MT(e){return{...e,json:VCu(e.json),parse:VCu(e.parse)}}function VCu(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
508
508
  `)),{ok:!0,value:t}):n}}var Pre=h(()=>{"use strict"});function y7r(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var k6o=h(()=>{"use strict"});var Hct,F6o=h(()=>{"use strict";k6o();Hct=class extends Error{errors;constructor(t){super(t.map(y7r).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});var Kct,N6o=h(()=>{"use strict";k6o();Kct=class extends Error{errors;constructor(t){super(t.map(y7r).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});function bh(e){return{nullable:()=>P0m(e),optional:()=>j6o(e),optionalNullable:()=>B0m(e),transform:t=>z6o(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new Kct(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new Hct(n.errors)}}}function P0m(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>ml.NULLABLE};return{...t,...bh(t)}}function j6o(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>ml.OPTIONAL};return{...t,...bh(t)}}function B0m(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>ml.OPTIONAL_NULLABLE};return{...t,...bh(t)}}function z6o(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...bh(r)}}var GCu=h(()=>{"use strict";_w();F6o();N6o()});var aM=h(()=>{"use strict";GCu();F6o();N6o()});function qCu(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:jm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:jm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>ml.BIGINT};return{...MT(e),...bh(e)}}var WCu=h(()=>{"use strict";_w();AN();Pre();aM()});var HCu=h(()=>{"use strict";WCu()});function KCu(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:jm(t,"string")}]}:R0m.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:jm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:jm(t,"Date object")}]},getType:()=>ml.DATE};return{...MT(e),...bh(e)}}var R0m,JCu=h(()=>{"use strict";_w();AN();Pre();aM();R0m=/^([+-]?\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)?)?)?)?$/});var YCu=h(()=>{"use strict";JCu()});function LT(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...MT(r),...bh(r)}}}var Bre=h(()=>{"use strict";aM();Pre()});function b7r(e){let t=new Set(e);return LT(ml.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:jm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:jm(n,"enum")}]}:{ok:!0,value:n})()}var XCu=h(()=>{"use strict";_w();Bre();AN()});var Q6o=h(()=>{"use strict";XCu()});function ZCu(e){let t=M6o(e);return{...t,...bh(t)}}function M6o(e){return{parse:(t,r)=>Jct(e).parse(t,r),json:(t,r)=>Jct(e).json(t,r),getType:()=>Jct(e).getType()}}function Jct(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var L6o=h(()=>{"use strict";aM()});function _6o(e){return Object.entries(e)}var $Cu=h(()=>{"use strict"});function XGt(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var U6o=h(()=>{"use strict"});function Lme(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var ZGt=h(()=>{"use strict"});function $Gt(e){return Object.keys(e)}var V6o=h(()=>{"use strict"});function exu(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var txu=h(()=>{"use strict"});function XK(e){return{withParsedProperties:t=>G6o(e,t)}}function G6o(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(D0m.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!Lme(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:jm(n,"object")}]};let o=new Set(Object.keys(t)),s=XGt(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...bh(r),...XK(r)}}var D0m,rxu=h(()=>{"use strict";U6o();AN();ZGt();aM();D0m=Object.prototype.hasOwnProperty});var eqt=h(()=>{"use strict";rxu()});function nxu(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function _me(e){return e.isProperty}var q6o=h(()=>{"use strict"});function E7r(e){let t;function r(){if(t==null){t={};for(let[d,f]of _6o(e)){let m=_me(f)?f.rawKey:d,g=_me(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of _6o(e)){let m=_me(f)?f.rawKey:d,g=_me(f)?f.valueSchema:f;F0m(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function u(){return o==null&&a(),o}function l(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>_me(f)?f.rawKey:d),_getParsedProperties:()=>$Gt(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return ixu({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return ixu({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:g=>{let A=e[g];if(A!=null)return _me(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>ml.OBJECT};return{...MT(p),...bh(p),...XK(p),...gUe(p)}}function ixu({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Lme(e))return{ok:!1,errors:[{path:s,message:jm(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!k0m.call(e,l))continue;let p=e[l],d=n(l);if(d!=null){a>0&&r.has(l)&&a--;let f=d.transform(p);f.ok?u[d.transformedKey]=f.value:(u[l]=p,c.push(...f.errors))}else switch(i){case"fail":c.push({path:[...s,l],message:`Unexpected key "${l}"`});break;case"strip":break;case"passthrough":u[l]=p;break}}if(a>0)for(let l of t)l in e||c.push({path:s,message:`Missing required key "${l}"`});return c.length===0||o?{ok:!0,value:u}:{ok:!1,errors:c}}function gUe(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>oxu({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>oxu({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>ml.OBJECT};return{...r,...bh(r),...XK(r),...gUe(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))t.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,u]of Object.entries(i))r.has(c)||(a[c]=u);return{ok:!0,value:{...a,...s.value}}},getType:()=>ml.OBJECT};return{...n,...bh(n),...XK(n),...gUe(n)}}}}function oxu({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Lme(t))return{ok:!1,errors:[{path:i,message:jm(t,"object")}]};let o=new Set(e),[s,a]=exu($Gt(t),l=>o.has(l)),c=r(XGt(t,a)),u=n(XGt(t,s));return c.ok&&u.ok?{ok:!0,value:{...c.value,...u.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function F0m(e){return!N0m(e)}function N0m(e){switch(e.getType()){case ml.ANY:case ml.UNKNOWN:case ml.OPTIONAL:case ml.OPTIONAL_NULLABLE:return!0;default:return!1}}var k0m,W6o=h(()=>{"use strict";_w();$Cu();U6o();AN();ZGt();V6o();Pre();txu();eqt();aM();q6o();k0m=Object.prototype.hasOwnProperty});function sxu(e){return E7r(e)}var axu=h(()=>{"use strict";W6o()});var H6o=h(()=>{"use strict";W6o();axu();q6o()});function cxu(e){let t={...M6o(e),_getRawProperties:()=>Jct(e)._getRawProperties(),_getParsedProperties:()=>Jct(e)._getParsedProperties()};return{...t,...bh(t),...XK(t),...gUe(t)}}var uxu=h(()=>{"use strict";H6o();eqt();aM();L6o()});var lxu=h(()=>{"use strict";L6o();uxu()});function I7r(e){let t={parse:(r,n)=>pxu(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>pxu(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>ml.LIST};return{...MT(t),...bh(t)}}function pxu(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:jm(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);o.ok?r.push(o.value):n.push(...o.errors)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var fxu=h(()=>{"use strict";_w();AN();Pre();aM()});var K6o=h(()=>{"use strict";fxu()});function dxu(e){return LT(ml.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:jm(r,`${e.toString()}`)}]})()}var mxu=h(()=>{"use strict";_w();Bre();AN()});function hxu(e){return LT(ml.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:jm(r,`"${e}"`)}]})()}var gxu=h(()=>{"use strict";_w();Bre();AN()});var Axu=h(()=>{"use strict";mxu();gxu()});var yxu,bxu=h(()=>{"use strict";_w();Bre();yxu=LT(ml.ANY,e=>({ok:!0,value:e}))});var Exu,Ixu=h(()=>{"use strict";_w();Bre();AN();Exu=LT(ml.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:jm(e,"boolean")}]})});var vxu,Cxu=h(()=>{"use strict";_w();Bre();vxu=LT(ml.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var xxu,Sxu=h(()=>{"use strict";_w();Bre();AN();xxu=LT(ml.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:jm(e,"number")}]})});var wxu,Txu=h(()=>{"use strict";_w();Bre();AN();wxu=LT(ml.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:jm(e,"string")}]})});var Oxu,Pxu=h(()=>{"use strict";_w();Bre();Oxu=LT(ml.UNKNOWN,e=>({ok:!0,value:e}))});var Bxu=h(()=>{"use strict";bxu();Ixu();Cxu();Sxu();Txu();Pxu()});function Dxu(e,t){let r={parse:(n,i)=>Rxu({value:n,isKeyNumeric:e.getType()===ml.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Rxu({value:n,isKeyNumeric:e.getType()===ml.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>ml.RECORD};return{...MT(r),...bh(r)}}function Rxu({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Lme(e))return{ok:!1,errors:[{path:i,message:jm(e,"object")}]};let o={},s=[];for(let a in e){if(!j0m.call(e,a))continue;let c=e[a];if(c===void 0)continue;let u=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(u=d)}let l=r(u),p=n(c,u);l.ok&&p.ok?o[l.value]=p.value:(l.ok||s.push(...l.errors),p.ok||s.push(...p.errors))}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var j0m,kxu=h(()=>{"use strict";_w();AN();ZGt();Pre();aM();j0m=Object.prototype.hasOwnProperty});var Fxu=h(()=>{"use strict";kxu()});function Nxu(e){let t=I7r(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:jm(n,"Set")}]},getType:()=>ml.SET};return{...MT(r),...bh(r)}}var jxu=h(()=>{"use strict";_w();AN();Pre();K6o();aM()});var zxu=h(()=>{"use strict";jxu()});function Mxu(e){let t={parse:(r,n)=>Qxu((i,o)=>i.parse(r,o),e,n),json:(r,n)=>Qxu((i,o)=>i.json(r,o),e,n),getType:()=>ml.UNDISCRIMINATED_UNION};return{...MT(t),...bh(t)}}function Qxu(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var Lxu=h(()=>{"use strict";_w();Pre();aM()});var _xu=h(()=>{"use strict";Lxu()});function Uxu(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var Vxu=h(()=>{"use strict"});function qxu(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=b7r($Gt(t)),o={parse:(s,a)=>Gxu({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>Gxu({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>ml.UNION};return{...MT(o),...bh(o),...XK(o)}}function Gxu({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Lme(e))return{ok:!1,errors:[{path:a,message:jm(e,"object")}]};let c=e[t],u={};for(let f in e)z0m.call(e,f)&&f!==t&&(u[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let l=n(c);if(!l.ok)return{ok:!1,errors:l.errors};let p=i(l.value);if(p==null)return o?{ok:!0,value:{[r]:l.value,...u}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(u,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var z0m,Wxu=h(()=>{"use strict";_w();AN();ZGt();V6o();Pre();Q6o();eqt();aM();z0m=Object.prototype.hasOwnProperty});var Hxu=h(()=>{"use strict";Vxu();Wxu()});var Kxu=h(()=>{"use strict";HCu();YCu();Q6o();lxu();K6o();Axu();H6o();eqt();Bxu();Fxu();aM();zxu();_xu();Hxu()});var go={};te(go,{JsonError:()=>Hct,ParseError:()=>Kct,any:()=>yxu,bigint:()=>qCu,boolean:()=>Exu,booleanLiteral:()=>dxu,date:()=>KCu,discriminant:()=>Uxu,enum_:()=>b7r,getObjectLikeUtils:()=>XK,getObjectUtils:()=>gUe,getSchemaUtils:()=>bh,isProperty:()=>_me,lazy:()=>ZCu,lazyObject:()=>cxu,list:()=>I7r,never:()=>vxu,number:()=>xxu,object:()=>E7r,objectWithoutOptionalProperties:()=>sxu,optional:()=>j6o,property:()=>nxu,record:()=>Dxu,set:()=>Nxu,string:()=>wxu,stringLiteral:()=>hxu,transform:()=>z6o,undiscriminatedUnion:()=>Mxu,union:()=>qxu,unknown:()=>Oxu,withParsedProperties:()=>G6o});var Jxu=h(()=>{"use strict";Kxu()});var Yxu=h(()=>{"use strict"});var dE=h(()=>{"use strict";LCu();_Cu();UCu();Jxu();Yxu()});var Rre,Yct=h(()=>{"use strict";dE();Rre=go.objectWithoutOptionalProperties({docs:go.string().optional()})});var J6o=h(()=>{"use strict";Yct()});var Y6o={};te(Y6o,{WithDocs:()=>Rre});var Xxu=h(()=>{"use strict";J6o()});var v7r,X6o=h(()=>{"use strict";dE();v7r=go.string()});var C7r,Z6o=h(()=>{"use strict";dE();C7r=go.enum_(["none","header"])});var Xct,x7r=h(()=>{"use strict";dE();Z6o();Xct=go.undiscriminatedUnion([C7r,go.string()])});var S7r,$6o=h(()=>{"use strict";dE();S7r=go.enum_(["rid","string","safelong","integer","double","boolean","binary"])});var vSe,tqt=h(()=>{"use strict";dE();$6o();vSe=go.undiscriminatedUnion([S7r,go.string()])});var w7r,e3o=h(()=>{"use strict";dE();tqt();w7r=go.objectWithoutOptionalProperties({type:vSe,docs:go.string().optional()})});var CSe,rqt=h(()=>{"use strict";dE();tqt();e3o();CSe=go.undiscriminatedUnion([vSe,w7r])});var T7r,t3o=h(()=>{"use strict";dE();T7r=go.enum_(["path","query","body"])});var O7r,r3o=h(()=>{"use strict";dE();Yct();t3o();O7r=go.objectWithoutOptionalProperties({paramType:go.property("param-type",T7r),type:go.string()}).extend(Rre)});var P7r,n3o=h(()=>{"use strict";dE();r3o();P7r=go.undiscriminatedUnion([go.string(),O7r])});var B7r,i3o=h(()=>{"use strict";dE();Yct();rqt();n3o();x7r();B7r=go.objectWithoutOptionalProperties({http:go.string(),auth:Xct.optional(),args:go.record(go.string(),P7r).optional(),returns:CSe.optional()}).extend(Rre)});var R7r,o3o=h(()=>{"use strict";dE();Yct();x7r();i3o();R7r=go.objectWithoutOptionalProperties({name:go.string().optional(),package:go.string().optional(),basePath:go.property("base-path",go.string().optional()),defaultAuth:go.property("default-auth",Xct.optional()),endpoints:go.record(go.string(),B7r).optional()}).extend(Rre)});var D7r,s3o=h(()=>{"use strict";dE();tqt();D7r=go.objectWithoutOptionalProperties({alias:vSe,docs:go.string().optional()})});var k7r,a3o=h(()=>{"use strict";dE();Yct();k7r=go.objectWithoutOptionalProperties({value:go.string()}).extend(Rre)});var F7r,c3o=h(()=>{"use strict";dE();a3o();F7r=go.undiscriminatedUnion([go.string(),k7r])});var N7r,u3o=h(()=>{"use strict";dE();c3o();N7r=go.objectWithoutOptionalProperties({values:go.list(F7r)})});var j7r,l3o=h(()=>{"use strict";dE();rqt();j7r=go.objectWithoutOptionalProperties({fields:go.record(go.string(),CSe)})});var z7r,p3o=h(()=>{"use strict";dE();rqt();z7r=go.objectWithoutOptionalProperties({union:go.record(go.string(),CSe)})});var Q7r,f3o=h(()=>{"use strict";dE();s3o();u3o();l3o();p3o();Q7r=go.undiscriminatedUnion([D7r,z7r,j7r,N7r])});var M7r,d3o=h(()=>{"use strict";dE();f3o();M7r=go.objectWithoutOptionalProperties({objects:go.record(go.string(),Q7r).optional()})});var L7r,m3o=h(()=>{"use strict";dE();d3o();L7r=go.objectWithoutOptionalProperties({conjureImports:go.property("conjure-imports",go.record(go.string(),go.string()).optional()),definitions:M7r.optional()})});var Zxu,$xu=h(()=>{"use strict";dE();o3o();m3o();X6o();Zxu=go.objectWithoutOptionalProperties({types:L7r.optional(),services:go.record(v7r,R7r).optional()})});var h3o=h(()=>{"use strict";X6o();$xu()});var g3o={};te(g3o,{ConjureServiceName:()=>v7r,DefinitionFile:()=>Zxu});var eSu=h(()=>{"use strict";h3o()});var A3o=h(()=>{"use strict";n3o();r3o();x7r();Z6o();i3o();t3o();o3o()});var y3o={};te(y3o,{ConjureArgument:()=>P7r,ConjureArgumentWithParamType:()=>O7r,ConjureAuthDefinition:()=>Xct,ConjureAuthDefinitionType:()=>C7r,ConjureEndpointDefinition:()=>B7r,ConjureParamType:()=>T7r,ConjureService:()=>R7r});var tSu=h(()=>{"use strict";A3o()});var b3o=h(()=>{"use strict";s3o();d3o();u3o();c3o();a3o();l3o();$6o();tqt();f3o();rqt();m3o();e3o();p3o()});var E3o={};te(E3o,{ConjureAliasDeclaration:()=>D7r,ConjureDefinitions:()=>M7r,ConjureEnumDeclaration:()=>N7r,ConjureEnumVariant:()=>F7r,ConjureEnumWithDocs:()=>k7r,ConjureObjectDeclaration:()=>j7r,ConjurePrimitive:()=>S7r,ConjureType:()=>vSe,ConjureTypeDeclaration:()=>Q7r,ConjureTypeReference:()=>CSe,ConjureTypeWithDocs:()=>w7r,ConjureTypes:()=>L7r,ConjureUnionDeclaration:()=>z7r});var rSu=h(()=>{"use strict";b3o()});var nSu=h(()=>{"use strict";Xxu();J6o();eSu();h3o();tSu();A3o();rSu();b3o()});var nqt={};te(nqt,{ConjureAliasDeclaration:()=>D7r,ConjureArgument:()=>P7r,ConjureArgumentWithParamType:()=>O7r,ConjureAuthDefinition:()=>Xct,ConjureAuthDefinitionType:()=>C7r,ConjureDefinitions:()=>M7r,ConjureEndpointDefinition:()=>B7r,ConjureEnumDeclaration:()=>N7r,ConjureEnumVariant:()=>F7r,ConjureEnumWithDocs:()=>k7r,ConjureObjectDeclaration:()=>j7r,ConjureParamType:()=>T7r,ConjurePrimitive:()=>S7r,ConjureService:()=>R7r,ConjureServiceName:()=>v7r,ConjureType:()=>vSe,ConjureTypeDeclaration:()=>Q7r,ConjureTypeReference:()=>CSe,ConjureTypeWithDocs:()=>w7r,ConjureTypes:()=>L7r,ConjureUnionDeclaration:()=>z7r,DefinitionFile:()=>Zxu,WithDocs:()=>Rre,commons:()=>Y6o,conjure:()=>g3o,services:()=>y3o,types:()=>E3o});var I3o=h(()=>{"use strict";nSu()});var iSu=h(()=>{"use strict";B6o();MCu();I3o()});var v3o=h(()=>{"use strict";iSu();B6o();I3o()});async function sSu(e,t){let r=[];for(let n of await G1(e,t))r.push(await M0m({relativeFilepath:Io(e,n),absoluteFilepath:n}));return r}async function M0m({relativeFilepath:e,absoluteFilepath:t}){let r=(await(0,oSu.readFile)(t)).toString().replaceAll(/: rid(?:$|\s)/g,`: string
509
509
  `).replaceAll("<rid>","<string>").replaceAll("rid>","string>").replaceAll(": safelong",": long").replaceAll("<safelong>","<long>").replaceAll("safelong>","long>").replaceAll(": any",": unknown").replaceAll("<any>","<unknown>").replaceAll("any>","unknown>");return{relativeFilepath:e,absoluteFilepath:t,fileContents:nqt.conjure.DefinitionFile.parseOrThrow(vr.load(r),{unrecognizedObjectKeys:"passthrough",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0})}}var oSu,aSu=h(()=>{"use strict";v3o();er();oSu=require("fs/promises");ts()});function cSu(e,t){if(L0m(e))return t.alias(e);if(_0m(e))return t.enum(e);if(U0m(e))return t.object(e);if(V0m(e))return t.union(e);Ee(e)}function L0m(e){return e?.alias!=null}function _0m(e){return e?.values!=null}function U0m(e){return e?.fields!=null}function V0m(e){return e?.union!=null}var uSu=h(()=>{"use strict";Ct()});async function lSu(e,t){for(let r of await sSu(e,"{yml,yaml}"))await t(r.absoluteFilepath,r.relativeFilepath,r.fileContents)}var iqt,pSu=h(()=>{"use strict";v3o();Ct();er();Dxo();kt();aSu();uSu();iqt=class extends M4t{fernDefinitionBuilder=new c3e(!1);conjureFilepathToFernFilepath={};async import({absolutePathToConjureFolder:t,authOverrides:r,environmentOverrides:n,globalHeaderOverrides:i}){if(r!=null){for(let[o,s]of Object.entries(r["auth-schemes"]??{}))this.fernDefinitionBuilder.addAuthScheme({name:o,schema:s});r.auth!=null&&this.fernDefinitionBuilder.setAuth(r.auth)}if(n!=null){for(let[o,s]of Object.entries(n.environments??{}))this.fernDefinitionBuilder.addEnvironment({name:o,schema:s});n["default-environment"]!=null&&this.fernDefinitionBuilder.setDefaultEnvironment(n["default-environment"]),n["default-url"]!=null&&this.fernDefinitionBuilder.setDefaultUrl(n["default-url"])}return await lSu(t,(o,s,a)=>{for(let[l,p]of Object.entries(a.services??{})){let d=QQt({value:l,suffix:"Service"});this.conjureFilepathToFernFilepath[s]=ye.of(`${d}/__package__.yml`);return}let u=SV(s)?.split(".")[0];u!=null&&(this.conjureFilepathToFernFilepath[s]=ye.of(`${u}/__package__.yml`))}),await lSu(t,(o,s,a)=>{if(a.services==null||Object.keys(a.services??{}).length===0){let c=this.conjureFilepathToFernFilepath[s];if(c==null)throw new T({message:`Failed to find corresponding fern filepath for conjure file ${s}`,code:T.Code.InternalError});for(let[u,l]of Object.entries(a.types?.conjureImports??{})){let p=this.getFernFileToImport({absoluteFilePathToConjureFile:o,absoluteFilePathToConjureFolder:t,importFilePath:ye.of(l)});this.fernDefinitionBuilder.addImport({file:c,fileToImport:ye.of(p),alias:u})}this.importAllTypes({conjureFile:a,fernFilePath:c});return}for(let[c,u]of Object.entries(a.services)){let l=QQt({value:c,suffix:"Service"}),p=ye.of(`${l}/__package__.yml`),d={};u.basePath!=null&&(d["base-path"]=u.basePath),u.docs!=null&&(d.docs=u.docs),this.fernDefinitionBuilder.setServiceInfo(p,d),this.importAllTypes({conjureFile:a,fernFilePath:p});for(let[f,m]of Object.entries(a.types?.conjureImports??{})){let g=this.getFernFileToImport({absoluteFilePathToConjureFile:o,absoluteFilePathToConjureFolder:t,importFilePath:ye.of(m)});this.fernDefinitionBuilder.addImport({file:p,fileToImport:ye.of(g),alias:f})}for(let[f,m]of Object.entries(u.endpoints??{})){let g=Pyr(m.http);if(g.type==="failure"){this.context?.logger.error(`Failed to parse ${m.http}. Skipping.`);continue}let y={auth:(m.auth??u.defaultAuth)!==mCu.None,path:g.path,method:g.method,response:m.returns==="binary"?"file":m.returns};m.docs!=null&&(y.docs=m.docs);let I={};if(m.args!=null)for(let x of g.pathParameters){let v=m.args[x];if(v==null)throw new T({message:`Failed to find path parameter ${x} in ${m.http}`,code:T.Code.InternalError});I[x]=typeof v=="string"?v:{type:v.type}}Object.entries(I).length>0&&(y["path-parameters"]=I);for(let[x,v]of Object.entries(m.args??{}))if(I[x]==null)if(typeof v=="string")y.request?typeof y.request=="string"&&(y.request={body:y.request}):y.request={},y.request.body=v==="binary"?"bytes":v;else switch(v.paramType){case"body":y.request={body:v.type==="binary"?"bytes":v.type};break;case"query":y.request==null?y.request={"query-parameters":{[x]:v.type}}:typeof y.request!="string"&&y.request?.["query-parameters"]==null?y.request["query-parameters"]={[x]:v.type}:typeof y.request!="string"&&y.request?.["query-parameters"]!=null&&(y.request["query-parameters"][x]=v.type)}y.request!=null&&typeof y.request!="string"&&y.request?.["query-parameters"]!=null&&(y.request.name=`${f}Request`),this.fernDefinitionBuilder.addEndpoint(p,{name:f,schema:y,source:void 0})}}}),this.fernDefinitionBuilder.build()}convertBinaryType(t){return typeof t=="string"?t==="binary"?{type:"string",validation:{format:"binary"}}:t:t.type==="binary"?{...t,type:"string",validation:{format:"binary"}}:t}importAllTypes({conjureFile:t,fernFilePath:r}){for(let[n,i]of Object.entries(t.types?.definitions?.objects??{}))cSu(i,{alias:o=>{let s=o.alias==="binary"?{type:"string",validation:{format:"binary"}}:o.alias;this.fernDefinitionBuilder.addType(r,{name:n,schema:typeof s=="string"?{type:s,docs:o.docs}:{...s,docs:o.docs}})},object:o=>{this.fernDefinitionBuilder.addType(r,{name:n,schema:{properties:Object.fromEntries(Object.entries(o.fields).map(([s,a])=>[s,this.convertBinaryType(a)]))}})},enum:o=>{this.fernDefinitionBuilder.addType(r,{name:n,schema:{enum:o.values}})},union:o=>{this.fernDefinitionBuilder.addType(r,{name:n,schema:{union:Object.fromEntries(Object.entries(o.union).map(([s,a])=>{let c=this.convertBinaryType(a);return[s,{type:typeof c=="string"?c:c.type,docs:typeof c=="string"?void 0:c.docs,key:s}]}))}})}})}getFernFileToImport({absoluteFilePathToConjureFile:t,importFilePath:r,absoluteFilePathToConjureFolder:n}){let i=ke(un(t),ye.of(r)),o=sI(n,i),s=this.conjureFilepathToFernFilepath[o];if(s==null)throw new T({message:`Failed to find corresponding fern filepath for conjure file ${o}`,code:T.Code.InternalError});return s}}});var fSu=h(()=>{"use strict";pSu()});function dSu(e,t){return Cp(e,t)}var mSu=h(()=>{"use strict";Vi()});var Zct,hSu=h(()=>{"use strict";Bc();Bi();fSu();er();ts();mSu();Zct=class extends qH{type="conjure";absolutePathToConjureFolder;constructor({relativePathToConjureDirectory:t,...r}){super(r),this.absolutePathToConjureFolder=ke(r.absoluteFilePath,t)}async toFernWorkspace({context:t},r,n,i){let o=await this.getDefinition({context:t},r);return new bD({absoluteFilePath:this.absoluteFilePath,workspaceName:this.workspaceName,generatorsConfiguration:this.generatorsConfiguration,dependenciesConfiguration:{dependencies:{}},definition:o,cliVersion:this.cliVersion,sources:void 0})}async getDefinition({context:t},r){let i=await new iqt(t).import({absolutePathToConjureFolder:this.absolutePathToConjureFolder,authOverrides:this.generatorsConfiguration?.api?.auth!=null?{...this.generatorsConfiguration?.api}:void 0,environmentOverrides:this.generatorsConfiguration?.api?.environments!=null?{...this.generatorsConfiguration?.api}:void 0,globalHeaderOverrides:this.generatorsConfiguration?.api?.headers!=null?{...this.generatorsConfiguration?.api}:void 0});return{absoluteFilePath:_t.of("/DUMMY_PATH"),rootApiFile:{defaultUrl:i.rootApiFile["default-url"],contents:i.rootApiFile,rawContents:vr.dump(i.rootApiFile)},namedDefinitionFiles:{...dSu(i.definitionFiles,o=>({absoluteFilepath:_t.of("/DUMMY_PATH"),rawContents:vr.dump(o),contents:o})),[ye.of(rd)]:{absoluteFilepath:_t.of("/DUMMY_PATH"),rawContents:vr.dump(i.packageMarkerFile),contents:i.packageMarkerFile}},packageMarkers:{},importedDefinitions:{}}}getAbsoluteFilePaths(){return[this.absolutePathToConjureFolder]}}});var ISu=E((AUe,ESu)=>{"use strict";var C3o=require("crypto");AUe=ESu.exports=oqt;function oqt(e,t){return t=ySu(e,t),G0m(e,t)}AUe.sha1=function(e){return oqt(e)};AUe.keys=function(e){return oqt(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};AUe.MD5=function(e){return oqt(e,{algorithm:"md5",encoding:"hex"})};AUe.keysMD5=function(e){return oqt(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var $ct=C3o.getHashes?C3o.getHashes().slice():["sha1","md5"];$ct.push("passthrough");var gSu=["buffer","hex","binary","base64"];function ySu(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=t.ignoreUnknown===!0,r.respectType=t.respectType!==!1,r.respectFunctionNames=t.respectFunctionNames!==!1,r.respectFunctionProperties=t.respectFunctionProperties!==!1,r.unorderedArrays=t.unorderedArrays===!0,r.unorderedSets=t.unorderedSets!==!1,r.unorderedObjects=t.unorderedObjects!==!1,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,typeof e>"u")throw new Error("Object argument required.");for(var n=0;n<$ct.length;++n)$ct[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=$ct[n]);if($ct.indexOf(r.algorithm)===-1)throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+$ct.join(", "));if(gSu.indexOf(r.encoding)===-1&&r.algorithm!=="passthrough")throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+gSu.join(", "));return r}function ASu(e){if(typeof e!="function")return!1;var t=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return t.exec(Function.prototype.toString.call(e))!=null}function G0m(e,t){var r;t.algorithm!=="passthrough"?r=C3o.createHash(t.algorithm):r=new bSu,typeof r.write>"u"&&(r.write=r.update,r.end=r.update);var n=x3o(t,r);if(n.dispatch(e),r.update||r.end(""),r.digest)return r.digest(t.encoding==="buffer"?void 0:t.encoding);var i=r.read();return t.encoding==="buffer"?i:i.toString(t.encoding)}AUe.writeToStream=function(e,t,r){return typeof r>"u"&&(r=t,t={}),t=ySu(e,t),x3o(t,r).dispatch(e)};function x3o(e,t,r){r=r||[];var n=function(i){return t.update?t.update(i,"utf8"):t.write(i,"utf8")};return{dispatch:function(i){e.replacer&&(i=e.replacer(i));var o=typeof i;return i===null&&(o="null"),this["_"+o](i)},_object:function(i){var o=/\[object (.*)\]/i,s=Object.prototype.toString.call(i),a=o.exec(s);a?a=a[1]:a="unknown:["+s+"]",a=a.toLowerCase();var c=null;if((c=r.indexOf(i))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(i),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(i))return n("buffer:"),n(i);if(a!=="object"&&a!=="function"&&a!=="asyncfunction")if(this["_"+a])this["_"+a](i);else{if(e.ignoreUnknown)return n("["+a+"]");throw new Error('Unknown object type "'+a+'"')}else{var u=Object.keys(i);e.unorderedObjects&&(u=u.sort()),e.respectType!==!1&&!ASu(i)&&u.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(u=u.filter(function(p){return!e.excludeKeys(p)})),n("object:"+u.length+":");var l=this;return u.forEach(function(p){l.dispatch(p),n(":"),e.excludeValues||l.dispatch(i[p]),n(",")})}},_array:function(i,o){o=typeof o<"u"?o:e.unorderedArrays!==!1;var s=this;if(n("array:"+i.length+":"),!o||i.length<=1)return i.forEach(function(u){return s.dispatch(u)});var a=[],c=i.map(function(u){var l=new bSu,p=r.slice(),d=x3o(e,l,p);return d.dispatch(u),a=a.concat(p.slice(r.length)),l.read().toString()});return r=r.concat(a),c.sort(),this._array(c,!1)},_date:function(i){return n("date:"+i.toJSON())},_symbol:function(i){return n("symbol:"+i.toString())},_error:function(i){return n("error:"+i.toString())},_boolean:function(i){return n("bool:"+i.toString())},_string:function(i){n("string:"+i.length+":"),n(i.toString())},_function:function(i){n("fn:"),ASu(i)?this.dispatch("[native]"):this.dispatch(i.toString()),e.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),e.respectFunctionProperties&&this._object(i)},_number:function(i){return n("number:"+i.toString())},_xml:function(i){return n("xml:"+i.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(i){return n("regex:"+i.toString())},_uint8array:function(i){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint8clampedarray:function(i){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},_int8array:function(i){return n("int8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint16array:function(i){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},_int16array:function(i){return n("int16array:"),this.dispatch(Array.prototype.slice.call(i))},_uint32array:function(i){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},_int32array:function(i){return n("int32array:"),this.dispatch(Array.prototype.slice.call(i))},_float32array:function(i){return n("float32array:"),this.dispatch(Array.prototype.slice.call(i))},_float64array:function(i){return n("float64array:"),this.dispatch(Array.prototype.slice.call(i))},_arraybuffer:function(i){return n("arraybuffer:"),this.dispatch(new Uint8Array(i))},_url:function(i){return n("url:"+i.toString(),"utf8")},_map:function(i){n("map:");var o=Array.from(i);return this._array(o,e.unorderedSets!==!1)},_set:function(i){n("set:");var o=Array.from(i);return this._array(o,e.unorderedSets!==!1)},_file:function(i){return n("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported
510
510
  (see https://github.com/puleos/object-hash/issues/26)
@@ -3465,7 +3465,7 @@ ${vnl.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&QJo(th
3465
3465
  `).length),this}updateBottomBar(t){return xHt(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+`
3466
3466
  `}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&&Pnn(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var am=Ae(_4(),1),_il=Ae(tHt(),1);var cin=Ae(_4(),1),Mil=Ae(tHt(),1),uin=function(e,t,r){return typeof e[t]!="function"?(0,cin.of)(e):(0,cin.from)((0,Mil.default)(e[t])(r).then(n=>(e[t]=n,e)))};var Lil={set:(e,t="",r)=>{let n=e;t.split(".").forEach((i,o,s)=>{i==="__proto__"||i==="constructor"||(o===s.length-1?n[i]=r:(!(i in n)||typeof n[i]!="object")&&(n[i]={}),n=n[i])})},get:(e,t="",r)=>{let n=o=>String.prototype.split.call(t,o).filter(Boolean).reduce((s,a)=>s!=null?s[a]:s,e),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===e?r:i}},Eft=class extends h5e{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=typeof r=="object"?{...r}:{};let n;return Array.isArray(t)?n=(0,am.from)(t):(0,am.isObservable)(t)?n=t:Object.values(t).every(i=>typeof i=="object"&&!Array.isArray(i)&&i!=null)?n=(0,am.from)(Object.entries(t).map(([i,o])=>({name:i,...o}))):n=(0,am.from)([t]),this.process=n.pipe((0,am.concatMap)(this.processQuestion.bind(this)),(0,am.publish)()),this.process.connect(),this.process.pipe((0,am.reduce)((i,o)=>(Lil.set(i,o.name,o.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,am.defer)(()=>(0,am.of)(t).pipe((0,am.concatMap)(this.setDefaultType.bind(this)),(0,am.concatMap)(this.filterIfRunnable.bind(this)),(0,am.concatMap)(()=>uin(t,"message",this.answers)),(0,am.concatMap)(()=>uin(t,"default",this.answers)),(0,am.concatMap)(()=>uin(t,"choices",this.answers)),(0,am.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,am.defer)(()=>(0,am.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,am.defer)(()=>(0,am.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&Lil.get(this.answers,t.name)!==void 0)return am.EMPTY;if(t.when===!1)return am.EMPTY;if(typeof t.when!="function")return(0,am.of)(t);let{answers:r}=this;return(0,am.defer)(()=>(0,am.from)((0,_il.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,am.filter)(n=>n!=null)))}};function Uil(e){let t=function(r,n){let i;try{i=new Eft(t.prompts,e)}catch(s){return Promise.reject(s)}let o=i.run(r,n);return o.ui=i,o};return t.prompts={},t.registerPrompt=function(r,n){return t.prompts[r]=n,this},t.restoreDefaultPrompts=function(){this.registerPrompt("list",wHt),this.registerPrompt("input",l5e),this.registerPrompt("number",THt),this.registerPrompt("confirm",OHt),this.registerPrompt("rawlist",PHt),this.registerPrompt("expand",BHt),this.registerPrompt("checkbox",RHt),this.registerPrompt("password",DHt),this.registerPrompt("editor",LHt)},t.restoreDefaultPrompts(),t}var sXo=Uil();function bah(e,t){sXo.registerPrompt(e,t)}function Eah(){sXo.restoreDefaultPrompts()}var Iah={prompt:sXo,ui:{BottomBar:_Ht,Prompt:Eft},createPromptModule:Uil,registerPrompt:bah,restoreDefaultPrompts:Eah,Separator:wM},Pu=Iah;var vah=["prod","pre-prod","beta","dev","local"];function Cah(e){return vah.some(t=>t===e)}function zJ(e="prod"){let t=e?.trim();return t!=null&&Cah(t)?t:"local"}function lin(){let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";return e==null||e.trim().length===0?!1:process.env.FERN_DISABLE_TELEMETRY!=="true"}var Ift=require("path");function Gil(){let e=xah();return async t=>{for(let r of t)r.module=e(r.filename);return t}}function xah(e=process.argv[1]?(0,Ift.dirname)(process.argv[1]):process.cwd(),t=Ift.sep==="\\"){let r=t?Vil(e):e;return n=>{if(!n)return;let i=t?Vil(n):n,{dir:o,base:s,ext:a}=Ift.posix.parse(i);(a===".js"||a===".mjs"||a===".cjs")&&(s=s.slice(0,-1*a.length));let c=decodeURIComponent(s);o||(o=".");let u=o.lastIndexOf("/node_modules");if(u>-1)return`${o.slice(u+14).replace(/\//g,".")}:${c}`;if(o.startsWith(r)){let l=o.slice(r.length+1).replace(/\//g,".");return l?`${l}:${c}`:c}return c}}function Vil(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var nO={};te(nO,{DEFAULT_EXCEPTION_STEPS_CONFIG:()=>Oin,DOMExceptionCoercer:()=>CXo,EXCEPTION_STEP_INTERNAL_FIELDS:()=>XHt,ErrorCoercer:()=>HHt,ErrorEventCoercer:()=>xXo,ErrorPropertiesBuilder:()=>WHt,EventCoercer:()=>SXo,ExceptionStepsBuffer:()=>PXo,ObjectCoercer:()=>JHt,PrimitiveCoercer:()=>YHt,PromiseRejectionEventCoercer:()=>wXo,ReduceableCache:()=>TXo,StringCoercer:()=>KHt,chromeStackLineParser:()=>bXo,createDefaultStackParser:()=>vXo,createStackParser:()=>Dol,geckoStackLineParser:()=>EXo,getInjectedReleaseId:()=>Qch,getUtf8ByteLength:()=>Fol,nodeStackLineParser:()=>wol,opera10StackLineParser:()=>Col,opera11StackLineParser:()=>xol,resolveExceptionStepsConfig:()=>OXo,reverseAndStripFrames:()=>Rol,stripReservedExceptionStepFields:()=>Nch,winjsStackLineParser:()=>vol});var OM=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({});function p1e(e){let t=[];return JSON.stringify(e,function(r,n){if(typeof n=="bigint")return n.toString();if(!(typeof n=="function"||typeof n=="symbol")){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n=="object"){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(n))return"[Circular]";t.push(n)}return n}})??"null"}var Sah=Array.isArray,Wil=Object.prototype,Vqv=Wil.hasOwnProperty,pin=Wil.toString,V4=Sah||function(e){return pin.call(e)==="[object Array]"};var UHt=e=>e===Object(e)&&!V4(e);var Uhe=e=>e===void 0,rk=e=>pin.call(e)=="[object String]",aXo=e=>rk(e)&&e.trim().length===0,cXo=e=>e===null,QJ=e=>Uhe(e)||cXo(e),vft=e=>pin.call(e)=="[object Number]"&&e===e;var Hil=e=>pin.call(e)==="[object Boolean]";function fin(e){return e===null||typeof e!="object"}function g5e(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function f1e(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Yil(e,Error)}}function Kil(e){return g5e(e,"ErrorEvent")}function Cft(e){return"u">typeof Event&&Yil(e,Event)}function Jil(e){return g5e(e,"Object")}function Yil(e,t){try{return e instanceof t}catch{return!1}}var wah=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],din=new Map,Tah=256;function Oah(e,t){let r="";for(let n=0;n<t.length;n++){let i=t[n];r+=i.length+":"+i}return e.length+":"+e+"|"+t.length+":"+r}var Xil=function(e,t=[]){if(!e)return!1;let r=Oah(e,t),n=din.get(r);if(n!==void 0)return n;let i=e.toLowerCase(),o=wah.concat(t).some(s=>i.indexOf(s.toLowerCase())!==-1);return din.size>=Tah&&din.clear(),din.set(r,o),o};function VHt(e,t,r,n,i){return t>r&&(n.warn("min cannot be greater than max."),t=r),vft(e)?e>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(n.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),VHt(i??r,t,r,n))}var Pah=864e5,Bah=1,Rah=10;function Zil(e={}){return{refillRate:e.exceptionRateLimiterRefillRate??e.__exceptionRateLimiterRefillRate??Bah,bucketSize:e.exceptionRateLimiterBucketSize??e.__exceptionRateLimiterBucketSize??Rah}}var min=class{constructor(t){this._buckets={},this._onBucketRateLimited=t._onBucketRateLimited,this._bucketSize=VHt(t.bucketSize,0,100,t._logger),this._refillRate=VHt(t.refillRate,0,this._bucketSize,t._logger),this._refillInterval=VHt(t.refillInterval,0,Pah,t._logger)}_applyRefill(t,r){let n=r-t.lastAccess,i=Math.floor(n/this._refillInterval);if(i>0){let o=i*this._refillRate;t.tokens=Math.min(t.tokens+o,this._bucketSize),t.lastAccess=t.lastAccess+i*this._refillInterval}}consumeRateLimit(t){let r=Date.now(),n=String(t),i=this._buckets[n];return i?this._applyRefill(i,r):(i={tokens:this._bucketSize,lastAccess:r},this._buckets[n]=i),i.tokens===0?!0:(i.tokens--,i.tokens===0&&this._onBucketRateLimited?.(t),i.tokens===0)}stop(){this._buckets={}}};var hin="0123456789abcdef",gin=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length===16)return new e(t);throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||t<0||r<0||n<0||i<0||t>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");let o=new Uint8Array(16);return o[0]=t/2**40,o[1]=t/2**32,o[2]=t/2**24,o[3]=t/2**16,o[4]=t/256,o[5]=t,o[6]=112|r>>>8,o[7]=r,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}static parse(t){let r;switch(t.length){case 32:r=/^[0-9a-f]{32}$/i.exec(t)?.[0];break;case 36:r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break;case 38:r=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t)?.slice(1,6).join("");break;case 45:r=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break;default:break}if(r){let n=new Uint8Array(16);for(let i=0;i<16;i+=4){let o=parseInt(r.substring(2*i,2*i+8),16);n[i+0]=o>>>24,n[i+1]=o>>>16,n[i+2]=o>>>8,n[i+3]=o}return new e(n)}throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=hin.charAt(this.bytes[r]>>>4),t+=hin.charAt(15&this.bytes[r]),(r===3||r===5||r===7||r===9)&&(t+="-");return t}toHex(){let t="";for(let r=0;r<this.bytes.length;r++)t+=hin.charAt(this.bytes[r]>>>4),t+=hin.charAt(15&this.bytes[r]);return t}toJSON(){return this.toString()}getVariant(){let t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every(r=>r===0)?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every(r=>r===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;r<16;r++){let n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}},uXo=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??Dah()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,r){let n=this.generateOrAbortCore(t,r);return n===void 0&&(this.timestamp=0,n=this.generateOrAbortCore(t,r)),n}generateOrAbortCore(t,r){if(!Number.isInteger(t)||t<1||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(r<0||r>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+r>=this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return gin.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){let t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,gin.ofInner(t)}},Dah=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())>>>0}),$il,jN=()=>kah().toString(),kah=()=>($il||($il=new uXo)).generate();var Ain=class{add(t){let r=jN(),n=++this.nextId;return this.promiseByIds[r]={id:n,promise:t},t.catch(()=>{}).finally(()=>{delete this.promiseByIds[r]}),t}async join(){let t=Object.values(this.promiseByIds).map(n=>n.promise),r=t.length;for(;r>0;)await Promise.all(t),t=Object.values(this.promiseByIds).map(n=>n.promise),r=t.length}getPromises(t=[],r=this.nextId){let n=new Set(t);return Object.values(this.promiseByIds).filter(i=>i.id<=r&&!n.has(i.promise)).map(i=>i.promise)}get maxId(){return this.nextId}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={},this.nextId=0}};function Fah(e=console){return{log:e.log.bind(e),warn:e.warn.bind(e),error:e.error.bind(e),debug:e.debug.bind(e)}}var eol=(e,t,r)=>{function n(o,...s){t(()=>{let a=r[o];a(e,...s)})}return{debug:(...o)=>{n("debug",...o)},info:(...o)=>{n("log",...o)},warn:(...o)=>{n("warn",...o)},error:(...o)=>{n("error",...o)},critical:(...o)=>{r.error(e,...o)},createLogger:o=>eol(`${e} ${o}`,t,r)}},Nah=e=>e();function tol(e,t=Nah){return eol(e,t,Fah())}var Sft="Mobile",bin="iOS",xft="Android",sol="Tablet",i9v=xft+" "+sol;var zah="Apple",o9v=zah+" Watch",aol="Safari",Ein="BlackBerry",col="Samsung",Qah=col+"Browser",Mah=col+" Internet",Iin="Chrome",Lah=Iin+" OS",_ah=Iin+" "+bin,uol="Internet Explorer",Uah=uol+" "+Sft,fXo="Opera",s9v=fXo+" Mini",lol="Edge",Vah="Microsoft "+lol,dXo="Firefox",Gah=dXo+" "+bin,mXo="Nintendo",hXo="PlayStation",yin="Xbox",qah=xft+" "+Sft,Wah=Sft+" "+aol,GHt="Windows",Hah=GHt+" Phone";var pol="Generic",a9v=pol+" "+Sft.toLowerCase(),c9v=pol+" "+sol.toLowerCase(),Kah="Konqueror",Jah="Oculus Browser",rol="Vivaldi",Yah="Yandex",nol="Whale",Xah="DuckDuckGo",Zah="Pale Moon",iol="Waterfox",ool="Brave",fol="Claude",dol="Codex",mol="ChatGPT",$ah="Google Search App",I0="(\\d+(\\.\\d+)?)",lXo=new RegExp("Version/"+I0),pXo=new RegExp("("+fol+"|"+dol+"|"+mol+")\\/"+I0);var u9v=new RegExp(yin,"i"),l9v=new RegExp(hXo+" \\w+","i"),p9v=new RegExp(mXo+" \\w+","i"),ech=new RegExp(Ein+"|PlayBook|BB10","i"),tch={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000","5.1":"XP","5.2":"XP","6.0":"Vista","6.1":"7","6.2":"8","6.3":"8.1","6.4":"10","10.0":"10"};var f9v={[Uah]:[new RegExp("rv:"+I0)],[Vah]:[new RegExp(lol+"?\\/"+I0)],[Iin]:[new RegExp("("+Iin+"|CrMo)\\/"+I0)],[_ah]:[new RegExp("CriOS\\/"+I0)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+I0)],[aol]:[lXo],[Wah]:[lXo],[fXo]:[new RegExp("("+fXo+"|OPR)\\/"+I0)],[dXo]:[new RegExp(dXo+"\\/"+I0)],[Gah]:[new RegExp("FxiOS\\/"+I0)],[Kah]:[new RegExp("Konqueror[:/]?"+I0,"i")],[Ein]:[new RegExp(Ein+" "+I0),lXo],[qah]:[new RegExp("android\\s"+I0,"i")],[Mah]:[new RegExp(Qah+"\\/"+I0)],[Jah]:[new RegExp("OculusBrowser\\/"+I0)],[rol]:[new RegExp(rol+"\\/"+I0)],[Yah]:[new RegExp("YaBrowser\\/"+I0)],[nol]:[new RegExp(nol+"\\/"+I0)],[ool]:[new RegExp(ool+"\\/"+I0)],[fol]:[pXo],[dol]:[pXo],[mol]:[pXo],[Xah]:[new RegExp("(DuckDuckGo|Ddg)\\/"+I0)],[Zah]:[new RegExp("PaleMoon\\/"+I0)],[iol]:[new RegExp(iol+"\\/"+I0)],[$ah]:[new RegExp("GSA\\/"+I0)],[uol]:[new RegExp("(rv:|MSIE )"+I0)],Mozilla:[new RegExp("rv:"+I0)]};var d9v=[[new RegExp(yin+"; "+yin+" (.*?)[);]","i"),e=>[yin,e&&e[1]||""]],[new RegExp(mXo,"i"),[mXo,""]],[new RegExp(hXo,"i"),[hXo,""]],[ech,[Ein,""]],[new RegExp(GHt,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Hah,""];if(new RegExp(Sft).test(t)&&!/IEMobile\b/.test(t))return[GHt+" "+Sft,""];let r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){let n=r[1],i=tch[n]||"";return/arm/i.test(t)&&(i="RT"),[GHt,i]}return[GHt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){let t=[e[3],e[4],e[5]||"0"];return[bin,t.join(".")]}return[bin,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=Uhe(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+xft+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+xft+")","i"),e=>{if(e&&e[2]){let t=[e[2],e[3],e[4]||"0"];return[xft,t.join(".")]}return[xft,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];if(e&&e[1]){let r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Lah,""]],[/Linux|debian/i,["Linux",""]]];var vin="[Circular]",Cin="[Truncated]",U8="[Unserializable]",hol="[Function]",g9v=Date.prototype.getTime,A9v=Date.prototype.toISOString;function dne(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>=55296&&n<=56319){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=e[r]+e[r+1],r++):t+="\uFFFD"}else t+=n>=56320&&n<=57343?"\uFFFD":e[r]}return t}function Vhe(e,t){if(!t)return e;let r=[];try{r=Object.keys(t)}catch{r=[]}for(let n of r){let i;try{i=t[n]}catch{i=U8}Object.defineProperty(e,n,{value:i,enumerable:!0,writable:!0,configurable:!0})}return e}function gXo(e,t=Date.now()){if(typeof e!="string"||!e)return;let r=e.trim(),n=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(n)){let s=1e3*Math.min(Number(n),300);return s>0?s:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(n))return;let i=/^\w{3} \w{3} /.test(n)?n+" GMT":n,o=Date.parse(i)-t;if(!(!Number.isFinite(o)||o<=0))return Math.min(o,3e5)}var A5e=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;let r=this.isOpen(),n=Date.now(),i=Math.min(t.retryAfterMs,3e5);if(!r){this._installedAt=n,this._until=n+i;return}this._until=Math.max(this._until,Math.min(n+i,this._installedAt+3e5))}remainingMs(){let t=Date.now();if(t<this._installedAt-5e3)return this.reset(),0;let r=Math.min(3e5,Math.max(0,this._until-t));return r===0&&this.reset(),r}isOpen(){return this.remainingMs()>0}reset(){this._until=0,this._installedAt=0}constructor(){this._until=0,this._installedAt=0}};var gol="utf8",rch=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nch(e){return typeof e=="string"&&rch.test(e)}function y5e(e,t){return nch(e)?e:t()}function wft(e,t){let r=new Error(t);try{Object.defineProperty(r,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return r}function Aol(e){return e?.replace(/\/+$/,"")}async function yol(e,t){let r=null;for(let n=0;n<t.retryCount+1;n++){n>0&&await new Promise(i=>setTimeout(i,t.retryDelay));try{return await e()}catch(i){if(r=i,!t.retryCheck(i))throw i}}throw r}function AXo(){return new Date().toISOString()}function zN(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}async function d1e(e,t,r){let n;try{return await Promise.race([e,new Promise((i,o)=>{n=zN(()=>{try{r?.(),i()}catch(s){o(s)}},t)})])}finally{clearTimeout(n)}}var bol=e=>e&&typeof e.then=="function";function qHt(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var xin,Eol,Sin;function Iol(e){let t=globalThis._posthogChunkIds;if(!t)return;let r=Object.keys(t);return Sin&&r.length===Eol||(Eol=r.length,Sin=r.reduce((n,i)=>{xin||(xin={});let o=xin[i];if(o)n[o[0]]=o[1];else{let s=e(i);for(let a=s.length-1;a>=0;a--){let u=s[a]?.filename,l=t[i];if(u&&l){n[u]=l,xin[i]=[u,l];break}}}return n},{})),Sin}var yXo=50,ich=1e3,och=100,sch=4,WHt=class{constructor(t,r,n=[]){this.coercers=t,this.stackParser=r,this.modifiers=n}buildFromUnknown(t,r={}){let i=r&&r.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,r,0).apply(t),a=this.buildParsingContext(r),c=this.parseStacktrace(s,a);return{$exception_list:this.convertToExceptionList(c,i),$exception_level:"error"}}async modifyFrames(t){for(let r of t)r.stacktrace&&r.stacktrace.frames&&V4(r.stacktrace.frames)&&(r.stacktrace.frames=await this.applyModifiers(r.stacktrace.frames));return t}coerceFallback(t){return{type:"Error",value:"Unknown error",stack:t.syntheticException?.stack,synthetic:!0}}parseStacktrace(t,r){let n;t.cause!=null&&(n=this.parseStacktrace(t.cause,r));let i;if(t.stack!=""&&t.stack!=null)try{i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?r.skipFirstLines:0),r.chunkIdMap)}catch{}return{...t,cause:n,stack:i,errors:t.errors?.map(o=>this.parseStacktrace(o,r))}}applyChunkIds(t,r){return t.map(n=>(n.filename&&r&&(n.chunk_id=r[n.filename]),n))}applyCoercers(t,r){for(let n of this.coercers)if(n.match(t))return n.coerce(t,r);return this.coerceFallback(r)}async applyModifiers(t){let r=t;for(let n of this.modifiers)r=await n(r);return r}convertToExceptionList(t,r){let n=[],i=(o,s,a)=>{let c=n.length,u=s===void 0?{type:typeof r.type=="string"&&r.type.length>0?r.type:"generic",...typeof r.handled=="boolean"?{handled:r.handled}:r.handled===void 0?{handled:!0}:{},synthetic:typeof r.synthetic=="boolean"?r.synthetic:o.synthetic,exception_id:c}:{type:"chained",source:a,synthetic:o.synthetic,exception_id:c,parent_id:s},l={type:o.type,value:o.value,mechanism:u};o.stack&&(l.stacktrace={type:"raw",frames:o.stack}),n.push(l),o.cause&&i(o.cause,c,"cause");for(let p of o.errors??[])i(p,c,"member")};return i(t),n}buildParsingContext(t){return{chunkIdMap:Iol(this.stackParser),skipFirstLines:t.skipFirstLines??1}}getAggregateErrors(t){try{if(f1e(t)){let r=Object.getPrototypeOf(t);for(let n=0;r&&n<och;n++){let i=Object.getOwnPropertyDescriptor(r,"constructor")?.value;if(typeof i=="function"&&i.name==="AggregateError"){let o=t.errors;return V4(o)?o:void 0}r=Object.getPrototypeOf(r)}}}catch{}}buildCoercingContext(t,r,n=0){let i=0,o=0,s=!1,a=new Set,c=[],u={},l=(f,m,g=0)=>{let A=p(m,g),y=A.apply;if(A.apply=R=>{c.push(f);try{return y(R)}finally{c.pop()}},g>sch||g>0&&c.indexOf(f)!==-1)return this.coerceFallback(A);let I=typeof f=="object"&&f!==null||typeof f=="function";if(g===0&&i>=yXo||I&&a.has(f))return;I&&a.add(f),g===0&&i++;let x=this.getAggregateErrors(f);s||=!!x;let v;try{if(v=this.applyCoercers(f,A),!v)throw u}catch(R){if(R===u){g===0&&i--;return}if(!s)throw R;v=this.coerceFallback(A)}if(!x||i>=yXo)return v;let S;try{S=x.length}catch{return v}if(!Number.isInteger(S)||S<0||S>4294967295)return v;let B=[];for(let R=0;i<yXo&&o<ich&&R<S;R++){o++;let D;try{D=A.next(x[R])}catch{i++,D=this.coerceFallback(p(m+1))}D&&B.push(D)}return{...v,errors:B}},p=(f,m=0)=>({...r,syntheticException:f==0?r.syntheticException:void 0,mechanism:f==0?t:{},apply:g=>{let A=l(g,f,m+1);if(!A)throw u;return A},next:g=>l(g,f+1)}),d=p(n);return{...d,apply:f=>l(f,n)??this.coerceFallback(d)}}};var tR="?",ach="<anonymous>",cch=/^([a-z][a-z0-9.+-]+):/i,uch=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function lch(e){if(!e||e===ach)return!1;let t=cch.exec(e);return!t||uch.includes(t[1].toLowerCase())}function mne(e,t,r,n,i){let o={platform:e,filename:t,function:r==="<anonymous>"?tR:r,in_app:lch(t)};return Uhe(n)||(o.lineno=n),Uhe(i)||(o.colno=i),o}var win=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:tR,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var pch=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,fch=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,dch=/\((\S*)(?::(\d+))(?::(\d+))\)/,bXo=(e,t)=>{let r=pch.exec(e);if(r){let[,i,o,s]=r;return mne(t,i,tR,+o,+s)}let n=fch.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){let a=dch.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}let[o,s]=win(n[1]||tR,n[2]);return mne(t,s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}};var mch=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,hch=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,EXo=(e,t)=>{let r=mch.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let s=hch.exec(r[3]);s&&(r[1]=r[1]||"eval",r[3]=s[1],r[4]=s[2],r[5]="")}let i=r[3],o=r[1]||tR;return[o,i]=win(o,i),mne(t,i,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}};var gch=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vol=(e,t)=>{let r=gch.exec(e);return r?mne(t,r[2],r[1]||tR,+r[3],r[4]?+r[4]:void 0):void 0};var Ach=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Col=(e,t)=>{let r=Ach.exec(e);return r?mne(t,r[2],r[3]||tR,+r[1]):void 0},ych=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,xol=(e,t)=>{let r=ych.exec(e);return r?mne(t,r[5],r[3]||r[4]||tR,+r[1],+r[2]):void 0};var bch=/^\s*[-]{4,}$/,Ech=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,Ich=/^Promise\.(?:all|any)$/,vch=/^index \d+$/,Cch="node:internal/promise",wol=(e,t)=>{let r=e.match(Ech);if(r){let n,i,o,s,a;if(r[1]){o=r[1];let l=o.lastIndexOf(".");if(o[l-1]==="."&&l--,l>0){n=o.slice(0,l),i=o.slice(l+1);let p=n.indexOf(".Module");p>0&&(o=o.slice(p+1),n=n.slice(0,p))}s=void 0}i&&(s=n,a=i),i==="<anonymous>"&&(a=void 0,o=void 0),o===void 0&&(a=a||tR,o=s?`${s}.${a}`:a);let c=r[2]?.startsWith("file://")?r[2].slice(7):r[2],u=r[5]==="native";return c?.match(/\/[A-Z]:/)&&(c=c.slice(1)),!c&&r[5]&&!u&&(c=r[5]),Ich.test(o)&&vch.test(c||"")&&(c=Cch),{filename:c?decodeURI(c):void 0,module:void 0,function:o,lineno:Sol(r[3]),colno:Sol(r[4]),in_app:xch(c||"",u),platform:t}}if(e.match(bch))return{filename:e,platform:t}};function xch(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function Sol(e){return parseInt(e||"",10)||void 0}var Tol=/\(error: (.*)\)/,Ool=50,Sch=10,wch=1e3;function IXo(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function Tch(e){for(let t=1;t<=Sch;t++){let r=e.length-2*t;if(r<0)break;let n=!0;for(let i=0;i<t;i++){let o=e[r+i];if(!IXo(o,e[r+t+i])){n=!1;break}}if(n){for(let i=0;i<t;i++)e[r+i]=e[r+t+i];return e.length=r+t,{start:r,length:t}}}}function Och(e,t){let r=t.start+t.length,n=Bol(e,t);n&&e.splice(r+n===e.length?r:t.start,n)}function Pol(e,t){let r=t.start;for(;r>0&&IXo(e[r-1],e[r-1+t.length]);)r--;return t.start-r}function Bol(e,t){let r=t.start+t.length,n=r;for(;n<e.length&&IXo(e[n],e[n-t.length]);)n++;return n-r}function Pch(e,t){let r=t[0],n=e.length-(r?Pol(e,r):0);for(let i of t)n-=Bol(e,i);return n}function Bch(e){let t=e.map(n=>`${n.function}|${n.filename}|${n.lineno}|${n.colno}|${n.module}`),r=0;for(let n=1;n<t.length;n++)Rch(t,n,r)&&(r=n);e.push(...e.splice(0,r))}function Rch(e,t,r){for(let n=0;n<e.length;n++){let i=e[(t+n)%e.length],o=e[(r+n)%e.length];if(i!==o)return i<o}return!1}function Rol(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,Ool).map(r=>({...r,filename:r.filename||Dch(t).filename,function:r.function||tR}))}function Dch(e){return e[e.length-1]||{}}function vXo(){return Dol("web:javascript",bXo,EXo)}function Dol(e,...t){return(r,n=0)=>{let i=[],o=r.split(`
3467
3467
  `),s=Math.min(o.length,n+wch),a=[];for(let l=n;l<s;l++){let p=o[l];if(p.length>1024)continue;let d=Tol.test(p)?p.replace(Tol,"$1"):p;if(!d.match(/\S*Error: /)){for(let f of t){let m=f(d,e);if(m){i.push(m);let g=Tch(i);if(g){for(let A=a.length-1;A>=0;A--){let y=a[A];if(y.start+y.length<=g.start)break;a.pop()}a.push(g)}break}}if(Pch(i,a)>=Ool)break}}let c=[...a].sort((l,p)=>p.start-l.start),u=c[c.length-1];if(u){let l=Pol(i,u);i.splice(u.start-l,l);for(let p of c)p.start-=l}for(let l of c)Och(i,l);return a.some(l=>l.start===0&&i.length===l.length)&&Bch(i),Rol(i)}}var CXo=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){let n=rk(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){let r=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${r}: ${t.message}`:r}isDOMException(t){return g5e(t,"DOMException")}isDOMError(t){return g5e(t,"DOMError")}};var HHt=class{match(t){return f1e(t)}coerce(t,r){let n=this.getStack(t),i=n===void 0?r.syntheticException?.stack:void 0,o=!!i;return{type:this.getType(t),value:this.getMessage(t,r),stack:n??i,cause:t.cause?r.next(t.cause):void 0,synthetic:o}}getType(t){return t.name||t.constructor.name}getMessage(t,r){let n=t.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(t){try{let r=t.stacktrace;if(typeof r=="string"&&r.length>0)return r;let n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}};var xXo=class{match(t){if(!Kil(t))return!1;let r=t;return r.error!=null||this._hasUsableMessage(r)}coerce(t,r){if(t.error!=null)return r.apply(t.error);let n=r.apply(t.message);return{...n,stack:this._buildLocationStack(t)??n.stack,synthetic:!0}}_hasUsableMessage(t){return rk(t.message)&&t.message.length>0}_buildLocationStack(t){let r=t,n=r.lineno??0,i=r.colno??0;if(!(!rk(r.filename)||r.filename.length===0)&&n!==0)return`Error
3468
- at ${r.filename}:${n}:${i}`}};var kch=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,KHt=class{match(t){return typeof t=="string"}coerce(t,r){let[n,i]=this.getInfos(t);return{type:n??"Error",value:i??t,stack:r.syntheticException?.stack,synthetic:!0}}getInfos(t){let r="Error",n=t,i=t.match(kch);return i&&(r=i[1],n=i[2]),[r,n]}};var kol=["fatal","error","warning","log","info","debug"];function Tin(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let n=r.length;n>0;n--){let i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}var JHt=class{match(t){return typeof t=="object"&&t!==null}coerce(t,r){let n=this.getErrorPropertyFromObject(t);return n?r.apply(n):{type:this.getType(t),value:this.getValue(t),stack:this.getStack(t)??r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(Cft(t))return t.constructor.name;let r="name"in t?t.name:void 0;return rk(r)&&!aXo(r)?r:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let i=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(i+=` with message: '${t.message}'`),i}if("message"in t&&typeof t.message=="string")return t.message;let r=this.getObjectClassName(t),n=Tin(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${n}`}isSeverityLevel(t){return rk(t)&&!aXo(t)&&kol.indexOf(t)>=0}getStack(t){try{return rk(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:rk(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];if(f1e(n))return n}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var SXo=class{match(t){return Cft(t)}coerce(t,r){let n=t.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${Tin(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var YHt=class{match(t){return fin(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var wXo=class{match(t){return g5e(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Cft(t))return!1;try{let r=t.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(t,r){let n=this.getUnhandledRejectionReason(t);return fin(n)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`,stack:r.syntheticException?.stack,synthetic:!0}:r.apply(n)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var TXo=class{constructor(t){this._maxSize=t,this._cache=new Map}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){this._cache.set(t,r)}reduce(){for(;this._cache.size>=this._maxSize;){let t=this._cache.keys().next().value;t&&this._cache.delete(t)}}};var XHt={MESSAGE:"$message",TIMESTAMP:"$timestamp"},Fch=new Set([XHt.MESSAGE,XHt.TIMESTAMP]),Oin={enabled:!0,max_bytes:32768};function OXo(e){return e?{enabled:e.enabled??Oin.enabled,max_bytes:jch(e.max_bytes,Oin.max_bytes)}:{...Oin}}function Nch(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((n,i)=>Fch.has(i)?(t.push(i),n):(n[i]=e[i],n),{}),droppedKeys:t}}var PXo=class{constructor(t){this._entries=[],this._totalBytes=0,this._config=OXo(t)}setConfig(t){this._config=OXo(t),this._trimToMaxBytes()}add(t){let r=zch(t);if(!r)return;let n=Fol(r.json);n>this._config.max_bytes||(this._entries.push({step:r.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}getAttachable(){return this._entries.map(t=>t.step)}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){let t=this._entries.shift();t&&(this._totalBytes-=t.bytes)}}};function jch(e,t){if(!vft(e)||e===1/0||e===-1/0)return t;let r=Math.floor(e);return r<0?t:r}function zch(e){let t;try{t=p1e(e)}catch{return}try{let r=JSON.parse(t);if(!UHt(r))return;let n=r,i=n[XHt.MESSAGE],o=n[XHt.TIMESTAMP];return!rk(i)||i.trim().length===0||!rk(o)&&!vft(o)?void 0:{step:n,json:t}}catch{return}}function Fol(e){if("u">typeof TextEncoder)return new TextEncoder().encode(e).length;let t=encodeURIComponent(e),r=0;for(let n=0;n<t.length;n++)t[n]==="%"?(r+=1,n+=2):r+=1;return r}function Qch(){let e=globalThis._posthogReleaseId;return typeof e=="string"&&e.length>0?e:void 0}var BXo=e=>{if("flags"in e){let t=Nol(e.flags),r=jol(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,o])=>[i,Tft(o)])),n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,Mch(i,o,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function Mch(e,t,r){return{key:e,enabled:typeof t=="string"?!0:t,variant:typeof t=="string"?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var Nol=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,ZHt(r)]).filter(([,t])=>t!==void 0)),jol=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(r=>{let n=t[r];return n.enabled&&n.metadata&&n.metadata.payload!==void 0}).map(r=>{let n=t[r].metadata?.payload;return[r,n?Tft(n):void 0]}))},ZHt=e=>e===void 0?void 0:e.variant??e.enabled,Tft=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};var zol=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Lch=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain",...zol,"$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],$Ht=(e,t=[])=>{let r={},n=i=>{e[i]!==void 0&&(r[i]=e[i])};return Lch.forEach(n),t.forEach(n),r};var Pin=class{constructor(){this.events={},this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),()=>{this.events[t]=this.events[t].filter(n=>n!==r)}}emit(t,r){for(let n of this.events[t]||[])n(r);for(let n of this.events["*"]||[])n(t,r)}};function RXo(){return"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&typeof Response.prototype.blob=="function"}var Uch="NativeGzipValidationError",Vch=31,Gch=139,qch=8,Wch=e=>e.length>=2&&e[0]===Vch&&e[1]===Gch;var eKt,Hch=()=>{if(eKt)return eKt;eKt=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;eKt[e]=t>>>0}return eKt},Kch=e=>{let t=Hch(),r=4294967295;for(let n=0;n<e.length;n++)r=t[(r^e[n])&255]^r>>>8;return(4294967295^r)>>>0},Bin=e=>{throw wft(Uch,`Native gzip produced invalid output: ${e}`)},Jch=async(e,t)=>{e.size<18&&Bin("too-short");let r=new Uint8Array(await e.slice(0,10).arrayBuffer());(!Wch(r)||r[2]!==qch)&&Bin("invalid-header");let n=new DataView(await e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==Kch(t)&&Bin("invalid-crc");let i=t.length>>>0;n.getUint32(4,!0)!==i&&Bin("invalid-size")};async function tKt(e,t=!0,r){try{let n=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),s=o.write(n).then(()=>o.close()).catch(async u=>{try{await o.abort(u)}catch{}throw u}),a=new Response(i.readable).blob(),[c]=await Promise.all([a,s]);return await Jch(c,n),c}catch(n){if(r?.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}}var V8=class extends Error{constructor(t,r,n,i){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.responseBodyDeadline=n,this.abortController=i,this.name="PostHogFetchHttpError",this._bodyReadTimedOut=!1}get status(){return this.response.status}get retryAfterMs(){try{return gXo(this.response.headers?.get("retry-after"))}catch{return}}get bodyReadTimedOut(){return this._bodyReadTimedOut}get text(){if(!this.responseBodyTextPromise)if(Date.now()>=this.responseBodyDeadline){this._bodyReadTimedOut=!0;let t=wft("AbortError","Response body read timed out");this.cancelResponseBody(t),this.responseBodyTextPromise=Promise.reject(t)}else{let t=new Promise((n,i)=>{this.responseBodyTimer=zN(()=>{this._bodyReadTimedOut=!0;let o=wft("AbortError","Response body read timed out");i(o),this.cancelResponseBody(o)},this.responseBodyDeadline-Date.now())}),r;try{r=Promise.resolve(this.response.text())}catch(n){r=Promise.reject(n)}this.responseBodyTextPromise=Promise.race([r,t]).finally(()=>clearTimeout(this.responseBodyTimer))}return this.responseBodyTextPromise}get json(){return this.text.then(t=>JSON.parse(t))}cancelResponseBody(t){clearTimeout(this.responseBodyTimer),this.abortController.signal.aborted||this.abortController.abort(t),(async()=>{try{await this.response.body?.cancel()}catch{}})()}},Ghe=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};var Uol=(e,t)=>{for(let r of Object.keys(t))(r.startsWith("$feature/")||r==="$active_feature_flags")&&(e[r]=t[r])};async function Qol(e){if(e instanceof V8){let t="";try{t=await e.text}catch{e.bodyReadTimedOut&&(t="<response body read timed out>")}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function Ych(e){return typeof e=="object"&&(e instanceof V8||Vol(e))}function Vol(e){return e instanceof Ghe}function Xch(e){if(e instanceof V8)return e.status===502||e.status===504;if(!(e instanceof Ghe))return!1;let t=e.error;return(t?.code??t?.cause?.code)!=="ECONNREFUSED"}var Mol=10485760;function Lol(e){try{return typeof e!="string"?e instanceof Uint8Array?e.byteLength:e.size:"u">typeof Buffer?Buffer.byteLength(e,gol):new TextEncoder().encode(e).length}catch{return 0}}function Oft(e){return typeof e=="object"&&e instanceof V8&&e.status===413}function Rin(e){return e instanceof V8?e.status===408||e.status===429||e.status>=500:Vol(e)}function _ol(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var DXo="default",rKt=class{getErrorPropertiesBuilder(){return this._errorPropertiesBuilder||(this._errorPropertiesBuilder=this.createErrorPropertiesBuilder()),this._errorPropertiesBuilder}createErrorPropertiesBuilder(){return new WHt([new HHt,new JHt,new KHt,new YHt],vXo())}getEvaluationRuntime(){}constructor(t,r={}){this.flushPromise=null,this.pendingFlushPromise=null,this.flushPromises=new Set,this._dequeuedMessagesCount=0,this.shutdownPromise=null,this.promiseQueue=new Ain,this._events=new Pin,this._isInitialized=!1;let n=typeof t=="string"?t.trim():"",i=typeof r.host=="string"?r.host.trim():"",o=!n;this._logger=tol("[PostHog]",this.logMsgIfDebug.bind(this)),o&&this._logger.error("You must pass your PostHog project's api key. The client will be disabled."),this.apiKey=n,this.host=Aol(i||"https://us.i.posthog.com"),this.flushAt=r.flushAt?Math.max(r.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r.maxQueueSize??1e3),this.flushInterval=r.flushInterval??1e4,this.preloadFeatureFlags=r.preloadFeatureFlags??!0,this.defaultOptIn=r.defaultOptIn??!0,this.disableSurveys=r.disableSurveys??!1,this._retryOptions={retryCount:r.fetchRetryCount??3,retryDelay:r.fetchRetryDelay??3e3,retryCheck:Rin},this.requestTimeout=r.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r.featureFlagsRequestTimeoutMs??3e3,this.featureFlagsRequestMaxRetries=r.featureFlagsRequestMaxRetries??1,this.remoteConfigRequestTimeoutMs=r.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r.disableGeoip??!0,this.disabled=(r.disabled??!1)||o,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this.evaluationContexts=r?.evaluationContexts??r?.evaluationEnvironments,r?.evaluationEnvironments&&!r?.evaluationContexts&&this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version."),this.disableCompression=!RXo()||(r?.disableCompression??!1)}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(OM.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(OM.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(OM.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(n,i)=>this._logger.info(n,i));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){let r=t.properties||{},n={...r,...this.getCommonEventProperties()};return Uol(n,r),t.event==="$feature_flag_called"&&n.$feature_flag_has_experiment===!1&&this.isMinimalFlagCalledEventsEnabled()&&(n=$Ht(n)),{distinct_id:t.distinct_id,event:t.event,properties:n}}isMinimalFlagCalledEventsEnabled(){return!1}addPendingPromise(t){return this.promiseQueue.add(t)}identifyStateless(t,r,n){this.wrap(()=>{let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};this.enqueue("identify",i,n)})}async identifyStatelessImmediate(t,r,n){let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};await this.sendImmediate("identify",i,n)}captureStateless(t,r,n,i){this.wrap(()=>{let o=this.buildPayload({distinct_id:t,event:r,properties:n});this.enqueue("capture",o,i)})}async captureStatelessImmediate(t,r,n,i){let o=this.buildPayload({distinct_id:t,event:r,properties:n});await this.sendImmediate("capture",o,i)}aliasStateless(t,r,n,i){this.wrap(()=>{let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});this.enqueue("alias",o,i)})}async aliasStatelessImmediate(t,r,n,i){let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",o,i)}groupIdentifyStateless(t,r,n,i,o,s){this.wrap(()=>{let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});this.enqueue("capture",a,i)})}async groupIdentifyStatelessImmediate(t,r,n,i,o,s){let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});await this.sendImmediate("capture",a,i)}async getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,n,{type:"required",consume:i=>i.json()},{retryCount:0},this.remoteConfigRequestTimeoutMs).catch(i=>{this._logger.error("Remote config could not be loaded",i),this._events.emit("error",i)})}async getFlags(t,r={},n={},i={},o={},s=!1){await this._initPromise;let a=s?"&config=true":"",c=`${this.host}/flags/?v=2${a}`,u={token:this.apiKey,distinct_id:t,groups:r,person_properties:n,group_properties:i,...o};n.$device_id&&(u.$device_id=n.$device_id),this.evaluationContexts&&this.evaluationContexts.length>0&&(u.evaluation_contexts=this.evaluationContexts);let l=this.getEvaluationRuntime();l&&(u.evaluation_runtime=l);let p={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(u)};return this._logger.info("Flags URL",c),this.fetchWithRetry(c,p,{type:"required",consume:d=>d.json()},{retryCount:this.featureFlagsRequestMaxRetries,retryCheck:Xch},this.featureFlagsRequestTimeoutMs).then(d=>({success:!0,response:BXo(d)})).catch(d=>(this._events.emit("error",d),{success:!1,error:this.categorizeRequestError(d)}))}categorizeRequestError(t){if(t instanceof V8)return{type:"api_error",statusCode:t.status};if(t instanceof Ghe){let r=t.error;return r instanceof Error&&(r.name==="AbortError"||r.name==="TimeoutError")?{type:"timeout"}:{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailStateless(t,r,n,i,o,s);if(a===void 0)return{response:void 0,requestId:void 0};let c=ZHt(a.response);return c===void 0&&(c=!1),{response:c,requestId:a.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(r,n,i,o,s,[t]);return a===void 0?void 0:{response:a.flags[t],requestId:a.requestId,evaluatedAt:a.evaluatedAt}}async getFeatureFlagPayloadStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagPayloadsStateless(r,n,i,o,s,[t]);if(!a)return;let c=a[t];return c===void 0?null:c}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},o,s){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},o,s){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(t,r,n,i,o,s);return a?{flags:a.featureFlags,payloads:a.featureFlagPayloads,requestId:a.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a={geoip_disable:o??this.disableGeoip};s&&(a.flag_keys_to_evaluate=s);let c=await this.getFlags(t,r,n,i,a);if(!c.success)return;let u=c.response;return u.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),u.quotaLimited?.includes("feature_flags")?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:u?.requestId,quotaLimited:u.quotaLimited}):u}async getSurveysStateless(){if(await this._initPromise,this.disabled)return[];if(this.disableSurveys===!0)return this._logger.info("Loading surveys is disabled."),[];let t=`${this.host}/api/surveys/?token=${this.apiKey}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},i=(await this.fetchWithRetry(t,r,{type:"required",consume:o=>{if(o.status!==200||!o.json){let s=`Surveys API could not be loaded: ${o.status}`,a=new Error(s);return this._logger.error(a),this._events.emit("error",new Error(s)),Promise.resolve(void 0)}return o.json()}}).catch(o=>{this._logger.error("Surveys API could not be loaded",o),this._events.emit("error",o)}))?.surveys;return i&&this._logger.info("Surveys fetched from API: ",JSON.stringify(i)),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(OM.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(OM.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(OM.Props,this.props)})}processBeforeEnqueue(t){return t}async flushStorage(){}getQueueRouteKey(t){return DXo}persistedQueueKeyForRoute(t){return OM.Queue}getActiveQueueRoutes(){return[DXo]}getRouteQueue(t){return this.getPersistedProperty(this.persistedQueueKeyForRoute(t))||[]}enqueue(t,r,n,i){this.wrap(()=>{if(this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o===null)return;o=this.normalizeMessage(o);let s=this.persistedQueueKeyForRoute(i??this.getQueueRouteKey(o)),a=this.getPersistedProperty(s)||[];a.length>=this.maxQueueSize&&(a.shift(),this._logger.warn("Queue is full, the oldest event is dropped.")),a.push({message:o}),this.setPersistedProperty(s,a),this._events.emit(t,o),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=zN(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n,i){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o!==null){o=this.normalizeMessage(o);try{await this.sendBatch([o],void 0,i??this.getQueueRouteKey(o))}catch(s){this._events.emit("error",s)}}}normalizeMessage(t){let{type:r,library:n,library_version:i,...o}=t,s=_ol(o.properties)?o.properties:void 0;return n!==void 0&&s?.$lib===void 0&&(s={...s||{},$lib:n}),i!==void 0&&s?.$lib_version===void 0&&(s={...s||{},$lib_version:i}),s&&(o.properties=s),o.uuid=y5e(o.uuid,jN),o}normalizeTimestampForWire(t){let r=t instanceof Date?t:typeof t=="string"?new Date(t):null;if(!r||Number.isNaN(r.getTime()))return t;let n=r.toISOString(),i=typeof t=="string"?t.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1]:void 0;return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}prepareMessage(t,r){let n={...t,timestamp:r?.timestamp?r?.timestamp:AXo(),uuid:y5e(r?.uuid,jN)};return(r?.disableGeoip??this.disableGeoip)&&(_ol(n.properties)||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.pendingFlushPromise||this.flushAutomatic().catch(async t=>{await Qol(t)})}flushAutomatic(){return this.flush()}async waitForPendingPromises(t,r=[]){let n=r.filter(o=>!!o),i=0;for(;;){let o=this.promiseQueue.getPromises([...n,...this.flushPromises],t);if(o.length===0)return;i>0&&this._logger.debug(`flush() re-checking ${o.length} pending promise(s) before flushing`),await Promise.all(o.map(s=>s.catch(()=>{}))),i++}}flushWithPendingPromises(){return this.flushInternal(!0)}flush(){return this.flushInternal(!1)}flushInternal(t){if(this.disabled)return Promise.resolve();if(!t&&this.pendingFlushPromise)return this.pendingFlushPromise;let r=this.flushPromise,n=this.promiseQueue.maxId,i=Promise.resolve().then(()=>{if(t)return this.waitForPendingPromises(n,[r,i])}).then(()=>qHt([r])).then(()=>(this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this._flush()));return this.pendingFlushPromise=i,this.flushPromise=i,this.flushPromises.add(i),this.addPendingPromise(i),qHt([i]).then(()=>{this.flushPromises.delete(i),this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this.flushPromise===i&&(this.flushPromise=null)}),i}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}compressPayload(t){return tKt(t,this.isDebug)}getBatchEndpointPath(t){return"/batch/"}async sendBatch(t,r,n=DXo){let i={api_key:this.apiKey,batch:t.map(u=>{if(!u)return u;let l=this.normalizeTimestampForWire(u.timestamp);return l===u.timestamp?u:{...u,timestamp:l}}),sent_at:AXo()};this.historicalMigration&&(i.historical_migration=!0);let o=p1e(i),s=`${this.host}${this.getBatchEndpointPath(n)}`,a=this.disableCompression?null:await this.compressPayload(o),c={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...a!==null&&{"Content-Encoding":"gzip"}},body:a||o};await this.fetchWithRetry(s,c,{type:"successful-write"},r)}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getActiveQueueRoutes();if(!t.some(i=>this.getRouteQueue(i).length>0))return;let r=[],n;for(let i of t)try{await this._flushRoute(i,r)}catch(o){n===void 0&&(n=o)}if(n!==void 0)throw n;this._events.emit("flush",r)}async _flushRoute(t,r){let n=this.persistedQueueKeyForRoute(t),i=this.getPersistedProperty(n)||[];if(!i.length)return;let o=i.length,s=0;for(;i.length>0&&s<o;){let a=i.slice(0,this.maxBatchSize),c=a.map(p=>p.message===void 0?p.message:this.normalizeMessage(p.message)),u=async()=>{let p=this.getPersistedProperty(n)||[],d=[...a],f=p.filter(m=>{let g=m.message?.uuid,A=d.findIndex(y=>y===m||typeof g=="string"&&g.length>0&&y.message?.uuid===g);return A===-1?!0:(d.splice(A,1),!1)});this.setPersistedProperty(n,f),i=f,this._dequeuedMessagesCount+=a.length,await this.flushStorage()},l={retryCheck:p=>Oft(p)?!1:Rin(p)};try{await this.sendBatch(c,l,t)}catch(p){if(Oft(p)&&c.length>1){this.maxBatchSize=Math.max(1,Math.floor(c.length/2)),this._logger.warn(`Received 413 when sending batch of size ${c.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw p instanceof Ghe||await u(),this._events.emit("error",p),p}await u(),r.push(...c),s+=c.length}}async _sendOtlpBatch({path:t,auth:r,payload:n}){if(this.disabled)return{kind:"fatal",error:new Error("The client is disabled")};let i;try{i=JSON.stringify(n)}catch(l){return this.logMsgIfDebug(()=>console.warn(`[PostHog] Could not serialize a ${t} batch; reporting it as too large`,l)),{kind:"too-large",measuredLocally:!0}}let o=Lol(i);if(o>Mol)return this.logMsgIfDebug(()=>console.warn(`[PostHog] Not sending a ${t} batch of ${o} bytes: the endpoint accepts at most ${Mol}`)),{kind:"too-large",measuredLocally:!0};let s=r==="bearer"?`${this.host}/i/v1/${t}`:`${this.host}/i/v1/${t}?token=${encodeURIComponent(this.apiKey)}`,a=this.disableCompression?null:await this.compressPayload(i),c=a||i,u={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...r==="bearer"&&{Authorization:`Bearer ${this.apiKey}`},...a!==null&&{"Content-Encoding":"gzip"}},body:c};try{return await this.fetchWithRetry(s,u,{type:"successful-write"},{retryCheck:l=>Oft(l)||l instanceof V8&&l.retryAfterMs!==void 0?!1:Rin(l)}),{kind:"ok"}}catch(l){if(Oft(l))return{kind:"too-large"};if(Rin(l)){let p=l instanceof V8?l.retryAfterMs:void 0;return{kind:"retry-later",error:l,...p!==void 0&&{retryAfterMs:p}}}return{kind:"fatal",error:l}}}async _sendLogsBatch(t){return this._sendOtlpBatch({path:"logs",auth:"query-token",payload:t})}async _sendMetricsBatch(t){return this._sendOtlpBatch({path:"metrics",auth:"query-token",payload:t})}async _sendTracesBatch(t){return this._sendOtlpBatch({path:"traces",auth:"bearer",payload:t})}async fetchWithRetry(t,r,n,i,o){let s=r.body?r.body:"",a=Lol(s),c={...this._retryOptions,...i},u=0;return await yol(async()=>{u++;let l=new AbortController,p=o??this.requestTimeout,d=Date.now()+p,f,m=new Promise((x,v)=>{f=zN(()=>{let S=wft("AbortError",`Request timed out after ${p}ms`);v(S),l.abort(S)},p)}),g,A=!1,y,I=()=>y??=(async()=>{try{await g?.body?.cancel()}catch{}})();try{let x;try{x=this.fetch(t,{signal:l.signal,...r})}catch(B){throw new Ghe(B)}x.then(B=>{l.signal.aborted&&!A&&Promise.resolve(B.body?.cancel()).catch(()=>{})}).catch(()=>{});try{g=await Promise.race([x,m]),A=!0}catch(B){throw new Ghe(B)}let v=r.mode==="no-cors",S=n.type==="successful-write"?300:400;if(!v&&(g.status<200||g.status>=S))throw new V8(g,a,d,l);if(n.type==="successful-write"){try{await Promise.race([I(),m])}catch{}return}try{return await Promise.race([n.consume(g),m])}catch(B){throw l.signal.aborted?new Ghe(B):B}}finally{clearTimeout(f),l.signal.aborted&&g&&I()}},{...c,retryCheck:l=>{let p=c.retryCheck(l);return p&&u<=c.retryCount&&l instanceof V8&&l.cancelResponseBody(),p}})}async _shutdown(t=3e4){await this._initPromise;let r=!1;return this.clearFlushTimer(),this.disabled?void 0:d1e((async()=>{try{for(await this.promiseQueue.join();this.getActiveQueueRoutes().some(s=>this.getRouteQueue(s).length>0);){let o=this._dequeuedMessagesCount;if(await this.flush(),r)break;if(this._dequeuedMessagesCount===o){this._logger.warn("Shutdown flush completed but did not send any queued events. Stopping drain to avoid a loop.");break}}}catch(i){if(!Ych(i))throw i;await Qol(i)}})(),t,()=>{this._logger.critical("Timeout while shutting down PostHog. Some events may not have been sent.",{shutdownTimeoutMs:t}),r=!0})}async shutdown(t=3e4){return this.shutdownPromise?this._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup"):this.shutdownPromise=this._shutdown(t).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}};var ruh=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi;var C7v=new RegExp(ruh.source,"i"),Gol=/[a-z][a-z0-9+.-]{0,63}:\/\//i,x7v=new RegExp(`^${Gol.source}`,"i"),S7v=new RegExp(Gol.source,"gi");var nuh=["is_not","is_set"],iuh=1152921504606847e3,Zu=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Object.setPrototypeOf(this,e.prototype)}};function kXo(e){if(typeof e=="boolean")return!0;if(typeof e=="string"){let t=e.toLowerCase();return t==="true"||t==="false"}if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!kXo(t in e?e[t]:null))return!1;return!0}function FXo(e){if(typeof e=="boolean")return e;if(typeof e=="string")return e.toLowerCase()==="true";if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!FXo(t in e?e[t]:null))return!1;return!0}function nKt(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(t+1>=e.length||n<56320||n>57343)throw new Zu("Cannot stringify an unpaired surrogate like the flags service");t++}else if(r>=56320&&r<=57343)throw new Zu("Cannot stringify an unpaired surrogate like the flags service")}}function kin(e,t=new Set){if(!(e===null||typeof e=="boolean")){if(typeof e=="string")return void nKt(e);if(typeof e=="number"){if(!Number.isFinite(e))throw new Zu(`Cannot represent non-finite number ${e} like the flags service`);return}if(Array.isArray(e)){if(t.has(e))throw new Zu("Cannot represent a circular array during local evaluation");t.add(e);try{for(let r=0;r<e.length;r++)r in e&&kin(e[r],t)}finally{t.delete(e)}return}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Zu("Cannot represent a non-JSON object like the flags service");if(t.has(e))throw new Zu("Cannot represent a circular object during local evaluation");t.add(e);try{for(let n of Object.keys(e))nKt(n),kin(e[n],t)}finally{t.delete(e)}return}throw new Zu(`Cannot represent ${typeof e} like the flags service`)}}function ouh(e,t){let r=0,n=0;for(;r<e.length&&n<t.length;){let i=e.charCodeAt(r),o=t.charCodeAt(n),s=i>=55296&&i<=56319,a=o>=55296&&o<=56319,c=s?e.charCodeAt(r+1):0,u=a?t.charCodeAt(n+1):0,l=s?(i-55296)*1024+c-56320+65536:i,p=a?(o-55296)*1024+u-56320+65536:o;if(l!==p)return l-p;r+=s?2:1,n+=a?2:1}return e.length-t.length}function NXo(e,t=new Set){if(e===null)return"null";if(typeof e=="string")return nKt(e),JSON.stringify(e);if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new Zu(`Cannot stringify non-finite number ${e} like the flags service`);if(Number.isInteger(e))throw new Zu(`Cannot distinguish integer ${e} from an integral JSON float during local evaluation`);return String(e)}if(Array.isArray(e)){if(t.has(e))throw new Zu("Cannot stringify a circular array during local evaluation");t.add(e);try{let r=[];for(let n=0;n<e.length;n++)r.push(n in e?NXo(e[n],t):"null");return`[${r.join(",")}]`}finally{t.delete(e)}}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Zu("Cannot stringify a non-JSON object like the flags service");if(t.has(e))throw new Zu("Cannot stringify a circular object during local evaluation");t.add(e);try{let n=Object.keys(e);return n.forEach(nKt),`{${n.sort(ouh).map(i=>`${JSON.stringify(i)}:${NXo(e[i],t)}`).join(",")}}`}finally{t.delete(e)}}throw new Zu(`Cannot stringify ${typeof e} like the flags service`)}function Din(e){return typeof e=="string"?(nKt(e),e):NXo(e)}function qol(e){try{return new RegExp(e),!0}catch{return!1}}function G8(e){return String(e).replace(/[A-Z]/g,t=>t.toLowerCase())}function Hol(e,t,r){if(!/^\d+$/.test(e)||r==="strict"&&e.length>1&&e[0]==="0")throw new Zu(`Invalid semver: ${t}`);return parseInt(e,10)}function Xw(e,t="strict"){let n=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!n||n.startsWith("."))throw new Zu(`Invalid semver: ${e}`);let i=n.split("."),o=s=>s===void 0||s===""?0:Hol(s,e,t);return[o(i[0]),o(i[1]),o(i[2])]}function q8(e,t){for(let r=0;r<3;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0}function suh(e,t){let r=Xw(e,t);return{lower:[r[0],r[1],r[2]],upper:[r[0],r[1]+1,0]}}function auh(e,t){let[r,n,i]=Xw(e,t),o=[r,n,i],s;return s=r>0?[r+1,0,0]:n>0?[0,n+1,0]:[0,0,i+1],{lower:o,upper:s}}function cuh(e,t){let n=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!n)throw new Zu(`Invalid wildcard semver: ${e}`);let i=n.split("."),o=c=>{if(t==="legacy-permissive"){let u=parseInt(c,10);if(!isNaN(u))return u}else try{return Hol(c,e,t)}catch{}throw new Zu(`Invalid wildcard semver: ${e}`)},s=o(i[0]);if(i.length===1)return{lower:[s,0,0],upper:[s+1,0,0]};let a=o(i[1]);return{lower:[s,a,0],upper:[s,a+1,0]}}function Wol(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(!isNaN(t.valueOf()))return t;throw new Zu(`${e} is in an invalid date format`)}throw new Zu(`The date provided ${e} must be a string, number, or date object`)}function jXo(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(!r||!r.groups)return null;let i=parseInt(r.groups.number);if(i>=1e4)return null;let o=r.groups.interval;if(o==="h")n.setUTCHours(n.getUTCHours()-i);else if(o==="d")n.setUTCDate(n.getUTCDate()-i);else if(o==="w")n.setUTCDate(n.getUTCDate()-7*i);else if(o==="m")n.setUTCMonth(n.getUTCMonth()-i);else{if(o!=="y")return null;n.setUTCFullYear(n.getUTCFullYear()-i)}return n}function zXo(e,t,r={}){let n=e.key,i=e.value,o=e.operator||"exact",s=r.semverParsingPolicy??"strict";if(Object.prototype.hasOwnProperty.call(t,n)){if(o==="is_not_set")return!1;if(o==="is_set")return!0}else throw new Zu(`Property ${n} not found in propertyValues`);let c=t[n];if(c===void 0)return r.warnFunction?.(`Property ${n} cannot have a value of undefined with the ${o} operator`),o==="is_not";if(c===null&&!nuh.includes(o)&&o!=="exact"&&o!=="is_not")return r.warnFunction?.(`Property ${n} cannot have a value of null with the ${o} operator`),!1;let u=(p,d)=>{if(r.propertyMatchingVersion!==2&&kXo(p)||Array.isArray(p)&&p.length===0)return kin(d),FXo(p)===FXo(d);if(r.propertyMatchingVersion===2&&typeof d=="number"&&kXo(p))return kin(d),!1;if(Array.isArray(p)){let f=Din(d).toLowerCase();return p.some(m=>Din(m).toLowerCase()===f)}return Din(p).toLowerCase()===Din(d).toLowerCase()},l=(p,d,f)=>{if(f==="gt")return p>d;if(f==="gte")return p>=d;if(f==="lt")return p<d;if(f==="lte")return p<=d;throw new Error(`Invalid operator: ${f}`)};switch(o){case"exact":return u(i,c);case"is_not":return!u(i,c);case"is_set":return!0;case"icontains":return G8(c).includes(G8(i));case"not_icontains":return!G8(c).includes(G8(i));case"starts_with":return G8(c).startsWith(G8(i));case"not_starts_with":return!G8(c).startsWith(G8(i));case"ends_with":return G8(c).endsWith(G8(i));case"not_ends_with":return!G8(c).endsWith(G8(i));case"regex":return qol(String(i))&&String(c).match(String(i))!==null;case"not_regex":return qol(String(i))&&String(c).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let p=typeof i=="number"?i:parseFloat(String(i)),d=typeof c=="number"?c:c!=null?parseFloat(String(c)):NaN;return Number.isFinite(p)&&Number.isFinite(d)?l(d,p,o):l(String(c),String(i),o)}case"is_date_after":case"is_date_before":{if(typeof i=="boolean")throw new Zu("Date operations cannot be performed on boolean values");let p=jXo(String(i));p==null&&(p=Wol(i));let d=Wol(c);return o==="is_date_before"?d<p:d>p}case"semver_eq":return q8(Xw(String(c),s),Xw(String(i),s))===0;case"semver_neq":return q8(Xw(String(c),s),Xw(String(i),s))!==0;case"semver_gt":return q8(Xw(String(c),s),Xw(String(i),s))>0;case"semver_gte":return q8(Xw(String(c),s),Xw(String(i),s))>=0;case"semver_lt":return q8(Xw(String(c),s),Xw(String(i),s))<0;case"semver_lte":return q8(Xw(String(c),s),Xw(String(i),s))<=0;case"semver_tilde":{let p=Xw(String(c),s),{lower:d,upper:f}=suh(String(i),s);return q8(p,d)>=0&&q8(p,f)<0}case"semver_caret":{let p=Xw(String(c),s),{lower:d,upper:f}=auh(String(i),s);return q8(p,d)>=0&&q8(p,f)<0}case"semver_wildcard":{let p=Xw(String(c),s),{lower:d,upper:f}=cuh(String(i),s);return q8(p,d)>=0&&q8(p,f)<0}default:throw new Zu(`Unknown operator: ${o}`)}}async function Kol(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("SubtleCrypto API not available");let r=await t.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function iKt(e,t,r="",n="."){let i=await Kol(`${e}${n}${t}${r}`);return parseInt(i.slice(0,15),16)/iuh}async function QXo(e,t){if(e==null||e.id==null||e.exclusion_percentage==null)return;let r=Number(e.exclusion_percentage);if(!Number.isFinite(r))return;let n=Math.min(Math.max(r,0),100);if(!(n!==100&&await iKt("holdout",t,"","-")>n/100))return`holdout-${e.id}`}function Fin(e){let t=[],r=0;for(let n of e){let i=r+n.rollout_percentage/100;t.push({valueMin:r,valueMax:i,key:n.key}),r=i}return t}async function MXo(e,t,r){let n=await iKt(e,t,"variant");return Fin(r).find(i=>n>=i.valueMin&&n<i.valueMax)?.key}function LXo(e,t){if(t===!1||t==null||!e)return null;let r=typeof t=="boolean"?t.toString():t,n=e[r]||null;return n==null?null:Tft(n)}var Jol=9223372036854776e3,uuh="9223372036854775808",luh=Object.prototype.propertyIsEnumerable;function puh(){return{ancestors:new WeakSet,remainingNodes:1e4}}function hne(e,t){try{return Yol(e,t,puh(),0)}catch{return[]}}function fuh(e,t){let r=e.toString(),n=BigInt(uuh);return e>=n||e<-n?(t?.debug(`Attribute ${r} is outside the int64 range; encoding it as a string`),{stringValue:r}):{intValue:r}}function VXo(e,t,r,n){if(r.remainingNodes<=0)return{stringValue:Cin};if(r.remainingNodes--,Hil(e))return{boolValue:e};if(typeof e=="bigint")return fuh(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if("u"<typeof BigInt)return{stringValue:String(e)};let i=BigInt(e).toString();return e>=Jol||e<-Jol?(t?.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:dne(e)};if(typeof e=="function")return{stringValue:hol};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(r.ancestors.has(e))return{stringValue:vin};if(n>=20)return{stringValue:Cin};if(e instanceof Date){let i=e.getTime(),o=Number.isFinite(i)?e.toISOString():String(e);return{stringValue:typeof o=="string"?dne(o):String(o)}}r.ancestors.add(e);try{try{let i=e.toJSON;if(typeof i=="function")return VXo(i.call(e),t,r,n+1)}catch{}return V4(e)?{arrayValue:{values:duh(e,t,r,n+1)}}:{kvlistValue:{values:Yol(e,t,r,n+1)}}}finally{r.ancestors.delete(e)}}return{stringValue:dne(String(e))}}function duh(e,t,r,n){let i=[],o=Math.min(e.length,1e3),s=0;for(;s<o&&r.remainingNodes>0;s++)try{let a=s in e?e[s]:void 0;if(QJ(a))continue;i.push(VXo(a,t,r,n))}catch{i.push({stringValue:U8})}return e.length>s&&i.push({stringValue:Cin}),i}function Yol(e,t,r,n){let i=[];for(let o in e)if(luh.call(e,o)){if(!o){t?.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||r.remainingNodes<=0){t?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let s=e[o];if(cXo(s)||Uhe(s))continue;i.push({key:dne(o),value:VXo(s,t,r,n)})}catch{i.push({key:dne(o),value:{stringValue:U8}})}}return i}function sKt(e,t,r){return{...Vhe({},e.resourceAttributes),"service.name":e.serviceName||"unknown_service",...e.environment&&{"deployment.environment":e.environment},...e.serviceVersion&&{"service.version":e.serviceVersion},"telemetry.sdk.name":t,"telemetry.sdk.version":r}}var muh=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function aKt(e,t){let r=Vhe({},e),n={};for(let i of muh)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i],delete r[i]);return[...hne(r,t),...hne(n,t)]}var Xol={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"};function huh(e){if(e)return Object.prototype.hasOwnProperty.call(Xol,e)?Xol[e]:e}function GXo(e,t){let r=huh(e);return{...r?{"os.name":r}:{},...t?{"os.version":t}:{}}}var guh={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},_7v=guh.info;var b5e=class{constructor(t){this._onFire=t,this._firesAt=0}get pending(){return!!this._timer}arm(t){this.clear(),this._firesAt=Date.now()+t,this._timer=zN(()=>{this._timer=void 0,this._onFire()},t)}armNoEarlierThan(t){this._timer&&Date.now()+t<=this._firesAt||this.arm(t)}clear(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)}};function cKt(){return 1-.25+Math.random()*.25*2}var W8=1;function uKt(e,t,r,n){let i=Math.min(Math.max(0,t-1),6),o=e*2**i,s=n===void 0?o:Math.min(o,Math.max(n,e));return Math.round(s*r)}var lKt=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function qXo(e){return String(e)+"000000"}function WXo(e,t,r,n){let i="";return n&&(i=Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${JSON.stringify(n[s])}`).join(",")),`${e}\0${t}\0${r??""}\0${i}`}function Zol(e,t){for(let r=0;r<t.length;r++)if(e<=t[r])return r;return t.length}function HXo(e,t,r){return sKt(e,t,r)}function KXo(e,t,r,n){return{resourceMetrics:[{resource:{attributes:aKt(t)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]}}function jin(e){let t=e?.resourceAttributes;return{serviceName:t?.["service.name"]??e?.serviceName,serviceVersion:t?.["service.version"]??e?.serviceVersion,environment:t?.["deployment.environment"]??e?.environment,resourceAttributes:t,beforeSend:e?.beforeSend,flushIntervalMs:e?.flushIntervalMs??1e4,maxSeriesPerFlush:e?.maxSeriesPerFlush??1e3}}var $ol=1,pKt=class{constructor(t,r,n){this._instance=t,this._config=r,this._logger=n,this._series=new Map,this._flushTimer=new b5e(()=>this.flush().catch(i=>{this._logger.error("Metrics flush failed:",i)})),this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._retryAfter=new A5e,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._generation=0}count(t,r=1,n){this._capture({name:t,type:"count",value:r,unit:n?.unit,attributes:n?.attributes})}gauge(t,r,n){this._capture({name:t,type:"gauge",value:r,unit:n?.unit,attributes:n?.attributes})}histogram(t,r,n){this._capture({name:t,type:"histogram",value:r,unit:n?.unit,attributes:n?.attributes})}flush(){let t=this._flushPromise,n=(async()=>{t&&await t.catch(()=>{}),await this._doFlush()})().finally(()=>{this._flushPromise===n&&(this._flushPromise=null)});return this._flushPromise=n,n}drainWindow(){if(this._series.size===0)return null;let t=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(t)}reset(){this._generation++,this._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=W8,this._flushTimer.clear(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set}_capture(t){if(this._instance.isDisabled||this._instance.optedOut)return;let r=this._runBeforeSend(t);if(r===null)return;if(!r.name||typeof r.name!="string")return void this._logger.warn("Dropping metric with empty name");if(typeof r.value!="number"||!Number.isFinite(r.value))return void this._logger.warn(`Dropping metric '${r.name}': value must be a finite number`);if(r.type==="count"&&r.value<0)return void this._logger.warn(`Dropping count '${r.name}': counters are monotonic, value must be >= 0`);let n,i;try{n=r.attributes?{...r.attributes}:void 0,i=WXo(r.type,r.name,r.unit,n)}catch(a){this._logger.warn(`Dropping metric '${r.name}': attributes could not be serialized`,a);return}let o=this._series.get(i);if(!o){if(!this._admitNewSeries())return;o={name:r.name,type:r.type,unit:r.unit,attributes:n,windowStartMs:Date.now()},this._series.set(i,o)}let s=this._typeByName.get(r.name);s===void 0?this._typeByName.set(r.name,r.type):s!==r.type&&!this._typeCollisionWarned.has(r.name)&&(this._typeCollisionWarned.add(r.name),this._logger.warn(`Metric name '${r.name}' is already used as a ${s}; recording it as a ${r.type} too will blend both series in charts. Use a distinct name.`)),this._fold(o,r.value),this._armFlushTimer()}_admitNewSeries(){return this._series.size<this._config.maxSeriesPerFlush?!0:(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn(`Metric series cap reached (${this._config.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}_fold(t,r){switch(t.type){case"count":t.total=(t.total??0)+r;break;case"gauge":t.last=r;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:r,max:r,bucketCounts:new Array(lKt.length+1).fill(0)});let n=t.hist;n.count+=1,n.sum+=r,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.bucketCounts[Zol(r,lKt)]+=1;break}}}_runBeforeSend(t){let r=this._config.beforeSend;if(!r)return t;let n=V4(r)?r:[r],i=t;for(let o of n)try{let s=o(i);if(!s)return this._logger.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this._logger.error("Error in beforeSend function for metric:",s),null}return i}_armFlushTimer(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(uKt(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}async _doFlush(){if(this._flushTimer.clear(),this._series.size===0)return;let t=this._series;this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set;let r=this._generation,n=await this._instance._sendMetricsBatch(this._buildPayload(t));if(r===this._generation)switch(this._retryAfter.record(n),n.kind==="retry-later"?(this._consecutiveFlushFailures++,this._flushJitter=cKt()):(this._consecutiveFlushFailures=0,this._flushJitter=W8),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),n.kind){case"ok":return;case"retry-later":this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay());return;case"too-large":this._logger.warn("Metrics batch exceeded the server size limit and was dropped");return;case"fatal":this._logger.error("Failed to send metrics batch:",n.error);return}}_buildPayload(t){return KXo(this._buildMetrics(t),HXo(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._instance.getLibraryId(),this._instance.getLibraryVersion())}_buildMetrics(t){let r=qXo(Date.now()),n=new Map;for(let i of t.values()){let o=WXo(i.type,i.name,i.unit,void 0),s=n.get(o);s||(s={name:i.name,...i.unit&&{unit:i.unit}},i.type==="count"?s.sum={aggregationTemporality:$ol,isMonotonic:!0,dataPoints:[]}:i.type==="gauge"?s.gauge={dataPoints:[]}:s.histogram={aggregationTemporality:$ol,dataPoints:[]},n.set(o,s));let a=hne(i.attributes??{},this._logger),c=qXo(i.windowStartMs);if(i.type==="count"){let u={attributes:a,startTimeUnixNano:c,timeUnixNano:r,asDouble:i.total??0};s.sum.dataPoints.push(u)}else if(i.type==="gauge"){let u={attributes:a,timeUnixNano:r,asDouble:i.last??0};s.gauge.dataPoints.push(u)}else if(i.hist){let u={attributes:a,startTimeUnixNano:c,timeUnixNano:r,count:i.hist.count,sum:i.hist.sum,min:i.hist.min,max:i.hist.max,bucketCounts:i.hist.bucketCounts,explicitBounds:lKt};s.histogram.dataPoints.push(u)}}return Array.from(n.values())}_mergeWindowBack(t){for(let[r,n]of t){let i=this._series.get(r);if(!i){this._admitNewSeries()&&this._series.set(r,n);continue}switch(i.windowStartMs=Math.min(i.windowStartMs,n.windowStartMs),i.type){case"count":i.total=(i.total??0)+(n.total??0);break;case"gauge":break;case"histogram":if(n.hist)if(i.hist){i.hist.count+=n.hist.count,i.hist.sum+=n.hist.sum,i.hist.min=Math.min(i.hist.min,n.hist.min),i.hist.max=Math.max(i.hist.max,n.hist.max);for(let o=0;o<i.hist.bucketCounts.length;o++)i.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else i.hist=n.hist;break}}}};var Euh="0".repeat(32),Iuh="0".repeat(16),vuh=/^[0-9a-f]+$/;function Cuh(e){let t=new Uint8Array(e),r=globalThis.crypto;if(r&&typeof r.getRandomValues=="function")try{return r.getRandomValues(t),t}catch{}for(let n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}function xuh(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function esl(e){let t=xuh(Cuh(e));return/[^0]/.test(t)?t:t.slice(0,-1)+"1"}function tsl(){return esl(16)}function rsl(){return esl(8)}function nsl(e,t,r){return typeof e=="string"&&e.length===t&&e!==r&&vuh.test(e)}function isl(e){return nsl(e,32,Euh)}function osl(e){return nsl(e,16,Iuh)}var Suh=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;function ssl(e){let t=asl(e);return t&&{traceId:t.traceId,spanId:t.spanId,flags:wuh(t.flags)}}function wuh(e){return 1&parseInt(e,16)?Qin:Tuh}function asl(e){if(typeof e!="string")return;let t=Suh.exec(e.trim());if(!t)return;let[,r,n,i,o,s]=t;if(r!=="ff"&&!(r==="00"&&s)&&!(!isl(n)||!osl(i)))return{version:r,traceId:n,spanId:i,flags:o}}function csl(e){return asl(e)&&e.trim()}function zin(e){return Array.isArray(e)&&e.length===1?e[0]:e}var Qin="01",Tuh="00";function usl(e,t,r=Qin){return`00-${e}-${t}-${r}`}var Ouh=32,JXo=512;function Min(e){if(typeof e!="string")return;let t=e.trim();if(!t||/[^\x20-\x7e\t]/.test(t))return;let r=t.split(",");if(!(r.length>Ouh)){for(let n of r)if(n.trim()&&!n.includes("="))return;return t.length<=JXo?t:Buh(r)}}var Puh=128;function Buh(e){let t=[...e],r=()=>t.reduce((n,i)=>n+i.length,0)+t.length-1;for(let n=t.length-1;n>=0&&r()>JXo;n--)t[n].length>Puh&&t.splice(n,1);for(;t.length&&r()>JXo;)t.pop();return t.length?t.join(","):void 0}var lsl="unknown";function E5e(e,t,r,n){return typeof e=="string"&&e.trim()?e.length>r?e.slice(0,r):e:(n?.debug(`${t} must be a non-empty string; using "${lsl}"`),lsl)}function Pft(e){if(e==null)return;let t=e;if(e instanceof Date)try{t=e.getTime()}catch{return}if(!(typeof t!="number"||!Number.isFinite(t))&&!(t<0||t>9223372036854))return t}function psl(e,t,r){let n=Pft(e);return n===void 0?(e!==void 0&&r?.debug("Span startTime is out of range or not a valid time; using the current time"),t):(t-n>864e5?r?.debug("Span startTime is more than 24 hours in the past; the server will clamp it to receive time and keep the original in $originalTimestamp"):n>t&&r?.debug("Span startTime is in the future; the span may export with a zero duration"),n)}function Lin(e,t){return e<t?t:e}function fKt(e,t,r,n){let i=Pft(e);return i===void 0?(e!==void 0&&n?.debug(`Span ${r} is out of range or not a valid time; using the derived time`),t):i}function Uin(){let e=globalThis.performance;return typeof e?.now=="function"?e.now():void 0}var Bft=class{constructor(t,r,n){this._onEnd=r,this._logger=n,this._events=[],this._ended=!1,this._userAttributeCount=0,this._userEventCount=0,this._droppedAttributes=0,this._droppedEvents=0,this._traceId=t.traceId,this._spanId=t.spanId,this._parentSpanId=t.parentSpanId,this._traceState=t.traceState,this._traceFlags=t.traceFlags??Qin,this._parentIsRemote=t.parentIsRemote??!1,this._name=t.name,this._kind=t.kind,this._autoKeys=new Set(t.autoAttributeKeys),this._maxAttributes=t.maxAttributes,this._maxEvents=t.maxEvents,this._maxAttributesPerEvent=t.maxAttributesPerEvent,this._maxAttributeValueLength=t.maxAttributeValueLength,this._attributes=Object.create(null);for(let i of Object.keys(t.attributes))this._writeAttribute(i,t.attributes[i]);this._startMono=t.backdated?void 0:Uin(),this._startTime=t.clockAnchor&&this._startMono!==void 0?t.clockAnchor.wall+(this._startMono-t.clockAnchor.mono):t.startTime,this._startMono!==void 0&&(this._clockAnchor=t.clockAnchor??{wall:this._startTime,mono:this._startMono})}_now(){if(this._startMono!==void 0){let t=Uin();if(t!==void 0)return this._startTime+Math.max(0,t-this._startMono)}return Date.now()}_mutable(t){return this._ended?(this._logger?.debug(`Ignoring ${t} on a span that has already ended`),!1):!0}_writeAttribute(t,r){if(QJ(r)){t in this._attributes&&!this._autoKeys.has(t)&&this._userAttributeCount--,delete this._attributes[t];return}if(!this._autoKeys.has(t)&&!(t in this._attributes)){if(this._userAttributeCount>=this._maxAttributes)return void this._droppedAttributes++;this._userAttributeCount++}this._attributes[t]=Gin(r,this._maxAttributeValueLength)}setAttribute(t,r){return this._mutable("setAttribute")&&this._writeAttribute(t,r),this}setAttributes(t){if(this._mutable("setAttributes")){let r=Vhe({},t);for(let n of Object.keys(r))this._writeAttribute(n,r[n])}return this}addEvent(t,r,n){if(this._mutable("addEvent")){if(this._userEventCount>=this._maxEvents)return this._droppedEvents++,this;this._userEventCount++;let i=r&&hsl(r,this._maxAttributesPerEvent,this._maxAttributeValueLength);this._events.push({name:E5e(t,"Span event name",this._maxAttributeValueLength,this._logger),timestamp:fKt(n,this._now(),"event timestamp",this._logger),...i&&{attributes:i.attributes,...i.dropped&&{droppedAttributesCount:i.dropped}}})}return this}setStatus(t,r){if(this._mutable("setStatus")){if(t!=="ok"&&t!=="error")return this._logger?.debug(`Ignoring unknown span status "${String(t)}"; expected "ok" or "error"`),this;this._status={code:t,...r&&{message:YXo(r,this._maxAttributeValueLength)}}}return this}get statusIsExplicitlyOk(){return this._status?.code==="ok"}recordException(t){if(!this._mutable("recordException"))return this;let{type:r,message:n,stack:i}=XXo(t);return this.addEvent(Ruh,{"exception.type":r,"exception.message":n,...i&&{"exception.stacktrace":i}}),this.setStatus("error",n)}updateName(t){return this._mutable("updateName")&&(this._name=E5e(t,"Span name",this._maxAttributeValueLength,this._logger)),this}traceparent(){return usl(this._traceId,this._spanId,this._traceFlags)}tracestate(){return this._traceState??null}childContext(){return{traceId:this._traceId,parentSpanId:this._spanId,traceState:this._traceState,traceFlags:this._traceFlags,clockAnchor:this._clockAnchor}}end(t){if(this._ended)return void this._logger?.debug("Ignoring end() on a span that has already ended");this._ended=!0;let r=this._now(),n=fKt(t,r,"end time",this._logger);this._onEnd({traceId:this._traceId,spanId:this._spanId,...this._parentSpanId&&{parentSpanId:this._parentSpanId},...this._traceState&&{traceState:this._traceState},traceFlags:this._traceFlags,parentIsRemote:this._parentIsRemote,name:this._name,kind:this._kind,...this._status&&{status:this._status},attributes:{...this._attributes},events:this._events,startTime:this._startTime,endTime:Lin(n,this._startTime),...this._droppedAttributes&&{droppedAttributesCount:this._droppedAttributes},...this._droppedEvents&&{droppedEventsCount:this._droppedEvents}},this._autoKeys)}},Ruh="exception",Duh=4294967295;function kuh(e){try{return typeof e=="string"?e:String(e)}catch{return U8}}function I5e(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?0:Math.min(Math.floor(e),Duh)}function Fuh(e,t){if(!t.length)return Object.keys(e);let r=t.filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)),n=new Set(r);return[...r,...Object.keys(e).filter(i=>!n.has(i))]}function dsl(e,t,r,n,i,o,s=[]){let a=0,c=0,u={};for(let f of Fuh(e.attributes,s)){let m=e.attributes[f];if(!QJ(m)){if(!t.has(f)){if(a>=r){c++;continue}a++}Object.defineProperty(u,f,{value:Gin(m,o),enumerable:!0,writable:!0,configurable:!0})}}e.attributes=u,c&&(e.droppedAttributesCount=I5e(e.droppedAttributesCount)+c);let l=0,p=0,d=[];for(let f of e.events){if(l>=n){p++;continue}if(l++,f.attributes){let m=hsl(f.attributes,i,o);f.attributes=m.attributes,m.dropped&&(f.droppedAttributesCount=I5e(f.droppedAttributesCount)+m.dropped)}d.push(f)}e.events=d,p&&(e.droppedEventsCount=I5e(e.droppedEventsCount)+p),e.status?.message&&(e.status={...e.status,message:YXo(kuh(e.status.message),o)})}var Vin=class{setAttribute(){return this}setAttributes(){return this}addEvent(){return this}setStatus(){return this}recordException(){return this}updateName(){return this}traceparent(){return null}tracestate(){return null}end(){}},msl=new Vin,dKt=class extends Vin{constructor(t,r){super(),this._traceparent=t,this._tracestate=r}traceparent(){return this._traceparent}tracestate(){return this._tracestate??null}};function Nuh(e){try{let t=e.stack;return typeof t=="string"&&t?{stack:t}:{}}catch{return{}}}function m1e(e,t){let r=zin(e?.parent)??t,n=typeof r=="string"||r==null?r:fsl(r,"traceparent"),i=csl(n);if(!i)return msl;let o=typeof r=="string"||r==null?e?.tracestate:fsl(r,"tracestate");return new dKt(i,Min(o))}function fsl(e,t){try{let r=e[t];return typeof r=="function"?r.call(e):void 0}catch{return}}function YXo(e,t){return e.length>t?e.slice(0,t):e}function Gin(e,t){return _in(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}function _in(e,t,r,n){if(e===null||typeof e!="object")return QJ(e)||r.remainingNodes<=0?e:(r.remainingNodes--,typeof e=="string"?YXo(e,t):e);if(r.ancestors.has(e))return vin;if(r.remainingNodes<=0||n>=20)return e;r.remainingNodes--,r.ancestors.add(e);try{if(e instanceof Date)return e;let i=juh(e);if(i.selfDescribed)return QJ(i.value)?String(i.value):_in(i.value,t,r,n+1);if(V4(e)){let a=Math.min(e.length,1e3),c=[];for(let u=0;u<a;u++)try{c.push(_in(e[u],t,r,n+1))}catch{c.push(U8)}return e.length>a&&(c.length=e.length),c}let o={},s=0;for(let a of Object.keys(e)){if(s>=1e3)break;let c;try{c=_in(e[a],t,r,n+1)}catch{c=U8}a&&!QJ(c)&&s++,Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}catch{return e}finally{r.ancestors.delete(e)}}function juh(e){try{let t=e.toJSON;if(typeof t=="function")return{selfDescribed:!0,value:t.call(e)}}catch{}return{selfDescribed:!1}}function hsl(e,t,r){let n;try{n=Object.keys(e)}catch{return{attributes:{},dropped:0}}let i={},o=0,s=0;for(let a of n){if(o>=t){s++;continue}let c;try{c=Gin(e[a],r)}catch{c=U8}QJ(c)||(o++,Object.defineProperty(i,a,{value:c,enumerable:!0,writable:!0,configurable:!0}))}return{attributes:i,dropped:s}}function gsl(e,t){for(let r of Object.keys(e))e[r]=Gin(e[r],t);return e}function mKt(e,t,r){return t===msl?r(t):e.with(t,()=>r(t))}function XXo(e){try{let t=Nuh(e);if(f1e(e))return{type:e.name||"Error",message:e.message||"",...t};if(typeof e=="string")return{type:"string",message:e};if(e&&typeof e=="object"){let r=e;if(typeof r.message=="string")return{type:typeof r.name=="string"?r.name:"Object",message:r.message,...t}}return{type:typeof e,message:String(e)}}catch{return{type:typeof e,message:""}}}var ZXo={internal:1,server:2,client:3,producer:4,consumer:5},zuh={ok:1,error:2},Quh=1,Muh=256,Luh=512;function _uh(e){let t=parseInt(e.traceFlags,16);return(Number.isFinite(t)?255&t:Quh)|Muh|(e.parentIsRemote?Luh:0)}function qin(e){if(typeof e=="string")return dne(e);try{return dne(String(e))}catch{return U8}}function Uuh(e){return e&&Object.prototype.hasOwnProperty.call(ZXo,e)?ZXo[e]:ZXo.internal}function $Xo(e){let t=Math.floor(e),r=Math.round((e-t)*1e6);return r>=1e6&&(t+=1,r=0),String(t)+String(r).padStart(6,"0")}function Vuh(e,t){let r={name:qin(e.name),timeUnixNano:$Xo(e.timestamp)};if(e.attributes){let i=hne(e.attributes,t);i.length&&(r.attributes=i)}let n=I5e(e.droppedAttributesCount);return n&&(r.droppedAttributesCount=n),r}function Asl(e,t){let r={traceId:e.traceId,spanId:e.spanId,name:qin(e.name),kind:Uuh(e.kind),startTimeUnixNano:$Xo(e.startTime),endTimeUnixNano:$Xo(e.endTime),flags:_uh(e)};e.parentSpanId&&(r.parentSpanId=e.parentSpanId),e.traceState&&(r.traceState=qin(e.traceState));let n=hne(e.attributes,t);n.length&&(r.attributes=n),e.events.length&&(r.events=e.events.map(s=>Vuh(s,t)));let i=I5e(e.droppedAttributesCount);i&&(r.droppedAttributesCount=i);let o=I5e(e.droppedEventsCount);return o&&(r.droppedEventsCount=o),e.status&&(r.status={code:zuh[e.status.code],...e.status.message&&{message:qin(e.status.message)}}),r}function ysl(e,t,r){return sKt(e,t,r)}function bsl(e,t,r,n,i){return{resourceSpans:[{resource:{attributes:aKt(t,i)},scopeSpans:[{scope:{name:r,version:n},spans:e}]}]}}var Esl=8;function Win(){return Uin()??Date.now()}function eZo(e){try{return e instanceof Bft}catch{return!1}}function Isl(e,t){let r=ssl(e);if(r)return{traceId:r.traceId,parentSpanId:r.spanId,traceState:Min(t),traceFlags:r.flags,isRemote:!0}}function Guh(e){try{return typeof e.traceparent=="function"}catch{return!1}}function quh(e){return!!e.attributes&&typeof e.attributes=="object"&&!Array.isArray(e.attributes)&&Array.isArray(e.events)&&e.name!==void 0&&e.kind!==void 0&&e.startTime!==void 0&&e.endTime!==void 0}function Hin(e,t,r){e[t]!==r&&(e[t]=r)}function Wuh(e,t){try{let r=Object.getOwnPropertyDescriptors(e);for(let n of["traceId","spanId","parentSpanId","traceState"])r[n]={value:t[n],enumerable:!0,writable:!0,configurable:!0};return Object.create(Object.getPrototypeOf(e),r)}catch{return e}}var hKt=class{constructor(t,r,n,i,o,s){this._instance=t,this._config=r,this._logger=n,this._getContext=i,this._contextManager=o,this._onSpanQueued=s,this._queue=[],this._flushTimer=new b5e(()=>this._flushInBackground()),this._flushPromise=null,this._droppedSinceWarning=0,this._lastDropWarningAt=0,this._dropReasons=new Set,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._retryAfter=new A5e,this._headBatchFailures=0,this._headBatchSize=0,this._headBatchChargeableAt=0,this._generation=0,this._liveSpans=new Map,this._maxExportBatchSize=r.maxExportBatchSize}startSpan(t,r){if(this._instance.isDisabled||this._instance.optedOut)return m1e(r,this._contextManager.active());let n=zin(r?.parent);if(n&&typeof n!="string"&&!eZo(n)){if(Guh(n))return this._logger.debug("Span parent is not a span from this SDK; returning an inert span"),m1e(r,this._contextManager.active());this._logger.debug("Ignoring an unusable span parent")}let i=this._resolveParent(n,r);if(this._liveSpans.size>=this._config.maxLiveSpans&&this._evictAgedSpans(),this._liveSpans.size>=this._config.maxLiveSpans)return this._recordDrop(1,`the live-span limit (${this._config.maxLiveSpans}) was reached \u2014 spans are being started and never ended`),m1e(r,this._contextManager.active());let o=Date.now(),s=psl(r?.startTime,o,this._logger),a=rsl();this._liveSpans.set(a,Win());let c=this._autoContextAttributes();return new Bft({traceId:i?.traceId??tsl(),spanId:a,parentSpanId:i?.parentSpanId,traceState:i?.traceState,traceFlags:i?.traceFlags,parentIsRemote:i?.isRemote,name:E5e(t,"Span name",this._config.maxAttributeValueLength,this._logger),kind:r?.kind??"internal",attributes:Vhe({...c},r?.attributes),autoAttributeKeys:Object.keys(c),maxAttributes:this._config.maxAttributesPerSpan,maxEvents:this._config.maxEventsPerSpan,maxAttributesPerEvent:this._config.maxAttributesPerEvent,maxAttributeValueLength:this._config.maxAttributeValueLength,startTime:s,backdated:s!==o,clockAnchor:Pft(r?.startTime)===void 0?i?.clockAnchor:void 0},(u,l)=>this._onSpanEnd(u,l),this._logger)}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this.startSpan(t,i);try{let a=mKt(this._contextManager,s,o);return bol(a)?a.then(c=>(s.end(),c),c=>{throw this._recordCallbackError(s,c),s.end(),c}):(s.end(),a)}catch(a){throw this._recordCallbackError(s,a),s.end(),a}}getActiveSpan(){return this._contextManager.active()??null}get throttled(){return this._retryAfter.isOpen()}async flush(){for(;;)if(!this._queue.length||!await(this._flushPromise??this._startFlush()))return}_startFlush(){this._flushTimer.clear();let t=this._generation,r=Promise.resolve().then(()=>t===this._generation?this._flushInner():0).finally(()=>{this._flushPromise===r&&(this._flushPromise=null),this._armFlushTimerIfQueuedNoEarlierThan()});return this._flushPromise=r,r}reset(){this._flushTimer.clear(),this._queue.length&&this._logger.critical(`Discarding ${this._queue.length} span(s) that were still queued when tracing was shut down. Raise the shutdown timeout or flush earlier if they matter.`),this._queue=[],this._liveSpans.clear(),this._flushPromise=null,this._generation++,this._maxExportBatchSize=this._config.maxExportBatchSize,this._droppedSinceWarning=0,this._dropReasons.clear(),this._lastDropWarningAt=0,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._retryAfter.reset(),this._resetHeadBatchBudget()}_resetHeadBatchBudget(){this._headBatchFailures=0,this._headBatchChargeableAt=0}_resolveParent(t,r){if(typeof t=="string"){let i=Isl(t,r?.tracestate);return i||this._logger.debug("Ignoring malformed traceparent; starting a new trace"),i}if(eZo(t))return t.childContext();let n=this._contextManager.active();if(eZo(n))return n.childContext();if(n instanceof dKt)return Isl(n.traceparent(),n.tracestate()??void 0)}_autoContextAttributes(){let t;try{t=this._getContext()}catch(n){return this._logger.debug("Failed to read tracing context; span will carry no PostHog attributes",n),{}}let r={};return t.distinctId&&(r.posthogDistinctId=t.distinctId),t.sessionId&&(r.sessionId=t.sessionId),t.currentUrl&&(r["url.full"]=t.currentUrl),t.screenName&&(r["screen.name"]=t.screenName),t.appState&&(r["app.state"]=t.appState),r}_recordCallbackError(t,r){if(!(t instanceof Bft))return;let{type:n,message:i,stack:o}=XXo(r);t.addEvent("exception",{"exception.type":n,"exception.message":i,...o&&{"exception.stacktrace":o}}),t.statusIsExplicitlyOk||t.setStatus("error",i)}_evictAgedSpans(){let t=Win()-this._config.maxSpanAgeMs,r=0;for(let[n,i]of this._liveSpans){if(i>t)break;this._liveSpans.delete(n),r++}r&&this._recordDrop(r,`they were still live after ${this._config.maxSpanAgeMs}ms`)}_onSpanEnd(t,r){if(!this._liveSpans.delete(t.spanId))return;if(this._instance.isDisabled||this._instance.optedOut)return void this._recordDrop(1,"the user has opted out");let n=this._runBeforeSpanSend(t,r);if(n){if(this._reportLimitDrops(n),this._queue.length>=this._config.maxQueueSize)return void this._recordDrop(1,`the queue is full (${this._config.maxQueueSize}) \u2014 raise the flush frequency or reduce span volume`);this._queue.push(n);try{this._onSpanQueued?.()}catch(i){this._logger.debug("Span queue notification failed",i)}!(this._queue.length>=this._maxExportBatchSize)||this._consecutiveFlushFailures||this._retryAfter.isOpen()?this._armFlushTimerIfQueued():this._flushInBackground()}}_reportLimitDrops(t){let r=t.droppedAttributesCount??0,n=t.droppedEventsCount??0,i=0;for(let o of t.events)i+=o.droppedAttributesCount??0;(r||n||i)&&this._logger.debug(`Span limits discarded data from "${t.name}": ${r} attributes, ${n} events, ${i} event attributes`)}_runBeforeSpanSend(t,r){if(!this._config.beforeSpanSend.length)return t;let n={traceId:t.traceId,spanId:t.spanId,parentSpanId:t.parentSpanId,traceState:t.traceState},i={startTime:t.startTime,endTime:t.endTime},o={attributes:t.droppedAttributesCount,events:t.droppedEventsCount},s=Object.keys(t.attributes),a={traceFlags:t.traceFlags,parentIsRemote:t.parentIsRemote},c=t.status&&{...t.status},u=t,l=t;try{for(let f of this._config.beforeSpanSend){let m=f(u);if(!m)return this._recordDrop(1,"beforeSpanSend dropped it"),null;u=this._keepSpanIdentity(m,n)}if(l={traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,traceState:n.traceState,name:u.name,kind:u.kind,status:u.status,attributes:u.attributes,events:u.events,startTime:u.startTime,endTime:u.endTime,traceFlags:a.traceFlags,parentIsRemote:a.parentIsRemote,droppedAttributesCount:o.attributes,droppedEventsCount:o.events},!quh(l))return this._logger.debug("beforeSpanSend did not return a span record; dropping the span"),this._recordDrop(1,"beforeSpanSend returned an unusable record"),null;l.name=E5e(l.name,"Span name",this._config.maxAttributeValueLength,this._logger),l.status&&l.status.code!=="ok"&&l.status.code!=="error"&&(this._logger.debug("beforeSpanSend set an unknown span status; keeping the original"),l.status=c),l.startTime=Pft(l.startTime)??i.startTime,l.endTime=Lin(Pft(l.endTime)??i.endTime,l.startTime);let d=[];for(let f of l.events)try{d.push({...f,name:E5e(f.name,"Span event name",this._config.maxAttributeValueLength,this._logger),timestamp:fKt(f.timestamp,l.startTime,"event timestamp",this._logger)})}catch{this._logger.debug("beforeSpanSend left an unreadable span event; dropping it")}return l.events=d,dsl(l,r,this._config.maxAttributesPerSpan,this._config.maxEventsPerSpan,this._config.maxAttributesPerEvent,this._config.maxAttributeValueLength,s),l}catch(p){return this._logger.debug("beforeSpanSend failed; dropping the span rather than exporting it unscrubbed",p),this._recordDrop(1,"beforeSpanSend failed"),null}}_keepSpanIdentity(t,r){(t.traceId!==r.traceId||t.spanId!==r.spanId||t.parentSpanId!==r.parentSpanId)&&this._logger.debug("beforeSpanSend changed a span identity field; keeping the original ids");try{Hin(t,"traceId",r.traceId),Hin(t,"spanId",r.spanId),Hin(t,"parentSpanId",r.parentSpanId),Hin(t,"traceState",r.traceState)}catch{return Wuh(t,r)}return t}_recordDrop(t,r){this._droppedSinceWarning+=t,this._dropReasons.add(r),Date.now()-this._lastDropWarningAt>=this._config.flushIntervalMs&&this._warnAboutDrops()}_warnAboutDrops(){this._droppedSinceWarning&&(this._lastDropWarningAt=Date.now(),this._logger.warn(`Dropping ${this._droppedSinceWarning} span(s): ${[...this._dropReasons].join("; ")}`),this._droppedSinceWarning=0,this._dropReasons.clear())}_encodeBatch(t){let r=[];for(let n of t)try{r.push(Asl(n,this._logger))}catch(i){this._logger.debug("Failed to encode a span; dropping it",i),this._recordDrop(1,"its attributes could not be encoded")}return r}_discardQueueIfConsentWithdrawn(){if(!this._instance.isDisabled&&!this._instance.optedOut)return 0;let t=this._queue.length;return this._queue=[],this._resetHeadBatchBudget(),this._recordDrop(t,"the user has opted out"),this._warnAboutDrops(),t}async _flushInner(){if(!this._queue.length)return 0;let t=this._discardQueueIfConsentWithdrawn();if(t)return t;let r=gsl(ysl(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._config.maxAttributeValueLength),n=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),o=this._queue.length,s=0,a=1/0,c=this._generation;try{for(;o>0&&this._queue.length>0;){let u=this._discardQueueIfConsentWithdrawn();if(u)return s+u;let l=this._headBatchFailures>0?Math.min(this._maxExportBatchSize,this._headBatchSize):this._maxExportBatchSize,p=Math.max(1,Math.min(l,a,o,this._queue.length)),d=this._queue.slice(0,p),f=this._encodeBatch(d);if(!f.length){this._queue.splice(0,p),o-=p,s+=p,this._resetHeadBatchBudget();continue}let m=Win()>=this._headBatchChargeableAt&&!this._retryAfter.isOpen(),g=await this._instance._sendTracesBatch(bsl(f,r,n,i,this._logger));if(c!==this._generation)break;if(this._retryAfter.record(g),g.kind==="ok"){this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget(),this._queue.splice(0,p),o-=p,s+=p,this._maxExportBatchSize<this._config.maxExportBatchSize&&this._maxExportBatchSize++;continue}if(g.kind==="too-large"){if(p===1){this._queue.splice(0,1),o-=1,s+=1,this._recordDrop(1,"it is too large for the ingestion endpoint"),this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget();continue}let A=Math.max(1,Math.floor(p/2));g.measuredLocally?a=A:this._maxExportBatchSize=A,this._resetHeadBatchBudget(),this._logger.debug(`Batch too large; retrying the same spans in batches of ${A}`);continue}if(g.kind==="retry-later"){if(this._consecutiveFlushFailures++,this._flushJitter=cKt(),this._headBatchSize=p,m&&(this._headBatchFailures++,this._headBatchChargeableAt=Win()+this._nextFlushDelay()),this._headBatchFailures<Esl)return this._logger.debug("Span export failed; retrying on the next flush",g.error),s;if(this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget(),this._recordDrop(p,`the ingestion endpoint failed ${Esl} times in a row`),this._retryAfter.isOpen())return s;continue}this._logger.debug("Dropping a span batch the ingestion endpoint rejected",g.error),this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget(),this._recordDrop(p,"the ingestion endpoint rejected the batch")}return s}finally{this._warnAboutDrops()}}_flushInBackground(){this._backgroundFlush||(this._backgroundFlush=this.flush().catch(t=>{this._logger.debug("Background span flush failed",t)}).finally(()=>{this._backgroundFlush=void 0,this._armFlushTimerIfQueuedNoEarlierThan()}))}_armFlushTimerIfQueued(){this._flushTimer.pending||!this._queue.length||this._flushTimer.arm(this._nextFlushDelay())}_armFlushTimerIfQueuedNoEarlierThan(){this._queue.length&&this._flushTimer.armNoEarlierThan(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(uKt(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}};var gKt=class{active(){return this._active}with(t,r){let n=this._active;this._active=t;try{return r()}finally{this._active=n}}};var Huh=5e3,Kuh=512,Juh=2048,Yuh=128,Xuh=128,Zuh=128,$uh=8192,elh=1e4,tlh=36e5;function h1e(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=1?e:t}var vsl=["service.name","service.version","deployment.environment"];function rlh(e){if(!(!e||typeof e!="object"||Array.isArray(e)))try{if(vsl.every(r=>!(r in e)||typeof e[r]=="string"))return e;let t={...e};for(let r of vsl)r in t&&typeof t[r]!="string"&&delete t[r];return t}catch{return}}function nlh(e,t){if(!e)return[];let r=[e].flat().filter(i=>!!i),n=r.filter(i=>typeof i=="function");return n.length!==r.length&&t?.critical(`beforeSpanSend: ignoring ${r.length-n.length} of ${r.length} entries that are not functions. Spans export without them, so whatever they were redacting is not redacted.`),n}function tZo(e,t,r){let n=Vhe({...t},rlh(e?.resourceAttributes)),i=h1e(e?.maxExportBatchSize,Kuh);return{serviceName:n?.["service.name"]??e?.serviceName,serviceVersion:n?.["service.version"]??e?.serviceVersion,environment:n?.["deployment.environment"]??e?.environment,resourceAttributes:n,beforeSpanSend:nlh(e?.beforeSpanSend,r),maxAttributesPerSpan:h1e(e?.maxAttributesPerSpan,Yuh),maxEventsPerSpan:h1e(e?.maxEventsPerSpan,Xuh),maxAttributesPerEvent:Zuh,maxAttributeValueLength:h1e(e?.maxAttributeValueLength,$uh),flushIntervalMs:h1e(e?.flushIntervalMs,Huh),maxExportBatchSize:i,maxQueueSize:Math.max(h1e(e?.maxQueueSize,Juh),i),maxLiveSpans:h1e(e?.maxLiveSpans,elh),maxSpanAgeMs:h1e(e?.maxSpanAgeMs,tlh)}}var rZo=require("fs"),Ssl=require("fs/promises"),iZo=require("path"),wsl=require("readline"),Kin=new nO.ReduceableCache(25),AKt=new nO.ReduceableCache(20),oZo=7,ilh=1e3,olh=1e4,nZo=10485760;async function Tsl(e,t=Ssl.open,r){let n={},i;try{i=process.cwd()}catch{}for(let a=e.length-1;a>=0;a--){let c=e[a],u=c?.filename;if(!c||typeof u!="string"||typeof c.lineno!="number"||llh(u)||plh(c)||!(0,iZo.isAbsolute)(u)&&i===void 0)continue;n[u]||(n[u]=[]),n[u].push(c.lineno)}let o=Object.keys(n);if(o.length==0)return e;let s=[];for(let a of o){let c=Osl(a,i);if(c===void 0||AKt.get(c))continue;let u=n[a];if(!u)continue;u.sort((d,f)=>d-f);let l=dlh(u);if(l.every(d=>flh(c,d)))continue;let p=mlh(Kin,c,{});s.push(alh(a,l,p,c,t,r))}return await Promise.all(s).catch(()=>{}),e&&e.length>0&&clh(e,Kin,i),Kin.reduce(),e}async function slh(e,t,r){let n,i=!1;try{n=await t(e,rZo.constants.O_RDONLY|rZo.constants.O_NONBLOCK);let o=await n.stat();return o.isFile()?o.size>nZo?void r?.debug(`Skipping source context for oversized file ${e}: ${o.size} bytes exceeds ${nZo}`):(i=!0,n):void 0}catch{return}finally{n&&!i&&await n.close().catch(()=>{})}}async function alh(e,t,r,n,i,o){let s=await slh(e,i,o);if(s===void 0)return void AKt.set(n,1);let a=s;return new Promise(c=>{let u=!1;function l(x){u||(u=!0,x?.destroy(),a.close().then(c,c))}let p;try{p=a.createReadStream({autoClose:!1,start:0,end:nZo-1})}catch{AKt.set(n,1),l();return}let d;try{d=(0,wsl.createInterface)({input:p})}catch{AKt.set(n,1),l(p);return}let f=0,m=0,g=t[m];if(g===void 0)return void l(p);let A=g[0],y=g[1];function I(){AKt.set(n,1),d.close(),d.removeAllListeners(),l(p)}p.on("error",I),d.on("error",I),d.on("close",()=>l(p)),d.on("line",x=>{if(f++,!(f<A)&&(r[f]=hlh(x,0),f>=y)){if(m===t.length-1){d.close(),d.removeAllListeners();return}m++;let v=t[m];if(v===void 0){d.close(),d.removeAllListeners();return}A=v[0],y=v[1]}})})}function clh(e,t,r){for(let n of e)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let i=Osl(n.filename,r),o=i===void 0?void 0:t.get(i);if(o===void 0)continue;ulh(n.lineno,n,o)}}function ulh(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=Psl(e);i<e;i++){let o=r[i];if(o===void 0)return void Csl(t);t.pre_context.push(o)}if(r[e]===void 0)return void Csl(t);t.context_line=r[e];let n=Bsl(e);t.post_context=[];for(let i=e+1;i<=n;i++){let o=r[i];if(o===void 0)break;t.post_context.push(o)}}function Csl(e){delete e.pre_context,delete e.context_line,delete e.post_context}function llh(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function plh(e){return e.lineno!==void 0&&e.lineno>olh||e.colno!==void 0&&e.colno>ilh}function Osl(e,t){return(0,iZo.isAbsolute)(e)?JSON.stringify([null,e]):t===void 0?void 0:JSON.stringify([t,e])}function flh(e,t){let r=Kin.get(e);if(r===void 0)return!1;for(let n=t[0];n<=t[1];n++)if(r[n]===void 0)return!1;return!0}function dlh(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=xsl(r),i=[];for(;;){if(t===e.length-1){i.push(n);break}let o=e[t+1];if(typeof o!="number")break;o<=n[1]?n[1]=o+oZo:(i.push(n),n=xsl(o)),t++}return i}function xsl(e){return[Psl(e),Bsl(e)]}function Psl(e){return Math.max(1,e-oZo)}function Bsl(e){return e+oZo}function mlh(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function hlh(e,t){let r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);let i=Math.max(t-60,0);i<5&&(i=0);let o=Math.min(i+140,n);return o>n-5&&(o=n),o===n&&(i=Math.max(o-140,0)),r=r.slice(i,o),i>0&&(r=`...${r}`),o<n&&(r+="..."),r}var Rft=require("path");function Rsl(e=process.cwd()){let t=Rft.sep==="\\",r=i=>t?i.replace(/\\/g,"/"):i,n=r(e);return async i=>{for(let o of i)!o.filename||o.filename.startsWith("node:")||o.filename.startsWith("data:")||(0,Rft.isAbsolute)(o.filename)&&(o.filename=r((0,Rft.relative)(n,r(o.filename))));return i}}var Dsl="5.55.0";var qhe={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};var g1e=class e{constructor(t){this._host=t.host,this._distinctId=t.distinctId,this._groups=t.groups,this._disableGeoip=t.disableGeoip,this._flags=t.flags,this._requestId=t.requestId,this._evaluatedAt=t.evaluatedAt,this._flagDefinitionsLoadedAt=t.flagDefinitionsLoadedAt,this._errorsWhileComputing=t.errorsWhileComputing??!1,this._quotaLimited=t.quotaLimited??!1,this._accessed=t.accessed??new Set,this._isSlice=t.isSlice??!1}isEnabled(t,r={}){let n=this._flags[t];return this._recordAccess(t),n?.enabled??r.defaultValue??!1}getFlag(t){let r=this._flags[t];if(this._recordAccess(t),!!r)return r.enabled?r.variant??!0:!1}getFlagPayload(t){return this._flags[t]?.payload}onlyAccessed(){let t={};for(let r of this._accessed){let n=this._flags[r];n&&(t[r]=n)}return this._cloneWith(t)}only(t){let r={},n=[];for(let i of t){let o=this._flags[i];o?r[i]=o:n.push(i)}return n.length>0&&this._host.logWarning(`FeatureFlagEvaluations.only() was called with flag keys that are not in the evaluation set and will be dropped: ${n.join(", ")}`),this._cloneWith(r)}get keys(){return Object.keys(this._flags)}_getEventProperties(){let t={},r=[];for(let[n,i]of Object.entries(this._flags)){let o=i.enabled===!1?!1:i.variant??!0;t[`$feature/${n}`]=o,i.enabled&&r.push(n)}return r.length>0&&(r.sort(),t.$active_feature_flags=r),t}_cloneWith(t){return new e({host:this._host,distinctId:this._distinctId,groups:this._groups,disableGeoip:this._disableGeoip,flags:t,requestId:this._requestId,evaluatedAt:this._evaluatedAt,flagDefinitionsLoadedAt:this._flagDefinitionsLoadedAt,errorsWhileComputing:this._errorsWhileComputing,quotaLimited:this._quotaLimited,accessed:new Set(this._accessed),isSlice:!0})}_recordAccess(t){if(this._accessed.add(t),this._distinctId===""||this._isSlice&&!(t in this._flags))return;let r=this._flags[t],n=r===void 0?void 0:r.enabled===!1?!1:r.variant??!0,i={$feature_flag:t,$feature_flag_response:n,$feature_flag_id:r?.id,$feature_flag_version:r?.version,$feature_flag_reason:r?.reason,locally_evaluated:r?.locallyEvaluated??!1,[`$feature/${t}`]:n,$feature_flag_request_id:this._requestId,$feature_flag_evaluated_at:r?.locallyEvaluated?Date.now():this._evaluatedAt};r?.hasExperiment!==void 0&&(i.$feature_flag_has_experiment=r.hasExperiment),r?.locallyEvaluated&&this._flagDefinitionsLoadedAt!==void 0&&(i.$feature_flag_definitions_loaded_at=this._flagDefinitionsLoadedAt);let o=[];this._errorsWhileComputing&&o.push(qhe.ERRORS_WHILE_COMPUTING),this._quotaLimited&&o.push(qhe.QUOTA_LIMITED),r===void 0&&o.push(qhe.FLAG_MISSING),o.length>0&&(i.$feature_flag_error=o.join(",")),this._host.captureFlagCalledEventIfNeeded({distinctId:this._distinctId,key:t,response:n,groups:this._groups,disableGeoip:this._disableGeoip,properties:i})}};var glh=6e4;function ksl(e){return e==="client"||e==="server"?e:"all"}function Alh(e,t){return e===t||e==="all"||t==="all"}var Dft=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}};function ylh(e,t){e.name=t.name,Error.captureStackTrace(e,t),Object.setPrototypeOf(e,t.prototype)}var gne=class e extends Error{constructor(t){super(t),ylh(this,e)}},Jin=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:o,customHeaders:s,...a}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollerStopped=!1,this.filteredOutFlagKeys=new Set,this.pollingInterval=t,this.personalApiKey=r,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=i,this.projectApiKey=n,this.host=o,this.poller=void 0,this.fetch=a.fetch||fetch,this.onError=a.onError,this.customHeaders=s,this.onLoad=a.onLoad,this.onMinimalFlagCalledEvents=a.onMinimalFlagCalledEvents,this.cacheProvider=a.cacheProvider,this.strictLocalEvaluation=a.strictLocalEvaluation??!1,this.evaluationContexts=a.evaluationContexts,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}withEvaluationSnapshot(t){return t.definitions?t:{...t,evaluationCache:{},definitions:{featureFlagsByKey:this.featureFlagsByKey,groupTypeMapping:this.groupTypeMapping,cohorts:this.cohorts,filteredOutFlagKeys:this.filteredOutFlagKeys,propertyMatchingVersion:this.propertyMatchingVersion}}}createEvaluationContext(t,r={},n={},i={},o={}){return{distinctId:t,groups:r,personProperties:n,groupProperties:i,evaluationCache:o}}async getFeatureFlag(t,r,n={},i={},o={}){await this.loadFeatureFlags();let s,a;if(!this.loadedSuccessfullyOnce)return s;if(a=this.featureFlagsByKey[t],a!==void 0){let c=this.createEvaluationContext(r,n,i,o);try{s=(await this.computeFlagAndPayloadLocally(a,c)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${s}`))}catch(u){u instanceof gne||u instanceof Zu?this.logMsgIfDebug(()=>console.debug(`${u.name} when computing flag locally: ${t}: ${u.message}`)):u instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${u}`))}}return s}async getAllFlagsAndPayloads(t,r){await this.loadFeatureFlags();let n={},i={},o=this.featureFlags.length==0,s=r?r.map(c=>this.featureFlagsByKey[c]).filter(Boolean):this.featureFlags,a=this.withEvaluationSnapshot({...t,definitions:void 0});return await Promise.all(s.map(async c=>{try{let{value:u,payload:l}=await this.computeFlagAndPayloadLocally(c,a,{skipLoadCheck:!0});n[c.key]=u,l&&(i[c.key]=l)}catch(u){u instanceof gne||u instanceof Zu?this.logMsgIfDebug(()=>console.debug(`${u.name} when computing flag locally: ${c.key}: ${u.message}`)):u instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${c.key}: ${u}`)),o=!0}})),{response:n,payloads:i,fallbackToFlags:o}}async computeFlagAndPayloadLocally(t,r,n={}){let{matchValue:i,skipLoadCheck:o=!1}=n;if(this.loadedSuccessfullyOnce&&(r=this.withEvaluationSnapshot(r)),o||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};r=this.withEvaluationSnapshot(r),t=r.definitions.featureFlagsByKey[t.key]??t;let s;s=i!==void 0?i:await this.computeFlagValueLocally(t,r);let a=LXo(t.filters?.payloads,s);return{value:s,payload:a}}async computeFlagValueLocally(t,r){let{distinctId:n,groups:i,personProperties:o,groupProperties:s}=r;if(!t.active)return!1;if(t.ensure_experience_continuity)throw new Zu("Flag has experience continuity enabled");let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let u=r.definitions.groupTypeMapping[String(c)];if(!u)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Zu("Flag has unknown group type index");if(!(u in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;t.bucketing_identifier==="device_id"&&(o?.$device_id===void 0||o?.$device_id===null||o?.$device_id==="")&&this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Ignoring bucketing_identifier for group flag: ${t.key}`));let l=s[u];return await this.matchFeatureFlagProperties(t,i[u],l,r)}{let u=this.getBucketingValueForFlag(t,n,o);if(u===void 0)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute feature flag: ${t.key} without $device_id, falling back to server evaluation`)),new Zu(`Can't compute feature flag: ${t.key} without $device_id`);return await this.matchFeatureFlagProperties(t,u,o,r)}}getBucketingValueForFlag(t,r,n){if(t.filters?.aggregation_group_type_index!=null)return r;if(t.bucketing_identifier==="device_id"){let i=n?.$device_id;return i==null||i===""?void 0:i}return r}async evaluateFlagDependency(t,r,n){let{evaluationCache:i}=n,o=t.key;if(!n.definitions.featureFlagsByKey)throw new Zu("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new Zu(`Flag dependency property for '${o}' is missing required 'dependency_chain' field`);let s=t.dependency_chain;if(!Array.isArray(s))throw new Zu(`Flag dependency property for '${o}' has an invalid 'dependency_chain' (expected array, got ${typeof s})`);if(s.length===0)throw new Zu(`Circular dependency detected for flag '${o}' (empty dependency chain)`);for(let c of s){if(!(c in i)){let l=n.definitions.featureFlagsByKey[c];if(l)if(l.active)try{let p=await this.computeFlagValueLocally(l,n);i[c]=p}catch(p){throw new Zu(`Error evaluating flag dependency '${c}' for flag '${o}': ${p}`)}else i[c]=!1;else if(n.definitions.filteredOutFlagKeys.has(c))i[c]=!1;else throw new Zu(`Missing flag dependency '${c}' for flag '${o}'`)}if(i[c]==null)throw new Zu(`Dependency '${c}' could not be evaluated`)}let a=i[o];return this.flagEvaluatesToExpectedValue(t.value,a)}flagEvaluatesToExpectedValue(t,r){return typeof t=="boolean"?t===r||typeof r=="string"&&r!==""&&t===!0:typeof t=="string"?r===t:!1}async matchFeatureFlagProperties(t,r,n,i){i=this.withEvaluationSnapshot(i);let o=t.filters||{},s=await QXo(o.holdout,r);if(s!==void 0)return s;let a=o.groups||[],c=o.aggregation_group_type_index,u=o.early_exit??!1,{groups:l,groupProperties:p}=i,d=!1,f;for(let m of a)try{let g=m.aggregation_group_type_index!==void 0?m.aggregation_group_type_index:c,A=n,y=r;if(g!==c&&g!=null){let x=i.definitions.groupTypeMapping[String(g)];if(!x||!(x in l)){this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Skipping group condition for flag '${t.key}': group type index ${g} not available`));continue}if(!(x in p)){d=!0;continue}A=p[x],y=l[x]}let I=await this.isConditionMatch(t,y,m,A,i);if(I==="match"){let x=m.variant,v=o.multivariate?.variants||[];f=x&&v.some(S=>S.key===x)?x:await this.getMatchingVariant(t,y)||!0;break}if(u&&I==="out_of_rollout_bound"){if(d)break;return!1}}catch(g){if(g instanceof gne)throw g;if(g instanceof Zu)d=!0;else throw g}if(f!==void 0)return f;if(d)throw new Zu("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i,o){o=this.withEvaluationSnapshot(o);let s=o.definitions,a=n.rollout_percentage,c=u=>{this.logMsgIfDebug(()=>console.warn(u))};if((n.properties||[]).length>0){for(let u of n.properties){let l=u.type,p=!1;if(l==="cohort"){let d=await Nsl(u,i,s.cohorts,this.debugMode,f=>this.evaluateFlagDependency(f,i,o),s.propertyMatchingVersion);p=u.operator==="not_in"?!d:d}else p=l==="flag"?await this.evaluateFlagDependency(u,i,o):Fsl(u,i,c,s.propertyMatchingVersion);if(!p)return"no_match"}if(a==null)return"match"}return a!=null&&await iKt(t.key,r)>a/100?"out_of_rollout_bound":"match"}async getMatchingVariant(t,r){return MXo(t.key,r,t.filters?.multivariate?.variants||[])}variantLookupTable(t){return Fin(t.filters?.multivariate?.variants||[])}filterFlagsByEvaluationContexts(t){if(!this.evaluationContexts||this.evaluationContexts.length===0)return t;let r=new Set(this.evaluationContexts);return t.filter(n=>{let i=n.evaluation_contexts??n.evaluation_tags;return!i||i.length===0?!0:i.some(o=>r.has(o))})}getEvaluationRuntimeForFlag(t){let r=this.featureFlagsByKey[t];return r?ksl(r.evaluation_runtime):void 0}getFlagKeysByEvaluationRuntime(t){return this.featureFlags.filter(r=>Alh(ksl(r.evaluation_runtime),t)).map(r=>r.key)}updateFlagState(t){let r=this.filterFlagsByEvaluationContexts(t.flags);this.featureFlags=r,this.featureFlagsByKey=r.reduce((i,o)=>(i[o.key]=o,i),{});let n=new Set(r.map(i=>i.key));this.filteredOutFlagKeys=new Set(t.flags.filter(i=>!n.has(i.key)).map(i=>i.key)),this.groupTypeMapping=t.group_type_mapping??t.groupTypeMapping??{},this.cohorts=t.cohorts,this.propertyMatchingVersion=t.property_matching_version??t.propertyMatchingVersion,this.loadedSuccessfullyOnce=!0,this.onMinimalFlagCalledEvents?.((t.minimal_flag_called_events??t.minimalFlagCalledEvents)===!0)}warnAboutExperienceContinuityFlags(t){if(this.strictLocalEvaluation)return;let r=t.filter(n=>n.ensure_experience_continuity);r.length>0&&console.warn(`[PostHog] You are using local evaluation but ${r.length} flag(s) have experience continuity enabled: ${r.map(n=>n.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`)}async loadFromCache(t){if(!this.cacheProvider)return!1;try{let r=await this.cacheProvider.getFlagDefinitions();return r?(this.updateFlagState(r),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${t} (${r.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags),!0):!1}catch(r){return this.onError?.(new Error(`Failed to load from cache: ${r}`)),!1}}async loadFeatureFlags(t=!1){if(!(this.loadedSuccessfullyOnce&&!t))return!t&&this.nextFetchAllowedAt&&Date.now()<this.nextFetchAllowedAt?void this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period")):(this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(r=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${r}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise)}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getFlagDefinitionsLoadedAt(){return this.flagDefinitionsLoadedAt}getPollingInterval(){let t=this.pollingInterval??3e4;return this.shouldBeginExponentialBackoff?Math.min(glh,t*2**this.backOffCount):t}beginBackoff(){this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,this.nextFetchAllowedAt=Date.now()+this.getPollingInterval()}clearBackoff(){this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.nextFetchAllowedAt=void 0}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);try{let t=!0;if(this.cacheProvider)try{t=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(n){this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${n}`))}if(!t&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let r=await this._requestFeatureFlagDefinitions();if(!r)return;switch(r.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=r.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.clearBackoff();return;case 401:throw this.beginBackoff(),new Dft(`Your project key or secret key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.filteredOutFlagKeys=new Set,this.groupTypeMapping={},this.cohorts={},this.propertyMatchingVersion=void 0,this.onMinimalFlagCalledEvents?.(!1);return;case 403:throw this.beginBackoff(),new Dft(`Your secret key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct secret and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new Dft(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let n=await r.json()??{};if(!("flags"in n))return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(n)}`));this.flagsEtag=r.headers?.get("ETag")??void 0;let i=n.group_type_mapping||{},o=n.minimal_flag_called_events===!0,s={flags:n.flags??[],group_type_mapping:i,cohorts:n.cohorts||{},minimal_flag_called_events:o,property_matching_version:n.property_matching_version,propertyMatchingVersion:n.property_matching_version,groupTypeMapping:i,minimalFlagCalledEvents:o};if(this.updateFlagState(s),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(s)}catch(a){this.onError?.(new Error(`Failed to store in cache: ${a}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags);break}default:return}}catch(t){t instanceof Dft&&this.onError?.(t)}finally{!this.pollerStopped&&this.pollingInterval!==null&&(this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval()))}}getPersonalApiKeyRequestOptions(t="GET",r){let n={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return r&&(n["If-None-Match"]=r),{method:t,headers:n}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/flags/definitions?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),n=null;if(this.timeout&&typeof this.timeout=="number"){let o=new AbortController;n=zN(()=>{o.abort()},this.timeout),r.signal=o.signal}let i=()=>clearTimeout(n);try{let o=this.fetch,s=await o(t,r);return s.status!==200?(i(),s):{status:s.status,headers:s.headers,body:s.body,text:async()=>{try{return await s.text()}finally{i()}},json:async()=>{try{return await s.json()}finally{i()}}}}catch(o){throw i(),o}}async stopPoller(t=3e4){if(this.pollerStopped=!0,clearTimeout(this.poller),this.poller=void 0,this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await d1e(r,t,()=>{throw new Error(`Cache shutdown timeout after ${t}ms`)})}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};function Fsl(e,t,r,n){return zXo(e,t,{warnFunction:r,propertyMatchingVersion:n})}function blh(e,t){if(!(e in t))throw new gne(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}async function Nsl(e,t,r,n=!1,i,o){let s=String(e.value);blh(s,r);let a=r[s];return jsl(a,t,r,n,i,o)}async function jsl(e,t,r,n=!1,i,o){if(!e)return!0;let s=e.type,a=e.values;if(!a||a.length===0)return!0;let c=!1;if("values"in a[0]){for(let u of a)try{let l=await jsl(u,t,r,n,i,o);if(s==="AND"){if(!l)return!1}else if(l)return!0}catch(l){if(l instanceof gne)throw l;if(l instanceof Zu)n&&console.debug(`Failed to compute property ${u} locally: ${l}`),c=!0;else throw l}if(c)throw new Zu("Can't match cohort without a given cohort property value");return s==="AND"}for(let u of a)try{let l;if(u.type==="cohort")l=await Nsl(u,t,r,n,i,o);else if(u.type==="flag"){if(!i)throw new Zu(`Flag dependency '${u.key||"unknown"}' cannot be evaluated without a flag dependency evaluator`);l=await i(u)}else l=Fsl(u,t,void 0,o);let p=u.negation||!1;if(s==="AND"){if(!l&&!p||l&&p)return!1}else if(l&&!p||!l&&p)return!0}catch(l){if(l instanceof gne)throw l;if(l instanceof Zu)n&&console.debug(`Failed to compute property ${u} locally: ${l}`),c=!0;else throw l}if(c)throw new Zu("can't match cohort without a given cohort property value");return s==="AND"}var Elh=["--unhandled-rejections","--unhandled_rejections"],Ilh=new Set(["throw","strict","warn","warn-with-error-code","none"]),vlh=[...globalThis.process?.execArgv??[]],Clh=globalThis.process?.env?.NODE_OPTIONS;function xlh(e){let t=[],r="",n=!1;for(let i=0;i<e.length;i++){let o=e[i];o==="\\"&&n&&i+1<e.length?r+=e[++i]:o!==" "||n?o==='"'?n=!n:r+=o:r&&(t.push(r),r="")}return r&&t.push(r),t}function zsl(e){let t;for(let r=0;r<e.length;r++){let n=e[r],i=Elh.find(s=>n===s||n.startsWith(`${s}=`));if(!i)continue;let o=n===i?e[++r]:n.slice(i.length+1);Ilh.has(o)&&(t=o)}return t}function Slh(e=vlh,t=Clh){return zsl(e)??zsl(xlh(t??""))??"throw"}var Qsl=Slh();function Msl(e,t,r){e(t,{mechanism:{type:r==="unhandledRejection"?"onunhandledrejection":"onuncaughtexception",handled:!1}})}function wlh(e,t){let r=!1;return Object.assign((n,i)=>{let o=global.process.listeners("uncaughtException").filter(s=>s.name!=="domainUncaughtExceptionClear"&&s._posthogErrorHandler!==!0).length;Msl(e,n,i),!r&&o===0&&(r=!0,t(n))},{_posthogErrorHandler:!0})}function Lsl(e,t,r=Qsl){let n=globalThis.process;if(n){if(r==="strict")return void n.on("uncaughtExceptionMonitor",(i,o)=>Msl(e,i,o));n.on("uncaughtException",wlh(e,t))}}function _sl(e,t=Qsl){let r=globalThis.process;!r||t==="throw"||t==="strict"||t==="warn-with-error-code"||r.on("unhandledRejection",n=>{e(n,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var Tlh=2e3,sZo=class e{constructor(t,r,n){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=n,this._rateLimiter=new min({...Zil(r),refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(t){return UHt(t)&&"__posthog_previously_captured_error"in t&&t.__posthog_previously_captured_error===!0}static async buildEventMessage(t,r,n,i,o){let s={...o},a=t.buildFromUnknown(r,n);a.$exception_list=await t.modifyFrames(a.$exception_list);let c=nO.getInjectedReleaseId();return c&&(s.$release_id=c),{event:"$exception",distinctId:i,properties:{...a,...s},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){this.isEnabled()&&(Lsl(this.onException.bind(this),this.onFatalError.bind(this)),_sl(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{if(!e.isPreviouslyCapturedError(t)){let n=await e.buildEventMessage(this.client.getErrorPropertiesBuilder(),t,r),o=n.properties?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(o)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:o}):this.client._capturePreparedEvent(n,!1)}})())}async onFatalError(t){console.error(t),await this.client.shutdown(Tlh),globalThis.process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}},v5e=sZo;var Yin=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};function Olh(e){return e==="v0"||e==="v1"}function Usl(){let e="u">typeof process?process.env?.POSTHOG_CAPTURE_MODE:void 0;return Olh(e)?e:"v0"}var Plh="$ai_",yKt="analytics";function Vsl(e){return typeof e.event=="string"&&e.event.startsWith(Plh)}var kft=class e extends Error{constructor({requestId:t,drops:r,retryExhausted:n,cause:i}){super(e.buildMessage(t,r,n,i)),this.name="CaptureV1Error",this.requestId=t,this.drops=r,this.retryExhausted=n,this.cause=i}static buildMessage(t,r,n,i){let o=`Capture V1 batch ${t} did not fully deliver: ${r.length} dropped, ${n.length} undelivered`;return i instanceof Error&&(o+=` (${i.message})`),o}};function aZo(e){if(typeof e=="boolean")return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1}}function Blh(e){return typeof e=="string"?e:void 0}var Rlh=[{property:"$cookieless_mode",optionKey:"cookieless_mode",coerce:aZo},{property:"$ignore_sent_at",optionKey:"disable_skew_correction",coerce:aZo},{property:"$process_person_profile",optionKey:"process_person_profile",coerce:aZo},{property:"$product_tour_id",optionKey:"product_tour_id",coerce:Blh}],Dlh=[{property:"$session_id",field:"session_id"},{property:"$window_id",field:"window_id"}];function klh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Flh(e){if(typeof e=="string"){let r=new Date(e);if(Number.isNaN(r.getTime()))return new Date().toISOString();let n=r.toISOString(),i=e.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}if(e instanceof Date)return Number.isNaN(e.getTime())?new Date().toISOString():e.toISOString();let t=e==null?new Date:new Date(e);return Number.isNaN(t.getTime())?new Date().toISOString():t.toISOString()}function Gsl(e,t,r){r!==void 0&&!(t in e)&&(e[t]=r)}function Nlh(e){let r={...klh(e.properties)?e.properties:{}},n={};for(let{property:o,optionKey:s,coerce:a}of Rlh)if(o in r){let c=a(r[o]);c!==void 0&&(n[s]=c),delete r[o]}let i={};for(let{property:o,field:s}of Dlh)if(o in r){let a=r[o];typeof a=="string"&&(i[s]=a),delete r[o]}return delete r.$lib,delete r.$lib_version,Gsl(r,"$set",e.$set),Gsl(r,"$set_once",e.$set_once),{event:String(e.event??""),uuid:String(e.uuid??""),distinct_id:String(e.distinct_id??""),timestamp:Flh(e.timestamp),...i,options:n,properties:r}}function qsl(e,{createdAt:t,historicalMigration:r}){let n={created_at:t,batch:e.map(Nlh)};return r&&(n.historical_migration=!0),n}var jlh="/i/v1/analytics/events",zlh=3e4,Qlh=new Set([408,500,502,503,504]),Xin=class{constructor(t,r){this.config=t,this.maxBackoffMs=t.maxBackoffMs??zlh,this.fetchFn=r.fetch,this.onError=r.onError,this.now=r.now??Date.now,this.sleep=r.sleep??(n=>new Promise(i=>zN(i,n))),this.generateRequestId=r.generateRequestId??jN,this.compress=r.compress??tKt}async sendV1Batch(t){if(t.length===0)return;let r=this.generateRequestId(),n=new Date(this.now()).toISOString(),{batch:i}=qsl(t,{createdAt:n,historicalMigration:this.config.historicalMigration}),o=`${this.config.host}${jlh}`,s=[],a=i,c=Math.max(1,this.config.maxAttempts);for(let u=1;u<=c;u++){let l=u===c,p=p1e({created_at:n,...this.config.historicalMigration?{historical_migration:!0}:{},batch:a}),d,f;try{d=await this.sendOnce(o,p,u,r);let{response:m,signal:g}=d,{status:A}=m;if(A<200||A>=300)if(!l&&Qlh.has(A)){let y=this.parseRetryAfter(m);await d.waitFor(d.cancelBody()).catch(()=>{}),f=this.backoffDelay(u,y)}else{let y=await this.buildHttpError(m,A,d.waitFor);return this.surfaceBatchFailure(r,s,a,y)}else{let y;try{y=await d.waitFor(this.parseResponse(m))}catch(v){if(g.aborted)throw v;return this.surfaceBatchFailure(r,s,a,new Error(`Capture V1 returned an unparseable ${A} response body`))}let I=this.classify(a,y,s);if(I.length===0)return this.surfacePartialDrops(r,s);if(l)return void this.onError(new kft({requestId:r,drops:s,retryExhausted:I.map(v=>v.uuid)}));a=I;let x=this.parseRetryAfter(m);f=this.backoffDelay(u,x)}}catch(m){if(d&&!d.signal.aborted)throw m;if(l)return this.surfaceBatchFailure(r,s,a,m);f=this.backoffDelay(u)}finally{d?.cleanup()}f!==void 0&&await this.sleep(f)}}async sendOnce(t,r,n,i){let o=this.buildHeaders(n,i),s=r;if(this.config.compressionEnabled){let p=await this.compress(r,this.config.isDebug);p!==null&&(s=p,o["Content-Encoding"]="gzip")}let a=new AbortController,c="waiting for response headers",u,l=new Promise((p,d)=>{u=zN(()=>{let f=new Error(`Capture V1 request timed out ${c} after ${this.config.requestTimeoutMs}ms`);f.name="AbortError",d(f),a.abort(f)},this.config.requestTimeoutMs)});try{let p=this.fetchFn(t,{method:"POST",headers:o,body:s,signal:a.signal}),d=!1;p.then(y=>{a.signal.aborted&&!d&&this.cancelBody(y)}).catch(()=>{});let f=await Promise.race([p,l]);d=!0,c="while reading the response body";let m=!1,g,A=()=>g??=this.cancelBody(f);return{response:f,signal:a.signal,waitFor:y=>Promise.race([y,l]),cancelBody:A,cleanup:()=>{m||(m=!0,clearTimeout(u),a.signal.aborted&&A())}}}catch(p){throw clearTimeout(u),p}}buildHeaders(t,r){let n=`${this.config.libraryId}/${this.config.libraryVersion}`,i={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`,"PostHog-Sdk-Info":n,"PostHog-Attempt":String(t),"PostHog-Request-Id":r,"PostHog-Request-Timestamp":new Date(this.now()).toISOString()};return this.config.userAgent&&(i["User-Agent"]=this.config.userAgent),i}classify(t,r,n){let i=r.results??{},o=[];for(let s of t){let a=i[s.uuid];a&&(a.result==="drop"?n.push({uuid:s.uuid,details:a.details??void 0}):a.result==="retry"&&o.push(s))}return o}backoffDelay(t,r){let n=Math.min(this.config.initialRetryDelayMs*2**(t-1),this.maxBackoffMs);return r===void 0?n:Math.max(n,Math.min(r,this.maxBackoffMs))}parseRetryAfter(t){let r=t.headers?.get("Retry-After");if(!r)return;let n=r.trim();if(/^\d+$/.test(n)){let s=parseInt(n,10);return Number.isFinite(s)&&s>0?1e3*s:void 0}let i=Date.parse(n);if(Number.isNaN(i))return;let o=i-this.now();return o>0?o:void 0}async parseResponse(t){let r=await t.text(),n=JSON.parse(r);if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("unexpected response shape");let i=n.results;if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new Error("unexpected results shape");return{results:i??{}}}async buildHttpError(t,r,n){let i="";try{i=(await n(t.text())).slice(0,512)}catch{}let o=i?`: ${i}`:"";return new Error(`Capture V1 request failed with HTTP ${r}${o}`)}surfaceBatchFailure(t,r,n,i){this.onError(new kft({requestId:t,drops:r,retryExhausted:n.map(o=>o.uuid),cause:i}))}surfacePartialDrops(t,r){r.length>0&&this.onError(new kft({requestId:t,drops:r,retryExhausted:[]}))}async cancelBody(t){try{await t.body?.cancel()}catch{}}};var C5e="ai-capture",Zin="/i/v0/ai/batch/";var Llh=new TextEncoder;function uZo(e){return Llh.encode(p1e(e)).length}function Wsl(e,t=8388608,r=5242880){let n=[],i=[],o=[],s=0;for(let a of e){if(a===void 0)continue;let c=uZo(a);if(c>t){i.push({event:typeof a.event=="string"?a.event:"unknown",bytes:c});continue}o.length>0&&s+c>r&&(n.push(o),o=[],s=0),o.push(a),s+=c}return o.length>0&&n.push(o),{batches:n,dropped:i}}var _lh=100,Hsl=3e4,Ulh=5e4,Vlh=50,Glh=500,qlh="https://us.i.posthog.com",Ksl=new Set;function eon(e,t){Ksl.has(e)||(Ksl.add(e),console.warn(`[PostHog] ${t}`))}function Wlh(e){return typeof e=="string"?e.trim():""}function Hlh(e){return(typeof e=="string"?e.trim():"")||void 0}function Klh(e){return(typeof e=="string"?e.trim():"")||qlh}function Jlh(e){return(Array.isArray(e)?e:[e]).filter(r=>typeof r=="string"&&r.trim().length>0)}function Ylh(e){if(!e)return{};let t={};for(let[n,i]of Object.entries(e))t[`$feature/${n}`]=i;let r=Object.keys(e).filter(n=>e[n]!==!1).sort();return r.length>0&&(t.$active_feature_flags=r),t}var ton=class extends rKt{constructor(t,r={}){let n=Wlh(t),i={...r,maxQueueSize:r.maxQueueSize??1e4,flushInterval:r.flushInterval??5e3,host:Klh(r.host),personalApiKey:Hlh(r.secretKey??r.personalApiKey)};if(super(n,i),this._memoryStorage=new Yin,this._aiCaptureRouteActive=!1,this._minimalFlagCalledEvents=!1,this.options=i,this.captureMode=Usl(),this.enableFullAiCapture=i.enableFullAiCapture===!0,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof i.featureFlagsPollingInterval=="number"?Math.max(i.featureFlagsPollingInterval,_lh):i.featureFlagsPollingInterval===null?null:Hsl,typeof i.waitUntilDebounceMs=="number"&&(this.options.waitUntilDebounceMs=Math.max(i.waitUntilDebounceMs,0)),typeof i.waitUntilMaxWaitMs=="number"&&(this.options.waitUntilMaxWaitMs=Math.max(i.waitUntilMaxWaitMs,0)),!this.disabled&&i.personalApiKey){if(i.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');i.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new Jin({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:i.personalApiKey,projectApiKey:n,timeout:i.requestTimeout??1e4,host:this.host,fetch:i.fetch,onError:s=>{this._events.emit("error",s)},onLoad:s=>{this._events.emit("localEvaluationFlagsLoaded",s)},onMinimalFlagCalledEvents:s=>{this._minimalFlagCalledEvents=s},customHeaders:this.getCustomHeaders(),cacheProvider:i.flagDefinitionCacheProvider,strictLocalEvaluation:i.strictLocalEvaluation,evaluationContexts:i.evaluationContexts??i.evaluationEnvironments}))}this.errorTracking=new v5e(this,i,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=i.maxCacheSize||Ulh}enqueue(t,r,n,i){super.enqueue(t,r,n,i),this.scheduleDebouncedFlush()}_flushEventsAndSpans(t=!1){let r=this.flushWithPendingPromises();return!this._traces||t&&this._traces.throttled?r:qHt([r,this._traces.flush().catch(()=>{})]).then(([n])=>{if(n.status==="rejected")throw n.reason})}flushAutomatic(){return this._flushKeepingRuntimeAlive(!0)}async flush(){return this._flushKeepingRuntimeAlive(!1)}_flushKeepingRuntimeAlive(t){let r=this._flushEventsAndSpans(t),n=this.options.waitUntil;if(n&&!this._waitUntilCycle)try{n(r.catch(()=>{}))}catch{}return r}scheduleDebouncedFlush(){let t=this.options.waitUntil;if(!t||this.disabled||this.optedOut)return;if(!this._waitUntilCycle){let s,a=new Promise(c=>{s=c});try{t(a)}catch{return}this._waitUntilCycle={resolve:s,startedAt:Date.now(),timer:void 0}}let r=Date.now()-this._waitUntilCycle.startedAt,n=this.options.waitUntilMaxWaitMs??Glh,i=r>=n;if(this._waitUntilCycle.timer!==void 0&&clearTimeout(this._waitUntilCycle.timer),i)return void this.resolveWaitUntilFlush();let o=this.options.waitUntilDebounceMs??Vlh;this._waitUntilCycle.timer=zN(()=>{this.resolveWaitUntilFlush()},o)}_consumeWaitUntilCycle(){let t=this._waitUntilCycle;return t&&(clearTimeout(t.timer),this._waitUntilCycle=void 0),t?.resolve}async resolveWaitUntilFlush(){let t=this._consumeWaitUntilCycle();try{await this._flushEventsAndSpans()}catch{}finally{t?.()}}getPersistedProperty(t){return this._memoryStorage.getProperty(t)}setPersistedProperty(t,r){return this._memoryStorage.setProperty(t,r)}fetch(t,r){return this.options.fetch?this.options.fetch(t,r):fetch(t,r)}getQueueRouteKey(t){return this.captureMode==="v1"&&Vsl(t)?"ai":yKt}persistedQueueKeyForRoute(t){return t===C5e?OM.AiCaptureQueue:t==="ai"?OM.AiQueue:OM.Queue}getActiveQueueRoutes(){let t=this.captureMode==="v1"?[yKt,"ai"]:[yKt];return this._aiCaptureRouteActive&&t.push(C5e),t}getBatchEndpointPath(t){return t===C5e?Zin:super.getBatchEndpointPath(t)}async sendBatch(t,r,n=yKt){if(n===C5e)return this.sendAiCaptureBatch(t,r);if(this.captureMode!=="v1"||n==="ai")return super.sendBatch(t,r,n);let i=t.filter(o=>o!==void 0);await this.getV1Sender().sendV1Batch(i)}async sendAiCaptureBatch(t,r){let{batches:n,dropped:i}=Wsl(t);for(let{event:o,bytes:s}of i){let a=`Event ${o} (${s} bytes) exceeds the ${8388608/1048576}MiB limit for ${Zin}, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a))}for(let o of n)await this.sendAiSubBatch(o,r)}async sendAiSubBatch(t,r){try{await super.sendBatch(t,r,C5e)}catch(n){if(!Oft(n))throw n;if(t.length===1){let[o]=t,a=`Event ${typeof o.event=="string"?o.event:"unknown"} (${uZo(o)} bytes) was rejected with 413 by ${Zin} on its own, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a));return}let i=Math.ceil(t.length/2);await this.sendAiSubBatch(t.slice(0,i),r),await this.sendAiSubBatch(t.slice(i),r)}}getV1Sender(){return this._v1Sender||(this._v1Sender=new Xin({host:this.host,apiKey:this.apiKey,libraryId:this.getLibraryId(),libraryVersion:this.getLibraryVersion(),userAgent:this.getCustomUserAgent()||void 0,historicalMigration:this.historicalMigration,compressionEnabled:!this.disableCompression,requestTimeoutMs:this.requestTimeout,maxAttempts:(this.options.fetchRetryCount??3)+1,initialRetryDelayMs:this.options.fetchRetryDelay??3e3,isDebug:this.isDebug},{fetch:(t,r)=>this.fetch(t,r),onError:t=>this._events.emit("error",t),compress:t=>this.compressPayload(t)})),this._v1Sender}getLibraryVersion(){return Dsl}get metrics(){return this._metrics||(this._metrics=new pKt(this,jin(this.options.metrics),this._logger)),this._metrics}initializeSpanContextManager(){return new gKt}hostResourceAttributes(){return{}}get _spanContextManager(){return this._spanContext||(this._spanContext=this.initializeSpanContextManager()),this._spanContext}get _tracesPipeline(){if(this.options.traces)return this._traces||(this._traces=new hKt(this,tZo(this.options.traces,this.hostResourceAttributes(),this._logger),this._logger,()=>this._tracingContext(),this._spanContextManager,()=>this.scheduleDebouncedFlush())),this._traces}_tracingContext(){let t=this.context?.get();return{distinctId:t?.distinctId,sessionId:t?.sessionId}}startSpan(t,r){return this._tracesPipeline?.startSpan(t,r)??m1e(r,this._spanContextManager.active())}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this._tracesPipeline;return s?i?s.withSpan(t,i,o):s.withSpan(t,o):mKt(this._spanContextManager,m1e(i,this._spanContextManager.active()),o)}getActiveSpan(){return this._spanContextManager.active()??null}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}getEvaluationRuntime(){return"server"}getCommonEventProperties(){let t=super.getCommonEventProperties();return(this.options.isServer??!0)&&(t.$is_server=!0),t}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}_warnIfInvalidCapture(t,r,n){typeof t=="string"&&this._logger.warn(r),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn(n)}_sendPreparedEvent(t,r,n,i,o){return this.addPendingPromise(this._prepareEventMessage(r,i).then(({distinctId:s,event:a,properties:c,options:u})=>{let l={timestamp:u.timestamp,disableGeoip:u.disableGeoip,uuid:u.uuid},p={distinctId:s,event:a,properties:{...c,...this.getCommonEventProperties()}};return n?this.sendImmediate(t,p,l,o):this.enqueue(t,p,l,o)}).catch(s=>{s&&console.error(s)}))}_capturePreparedEvent(t,r){return this._sendPreparedEvent("capture",t,r)}capture(t){this._warnIfInvalidCapture(t,"Called capture() with a string as the first argument when an object was expected.","Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this._capturePreparedEvent(t,!1)}async captureImmediate(t){return this._warnIfInvalidCapture(t,"Called captureImmediate() with a string as the first argument when an object was expected.","Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default."),this._capturePreparedEvent(t,!0)}captureAi(t){if(this.disabled)return;let r=y5e(t.uuid,jN);return this._sendPreparedAiEvent({...t,uuid:r},!1),r}async captureAiImmediate(t){if(this.disabled)return;let r=y5e(t.uuid,jN);return await this._sendPreparedAiEvent({...t,uuid:r},!0),r}_sendPreparedAiEvent(t,r){return typeof t?.event=="string"&&!t.event.startsWith("$ai_")&&this._logger.debug(`captureAi called with non-AI event ${t.event}; routing it to the AI endpoint anyway.`),this._aiCaptureRouteActive=!0,this._sendPreparedEvent("capture",t,r,void 0,C5e)}identify({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,l={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:l,disableGeoip:n},!1,{includeContextProperties:!1})}async identifyImmediate({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,l={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};await this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:l,disableGeoip:n},!0,{includeContextProperties:!1})}setPersonProperties({distinctId:t,properties:r={},propertiesOnce:n={}}){if(Object.keys(r).length===0&&Object.keys(n).length===0)return;let i={};Object.keys(r).length>0&&(i.$set=r),Object.keys(n).length>0&&(i.$set_once=n),this.capture({distinctId:t,event:"$set",properties:i})}unsetPersonProperties({distinctId:t,properties:r}){let n=Jlh(r);n.length!==0&&this.capture({distinctId:t,event:"$set",properties:{$unset:n}})}alias(t){this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!1,{includeContextProperties:!1})}async aliasImmediate(t){await this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!0,{includeContextProperties:!1})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}getFeatureFlagEvaluationRuntime(t){return this.featureFlagsPoller?.getEvaluationRuntimeForFlag(t)}getFeatureFlagKeysByEvaluationRuntime(t){return this.featureFlagsPoller?.getFlagKeysByEvaluationRuntime(t)??[]}async waitForLocalEvaluationReady(t=Hsl){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let n=setTimeout(()=>{i(),r(!1)},t),i=this._events.on("localEvaluationFlagsLoaded",o=>{clearTimeout(n),i(),r(o>0)})})}_resolveDistinctId(t,r){return typeof t=="string"?{distinctId:t,options:r}:{distinctId:this.context?.get()?.distinctId,options:t}}async _getFeatureFlagResult(t,r,n={},i){if(this.disabled)return void this._logger.warn("The client is disabled");let o=n.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&t in this._flagOverrides){let R=this._flagOverrides[t];if(R===void 0)return;let D=this._payloadOverrides?.[t];return{key:t,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:D}}let{groups:s,disableGeoip:a}=n,{onlyEvaluateLocally:c,personProperties:u,groupProperties:l}=n,p=this.addLocalPersonAndGroupProperties(r,s,u,l);u=p.allPersonProperties,l=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(r,s,this.personPropertiesForLocalEvaluation(r,u),l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f,m=!1,g,A,y,I,x,v,S;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let R=this.featureFlagsPoller?.featureFlagsByKey[t];if(R)try{let D=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(R,d,{matchValue:i});if(D){m=!0;let O=D.value;I=R.id,v="Evaluated locally",S=R.has_experiment,f={key:t,enabled:O!==!1,variant:typeof O=="string"?O:void 0,payload:D.payload??void 0,reason:v,reasonCode:R.active===!1?"flag_disabled":void 0}}}catch(D){if(D instanceof gne||D instanceof Zu)this._logger?.info(`${D.name} when computing flag locally: ${t}: ${D.message}`);else throw D}}if(!m&&!c){let R=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,u,l,a,[t]);if(R===void 0)y=qhe.UNKNOWN_ERROR;else{this._minimalFlagCalledEvents=R.minimalFlagCalledEvents===!0,g=R.requestId,A=R.evaluatedAt;let D=[];R.errorsWhileComputingFlags&&D.push(qhe.ERRORS_WHILE_COMPUTING),R.quotaLimited?.includes("feature_flags")&&D.push(qhe.QUOTA_LIMITED);let O=R.flags[t];if(O===void 0)D.push(qhe.FLAG_MISSING);else{I=O.metadata?.id,x=O.metadata?.version,v=O.reason?.description??O.reason?.code,S=O.metadata?.has_experiment;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}f={key:t,enabled:O.enabled,variant:O.variant??void 0,payload:z,reason:v,reasonCode:O.reason?.code}}D.length>0&&(y=D.join(","))}}if(o){let R=f===void 0?void 0:f.enabled===!1?!1:f.variant??!0,D={$feature_flag:t,$feature_flag_response:R,$feature_flag_id:I,$feature_flag_version:x,$feature_flag_reason:v,locally_evaluated:m,[`$feature/${t}`]:R,$feature_flag_request_id:g,$feature_flag_evaluated_at:m?Date.now():A};if(S!==void 0&&(D.$feature_flag_has_experiment=S),m&&this.featureFlagsPoller){let O=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();O!==void 0&&(D.$feature_flag_definitions_loaded_at=O)}y&&(D.$feature_flag_error=y),this._captureFlagCalledEventIfNeeded({distinctId:r,key:t,response:R,groups:s,disableGeoip:a,properties:D})}return f!==void 0&&this._payloadOverrides!==void 0&&t in this._payloadOverrides&&(f={...f,payload:this._payloadOverrides[t]}),f}async getFeatureFlag(t,r,n){eon("getFeatureFlag","`getFeatureFlag` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlag(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});if(i!==void 0)return i.enabled===!1?!1:i.variant??!0}async getFeatureFlagPayload(t,r,n,i){if(eon("getFeatureFlagPayload","`getFeatureFlagPayload` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlagPayload(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request."),this._payloadOverrides!==void 0&&t in this._payloadOverrides)return this._payloadOverrides[t];let o=await this._getFeatureFlagResult(t,r,{...i,sendFeatureFlagEvents:!1},n);if(o!==void 0)return o.payload??null}async getFeatureFlagResult(t,r,n){let{distinctId:i,options:o}=this._resolveDistinctId(r,n);return i?this._getFeatureFlagResult(t,i,{...o,sendFeatureFlagEvents:o?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0}):void this._logger.warn("[PostHog] distinctId is required \u2014 pass it explicitly or use withContext()")}async getRemoteConfigPayload(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(!this.options.personalApiKey)throw new Error("Personal API key is required for remote config payload decryption");let r=await this._requestRemoteConfigPayload(t);if(!r)return;let n=await r.json();if(typeof n=="string")try{return JSON.parse(n)}catch{}return n}async isFeatureEnabled(t,r,n){eon("isFeatureEnabled","`isFeatureEnabled` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.isEnabled(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});return i===void 0?void 0:i.enabled===!1?!1:!!(i.variant??!0)||!1}async getAllFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);return n?(await this.getAllFlagsAndPayloads(n,i)).featureFlags||{}:(this._logger.warn("[PostHog] distinctId is required to get feature flags \u2014 pass it explicitly or use withContext()"),{})}async getAllFlagsAndPayloads(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to get feature flags and payloads \u2014 pass it explicitly or use withContext()"),{featureFlags:{},featureFlagPayloads:{}};if(this.disabled)return this._logger.warn("The client is disabled"),{featureFlags:{},featureFlagPayloads:{}};let{groups:o,disableGeoip:s,flagKeys:a}=i||{},{onlyEvaluateLocally:c,personProperties:u,groupProperties:l}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,u,l);u=p.allPersonProperties,l=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,u),l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),m={},g={},A=!0;if(f&&(m=f.response,g=f.payloads,A=f.fallbackToFlags),A&&!c){let y=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,u,l,s,a);m={...m,...y.flags||{}},g={...g,...y.payloads||{}}}return this._flagOverrides!==void 0&&(m={...m,...this._flagOverrides}),this._payloadOverrides!==void 0&&(g={...g,...this._payloadOverrides}),{featureFlags:m,featureFlagPayloads:g}}async evaluateFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to evaluate feature flags \u2014 pass it explicitly or use withContext()"),new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:"",flags:{}});if(this.disabled)return this._logger.warn("The client is disabled"),new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,flags:{}});let{groups:o,disableGeoip:s}=i||{},a=i?.flagKeys??void 0;if(a?.length===0)return new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:{}});let{onlyEvaluateLocally:c,personProperties:u,groupProperties:l}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,u,l);u=p.allPersonProperties,l=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,u),l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=a?new Set(a):void 0,m={},g,A,y=!1,I=!1,x=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),v=new Set;if(x)for(let[R,D]of Object.entries(x.response)){let O=this.featureFlagsPoller?.featureFlagsByKey[R];m[R]={key:R,enabled:D!==!1,variant:typeof D=="string"?D:void 0,payload:x.payloads[R],id:O?.id,version:void 0,reason:"Evaluated locally",locallyEvaluated:!0,hasExperiment:O?.has_experiment},v.add(R)}let S=f!==void 0&&Array.from(f).some(R=>this.featureFlagsPoller?.featureFlagsByKey[R]===void 0);if((x?x.fallbackToFlags||S:!0)&&!c){let R=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,u,l,s,a);if(R){this._minimalFlagCalledEvents=R.minimalFlagCalledEvents===!0,g=R.requestId,A=R.evaluatedAt,y=!!R.errorsWhileComputingFlags,I=Array.isArray(R.quotaLimited)&&R.quotaLimited.includes("feature_flags");for(let[D,O]of Object.entries(R.flags)){if(v.has(D))continue;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}m[D]={key:D,enabled:O.enabled,variant:O.variant,payload:z,id:O.metadata?.id,version:O.metadata?.version,reason:O.reason?.description??O.reason?.code,locallyEvaluated:!1,hasExperiment:O.metadata?.has_experiment}}}}if(this._flagOverrides!==void 0)for(let[R,D]of Object.entries(this._flagOverrides)){if(D===void 0){delete m[R];continue}let O=m[R];m[R]={key:R,enabled:D!==!1,variant:typeof D=="string"?D:void 0,payload:O?.payload,id:O?.id,version:O?.version,reason:O?.reason,locallyEvaluated:O?.locallyEvaluated??!1,hasExperiment:O?.hasExperiment}}if(this._payloadOverrides!==void 0)for(let[R,D]of Object.entries(this._payloadOverrides)){let O=m[R];O&&(m[R]={...O,payload:D})}if(f!==void 0)for(let R of Object.keys(m))f.has(R)||delete m[R];return new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:m,requestId:g,evaluatedAt:A,flagDefinitionsLoadedAt:this.featureFlagsPoller?.getFlagDefinitionsLoadedAt(),errorsWhileComputing:y,quotaLimited:I})}_shouldSendMinimalFlagCalledEvent(t,r){return t==="$feature_flag_called"&&this._minimalFlagCalledEvents&&r.$feature_flag_has_experiment===!1}_captureFlagCalledEventIfNeeded(t){let{distinctId:r,key:n,response:i,groups:o,disableGeoip:s,properties:a}=t,c=o&&Object.keys(o).length>0?`_${JSON.stringify(Object.entries(o).sort(([l],[p])=>l<p?-1:l>p?1:0))}`:"",u=`${n}_${i}${c}`;r in this.distinctIdHasSentFlagCalls&&this.distinctIdHasSentFlagCalls[r].has(u)||(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),this.distinctIdHasSentFlagCalls[r]instanceof Set?this.distinctIdHasSentFlagCalls[r].add(u):this.distinctIdHasSentFlagCalls[r]=new Set([u]),this.capture({distinctId:r,event:"$feature_flag_called",properties:a,groups:o,disableGeoip:s}))}_getFeatureFlagEvaluationsHost(){return this._featureFlagEvaluationsHost||(this._featureFlagEvaluationsHost={captureFlagCalledEventIfNeeded:t=>this._captureFlagCalledEventIfNeeded(t),logWarning:t=>{this.options.featureFlagsLogWarnings!==!1&&console.warn(`[PostHog] ${t}`)}}),this._featureFlagEvaluationsHost}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!1,{includeContextProperties:!1})}async groupIdentifyImmediate({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){await this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!0,{includeContextProperties:!1})}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}overrideFeatureFlags(t){let r=n=>Object.fromEntries(n.map(i=>[i,!0]));if(t===!1){this._flagOverrides=void 0,this._payloadOverrides=void 0;return}if(Array.isArray(t)){this._flagOverrides=r(t);return}if(this._isFeatureFlagOverrideOptions(t)){"flags"in t&&(t.flags===!1?this._flagOverrides=void 0:Array.isArray(t.flags)?this._flagOverrides=r(t.flags):t.flags!==void 0&&(this._flagOverrides={...t.flags})),"payloads"in t&&(t.payloads===!1?this._payloadOverrides=void 0:t.payloads!==void 0&&(this._payloadOverrides={...t.payloads}));return}this._flagOverrides={...t}}_isFeatureFlagOverrideOptions(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let r=t;if("flags"in r){let n=r.flags;if(n===!1||Array.isArray(n)||typeof n=="object"&&n!==null)return!0}if("payloads"in r){let n=r.payloads;if(n===!1||typeof n=="object"&&n!==null)return!0}return!1}withContext(t,r,n){return this.context?this.context.run(t,r,n):r()}getContext(){return this.context?.get()}enterContext(t,r){this.context?.enter(t,r)}async _shutdown(t){let r=Date.now()+(t??3e4),n=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown(),this._metrics&&(await d1e(this._metrics.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._metrics.reset()),this._traces&&(await d1e(this._traces.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._traces.reset());try{return await super._shutdown(Math.max(0,r-Date.now()))}finally{this.distinctIdHasSentFlagCalls={},n?.()}}async _requestRemoteConfigPayload(t){if(this.disabled||!this.apiKey||!this.options.personalApiKey)return;let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config?token=${encodeURIComponent(this.apiKey)}`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},i=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let o=new AbortController;i=zN(()=>{o.abort()},this.options.requestTimeout),n.signal=o.signal}try{return await this.fetch(r,n)}catch(o){this._events.emit("error",o);return}finally{i&&clearTimeout(i)}}extractPropertiesFromEvent(t,r){if(!t)return{personProperties:{},groupProperties:{}};let n={},i={};for(let[o,s]of Object.entries(t))if(Jil(s)&&r&&o in r){let a={};for(let[c,u]of Object.entries(s))a[String(c)]=String(u);i[String(o)]=a}else n[String(o)]=String(s);return{personProperties:n,groupProperties:i}}async getFeatureFlagsForEvent(t,r,n,i){if(this.disabled||!this.apiKey)return void this._logger.warn("The client is disabled");let o=i?.personProperties||{},s=i?.groupProperties||{},a=i?.flagKeys;if(i?.onlyEvaluateLocally??this.options.strictLocalEvaluation??!1)if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let u={};for(let[l,p]of Object.entries(r||{}))u[l]=String(p);return await this.getAllFlags(t,{groups:u,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}else return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let u={};for(let[l,p]of Object.entries(r||{}))u[l]=String(p);return await this.getAllFlags(t,{groups:u,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}return(await super.getFeatureFlagsStateless(t,r,o,s,n)).flags}addLocalPersonAndGroupProperties(t,r,n,i){let o={...n||{}},s={};if(r)for(let a of Object.keys(r))s[a]={$group_key:r[a],...i?.[a]||{}};return{allPersonProperties:o,allGroupProperties:s}}personPropertiesForLocalEvaluation(t,r){return{distinct_id:t,...r||{}}}createFeatureFlagEvaluationContext(t,r,n,i){return{distinctId:t,groups:r||{},personProperties:n||{},groupProperties:i||{},evaluationCache:{}}}captureException(t,r,n,i,o){if(!v5e.isPreviouslyCapturedError(t)){let s=new Error("PostHog syntheticException");this.addPendingPromise(v5e.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:s},r,n).then(a=>this._capturePreparedEvent({...a,uuid:i,flags:o},!1)))}}async captureExceptionImmediate(t,r,n,i){if(!v5e.isPreviouslyCapturedError(t)){let o=new Error("PostHog syntheticException");return this.addPendingPromise(v5e.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:o},r,n).then(s=>this.captureImmediate({...s,flags:i})))}}async prepareEventMessage(t){return this._prepareEventMessage(t)}async _prepareEventMessage(t,r={}){let{distinctId:n,event:i,properties:o,groups:s,flags:a,sendFeatureFlags:c,timestamp:u,disableGeoip:l,uuid:p}=t,d=this.context?.get(),f=r.includeContextProperties??!0,m=n||d?.distinctId,g=f?{...this.props,...d?.properties||{},...o||{}}:{...o||{}};m||(m=jN(),g.$process_person_profile=!1),f&&d?.sessionId&&!g.$session_id&&(g.$session_id=d.sessionId);let A=this._shouldSendMinimalFlagCalledEvent(i,g)?$Ht(g):g,y=this._runBeforeSend({distinctId:m,event:i,properties:A,groups:s,flags:a,sendFeatureFlags:c,timestamp:u,disableGeoip:l,uuid:p});if(!y)return Promise.reject(null);let I=await Promise.resolve().then(async()=>{if(a)return c&&console.warn("[PostHog] Both `flags` and `sendFeatureFlags` were passed to capture(); using `flags` and ignoring `sendFeatureFlags`."),a._getEventProperties();if(c){eon("sendFeatureFlags","`sendFeatureFlags` is deprecated and will be removed in a future major version. Pass a `flags` snapshot from `posthog.evaluateFlags(...)` instead \u2014 it avoids a second `/flags` request per capture and guarantees the event carries the exact flag values your code branched on.");let x=typeof c=="object"?c:void 0,v=await this.getFeatureFlagsForEvent(y.distinctId,s,l,x);return Ylh(v)}return{}}).catch(()=>({})).then(x=>{let v=y.groups||s;return{...x,...y.properties||{},...v!==void 0&&Object.keys(v).length>0?{$groups:v}:{}}});return y.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof I.$raw_user_agent=="string"&&Xil(I.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(y.event="$bot_pageview",I.$browser_type="bot"),{distinctId:y.distinctId,event:y.event,properties:I,options:{timestamp:y.timestamp,disableGeoip:y.disableGeoip,uuid:y.uuid}}}_runBeforeSend(t){let r=this.options.before_send;if(!r)return t;let n=Array.isArray(r)?r:[r],i=t;for(let o of n)try{if(i=o(i),!i)return this._logger.info(`Event '${t.event}' was rejected in beforeSend function`),null;if(!i.properties||Object.keys(i.properties).length===0){let s=`Event '${i.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(s)}}catch(s){return this._logger.error(`Error in before_send function for event '${t.event}':`,s),null}return i}};var Jsl=require("async_hooks"),ron=class{constructor(){this.storage=new Jsl.AsyncLocalStorage}get(){return this.storage.getStore()}run(t,r,n){return this.storage.run(this.resolve(t,n),r)}enter(t,r){this.storage.enterWith(this.resolve(t,r))}resolve(t,r){if(r?.fresh===!0)return t;let n=this.get()||{};return{distinctId:t.distinctId??n.distinctId,sessionId:t.sessionId??n.sessionId,properties:{...n.properties||{},...t.properties||{}}}}};var Ysl=require("async_hooks"),non=class{active(){return this._storage.getStore()}with(t,r){return this._storage.run(t,r)}constructor(){this._storage=new Ysl.AsyncLocalStorage}};var Xsl=require("zlib"),Zsl=require("util"),Xlh=(0,Zsl.promisify)(Xsl.gzip);async function $sl(e,t=!0){try{let r=await Xlh(e);return new Uint8Array(r)}catch(r){return t&&console.error("Failed to gzip compress data",r),null}}var ion=require("os");function eal(){let e,t;try{e=(0,ion.platform)(),t=(0,ion.release)()}catch{}return GXo(e,t)}var tal="posthog-node";function Zlh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}={}){return s=>{if(!(i==="*"||i.includes(s.level)))return s;s.tags||(s.tags={});let c=s.tags[lZo.POSTHOG_ID_TAG];if(c===void 0)return s;let u=e.options.host??"https://us.i.posthog.com",l=new URL(`/project/${e.apiKey}/person/${c}`,u).toString();s.tags["PostHog Person URL"]=l;let p=s.exception?.values||[],d=p.map(g=>({...g,stacktrace:g.stacktrace?{...g.stacktrace,type:"raw",frames:(g.stacktrace.frames||[]).map(A=>({...A,platform:"node:javascript"}))}:void 0})),f={$exception_message:p[0]?.value||s.message,$exception_type:p[0]?.type,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:p[0]?.value||s.message,$sentry_exception_type:p[0]?.type,$sentry_tags:s.tags},m=nO.getInjectedReleaseId();return m&&(f.$release_id=m),t&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+s.event_id),o&&e.capture({event:"$exception",distinctId:c,properties:f}),s}}var lZo=class{static{this.POSTHOG_ID_TAG="posthog_distinct_id"}constructor(t,r,n,i,o){this.name=tal,this.name=tal,this.setupOnce=function(s,a){let c=a()?.getClient()?.getDsn()?.projectId;s(Zlh(t,{organization:r,projectId:c,prefix:n,severityAllowList:i,sendExceptionsToPostHog:o??!0}))}}};var Ane=class extends ton{getLibraryId(){return"posthog-node"}compressPayload(t){return $sl(t,this.isDebug)}initializeContext(){return new ron}initializeSpanContextManager(){return new non}hostResourceAttributes(){return eal()}createErrorPropertiesBuilder(){return new nO.ErrorPropertiesBuilder([new nO.EventCoercer,new nO.ErrorCoercer,new nO.ObjectCoercer,new nO.StringCoercer,new nO.PrimitiveCoercer],nO.createStackParser("node:javascript",nO.nodeStackLineParser),[Gil(),t=>Tsl(t,void 0,this._logger),Rsl()])}};function ral(e){return e==null||!e.enabled?!1:e.variant==null||e.variant==="true"}var oon=class{isEnabled(){return Promise.resolve(!1)}getCachedValue(){}flush(){return Promise.resolve()}},$lh="feature_flag_evaluated",eph=3e3,tph=3e3,son=class{evaluator;environment;sendFeatureFlagEvents;pending=new Map;resolved=new Map;constructor({environment:t,sendFeatureFlagEvents:r,posthogApiKey:n,evaluator:i}){this.environment=t,this.sendFeatureFlagEvents=r,this.evaluator=i??new Ane(n??"",{featureFlagsRequestTimeoutMs:eph,isServer:!1})}isEnabled(t,r){let n=nal(t,r),i=this.pending.get(n);if(i!=null)return i;let o=this.evaluateAndRemember(t,r,n);return this.pending.set(n,o),o}async evaluateAndRemember(t,r,n){let i=await this.evaluate(t,r);return this.resolved.set(n,i),i}getCachedValue(t,r){return this.resolved.get(nal(t,r))}async flush(){if(!this.sendFeatureFlagEvents)return;let t;try{await Promise.race([this.flushAfterPendingEvaluations(),new Promise(r=>{t=setTimeout(r,tph),t.unref()})])}catch{}finally{clearTimeout(t)}}async flushAfterPendingEvaluations(){await Promise.allSettled(this.pending.values()),await this.evaluator.flush()}async evaluate(t,r){let{org:n}=r,i=nph(r,this.environment),o;try{o=await this.evaluator.getFeatureFlagResult(t,pZo(n),{personProperties:i,groups:{organization:n},groupProperties:{organization:i},sendFeatureFlagEvents:!1})}catch{return!1}return this.sendFeatureFlagEvents&&this.captureFlagUsage({flag:t,org:n,result:o,properties:i}),ral(o)}captureFlagUsage({flag:t,org:r,result:n,properties:i}){let o=rph(n),s={...i,...n?.reason!=null?{$feature_flag_reason:n.reason}:{},version:"5.170.7"};this.tryCapture({distinctId:pZo(r),event:"$feature_flag_called",groups:{organization:r},properties:{...s,$feature_flag:t,$feature_flag_response:o,[`$feature/${t}`]:o}}),this.tryCapture({distinctId:pZo(r),event:$lh,groups:{organization:r},properties:{...s,flag:t,response:o,enabled:ral(n)}})}tryCapture(t){try{this.evaluator.capture(t)}catch{}}};function rph(e){if(e!=null)return e.enabled?e.variant??!0:!1}function pZo(e){return`org:${e}`}function nph({org:e,generator:t,language:r},n){return{org:e,environment:n,...t!=null?{generator:t}:{},...r!=null?{language:r}:{}}}function nal(e,{org:t,generator:r,language:n}){return JSON.stringify([e,t,r??null,n??null])}var aon;function con(){return aon==null&&(aon=iph()),aon}async function fZo(){await aon?.flush()}function iph(){let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";return e==null||e.trim().length===0?new oon:new son({posthogApiKey:e,environment:zJ(),sendFeatureFlagEvents:lin()})}var uon=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Ane(t,{isServer:!1})}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"5.170.7",usingAccessToken:!0,cliReleaseEnvironment:zJ(),...Ope()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:zJ()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}};var bKt=class{async sendEvent(){}async sendAutomationEvent(){}async identify(){}async flush(){}};kd();er();var Fft=require("fs/promises"),ial=require("os"),oal=require("path");sVe();var oph="id",sph=".fern",EKt=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new Ane(r,{isServer:!1}),this.userId=t==null?void 0:nWo(t),this.token=t}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){let r=await this.getUserEmail();this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"5.170.7",...t,...t.properties,usingAccessToken:!1,cliReleaseEnvironment:zJ(),agent:lHr(),...r!=null?{userEmail:r}:{},...Ope()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:zJ()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}userEmail;async getUserEmail(){if(this.userEmail!==null){if(this.userEmail!=null)return this.userEmail;if(this.token==null){this.userEmail=null;return}try{let t=await Kf({token:this.token.value}).user.getMyself();if(t.ok&&t.body.email!=null)return this.userEmail=t.body.email,this.userEmail}catch{}this.userEmail=null}}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Ww(),r=ke(_t.of((0,ial.homedir)()),ye.of(sph),ye.of(oph));try{await Ut(r)?this.persistedDistinctId=(await(0,Fft.readFile)(r)).toString():(await(0,Fft.mkdir)((0,oal.dirname)(r),{recursive:!0}),await(0,Fft.writeFile)(r,t),this.persistedDistinctId=t)}catch{this.persistedDistinctId=t}}return this.persistedDistinctId}};var dZo;async function IKt(){return dZo==null&&(dZo=await aph()),dZo}async function aph(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";if(e==null||!lin())return new bKt;let t=await qlt();return t!=null?new EKt({token:t,posthogApiKey:e}):await EM()!=null?new uon({posthogApiKey:e}):new EKt({token:void 0,posthogApiKey:e})}catch{return new bKt}}Pn();Ct();kt();A8();var vKt=Ae(require("process"),1);cZe();var cal=Ae(k3o(),1),ual=Ae(aal(),1);function iO(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=dH(e),e.length===0))return 0;e=e.replace((0,ual.default)()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let o=i.codePointAt(0);if(o<=31||o>=127&&o<=159||o>=768&&o<=879)continue;switch(cal.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}Pn();function lon(e){let t=0;for(let r of e.split(`
3468
+ at ${r.filename}:${n}:${i}`}};var kch=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,KHt=class{match(t){return typeof t=="string"}coerce(t,r){let[n,i]=this.getInfos(t);return{type:n??"Error",value:i??t,stack:r.syntheticException?.stack,synthetic:!0}}getInfos(t){let r="Error",n=t,i=t.match(kch);return i&&(r=i[1],n=i[2]),[r,n]}};var kol=["fatal","error","warning","log","info","debug"];function Tin(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let n=r.length;n>0;n--){let i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}var JHt=class{match(t){return typeof t=="object"&&t!==null}coerce(t,r){let n=this.getErrorPropertyFromObject(t);return n?r.apply(n):{type:this.getType(t),value:this.getValue(t),stack:this.getStack(t)??r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(Cft(t))return t.constructor.name;let r="name"in t?t.name:void 0;return rk(r)&&!aXo(r)?r:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let i=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(i+=` with message: '${t.message}'`),i}if("message"in t&&typeof t.message=="string")return t.message;let r=this.getObjectClassName(t),n=Tin(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${n}`}isSeverityLevel(t){return rk(t)&&!aXo(t)&&kol.indexOf(t)>=0}getStack(t){try{return rk(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:rk(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];if(f1e(n))return n}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var SXo=class{match(t){return Cft(t)}coerce(t,r){let n=t.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${Tin(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var YHt=class{match(t){return fin(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var wXo=class{match(t){return g5e(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Cft(t))return!1;try{let r=t.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(t,r){let n=this.getUnhandledRejectionReason(t);return fin(n)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`,stack:r.syntheticException?.stack,synthetic:!0}:r.apply(n)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var TXo=class{constructor(t){this._maxSize=t,this._cache=new Map}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){this._cache.set(t,r)}reduce(){for(;this._cache.size>=this._maxSize;){let t=this._cache.keys().next().value;t&&this._cache.delete(t)}}};var XHt={MESSAGE:"$message",TIMESTAMP:"$timestamp"},Fch=new Set([XHt.MESSAGE,XHt.TIMESTAMP]),Oin={enabled:!0,max_bytes:32768};function OXo(e){return e?{enabled:e.enabled??Oin.enabled,max_bytes:jch(e.max_bytes,Oin.max_bytes)}:{...Oin}}function Nch(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((n,i)=>Fch.has(i)?(t.push(i),n):(n[i]=e[i],n),{}),droppedKeys:t}}var PXo=class{constructor(t){this._entries=[],this._totalBytes=0,this._config=OXo(t)}setConfig(t){this._config=OXo(t),this._trimToMaxBytes()}add(t){let r=zch(t);if(!r)return;let n=Fol(r.json);n>this._config.max_bytes||(this._entries.push({step:r.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}getAttachable(){return this._entries.map(t=>t.step)}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){let t=this._entries.shift();t&&(this._totalBytes-=t.bytes)}}};function jch(e,t){if(!vft(e)||e===1/0||e===-1/0)return t;let r=Math.floor(e);return r<0?t:r}function zch(e){let t;try{t=p1e(e)}catch{return}try{let r=JSON.parse(t);if(!UHt(r))return;let n=r,i=n[XHt.MESSAGE],o=n[XHt.TIMESTAMP];return!rk(i)||i.trim().length===0||!rk(o)&&!vft(o)?void 0:{step:n,json:t}}catch{return}}function Fol(e){if("u">typeof TextEncoder)return new TextEncoder().encode(e).length;let t=encodeURIComponent(e),r=0;for(let n=0;n<t.length;n++)t[n]==="%"?(r+=1,n+=2):r+=1;return r}function Qch(){let e=globalThis._posthogReleaseId;return typeof e=="string"&&e.length>0?e:void 0}var BXo=e=>{if("flags"in e){let t=Nol(e.flags),r=jol(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,o])=>[i,Tft(o)])),n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,Mch(i,o,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function Mch(e,t,r){return{key:e,enabled:typeof t=="string"?!0:t,variant:typeof t=="string"?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var Nol=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,ZHt(r)]).filter(([,t])=>t!==void 0)),jol=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(r=>{let n=t[r];return n.enabled&&n.metadata&&n.metadata.payload!==void 0}).map(r=>{let n=t[r].metadata?.payload;return[r,n?Tft(n):void 0]}))},ZHt=e=>e===void 0?void 0:e.variant??e.enabled,Tft=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};var zol=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Lch=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain",...zol,"$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],$Ht=(e,t=[])=>{let r={},n=i=>{e[i]!==void 0&&(r[i]=e[i])};return Lch.forEach(n),t.forEach(n),r};var Pin=class{constructor(){this.events={},this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),()=>{this.events[t]=this.events[t].filter(n=>n!==r)}}emit(t,r){for(let n of this.events[t]||[])n(r);for(let n of this.events["*"]||[])n(t,r)}};function RXo(){return"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&typeof Response.prototype.blob=="function"}var Uch="NativeGzipValidationError",Vch=31,Gch=139,qch=8,Wch=e=>e.length>=2&&e[0]===Vch&&e[1]===Gch;var eKt,Hch=()=>{if(eKt)return eKt;eKt=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;eKt[e]=t>>>0}return eKt},Kch=e=>{let t=Hch(),r=4294967295;for(let n=0;n<e.length;n++)r=t[(r^e[n])&255]^r>>>8;return(4294967295^r)>>>0},Bin=e=>{throw wft(Uch,`Native gzip produced invalid output: ${e}`)},Jch=async(e,t)=>{e.size<18&&Bin("too-short");let r=new Uint8Array(await e.slice(0,10).arrayBuffer());(!Wch(r)||r[2]!==qch)&&Bin("invalid-header");let n=new DataView(await e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==Kch(t)&&Bin("invalid-crc");let i=t.length>>>0;n.getUint32(4,!0)!==i&&Bin("invalid-size")};async function tKt(e,t=!0,r){try{let n=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),s=o.write(n).then(()=>o.close()).catch(async u=>{try{await o.abort(u)}catch{}throw u}),a=new Response(i.readable).blob(),[c]=await Promise.all([a,s]);return await Jch(c,n),c}catch(n){if(r?.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}}var V8=class extends Error{constructor(t,r,n,i){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.responseBodyDeadline=n,this.abortController=i,this.name="PostHogFetchHttpError",this._bodyReadTimedOut=!1}get status(){return this.response.status}get retryAfterMs(){try{return gXo(this.response.headers?.get("retry-after"))}catch{return}}get bodyReadTimedOut(){return this._bodyReadTimedOut}get text(){if(!this.responseBodyTextPromise)if(Date.now()>=this.responseBodyDeadline){this._bodyReadTimedOut=!0;let t=wft("AbortError","Response body read timed out");this.cancelResponseBody(t),this.responseBodyTextPromise=Promise.reject(t)}else{let t=new Promise((n,i)=>{this.responseBodyTimer=zN(()=>{this._bodyReadTimedOut=!0;let o=wft("AbortError","Response body read timed out");i(o),this.cancelResponseBody(o)},this.responseBodyDeadline-Date.now())}),r;try{r=Promise.resolve(this.response.text())}catch(n){r=Promise.reject(n)}this.responseBodyTextPromise=Promise.race([r,t]).finally(()=>clearTimeout(this.responseBodyTimer))}return this.responseBodyTextPromise}get json(){return this.text.then(t=>JSON.parse(t))}cancelResponseBody(t){clearTimeout(this.responseBodyTimer),this.abortController.signal.aborted||this.abortController.abort(t),(async()=>{try{await this.response.body?.cancel()}catch{}})()}},Ghe=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};var Uol=(e,t)=>{for(let r of Object.keys(t))(r.startsWith("$feature/")||r==="$active_feature_flags")&&(e[r]=t[r])};async function Qol(e){if(e instanceof V8){let t="";try{t=await e.text}catch{e.bodyReadTimedOut&&(t="<response body read timed out>")}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function Ych(e){return typeof e=="object"&&(e instanceof V8||Vol(e))}function Vol(e){return e instanceof Ghe}function Xch(e){if(e instanceof V8)return e.status===502||e.status===504;if(!(e instanceof Ghe))return!1;let t=e.error;return(t?.code??t?.cause?.code)!=="ECONNREFUSED"}var Mol=10485760;function Lol(e){try{return typeof e!="string"?e instanceof Uint8Array?e.byteLength:e.size:"u">typeof Buffer?Buffer.byteLength(e,gol):new TextEncoder().encode(e).length}catch{return 0}}function Oft(e){return typeof e=="object"&&e instanceof V8&&e.status===413}function Rin(e){return e instanceof V8?e.status===408||e.status===429||e.status>=500:Vol(e)}function _ol(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var DXo="default",rKt=class{getErrorPropertiesBuilder(){return this._errorPropertiesBuilder||(this._errorPropertiesBuilder=this.createErrorPropertiesBuilder()),this._errorPropertiesBuilder}createErrorPropertiesBuilder(){return new WHt([new HHt,new JHt,new KHt,new YHt],vXo())}getEvaluationRuntime(){}constructor(t,r={}){this.flushPromise=null,this.pendingFlushPromise=null,this.flushPromises=new Set,this._dequeuedMessagesCount=0,this.shutdownPromise=null,this.promiseQueue=new Ain,this._events=new Pin,this._isInitialized=!1;let n=typeof t=="string"?t.trim():"",i=typeof r.host=="string"?r.host.trim():"",o=!n;this._logger=tol("[PostHog]",this.logMsgIfDebug.bind(this)),o&&this._logger.error("You must pass your PostHog project's api key. The client will be disabled."),this.apiKey=n,this.host=Aol(i||"https://us.i.posthog.com"),this.flushAt=r.flushAt?Math.max(r.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r.maxQueueSize??1e3),this.flushInterval=r.flushInterval??1e4,this.preloadFeatureFlags=r.preloadFeatureFlags??!0,this.defaultOptIn=r.defaultOptIn??!0,this.disableSurveys=r.disableSurveys??!1,this._retryOptions={retryCount:r.fetchRetryCount??3,retryDelay:r.fetchRetryDelay??3e3,retryCheck:Rin},this.requestTimeout=r.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r.featureFlagsRequestTimeoutMs??3e3,this.featureFlagsRequestMaxRetries=r.featureFlagsRequestMaxRetries??1,this.remoteConfigRequestTimeoutMs=r.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r.disableGeoip??!0,this.disabled=(r.disabled??!1)||o,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this.evaluationContexts=r?.evaluationContexts??r?.evaluationEnvironments,r?.evaluationEnvironments&&!r?.evaluationContexts&&this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version."),this.disableCompression=!RXo()||(r?.disableCompression??!1)}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(OM.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(OM.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(OM.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(n,i)=>this._logger.info(n,i));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){let r=t.properties||{},n={...r,...this.getCommonEventProperties()};return Uol(n,r),t.event==="$feature_flag_called"&&n.$feature_flag_has_experiment===!1&&this.isMinimalFlagCalledEventsEnabled()&&(n=$Ht(n)),{distinct_id:t.distinct_id,event:t.event,properties:n}}isMinimalFlagCalledEventsEnabled(){return!1}addPendingPromise(t){return this.promiseQueue.add(t)}identifyStateless(t,r,n){this.wrap(()=>{let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};this.enqueue("identify",i,n)})}async identifyStatelessImmediate(t,r,n){let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};await this.sendImmediate("identify",i,n)}captureStateless(t,r,n,i){this.wrap(()=>{let o=this.buildPayload({distinct_id:t,event:r,properties:n});this.enqueue("capture",o,i)})}async captureStatelessImmediate(t,r,n,i){let o=this.buildPayload({distinct_id:t,event:r,properties:n});await this.sendImmediate("capture",o,i)}aliasStateless(t,r,n,i){this.wrap(()=>{let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});this.enqueue("alias",o,i)})}async aliasStatelessImmediate(t,r,n,i){let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",o,i)}groupIdentifyStateless(t,r,n,i,o,s){this.wrap(()=>{let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});this.enqueue("capture",a,i)})}async groupIdentifyStatelessImmediate(t,r,n,i,o,s){let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});await this.sendImmediate("capture",a,i)}async getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,n,{type:"required",consume:i=>i.json()},{retryCount:0},this.remoteConfigRequestTimeoutMs).catch(i=>{this._logger.error("Remote config could not be loaded",i),this._events.emit("error",i)})}async getFlags(t,r={},n={},i={},o={},s=!1){await this._initPromise;let a=s?"&config=true":"",c=`${this.host}/flags/?v=2${a}`,u={token:this.apiKey,distinct_id:t,groups:r,person_properties:n,group_properties:i,...o};n.$device_id&&(u.$device_id=n.$device_id),this.evaluationContexts&&this.evaluationContexts.length>0&&(u.evaluation_contexts=this.evaluationContexts);let l=this.getEvaluationRuntime();l&&(u.evaluation_runtime=l);let p={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(u)};return this._logger.info("Flags URL",c),this.fetchWithRetry(c,p,{type:"required",consume:d=>d.json()},{retryCount:this.featureFlagsRequestMaxRetries,retryCheck:Xch},this.featureFlagsRequestTimeoutMs).then(d=>({success:!0,response:BXo(d)})).catch(d=>(this._events.emit("error",d),{success:!1,error:this.categorizeRequestError(d)}))}categorizeRequestError(t){if(t instanceof V8)return{type:"api_error",statusCode:t.status};if(t instanceof Ghe){let r=t.error;return r instanceof Error&&(r.name==="AbortError"||r.name==="TimeoutError")?{type:"timeout"}:{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailStateless(t,r,n,i,o,s);if(a===void 0)return{response:void 0,requestId:void 0};let c=ZHt(a.response);return c===void 0&&(c=!1),{response:c,requestId:a.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(r,n,i,o,s,[t]);return a===void 0?void 0:{response:a.flags[t],requestId:a.requestId,evaluatedAt:a.evaluatedAt}}async getFeatureFlagPayloadStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagPayloadsStateless(r,n,i,o,s,[t]);if(!a)return;let c=a[t];return c===void 0?null:c}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},o,s){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},o,s){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(t,r,n,i,o,s);return a?{flags:a.featureFlags,payloads:a.featureFlagPayloads,requestId:a.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a={geoip_disable:o??this.disableGeoip};s&&(a.flag_keys_to_evaluate=s);let c=await this.getFlags(t,r,n,i,a);if(!c.success)return;let u=c.response;return u.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),u.quotaLimited?.includes("feature_flags")?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:u?.requestId,quotaLimited:u.quotaLimited}):u}async getSurveysStateless(){if(await this._initPromise,this.disabled)return[];if(this.disableSurveys===!0)return this._logger.info("Loading surveys is disabled."),[];let t=`${this.host}/api/surveys/?token=${this.apiKey}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},i=(await this.fetchWithRetry(t,r,{type:"required",consume:o=>{if(o.status!==200||!o.json){let s=`Surveys API could not be loaded: ${o.status}`,a=new Error(s);return this._logger.error(a),this._events.emit("error",new Error(s)),Promise.resolve(void 0)}return o.json()}}).catch(o=>{this._logger.error("Surveys API could not be loaded",o),this._events.emit("error",o)}))?.surveys;return i&&this._logger.info("Surveys fetched from API: ",JSON.stringify(i)),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(OM.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(OM.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(OM.Props,this.props)})}processBeforeEnqueue(t){return t}async flushStorage(){}getQueueRouteKey(t){return DXo}persistedQueueKeyForRoute(t){return OM.Queue}getActiveQueueRoutes(){return[DXo]}getRouteQueue(t){return this.getPersistedProperty(this.persistedQueueKeyForRoute(t))||[]}enqueue(t,r,n,i){this.wrap(()=>{if(this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o===null)return;o=this.normalizeMessage(o);let s=this.persistedQueueKeyForRoute(i??this.getQueueRouteKey(o)),a=this.getPersistedProperty(s)||[];a.length>=this.maxQueueSize&&(a.shift(),this._logger.warn("Queue is full, the oldest event is dropped.")),a.push({message:o}),this.setPersistedProperty(s,a),this._events.emit(t,o),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=zN(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n,i){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o!==null){o=this.normalizeMessage(o);try{await this.sendBatch([o],void 0,i??this.getQueueRouteKey(o))}catch(s){this._events.emit("error",s)}}}normalizeMessage(t){let{type:r,library:n,library_version:i,...o}=t,s=_ol(o.properties)?o.properties:void 0;return n!==void 0&&s?.$lib===void 0&&(s={...s||{},$lib:n}),i!==void 0&&s?.$lib_version===void 0&&(s={...s||{},$lib_version:i}),s&&(o.properties=s),o.uuid=y5e(o.uuid,jN),o}normalizeTimestampForWire(t){let r=t instanceof Date?t:typeof t=="string"?new Date(t):null;if(!r||Number.isNaN(r.getTime()))return t;let n=r.toISOString(),i=typeof t=="string"?t.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1]:void 0;return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}prepareMessage(t,r){let n={...t,timestamp:r?.timestamp?r?.timestamp:AXo(),uuid:y5e(r?.uuid,jN)};return(r?.disableGeoip??this.disableGeoip)&&(_ol(n.properties)||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.pendingFlushPromise||this.flushAutomatic().catch(async t=>{await Qol(t)})}flushAutomatic(){return this.flush()}async waitForPendingPromises(t,r=[]){let n=r.filter(o=>!!o),i=0;for(;;){let o=this.promiseQueue.getPromises([...n,...this.flushPromises],t);if(o.length===0)return;i>0&&this._logger.debug(`flush() re-checking ${o.length} pending promise(s) before flushing`),await Promise.all(o.map(s=>s.catch(()=>{}))),i++}}flushWithPendingPromises(){return this.flushInternal(!0)}flush(){return this.flushInternal(!1)}flushInternal(t){if(this.disabled)return Promise.resolve();if(!t&&this.pendingFlushPromise)return this.pendingFlushPromise;let r=this.flushPromise,n=this.promiseQueue.maxId,i=Promise.resolve().then(()=>{if(t)return this.waitForPendingPromises(n,[r,i])}).then(()=>qHt([r])).then(()=>(this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this._flush()));return this.pendingFlushPromise=i,this.flushPromise=i,this.flushPromises.add(i),this.addPendingPromise(i),qHt([i]).then(()=>{this.flushPromises.delete(i),this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this.flushPromise===i&&(this.flushPromise=null)}),i}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}compressPayload(t){return tKt(t,this.isDebug)}getBatchEndpointPath(t){return"/batch/"}async sendBatch(t,r,n=DXo){let i={api_key:this.apiKey,batch:t.map(u=>{if(!u)return u;let l=this.normalizeTimestampForWire(u.timestamp);return l===u.timestamp?u:{...u,timestamp:l}}),sent_at:AXo()};this.historicalMigration&&(i.historical_migration=!0);let o=p1e(i),s=`${this.host}${this.getBatchEndpointPath(n)}`,a=this.disableCompression?null:await this.compressPayload(o),c={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...a!==null&&{"Content-Encoding":"gzip"}},body:a||o};await this.fetchWithRetry(s,c,{type:"successful-write"},r)}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getActiveQueueRoutes();if(!t.some(i=>this.getRouteQueue(i).length>0))return;let r=[],n;for(let i of t)try{await this._flushRoute(i,r)}catch(o){n===void 0&&(n=o)}if(n!==void 0)throw n;this._events.emit("flush",r)}async _flushRoute(t,r){let n=this.persistedQueueKeyForRoute(t),i=this.getPersistedProperty(n)||[];if(!i.length)return;let o=i.length,s=0;for(;i.length>0&&s<o;){let a=i.slice(0,this.maxBatchSize),c=a.map(p=>p.message===void 0?p.message:this.normalizeMessage(p.message)),u=async()=>{let p=this.getPersistedProperty(n)||[],d=[...a],f=p.filter(m=>{let g=m.message?.uuid,A=d.findIndex(y=>y===m||typeof g=="string"&&g.length>0&&y.message?.uuid===g);return A===-1?!0:(d.splice(A,1),!1)});this.setPersistedProperty(n,f),i=f,this._dequeuedMessagesCount+=a.length,await this.flushStorage()},l={retryCheck:p=>Oft(p)?!1:Rin(p)};try{await this.sendBatch(c,l,t)}catch(p){if(Oft(p)&&c.length>1){this.maxBatchSize=Math.max(1,Math.floor(c.length/2)),this._logger.warn(`Received 413 when sending batch of size ${c.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw p instanceof Ghe||await u(),this._events.emit("error",p),p}await u(),r.push(...c),s+=c.length}}async _sendOtlpBatch({path:t,auth:r,payload:n}){if(this.disabled)return{kind:"fatal",error:new Error("The client is disabled")};let i;try{i=JSON.stringify(n)}catch(l){return this.logMsgIfDebug(()=>console.warn(`[PostHog] Could not serialize a ${t} batch; reporting it as too large`,l)),{kind:"too-large",measuredLocally:!0}}let o=Lol(i);if(o>Mol)return this.logMsgIfDebug(()=>console.warn(`[PostHog] Not sending a ${t} batch of ${o} bytes: the endpoint accepts at most ${Mol}`)),{kind:"too-large",measuredLocally:!0};let s=r==="bearer"?`${this.host}/i/v1/${t}`:`${this.host}/i/v1/${t}?token=${encodeURIComponent(this.apiKey)}`,a=this.disableCompression?null:await this.compressPayload(i),c=a||i,u={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...r==="bearer"&&{Authorization:`Bearer ${this.apiKey}`},...a!==null&&{"Content-Encoding":"gzip"}},body:c};try{return await this.fetchWithRetry(s,u,{type:"successful-write"},{retryCheck:l=>Oft(l)||l instanceof V8&&l.retryAfterMs!==void 0?!1:Rin(l)}),{kind:"ok"}}catch(l){if(Oft(l))return{kind:"too-large"};if(Rin(l)){let p=l instanceof V8?l.retryAfterMs:void 0;return{kind:"retry-later",error:l,...p!==void 0&&{retryAfterMs:p}}}return{kind:"fatal",error:l}}}async _sendLogsBatch(t){return this._sendOtlpBatch({path:"logs",auth:"query-token",payload:t})}async _sendMetricsBatch(t){return this._sendOtlpBatch({path:"metrics",auth:"query-token",payload:t})}async _sendTracesBatch(t){return this._sendOtlpBatch({path:"traces",auth:"bearer",payload:t})}async fetchWithRetry(t,r,n,i,o){let s=r.body?r.body:"",a=Lol(s),c={...this._retryOptions,...i},u=0;return await yol(async()=>{u++;let l=new AbortController,p=o??this.requestTimeout,d=Date.now()+p,f,m=new Promise((x,v)=>{f=zN(()=>{let S=wft("AbortError",`Request timed out after ${p}ms`);v(S),l.abort(S)},p)}),g,A=!1,y,I=()=>y??=(async()=>{try{await g?.body?.cancel()}catch{}})();try{let x;try{x=this.fetch(t,{signal:l.signal,...r})}catch(B){throw new Ghe(B)}x.then(B=>{l.signal.aborted&&!A&&Promise.resolve(B.body?.cancel()).catch(()=>{})}).catch(()=>{});try{g=await Promise.race([x,m]),A=!0}catch(B){throw new Ghe(B)}let v=r.mode==="no-cors",S=n.type==="successful-write"?300:400;if(!v&&(g.status<200||g.status>=S))throw new V8(g,a,d,l);if(n.type==="successful-write"){try{await Promise.race([I(),m])}catch{}return}try{return await Promise.race([n.consume(g),m])}catch(B){throw l.signal.aborted?new Ghe(B):B}}finally{clearTimeout(f),l.signal.aborted&&g&&I()}},{...c,retryCheck:l=>{let p=c.retryCheck(l);return p&&u<=c.retryCount&&l instanceof V8&&l.cancelResponseBody(),p}})}async _shutdown(t=3e4){await this._initPromise;let r=!1;return this.clearFlushTimer(),this.disabled?void 0:d1e((async()=>{try{for(await this.promiseQueue.join();this.getActiveQueueRoutes().some(s=>this.getRouteQueue(s).length>0);){let o=this._dequeuedMessagesCount;if(await this.flush(),r)break;if(this._dequeuedMessagesCount===o){this._logger.warn("Shutdown flush completed but did not send any queued events. Stopping drain to avoid a loop.");break}}}catch(i){if(!Ych(i))throw i;await Qol(i)}})(),t,()=>{this._logger.critical("Timeout while shutting down PostHog. Some events may not have been sent.",{shutdownTimeoutMs:t}),r=!0})}async shutdown(t=3e4){return this.shutdownPromise?this._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup"):this.shutdownPromise=this._shutdown(t).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}};var ruh=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi;var C7v=new RegExp(ruh.source,"i"),Gol=/[a-z][a-z0-9+.-]{0,63}:\/\//i,x7v=new RegExp(`^${Gol.source}`,"i"),S7v=new RegExp(Gol.source,"gi");var nuh=["is_not","is_set"],iuh=1152921504606847e3,Zu=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Object.setPrototypeOf(this,e.prototype)}};function kXo(e){if(typeof e=="boolean")return!0;if(typeof e=="string"){let t=e.toLowerCase();return t==="true"||t==="false"}if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!kXo(t in e?e[t]:null))return!1;return!0}function FXo(e){if(typeof e=="boolean")return e;if(typeof e=="string")return e.toLowerCase()==="true";if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!FXo(t in e?e[t]:null))return!1;return!0}function nKt(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(t+1>=e.length||n<56320||n>57343)throw new Zu("Cannot stringify an unpaired surrogate like the flags service");t++}else if(r>=56320&&r<=57343)throw new Zu("Cannot stringify an unpaired surrogate like the flags service")}}function kin(e,t=new Set){if(!(e===null||typeof e=="boolean")){if(typeof e=="string")return void nKt(e);if(typeof e=="number"){if(!Number.isFinite(e))throw new Zu(`Cannot represent non-finite number ${e} like the flags service`);return}if(Array.isArray(e)){if(t.has(e))throw new Zu("Cannot represent a circular array during local evaluation");t.add(e);try{for(let r=0;r<e.length;r++)r in e&&kin(e[r],t)}finally{t.delete(e)}return}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Zu("Cannot represent a non-JSON object like the flags service");if(t.has(e))throw new Zu("Cannot represent a circular object during local evaluation");t.add(e);try{for(let n of Object.keys(e))nKt(n),kin(e[n],t)}finally{t.delete(e)}return}throw new Zu(`Cannot represent ${typeof e} like the flags service`)}}function ouh(e,t){let r=0,n=0;for(;r<e.length&&n<t.length;){let i=e.charCodeAt(r),o=t.charCodeAt(n),s=i>=55296&&i<=56319,a=o>=55296&&o<=56319,c=s?e.charCodeAt(r+1):0,u=a?t.charCodeAt(n+1):0,l=s?(i-55296)*1024+c-56320+65536:i,p=a?(o-55296)*1024+u-56320+65536:o;if(l!==p)return l-p;r+=s?2:1,n+=a?2:1}return e.length-t.length}function NXo(e,t=new Set){if(e===null)return"null";if(typeof e=="string")return nKt(e),JSON.stringify(e);if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new Zu(`Cannot stringify non-finite number ${e} like the flags service`);if(Number.isInteger(e))throw new Zu(`Cannot distinguish integer ${e} from an integral JSON float during local evaluation`);return String(e)}if(Array.isArray(e)){if(t.has(e))throw new Zu("Cannot stringify a circular array during local evaluation");t.add(e);try{let r=[];for(let n=0;n<e.length;n++)r.push(n in e?NXo(e[n],t):"null");return`[${r.join(",")}]`}finally{t.delete(e)}}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Zu("Cannot stringify a non-JSON object like the flags service");if(t.has(e))throw new Zu("Cannot stringify a circular object during local evaluation");t.add(e);try{let n=Object.keys(e);return n.forEach(nKt),`{${n.sort(ouh).map(i=>`${JSON.stringify(i)}:${NXo(e[i],t)}`).join(",")}}`}finally{t.delete(e)}}throw new Zu(`Cannot stringify ${typeof e} like the flags service`)}function Din(e){return typeof e=="string"?(nKt(e),e):NXo(e)}function qol(e){try{return new RegExp(e),!0}catch{return!1}}function G8(e){return String(e).replace(/[A-Z]/g,t=>t.toLowerCase())}function Hol(e,t,r){if(!/^\d+$/.test(e)||r==="strict"&&e.length>1&&e[0]==="0")throw new Zu(`Invalid semver: ${t}`);return parseInt(e,10)}function Xw(e,t="strict"){let n=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!n||n.startsWith("."))throw new Zu(`Invalid semver: ${e}`);let i=n.split("."),o=s=>s===void 0||s===""?0:Hol(s,e,t);return[o(i[0]),o(i[1]),o(i[2])]}function q8(e,t){for(let r=0;r<3;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0}function suh(e,t){let r=Xw(e,t);return{lower:[r[0],r[1],r[2]],upper:[r[0],r[1]+1,0]}}function auh(e,t){let[r,n,i]=Xw(e,t),o=[r,n,i],s;return s=r>0?[r+1,0,0]:n>0?[0,n+1,0]:[0,0,i+1],{lower:o,upper:s}}function cuh(e,t){let n=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!n)throw new Zu(`Invalid wildcard semver: ${e}`);let i=n.split("."),o=c=>{if(t==="legacy-permissive"){let u=parseInt(c,10);if(!isNaN(u))return u}else try{return Hol(c,e,t)}catch{}throw new Zu(`Invalid wildcard semver: ${e}`)},s=o(i[0]);if(i.length===1)return{lower:[s,0,0],upper:[s+1,0,0]};let a=o(i[1]);return{lower:[s,a,0],upper:[s,a+1,0]}}function Wol(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(!isNaN(t.valueOf()))return t;throw new Zu(`${e} is in an invalid date format`)}throw new Zu(`The date provided ${e} must be a string, number, or date object`)}function jXo(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(!r||!r.groups)return null;let i=parseInt(r.groups.number);if(i>=1e4)return null;let o=r.groups.interval;if(o==="h")n.setUTCHours(n.getUTCHours()-i);else if(o==="d")n.setUTCDate(n.getUTCDate()-i);else if(o==="w")n.setUTCDate(n.getUTCDate()-7*i);else if(o==="m")n.setUTCMonth(n.getUTCMonth()-i);else{if(o!=="y")return null;n.setUTCFullYear(n.getUTCFullYear()-i)}return n}function zXo(e,t,r={}){let n=e.key,i=e.value,o=e.operator||"exact",s=r.semverParsingPolicy??"strict";if(Object.prototype.hasOwnProperty.call(t,n)){if(o==="is_not_set")return!1;if(o==="is_set")return!0}else throw new Zu(`Property ${n} not found in propertyValues`);let c=t[n];if(c===void 0)return r.warnFunction?.(`Property ${n} cannot have a value of undefined with the ${o} operator`),o==="is_not";if(c===null&&!nuh.includes(o)&&o!=="exact"&&o!=="is_not")return r.warnFunction?.(`Property ${n} cannot have a value of null with the ${o} operator`),!1;let u=(p,d)=>{if(r.propertyMatchingVersion!==2&&kXo(p)||Array.isArray(p)&&p.length===0)return kin(d),FXo(p)===FXo(d);if(r.propertyMatchingVersion===2&&typeof d=="number"&&kXo(p))return kin(d),!1;if(Array.isArray(p)){let f=Din(d).toLowerCase();return p.some(m=>Din(m).toLowerCase()===f)}return Din(p).toLowerCase()===Din(d).toLowerCase()},l=(p,d,f)=>{if(f==="gt")return p>d;if(f==="gte")return p>=d;if(f==="lt")return p<d;if(f==="lte")return p<=d;throw new Error(`Invalid operator: ${f}`)};switch(o){case"exact":return u(i,c);case"is_not":return!u(i,c);case"is_set":return!0;case"icontains":return G8(c).includes(G8(i));case"not_icontains":return!G8(c).includes(G8(i));case"starts_with":return G8(c).startsWith(G8(i));case"not_starts_with":return!G8(c).startsWith(G8(i));case"ends_with":return G8(c).endsWith(G8(i));case"not_ends_with":return!G8(c).endsWith(G8(i));case"regex":return qol(String(i))&&String(c).match(String(i))!==null;case"not_regex":return qol(String(i))&&String(c).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let p=typeof i=="number"?i:parseFloat(String(i)),d=typeof c=="number"?c:c!=null?parseFloat(String(c)):NaN;return Number.isFinite(p)&&Number.isFinite(d)?l(d,p,o):l(String(c),String(i),o)}case"is_date_after":case"is_date_before":{if(typeof i=="boolean")throw new Zu("Date operations cannot be performed on boolean values");let p=jXo(String(i));p==null&&(p=Wol(i));let d=Wol(c);return o==="is_date_before"?d<p:d>p}case"semver_eq":return q8(Xw(String(c),s),Xw(String(i),s))===0;case"semver_neq":return q8(Xw(String(c),s),Xw(String(i),s))!==0;case"semver_gt":return q8(Xw(String(c),s),Xw(String(i),s))>0;case"semver_gte":return q8(Xw(String(c),s),Xw(String(i),s))>=0;case"semver_lt":return q8(Xw(String(c),s),Xw(String(i),s))<0;case"semver_lte":return q8(Xw(String(c),s),Xw(String(i),s))<=0;case"semver_tilde":{let p=Xw(String(c),s),{lower:d,upper:f}=suh(String(i),s);return q8(p,d)>=0&&q8(p,f)<0}case"semver_caret":{let p=Xw(String(c),s),{lower:d,upper:f}=auh(String(i),s);return q8(p,d)>=0&&q8(p,f)<0}case"semver_wildcard":{let p=Xw(String(c),s),{lower:d,upper:f}=cuh(String(i),s);return q8(p,d)>=0&&q8(p,f)<0}default:throw new Zu(`Unknown operator: ${o}`)}}async function Kol(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("SubtleCrypto API not available");let r=await t.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function iKt(e,t,r="",n="."){let i=await Kol(`${e}${n}${t}${r}`);return parseInt(i.slice(0,15),16)/iuh}async function QXo(e,t){if(e==null||e.id==null||e.exclusion_percentage==null)return;let r=Number(e.exclusion_percentage);if(!Number.isFinite(r))return;let n=Math.min(Math.max(r,0),100);if(!(n!==100&&await iKt("holdout",t,"","-")>n/100))return`holdout-${e.id}`}function Fin(e){let t=[],r=0;for(let n of e){let i=r+n.rollout_percentage/100;t.push({valueMin:r,valueMax:i,key:n.key}),r=i}return t}async function MXo(e,t,r){let n=await iKt(e,t,"variant");return Fin(r).find(i=>n>=i.valueMin&&n<i.valueMax)?.key}function LXo(e,t){if(t===!1||t==null||!e)return null;let r=typeof t=="boolean"?t.toString():t,n=e[r]||null;return n==null?null:Tft(n)}var Jol=9223372036854776e3,uuh="9223372036854775808",luh=Object.prototype.propertyIsEnumerable;function puh(){return{ancestors:new WeakSet,remainingNodes:1e4}}function hne(e,t){try{return Yol(e,t,puh(),0)}catch{return[]}}function fuh(e,t){let r=e.toString(),n=BigInt(uuh);return e>=n||e<-n?(t?.debug(`Attribute ${r} is outside the int64 range; encoding it as a string`),{stringValue:r}):{intValue:r}}function VXo(e,t,r,n){if(r.remainingNodes<=0)return{stringValue:Cin};if(r.remainingNodes--,Hil(e))return{boolValue:e};if(typeof e=="bigint")return fuh(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if("u"<typeof BigInt)return{stringValue:String(e)};let i=BigInt(e).toString();return e>=Jol||e<-Jol?(t?.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:dne(e)};if(typeof e=="function")return{stringValue:hol};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(r.ancestors.has(e))return{stringValue:vin};if(n>=20)return{stringValue:Cin};if(e instanceof Date){let i=e.getTime(),o=Number.isFinite(i)?e.toISOString():String(e);return{stringValue:typeof o=="string"?dne(o):String(o)}}r.ancestors.add(e);try{try{let i=e.toJSON;if(typeof i=="function")return VXo(i.call(e),t,r,n+1)}catch{}return V4(e)?{arrayValue:{values:duh(e,t,r,n+1)}}:{kvlistValue:{values:Yol(e,t,r,n+1)}}}finally{r.ancestors.delete(e)}}return{stringValue:dne(String(e))}}function duh(e,t,r,n){let i=[],o=Math.min(e.length,1e3),s=0;for(;s<o&&r.remainingNodes>0;s++)try{let a=s in e?e[s]:void 0;if(QJ(a))continue;i.push(VXo(a,t,r,n))}catch{i.push({stringValue:U8})}return e.length>s&&i.push({stringValue:Cin}),i}function Yol(e,t,r,n){let i=[];for(let o in e)if(luh.call(e,o)){if(!o){t?.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||r.remainingNodes<=0){t?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let s=e[o];if(cXo(s)||Uhe(s))continue;i.push({key:dne(o),value:VXo(s,t,r,n)})}catch{i.push({key:dne(o),value:{stringValue:U8}})}}return i}function sKt(e,t,r){return{...Vhe({},e.resourceAttributes),"service.name":e.serviceName||"unknown_service",...e.environment&&{"deployment.environment":e.environment},...e.serviceVersion&&{"service.version":e.serviceVersion},"telemetry.sdk.name":t,"telemetry.sdk.version":r}}var muh=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function aKt(e,t){let r=Vhe({},e),n={};for(let i of muh)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i],delete r[i]);return[...hne(r,t),...hne(n,t)]}var Xol={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"};function huh(e){if(e)return Object.prototype.hasOwnProperty.call(Xol,e)?Xol[e]:e}function GXo(e,t){let r=huh(e);return{...r?{"os.name":r}:{},...t?{"os.version":t}:{}}}var guh={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},_7v=guh.info;var b5e=class{constructor(t){this._onFire=t,this._firesAt=0}get pending(){return!!this._timer}arm(t){this.clear(),this._firesAt=Date.now()+t,this._timer=zN(()=>{this._timer=void 0,this._onFire()},t)}armNoEarlierThan(t){this._timer&&Date.now()+t<=this._firesAt||this.arm(t)}clear(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)}};function cKt(){return 1-.25+Math.random()*.25*2}var W8=1;function uKt(e,t,r,n){let i=Math.min(Math.max(0,t-1),6),o=e*2**i,s=n===void 0?o:Math.min(o,Math.max(n,e));return Math.round(s*r)}var lKt=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function qXo(e){return String(e)+"000000"}function WXo(e,t,r,n){let i="";return n&&(i=Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${JSON.stringify(n[s])}`).join(",")),`${e}\0${t}\0${r??""}\0${i}`}function Zol(e,t){for(let r=0;r<t.length;r++)if(e<=t[r])return r;return t.length}function HXo(e,t,r){return sKt(e,t,r)}function KXo(e,t,r,n){return{resourceMetrics:[{resource:{attributes:aKt(t)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]}}function jin(e){let t=e?.resourceAttributes;return{serviceName:t?.["service.name"]??e?.serviceName,serviceVersion:t?.["service.version"]??e?.serviceVersion,environment:t?.["deployment.environment"]??e?.environment,resourceAttributes:t,beforeSend:e?.beforeSend,flushIntervalMs:e?.flushIntervalMs??1e4,maxSeriesPerFlush:e?.maxSeriesPerFlush??1e3}}var $ol=1,pKt=class{constructor(t,r,n){this._instance=t,this._config=r,this._logger=n,this._series=new Map,this._flushTimer=new b5e(()=>this.flush().catch(i=>{this._logger.error("Metrics flush failed:",i)})),this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._retryAfter=new A5e,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._generation=0}count(t,r=1,n){this._capture({name:t,type:"count",value:r,unit:n?.unit,attributes:n?.attributes})}gauge(t,r,n){this._capture({name:t,type:"gauge",value:r,unit:n?.unit,attributes:n?.attributes})}histogram(t,r,n){this._capture({name:t,type:"histogram",value:r,unit:n?.unit,attributes:n?.attributes})}flush(){let t=this._flushPromise,n=(async()=>{t&&await t.catch(()=>{}),await this._doFlush()})().finally(()=>{this._flushPromise===n&&(this._flushPromise=null)});return this._flushPromise=n,n}drainWindow(){if(this._series.size===0)return null;let t=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(t)}reset(){this._generation++,this._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=W8,this._flushTimer.clear(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set}_capture(t){if(this._instance.isDisabled||this._instance.optedOut)return;let r=this._runBeforeSend(t);if(r===null)return;if(!r.name||typeof r.name!="string")return void this._logger.warn("Dropping metric with empty name");if(typeof r.value!="number"||!Number.isFinite(r.value))return void this._logger.warn(`Dropping metric '${r.name}': value must be a finite number`);if(r.type==="count"&&r.value<0)return void this._logger.warn(`Dropping count '${r.name}': counters are monotonic, value must be >= 0`);let n,i;try{n=r.attributes?{...r.attributes}:void 0,i=WXo(r.type,r.name,r.unit,n)}catch(a){this._logger.warn(`Dropping metric '${r.name}': attributes could not be serialized`,a);return}let o=this._series.get(i);if(!o){if(!this._admitNewSeries())return;o={name:r.name,type:r.type,unit:r.unit,attributes:n,windowStartMs:Date.now()},this._series.set(i,o)}let s=this._typeByName.get(r.name);s===void 0?this._typeByName.set(r.name,r.type):s!==r.type&&!this._typeCollisionWarned.has(r.name)&&(this._typeCollisionWarned.add(r.name),this._logger.warn(`Metric name '${r.name}' is already used as a ${s}; recording it as a ${r.type} too will blend both series in charts. Use a distinct name.`)),this._fold(o,r.value),this._armFlushTimer()}_admitNewSeries(){return this._series.size<this._config.maxSeriesPerFlush?!0:(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn(`Metric series cap reached (${this._config.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}_fold(t,r){switch(t.type){case"count":t.total=(t.total??0)+r;break;case"gauge":t.last=r;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:r,max:r,bucketCounts:new Array(lKt.length+1).fill(0)});let n=t.hist;n.count+=1,n.sum+=r,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.bucketCounts[Zol(r,lKt)]+=1;break}}}_runBeforeSend(t){let r=this._config.beforeSend;if(!r)return t;let n=V4(r)?r:[r],i=t;for(let o of n)try{let s=o(i);if(!s)return this._logger.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this._logger.error("Error in beforeSend function for metric:",s),null}return i}_armFlushTimer(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(uKt(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}async _doFlush(){if(this._flushTimer.clear(),this._series.size===0)return;let t=this._series;this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set;let r=this._generation,n=await this._instance._sendMetricsBatch(this._buildPayload(t));if(r===this._generation)switch(this._retryAfter.record(n),n.kind==="retry-later"?(this._consecutiveFlushFailures++,this._flushJitter=cKt()):(this._consecutiveFlushFailures=0,this._flushJitter=W8),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),n.kind){case"ok":return;case"retry-later":this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay());return;case"too-large":this._logger.warn("Metrics batch exceeded the server size limit and was dropped");return;case"fatal":this._logger.error("Failed to send metrics batch:",n.error);return}}_buildPayload(t){return KXo(this._buildMetrics(t),HXo(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._instance.getLibraryId(),this._instance.getLibraryVersion())}_buildMetrics(t){let r=qXo(Date.now()),n=new Map;for(let i of t.values()){let o=WXo(i.type,i.name,i.unit,void 0),s=n.get(o);s||(s={name:i.name,...i.unit&&{unit:i.unit}},i.type==="count"?s.sum={aggregationTemporality:$ol,isMonotonic:!0,dataPoints:[]}:i.type==="gauge"?s.gauge={dataPoints:[]}:s.histogram={aggregationTemporality:$ol,dataPoints:[]},n.set(o,s));let a=hne(i.attributes??{},this._logger),c=qXo(i.windowStartMs);if(i.type==="count"){let u={attributes:a,startTimeUnixNano:c,timeUnixNano:r,asDouble:i.total??0};s.sum.dataPoints.push(u)}else if(i.type==="gauge"){let u={attributes:a,timeUnixNano:r,asDouble:i.last??0};s.gauge.dataPoints.push(u)}else if(i.hist){let u={attributes:a,startTimeUnixNano:c,timeUnixNano:r,count:i.hist.count,sum:i.hist.sum,min:i.hist.min,max:i.hist.max,bucketCounts:i.hist.bucketCounts,explicitBounds:lKt};s.histogram.dataPoints.push(u)}}return Array.from(n.values())}_mergeWindowBack(t){for(let[r,n]of t){let i=this._series.get(r);if(!i){this._admitNewSeries()&&this._series.set(r,n);continue}switch(i.windowStartMs=Math.min(i.windowStartMs,n.windowStartMs),i.type){case"count":i.total=(i.total??0)+(n.total??0);break;case"gauge":break;case"histogram":if(n.hist)if(i.hist){i.hist.count+=n.hist.count,i.hist.sum+=n.hist.sum,i.hist.min=Math.min(i.hist.min,n.hist.min),i.hist.max=Math.max(i.hist.max,n.hist.max);for(let o=0;o<i.hist.bucketCounts.length;o++)i.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else i.hist=n.hist;break}}}};var Euh="0".repeat(32),Iuh="0".repeat(16),vuh=/^[0-9a-f]+$/;function Cuh(e){let t=new Uint8Array(e),r=globalThis.crypto;if(r&&typeof r.getRandomValues=="function")try{return r.getRandomValues(t),t}catch{}for(let n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}function xuh(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function esl(e){let t=xuh(Cuh(e));return/[^0]/.test(t)?t:t.slice(0,-1)+"1"}function tsl(){return esl(16)}function rsl(){return esl(8)}function nsl(e,t,r){return typeof e=="string"&&e.length===t&&e!==r&&vuh.test(e)}function isl(e){return nsl(e,32,Euh)}function osl(e){return nsl(e,16,Iuh)}var Suh=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;function ssl(e){let t=asl(e);return t&&{traceId:t.traceId,spanId:t.spanId,flags:wuh(t.flags)}}function wuh(e){return 1&parseInt(e,16)?Qin:Tuh}function asl(e){if(typeof e!="string")return;let t=Suh.exec(e.trim());if(!t)return;let[,r,n,i,o,s]=t;if(r!=="ff"&&!(r==="00"&&s)&&!(!isl(n)||!osl(i)))return{version:r,traceId:n,spanId:i,flags:o}}function csl(e){return asl(e)&&e.trim()}function zin(e){return Array.isArray(e)&&e.length===1?e[0]:e}var Qin="01",Tuh="00";function usl(e,t,r=Qin){return`00-${e}-${t}-${r}`}var Ouh=32,JXo=512;function Min(e){if(typeof e!="string")return;let t=e.trim();if(!t||/[^\x20-\x7e\t]/.test(t))return;let r=t.split(",");if(!(r.length>Ouh)){for(let n of r)if(n.trim()&&!n.includes("="))return;return t.length<=JXo?t:Buh(r)}}var Puh=128;function Buh(e){let t=[...e],r=()=>t.reduce((n,i)=>n+i.length,0)+t.length-1;for(let n=t.length-1;n>=0&&r()>JXo;n--)t[n].length>Puh&&t.splice(n,1);for(;t.length&&r()>JXo;)t.pop();return t.length?t.join(","):void 0}var lsl="unknown";function E5e(e,t,r,n){return typeof e=="string"&&e.trim()?e.length>r?e.slice(0,r):e:(n?.debug(`${t} must be a non-empty string; using "${lsl}"`),lsl)}function Pft(e){if(e==null)return;let t=e;if(e instanceof Date)try{t=e.getTime()}catch{return}if(!(typeof t!="number"||!Number.isFinite(t))&&!(t<0||t>9223372036854))return t}function psl(e,t,r){let n=Pft(e);return n===void 0?(e!==void 0&&r?.debug("Span startTime is out of range or not a valid time; using the current time"),t):(t-n>864e5?r?.debug("Span startTime is more than 24 hours in the past; the server will clamp it to receive time and keep the original in $originalTimestamp"):n>t&&r?.debug("Span startTime is in the future; the span may export with a zero duration"),n)}function Lin(e,t){return e<t?t:e}function fKt(e,t,r,n){let i=Pft(e);return i===void 0?(e!==void 0&&n?.debug(`Span ${r} is out of range or not a valid time; using the derived time`),t):i}function Uin(){let e=globalThis.performance;return typeof e?.now=="function"?e.now():void 0}var Bft=class{constructor(t,r,n){this._onEnd=r,this._logger=n,this._events=[],this._ended=!1,this._userAttributeCount=0,this._userEventCount=0,this._droppedAttributes=0,this._droppedEvents=0,this._traceId=t.traceId,this._spanId=t.spanId,this._parentSpanId=t.parentSpanId,this._traceState=t.traceState,this._traceFlags=t.traceFlags??Qin,this._parentIsRemote=t.parentIsRemote??!1,this._name=t.name,this._kind=t.kind,this._autoKeys=new Set(t.autoAttributeKeys),this._maxAttributes=t.maxAttributes,this._maxEvents=t.maxEvents,this._maxAttributesPerEvent=t.maxAttributesPerEvent,this._maxAttributeValueLength=t.maxAttributeValueLength,this._attributes=Object.create(null);for(let i of Object.keys(t.attributes))this._writeAttribute(i,t.attributes[i]);this._startMono=t.backdated?void 0:Uin(),this._startTime=t.clockAnchor&&this._startMono!==void 0?t.clockAnchor.wall+(this._startMono-t.clockAnchor.mono):t.startTime,this._startMono!==void 0&&(this._clockAnchor=t.clockAnchor??{wall:this._startTime,mono:this._startMono})}_now(){if(this._startMono!==void 0){let t=Uin();if(t!==void 0)return this._startTime+Math.max(0,t-this._startMono)}return Date.now()}_mutable(t){return this._ended?(this._logger?.debug(`Ignoring ${t} on a span that has already ended`),!1):!0}_writeAttribute(t,r){if(QJ(r)){t in this._attributes&&!this._autoKeys.has(t)&&this._userAttributeCount--,delete this._attributes[t];return}if(!this._autoKeys.has(t)&&!(t in this._attributes)){if(this._userAttributeCount>=this._maxAttributes)return void this._droppedAttributes++;this._userAttributeCount++}this._attributes[t]=Gin(r,this._maxAttributeValueLength)}setAttribute(t,r){return this._mutable("setAttribute")&&this._writeAttribute(t,r),this}setAttributes(t){if(this._mutable("setAttributes")){let r=Vhe({},t);for(let n of Object.keys(r))this._writeAttribute(n,r[n])}return this}addEvent(t,r,n){if(this._mutable("addEvent")){if(this._userEventCount>=this._maxEvents)return this._droppedEvents++,this;this._userEventCount++;let i=r&&hsl(r,this._maxAttributesPerEvent,this._maxAttributeValueLength);this._events.push({name:E5e(t,"Span event name",this._maxAttributeValueLength,this._logger),timestamp:fKt(n,this._now(),"event timestamp",this._logger),...i&&{attributes:i.attributes,...i.dropped&&{droppedAttributesCount:i.dropped}}})}return this}setStatus(t,r){if(this._mutable("setStatus")){if(t!=="ok"&&t!=="error")return this._logger?.debug(`Ignoring unknown span status "${String(t)}"; expected "ok" or "error"`),this;this._status={code:t,...r&&{message:YXo(r,this._maxAttributeValueLength)}}}return this}get statusIsExplicitlyOk(){return this._status?.code==="ok"}recordException(t){if(!this._mutable("recordException"))return this;let{type:r,message:n,stack:i}=XXo(t);return this.addEvent(Ruh,{"exception.type":r,"exception.message":n,...i&&{"exception.stacktrace":i}}),this.setStatus("error",n)}updateName(t){return this._mutable("updateName")&&(this._name=E5e(t,"Span name",this._maxAttributeValueLength,this._logger)),this}traceparent(){return usl(this._traceId,this._spanId,this._traceFlags)}tracestate(){return this._traceState??null}childContext(){return{traceId:this._traceId,parentSpanId:this._spanId,traceState:this._traceState,traceFlags:this._traceFlags,clockAnchor:this._clockAnchor}}end(t){if(this._ended)return void this._logger?.debug("Ignoring end() on a span that has already ended");this._ended=!0;let r=this._now(),n=fKt(t,r,"end time",this._logger);this._onEnd({traceId:this._traceId,spanId:this._spanId,...this._parentSpanId&&{parentSpanId:this._parentSpanId},...this._traceState&&{traceState:this._traceState},traceFlags:this._traceFlags,parentIsRemote:this._parentIsRemote,name:this._name,kind:this._kind,...this._status&&{status:this._status},attributes:{...this._attributes},events:this._events,startTime:this._startTime,endTime:Lin(n,this._startTime),...this._droppedAttributes&&{droppedAttributesCount:this._droppedAttributes},...this._droppedEvents&&{droppedEventsCount:this._droppedEvents}},this._autoKeys)}},Ruh="exception",Duh=4294967295;function kuh(e){try{return typeof e=="string"?e:String(e)}catch{return U8}}function I5e(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?0:Math.min(Math.floor(e),Duh)}function Fuh(e,t){if(!t.length)return Object.keys(e);let r=t.filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)),n=new Set(r);return[...r,...Object.keys(e).filter(i=>!n.has(i))]}function dsl(e,t,r,n,i,o,s=[]){let a=0,c=0,u={};for(let f of Fuh(e.attributes,s)){let m=e.attributes[f];if(!QJ(m)){if(!t.has(f)){if(a>=r){c++;continue}a++}Object.defineProperty(u,f,{value:Gin(m,o),enumerable:!0,writable:!0,configurable:!0})}}e.attributes=u,c&&(e.droppedAttributesCount=I5e(e.droppedAttributesCount)+c);let l=0,p=0,d=[];for(let f of e.events){if(l>=n){p++;continue}if(l++,f.attributes){let m=hsl(f.attributes,i,o);f.attributes=m.attributes,m.dropped&&(f.droppedAttributesCount=I5e(f.droppedAttributesCount)+m.dropped)}d.push(f)}e.events=d,p&&(e.droppedEventsCount=I5e(e.droppedEventsCount)+p),e.status?.message&&(e.status={...e.status,message:YXo(kuh(e.status.message),o)})}var Vin=class{setAttribute(){return this}setAttributes(){return this}addEvent(){return this}setStatus(){return this}recordException(){return this}updateName(){return this}traceparent(){return null}tracestate(){return null}end(){}},msl=new Vin,dKt=class extends Vin{constructor(t,r){super(),this._traceparent=t,this._tracestate=r}traceparent(){return this._traceparent}tracestate(){return this._tracestate??null}};function Nuh(e){try{let t=e.stack;return typeof t=="string"&&t?{stack:t}:{}}catch{return{}}}function m1e(e,t){let r=zin(e?.parent)??t,n=typeof r=="string"||r==null?r:fsl(r,"traceparent"),i=csl(n);if(!i)return msl;let o=typeof r=="string"||r==null?e?.tracestate:fsl(r,"tracestate");return new dKt(i,Min(o))}function fsl(e,t){try{let r=e[t];return typeof r=="function"?r.call(e):void 0}catch{return}}function YXo(e,t){return e.length>t?e.slice(0,t):e}function Gin(e,t){return _in(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}function _in(e,t,r,n){if(e===null||typeof e!="object")return QJ(e)||r.remainingNodes<=0?e:(r.remainingNodes--,typeof e=="string"?YXo(e,t):e);if(r.ancestors.has(e))return vin;if(r.remainingNodes<=0||n>=20)return e;r.remainingNodes--,r.ancestors.add(e);try{if(e instanceof Date)return e;let i=juh(e);if(i.selfDescribed)return QJ(i.value)?String(i.value):_in(i.value,t,r,n+1);if(V4(e)){let a=Math.min(e.length,1e3),c=[];for(let u=0;u<a;u++)try{c.push(_in(e[u],t,r,n+1))}catch{c.push(U8)}return e.length>a&&(c.length=e.length),c}let o={},s=0;for(let a of Object.keys(e)){if(s>=1e3)break;let c;try{c=_in(e[a],t,r,n+1)}catch{c=U8}a&&!QJ(c)&&s++,Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}catch{return e}finally{r.ancestors.delete(e)}}function juh(e){try{let t=e.toJSON;if(typeof t=="function")return{selfDescribed:!0,value:t.call(e)}}catch{}return{selfDescribed:!1}}function hsl(e,t,r){let n;try{n=Object.keys(e)}catch{return{attributes:{},dropped:0}}let i={},o=0,s=0;for(let a of n){if(o>=t){s++;continue}let c;try{c=Gin(e[a],r)}catch{c=U8}QJ(c)||(o++,Object.defineProperty(i,a,{value:c,enumerable:!0,writable:!0,configurable:!0}))}return{attributes:i,dropped:s}}function gsl(e,t){for(let r of Object.keys(e))e[r]=Gin(e[r],t);return e}function mKt(e,t,r){return t===msl?r(t):e.with(t,()=>r(t))}function XXo(e){try{let t=Nuh(e);if(f1e(e))return{type:e.name||"Error",message:e.message||"",...t};if(typeof e=="string")return{type:"string",message:e};if(e&&typeof e=="object"){let r=e;if(typeof r.message=="string")return{type:typeof r.name=="string"?r.name:"Object",message:r.message,...t}}return{type:typeof e,message:String(e)}}catch{return{type:typeof e,message:""}}}var ZXo={internal:1,server:2,client:3,producer:4,consumer:5},zuh={ok:1,error:2},Quh=1,Muh=256,Luh=512;function _uh(e){let t=parseInt(e.traceFlags,16);return(Number.isFinite(t)?255&t:Quh)|Muh|(e.parentIsRemote?Luh:0)}function qin(e){if(typeof e=="string")return dne(e);try{return dne(String(e))}catch{return U8}}function Uuh(e){return e&&Object.prototype.hasOwnProperty.call(ZXo,e)?ZXo[e]:ZXo.internal}function $Xo(e){let t=Math.floor(e),r=Math.round((e-t)*1e6);return r>=1e6&&(t+=1,r=0),String(t)+String(r).padStart(6,"0")}function Vuh(e,t){let r={name:qin(e.name),timeUnixNano:$Xo(e.timestamp)};if(e.attributes){let i=hne(e.attributes,t);i.length&&(r.attributes=i)}let n=I5e(e.droppedAttributesCount);return n&&(r.droppedAttributesCount=n),r}function Asl(e,t){let r={traceId:e.traceId,spanId:e.spanId,name:qin(e.name),kind:Uuh(e.kind),startTimeUnixNano:$Xo(e.startTime),endTimeUnixNano:$Xo(e.endTime),flags:_uh(e)};e.parentSpanId&&(r.parentSpanId=e.parentSpanId),e.traceState&&(r.traceState=qin(e.traceState));let n=hne(e.attributes,t);n.length&&(r.attributes=n),e.events.length&&(r.events=e.events.map(s=>Vuh(s,t)));let i=I5e(e.droppedAttributesCount);i&&(r.droppedAttributesCount=i);let o=I5e(e.droppedEventsCount);return o&&(r.droppedEventsCount=o),e.status&&(r.status={code:zuh[e.status.code],...e.status.message&&{message:qin(e.status.message)}}),r}function ysl(e,t,r){return sKt(e,t,r)}function bsl(e,t,r,n,i){return{resourceSpans:[{resource:{attributes:aKt(t,i)},scopeSpans:[{scope:{name:r,version:n},spans:e}]}]}}var Esl=8;function Win(){return Uin()??Date.now()}function eZo(e){try{return e instanceof Bft}catch{return!1}}function Isl(e,t){let r=ssl(e);if(r)return{traceId:r.traceId,parentSpanId:r.spanId,traceState:Min(t),traceFlags:r.flags,isRemote:!0}}function Guh(e){try{return typeof e.traceparent=="function"}catch{return!1}}function quh(e){return!!e.attributes&&typeof e.attributes=="object"&&!Array.isArray(e.attributes)&&Array.isArray(e.events)&&e.name!==void 0&&e.kind!==void 0&&e.startTime!==void 0&&e.endTime!==void 0}function Hin(e,t,r){e[t]!==r&&(e[t]=r)}function Wuh(e,t){try{let r=Object.getOwnPropertyDescriptors(e);for(let n of["traceId","spanId","parentSpanId","traceState"])r[n]={value:t[n],enumerable:!0,writable:!0,configurable:!0};return Object.create(Object.getPrototypeOf(e),r)}catch{return e}}var hKt=class{constructor(t,r,n,i,o,s){this._instance=t,this._config=r,this._logger=n,this._getContext=i,this._contextManager=o,this._onSpanQueued=s,this._queue=[],this._flushTimer=new b5e(()=>this._flushInBackground()),this._flushPromise=null,this._droppedSinceWarning=0,this._lastDropWarningAt=0,this._dropReasons=new Set,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._retryAfter=new A5e,this._headBatchFailures=0,this._headBatchSize=0,this._headBatchChargeableAt=0,this._generation=0,this._liveSpans=new Map,this._maxExportBatchSize=r.maxExportBatchSize}startSpan(t,r){if(this._instance.isDisabled||this._instance.optedOut)return m1e(r,this._contextManager.active());let n=zin(r?.parent);if(n&&typeof n!="string"&&!eZo(n)){if(Guh(n))return this._logger.debug("Span parent is not a span from this SDK; returning an inert span"),m1e(r,this._contextManager.active());this._logger.debug("Ignoring an unusable span parent")}let i=this._resolveParent(n,r);if(this._liveSpans.size>=this._config.maxLiveSpans&&this._evictAgedSpans(),this._liveSpans.size>=this._config.maxLiveSpans)return this._recordDrop(1,`the live-span limit (${this._config.maxLiveSpans}) was reached \u2014 spans are being started and never ended`),m1e(r,this._contextManager.active());let o=Date.now(),s=psl(r?.startTime,o,this._logger),a=rsl();this._liveSpans.set(a,Win());let c=this._autoContextAttributes();return new Bft({traceId:i?.traceId??tsl(),spanId:a,parentSpanId:i?.parentSpanId,traceState:i?.traceState,traceFlags:i?.traceFlags,parentIsRemote:i?.isRemote,name:E5e(t,"Span name",this._config.maxAttributeValueLength,this._logger),kind:r?.kind??"internal",attributes:Vhe({...c},r?.attributes),autoAttributeKeys:Object.keys(c),maxAttributes:this._config.maxAttributesPerSpan,maxEvents:this._config.maxEventsPerSpan,maxAttributesPerEvent:this._config.maxAttributesPerEvent,maxAttributeValueLength:this._config.maxAttributeValueLength,startTime:s,backdated:s!==o,clockAnchor:Pft(r?.startTime)===void 0?i?.clockAnchor:void 0},(u,l)=>this._onSpanEnd(u,l),this._logger)}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this.startSpan(t,i);try{let a=mKt(this._contextManager,s,o);return bol(a)?a.then(c=>(s.end(),c),c=>{throw this._recordCallbackError(s,c),s.end(),c}):(s.end(),a)}catch(a){throw this._recordCallbackError(s,a),s.end(),a}}getActiveSpan(){return this._contextManager.active()??null}get throttled(){return this._retryAfter.isOpen()}async flush(){for(;;)if(!this._queue.length||!await(this._flushPromise??this._startFlush()))return}_startFlush(){this._flushTimer.clear();let t=this._generation,r=Promise.resolve().then(()=>t===this._generation?this._flushInner():0).finally(()=>{this._flushPromise===r&&(this._flushPromise=null),this._armFlushTimerIfQueuedNoEarlierThan()});return this._flushPromise=r,r}reset(){this._flushTimer.clear(),this._queue.length&&this._logger.critical(`Discarding ${this._queue.length} span(s) that were still queued when tracing was shut down. Raise the shutdown timeout or flush earlier if they matter.`),this._queue=[],this._liveSpans.clear(),this._flushPromise=null,this._generation++,this._maxExportBatchSize=this._config.maxExportBatchSize,this._droppedSinceWarning=0,this._dropReasons.clear(),this._lastDropWarningAt=0,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._retryAfter.reset(),this._resetHeadBatchBudget()}_resetHeadBatchBudget(){this._headBatchFailures=0,this._headBatchChargeableAt=0}_resolveParent(t,r){if(typeof t=="string"){let i=Isl(t,r?.tracestate);return i||this._logger.debug("Ignoring malformed traceparent; starting a new trace"),i}if(eZo(t))return t.childContext();let n=this._contextManager.active();if(eZo(n))return n.childContext();if(n instanceof dKt)return Isl(n.traceparent(),n.tracestate()??void 0)}_autoContextAttributes(){let t;try{t=this._getContext()}catch(n){return this._logger.debug("Failed to read tracing context; span will carry no PostHog attributes",n),{}}let r={};return t.distinctId&&(r.posthogDistinctId=t.distinctId),t.sessionId&&(r.sessionId=t.sessionId),t.currentUrl&&(r["url.full"]=t.currentUrl),t.screenName&&(r["screen.name"]=t.screenName),t.appState&&(r["app.state"]=t.appState),r}_recordCallbackError(t,r){if(!(t instanceof Bft))return;let{type:n,message:i,stack:o}=XXo(r);t.addEvent("exception",{"exception.type":n,"exception.message":i,...o&&{"exception.stacktrace":o}}),t.statusIsExplicitlyOk||t.setStatus("error",i)}_evictAgedSpans(){let t=Win()-this._config.maxSpanAgeMs,r=0;for(let[n,i]of this._liveSpans){if(i>t)break;this._liveSpans.delete(n),r++}r&&this._recordDrop(r,`they were still live after ${this._config.maxSpanAgeMs}ms`)}_onSpanEnd(t,r){if(!this._liveSpans.delete(t.spanId))return;if(this._instance.isDisabled||this._instance.optedOut)return void this._recordDrop(1,"the user has opted out");let n=this._runBeforeSpanSend(t,r);if(n){if(this._reportLimitDrops(n),this._queue.length>=this._config.maxQueueSize)return void this._recordDrop(1,`the queue is full (${this._config.maxQueueSize}) \u2014 raise the flush frequency or reduce span volume`);this._queue.push(n);try{this._onSpanQueued?.()}catch(i){this._logger.debug("Span queue notification failed",i)}!(this._queue.length>=this._maxExportBatchSize)||this._consecutiveFlushFailures||this._retryAfter.isOpen()?this._armFlushTimerIfQueued():this._flushInBackground()}}_reportLimitDrops(t){let r=t.droppedAttributesCount??0,n=t.droppedEventsCount??0,i=0;for(let o of t.events)i+=o.droppedAttributesCount??0;(r||n||i)&&this._logger.debug(`Span limits discarded data from "${t.name}": ${r} attributes, ${n} events, ${i} event attributes`)}_runBeforeSpanSend(t,r){if(!this._config.beforeSpanSend.length)return t;let n={traceId:t.traceId,spanId:t.spanId,parentSpanId:t.parentSpanId,traceState:t.traceState},i={startTime:t.startTime,endTime:t.endTime},o={attributes:t.droppedAttributesCount,events:t.droppedEventsCount},s=Object.keys(t.attributes),a={traceFlags:t.traceFlags,parentIsRemote:t.parentIsRemote},c=t.status&&{...t.status},u=t,l=t;try{for(let f of this._config.beforeSpanSend){let m=f(u);if(!m)return this._recordDrop(1,"beforeSpanSend dropped it"),null;u=this._keepSpanIdentity(m,n)}if(l={traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,traceState:n.traceState,name:u.name,kind:u.kind,status:u.status,attributes:u.attributes,events:u.events,startTime:u.startTime,endTime:u.endTime,traceFlags:a.traceFlags,parentIsRemote:a.parentIsRemote,droppedAttributesCount:o.attributes,droppedEventsCount:o.events},!quh(l))return this._logger.debug("beforeSpanSend did not return a span record; dropping the span"),this._recordDrop(1,"beforeSpanSend returned an unusable record"),null;l.name=E5e(l.name,"Span name",this._config.maxAttributeValueLength,this._logger),l.status&&l.status.code!=="ok"&&l.status.code!=="error"&&(this._logger.debug("beforeSpanSend set an unknown span status; keeping the original"),l.status=c),l.startTime=Pft(l.startTime)??i.startTime,l.endTime=Lin(Pft(l.endTime)??i.endTime,l.startTime);let d=[];for(let f of l.events)try{d.push({...f,name:E5e(f.name,"Span event name",this._config.maxAttributeValueLength,this._logger),timestamp:fKt(f.timestamp,l.startTime,"event timestamp",this._logger)})}catch{this._logger.debug("beforeSpanSend left an unreadable span event; dropping it")}return l.events=d,dsl(l,r,this._config.maxAttributesPerSpan,this._config.maxEventsPerSpan,this._config.maxAttributesPerEvent,this._config.maxAttributeValueLength,s),l}catch(p){return this._logger.debug("beforeSpanSend failed; dropping the span rather than exporting it unscrubbed",p),this._recordDrop(1,"beforeSpanSend failed"),null}}_keepSpanIdentity(t,r){(t.traceId!==r.traceId||t.spanId!==r.spanId||t.parentSpanId!==r.parentSpanId)&&this._logger.debug("beforeSpanSend changed a span identity field; keeping the original ids");try{Hin(t,"traceId",r.traceId),Hin(t,"spanId",r.spanId),Hin(t,"parentSpanId",r.parentSpanId),Hin(t,"traceState",r.traceState)}catch{return Wuh(t,r)}return t}_recordDrop(t,r){this._droppedSinceWarning+=t,this._dropReasons.add(r),Date.now()-this._lastDropWarningAt>=this._config.flushIntervalMs&&this._warnAboutDrops()}_warnAboutDrops(){this._droppedSinceWarning&&(this._lastDropWarningAt=Date.now(),this._logger.warn(`Dropping ${this._droppedSinceWarning} span(s): ${[...this._dropReasons].join("; ")}`),this._droppedSinceWarning=0,this._dropReasons.clear())}_encodeBatch(t){let r=[];for(let n of t)try{r.push(Asl(n,this._logger))}catch(i){this._logger.debug("Failed to encode a span; dropping it",i),this._recordDrop(1,"its attributes could not be encoded")}return r}_discardQueueIfConsentWithdrawn(){if(!this._instance.isDisabled&&!this._instance.optedOut)return 0;let t=this._queue.length;return this._queue=[],this._resetHeadBatchBudget(),this._recordDrop(t,"the user has opted out"),this._warnAboutDrops(),t}async _flushInner(){if(!this._queue.length)return 0;let t=this._discardQueueIfConsentWithdrawn();if(t)return t;let r=gsl(ysl(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._config.maxAttributeValueLength),n=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),o=this._queue.length,s=0,a=1/0,c=this._generation;try{for(;o>0&&this._queue.length>0;){let u=this._discardQueueIfConsentWithdrawn();if(u)return s+u;let l=this._headBatchFailures>0?Math.min(this._maxExportBatchSize,this._headBatchSize):this._maxExportBatchSize,p=Math.max(1,Math.min(l,a,o,this._queue.length)),d=this._queue.slice(0,p),f=this._encodeBatch(d);if(!f.length){this._queue.splice(0,p),o-=p,s+=p,this._resetHeadBatchBudget();continue}let m=Win()>=this._headBatchChargeableAt&&!this._retryAfter.isOpen(),g=await this._instance._sendTracesBatch(bsl(f,r,n,i,this._logger));if(c!==this._generation)break;if(this._retryAfter.record(g),g.kind==="ok"){this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget(),this._queue.splice(0,p),o-=p,s+=p,this._maxExportBatchSize<this._config.maxExportBatchSize&&this._maxExportBatchSize++;continue}if(g.kind==="too-large"){if(p===1){this._queue.splice(0,1),o-=1,s+=1,this._recordDrop(1,"it is too large for the ingestion endpoint"),this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget();continue}let A=Math.max(1,Math.floor(p/2));g.measuredLocally?a=A:this._maxExportBatchSize=A,this._resetHeadBatchBudget(),this._logger.debug(`Batch too large; retrying the same spans in batches of ${A}`);continue}if(g.kind==="retry-later"){if(this._consecutiveFlushFailures++,this._flushJitter=cKt(),this._headBatchSize=p,m&&(this._headBatchFailures++,this._headBatchChargeableAt=Win()+this._nextFlushDelay()),this._headBatchFailures<Esl)return this._logger.debug("Span export failed; retrying on the next flush",g.error),s;if(this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget(),this._recordDrop(p,`the ingestion endpoint failed ${Esl} times in a row`),this._retryAfter.isOpen())return s;continue}this._logger.debug("Dropping a span batch the ingestion endpoint rejected",g.error),this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=W8,this._resetHeadBatchBudget(),this._recordDrop(p,"the ingestion endpoint rejected the batch")}return s}finally{this._warnAboutDrops()}}_flushInBackground(){this._backgroundFlush||(this._backgroundFlush=this.flush().catch(t=>{this._logger.debug("Background span flush failed",t)}).finally(()=>{this._backgroundFlush=void 0,this._armFlushTimerIfQueuedNoEarlierThan()}))}_armFlushTimerIfQueued(){this._flushTimer.pending||!this._queue.length||this._flushTimer.arm(this._nextFlushDelay())}_armFlushTimerIfQueuedNoEarlierThan(){this._queue.length&&this._flushTimer.armNoEarlierThan(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(uKt(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}};var gKt=class{active(){return this._active}with(t,r){let n=this._active;this._active=t;try{return r()}finally{this._active=n}}};var Huh=5e3,Kuh=512,Juh=2048,Yuh=128,Xuh=128,Zuh=128,$uh=8192,elh=1e4,tlh=36e5;function h1e(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=1?e:t}var vsl=["service.name","service.version","deployment.environment"];function rlh(e){if(!(!e||typeof e!="object"||Array.isArray(e)))try{if(vsl.every(r=>!(r in e)||typeof e[r]=="string"))return e;let t={...e};for(let r of vsl)r in t&&typeof t[r]!="string"&&delete t[r];return t}catch{return}}function nlh(e,t){if(!e)return[];let r=[e].flat().filter(i=>!!i),n=r.filter(i=>typeof i=="function");return n.length!==r.length&&t?.critical(`beforeSpanSend: ignoring ${r.length-n.length} of ${r.length} entries that are not functions. Spans export without them, so whatever they were redacting is not redacted.`),n}function tZo(e,t,r){let n=Vhe({...t},rlh(e?.resourceAttributes)),i=h1e(e?.maxExportBatchSize,Kuh);return{serviceName:n?.["service.name"]??e?.serviceName,serviceVersion:n?.["service.version"]??e?.serviceVersion,environment:n?.["deployment.environment"]??e?.environment,resourceAttributes:n,beforeSpanSend:nlh(e?.beforeSpanSend,r),maxAttributesPerSpan:h1e(e?.maxAttributesPerSpan,Yuh),maxEventsPerSpan:h1e(e?.maxEventsPerSpan,Xuh),maxAttributesPerEvent:Zuh,maxAttributeValueLength:h1e(e?.maxAttributeValueLength,$uh),flushIntervalMs:h1e(e?.flushIntervalMs,Huh),maxExportBatchSize:i,maxQueueSize:Math.max(h1e(e?.maxQueueSize,Juh),i),maxLiveSpans:h1e(e?.maxLiveSpans,elh),maxSpanAgeMs:h1e(e?.maxSpanAgeMs,tlh)}}var rZo=require("fs"),Ssl=require("fs/promises"),iZo=require("path"),wsl=require("readline"),Kin=new nO.ReduceableCache(25),AKt=new nO.ReduceableCache(20),oZo=7,ilh=1e3,olh=1e4,nZo=10485760;async function Tsl(e,t=Ssl.open,r){let n={},i;try{i=process.cwd()}catch{}for(let a=e.length-1;a>=0;a--){let c=e[a],u=c?.filename;if(!c||typeof u!="string"||typeof c.lineno!="number"||llh(u)||plh(c)||!(0,iZo.isAbsolute)(u)&&i===void 0)continue;n[u]||(n[u]=[]),n[u].push(c.lineno)}let o=Object.keys(n);if(o.length==0)return e;let s=[];for(let a of o){let c=Osl(a,i);if(c===void 0||AKt.get(c))continue;let u=n[a];if(!u)continue;u.sort((d,f)=>d-f);let l=dlh(u);if(l.every(d=>flh(c,d)))continue;let p=mlh(Kin,c,{});s.push(alh(a,l,p,c,t,r))}return await Promise.all(s).catch(()=>{}),e&&e.length>0&&clh(e,Kin,i),Kin.reduce(),e}async function slh(e,t,r){let n,i=!1;try{n=await t(e,rZo.constants.O_RDONLY|rZo.constants.O_NONBLOCK);let o=await n.stat();return o.isFile()?o.size>nZo?void r?.debug(`Skipping source context for oversized file ${e}: ${o.size} bytes exceeds ${nZo}`):(i=!0,n):void 0}catch{return}finally{n&&!i&&await n.close().catch(()=>{})}}async function alh(e,t,r,n,i,o){let s=await slh(e,i,o);if(s===void 0)return void AKt.set(n,1);let a=s;return new Promise(c=>{let u=!1;function l(x){u||(u=!0,x?.destroy(),a.close().then(c,c))}let p;try{p=a.createReadStream({autoClose:!1,start:0,end:nZo-1})}catch{AKt.set(n,1),l();return}let d;try{d=(0,wsl.createInterface)({input:p})}catch{AKt.set(n,1),l(p);return}let f=0,m=0,g=t[m];if(g===void 0)return void l(p);let A=g[0],y=g[1];function I(){AKt.set(n,1),d.close(),d.removeAllListeners(),l(p)}p.on("error",I),d.on("error",I),d.on("close",()=>l(p)),d.on("line",x=>{if(f++,!(f<A)&&(r[f]=hlh(x,0),f>=y)){if(m===t.length-1){d.close(),d.removeAllListeners();return}m++;let v=t[m];if(v===void 0){d.close(),d.removeAllListeners();return}A=v[0],y=v[1]}})})}function clh(e,t,r){for(let n of e)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let i=Osl(n.filename,r),o=i===void 0?void 0:t.get(i);if(o===void 0)continue;ulh(n.lineno,n,o)}}function ulh(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=Psl(e);i<e;i++){let o=r[i];if(o===void 0)return void Csl(t);t.pre_context.push(o)}if(r[e]===void 0)return void Csl(t);t.context_line=r[e];let n=Bsl(e);t.post_context=[];for(let i=e+1;i<=n;i++){let o=r[i];if(o===void 0)break;t.post_context.push(o)}}function Csl(e){delete e.pre_context,delete e.context_line,delete e.post_context}function llh(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function plh(e){return e.lineno!==void 0&&e.lineno>olh||e.colno!==void 0&&e.colno>ilh}function Osl(e,t){return(0,iZo.isAbsolute)(e)?JSON.stringify([null,e]):t===void 0?void 0:JSON.stringify([t,e])}function flh(e,t){let r=Kin.get(e);if(r===void 0)return!1;for(let n=t[0];n<=t[1];n++)if(r[n]===void 0)return!1;return!0}function dlh(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=xsl(r),i=[];for(;;){if(t===e.length-1){i.push(n);break}let o=e[t+1];if(typeof o!="number")break;o<=n[1]?n[1]=o+oZo:(i.push(n),n=xsl(o)),t++}return i}function xsl(e){return[Psl(e),Bsl(e)]}function Psl(e){return Math.max(1,e-oZo)}function Bsl(e){return e+oZo}function mlh(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function hlh(e,t){let r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);let i=Math.max(t-60,0);i<5&&(i=0);let o=Math.min(i+140,n);return o>n-5&&(o=n),o===n&&(i=Math.max(o-140,0)),r=r.slice(i,o),i>0&&(r=`...${r}`),o<n&&(r+="..."),r}var Rft=require("path");function Rsl(e=process.cwd()){let t=Rft.sep==="\\",r=i=>t?i.replace(/\\/g,"/"):i,n=r(e);return async i=>{for(let o of i)!o.filename||o.filename.startsWith("node:")||o.filename.startsWith("data:")||(0,Rft.isAbsolute)(o.filename)&&(o.filename=r((0,Rft.relative)(n,r(o.filename))));return i}}var Dsl="5.55.0";var qhe={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};var g1e=class e{constructor(t){this._host=t.host,this._distinctId=t.distinctId,this._groups=t.groups,this._disableGeoip=t.disableGeoip,this._flags=t.flags,this._requestId=t.requestId,this._evaluatedAt=t.evaluatedAt,this._flagDefinitionsLoadedAt=t.flagDefinitionsLoadedAt,this._errorsWhileComputing=t.errorsWhileComputing??!1,this._quotaLimited=t.quotaLimited??!1,this._accessed=t.accessed??new Set,this._isSlice=t.isSlice??!1}isEnabled(t,r={}){let n=this._flags[t];return this._recordAccess(t),n?.enabled??r.defaultValue??!1}getFlag(t){let r=this._flags[t];if(this._recordAccess(t),!!r)return r.enabled?r.variant??!0:!1}getFlagPayload(t){return this._flags[t]?.payload}onlyAccessed(){let t={};for(let r of this._accessed){let n=this._flags[r];n&&(t[r]=n)}return this._cloneWith(t)}only(t){let r={},n=[];for(let i of t){let o=this._flags[i];o?r[i]=o:n.push(i)}return n.length>0&&this._host.logWarning(`FeatureFlagEvaluations.only() was called with flag keys that are not in the evaluation set and will be dropped: ${n.join(", ")}`),this._cloneWith(r)}get keys(){return Object.keys(this._flags)}_getEventProperties(){let t={},r=[];for(let[n,i]of Object.entries(this._flags)){let o=i.enabled===!1?!1:i.variant??!0;t[`$feature/${n}`]=o,i.enabled&&r.push(n)}return r.length>0&&(r.sort(),t.$active_feature_flags=r),t}_cloneWith(t){return new e({host:this._host,distinctId:this._distinctId,groups:this._groups,disableGeoip:this._disableGeoip,flags:t,requestId:this._requestId,evaluatedAt:this._evaluatedAt,flagDefinitionsLoadedAt:this._flagDefinitionsLoadedAt,errorsWhileComputing:this._errorsWhileComputing,quotaLimited:this._quotaLimited,accessed:new Set(this._accessed),isSlice:!0})}_recordAccess(t){if(this._accessed.add(t),this._distinctId===""||this._isSlice&&!(t in this._flags))return;let r=this._flags[t],n=r===void 0?void 0:r.enabled===!1?!1:r.variant??!0,i={$feature_flag:t,$feature_flag_response:n,$feature_flag_id:r?.id,$feature_flag_version:r?.version,$feature_flag_reason:r?.reason,locally_evaluated:r?.locallyEvaluated??!1,[`$feature/${t}`]:n,$feature_flag_request_id:this._requestId,$feature_flag_evaluated_at:r?.locallyEvaluated?Date.now():this._evaluatedAt};r?.hasExperiment!==void 0&&(i.$feature_flag_has_experiment=r.hasExperiment),r?.locallyEvaluated&&this._flagDefinitionsLoadedAt!==void 0&&(i.$feature_flag_definitions_loaded_at=this._flagDefinitionsLoadedAt);let o=[];this._errorsWhileComputing&&o.push(qhe.ERRORS_WHILE_COMPUTING),this._quotaLimited&&o.push(qhe.QUOTA_LIMITED),r===void 0&&o.push(qhe.FLAG_MISSING),o.length>0&&(i.$feature_flag_error=o.join(",")),this._host.captureFlagCalledEventIfNeeded({distinctId:this._distinctId,key:t,response:n,groups:this._groups,disableGeoip:this._disableGeoip,properties:i})}};var glh=6e4;function ksl(e){return e==="client"||e==="server"?e:"all"}function Alh(e,t){return e===t||e==="all"||t==="all"}var Dft=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}};function ylh(e,t){e.name=t.name,Error.captureStackTrace(e,t),Object.setPrototypeOf(e,t.prototype)}var gne=class e extends Error{constructor(t){super(t),ylh(this,e)}},Jin=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:o,customHeaders:s,...a}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollerStopped=!1,this.filteredOutFlagKeys=new Set,this.pollingInterval=t,this.personalApiKey=r,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=i,this.projectApiKey=n,this.host=o,this.poller=void 0,this.fetch=a.fetch||fetch,this.onError=a.onError,this.customHeaders=s,this.onLoad=a.onLoad,this.onMinimalFlagCalledEvents=a.onMinimalFlagCalledEvents,this.cacheProvider=a.cacheProvider,this.strictLocalEvaluation=a.strictLocalEvaluation??!1,this.evaluationContexts=a.evaluationContexts,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}withEvaluationSnapshot(t){return t.definitions?t:{...t,evaluationCache:{},definitions:{featureFlagsByKey:this.featureFlagsByKey,groupTypeMapping:this.groupTypeMapping,cohorts:this.cohorts,filteredOutFlagKeys:this.filteredOutFlagKeys,propertyMatchingVersion:this.propertyMatchingVersion}}}createEvaluationContext(t,r={},n={},i={},o={}){return{distinctId:t,groups:r,personProperties:n,groupProperties:i,evaluationCache:o}}async getFeatureFlag(t,r,n={},i={},o={}){await this.loadFeatureFlags();let s,a;if(!this.loadedSuccessfullyOnce)return s;if(a=this.featureFlagsByKey[t],a!==void 0){let c=this.createEvaluationContext(r,n,i,o);try{s=(await this.computeFlagAndPayloadLocally(a,c)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${s}`))}catch(u){u instanceof gne||u instanceof Zu?this.logMsgIfDebug(()=>console.debug(`${u.name} when computing flag locally: ${t}: ${u.message}`)):u instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${u}`))}}return s}async getAllFlagsAndPayloads(t,r){await this.loadFeatureFlags();let n={},i={},o=this.featureFlags.length==0,s=r?r.map(c=>this.featureFlagsByKey[c]).filter(Boolean):this.featureFlags,a=this.withEvaluationSnapshot({...t,definitions:void 0});return await Promise.all(s.map(async c=>{try{let{value:u,payload:l}=await this.computeFlagAndPayloadLocally(c,a,{skipLoadCheck:!0});n[c.key]=u,l&&(i[c.key]=l)}catch(u){u instanceof gne||u instanceof Zu?this.logMsgIfDebug(()=>console.debug(`${u.name} when computing flag locally: ${c.key}: ${u.message}`)):u instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${c.key}: ${u}`)),o=!0}})),{response:n,payloads:i,fallbackToFlags:o}}async computeFlagAndPayloadLocally(t,r,n={}){let{matchValue:i,skipLoadCheck:o=!1}=n;if(this.loadedSuccessfullyOnce&&(r=this.withEvaluationSnapshot(r)),o||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};r=this.withEvaluationSnapshot(r),t=r.definitions.featureFlagsByKey[t.key]??t;let s;s=i!==void 0?i:await this.computeFlagValueLocally(t,r);let a=LXo(t.filters?.payloads,s);return{value:s,payload:a}}async computeFlagValueLocally(t,r){let{distinctId:n,groups:i,personProperties:o,groupProperties:s}=r;if(!t.active)return!1;if(t.ensure_experience_continuity)throw new Zu("Flag has experience continuity enabled");let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let u=r.definitions.groupTypeMapping[String(c)];if(!u)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Zu("Flag has unknown group type index");if(!(u in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;t.bucketing_identifier==="device_id"&&(o?.$device_id===void 0||o?.$device_id===null||o?.$device_id==="")&&this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Ignoring bucketing_identifier for group flag: ${t.key}`));let l=s[u];return await this.matchFeatureFlagProperties(t,i[u],l,r)}{let u=this.getBucketingValueForFlag(t,n,o);if(u===void 0)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute feature flag: ${t.key} without $device_id, falling back to server evaluation`)),new Zu(`Can't compute feature flag: ${t.key} without $device_id`);return await this.matchFeatureFlagProperties(t,u,o,r)}}getBucketingValueForFlag(t,r,n){if(t.filters?.aggregation_group_type_index!=null)return r;if(t.bucketing_identifier==="device_id"){let i=n?.$device_id;return i==null||i===""?void 0:i}return r}async evaluateFlagDependency(t,r,n){let{evaluationCache:i}=n,o=t.key;if(!n.definitions.featureFlagsByKey)throw new Zu("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new Zu(`Flag dependency property for '${o}' is missing required 'dependency_chain' field`);let s=t.dependency_chain;if(!Array.isArray(s))throw new Zu(`Flag dependency property for '${o}' has an invalid 'dependency_chain' (expected array, got ${typeof s})`);if(s.length===0)throw new Zu(`Circular dependency detected for flag '${o}' (empty dependency chain)`);for(let c of s){if(!(c in i)){let l=n.definitions.featureFlagsByKey[c];if(l)if(l.active)try{let p=await this.computeFlagValueLocally(l,n);i[c]=p}catch(p){throw new Zu(`Error evaluating flag dependency '${c}' for flag '${o}': ${p}`)}else i[c]=!1;else if(n.definitions.filteredOutFlagKeys.has(c))i[c]=!1;else throw new Zu(`Missing flag dependency '${c}' for flag '${o}'`)}if(i[c]==null)throw new Zu(`Dependency '${c}' could not be evaluated`)}let a=i[o];return this.flagEvaluatesToExpectedValue(t.value,a)}flagEvaluatesToExpectedValue(t,r){return typeof t=="boolean"?t===r||typeof r=="string"&&r!==""&&t===!0:typeof t=="string"?r===t:!1}async matchFeatureFlagProperties(t,r,n,i){i=this.withEvaluationSnapshot(i);let o=t.filters||{},s=await QXo(o.holdout,r);if(s!==void 0)return s;let a=o.groups||[],c=o.aggregation_group_type_index,u=o.early_exit??!1,{groups:l,groupProperties:p}=i,d=!1,f;for(let m of a)try{let g=m.aggregation_group_type_index!==void 0?m.aggregation_group_type_index:c,A=n,y=r;if(g!==c&&g!=null){let x=i.definitions.groupTypeMapping[String(g)];if(!x||!(x in l)){this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Skipping group condition for flag '${t.key}': group type index ${g} not available`));continue}if(!(x in p)){d=!0;continue}A=p[x],y=l[x]}let I=await this.isConditionMatch(t,y,m,A,i);if(I==="match"){let x=m.variant,v=o.multivariate?.variants||[];f=x&&v.some(S=>S.key===x)?x:await this.getMatchingVariant(t,y)||!0;break}if(u&&I==="out_of_rollout_bound"){if(d)break;return!1}}catch(g){if(g instanceof gne)throw g;if(g instanceof Zu)d=!0;else throw g}if(f!==void 0)return f;if(d)throw new Zu("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i,o){o=this.withEvaluationSnapshot(o);let s=o.definitions,a=n.rollout_percentage,c=u=>{this.logMsgIfDebug(()=>console.warn(u))};if((n.properties||[]).length>0){for(let u of n.properties){let l=u.type,p=!1;if(l==="cohort"){let d=await Nsl(u,i,s.cohorts,this.debugMode,f=>this.evaluateFlagDependency(f,i,o),s.propertyMatchingVersion);p=u.operator==="not_in"?!d:d}else p=l==="flag"?await this.evaluateFlagDependency(u,i,o):Fsl(u,i,c,s.propertyMatchingVersion);if(!p)return"no_match"}if(a==null)return"match"}return a!=null&&await iKt(t.key,r)>a/100?"out_of_rollout_bound":"match"}async getMatchingVariant(t,r){return MXo(t.key,r,t.filters?.multivariate?.variants||[])}variantLookupTable(t){return Fin(t.filters?.multivariate?.variants||[])}filterFlagsByEvaluationContexts(t){if(!this.evaluationContexts||this.evaluationContexts.length===0)return t;let r=new Set(this.evaluationContexts);return t.filter(n=>{let i=n.evaluation_contexts??n.evaluation_tags;return!i||i.length===0?!0:i.some(o=>r.has(o))})}getEvaluationRuntimeForFlag(t){let r=this.featureFlagsByKey[t];return r?ksl(r.evaluation_runtime):void 0}getFlagKeysByEvaluationRuntime(t){return this.featureFlags.filter(r=>Alh(ksl(r.evaluation_runtime),t)).map(r=>r.key)}updateFlagState(t){let r=this.filterFlagsByEvaluationContexts(t.flags);this.featureFlags=r,this.featureFlagsByKey=r.reduce((i,o)=>(i[o.key]=o,i),{});let n=new Set(r.map(i=>i.key));this.filteredOutFlagKeys=new Set(t.flags.filter(i=>!n.has(i.key)).map(i=>i.key)),this.groupTypeMapping=t.group_type_mapping??t.groupTypeMapping??{},this.cohorts=t.cohorts,this.propertyMatchingVersion=t.property_matching_version??t.propertyMatchingVersion,this.loadedSuccessfullyOnce=!0,this.onMinimalFlagCalledEvents?.((t.minimal_flag_called_events??t.minimalFlagCalledEvents)===!0)}warnAboutExperienceContinuityFlags(t){if(this.strictLocalEvaluation)return;let r=t.filter(n=>n.ensure_experience_continuity);r.length>0&&console.warn(`[PostHog] You are using local evaluation but ${r.length} flag(s) have experience continuity enabled: ${r.map(n=>n.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`)}async loadFromCache(t){if(!this.cacheProvider)return!1;try{let r=await this.cacheProvider.getFlagDefinitions();return r?(this.updateFlagState(r),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${t} (${r.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags),!0):!1}catch(r){return this.onError?.(new Error(`Failed to load from cache: ${r}`)),!1}}async loadFeatureFlags(t=!1){if(!(this.loadedSuccessfullyOnce&&!t))return!t&&this.nextFetchAllowedAt&&Date.now()<this.nextFetchAllowedAt?void this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period")):(this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(r=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${r}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise)}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getFlagDefinitionsLoadedAt(){return this.flagDefinitionsLoadedAt}getPollingInterval(){let t=this.pollingInterval??3e4;return this.shouldBeginExponentialBackoff?Math.min(glh,t*2**this.backOffCount):t}beginBackoff(){this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,this.nextFetchAllowedAt=Date.now()+this.getPollingInterval()}clearBackoff(){this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.nextFetchAllowedAt=void 0}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);try{let t=!0;if(this.cacheProvider)try{t=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(n){this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${n}`))}if(!t&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let r=await this._requestFeatureFlagDefinitions();if(!r)return;switch(r.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=r.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.clearBackoff();return;case 401:throw this.beginBackoff(),new Dft(`Your project key or secret key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.filteredOutFlagKeys=new Set,this.groupTypeMapping={},this.cohorts={},this.propertyMatchingVersion=void 0,this.onMinimalFlagCalledEvents?.(!1);return;case 403:throw this.beginBackoff(),new Dft(`Your secret key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct secret and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new Dft(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let n=await r.json()??{};if(!("flags"in n))return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(n)}`));this.flagsEtag=r.headers?.get("ETag")??void 0;let i=n.group_type_mapping||{},o=n.minimal_flag_called_events===!0,s={flags:n.flags??[],group_type_mapping:i,cohorts:n.cohorts||{},minimal_flag_called_events:o,property_matching_version:n.property_matching_version,propertyMatchingVersion:n.property_matching_version,groupTypeMapping:i,minimalFlagCalledEvents:o};if(this.updateFlagState(s),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(s)}catch(a){this.onError?.(new Error(`Failed to store in cache: ${a}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags);break}default:return}}catch(t){t instanceof Dft&&this.onError?.(t)}finally{!this.pollerStopped&&this.pollingInterval!==null&&(this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval()))}}getPersonalApiKeyRequestOptions(t="GET",r){let n={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return r&&(n["If-None-Match"]=r),{method:t,headers:n}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/flags/definitions?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),n=null;if(this.timeout&&typeof this.timeout=="number"){let o=new AbortController;n=zN(()=>{o.abort()},this.timeout),r.signal=o.signal}let i=()=>clearTimeout(n);try{let o=this.fetch,s=await o(t,r);return s.status!==200?(i(),s):{status:s.status,headers:s.headers,body:s.body,text:async()=>{try{return await s.text()}finally{i()}},json:async()=>{try{return await s.json()}finally{i()}}}}catch(o){throw i(),o}}async stopPoller(t=3e4){if(this.pollerStopped=!0,clearTimeout(this.poller),this.poller=void 0,this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await d1e(r,t,()=>{throw new Error(`Cache shutdown timeout after ${t}ms`)})}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};function Fsl(e,t,r,n){return zXo(e,t,{warnFunction:r,propertyMatchingVersion:n})}function blh(e,t){if(!(e in t))throw new gne(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}async function Nsl(e,t,r,n=!1,i,o){let s=String(e.value);blh(s,r);let a=r[s];return jsl(a,t,r,n,i,o)}async function jsl(e,t,r,n=!1,i,o){if(!e)return!0;let s=e.type,a=e.values;if(!a||a.length===0)return!0;let c=!1;if("values"in a[0]){for(let u of a)try{let l=await jsl(u,t,r,n,i,o);if(s==="AND"){if(!l)return!1}else if(l)return!0}catch(l){if(l instanceof gne)throw l;if(l instanceof Zu)n&&console.debug(`Failed to compute property ${u} locally: ${l}`),c=!0;else throw l}if(c)throw new Zu("Can't match cohort without a given cohort property value");return s==="AND"}for(let u of a)try{let l;if(u.type==="cohort")l=await Nsl(u,t,r,n,i,o);else if(u.type==="flag"){if(!i)throw new Zu(`Flag dependency '${u.key||"unknown"}' cannot be evaluated without a flag dependency evaluator`);l=await i(u)}else l=Fsl(u,t,void 0,o);let p=u.negation||!1;if(s==="AND"){if(!l&&!p||l&&p)return!1}else if(l&&!p||!l&&p)return!0}catch(l){if(l instanceof gne)throw l;if(l instanceof Zu)n&&console.debug(`Failed to compute property ${u} locally: ${l}`),c=!0;else throw l}if(c)throw new Zu("can't match cohort without a given cohort property value");return s==="AND"}var Elh=["--unhandled-rejections","--unhandled_rejections"],Ilh=new Set(["throw","strict","warn","warn-with-error-code","none"]),vlh=[...globalThis.process?.execArgv??[]],Clh=globalThis.process?.env?.NODE_OPTIONS;function xlh(e){let t=[],r="",n=!1;for(let i=0;i<e.length;i++){let o=e[i];o==="\\"&&n&&i+1<e.length?r+=e[++i]:o!==" "||n?o==='"'?n=!n:r+=o:r&&(t.push(r),r="")}return r&&t.push(r),t}function zsl(e){let t;for(let r=0;r<e.length;r++){let n=e[r],i=Elh.find(s=>n===s||n.startsWith(`${s}=`));if(!i)continue;let o=n===i?e[++r]:n.slice(i.length+1);Ilh.has(o)&&(t=o)}return t}function Slh(e=vlh,t=Clh){return zsl(e)??zsl(xlh(t??""))??"throw"}var Qsl=Slh();function Msl(e,t,r){e(t,{mechanism:{type:r==="unhandledRejection"?"onunhandledrejection":"onuncaughtexception",handled:!1}})}function wlh(e,t){let r=!1;return Object.assign((n,i)=>{let o=global.process.listeners("uncaughtException").filter(s=>s.name!=="domainUncaughtExceptionClear"&&s._posthogErrorHandler!==!0).length;Msl(e,n,i),!r&&o===0&&(r=!0,t(n))},{_posthogErrorHandler:!0})}function Lsl(e,t,r=Qsl){let n=globalThis.process;if(n){if(r==="strict")return void n.on("uncaughtExceptionMonitor",(i,o)=>Msl(e,i,o));n.on("uncaughtException",wlh(e,t))}}function _sl(e,t=Qsl){let r=globalThis.process;!r||t==="throw"||t==="strict"||t==="warn-with-error-code"||r.on("unhandledRejection",n=>{e(n,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var Tlh=2e3,sZo=class e{constructor(t,r,n){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=n,this._rateLimiter=new min({...Zil(r),refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(t){return UHt(t)&&"__posthog_previously_captured_error"in t&&t.__posthog_previously_captured_error===!0}static async buildEventMessage(t,r,n,i,o){let s={...o},a=t.buildFromUnknown(r,n);a.$exception_list=await t.modifyFrames(a.$exception_list);let c=nO.getInjectedReleaseId();return c&&(s.$release_id=c),{event:"$exception",distinctId:i,properties:{...a,...s},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){this.isEnabled()&&(Lsl(this.onException.bind(this),this.onFatalError.bind(this)),_sl(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{if(!e.isPreviouslyCapturedError(t)){let n=await e.buildEventMessage(this.client.getErrorPropertiesBuilder(),t,r),o=n.properties?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(o)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:o}):this.client._capturePreparedEvent(n,!1)}})())}async onFatalError(t){console.error(t),await this.client.shutdown(Tlh),globalThis.process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}},v5e=sZo;var Yin=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};function Olh(e){return e==="v0"||e==="v1"}function Usl(){let e="u">typeof process?process.env?.POSTHOG_CAPTURE_MODE:void 0;return Olh(e)?e:"v0"}var Plh="$ai_",yKt="analytics";function Vsl(e){return typeof e.event=="string"&&e.event.startsWith(Plh)}var kft=class e extends Error{constructor({requestId:t,drops:r,retryExhausted:n,cause:i}){super(e.buildMessage(t,r,n,i)),this.name="CaptureV1Error",this.requestId=t,this.drops=r,this.retryExhausted=n,this.cause=i}static buildMessage(t,r,n,i){let o=`Capture V1 batch ${t} did not fully deliver: ${r.length} dropped, ${n.length} undelivered`;return i instanceof Error&&(o+=` (${i.message})`),o}};function aZo(e){if(typeof e=="boolean")return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1}}function Blh(e){return typeof e=="string"?e:void 0}var Rlh=[{property:"$cookieless_mode",optionKey:"cookieless_mode",coerce:aZo},{property:"$ignore_sent_at",optionKey:"disable_skew_correction",coerce:aZo},{property:"$process_person_profile",optionKey:"process_person_profile",coerce:aZo},{property:"$product_tour_id",optionKey:"product_tour_id",coerce:Blh}],Dlh=[{property:"$session_id",field:"session_id"},{property:"$window_id",field:"window_id"}];function klh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Flh(e){if(typeof e=="string"){let r=new Date(e);if(Number.isNaN(r.getTime()))return new Date().toISOString();let n=r.toISOString(),i=e.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}if(e instanceof Date)return Number.isNaN(e.getTime())?new Date().toISOString():e.toISOString();let t=e==null?new Date:new Date(e);return Number.isNaN(t.getTime())?new Date().toISOString():t.toISOString()}function Gsl(e,t,r){r!==void 0&&!(t in e)&&(e[t]=r)}function Nlh(e){let r={...klh(e.properties)?e.properties:{}},n={};for(let{property:o,optionKey:s,coerce:a}of Rlh)if(o in r){let c=a(r[o]);c!==void 0&&(n[s]=c),delete r[o]}let i={};for(let{property:o,field:s}of Dlh)if(o in r){let a=r[o];typeof a=="string"&&(i[s]=a),delete r[o]}return delete r.$lib,delete r.$lib_version,Gsl(r,"$set",e.$set),Gsl(r,"$set_once",e.$set_once),{event:String(e.event??""),uuid:String(e.uuid??""),distinct_id:String(e.distinct_id??""),timestamp:Flh(e.timestamp),...i,options:n,properties:r}}function qsl(e,{createdAt:t,historicalMigration:r}){let n={created_at:t,batch:e.map(Nlh)};return r&&(n.historical_migration=!0),n}var jlh="/i/v1/analytics/events",zlh=3e4,Qlh=new Set([408,500,502,503,504]),Xin=class{constructor(t,r){this.config=t,this.maxBackoffMs=t.maxBackoffMs??zlh,this.fetchFn=r.fetch,this.onError=r.onError,this.now=r.now??Date.now,this.sleep=r.sleep??(n=>new Promise(i=>zN(i,n))),this.generateRequestId=r.generateRequestId??jN,this.compress=r.compress??tKt}async sendV1Batch(t){if(t.length===0)return;let r=this.generateRequestId(),n=new Date(this.now()).toISOString(),{batch:i}=qsl(t,{createdAt:n,historicalMigration:this.config.historicalMigration}),o=`${this.config.host}${jlh}`,s=[],a=i,c=Math.max(1,this.config.maxAttempts);for(let u=1;u<=c;u++){let l=u===c,p=p1e({created_at:n,...this.config.historicalMigration?{historical_migration:!0}:{},batch:a}),d,f;try{d=await this.sendOnce(o,p,u,r);let{response:m,signal:g}=d,{status:A}=m;if(A<200||A>=300)if(!l&&Qlh.has(A)){let y=this.parseRetryAfter(m);await d.waitFor(d.cancelBody()).catch(()=>{}),f=this.backoffDelay(u,y)}else{let y=await this.buildHttpError(m,A,d.waitFor);return this.surfaceBatchFailure(r,s,a,y)}else{let y;try{y=await d.waitFor(this.parseResponse(m))}catch(v){if(g.aborted)throw v;return this.surfaceBatchFailure(r,s,a,new Error(`Capture V1 returned an unparseable ${A} response body`))}let I=this.classify(a,y,s);if(I.length===0)return this.surfacePartialDrops(r,s);if(l)return void this.onError(new kft({requestId:r,drops:s,retryExhausted:I.map(v=>v.uuid)}));a=I;let x=this.parseRetryAfter(m);f=this.backoffDelay(u,x)}}catch(m){if(d&&!d.signal.aborted)throw m;if(l)return this.surfaceBatchFailure(r,s,a,m);f=this.backoffDelay(u)}finally{d?.cleanup()}f!==void 0&&await this.sleep(f)}}async sendOnce(t,r,n,i){let o=this.buildHeaders(n,i),s=r;if(this.config.compressionEnabled){let p=await this.compress(r,this.config.isDebug);p!==null&&(s=p,o["Content-Encoding"]="gzip")}let a=new AbortController,c="waiting for response headers",u,l=new Promise((p,d)=>{u=zN(()=>{let f=new Error(`Capture V1 request timed out ${c} after ${this.config.requestTimeoutMs}ms`);f.name="AbortError",d(f),a.abort(f)},this.config.requestTimeoutMs)});try{let p=this.fetchFn(t,{method:"POST",headers:o,body:s,signal:a.signal}),d=!1;p.then(y=>{a.signal.aborted&&!d&&this.cancelBody(y)}).catch(()=>{});let f=await Promise.race([p,l]);d=!0,c="while reading the response body";let m=!1,g,A=()=>g??=this.cancelBody(f);return{response:f,signal:a.signal,waitFor:y=>Promise.race([y,l]),cancelBody:A,cleanup:()=>{m||(m=!0,clearTimeout(u),a.signal.aborted&&A())}}}catch(p){throw clearTimeout(u),p}}buildHeaders(t,r){let n=`${this.config.libraryId}/${this.config.libraryVersion}`,i={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`,"PostHog-Sdk-Info":n,"PostHog-Attempt":String(t),"PostHog-Request-Id":r,"PostHog-Request-Timestamp":new Date(this.now()).toISOString()};return this.config.userAgent&&(i["User-Agent"]=this.config.userAgent),i}classify(t,r,n){let i=r.results??{},o=[];for(let s of t){let a=i[s.uuid];a&&(a.result==="drop"?n.push({uuid:s.uuid,details:a.details??void 0}):a.result==="retry"&&o.push(s))}return o}backoffDelay(t,r){let n=Math.min(this.config.initialRetryDelayMs*2**(t-1),this.maxBackoffMs);return r===void 0?n:Math.max(n,Math.min(r,this.maxBackoffMs))}parseRetryAfter(t){let r=t.headers?.get("Retry-After");if(!r)return;let n=r.trim();if(/^\d+$/.test(n)){let s=parseInt(n,10);return Number.isFinite(s)&&s>0?1e3*s:void 0}let i=Date.parse(n);if(Number.isNaN(i))return;let o=i-this.now();return o>0?o:void 0}async parseResponse(t){let r=await t.text(),n=JSON.parse(r);if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("unexpected response shape");let i=n.results;if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new Error("unexpected results shape");return{results:i??{}}}async buildHttpError(t,r,n){let i="";try{i=(await n(t.text())).slice(0,512)}catch{}let o=i?`: ${i}`:"";return new Error(`Capture V1 request failed with HTTP ${r}${o}`)}surfaceBatchFailure(t,r,n,i){this.onError(new kft({requestId:t,drops:r,retryExhausted:n.map(o=>o.uuid),cause:i}))}surfacePartialDrops(t,r){r.length>0&&this.onError(new kft({requestId:t,drops:r,retryExhausted:[]}))}async cancelBody(t){try{await t.body?.cancel()}catch{}}};var C5e="ai-capture",Zin="/i/v0/ai/batch/";var Llh=new TextEncoder;function uZo(e){return Llh.encode(p1e(e)).length}function Wsl(e,t=8388608,r=5242880){let n=[],i=[],o=[],s=0;for(let a of e){if(a===void 0)continue;let c=uZo(a);if(c>t){i.push({event:typeof a.event=="string"?a.event:"unknown",bytes:c});continue}o.length>0&&s+c>r&&(n.push(o),o=[],s=0),o.push(a),s+=c}return o.length>0&&n.push(o),{batches:n,dropped:i}}var _lh=100,Hsl=3e4,Ulh=5e4,Vlh=50,Glh=500,qlh="https://us.i.posthog.com",Ksl=new Set;function eon(e,t){Ksl.has(e)||(Ksl.add(e),console.warn(`[PostHog] ${t}`))}function Wlh(e){return typeof e=="string"?e.trim():""}function Hlh(e){return(typeof e=="string"?e.trim():"")||void 0}function Klh(e){return(typeof e=="string"?e.trim():"")||qlh}function Jlh(e){return(Array.isArray(e)?e:[e]).filter(r=>typeof r=="string"&&r.trim().length>0)}function Ylh(e){if(!e)return{};let t={};for(let[n,i]of Object.entries(e))t[`$feature/${n}`]=i;let r=Object.keys(e).filter(n=>e[n]!==!1).sort();return r.length>0&&(t.$active_feature_flags=r),t}var ton=class extends rKt{constructor(t,r={}){let n=Wlh(t),i={...r,maxQueueSize:r.maxQueueSize??1e4,flushInterval:r.flushInterval??5e3,host:Klh(r.host),personalApiKey:Hlh(r.secretKey??r.personalApiKey)};if(super(n,i),this._memoryStorage=new Yin,this._aiCaptureRouteActive=!1,this._minimalFlagCalledEvents=!1,this.options=i,this.captureMode=Usl(),this.enableFullAiCapture=i.enableFullAiCapture===!0,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof i.featureFlagsPollingInterval=="number"?Math.max(i.featureFlagsPollingInterval,_lh):i.featureFlagsPollingInterval===null?null:Hsl,typeof i.waitUntilDebounceMs=="number"&&(this.options.waitUntilDebounceMs=Math.max(i.waitUntilDebounceMs,0)),typeof i.waitUntilMaxWaitMs=="number"&&(this.options.waitUntilMaxWaitMs=Math.max(i.waitUntilMaxWaitMs,0)),!this.disabled&&i.personalApiKey){if(i.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');i.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new Jin({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:i.personalApiKey,projectApiKey:n,timeout:i.requestTimeout??1e4,host:this.host,fetch:i.fetch,onError:s=>{this._events.emit("error",s)},onLoad:s=>{this._events.emit("localEvaluationFlagsLoaded",s)},onMinimalFlagCalledEvents:s=>{this._minimalFlagCalledEvents=s},customHeaders:this.getCustomHeaders(),cacheProvider:i.flagDefinitionCacheProvider,strictLocalEvaluation:i.strictLocalEvaluation,evaluationContexts:i.evaluationContexts??i.evaluationEnvironments}))}this.errorTracking=new v5e(this,i,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=i.maxCacheSize||Ulh}enqueue(t,r,n,i){super.enqueue(t,r,n,i),this.scheduleDebouncedFlush()}_flushEventsAndSpans(t=!1){let r=this.flushWithPendingPromises();return!this._traces||t&&this._traces.throttled?r:qHt([r,this._traces.flush().catch(()=>{})]).then(([n])=>{if(n.status==="rejected")throw n.reason})}flushAutomatic(){return this._flushKeepingRuntimeAlive(!0)}async flush(){return this._flushKeepingRuntimeAlive(!1)}_flushKeepingRuntimeAlive(t){let r=this._flushEventsAndSpans(t),n=this.options.waitUntil;if(n&&!this._waitUntilCycle)try{n(r.catch(()=>{}))}catch{}return r}scheduleDebouncedFlush(){let t=this.options.waitUntil;if(!t||this.disabled||this.optedOut)return;if(!this._waitUntilCycle){let s,a=new Promise(c=>{s=c});try{t(a)}catch{return}this._waitUntilCycle={resolve:s,startedAt:Date.now(),timer:void 0}}let r=Date.now()-this._waitUntilCycle.startedAt,n=this.options.waitUntilMaxWaitMs??Glh,i=r>=n;if(this._waitUntilCycle.timer!==void 0&&clearTimeout(this._waitUntilCycle.timer),i)return void this.resolveWaitUntilFlush();let o=this.options.waitUntilDebounceMs??Vlh;this._waitUntilCycle.timer=zN(()=>{this.resolveWaitUntilFlush()},o)}_consumeWaitUntilCycle(){let t=this._waitUntilCycle;return t&&(clearTimeout(t.timer),this._waitUntilCycle=void 0),t?.resolve}async resolveWaitUntilFlush(){let t=this._consumeWaitUntilCycle();try{await this._flushEventsAndSpans()}catch{}finally{t?.()}}getPersistedProperty(t){return this._memoryStorage.getProperty(t)}setPersistedProperty(t,r){return this._memoryStorage.setProperty(t,r)}fetch(t,r){return this.options.fetch?this.options.fetch(t,r):fetch(t,r)}getQueueRouteKey(t){return this.captureMode==="v1"&&Vsl(t)?"ai":yKt}persistedQueueKeyForRoute(t){return t===C5e?OM.AiCaptureQueue:t==="ai"?OM.AiQueue:OM.Queue}getActiveQueueRoutes(){let t=this.captureMode==="v1"?[yKt,"ai"]:[yKt];return this._aiCaptureRouteActive&&t.push(C5e),t}getBatchEndpointPath(t){return t===C5e?Zin:super.getBatchEndpointPath(t)}async sendBatch(t,r,n=yKt){if(n===C5e)return this.sendAiCaptureBatch(t,r);if(this.captureMode!=="v1"||n==="ai")return super.sendBatch(t,r,n);let i=t.filter(o=>o!==void 0);await this.getV1Sender().sendV1Batch(i)}async sendAiCaptureBatch(t,r){let{batches:n,dropped:i}=Wsl(t);for(let{event:o,bytes:s}of i){let a=`Event ${o} (${s} bytes) exceeds the ${8388608/1048576}MiB limit for ${Zin}, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a))}for(let o of n)await this.sendAiSubBatch(o,r)}async sendAiSubBatch(t,r){try{await super.sendBatch(t,r,C5e)}catch(n){if(!Oft(n))throw n;if(t.length===1){let[o]=t,a=`Event ${typeof o.event=="string"?o.event:"unknown"} (${uZo(o)} bytes) was rejected with 413 by ${Zin} on its own, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a));return}let i=Math.ceil(t.length/2);await this.sendAiSubBatch(t.slice(0,i),r),await this.sendAiSubBatch(t.slice(i),r)}}getV1Sender(){return this._v1Sender||(this._v1Sender=new Xin({host:this.host,apiKey:this.apiKey,libraryId:this.getLibraryId(),libraryVersion:this.getLibraryVersion(),userAgent:this.getCustomUserAgent()||void 0,historicalMigration:this.historicalMigration,compressionEnabled:!this.disableCompression,requestTimeoutMs:this.requestTimeout,maxAttempts:(this.options.fetchRetryCount??3)+1,initialRetryDelayMs:this.options.fetchRetryDelay??3e3,isDebug:this.isDebug},{fetch:(t,r)=>this.fetch(t,r),onError:t=>this._events.emit("error",t),compress:t=>this.compressPayload(t)})),this._v1Sender}getLibraryVersion(){return Dsl}get metrics(){return this._metrics||(this._metrics=new pKt(this,jin(this.options.metrics),this._logger)),this._metrics}initializeSpanContextManager(){return new gKt}hostResourceAttributes(){return{}}get _spanContextManager(){return this._spanContext||(this._spanContext=this.initializeSpanContextManager()),this._spanContext}get _tracesPipeline(){if(this.options.traces)return this._traces||(this._traces=new hKt(this,tZo(this.options.traces,this.hostResourceAttributes(),this._logger),this._logger,()=>this._tracingContext(),this._spanContextManager,()=>this.scheduleDebouncedFlush())),this._traces}_tracingContext(){let t=this.context?.get();return{distinctId:t?.distinctId,sessionId:t?.sessionId}}startSpan(t,r){return this._tracesPipeline?.startSpan(t,r)??m1e(r,this._spanContextManager.active())}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this._tracesPipeline;return s?i?s.withSpan(t,i,o):s.withSpan(t,o):mKt(this._spanContextManager,m1e(i,this._spanContextManager.active()),o)}getActiveSpan(){return this._spanContextManager.active()??null}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}getEvaluationRuntime(){return"server"}getCommonEventProperties(){let t=super.getCommonEventProperties();return(this.options.isServer??!0)&&(t.$is_server=!0),t}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}_warnIfInvalidCapture(t,r,n){typeof t=="string"&&this._logger.warn(r),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn(n)}_sendPreparedEvent(t,r,n,i,o){return this.addPendingPromise(this._prepareEventMessage(r,i).then(({distinctId:s,event:a,properties:c,options:u})=>{let l={timestamp:u.timestamp,disableGeoip:u.disableGeoip,uuid:u.uuid},p={distinctId:s,event:a,properties:{...c,...this.getCommonEventProperties()}};return n?this.sendImmediate(t,p,l,o):this.enqueue(t,p,l,o)}).catch(s=>{s&&console.error(s)}))}_capturePreparedEvent(t,r){return this._sendPreparedEvent("capture",t,r)}capture(t){this._warnIfInvalidCapture(t,"Called capture() with a string as the first argument when an object was expected.","Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this._capturePreparedEvent(t,!1)}async captureImmediate(t){return this._warnIfInvalidCapture(t,"Called captureImmediate() with a string as the first argument when an object was expected.","Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default."),this._capturePreparedEvent(t,!0)}captureAi(t){if(this.disabled)return;let r=y5e(t.uuid,jN);return this._sendPreparedAiEvent({...t,uuid:r},!1),r}async captureAiImmediate(t){if(this.disabled)return;let r=y5e(t.uuid,jN);return await this._sendPreparedAiEvent({...t,uuid:r},!0),r}_sendPreparedAiEvent(t,r){return typeof t?.event=="string"&&!t.event.startsWith("$ai_")&&this._logger.debug(`captureAi called with non-AI event ${t.event}; routing it to the AI endpoint anyway.`),this._aiCaptureRouteActive=!0,this._sendPreparedEvent("capture",t,r,void 0,C5e)}identify({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,l={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:l,disableGeoip:n},!1,{includeContextProperties:!1})}async identifyImmediate({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,l={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};await this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:l,disableGeoip:n},!0,{includeContextProperties:!1})}setPersonProperties({distinctId:t,properties:r={},propertiesOnce:n={}}){if(Object.keys(r).length===0&&Object.keys(n).length===0)return;let i={};Object.keys(r).length>0&&(i.$set=r),Object.keys(n).length>0&&(i.$set_once=n),this.capture({distinctId:t,event:"$set",properties:i})}unsetPersonProperties({distinctId:t,properties:r}){let n=Jlh(r);n.length!==0&&this.capture({distinctId:t,event:"$set",properties:{$unset:n}})}alias(t){this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!1,{includeContextProperties:!1})}async aliasImmediate(t){await this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!0,{includeContextProperties:!1})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}getFeatureFlagEvaluationRuntime(t){return this.featureFlagsPoller?.getEvaluationRuntimeForFlag(t)}getFeatureFlagKeysByEvaluationRuntime(t){return this.featureFlagsPoller?.getFlagKeysByEvaluationRuntime(t)??[]}async waitForLocalEvaluationReady(t=Hsl){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let n=setTimeout(()=>{i(),r(!1)},t),i=this._events.on("localEvaluationFlagsLoaded",o=>{clearTimeout(n),i(),r(o>0)})})}_resolveDistinctId(t,r){return typeof t=="string"?{distinctId:t,options:r}:{distinctId:this.context?.get()?.distinctId,options:t}}async _getFeatureFlagResult(t,r,n={},i){if(this.disabled)return void this._logger.warn("The client is disabled");let o=n.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&t in this._flagOverrides){let R=this._flagOverrides[t];if(R===void 0)return;let D=this._payloadOverrides?.[t];return{key:t,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:D}}let{groups:s,disableGeoip:a}=n,{onlyEvaluateLocally:c,personProperties:u,groupProperties:l}=n,p=this.addLocalPersonAndGroupProperties(r,s,u,l);u=p.allPersonProperties,l=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(r,s,this.personPropertiesForLocalEvaluation(r,u),l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f,m=!1,g,A,y,I,x,v,S;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let R=this.featureFlagsPoller?.featureFlagsByKey[t];if(R)try{let D=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(R,d,{matchValue:i});if(D){m=!0;let O=D.value;I=R.id,v="Evaluated locally",S=R.has_experiment,f={key:t,enabled:O!==!1,variant:typeof O=="string"?O:void 0,payload:D.payload??void 0,reason:v,reasonCode:R.active===!1?"flag_disabled":void 0}}}catch(D){if(D instanceof gne||D instanceof Zu)this._logger?.info(`${D.name} when computing flag locally: ${t}: ${D.message}`);else throw D}}if(!m&&!c){let R=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,u,l,a,[t]);if(R===void 0)y=qhe.UNKNOWN_ERROR;else{this._minimalFlagCalledEvents=R.minimalFlagCalledEvents===!0,g=R.requestId,A=R.evaluatedAt;let D=[];R.errorsWhileComputingFlags&&D.push(qhe.ERRORS_WHILE_COMPUTING),R.quotaLimited?.includes("feature_flags")&&D.push(qhe.QUOTA_LIMITED);let O=R.flags[t];if(O===void 0)D.push(qhe.FLAG_MISSING);else{I=O.metadata?.id,x=O.metadata?.version,v=O.reason?.description??O.reason?.code,S=O.metadata?.has_experiment;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}f={key:t,enabled:O.enabled,variant:O.variant??void 0,payload:z,reason:v,reasonCode:O.reason?.code}}D.length>0&&(y=D.join(","))}}if(o){let R=f===void 0?void 0:f.enabled===!1?!1:f.variant??!0,D={$feature_flag:t,$feature_flag_response:R,$feature_flag_id:I,$feature_flag_version:x,$feature_flag_reason:v,locally_evaluated:m,[`$feature/${t}`]:R,$feature_flag_request_id:g,$feature_flag_evaluated_at:m?Date.now():A};if(S!==void 0&&(D.$feature_flag_has_experiment=S),m&&this.featureFlagsPoller){let O=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();O!==void 0&&(D.$feature_flag_definitions_loaded_at=O)}y&&(D.$feature_flag_error=y),this._captureFlagCalledEventIfNeeded({distinctId:r,key:t,response:R,groups:s,disableGeoip:a,properties:D})}return f!==void 0&&this._payloadOverrides!==void 0&&t in this._payloadOverrides&&(f={...f,payload:this._payloadOverrides[t]}),f}async getFeatureFlag(t,r,n){eon("getFeatureFlag","`getFeatureFlag` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlag(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});if(i!==void 0)return i.enabled===!1?!1:i.variant??!0}async getFeatureFlagPayload(t,r,n,i){if(eon("getFeatureFlagPayload","`getFeatureFlagPayload` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlagPayload(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request."),this._payloadOverrides!==void 0&&t in this._payloadOverrides)return this._payloadOverrides[t];let o=await this._getFeatureFlagResult(t,r,{...i,sendFeatureFlagEvents:!1},n);if(o!==void 0)return o.payload??null}async getFeatureFlagResult(t,r,n){let{distinctId:i,options:o}=this._resolveDistinctId(r,n);return i?this._getFeatureFlagResult(t,i,{...o,sendFeatureFlagEvents:o?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0}):void this._logger.warn("[PostHog] distinctId is required \u2014 pass it explicitly or use withContext()")}async getRemoteConfigPayload(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(!this.options.personalApiKey)throw new Error("Personal API key is required for remote config payload decryption");let r=await this._requestRemoteConfigPayload(t);if(!r)return;let n=await r.json();if(typeof n=="string")try{return JSON.parse(n)}catch{}return n}async isFeatureEnabled(t,r,n){eon("isFeatureEnabled","`isFeatureEnabled` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.isEnabled(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});return i===void 0?void 0:i.enabled===!1?!1:!!(i.variant??!0)||!1}async getAllFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);return n?(await this.getAllFlagsAndPayloads(n,i)).featureFlags||{}:(this._logger.warn("[PostHog] distinctId is required to get feature flags \u2014 pass it explicitly or use withContext()"),{})}async getAllFlagsAndPayloads(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to get feature flags and payloads \u2014 pass it explicitly or use withContext()"),{featureFlags:{},featureFlagPayloads:{}};if(this.disabled)return this._logger.warn("The client is disabled"),{featureFlags:{},featureFlagPayloads:{}};let{groups:o,disableGeoip:s,flagKeys:a}=i||{},{onlyEvaluateLocally:c,personProperties:u,groupProperties:l}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,u,l);u=p.allPersonProperties,l=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,u),l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),m={},g={},A=!0;if(f&&(m=f.response,g=f.payloads,A=f.fallbackToFlags),A&&!c){let y=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,u,l,s,a);m={...m,...y.flags||{}},g={...g,...y.payloads||{}}}return this._flagOverrides!==void 0&&(m={...m,...this._flagOverrides}),this._payloadOverrides!==void 0&&(g={...g,...this._payloadOverrides}),{featureFlags:m,featureFlagPayloads:g}}async evaluateFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to evaluate feature flags \u2014 pass it explicitly or use withContext()"),new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:"",flags:{}});if(this.disabled)return this._logger.warn("The client is disabled"),new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,flags:{}});let{groups:o,disableGeoip:s}=i||{},a=i?.flagKeys??void 0;if(a?.length===0)return new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:{}});let{onlyEvaluateLocally:c,personProperties:u,groupProperties:l}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,u,l);u=p.allPersonProperties,l=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,u),l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=a?new Set(a):void 0,m={},g,A,y=!1,I=!1,x=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),v=new Set;if(x)for(let[R,D]of Object.entries(x.response)){let O=this.featureFlagsPoller?.featureFlagsByKey[R];m[R]={key:R,enabled:D!==!1,variant:typeof D=="string"?D:void 0,payload:x.payloads[R],id:O?.id,version:void 0,reason:"Evaluated locally",locallyEvaluated:!0,hasExperiment:O?.has_experiment},v.add(R)}let S=f!==void 0&&Array.from(f).some(R=>this.featureFlagsPoller?.featureFlagsByKey[R]===void 0);if((x?x.fallbackToFlags||S:!0)&&!c){let R=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,u,l,s,a);if(R){this._minimalFlagCalledEvents=R.minimalFlagCalledEvents===!0,g=R.requestId,A=R.evaluatedAt,y=!!R.errorsWhileComputingFlags,I=Array.isArray(R.quotaLimited)&&R.quotaLimited.includes("feature_flags");for(let[D,O]of Object.entries(R.flags)){if(v.has(D))continue;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}m[D]={key:D,enabled:O.enabled,variant:O.variant,payload:z,id:O.metadata?.id,version:O.metadata?.version,reason:O.reason?.description??O.reason?.code,locallyEvaluated:!1,hasExperiment:O.metadata?.has_experiment}}}}if(this._flagOverrides!==void 0)for(let[R,D]of Object.entries(this._flagOverrides)){if(D===void 0){delete m[R];continue}let O=m[R];m[R]={key:R,enabled:D!==!1,variant:typeof D=="string"?D:void 0,payload:O?.payload,id:O?.id,version:O?.version,reason:O?.reason,locallyEvaluated:O?.locallyEvaluated??!1,hasExperiment:O?.hasExperiment}}if(this._payloadOverrides!==void 0)for(let[R,D]of Object.entries(this._payloadOverrides)){let O=m[R];O&&(m[R]={...O,payload:D})}if(f!==void 0)for(let R of Object.keys(m))f.has(R)||delete m[R];return new g1e({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:m,requestId:g,evaluatedAt:A,flagDefinitionsLoadedAt:this.featureFlagsPoller?.getFlagDefinitionsLoadedAt(),errorsWhileComputing:y,quotaLimited:I})}_shouldSendMinimalFlagCalledEvent(t,r){return t==="$feature_flag_called"&&this._minimalFlagCalledEvents&&r.$feature_flag_has_experiment===!1}_captureFlagCalledEventIfNeeded(t){let{distinctId:r,key:n,response:i,groups:o,disableGeoip:s,properties:a}=t,c=o&&Object.keys(o).length>0?`_${JSON.stringify(Object.entries(o).sort(([l],[p])=>l<p?-1:l>p?1:0))}`:"",u=`${n}_${i}${c}`;r in this.distinctIdHasSentFlagCalls&&this.distinctIdHasSentFlagCalls[r].has(u)||(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),this.distinctIdHasSentFlagCalls[r]instanceof Set?this.distinctIdHasSentFlagCalls[r].add(u):this.distinctIdHasSentFlagCalls[r]=new Set([u]),this.capture({distinctId:r,event:"$feature_flag_called",properties:a,groups:o,disableGeoip:s}))}_getFeatureFlagEvaluationsHost(){return this._featureFlagEvaluationsHost||(this._featureFlagEvaluationsHost={captureFlagCalledEventIfNeeded:t=>this._captureFlagCalledEventIfNeeded(t),logWarning:t=>{this.options.featureFlagsLogWarnings!==!1&&console.warn(`[PostHog] ${t}`)}}),this._featureFlagEvaluationsHost}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!1,{includeContextProperties:!1})}async groupIdentifyImmediate({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){await this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!0,{includeContextProperties:!1})}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}overrideFeatureFlags(t){let r=n=>Object.fromEntries(n.map(i=>[i,!0]));if(t===!1){this._flagOverrides=void 0,this._payloadOverrides=void 0;return}if(Array.isArray(t)){this._flagOverrides=r(t);return}if(this._isFeatureFlagOverrideOptions(t)){"flags"in t&&(t.flags===!1?this._flagOverrides=void 0:Array.isArray(t.flags)?this._flagOverrides=r(t.flags):t.flags!==void 0&&(this._flagOverrides={...t.flags})),"payloads"in t&&(t.payloads===!1?this._payloadOverrides=void 0:t.payloads!==void 0&&(this._payloadOverrides={...t.payloads}));return}this._flagOverrides={...t}}_isFeatureFlagOverrideOptions(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let r=t;if("flags"in r){let n=r.flags;if(n===!1||Array.isArray(n)||typeof n=="object"&&n!==null)return!0}if("payloads"in r){let n=r.payloads;if(n===!1||typeof n=="object"&&n!==null)return!0}return!1}withContext(t,r,n){return this.context?this.context.run(t,r,n):r()}getContext(){return this.context?.get()}enterContext(t,r){this.context?.enter(t,r)}async _shutdown(t){let r=Date.now()+(t??3e4),n=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown(),this._metrics&&(await d1e(this._metrics.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._metrics.reset()),this._traces&&(await d1e(this._traces.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._traces.reset());try{return await super._shutdown(Math.max(0,r-Date.now()))}finally{this.distinctIdHasSentFlagCalls={},n?.()}}async _requestRemoteConfigPayload(t){if(this.disabled||!this.apiKey||!this.options.personalApiKey)return;let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config?token=${encodeURIComponent(this.apiKey)}`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},i=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let o=new AbortController;i=zN(()=>{o.abort()},this.options.requestTimeout),n.signal=o.signal}try{return await this.fetch(r,n)}catch(o){this._events.emit("error",o);return}finally{i&&clearTimeout(i)}}extractPropertiesFromEvent(t,r){if(!t)return{personProperties:{},groupProperties:{}};let n={},i={};for(let[o,s]of Object.entries(t))if(Jil(s)&&r&&o in r){let a={};for(let[c,u]of Object.entries(s))a[String(c)]=String(u);i[String(o)]=a}else n[String(o)]=String(s);return{personProperties:n,groupProperties:i}}async getFeatureFlagsForEvent(t,r,n,i){if(this.disabled||!this.apiKey)return void this._logger.warn("The client is disabled");let o=i?.personProperties||{},s=i?.groupProperties||{},a=i?.flagKeys;if(i?.onlyEvaluateLocally??this.options.strictLocalEvaluation??!1)if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let u={};for(let[l,p]of Object.entries(r||{}))u[l]=String(p);return await this.getAllFlags(t,{groups:u,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}else return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let u={};for(let[l,p]of Object.entries(r||{}))u[l]=String(p);return await this.getAllFlags(t,{groups:u,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}return(await super.getFeatureFlagsStateless(t,r,o,s,n)).flags}addLocalPersonAndGroupProperties(t,r,n,i){let o={...n||{}},s={};if(r)for(let a of Object.keys(r))s[a]={$group_key:r[a],...i?.[a]||{}};return{allPersonProperties:o,allGroupProperties:s}}personPropertiesForLocalEvaluation(t,r){return{distinct_id:t,...r||{}}}createFeatureFlagEvaluationContext(t,r,n,i){return{distinctId:t,groups:r||{},personProperties:n||{},groupProperties:i||{},evaluationCache:{}}}captureException(t,r,n,i,o){if(!v5e.isPreviouslyCapturedError(t)){let s=new Error("PostHog syntheticException");this.addPendingPromise(v5e.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:s},r,n).then(a=>this._capturePreparedEvent({...a,uuid:i,flags:o},!1)))}}async captureExceptionImmediate(t,r,n,i){if(!v5e.isPreviouslyCapturedError(t)){let o=new Error("PostHog syntheticException");return this.addPendingPromise(v5e.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:o},r,n).then(s=>this.captureImmediate({...s,flags:i})))}}async prepareEventMessage(t){return this._prepareEventMessage(t)}async _prepareEventMessage(t,r={}){let{distinctId:n,event:i,properties:o,groups:s,flags:a,sendFeatureFlags:c,timestamp:u,disableGeoip:l,uuid:p}=t,d=this.context?.get(),f=r.includeContextProperties??!0,m=n||d?.distinctId,g=f?{...this.props,...d?.properties||{},...o||{}}:{...o||{}};m||(m=jN(),g.$process_person_profile=!1),f&&d?.sessionId&&!g.$session_id&&(g.$session_id=d.sessionId);let A=this._shouldSendMinimalFlagCalledEvent(i,g)?$Ht(g):g,y=this._runBeforeSend({distinctId:m,event:i,properties:A,groups:s,flags:a,sendFeatureFlags:c,timestamp:u,disableGeoip:l,uuid:p});if(!y)return Promise.reject(null);let I=await Promise.resolve().then(async()=>{if(a)return c&&console.warn("[PostHog] Both `flags` and `sendFeatureFlags` were passed to capture(); using `flags` and ignoring `sendFeatureFlags`."),a._getEventProperties();if(c){eon("sendFeatureFlags","`sendFeatureFlags` is deprecated and will be removed in a future major version. Pass a `flags` snapshot from `posthog.evaluateFlags(...)` instead \u2014 it avoids a second `/flags` request per capture and guarantees the event carries the exact flag values your code branched on.");let x=typeof c=="object"?c:void 0,v=await this.getFeatureFlagsForEvent(y.distinctId,s,l,x);return Ylh(v)}return{}}).catch(()=>({})).then(x=>{let v=y.groups||s;return{...x,...y.properties||{},...v!==void 0&&Object.keys(v).length>0?{$groups:v}:{}}});return y.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof I.$raw_user_agent=="string"&&Xil(I.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(y.event="$bot_pageview",I.$browser_type="bot"),{distinctId:y.distinctId,event:y.event,properties:I,options:{timestamp:y.timestamp,disableGeoip:y.disableGeoip,uuid:y.uuid}}}_runBeforeSend(t){let r=this.options.before_send;if(!r)return t;let n=Array.isArray(r)?r:[r],i=t;for(let o of n)try{if(i=o(i),!i)return this._logger.info(`Event '${t.event}' was rejected in beforeSend function`),null;if(!i.properties||Object.keys(i.properties).length===0){let s=`Event '${i.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(s)}}catch(s){return this._logger.error(`Error in before_send function for event '${t.event}':`,s),null}return i}};var Jsl=require("async_hooks"),ron=class{constructor(){this.storage=new Jsl.AsyncLocalStorage}get(){return this.storage.getStore()}run(t,r,n){return this.storage.run(this.resolve(t,n),r)}enter(t,r){this.storage.enterWith(this.resolve(t,r))}resolve(t,r){if(r?.fresh===!0)return t;let n=this.get()||{};return{distinctId:t.distinctId??n.distinctId,sessionId:t.sessionId??n.sessionId,properties:{...n.properties||{},...t.properties||{}}}}};var Ysl=require("async_hooks"),non=class{active(){return this._storage.getStore()}with(t,r){return this._storage.run(t,r)}constructor(){this._storage=new Ysl.AsyncLocalStorage}};var Xsl=require("zlib"),Zsl=require("util"),Xlh=(0,Zsl.promisify)(Xsl.gzip);async function $sl(e,t=!0){try{let r=await Xlh(e);return new Uint8Array(r)}catch(r){return t&&console.error("Failed to gzip compress data",r),null}}var ion=require("os");function eal(){let e,t;try{e=(0,ion.platform)(),t=(0,ion.release)()}catch{}return GXo(e,t)}var tal="posthog-node";function Zlh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}={}){return s=>{if(!(i==="*"||i.includes(s.level)))return s;s.tags||(s.tags={});let c=s.tags[lZo.POSTHOG_ID_TAG];if(c===void 0)return s;let u=e.options.host??"https://us.i.posthog.com",l=new URL(`/project/${e.apiKey}/person/${c}`,u).toString();s.tags["PostHog Person URL"]=l;let p=s.exception?.values||[],d=p.map(g=>({...g,stacktrace:g.stacktrace?{...g.stacktrace,type:"raw",frames:(g.stacktrace.frames||[]).map(A=>({...A,platform:"node:javascript"}))}:void 0})),f={$exception_message:p[0]?.value||s.message,$exception_type:p[0]?.type,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:p[0]?.value||s.message,$sentry_exception_type:p[0]?.type,$sentry_tags:s.tags},m=nO.getInjectedReleaseId();return m&&(f.$release_id=m),t&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+s.event_id),o&&e.capture({event:"$exception",distinctId:c,properties:f}),s}}var lZo=class{static{this.POSTHOG_ID_TAG="posthog_distinct_id"}constructor(t,r,n,i,o){this.name=tal,this.name=tal,this.setupOnce=function(s,a){let c=a()?.getClient()?.getDsn()?.projectId;s(Zlh(t,{organization:r,projectId:c,prefix:n,severityAllowList:i,sendExceptionsToPostHog:o??!0}))}}};var Ane=class extends ton{getLibraryId(){return"posthog-node"}compressPayload(t){return $sl(t,this.isDebug)}initializeContext(){return new ron}initializeSpanContextManager(){return new non}hostResourceAttributes(){return eal()}createErrorPropertiesBuilder(){return new nO.ErrorPropertiesBuilder([new nO.EventCoercer,new nO.ErrorCoercer,new nO.ObjectCoercer,new nO.StringCoercer,new nO.PrimitiveCoercer],nO.createStackParser("node:javascript",nO.nodeStackLineParser),[Gil(),t=>Tsl(t,void 0,this._logger),Rsl()])}};function ral(e){return e==null||!e.enabled?!1:e.variant==null||e.variant==="true"}var oon=class{isEnabled(){return Promise.resolve(!1)}getCachedValue(){}flush(){return Promise.resolve()}},$lh="feature_flag_evaluated",eph=3e3,tph=3e3,son=class{evaluator;environment;sendFeatureFlagEvents;pending=new Map;resolved=new Map;constructor({environment:t,sendFeatureFlagEvents:r,posthogApiKey:n,evaluator:i}){this.environment=t,this.sendFeatureFlagEvents=r,this.evaluator=i??new Ane(n??"",{featureFlagsRequestTimeoutMs:eph,isServer:!1})}isEnabled(t,r){let n=nal(t,r),i=this.pending.get(n);if(i!=null)return i;let o=this.evaluateAndRemember(t,r,n);return this.pending.set(n,o),o}async evaluateAndRemember(t,r,n){let i=await this.evaluate(t,r);return this.resolved.set(n,i),i}getCachedValue(t,r){return this.resolved.get(nal(t,r))}async flush(){if(!this.sendFeatureFlagEvents)return;let t;try{await Promise.race([this.flushAfterPendingEvaluations(),new Promise(r=>{t=setTimeout(r,tph),t.unref()})])}catch{}finally{clearTimeout(t)}}async flushAfterPendingEvaluations(){await Promise.allSettled(this.pending.values()),await this.evaluator.flush()}async evaluate(t,r){let{org:n}=r,i=nph(r,this.environment),o;try{o=await this.evaluator.getFeatureFlagResult(t,pZo(n),{personProperties:i,groups:{organization:n},groupProperties:{organization:i},sendFeatureFlagEvents:!1})}catch{return!1}return this.sendFeatureFlagEvents&&this.captureFlagUsage({flag:t,org:n,result:o,properties:i}),ral(o)}captureFlagUsage({flag:t,org:r,result:n,properties:i}){let o=rph(n),s={...i,...n?.reason!=null?{$feature_flag_reason:n.reason}:{},version:"5.170.8"};this.tryCapture({distinctId:pZo(r),event:"$feature_flag_called",groups:{organization:r},properties:{...s,$feature_flag:t,$feature_flag_response:o,[`$feature/${t}`]:o}}),this.tryCapture({distinctId:pZo(r),event:$lh,groups:{organization:r},properties:{...s,flag:t,response:o,enabled:ral(n)}})}tryCapture(t){try{this.evaluator.capture(t)}catch{}}};function rph(e){if(e!=null)return e.enabled?e.variant??!0:!1}function pZo(e){return`org:${e}`}function nph({org:e,generator:t,language:r},n){return{org:e,environment:n,...t!=null?{generator:t}:{},...r!=null?{language:r}:{}}}function nal(e,{org:t,generator:r,language:n}){return JSON.stringify([e,t,r??null,n??null])}var aon;function con(){return aon==null&&(aon=iph()),aon}async function fZo(){await aon?.flush()}function iph(){let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";return e==null||e.trim().length===0?new oon:new son({posthogApiKey:e,environment:zJ(),sendFeatureFlagEvents:lin()})}var uon=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Ane(t,{isServer:!1})}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"5.170.8",usingAccessToken:!0,cliReleaseEnvironment:zJ(),...Ope()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:zJ()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}};var bKt=class{async sendEvent(){}async sendAutomationEvent(){}async identify(){}async flush(){}};kd();er();var Fft=require("fs/promises"),ial=require("os"),oal=require("path");sVe();var oph="id",sph=".fern",EKt=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new Ane(r,{isServer:!1}),this.userId=t==null?void 0:nWo(t),this.token=t}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){let r=await this.getUserEmail();this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"5.170.8",...t,...t.properties,usingAccessToken:!1,cliReleaseEnvironment:zJ(),agent:lHr(),...r!=null?{userEmail:r}:{},...Ope()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:zJ()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}userEmail;async getUserEmail(){if(this.userEmail!==null){if(this.userEmail!=null)return this.userEmail;if(this.token==null){this.userEmail=null;return}try{let t=await Kf({token:this.token.value}).user.getMyself();if(t.ok&&t.body.email!=null)return this.userEmail=t.body.email,this.userEmail}catch{}this.userEmail=null}}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Ww(),r=ke(_t.of((0,ial.homedir)()),ye.of(sph),ye.of(oph));try{await Ut(r)?this.persistedDistinctId=(await(0,Fft.readFile)(r)).toString():(await(0,Fft.mkdir)((0,oal.dirname)(r),{recursive:!0}),await(0,Fft.writeFile)(r,t),this.persistedDistinctId=t)}catch{this.persistedDistinctId=t}}return this.persistedDistinctId}};var dZo;async function IKt(){return dZo==null&&(dZo=await aph()),dZo}async function aph(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";if(e==null||!lin())return new bKt;let t=await qlt();return t!=null?new EKt({token:t,posthogApiKey:e}):await EM()!=null?new uon({posthogApiKey:e}):new EKt({token:void 0,posthogApiKey:e})}catch{return new bKt}}Pn();Ct();kt();A8();var vKt=Ae(require("process"),1);cZe();var cal=Ae(k3o(),1),ual=Ae(aal(),1);function iO(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=dH(e),e.length===0))return 0;e=e.replace((0,ual.default)()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let o=i.codePointAt(0);if(o<=31||o>=127&&o<=159||o>=768&&o<=879)continue;switch(cal.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}Pn();function lon(e){let t=0;for(let r of e.split(`
3469
3469
  `))t=Math.max(t,iO(r));return t}var Pal=Ae(hZo(),1);var uph=/[\p{Lu}]/u,lph=/[\p{Ll}]/u,fal=/^[\p{Lu}](?![\p{Lu}])/gu,hal=/([\p{Alpha}\p{N}_]|$)/u,gZo=/[_.\- ]+/,pph=new RegExp("^"+gZo.source),dal=new RegExp(gZo.source+hal.source,"gu"),mal=new RegExp("\\d+"+hal.source,"gu"),fph=(e,t,r,n)=>{let i=!1,o=!1,s=!1,a=!1;for(let c=0;c<e.length;c++){let u=e[c];a=c>2?e[c-3]==="-":!0,i&&uph.test(u)?(e=e.slice(0,c)+"-"+e.slice(c),i=!1,s=o,o=!0,c++):o&&s&&lph.test(u)&&(!a||n)?(e=e.slice(0,c-1)+"-"+e.slice(c-1),s=o,o=!1,i=!0):(i=t(u)===u&&r(u)!==u,s=o,o=r(u)===u&&t(u)!==u)}return e},dph=(e,t)=>(fal.lastIndex=0,e.replace(fal,r=>t(r))),mph=(e,t)=>(dal.lastIndex=0,mal.lastIndex=0,e.replace(dal,(r,n)=>t(n)).replace(mal,r=>t(r)));function AZo(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(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";let r=t.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(t.locale),n=t.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(t.locale);return e.length===1?gZo.test(e)?"":t.pascalCase?n(e):r(e):(e!==r(e)&&(e=fph(e,r,n,t.preserveConsecutiveUppercase)),e=e.replace(pph,""),e=t.preserveConsecutiveUppercase?dph(e,r):r(e),t.pascalCase&&(e=n(e.charAt(0))+e.slice(1)),mph(e,n))}var IZo=Ae(Aal(),1);cZe();var yal=(e=0)=>t=>`\x1B[${t+e}m`,bal=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Eal=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,vE={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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},DYv=Object.keys(vE.modifier),yph=Object.keys(vE.color),bph=Object.keys(vE.bgColor),kYv=[...yph,...bph];function Eph(){let e=new Map;for(let[t,r]of Object.entries(vE)){for(let[n,i]of Object.entries(r))vE[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=vE[n],e.set(i[0],i[1]);Object.defineProperty(vE,t,{value:r,enumerable:!1})}return Object.defineProperty(vE,"codes",{value:e,enumerable:!1}),vE.color.close="\x1B[39m",vE.bgColor.close="\x1B[49m",vE.color.ansi=yal(),vE.color.ansi256=bal(),vE.color.ansi16m=Eal(),vE.bgColor.ansi=yal(10),vE.bgColor.ansi256=bal(10),vE.bgColor.ansi16m=Eal(10),Object.defineProperties(vE,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>vE.rgbToAnsi256(...vE.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>vE.ansi256ToAnsi(vE.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>vE.ansi256ToAnsi(vE.hexToAnsi256(t)),enumerable:!1}}),vE}var Iph=Eph(),Ial=Iph;var pon=new Set(["\x1B","\x9B"]),vph=39,bZo="\x07",xal="[",Cph="]",Sal="m",EZo=`${Cph}8;;`,val=e=>`${pon.values().next().value}${xal}${e}${Sal}`,Cal=e=>`${pon.values().next().value}${EZo}${e}${bZo}`,xph=e=>e.split(" ").map(t=>iO(t)),yZo=(e,t,r)=>{let n=[...t],i=!1,o=!1,s=iO(dH(e[e.length-1]));for(let[a,c]of n.entries()){let u=iO(c);if(s+u<=r?e[e.length-1]+=c:(e.push(c),s=0),pon.has(c)&&(i=!0,o=n.slice(a+1).join("").startsWith(EZo)),i){o?c===bZo&&(i=!1,o=!1):c===Sal&&(i=!1);continue}s+=u,s===r&&a<n.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Sph=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(iO(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},wph=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,o,s=xph(e),a=[""];for(let[u,l]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=iO(a[a.length-1]);if(u!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&s[u]>t){let d=t-p,f=1+Math.floor((s[u]-d-1)/t);Math.floor((s[u]-1)/t)<f&&a.push(""),yZo(a,l,t);continue}if(p+s[u]>t&&p>0&&s[u]>0){if(r.wordWrap===!1&&p<t){yZo(a,l,t);continue}a.push("")}if(p+s[u]>t&&r.wordWrap===!1){yZo(a,l,t);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(u=>Sph(u)));let c=[...a.join(`
3470
3470
  `)];for(let[u,l]of c.entries()){if(n+=l,pon.has(l)){let{groups:d}=new RegExp(`(?:\\${xal}(?<code>\\d+)m|\\${EZo}(?<uri>.*)${bZo})`).exec(c.slice(u).join(""))||{groups:{}};if(d.code!==void 0){let f=Number.parseFloat(d.code);i=f===vph?void 0:f}else d.uri!==void 0&&(o=d.uri.length===0?void 0:d.uri)}let p=Ial.codes.get(Number(i));c[u+1]===`
3471
3471
  `?(o&&(n+=Cal("")),i&&p&&(n+=val(p))):l===`
@@ -4125,7 +4125,7 @@ ${$e.stack}`),!1}};await D();let O=S.apiWorkspaces.flatMap(Be=>Be.getAbsoluteFil
4125
4125
  `)},ue=[],Pe,Ie=!1;z.on("all",(Be,_e)=>{n.logger.info(de.dim(`[${Be}] ${_e}`)),!Ie&&(ue.push(_t.of(_e)),Pe!=null&&clearTimeout(Pe),Pe=setTimeout(()=>{(async()=>{Ie=!0;try{let $e=R.getFilesToReload(ue);await D($e)&&await ce()}finally{ue.length=0,Ie=!1}})()},g8g))}),n.logger.info(`Docs preview server (Astro) ready on http://localhost:${i}${g}`),await me}async function I8g({bundlePath:e,forceDownload:t,cacheDir:r,context:n}){if(e!=null)return n.logger.info(`Using Astro bundle from path: ${e}`),await MEp(_t.of(e));if(t){let a=e2e({astro:!0,cacheDir:r});await Ut(a)&&(n.logger.info("Force download requested. Deleting cached Astro bundle..."),await(0,TSi.rm)(a,{recursive:!0}))}let i="https://prod-local-preview-astro-bundle.s3.amazonaws.com/";if(i==null)throw new T({message:"Failed to connect to the docs preview server. Please contact support@buildwithfern.com",code:T.Code.InternalError});let o=JGe({astro:!0,cacheDir:r});if((await G$t({bucketUrl:i,logger:n.logger,preferCached:!0,astro:!0,tryTar:!0,cacheDir:r})).type==="failure")if(await Ut(o))n.logger.warn("Falling back to cached Astro bundle...");else throw new T({message:"Failed to download the Astro docs preview bundle. Please reach out to support@buildwithfern.com.",code:T.Code.NetworkError});return await MEp(o)}async function MEp(e){let t=ke(e,ye.of(y8g)),r=b8g;if(await Ut(t)){let i=JSON.parse(await(0,TSi.readFile)(t,"utf-8"));typeof i.entry=="string"&&(r=i.entry)}let n=ke(e,ye.of(r));if(!await Ut(n))throw new T({message:`${e} does not contain the Astro preview server (missing ${r}).`,code:T.Code.UserError});return{root:e,entry:n}}var v8g="_fern-files";function C8g({rendererPort:e,rendererHost:t,mirrorPort:r,basepath:n,reloadClients:i}){let o=`${n}/${v8g}/`;return oNs.default.createServer((s,a)=>{if(s.url===_Ep){a.writeHead(200,{"content-type":"text/event-stream","cache-control":"no-store",connection:"keep-alive"}),a.write(`: connected
4126
4126
 
4127
4127
  `),i.add(a),s.on("close",()=>i.delete(a));return}let c=s.url!=null&&s.url.startsWith(o),u=oNs.default.request(c?{host:"127.0.0.1",port:r,method:s.method,path:`/files/${s.url?.slice(o.length)??""}`,headers:s.headers}:{host:"127.0.0.1",port:e,method:s.method,path:s.url,headers:{...s.headers,[LEp]:t}},l=>{let p={...l.headers};if(!((p["content-type"]??"").includes("text/html")&&p["content-encoding"]==null)){a.writeHead(l.statusCode??502,p),l.pipe(a);return}let f=[];l.on("data",m=>f.push(m)),l.on("end",()=>{let m=Buffer.concat(f).toString("utf-8"),g=m.lastIndexOf("</body>"),A=g>=0?`${m.slice(0,g)}${QEp}${m.slice(g)}`:`${m}${QEp}`,y=Buffer.from(A,"utf-8");delete p["transfer-encoding"],p["content-length"]=y.byteLength.toString(),a.writeHead(l.statusCode??502,p),a.end(y)}),l.on("error",()=>a.destroy())});u.on("error",l=>{a.headersSent||a.writeHead(502,{"content-type":"text/plain"}),a.end(`Astro preview server unavailable: ${l.message}
4128
- `)}),s.pipe(u)})}function x8g(){return new Promise((e,t)=>{let r=sNs.default.createServer();r.once("error",t),r.listen(0,"127.0.0.1",()=>{let n=r.address(),i=typeof n=="object"&&n!=null?n.port:void 0;r.close(()=>i!=null?e(i):t(new Error("could not allocate a port")))})})}function S8g(e,t,r){let n=Date.now()+r;return new Promise((i,o)=>{let s=!1;t.on("exit",c=>{s=!0,o(new Error(`Astro preview server exited with code ${c} before becoming ready`))});let a=()=>{if(s)return;if(Date.now()>n){o(new Error("timed out waiting for the Astro preview server to become ready"));return}let c=sNs.default.connect(e,"127.0.0.1");c.once("connect",()=>{c.destroy(),i()}),c.once("error",()=>{c.destroy(),setTimeout(a,200)})};a()})}kt();var GEp=/^[a-z0-9-]+-preview-[a-z0-9-]+\.docs\.buildwithfern\.com$/i,UEp="docs.buildwithfern.com",VEp=62;function yWe(e){let t=e.toLowerCase().trim();t.startsWith("https://")?t=t.slice(8):t.startsWith("http://")&&(t=t.slice(7));let r=t.indexOf("/");return r!==-1&&(t=t.slice(0,r)),GEp.test(t)}function qEp(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return t.length===0?"default":t}function pir({orgId:e,previewId:t}){let r=qEp(t),n=`${e}-preview-${r}.${UEp}`;if(n.length<=VEp)return n;let i=`${e}-preview-`,o=VEp-i.length;if(o<8)throw new T({message:`Organization name "${e}" is too long to generate a valid preview URL`,code:T.Code.ValidationError});let a=r.slice(0,o).replace(/-+$/,"");return`${i}${a}.${UEp}`}Ct();LI();Ah();er();m0();kt();Pn();var NNs=require("child_process"),ivp=Ae(HEp(),1),jNs=Ae(SSi(),1),zNs=Ae(require("fs"),1),MNs=require("fs/promises"),ovp=Ae(require("http"),1),svp=Ae(require("os"),1),VSi=Ae(require("path"),1);BNs();LI();er();var RNs=require("fs/promises");async function DNs(e,t){let r=new Map,{docsDefinition:n,translationPages:i,translationNavigationOverlays:o,translatedApiDefinitions:s,collectedFileIds:a,docsWorkspacePath:c,markdownFilesToPathName:u}=e,l=i!=null&&Object.keys(i).length>0,p=s!=null&&Object.keys(s).length>0;if(!l&&!p)return r;let d=n.config.translations?.defaultLocale,f=new Set([...Object.keys(i??{}),...Object.keys(s??{})]);for(let m of f){if(m===d)continue;let g=i?.[m]??{};try{let A=async pe=>{let oe=Io(c,pe),me=Yn(c,ye.of(`translations/${m}/${oe}`));return await Ut(me)?me:pe},y=async pe=>{let oe=await A(pe),me=await(0,RNs.readFile)(oe,"utf-8"),xe=me.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return xe!=null?me.slice(xe[0].length):me},I=async pe=>{let oe=await A(pe);return(0,RNs.readFile)(oe,"utf-8")},x={};for(let[pe,oe]of Object.entries(n.pages))oe!=null&&(x[pe]=oe);for(let[pe,oe]of Object.entries(g))try{let me=x[pe],xe=Yn(c,ye.of(pe)),{markdown:Re}=await IF({markdown:oe,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,markdownLoader:y}),ce=await c_({markdown:Re,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,fileLoader:I}),ue=u_({markdown:ce,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t}),Pe=JO(ue);Pe=n_(Pe,a,u,{absolutePathToMarkdownFile:xe,absolutePathToFernFolder:c},t),x[pe]={markdown:Pe,rawMarkdown:Pe,editThisPageUrl:me?.editThisPageUrl,editThisPageLaunch:me?.editThisPageLaunch}}catch(me){t.logger.warn(`Failed to process translated page "${pe}" for locale "${m}": ${String(me)}. Falling back to base page.`)}let v=uGe(n.config.root,g,t),S=o?.[m],B=n.config.announcement,R=n.config.navbarLinks;S!=null&&(v=pGe(v,S),B=fGe(S)??B,S.navbarLinks!=null&&(R=S.navbarLinks));let D=n.apis,O=s?.[m],z=O,Y;if(O!=null&&v!=null){let pe=aGe(v,D,O);pe.size>0&&(t.logger.warn(`Translated API definition(s) [${Array.from(pe).join(", ")}] for locale "${m}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`),z=Object.fromEntries(Object.entries(O).filter(([oe])=>!pe.has(oe)))),Y=new Set(Object.keys(O).filter(oe=>!pe.has(oe)))}let ee=z!=null&&Object.keys(z).length>0?{...n.apis,...z}:n.apis;O!=null&&Object.keys(O).length>0&&v!=null&&(v=cGe(v,D,O,{rewritableApiIds:Y}));let ae={...n,apis:ee,pages:x,config:{...n.config,root:v,announcement:B,navbarLinks:R}};r.set(m,ae),t.logger.debug(`Computed translated definition for locale "${m}"`+(O!=null?` (with ${Object.keys(O).length} translated API(s))`:""))}catch(A){t.logger.warn(`Failed to compute translation for locale "${m}": ${String(A)}`)}}return r}er();var KW=require("fs/promises"),ZIp=require("os"),FNs=Ae(require("path"),1),ZGg=".fern",$Gg="logs",kNs=100*1024*1024;function eqg(){return"cli@5.170.7"}var xWe=class{logFilePath=null;initialized=!1;sessionStartTime;consoleLogger;constructor(){this.sessionStartTime=Date.now()}async initialize(t,r){if(this.initialized)return;this.consoleLogger=t;let n=r??ke(ke(_t.of((0,ZIp.homedir)()),ye.of(ZGg)),ye.of($Gg));await Ut(n)||await(0,KW.mkdir)(n,{recursive:!0});let o=`${new Date().toISOString().replace(/[:.]/g,"-")}.debug.log`;this.logFilePath=ke(n,ye.of(o));let s=["================================================================================","Fern Docs Dev Debug Log",`Session started: ${new Date().toISOString()}`,`Log file: ${FNs.default.basename(this.logFilePath)}`,"================================================================================",""].join(`
4128
+ `)}),s.pipe(u)})}function x8g(){return new Promise((e,t)=>{let r=sNs.default.createServer();r.once("error",t),r.listen(0,"127.0.0.1",()=>{let n=r.address(),i=typeof n=="object"&&n!=null?n.port:void 0;r.close(()=>i!=null?e(i):t(new Error("could not allocate a port")))})})}function S8g(e,t,r){let n=Date.now()+r;return new Promise((i,o)=>{let s=!1;t.on("exit",c=>{s=!0,o(new Error(`Astro preview server exited with code ${c} before becoming ready`))});let a=()=>{if(s)return;if(Date.now()>n){o(new Error("timed out waiting for the Astro preview server to become ready"));return}let c=sNs.default.connect(e,"127.0.0.1");c.once("connect",()=>{c.destroy(),i()}),c.once("error",()=>{c.destroy(),setTimeout(a,200)})};a()})}kt();var GEp=/^[a-z0-9-]+-preview-[a-z0-9-]+\.docs\.buildwithfern\.com$/i,UEp="docs.buildwithfern.com",VEp=62;function yWe(e){let t=e.toLowerCase().trim();t.startsWith("https://")?t=t.slice(8):t.startsWith("http://")&&(t=t.slice(7));let r=t.indexOf("/");return r!==-1&&(t=t.slice(0,r)),GEp.test(t)}function qEp(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return t.length===0?"default":t}function pir({orgId:e,previewId:t}){let r=qEp(t),n=`${e}-preview-${r}.${UEp}`;if(n.length<=VEp)return n;let i=`${e}-preview-`,o=VEp-i.length;if(o<8)throw new T({message:`Organization name "${e}" is too long to generate a valid preview URL`,code:T.Code.ValidationError});let a=r.slice(0,o).replace(/-+$/,"");return`${i}${a}.${UEp}`}Ct();LI();Ah();er();m0();kt();Pn();var NNs=require("child_process"),ivp=Ae(HEp(),1),jNs=Ae(SSi(),1),zNs=Ae(require("fs"),1),MNs=require("fs/promises"),ovp=Ae(require("http"),1),svp=Ae(require("os"),1),VSi=Ae(require("path"),1);BNs();LI();er();var RNs=require("fs/promises");async function DNs(e,t){let r=new Map,{docsDefinition:n,translationPages:i,translationNavigationOverlays:o,translatedApiDefinitions:s,collectedFileIds:a,docsWorkspacePath:c,markdownFilesToPathName:u}=e,l=i!=null&&Object.keys(i).length>0,p=s!=null&&Object.keys(s).length>0;if(!l&&!p)return r;let d=n.config.translations?.defaultLocale,f=new Set([...Object.keys(i??{}),...Object.keys(s??{})]);for(let m of f){if(m===d)continue;let g=i?.[m]??{};try{let A=async pe=>{let oe=Io(c,pe),me=Yn(c,ye.of(`translations/${m}/${oe}`));return await Ut(me)?me:pe},y=async pe=>{let oe=await A(pe),me=await(0,RNs.readFile)(oe,"utf-8"),xe=me.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return xe!=null?me.slice(xe[0].length):me},I=async pe=>{let oe=await A(pe);return(0,RNs.readFile)(oe,"utf-8")},x={};for(let[pe,oe]of Object.entries(n.pages))oe!=null&&(x[pe]=oe);for(let[pe,oe]of Object.entries(g))try{let me=x[pe],xe=Yn(c,ye.of(pe)),{markdown:Re}=await IF({markdown:oe,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,markdownLoader:y}),ce=await c_({markdown:Re,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,fileLoader:I}),ue=u_({markdown:ce,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t}),Pe=JO(ue);Pe=n_(Pe,a,u,{absolutePathToMarkdownFile:xe,absolutePathToFernFolder:c},t),x[pe]={markdown:Pe,rawMarkdown:Pe,editThisPageUrl:me?.editThisPageUrl,editThisPageLaunch:me?.editThisPageLaunch}}catch(me){t.logger.warn(`Failed to process translated page "${pe}" for locale "${m}": ${String(me)}. Falling back to base page.`)}let v=uGe(n.config.root,g,t),S=o?.[m],B=n.config.announcement,R=n.config.navbarLinks;S!=null&&(v=pGe(v,S),B=fGe(S)??B,S.navbarLinks!=null&&(R=S.navbarLinks));let D=n.apis,O=s?.[m],z=O,Y;if(O!=null&&v!=null){let pe=aGe(v,D,O);pe.size>0&&(t.logger.warn(`Translated API definition(s) [${Array.from(pe).join(", ")}] for locale "${m}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`),z=Object.fromEntries(Object.entries(O).filter(([oe])=>!pe.has(oe)))),Y=new Set(Object.keys(O).filter(oe=>!pe.has(oe)))}let ee=z!=null&&Object.keys(z).length>0?{...n.apis,...z}:n.apis;O!=null&&Object.keys(O).length>0&&v!=null&&(v=cGe(v,D,O,{rewritableApiIds:Y}));let ae={...n,apis:ee,pages:x,config:{...n.config,root:v,announcement:B,navbarLinks:R}};r.set(m,ae),t.logger.debug(`Computed translated definition for locale "${m}"`+(O!=null?` (with ${Object.keys(O).length} translated API(s))`:""))}catch(A){t.logger.warn(`Failed to compute translation for locale "${m}": ${String(A)}`)}}return r}er();var KW=require("fs/promises"),ZIp=require("os"),FNs=Ae(require("path"),1),ZGg=".fern",$Gg="logs",kNs=100*1024*1024;function eqg(){return"cli@5.170.8"}var xWe=class{logFilePath=null;initialized=!1;sessionStartTime;consoleLogger;constructor(){this.sessionStartTime=Date.now()}async initialize(t,r){if(this.initialized)return;this.consoleLogger=t;let n=r??ke(ke(_t.of((0,ZIp.homedir)()),ye.of(ZGg)),ye.of($Gg));await Ut(n)||await(0,KW.mkdir)(n,{recursive:!0});let o=`${new Date().toISOString().replace(/[:.]/g,"-")}.debug.log`;this.logFilePath=ke(n,ye.of(o));let s=["================================================================================","Fern Docs Dev Debug Log",`Session started: ${new Date().toISOString()}`,`Log file: ${FNs.default.basename(this.logFilePath)}`,"================================================================================",""].join(`
4129
4129
  `);await(0,KW.writeFile)(this.logFilePath,s,"utf-8"),this.initialized=!0,this.enforceLogSizeLimit(n)}getLogFilePath(){return this.logFilePath}async writeEntry(t){if(!this.initialized||!this.logFilePath)return;let r=JSON.stringify(t)+`
4130
4130
  `;try{await(0,KW.appendFile)(this.logFilePath,r,"utf-8")}catch{}}async logFrontendMetrics(t){let r={timestamp:t.timestamp,source:t.source,level:t.level,eventType:this.getEventType(t.payload,t.isAggregate),isAggregate:t.isAggregate,data:t.payload};await this.writeEntry(r)}async logCliMetric(t,r="info"){let n={timestamp:t.timestamp,source:eqg(),level:r,eventType:t.type,data:{durationMs:t.durationMs,metadata:t.metadata}};await this.writeEntry(n)}async logCliMemory(){let t=process.memoryUsage(),r={type:"cli_memory",timestamp:new Date().toISOString(),metadata:{heapUsed:t.heapUsed,heapTotal:t.heapTotal,external:t.external,rss:t.rss,heapUsedMB:Math.round(t.heapUsed/1024/1024*100)/100,heapTotalMB:Math.round(t.heapTotal/1024/1024*100)/100,rssMB:Math.round(t.rss/1024/1024*100)/100}};await this.logCliMetric(r)}async logCliReloadStart(){let t={type:"cli_reload_start",timestamp:new Date().toISOString()};await this.logCliMetric(t)}async logCliReloadFinish(t,r){let n={type:"cli_reload_finish",timestamp:new Date().toISOString(),durationMs:t,metadata:r};await this.logCliMetric(n)}async logCliDocsGeneration(t,r){let n={type:"cli_docs_generation",timestamp:new Date().toISOString(),durationMs:t,metadata:r};await this.logCliMetric(n)}async logCliValidation(t,r){let n={type:"cli_validation",timestamp:new Date().toISOString(),durationMs:t,metadata:{success:r}};await this.logCliMetric(n)}async enforceLogSizeLimit(t){try{let n=(await(0,KW.readdir)(t)).filter(c=>c.endsWith(".log")),i=[];for(let c of n){let u=FNs.default.join(t,c);try{let l=await(0,KW.stat)(u);i.push({name:c,fullPath:u,size:l.size,mtimeMs:l.mtimeMs})}catch{}}let o=i.reduce((c,u)=>c+u.size,0),s=Math.round(o/1024/1024*100)/100,a=kNs/1024/1024;if(o<=kNs){this.consoleLogger?.debug(`Log directory size ${s} MB does not exceed ${a} MB cap`);return}this.consoleLogger?.info(`Rotating logs: total size ${s} MB exceeds ${a} MB cap`),i.sort((c,u)=>c.mtimeMs-u.mtimeMs);for(let c of i){if(o<=kNs)break;if(!(this.logFilePath!=null&&c.fullPath===this.logFilePath))try{await(0,KW.unlink)(c.fullPath),o-=c.size}catch{}}}catch{}}getEventType(t,r){return r?"aggregate_summary":"type"in t&&typeof t.type=="string"?t.type:"unknown"}static isMetricsMessage(t){if(typeof t!="object"||t===null)return!1;let r=t;return r.type==="metrics"&&typeof r.timestamp=="string"&&typeof r.source=="string"}};var USi={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"};function $Ip(e){let t=tqg();if(t==null)return;let{port:r,debugLogger:n,getDocsLoadResponse:i,extractLocaleFromPath:o}=e,s=new Map;function a(u){let l=JSON.stringify(u),p=[];for(let[d]of s)try{d.send(l)}catch{p.push(d)}for(let d of p){let f=s.get(d);f&&(clearInterval(f.pingInterval),s.delete(d))}}let c=t.serve({port:r,async fetch(u,l){if(u.method==="OPTIONS")return new Response(null,{status:204,headers:USi});let p=new URL(u.url);if(u.headers.get("upgrade")?.toLowerCase()==="websocket"){l.upgrade(u,{data:{connectionId:`${Date.now()}`}});return}if(u.method==="POST"&&p.pathname==="/v2/registry/docs/load-with-url")try{let f=await u.json(),m=o?.(f?.url);return new Response(JSON.stringify(i(m)),{headers:{"Content-Type":"application/json",...USi}})}catch{return new Response(JSON.stringify(i()),{headers:{"Content-Type":"application/json",...USi}})}let d=/^\/_local\/(.*)/.exec(p.pathname);return u.method==="GET"&&d!=null?new Response(t.file(`/${d[1]}`),{headers:USi}):new Response("Not Found",{status:404})},websocket:{open(u){let{connectionId:l}=u.data,p=setInterval(()=>{let d=s.get(u);if(!d)return;let f=Date.now();if(f-d.lastPong>9e4){u.close();return}try{u.send(JSON.stringify({type:"ping",timestamp:f}))}catch{u.close()}},3e4);s.set(u,{pingInterval:p,lastPong:Date.now()});try{u.send(JSON.stringify({type:"connected",connectionId:l}))}catch{}},message(u,l){try{let p=JSON.parse(l.toString());if(p.type==="pong"){let d=s.get(u);d&&(d.lastPong=Date.now())}else xWe.isMetricsMessage(p)&&n.logFrontendMetrics(p)}catch{}},close(u){let l=s.get(u);l&&(clearInterval(l.pingInterval),s.delete(u))}}});return{sendData:a,stop:u=>c.stop(u)}}function tqg(){return globalThis.Bun}var evp=require("fs"),tvp=Ae(require("path"),1),rqg=`"use strict";
4131
4131
 
@@ -4446,7 +4446,7 @@ ${n}
4446
4446
 
4447
4447
  Add a 'docs:' section to your fern.yml to get started.`,code:T.Code.ConfigError});let i=n.docs.raw.libraries;if(i==null)throw new T({message:`No libraries configured in docs.yml.
4448
4448
 
4449
- Add a 'libraries' section to configure library documentation.`,code:T.Code.ConfigError});let o=await t.getTokenOrPrompt();await t.verifyOrgAccess({organization:n.org,token:o});let s=n.docs.absoluteFilePath??n.absoluteFilePath??t.cwd,a=_t.of(un(s)),c=new zd({context:t,logLevel:Xn.Info});await wsr({libraries:i,library:r.library,docsDirectoryPath:a,orgId:n.org,tokenValue:o.value,context:c,wrapStep:EP,docsConfig:n.docs.raw})}};function __s(e){let t=new L_s;li(e,"generate","[Beta] Generate MDX documentation from library source code. Requires 'libraries' config in docs.yml.",(r,n)=>t.handle(r,n),r=>r.option("library",{type:"string",description:"Name of a specific library defined in docs.yml to generate docs for"}))}function U_s(e){DA({cli:e,name:"md",subcommands:[__s,l_s]})}kt();function cRi(e,t,r,n,i,o){e.command(t,r,s=>{for(let a of o)a(s);return s.command("$0",!1,a=>{let c=a.version(!1);return i!=null?i(c):c},zsn(n)),s.version(!1).usage(r)})}Ct();LI();kt();Pn();Ct();kt();var uRi=class{context;task;project;docsWorkspace;ossWorkspaces;token;constructor({context:t,task:r,project:n,docsWorkspace:i,ossWorkspaces:o,token:s}){this.context=t,this.task=r,this.project=n,this.docsWorkspace=i,this.ossWorkspaces=o,this.token=s}async publish({instanceUrl:t,preview:r,previewId:n,skipUpload:i}){let o=new zd({context:this.context,task:this.task});try{let s=await Lnr({organization:this.project.config.organization,apiWorkspaces:this.project.apiWorkspaces,ossWorkspaces:this.ossWorkspaces,docsWorkspace:this.docsWorkspace,context:o,token:this.token,instanceUrl:t,preview:r,previewId:n,disableTemplates:void 0,skipUpload:i,cliVersion:"5.170.7",loginCommand:"fern auth login"});return o.getResult()===wf.Failure?{success:!1}:{success:!0,url:s}}catch(s){return{success:!1,error:xn(s)}}}};Ct();Pn();var QRt=class e{static MAX_DISPLAYED_LOGS_TTY=10;static URL_PATTERN=/https?:\/\/[^\s]+/;context;stream;tasks={};taskOrder=[];startTime;isRegistered=!1;constructor(t){this.context=t.context,this.stream=t.stream??process.stderr}addTask(t){let r={...t,status:t.status??"pending"};return this.tasks[t.id]=r,this.taskOrder.push(t.id),this}async start(t){return this.startTime=Date.now(),t!=null&&await this.context.ttyAwareLogger.takeOverTerminal(()=>{this.stream.write(`
4449
+ Add a 'libraries' section to configure library documentation.`,code:T.Code.ConfigError});let o=await t.getTokenOrPrompt();await t.verifyOrgAccess({organization:n.org,token:o});let s=n.docs.absoluteFilePath??n.absoluteFilePath??t.cwd,a=_t.of(un(s)),c=new zd({context:t,logLevel:Xn.Info});await wsr({libraries:i,library:r.library,docsDirectoryPath:a,orgId:n.org,tokenValue:o.value,context:c,wrapStep:EP,docsConfig:n.docs.raw})}};function __s(e){let t=new L_s;li(e,"generate","[Beta] Generate MDX documentation from library source code. Requires 'libraries' config in docs.yml.",(r,n)=>t.handle(r,n),r=>r.option("library",{type:"string",description:"Name of a specific library defined in docs.yml to generate docs for"}))}function U_s(e){DA({cli:e,name:"md",subcommands:[__s,l_s]})}kt();function cRi(e,t,r,n,i,o){e.command(t,r,s=>{for(let a of o)a(s);return s.command("$0",!1,a=>{let c=a.version(!1);return i!=null?i(c):c},zsn(n)),s.version(!1).usage(r)})}Ct();LI();kt();Pn();Ct();kt();var uRi=class{context;task;project;docsWorkspace;ossWorkspaces;token;constructor({context:t,task:r,project:n,docsWorkspace:i,ossWorkspaces:o,token:s}){this.context=t,this.task=r,this.project=n,this.docsWorkspace=i,this.ossWorkspaces=o,this.token=s}async publish({instanceUrl:t,preview:r,previewId:n,skipUpload:i}){let o=new zd({context:this.context,task:this.task});try{let s=await Lnr({organization:this.project.config.organization,apiWorkspaces:this.project.apiWorkspaces,ossWorkspaces:this.ossWorkspaces,docsWorkspace:this.docsWorkspace,context:o,token:this.token,instanceUrl:t,preview:r,previewId:n,disableTemplates:void 0,skipUpload:i,cliVersion:"5.170.8",loginCommand:"fern auth login"});return o.getResult()===wf.Failure?{success:!1}:{success:!0,url:s}}catch(s){return{success:!1,error:xn(s)}}}};Ct();Pn();var QRt=class e{static MAX_DISPLAYED_LOGS_TTY=10;static URL_PATTERN=/https?:\/\/[^\s]+/;context;stream;tasks={};taskOrder=[];startTime;isRegistered=!1;constructor(t){this.context=t.context,this.stream=t.stream??process.stderr}addTask(t){let r={...t,status:t.status??"pending"};return this.tasks[t.id]=r,this.taskOrder.push(t.id),this}async start(t){return this.startTime=Date.now(),t!=null&&await this.context.ttyAwareLogger.takeOverTerminal(()=>{this.stream.write(`
4450
4450
  `),this.stream.write(`${de.cyan("\u25C6")} ${de.bold(t.title)}
4451
4451
  `),t.subtitle!=null&&this.stream.write(` ${de.dim(t.subtitle)}
4452
4452
  `),this.stream.write(`
@@ -5140,7 +5140,7 @@ ${r}`}function VNi(e){let t=this,{emitParseErrors:r,...n}={...t.data("settings")
5140
5140
  `),g="";return c&&(g=l.style.error(c)),[`${p} ${f} ${s}`,[m,g].filter(Boolean).join(`
5141
5141
  `)]});var Gty=Px((e,t)=>{let{validate:r=()=>!0}=e,n=sv(e.theme),[i,o]=yu("idle"),[s,a]=yu(),[c,u]=yu(""),l=Tx({status:i,theme:n});Ox(async(g,A)=>{if(i==="idle")if(wx(g)){let y=c;o("loading");let I=await r(y);I===!0?(u(y),o("done"),t(y)):(A.write(c),a(I||"You must provide a valid value"),o("idle"))}else u(A.line),a(void 0)});let p=n.style.message(e.message,i),d="",f;e.mask?d=(typeof e.mask=="string"?e.mask:"*").repeat(c.length):i!=="done"&&(f=`${n.style.help("[input is masked]")}${NFt}`),i==="done"&&(d=n.style.answer(d));let m="";return s&&(m=n.style.error(s)),[[l,p,e.mask?d:f].join(" "),m]});var GKe=Ae(Jw(),1);var qty={icon:{cursor:bS.pointer},style:{disabled:e=>GKe.default.dim(`- ${e}`),searchTerm:e=>GKe.default.cyan(e),description:e=>GKe.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${GKe.default.bold(t)} ${GKe.default.dim(r)}`).join(GKe.default.dim(" \u2022 "))},helpMode:"always"};function Ira(e){return!qd.isSeparator(e)&&!e.disabled}function Wty(e){return e.map(t=>{if(qd.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var Hty=Px((e,t)=>{let{pageSize:r=7,validate:n=()=>!0}=e,i=sv(qty,e.theme),[o,s]=yu("loading"),[a,c]=yu(""),[u,l]=yu([]),[p,d]=yu(),f=Tx({status:o,theme:i}),m=q6(()=>{let z=u.findIndex(Ira),Y=u.findLastIndex(Ira);return{first:z,last:Y}},[u]),[g=m.first,A]=yu();hU(()=>{let z=new AbortController;return s("loading"),d(void 0),(async()=>{try{let $=await e.source(a||void 0,{signal:z.signal});z.signal.aborted||(A(void 0),d(void 0),l(Wty($)),s("idle"))}catch($){!z.signal.aborted&&$ instanceof Error&&d($.message)}})(),()=>{z.abort()}},[a]);let y=u[g];Ox(async(z,Y)=>{if(wx(z))if(y){s("loading");let $=await n(y.value);s("idle"),$===!0?(s("done"),t(y.value)):y.name===a?d($||"You must provide a valid value"):(Y.write(y.name),c(y.name))}else Y.write(a);else if(Ybe(z)&&y)Y.clearLine(0),Y.write(y.name),c(y.name);else if(o!=="loading"&&(QR(z)||G6(z))){if(Y.clearLine(0),QR(z)&&g!==m.first||G6(z)&&g!==m.last){let $=QR(z)?-1:1,ee=g;do ee=(ee+$+u.length)%u.length;while(!Ira(u[ee]));A(ee)}}else c(Y.line)});let I=i.style.message(e.message,o),x;if(i.helpMode!=="never")if(e.instructions){let{pager:z,navigation:Y}=e.instructions;x=i.style.help(u.length>r?z:Y)}else x=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let v=LKe({items:u,active:g,renderItem({item:z,isActive:Y}){if(qd.isSeparator(z))return` ${z.separator}`;if(z.disabled){let ae=typeof z.disabled=="string"?z.disabled:"(disabled)";return i.style.disabled(`${z.name} ${ae}`)}let $=Y?i.style.highlight:ae=>ae,ee=Y?i.icon.cursor:" ";return $(`${ee} ${z.name}`)},pageSize:r,loop:!1}),S;p?S=i.style.error(p):u.length===0&&a!==""&&o==="idle"&&(S=i.style.error("No results found"));let B;if(o==="done"&&y)return[f,I,i.style.answer(y.short)].filter(Boolean).join(" ").trimEnd();B=i.style.searchTerm(a);let R=y?.description,D=[f,I,B].filter(Boolean).join(" ").trimEnd(),O=[S??v," ",R?i.style.description(R):"",x].filter(Boolean).join(`
5142
5142
  `).trimEnd();return[D,O]});var zFt=Ae(Jw(),1);var Kty={icon:{cursor:bS.pointer},style:{disabled:e=>zFt.default.dim(`- ${e}`),description:e=>zFt.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${zFt.default.bold(t)} ${zFt.default.dim(r)}`).join(zFt.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function jFt(e){return!qd.isSeparator(e)&&!e.disabled}function Jty(e){return e.map(t=>{if(qd.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var vra=Px((e,t)=>{let{loop:r=!0,pageSize:n=7}=e,i=sv(Kty,e.theme),{keybindings:o}=i,[s,a]=yu("idle"),c=Tx({status:s,theme:i}),u=MKe(),l=!o.includes("vim"),p=q6(()=>Jty(e.choices),[e.choices]),d=q6(()=>{let R=p.findIndex(jFt),D=p.findLastIndex(jFt);if(R===-1)throw new Gle("[select prompt] No selectable choices. All choices are disabled.");return{first:R,last:D}},[p]),f=q6(()=>"default"in e?p.findIndex(R=>jFt(R)&&R.value===e.default):-1,[e.default,p]),[m,g]=yu(f===-1?d.first:f),A=p[m];Ox((R,D)=>{if(clearTimeout(u.current),wx(R))a("done"),t(A.value);else if(QR(R,o)||G6(R,o)){if(D.clearLine(0),r||QR(R,o)&&m!==d.first||G6(R,o)&&m!==d.last){let O=QR(R,o)?-1:1,z=m;do z=(z+O+p.length)%p.length;while(!jFt(p[z]));g(z)}}else if(Bur(R)&&!Number.isNaN(Number(D.line))){let O=Number(D.line)-1,z=-1,Y=p.findIndex(ee=>qd.isSeparator(ee)?!1:(z++,z===O)),$=p[Y];$!=null&&jFt($)&&g(Y),u.current=setTimeout(()=>{D.clearLine(0)},700)}else if(jKe(R))D.clearLine(0);else if(l){let O=D.line.toLowerCase(),z=p.findIndex(Y=>qd.isSeparator(Y)||!jFt(Y)?!1:Y.name.toLowerCase().startsWith(O));z!==-1&&g(z),u.current=setTimeout(()=>{D.clearLine(0)},700)}}),hU(()=>()=>{clearTimeout(u.current)},[]);let y=i.style.message(e.message,s),I;if(i.helpMode!=="never")if(e.instructions){let{pager:R,navigation:D}=e.instructions;I=i.style.help(p.length>n?R:D)}else I=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let x=0,v=LKe({items:p,active:m,renderItem({item:R,isActive:D,index:O}){if(qd.isSeparator(R))return x++,` ${R.separator}`;let z=i.indexMode==="number"?`${O+1-x}. `:"";if(R.disabled){let ee=typeof R.disabled=="string"?R.disabled:"(disabled)";return i.style.disabled(`${z}${R.name} ${ee}`)}let Y=D?i.style.highlight:ee=>ee,$=D?i.icon.cursor:" ";return Y(`${$} ${z}${R.name}`)},pageSize:n,loop:r});if(s==="done")return[c,y,i.style.answer(A.short)].filter(Boolean).join(" ");let{description:S}=A;return`${[[c,y].filter(Boolean).join(" "),v," ",S?i.style.description(S):"",I].filter(Boolean).join(`
5143
- `).trimEnd()}${NFt}`});Pn();Vi();var qle={GENERATION_STARTED:"generation_started",GENERATION_COMPLETED:"generation_completed",GENERATION_FAILED:"generation_failed",VERIFICATION_FAILED:"verification_failed",SDK_PR_CREATED:"sdk_pr_created",UPGRADE_APPLIED:"upgrade_applied",MAJOR_VERSION_BUMP:"major_version_bump"},Yty={[qle.GENERATION_STARTED]:!1,[qle.GENERATION_COMPLETED]:!1,[qle.GENERATION_FAILED]:!0,[qle.VERIFICATION_FAILED]:!0,[qle.SDK_PR_CREATED]:!1,[qle.UPGRADE_APPLIED]:!1,[qle.MAJOR_VERSION_BUMP]:!1};function C7p(e){return Yty[e]}function x7p(e,t){return{automation_mode:!0,surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function S7p(e,t){function r(i,o,s){s!=null&&(i[o]=s)}let n={surface:"cli",automation_mode:"true"};return r(n,"event",e.event),r(n,"action",t.action),r(n,"run_id",t.run_id),r(n,"org",t.org),r(n,"config_repo",t.config_repo),r(n,"trigger",t.trigger),r(n,"error_code",e.errorCode??"none"),n}function w7p(e,t){return{github_run_id:t.github_run_id,github_run_url:t.github_run_url,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,cli_version:t.cli_version,...e.attributes??{}}}function T7p(e,t){return{event:e.event,timestamp:new Date().toISOString(),surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function O7p(e){let t=e.join(" ");return/\bautomations\s+generate\b/.test(t)?qle.GENERATION_FAILED:/\bautomations\s+preview\b/.test(t)?qle.VERIFICATION_FAILED:qle.GENERATION_FAILED}var Xty="",Zty="FERN_AUTOMATION_EVENTS_ORIGIN",$ty=3e3,Sji=class e{static instance;origin;inflight=[];static getInstance(){return e.instance==null&&(e.instance=new e(process.env[Zty]??Xty)),e.instance}constructor(t){this.origin=t}resolveEndpoint(){if(this.origin.length!==0)return`${this.origin.replace(/\/$/,"")}/v1/automation/events`}post(t,r){this.inflight.push(this.send(t,r))}async shutdown(){let t=this.inflight;this.inflight=[],t.length>0&&await Promise.allSettled(t)}async send(t,r){let n=this.resolveEndpoint();if(n==null)return;let i=new AbortController,o=setTimeout(()=>i.abort(),$ty);try{let s={"content-type":"application/json"},a=await EM();a!=null&&a.value.length>0&&(s.Authorization=`Bearer ${a.value}`);let c=await fetch(n,{method:"POST",headers:s,body:JSON.stringify(T7p(t,r)),signal:i.signal})}catch{return}finally{clearTimeout(o)}}};function P7p(){let{fern_run_id:e,github_run_id:t}=Ope();return{action:process.env.FERN_ACTION,run_id:e,github_run_id:t,github_run_url:process.env.FERN_GITHUB_RUN_URL,org:void 0,config_repo:process.env.FERN_CONFIG_REPO,config_commit_sha:process.env.FERN_CONFIG_COMMIT_SHA,config_branch:process.env.FERN_CONFIG_BRANCH,config_pr_number:process.env.FERN_CONFIG_PR_NUMBER,trigger:process.env.GITHUB_EVENT_NAME,cli_version:"5.170.7"}}function B7p(){return process.env.FERN_AUTOMATION==="true"}var ery=3e3,wji=class{constructor(t,r=Sji.getInstance()){this.reporter=t;this.automationEventApiClient=r;this.context=P7p()}reporter;automationEventApiClient;context;setOrganization(t){this.context={...this.context,org:t}}emit(t,r){let n=this.captureSentryForFailure({event:t,context:this.context,error:r?.error}),i=n==null?t:{...t,attributes:{...t.attributes??{},sentry_event_id:n}};this.capturePostHogEvent({event:i,context:this.context}),this.captureAutomationEventApiEvent(i,this.context)}async flush(){let t;try{await Promise.race([this.automationEventApiClient.shutdown(),new Promise(r=>{t=setTimeout(r,ery)})])}finally{clearTimeout(t)}}capturePostHogEvent({event:t,context:r}){this.reporter.instrumentPostHogAutomationEvent({distinctId:r.run_id??void 0,event:t.event,properties:x7p(t,r)})}captureSentryForFailure({event:t,context:r,error:n}){if(!(!C7p(t.event)||t.errorCode==null))return this.reporter.captureException(n,{tags:S7p(t,r),context:{automation:w7p(t,r)}})}captureAutomationEventApiEvent(t,r){this.automationEventApiClient.post(t,r)}};kt();function Tji(e,t,r){if(t instanceof hc)return;let n=jMe(t,r?.code),i=r?.argv??process.argv,o=i.join(" "),s=r?.message??(t instanceof Error?t.message:void 0)??"",a=t??new T({message:s,code:n});B7p()?nry(i,e,n,s,a):rry(e,o,n,a)}function rry(e,t,r,n){e.instrumentPostHogEvent({command:t,properties:{failed:!0,errorCode:r}}),dQt(r)&&e.captureException(n,{tags:{"error.code":r}})}function nry(e,t,r,n,i){let o=O7p(e);t.emitAutomationTelemetryEvent({event:o,errorCode:r,attributes:{error_message:n}},{error:i})}kt();function qKe(){return process.env.FERN_DISABLE_TELEMETRY==="true"}function Oji({cliName:e,packageVersion:t,isLocal:r}){return qKe()||r?!1:!(t==="0.0.0")&&(e==="fern"&&!0)}var Pji=class{sentry;constructor({release:t,telemetry:r}){let n="https://84f58b5e457f06999d92f11ce4b79158@o4509504076185600.ingest.us.sentry.io/4511021546602496";if(Oji(r)&&n!=null&&n.length>0){let i="production";if(i==null||i.length===0)throw new T({message:"SENTRY_ENVIRONMENT must be set when SENTRY_DSN is configured",code:T.Code.ConfigError});this.sentry=oQt({dsn:n,release:t,environment:i,defaultIntegrations:!1,integrations:[VYe(),iEe(),oEe(),U0e(),nEe()],tracesSampleRate:0,attachStacktrace:!0,sendClientReports:!1}),sQt()}}captureException(t,r){if(this.sentry!=null)try{let n=r?.tags,i=r?.context,o=n!=null&&Object.keys(n).length>0,s=i!=null&&Object.values(i).some(a=>a!=null);return!o&&!s?this.sentry.captureException(t):_P(a=>{if(o&&a.setTags(n),i!=null)for(let[c,u]of Object.entries(i))u!=null&&a.setContext(c,u);return this.sentry?.captureException(t,void 0,a)})}catch{return}}async flush(){this.sentry!=null&&await Promise.resolve(this.sentry.flush(2e3)).catch(()=>{})}};kt();var Bji=class{originalWrite;redirected=!1;redirect(){if(this.redirected)throw new T({message:"StdoutRedirector: already redirected \u2014 did you forget to restore()?",code:T.Code.InternalError});this.originalWrite=process.stdout.write,process.stdout.write=process.stderr.write.bind(process.stderr),this.redirected=!0}restore(){!this.redirected||this.originalWrite==null||(process.stdout.write=this.originalWrite,this.originalWrite=void 0,this.redirected=!1)}async withRedirect(t){this.redirect();try{return await t()}finally{this.restore()}}};Vme();Ct();Uy();kt();Pn();var Fur=class{result=wf.Success;lastFailureMessage=void 0;logImmediately;logPrefix;title;subtasks=[];shouldBufferLogs;bufferedLogs=[];status="notStarted";onResult;instrumentPostHogEventImpl;captureExceptionImpl;emitAutomationTelemetryEventImpl;constructor({logImmediately:t,logPrefix:r,title:n,takeOverTerminal:i,onResult:o,shouldBufferLogs:s,instrumentPostHogEvent:a,captureException:c,emitAutomationTelemetryEvent:u}){this.logImmediately=t,this.logPrefix=r??"",this.title=n,this.takeOverTerminal=i,this.onResult=o,this.shouldBufferLogs=s,this.instrumentPostHogEventImpl=a,this.captureExceptionImpl=c,this.emitAutomationTelemetryEventImpl=u}start(){return this.status="running",this}isStarted(){return this.status!=="notStarted"}finish(){this.status!=="finished"&&(this.status="finished",this.flushLogs(),this.onResult?.(this.getResult()))}isFinished(){return this.status==="finished"}takeOverTerminal;failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),this.finish(),new hc(t??(r instanceof hc?r.failureMessage:this.lastFailureMessage))}failWithoutThrowing(t,r,n){this.result=wf.Failure,!(r instanceof hc)&&(t!=null&&(this.lastFailureMessage=t),sqt({message:t,error:r,logger:this.logger}),Tji(this,r,{...n,message:t}))}getLastFailureMessage(){return this.lastFailureMessage}captureException(t,r){return this.captureExceptionImpl?.(t,r)}emitAutomationTelemetryEvent(t,r){this.emitAutomationTelemetryEventImpl(t,r)}getResult(){return this.result}instrumentPostHogEvent(t){this.instrumentPostHogEventImpl(t)}logAtLevel(t,...r){this.logAtLevelWithOverrides(t,r)}logAtLevelWithOverrides(t,r,n={}){this.log({parts:r,level:t,time:new Date,...n})}log(t){this.bufferedLogs.push({...t,prefix:this.logPrefix}),this.shouldBufferLogs||this.flushLogs()}flushLogs(){this.logImmediately(this.bufferedLogs),this.bufferedLogs=[]}logger=oI(this.logAtLevel.bind(this));addInteractiveTask({name:t,subtitle:r}){let n=new Cra({name:t,subtitle:r,logImmediately:i=>this.logImmediately(i),logPrefix:`${this.logPrefix}${de.blackBright(t)} `,takeOverTerminal:this.takeOverTerminal,onResult:this.onResult,shouldBufferLogs:this.shouldBufferLogs,instrumentPostHogEvent:i=>this.instrumentPostHogEventImpl(i),captureException:this.captureExceptionImpl,emitAutomationTelemetryEvent:this.emitAutomationTelemetryEventImpl});return this.subtasks.push(n),n}async runInteractiveTask(t,r){let n=this.addInteractiveTask(t).start();try{await r(n)}catch(o){n.failWithoutThrowing(void 0,o)}finally{n.finish()}let i=n.getResult()===wf.Success;return i||(this.lastFailureMessage=n.getLastFailureMessage()??this.lastFailureMessage),i}printInteractiveTasks({spinner:t}){return this.subtasks.map(r=>r.print({spinner:t})).join(`
5143
+ `).trimEnd()}${NFt}`});Pn();Vi();var qle={GENERATION_STARTED:"generation_started",GENERATION_COMPLETED:"generation_completed",GENERATION_FAILED:"generation_failed",VERIFICATION_FAILED:"verification_failed",SDK_PR_CREATED:"sdk_pr_created",UPGRADE_APPLIED:"upgrade_applied",MAJOR_VERSION_BUMP:"major_version_bump"},Yty={[qle.GENERATION_STARTED]:!1,[qle.GENERATION_COMPLETED]:!1,[qle.GENERATION_FAILED]:!0,[qle.VERIFICATION_FAILED]:!0,[qle.SDK_PR_CREATED]:!1,[qle.UPGRADE_APPLIED]:!1,[qle.MAJOR_VERSION_BUMP]:!1};function C7p(e){return Yty[e]}function x7p(e,t){return{automation_mode:!0,surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function S7p(e,t){function r(i,o,s){s!=null&&(i[o]=s)}let n={surface:"cli",automation_mode:"true"};return r(n,"event",e.event),r(n,"action",t.action),r(n,"run_id",t.run_id),r(n,"org",t.org),r(n,"config_repo",t.config_repo),r(n,"trigger",t.trigger),r(n,"error_code",e.errorCode??"none"),n}function w7p(e,t){return{github_run_id:t.github_run_id,github_run_url:t.github_run_url,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,cli_version:t.cli_version,...e.attributes??{}}}function T7p(e,t){return{event:e.event,timestamp:new Date().toISOString(),surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function O7p(e){let t=e.join(" ");return/\bautomations\s+generate\b/.test(t)?qle.GENERATION_FAILED:/\bautomations\s+preview\b/.test(t)?qle.VERIFICATION_FAILED:qle.GENERATION_FAILED}var Xty="",Zty="FERN_AUTOMATION_EVENTS_ORIGIN",$ty=3e3,Sji=class e{static instance;origin;inflight=[];static getInstance(){return e.instance==null&&(e.instance=new e(process.env[Zty]??Xty)),e.instance}constructor(t){this.origin=t}resolveEndpoint(){if(this.origin.length!==0)return`${this.origin.replace(/\/$/,"")}/v1/automation/events`}post(t,r){this.inflight.push(this.send(t,r))}async shutdown(){let t=this.inflight;this.inflight=[],t.length>0&&await Promise.allSettled(t)}async send(t,r){let n=this.resolveEndpoint();if(n==null)return;let i=new AbortController,o=setTimeout(()=>i.abort(),$ty);try{let s={"content-type":"application/json"},a=await EM();a!=null&&a.value.length>0&&(s.Authorization=`Bearer ${a.value}`);let c=await fetch(n,{method:"POST",headers:s,body:JSON.stringify(T7p(t,r)),signal:i.signal})}catch{return}finally{clearTimeout(o)}}};function P7p(){let{fern_run_id:e,github_run_id:t}=Ope();return{action:process.env.FERN_ACTION,run_id:e,github_run_id:t,github_run_url:process.env.FERN_GITHUB_RUN_URL,org:void 0,config_repo:process.env.FERN_CONFIG_REPO,config_commit_sha:process.env.FERN_CONFIG_COMMIT_SHA,config_branch:process.env.FERN_CONFIG_BRANCH,config_pr_number:process.env.FERN_CONFIG_PR_NUMBER,trigger:process.env.GITHUB_EVENT_NAME,cli_version:"5.170.8"}}function B7p(){return process.env.FERN_AUTOMATION==="true"}var ery=3e3,wji=class{constructor(t,r=Sji.getInstance()){this.reporter=t;this.automationEventApiClient=r;this.context=P7p()}reporter;automationEventApiClient;context;setOrganization(t){this.context={...this.context,org:t}}emit(t,r){let n=this.captureSentryForFailure({event:t,context:this.context,error:r?.error}),i=n==null?t:{...t,attributes:{...t.attributes??{},sentry_event_id:n}};this.capturePostHogEvent({event:i,context:this.context}),this.captureAutomationEventApiEvent(i,this.context)}async flush(){let t;try{await Promise.race([this.automationEventApiClient.shutdown(),new Promise(r=>{t=setTimeout(r,ery)})])}finally{clearTimeout(t)}}capturePostHogEvent({event:t,context:r}){this.reporter.instrumentPostHogAutomationEvent({distinctId:r.run_id??void 0,event:t.event,properties:x7p(t,r)})}captureSentryForFailure({event:t,context:r,error:n}){if(!(!C7p(t.event)||t.errorCode==null))return this.reporter.captureException(n,{tags:S7p(t,r),context:{automation:w7p(t,r)}})}captureAutomationEventApiEvent(t,r){this.automationEventApiClient.post(t,r)}};kt();function Tji(e,t,r){if(t instanceof hc)return;let n=jMe(t,r?.code),i=r?.argv??process.argv,o=i.join(" "),s=r?.message??(t instanceof Error?t.message:void 0)??"",a=t??new T({message:s,code:n});B7p()?nry(i,e,n,s,a):rry(e,o,n,a)}function rry(e,t,r,n){e.instrumentPostHogEvent({command:t,properties:{failed:!0,errorCode:r}}),dQt(r)&&e.captureException(n,{tags:{"error.code":r}})}function nry(e,t,r,n,i){let o=O7p(e);t.emitAutomationTelemetryEvent({event:o,errorCode:r,attributes:{error_message:n}},{error:i})}kt();function qKe(){return process.env.FERN_DISABLE_TELEMETRY==="true"}function Oji({cliName:e,packageVersion:t,isLocal:r}){return qKe()||r?!1:!(t==="0.0.0")&&(e==="fern"&&!0)}var Pji=class{sentry;constructor({release:t,telemetry:r}){let n="https://84f58b5e457f06999d92f11ce4b79158@o4509504076185600.ingest.us.sentry.io/4511021546602496";if(Oji(r)&&n!=null&&n.length>0){let i="production";if(i==null||i.length===0)throw new T({message:"SENTRY_ENVIRONMENT must be set when SENTRY_DSN is configured",code:T.Code.ConfigError});this.sentry=oQt({dsn:n,release:t,environment:i,defaultIntegrations:!1,integrations:[VYe(),iEe(),oEe(),U0e(),nEe()],tracesSampleRate:0,attachStacktrace:!0,sendClientReports:!1}),sQt()}}captureException(t,r){if(this.sentry!=null)try{let n=r?.tags,i=r?.context,o=n!=null&&Object.keys(n).length>0,s=i!=null&&Object.values(i).some(a=>a!=null);return!o&&!s?this.sentry.captureException(t):_P(a=>{if(o&&a.setTags(n),i!=null)for(let[c,u]of Object.entries(i))u!=null&&a.setContext(c,u);return this.sentry?.captureException(t,void 0,a)})}catch{return}}async flush(){this.sentry!=null&&await Promise.resolve(this.sentry.flush(2e3)).catch(()=>{})}};kt();var Bji=class{originalWrite;redirected=!1;redirect(){if(this.redirected)throw new T({message:"StdoutRedirector: already redirected \u2014 did you forget to restore()?",code:T.Code.InternalError});this.originalWrite=process.stdout.write,process.stdout.write=process.stderr.write.bind(process.stderr),this.redirected=!0}restore(){!this.redirected||this.originalWrite==null||(process.stdout.write=this.originalWrite,this.originalWrite=void 0,this.redirected=!1)}async withRedirect(t){this.redirect();try{return await t()}finally{this.restore()}}};Vme();Ct();Uy();kt();Pn();var Fur=class{result=wf.Success;lastFailureMessage=void 0;logImmediately;logPrefix;title;subtasks=[];shouldBufferLogs;bufferedLogs=[];status="notStarted";onResult;instrumentPostHogEventImpl;captureExceptionImpl;emitAutomationTelemetryEventImpl;constructor({logImmediately:t,logPrefix:r,title:n,takeOverTerminal:i,onResult:o,shouldBufferLogs:s,instrumentPostHogEvent:a,captureException:c,emitAutomationTelemetryEvent:u}){this.logImmediately=t,this.logPrefix=r??"",this.title=n,this.takeOverTerminal=i,this.onResult=o,this.shouldBufferLogs=s,this.instrumentPostHogEventImpl=a,this.captureExceptionImpl=c,this.emitAutomationTelemetryEventImpl=u}start(){return this.status="running",this}isStarted(){return this.status!=="notStarted"}finish(){this.status!=="finished"&&(this.status="finished",this.flushLogs(),this.onResult?.(this.getResult()))}isFinished(){return this.status==="finished"}takeOverTerminal;failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),this.finish(),new hc(t??(r instanceof hc?r.failureMessage:this.lastFailureMessage))}failWithoutThrowing(t,r,n){this.result=wf.Failure,!(r instanceof hc)&&(t!=null&&(this.lastFailureMessage=t),sqt({message:t,error:r,logger:this.logger}),Tji(this,r,{...n,message:t}))}getLastFailureMessage(){return this.lastFailureMessage}captureException(t,r){return this.captureExceptionImpl?.(t,r)}emitAutomationTelemetryEvent(t,r){this.emitAutomationTelemetryEventImpl(t,r)}getResult(){return this.result}instrumentPostHogEvent(t){this.instrumentPostHogEventImpl(t)}logAtLevel(t,...r){this.logAtLevelWithOverrides(t,r)}logAtLevelWithOverrides(t,r,n={}){this.log({parts:r,level:t,time:new Date,...n})}log(t){this.bufferedLogs.push({...t,prefix:this.logPrefix}),this.shouldBufferLogs||this.flushLogs()}flushLogs(){this.logImmediately(this.bufferedLogs),this.bufferedLogs=[]}logger=oI(this.logAtLevel.bind(this));addInteractiveTask({name:t,subtitle:r}){let n=new Cra({name:t,subtitle:r,logImmediately:i=>this.logImmediately(i),logPrefix:`${this.logPrefix}${de.blackBright(t)} `,takeOverTerminal:this.takeOverTerminal,onResult:this.onResult,shouldBufferLogs:this.shouldBufferLogs,instrumentPostHogEvent:i=>this.instrumentPostHogEventImpl(i),captureException:this.captureExceptionImpl,emitAutomationTelemetryEvent:this.emitAutomationTelemetryEventImpl});return this.subtasks.push(n),n}async runInteractiveTask(t,r){let n=this.addInteractiveTask(t).start();try{await r(n)}catch(o){n.failWithoutThrowing(void 0,o)}finally{n.finish()}let i=n.getResult()===wf.Success;return i||(this.lastFailureMessage=n.getLastFailureMessage()??this.lastFailureMessage),i}printInteractiveTasks({spinner:t}){return this.subtasks.map(r=>r.print({spinner:t})).join(`
5144
5144
  `)}},Cra=class extends Fur{name;subtitle;constructor({name:t,subtitle:r,...n}){super(n),this.name=t,this.subtitle=r}start(){return super.start(),this.logAtLevelWithOverrides(Xn.Info,["Started."],{omitOnTTY:!0}),this.flushLogs(),this}isStarted(){return this.status!=="notStarted"}finish(){this.status!=="finished"&&(this.result===wf.Success?this.logAtLevelWithOverrides(Xn.Info,["Finished."],{omitOnTTY:!0}):this.logAtLevelWithOverrides(Xn.Error,["Failed."],{omitOnTTY:!0}),super.finish())}setSubtitle(t){this.subtitle=t}print({spinner:t}){let r=[this.name];return this.subtitle!=null&&r.push(de.dim(this.subtitle)),r.push(...this.subtasks.map(n=>n.print({spinner:t}))),Gz({prefix:this.getIcon({spinner:t}),content:r.join(`
5145
5145
  `)})}printInteractiveTasks({spinner:t}){return this.print({spinner:t})}getIcon({spinner:t}){let r=this.subtasks.length>0;switch(this.status){case"notStarted":return r?de.dim("\u25B8 "):de.dim("\u25E6 ");case"running":return r?de.cyan("\u25BE "):t;case"finished":switch(this.getResult()){case wf.Success:return r?de.green("\u25BE "):de.green("\u2713 ");case wf.Failure:return r?de.red("\u25BE "):de.red("x ")}}}getResult(){if(this.result===wf.Failure)return wf.Failure;for(let t of this.subtasks)if(t.getResult()===wf.Failure)return wf.Failure;return wf.Success}};kt();var R7p=Ae(j_e(),1);Pn();function D7p(e){return e.filter(t=>t.isUpgradeAvailable).length>0}function iry(e){return(e.cliUpgradeInfo?.isUpgradeAvailable??!1)||D7p(e.generatorUpgradeInfo)}async function k7p({cliEnvironment:e,upgradeInfo:t}){if(!iry(t)||e.packageVersion==t.cliUpgradeInfo?.latestVersion)return;let r=`${de.underline("Upgrades available")}
5146
5146
 
@@ -5149,7 +5149,7 @@ ${r}`}function VNi(e){let t=this,{emitParseErrors:r,...n}={...t.data("settings")
5149
5149
  Run ${de.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
5150
5150
  Run ${de.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),Nft(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function xra({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!D7p(e))return;let i=t??"",o=e.filter(a=>a.isUpgradeAvailable);r!=null&&(o=o.slice(0,r+1));let s=o.sort((a,c)=>a.generatorName.localeCompare(c.generatorName)||a.currentVersion.localeCompare(c.currentVersion));for(let a of s)i+=`
5151
5151
  ${await ory(a.generatorName)} (${a.apiName!=null?"API: "+a.apiName+", ":""}Group: ${a.generatorGroup}) `+de.dim(a.currentVersion)+de.reset(" \u2192 ")+de.green(a.latestVersion);return i+=`
5152
- `,n?Nft(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function ory(e){let r=await new R7p.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new T({message:`Generator ${e} not found`,code:T.Code.ConfigError});return r.body.displayName}Bi();$me();kt();var Nur=Ae(_y(),1);function QFt(e){let t;return()=>(t??=e.runTask(r=>pd(r)),t)}function Rji({generatorId:e,candidateVersion:t,currentVersion:r}){if(!F7p(t)||!F7p(r))throw new T({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:T.Code.VersionError});try{return t===r?0:Gw(t,r)?1:Gw(r,t)?-1:0}catch{let n=Nur.default.valid(t),i=Nur.default.valid(r);if(n!=null&&i!=null)return Math.sign(Nur.default.compare(n,i));throw new T({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:T.Code.VersionError})}}function F7p(e){if(e==="latest"||Nur.default.valid(e)!=null)return!0;try{return oJ(e),!0}catch{return!1}}async function Dji({generatorId:e,currentVersion:t,includeMajor:r,channel:n,organization:i,getToken:o,context:s}){if(n!=null)throw new Error(`SDK Gen API generator version discovery does not support the requested upgrade channel "${n}". Remove --channel to use executable index versions; FDR channel metadata is used only when the ${krr} feature flag is off for this organization.`);let a=kTt();if(a==null)throw new Error("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled");let c=Gv(e);if(c==null)return s.logger.error(`SDK Gen API cannot discover versions for unsupported generator ${e}. Use a canonical first-party SDK generator name.`),{};let u=await o(),l=await Zvs({origin:a,organization:i,token:u,generatorId:e,language:c,currentVersion:t,includeMajor:r});return l.state==="UNAVAILABLE"?(s.logger.error(`SDK Gen API cannot resolve an executable version for ${e}@${t} (${l.reason}). Publish the coordinate to this environment or choose a supported generator version.`),{}):{compatibleVersion:l.compatibleVersion,withheldMajorVersion:l.withheldMajorVersion}}async function sry({cliContext:e,project:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let{apiWorkspaces:a}=t,c=QFt(e);if(a.length===1){let l={type:"singleApi",versions:{}};return await N7p({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(p,d,f,m)=>{l.versions[d]==null&&(l.versions[d]={});let g=w_e(f.name);if(g==null){m.logger.debug(`Skipping unknown generator: ${f.name}`);return}let A=await z7p({generatorName:f.name,normalizedGeneratorName:g,cliVersion:e.environment.packageVersion,currentGeneratorVersion:f.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:c,context:m});A!=null&&(l.versions[d][f.name]={previousVersion:f.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),l}let u={type:"multiApi",versions:{}};return await N7p({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(l,p,d,f)=>{if(l==null)return;u.versions[l]==null&&(u.versions[l]={}),u.versions[l][p]==null&&(u.versions[l][p]={});let m=w_e(d.name);if(m==null){f.logger.debug(`Skipping unknown generator: ${d.name}`);return}let g=await z7p({generatorName:d.name,normalizedGeneratorName:m,cliVersion:e.environment.packageVersion,currentGeneratorVersion:d.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:c,context:f});g!=null&&(u.versions[l][p][d.name]={previousVersion:d.version,latestVersion:g})},generatorFilter:r,groupFilter:n}),u}async function N7p({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async o=>{await e.runTaskForWorkspace(o,async s=>{let a=await m4({absolutePathToWorkspace:o.absoluteFilePath,context:s});if(a==null||a.groups==null)return;let c=n!=null?eg(n):void 0;for(let u of a.groups)if(!(i!=null&&u.groupName!==i))for(let l of u.generators)c!=null&&l.name!==c||await r(o.workspaceName,u.groupName,l,s)})}))}function j7p(e,t,r){let n=[];for(let[i,o]of Object.entries(e))for(let[s,a]of Object.entries(o)){r.debug(`Checking if ${s} in group ${i} has an upgrade available...`);let c=Rji({generatorId:s,candidateVersion:a.latestVersion,currentVersion:a.previousVersion})===1;r.debug(`Latest version: ${a.latestVersion}. `+(c?"Upgrade available.":"No upgrade available.")),n.push({generatorName:s,generatorGroup:i,apiName:t,isUpgradeAvailable:c,currentVersion:a.previousVersion,latestVersion:a.latestVersion})}return n}async function z7p({generatorName:e,normalizedGeneratorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,organization:s,skipFeatureFlagRequest:a,getSdkGenApiToken:c,context:u}){return n==="latest"?"latest":await ary({organization:s,generatorName:eg(e),skipFeatureFlagRequest:a})?(await Dji({generatorId:eg(e),currentVersion:n,includeMajor:o??!1,channel:i,organization:s,getToken:c,context:u})).compatibleVersion:LB({generatorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,context:u})}async function kji({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let a=[];if(e!=null){let c=await sry({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s});if(c.type==="multiApi")for(let[u,l]of Object.entries(c.versions))a.push(...j7p(l,u,t.logger));else a.push(...j7p(c.versions,void 0,t.logger))}return a}async function ary({organization:e,generatorName:t,skipFeatureFlagRequest:r}){return r===!0?RPs({organization:e,generatorName:t})??!1:RTt({organization:e,generatorName:t})}kt();Ujr();async function Xbe({cliEnvironment:e,includePreReleases:t=!1}){if(e.packageName!=="fern-api"||e.packageVersion==="0.0.0")return e.packageVersion;try{return await T6e(e.packageName,{version:t?"prerelease":"latest"})}catch(r){throw new T({message:`Failed to resolve latest CLI version: ${r instanceof Error?r.message:String(r)}`,code:T.Code.NetworkError})}}var Q7p=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],Fji=class e{environment;sentryClient;posthogManager;automationTelemetryManager;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Xn.Info;isLocal;stdoutRedirector=new Bji;jsonMode=!1;static async create(t,r,{isLocal:n}){let i=await IKt();return new e(t,r,{isLocal:n,posthogManager:i})}constructor(t,r,{isLocal:n,posthogManager:i}){this.ttyAwareLogger=new vqt(t,r),this.isLocal=n??!1,this.posthogManager=i;let o=this.getPackageName(),s=this.getPackageVersion(),a=this.getCliName();(o==null||s==null||a==null)&&this.exitProgram(),this.environment={packageName:o,packageVersion:s,cliName:a},this.sentryClient=new Pji({release:`cli@${this.environment.packageVersion}`,telemetry:{cliName:this.environment.cliName,packageVersion:this.environment.packageVersion,isLocal:this.isLocal}}),this.automationTelemetryManager=new wji(this)}getPackageName(){return"fern-api"}getPackageVersion(){return"5.170.7"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${de.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),new hc(t??(r instanceof hc?r.failureMessage:r!=null?xn(r):void 0))}failWithoutThrowing(t,r,n){this.didSucceed=!1,!(r instanceof hc)&&(sqt({message:t,error:r,logger:this.logger}),Tji(this,r,{...n,message:t}))}enableJsonMode(){this.jsonMode||(this.jsonMode=!0,this.stdoutRedirector.redirect())}get isJsonMode(){return this.jsonMode}get isTTY(){return this.ttyAwareLogger.isTTY}writeJsonToStdout(t){this.writeTextToStdout(JSON.stringify(t,null,2)+`
5152
+ `,n?Nft(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function ory(e){let r=await new R7p.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new T({message:`Generator ${e} not found`,code:T.Code.ConfigError});return r.body.displayName}Bi();$me();kt();var Nur=Ae(_y(),1);function QFt(e){let t;return()=>(t??=e.runTask(r=>pd(r)),t)}function Rji({generatorId:e,candidateVersion:t,currentVersion:r}){if(!F7p(t)||!F7p(r))throw new T({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:T.Code.VersionError});try{return t===r?0:Gw(t,r)?1:Gw(r,t)?-1:0}catch{let n=Nur.default.valid(t),i=Nur.default.valid(r);if(n!=null&&i!=null)return Math.sign(Nur.default.compare(n,i));throw new T({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:T.Code.VersionError})}}function F7p(e){if(e==="latest"||Nur.default.valid(e)!=null)return!0;try{return oJ(e),!0}catch{return!1}}async function Dji({generatorId:e,currentVersion:t,includeMajor:r,channel:n,organization:i,getToken:o,context:s}){if(n!=null)throw new Error(`SDK Gen API generator version discovery does not support the requested upgrade channel "${n}". Remove --channel to use executable index versions; FDR channel metadata is used only when the ${krr} feature flag is off for this organization.`);let a=kTt();if(a==null)throw new Error("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled");let c=Gv(e);if(c==null)return s.logger.error(`SDK Gen API cannot discover versions for unsupported generator ${e}. Use a canonical first-party SDK generator name.`),{};let u=await o(),l=await Zvs({origin:a,organization:i,token:u,generatorId:e,language:c,currentVersion:t,includeMajor:r});return l.state==="UNAVAILABLE"?(s.logger.error(`SDK Gen API cannot resolve an executable version for ${e}@${t} (${l.reason}). Publish the coordinate to this environment or choose a supported generator version.`),{}):{compatibleVersion:l.compatibleVersion,withheldMajorVersion:l.withheldMajorVersion}}async function sry({cliContext:e,project:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let{apiWorkspaces:a}=t,c=QFt(e);if(a.length===1){let l={type:"singleApi",versions:{}};return await N7p({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(p,d,f,m)=>{l.versions[d]==null&&(l.versions[d]={});let g=w_e(f.name);if(g==null){m.logger.debug(`Skipping unknown generator: ${f.name}`);return}let A=await z7p({generatorName:f.name,normalizedGeneratorName:g,cliVersion:e.environment.packageVersion,currentGeneratorVersion:f.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:c,context:m});A!=null&&(l.versions[d][f.name]={previousVersion:f.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),l}let u={type:"multiApi",versions:{}};return await N7p({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(l,p,d,f)=>{if(l==null)return;u.versions[l]==null&&(u.versions[l]={}),u.versions[l][p]==null&&(u.versions[l][p]={});let m=w_e(d.name);if(m==null){f.logger.debug(`Skipping unknown generator: ${d.name}`);return}let g=await z7p({generatorName:d.name,normalizedGeneratorName:m,cliVersion:e.environment.packageVersion,currentGeneratorVersion:d.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:c,context:f});g!=null&&(u.versions[l][p][d.name]={previousVersion:d.version,latestVersion:g})},generatorFilter:r,groupFilter:n}),u}async function N7p({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async o=>{await e.runTaskForWorkspace(o,async s=>{let a=await m4({absolutePathToWorkspace:o.absoluteFilePath,context:s});if(a==null||a.groups==null)return;let c=n!=null?eg(n):void 0;for(let u of a.groups)if(!(i!=null&&u.groupName!==i))for(let l of u.generators)c!=null&&l.name!==c||await r(o.workspaceName,u.groupName,l,s)})}))}function j7p(e,t,r){let n=[];for(let[i,o]of Object.entries(e))for(let[s,a]of Object.entries(o)){r.debug(`Checking if ${s} in group ${i} has an upgrade available...`);let c=Rji({generatorId:s,candidateVersion:a.latestVersion,currentVersion:a.previousVersion})===1;r.debug(`Latest version: ${a.latestVersion}. `+(c?"Upgrade available.":"No upgrade available.")),n.push({generatorName:s,generatorGroup:i,apiName:t,isUpgradeAvailable:c,currentVersion:a.previousVersion,latestVersion:a.latestVersion})}return n}async function z7p({generatorName:e,normalizedGeneratorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,organization:s,skipFeatureFlagRequest:a,getSdkGenApiToken:c,context:u}){return n==="latest"?"latest":await ary({organization:s,generatorName:eg(e),skipFeatureFlagRequest:a})?(await Dji({generatorId:eg(e),currentVersion:n,includeMajor:o??!1,channel:i,organization:s,getToken:c,context:u})).compatibleVersion:LB({generatorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,context:u})}async function kji({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let a=[];if(e!=null){let c=await sry({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s});if(c.type==="multiApi")for(let[u,l]of Object.entries(c.versions))a.push(...j7p(l,u,t.logger));else a.push(...j7p(c.versions,void 0,t.logger))}return a}async function ary({organization:e,generatorName:t,skipFeatureFlagRequest:r}){return r===!0?RPs({organization:e,generatorName:t})??!1:RTt({organization:e,generatorName:t})}kt();Ujr();async function Xbe({cliEnvironment:e,includePreReleases:t=!1}){if(e.packageName!=="fern-api"||e.packageVersion==="0.0.0")return e.packageVersion;try{return await T6e(e.packageName,{version:t?"prerelease":"latest"})}catch(r){throw new T({message:`Failed to resolve latest CLI version: ${r instanceof Error?r.message:String(r)}`,code:T.Code.NetworkError})}}var Q7p=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],Fji=class e{environment;sentryClient;posthogManager;automationTelemetryManager;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Xn.Info;isLocal;stdoutRedirector=new Bji;jsonMode=!1;static async create(t,r,{isLocal:n}){let i=await IKt();return new e(t,r,{isLocal:n,posthogManager:i})}constructor(t,r,{isLocal:n,posthogManager:i}){this.ttyAwareLogger=new vqt(t,r),this.isLocal=n??!1,this.posthogManager=i;let o=this.getPackageName(),s=this.getPackageVersion(),a=this.getCliName();(o==null||s==null||a==null)&&this.exitProgram(),this.environment={packageName:o,packageVersion:s,cliName:a},this.sentryClient=new Pji({release:`cli@${this.environment.packageVersion}`,telemetry:{cliName:this.environment.cliName,packageVersion:this.environment.packageVersion,isLocal:this.isLocal}}),this.automationTelemetryManager=new wji(this)}getPackageName(){return"fern-api"}getPackageVersion(){return"5.170.8"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${de.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),new hc(t??(r instanceof hc?r.failureMessage:r!=null?xn(r):void 0))}failWithoutThrowing(t,r,n){this.didSucceed=!1,!(r instanceof hc)&&(sqt({message:t,error:r,logger:this.logger}),Tji(this,r,{...n,message:t}))}enableJsonMode(){this.jsonMode||(this.jsonMode=!0,this.stdoutRedirector.redirect())}get isJsonMode(){return this.jsonMode}get isTTY(){return this.ttyAwareLogger.isTTY}writeJsonToStdout(t){this.writeTextToStdout(JSON.stringify(t,null,2)+`
5153
5153
  `)}writeTextToStdout(t){this.stdoutRedirector.restore(),process.stdout.write(t),this.jsonMode&&this.stdoutRedirector.redirect()}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish();try{await Promise.all([this.posthogManager.flush(),fZo()])}catch{}await this.sentryClient.flush(),await this.automationTelemetryManager.flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable({skipFeatureFlagRequest:!0}),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await k7p({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
5154
5154
  `)||(r+=`
5155
5155
  `),this.stderr.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram({code:t}={}){process.exit(t??(this.didSucceed?0:1))}longestWorkspaceName;registerWorkspaces(t){let r=Uqi(t.map(n=>n.type==="docs"?"docs":n.workspaceName??"api"),n=>n.length);r!=null&&(this.longestWorkspaceName=r)}project;registerProject(t){this.project=t,this.automationTelemetryManager.setOrganization(t.config.organization)}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 Fur(t);return this.ttyAwareLogger.registerTask(r),r}USE_NODE_18_OR_ABOVE_MESSAGE="The Fern CLI requires Node 18+ or above.";async runTaskWithInit(t,r){let n=this.addTaskWithInit(t).start(),i;try{i=await r(n)}catch(o){let s=o instanceof hc?o.failureMessage??n.getLastFailureMessage():xn(o);throw n.failWithoutThrowing(void 0,o),new hc(s)}finally{n.finish()}return i}instrumentPostHogEvent(t){this.isLocal||this.posthogManager.sendEvent(t)}instrumentPostHogAutomationEvent(t){this.isLocal||this.posthogManager.sendAutomationEvent(t)}captureException(t,r){return this.sentryClient.captureException(t,r)}emitAutomationTelemetryEvent(t,r){this.automationTelemetryManager.emit(t,r)}logger=oI((t,...r)=>this.log(t,...r));stderr=oI((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=t.type==="docs"?"docs":t.workspaceName??"api",n=M7p(r),i=1+(this.longestWorkspaceName!=null?M7p(this.longestWorkspaceName):n).length,o=n.padEnd(i),s=Q7p[this.numTasks++%Q7p.length],a=de.hex(s)(o);return{...this.constructTaskInit(),logPrefix:a,title:de.hex(s).bold(r)}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===wf.Failure&&(this.didSucceed=!1)},instrumentPostHogEvent:t=>{this.instrumentPostHogEvent(t)},shouldBufferLogs:!1,captureException:(t,r)=>this.sentryClient.captureException(t,r),emitAutomationTelemetryEvent:(t,r)=>this.emitAutomationTelemetryEvent(t,r)}}log(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}])}logStderr(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}],{stderr:!0})}logImmediately(t,{stderr:r=!1}={}){let n=t.filter(i=>mw.indexOf(i.level)>=mw.indexOf(this.logLevel));this.ttyAwareLogger.log(n,{includeDebugInfo:this.logLevel===Xn.Debug,stderr:r||this.jsonMode})}_suppressUpgradeMessage=!1;suppressUpgradeMessage(){this._suppressUpgradeMessage=!0}_isUpgradeAvailable;async isUpgradeAvailable({includePreReleases:t=!1,skipFeatureFlagRequest:r=!1}={}){if(this._isUpgradeAvailable==null){this.logger.debug(`Checking if ${this.environment.packageName} upgrade is available...`);let n=await Xbe({cliEnvironment:this.environment,includePreReleases:t}),i=Gw(n,this.environment.packageVersion);this.logger.debug(`Latest version: ${n}. `+(i?"Upgrade available.":"No upgrade available."));let o={isUpgradeAvailable:i,latestVersion:n},s=await kji({project:this.project,cliContext:this,skipFeatureFlagRequest:r});this._isUpgradeAvailable={cliUpgradeInfo:o,generatorUpgradeInfo:s}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){return this.selectPrompt({message:t,choices:[{name:"No",value:!1},{name:"Yes",value:!0}],default:r})}async selectPrompt({message:t,choices:r,default:n}){try{return await vra({message:t,choices:r,default:n,theme:{prefix:de.yellow("?"),style:{answer:i=>de.cyan(i),message:i=>de.bold(i),highlight:i=>de.cyan(i)}}})}catch(i){throw i?.name==="ExitPromptError"?(this.logger.info(`