fern-api 5.44.4 → 5.44.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +9 -9
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -3034,7 +3034,7 @@ Example: if your docs.yml references "pages/getting-started.mdx", add a translat
|
|
|
3034
3034
|
version at "translations/${c}/pages/getting-started.mdx".`,void 0,{code:D.Code.ValidationError});return}let l={},p=[];await Promise.all(Object.keys(r).map(async d=>{let f=dW.default.join(u,d);await sr(f)?l[d]=await(0,Ipe.readFile)(f,"utf-8"):p.push(d)})),p.length>0&&i.logger.warn(`Translation for locale "${c}" is missing ${p.length} page(s):
|
|
3035
3035
|
`+p.map(d=>` - translations/${c}/${d}`).join(`
|
|
3036
3036
|
`)+`
|
|
3037
|
-
These pages will fall back to the default language content.`),s[c]=l})),s}async function xMf({translations:e,defaultLocale:t,absolutePathToFernFolder:r,context:n}){if(e==null||e.length===0)return;let i=dW.default.join(r,"translations"),o={},s=e.map(a=>Uh.DocsYmlSchemas.normalizeTranslationConfig(a));if(await Promise.all(s.map(async({lang:a})=>{if(a===t)return;let c=await SMf({translationsRootDir:i,lang:a});if(c==null)return;let{overlayDocsYmlPath:u,overlayDir:l}=c;try{let p=wr.load(await(0,Ipe.readFile)(u,"utf-8"));if(!So(p)){n.logger.warn(`Translation overlay at "${u}" is not a valid YAML object. Skipping.`);return}let d=await BMf({docsYmlContent:p,langFernDir:l,overlayDocsYmlPath:u,context:n});o[a]=d}catch(p){n.logger.warn(`Failed to load translation overlay for locale "${a}": ${String(p)}. Navigation labels will not be translated for this locale.`)}})),Object.keys(o).length!==0)return o}async function SMf({translationsRootDir:e,lang:t}){let r=dW.default.join(e,t),n=dW.default.join(r,"docs.yml");if(await sr(n))return{overlayDocsYmlPath:n,overlayDir:r};let i=dW.default.join(r,"fern"),o=dW.default.join(i,"docs.yml");if(await sr(o))return{overlayDocsYmlPath:o,overlayDir:i}}function vrc(e,t){if(So(e)){let r=e[t];if(typeof r=="string")return r}}async function TMf({rawNavbarLinks:e,overlayDocsYmlPath:t,context:r}){let n=[];for(let[i,o]of e.entries())try{let s=await Uh.RawSchemas.Serializer.NavbarLink.parseOrThrow(o);n.push(s)}catch(s){r.logger.warn(`Invalid navbar-link at index ${i} in "${t}": ${String(s)}. Skipping this entry.`)}return n}async function BMf({docsYmlContent:e,langFernDir:t,overlayDocsYmlPath:r,context:n}){let i={tabs:void 0,products:void 0,versions:void 0,announcement:void 0,navigation:void 0,navbarLinks:void 0};if(So(e.announcement)){let s=vrc(e.announcement,"message");s!=null&&(i.announcement={message:s})}let o=e["navbar-links"];if(Array.isArray(o)){let s=await TMf({rawNavbarLinks:o,overlayDocsYmlPath:r,context:n});i.navbarLinks=xrc(s,r)??[]}if(So(e.tabs)&&(i.tabs=Trc(e.tabs)),Array.isArray(e.products)){i.products=[];for(let s of e.products){if(!So(s))continue;let a=s,c={slug:typeof a.slug=="string"?a.slug:void 0,displayName:typeof a["display-name"]=="string"?a["display-name"]:void 0,subtitle:typeof a.subtitle=="string"?a.subtitle:void 0,announcement:void 0,tabs:void 0,navigation:void 0,versions:void 0};if(So(a.announcement)){let u=vrc(a.announcement,"message");u!=null&&(c.announcement={message:u})}if(typeof a.path=="string"){let u=await Src({relativeNavPath:a.path,overlayDir:t,overlayKind:"product",context:n});u!=null&&(c.tabs=u.tabs,c.navigation=u.navigation)}if(Array.isArray(a.versions)){c.versions=[];for(let u of a.versions)So(u)&&c.versions.push(await Irc({versionObj:u,overlayDir:t,context:n}))}i.products.push(c)}}if(Array.isArray(e.versions)){i.versions=[];for(let s of e.versions)So(s)&&i.versions.push(await Irc({versionObj:s,overlayDir:t,context:n}))}return Array.isArray(e.navigation)&&(i.navigation=[...i.navigation??[],...mNr(e.navigation)]),i}async function Irc({versionObj:e,overlayDir:t,context:r}){let n={slug:typeof e.slug=="string"?e.slug:void 0,displayName:typeof e["display-name"]=="string"?e["display-name"]:void 0,tabs:void 0,navigation:void 0};if(typeof e.path=="string"){let i=await Src({relativeNavPath:e.path,overlayDir:t,overlayKind:"version",context:r});i!=null&&(n.tabs=i.tabs,n.navigation=i.navigation)}return n}async function Src({relativeNavPath:e,overlayDir:t,overlayKind:r,context:n}){let i=dW.default.resolve(t,e);if(!i.startsWith(t)){n.logger.warn(`Invalid path in ${r} overlay: "${e}" escapes the translations directory. Skipping.`);return}if(await sr(i))try{let o=wr.load(await(0,Ipe.readFile)(i,"utf-8"));if(!So(o))return;let s=o;return{tabs:So(s.tabs)?Trc(s.tabs):void 0,navigation:Array.isArray(s.navigation)?mNr(s.navigation):void 0}}catch(o){n.logger.warn(`Failed to load translation nav file "${i}": ${String(o)}`);return}}function Trc(e){let t={};for(let[r,n]of Object.entries(e))if(So(n)){let i=n;t[r]={displayName:typeof i["display-name"]=="string"?i["display-name"]:void 0,slug:typeof i.slug=="string"?i.slug:void 0}}return t}function mNr(e){let t=[];for(let r of e){if(!So(r))continue;let n=r;if(typeof n.tab=="string"){let i={type:"tab",tabId:n.tab,layout:Array.isArray(n.layout)?mNr(n.layout):void 0,variants:Array.isArray(n.variants)?OMf(n.variants):void 0};t.push(i);continue}if(typeof n.section=="string"){let i={type:"section",title:n.section,slug:typeof n.slug=="string"?n.slug:void 0,contents:Array.isArray(n.contents)?mNr(n.contents):void 0};t.push(i);continue}if(typeof n.page=="string"){let i={type:"page",title:n.page,slug:typeof n.slug=="string"?n.slug:void 0};t.push(i);continue}}return t}function OMf(e){let t=[];for(let r of e){if(!So(r))continue;let n=r;t.push({title:typeof n.title=="string"?n.title:void 0,subtitle:typeof n.subtitle=="string"?n.subtitle:void 0,slug:typeof n.slug=="string"?n.slug:void 0})}return t}jt();tr();_t();var Orc=require("fs/promises");as();var Brc=Bt.strictObject({organization:Bt.string(),version:Bt.string()});async function CO({directory:e,context:t}){let r=Ze(e,Fe.of(qE)),n=await(0,Orc.readFile)(r),i;try{i=JSON.parse(n.toString())}catch(s){throw new D({message:`Failed to parse ${qE}: ${qn(s)}`,code:D.Code.ParseError})}let o=await xOr({schema:Brc,value:i,context:t,filepathBeingParsed:r});return{_absolutePath:r,rawConfig:o,organization:o.organization,version:o.version}}var $e={TYPESCRIPT:"fernapi/fern-typescript",TYPESCRIPT_SDK:"fernapi/fern-typescript-sdk",TYPESCRIPT_NODE_SDK:"fernapi/fern-typescript-node-sdk",TYPESCRIPT_BROWSER_SDK:"fernapi/fern-typescript-browser-sdk",TYPESCRIPT_EXPRESS:"fernapi/fern-typescript-express",JAVA:"fernapi/fern-java",JAVA_MODEL:"fernapi/fern-java-model",JAVA_SDK:"fernapi/fern-java-sdk",JAVA_SPRING:"fernapi/fern-java-spring",PYTHON_FASTAPI:"fernapi/fern-fastapi-server",PYTHON_PYDANTIC:"fernapi/fern-pydantic-model",PYTHON_SDK:"fernapi/fern-python-sdk",GO_MODEL:"fernapi/fern-go-model",GO_SDK:"fernapi/fern-go-sdk",RUBY_SDK:"fernapi/fern-ruby-sdk",CSHARP_MODEL:"fernapi/fern-csharp-model",CSHARP_SDK:"fernapi/fern-csharp-sdk",SWIFT_MODEL:"fernapi/fern-swift-model",SWIFT_SDK:"fernapi/fern-swift-sdk",PHP_MODEL:"fernapi/fern-php-model",PHP_SDK:"fernapi/fern-php-sdk",RUST_MODEL:"fernapi/fern-rust-model",RUST_SDK:"fernapi/fern-rust-sdk",OPENAPI:"fernapi/fern-openapi",STOPLIGHT:"fernapi/fern-stoplight",POSTMAN:"fernapi/fern-postman",OPENAPI_PYTHON_CLIENT:"fernapi/openapi-python-client",CLI:"fernapi/fern-cli"};_t();var Tuo=we(Nx(),1);var $6t={[$e.JAVA]:{version:"2.38.1"},[$e.TYPESCRIPT_EXPRESS]:{version:"0.18.4",output:{location:"local-file-system",path:"../src/fern"}},[$e.JAVA_MODEL]:{version:"1.0.0"},[$e.JAVA_SDK]:{version:"2.38.1",output:{location:"local-file-system",path:"../sdks/java/src/main/java/"}},[$e.JAVA_SPRING]:{version:"0.9.2",output:{location:"local-file-system",path:"../src/main/java/com/fern"}},[$e.TYPESCRIPT]:{version:"0.0.247"},[$e.TYPESCRIPT_SDK]:{version:"3.71.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[$e.TYPESCRIPT_NODE_SDK]:{version:"3.71.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[$e.TYPESCRIPT_BROWSER_SDK]:{version:"1.0.0",output:{location:"local-file-system",path:"../sdks/typescript"}},[$e.PYTHON_PYDANTIC]:{version:"1.4.7"},[$e.PYTHON_FASTAPI]:{version:"1.7.0",output:{location:"local-file-system",path:"../src/fern"}},[$e.PYTHON_SDK]:{version:"4.23.2",output:{location:"local-file-system",path:"../sdks/python"}},[$e.GO_MODEL]:{version:"0.23.5"},[$e.GO_SDK]:{version:"1.4.0",output:{location:"local-file-system",path:"../sdks/go"},config:{module:{path:"sdk"}}},[$e.RUBY_SDK]:{version:"0.8.2",output:{location:"local-file-system",path:"../sdks/ruby"}},[$e.OPENAPI]:{version:"0.1.7",config:{format:"yaml"},output:{location:"local-file-system",path:"../openapi"}},[$e.STOPLIGHT]:{version:"0.0.28",config:{format:"yaml"}},[$e.POSTMAN]:{version:"0.4.0",output:{location:"local-file-system",path:"../postman"}},[$e.OPENAPI_PYTHON_CLIENT]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/python"},config:{format:"yaml"}},[$e.CSHARP_MODEL]:{version:"0.0.1"},[$e.CSHARP_SDK]:{version:"2.0.2",output:{location:"local-file-system",path:"../sdks/csharp"}},[$e.SWIFT_MODEL]:{version:"0.0.0"},[$e.SWIFT_SDK]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/swift/sdk"}},[$e.PHP_MODEL]:{version:"0.0.0"},[$e.PHP_SDK]:{version:"1.16.3",output:{location:"local-file-system",path:"../sdks/php/sdk"}},[$e.RUST_MODEL]:{version:"0.0.1",output:{location:"local-file-system",path:"../models/rust"}},[$e.RUST_SDK]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/rust"}},[$e.CLI]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/cli"}}};_t();var eLt="fernapi",M6e="fern-api";function py(e){return e=gtt(e),e.includes("/")?e:`${eLt}/${e}`}function gtt(e){let t=`${M6e}/`;return e.startsWith(t)?`${eLt}/${e.slice(t.length)}`:e}function hNr(e,t){let r=`${M6e}/`;if(e.startsWith(r)){let n=`${eLt}/${e.slice(r.length)}`;return t.logger.warn(`"${e}" is not a valid generator name. Using "${n}" instead \u2014 the Docker org is "fernapi", not "fern-api".`),n}return e}function L6e(e){let t=`${eLt}/`;return e.startsWith(t)?e.slice(t.length):e}function lao(e,t){let r=z6e(e);return r??t.failAndThrow("Unrecognized generator: "+e,void 0,{code:D.Code.ConfigError})}var PMf={"fernapi/java-model":$e.JAVA_MODEL,"fernapi/fern-typescript-node-sdk":$e.TYPESCRIPT_SDK};function z6e(e){e=py(e);let t=PMf[e];if(t!=null&&(e=t),DMf(e))return e}function DMf(e){return Object.values($e).includes(e)}var tQr=we(Y6e(),1),Nuc=we(Nx(),1);async function M1({generatorName:e,cliVersion:t,channel:r,currentGeneratorVersion:n,includeMajor:i,context:o}){let s=Nuc.default.parse(n),a="https://registry.buildwithfern.com",c=new tQr.FernRegistryClient({environment:a});o?.logger.debug(`Getting latest version for ${e} with CLI version ${t}, includeMajor: ${i}, prior version: ${s}, FDR origin: ${a}`);let u={generator:s9f(e,o),releaseTypes:[r??tQr.FernRegistry.generators.ReleaseType.Ga],cliVersion:t};!i&&s!=null&&(u.generatorMajorVersion=s.major),o?.logger.debug(`[FDR] getLatestGeneratorRelease request: ${JSON.stringify(u)}`);let l=await c.generators.versions.getLatestGeneratorRelease(u);if(l.ok)return o?.logger.debug(`[FDR] getLatestGeneratorRelease response for ${e}: version=${l.body.version}, irVersion=${l.body.irVersion}`),l.body.version;o?.logger.debug(`[FDR] getLatestGeneratorRelease failed for ${e}: ${JSON.stringify(l)}`)}function s9f(e,t){switch(e.startsWith("fernapi/")&&(e=e.replace("fernapi/","")),e){case"fern-python-sdk":return"python-sdk";case"fern-pydantic-model":return"pydantic";case"fern-fastapi-server":return"fastapi";case"fern-typescript":case"fern-typescript-browser-sdk":case"fern-typescript-node-sdk":case"fern-typescript-sdk":return"ts-sdk";case"fern-typescript-express":return"ts-express";case"fern-java-sdk":return"java-sdk";case"fern-java-model":case"java-model":return"java-model";case"fern-java-spring":return"java-spring";case"fern-go-sdk":return"go-sdk";case"fern-go-model":return"go-model";case"fern-csharp-sdk":return"csharp-sdk";case"fern-csharp-model":return"csharp-model";case"fern-ruby-sdk":case"fern-ruby-sdk-v2":return"ruby-sdk-v2";case"fern-postman":return"postman";case"fern-openapi":return"openapi";case"fern-php-sdk":return"php-sdk";case"fern-php-model":return"php-model";case"fern-rust-sdk":return"rust-sdk";case"fern-rust-model":return"rust-model";case"fern-swift-sdk":return"swift-sdk";case"fern-swift-model":return"swift-model";case"fern-cli":return"cli";default:return t?.logger.warn(`Unrecognized generator name found, attempting to parse manually: ${e}`),e.startsWith("fern-")?e.replace("fern-",""):e}}_t();async function juc({generatorsConfiguration:e,groupName:t=e[Un.DEFAULT_GROUP_GENERATORS_CONFIG_KEY],context:r,update:n}){if(t==null){let s=Object.keys(e.groups??{});if(s.length>0){let a=`No group specified. Use the --group option:
|
|
3037
|
+
These pages will fall back to the default language content.`),s[c]=l})),s}async function xMf({translations:e,defaultLocale:t,absolutePathToFernFolder:r,context:n}){if(e==null||e.length===0)return;let i=dW.default.join(r,"translations"),o={},s=e.map(a=>Uh.DocsYmlSchemas.normalizeTranslationConfig(a));if(await Promise.all(s.map(async({lang:a})=>{if(a===t)return;let c=await SMf({translationsRootDir:i,lang:a});if(c==null)return;let{overlayDocsYmlPath:u,overlayDir:l}=c;try{let p=wr.load(await(0,Ipe.readFile)(u,"utf-8"));if(!So(p)){n.logger.warn(`Translation overlay at "${u}" is not a valid YAML object. Skipping.`);return}let d=await BMf({docsYmlContent:p,langFernDir:l,overlayDocsYmlPath:u,context:n});o[a]=d}catch(p){n.logger.warn(`Failed to load translation overlay for locale "${a}": ${String(p)}. Navigation labels will not be translated for this locale.`)}})),Object.keys(o).length!==0)return o}async function SMf({translationsRootDir:e,lang:t}){let r=dW.default.join(e,t),n=dW.default.join(r,"docs.yml");if(await sr(n))return{overlayDocsYmlPath:n,overlayDir:r};let i=dW.default.join(r,"fern"),o=dW.default.join(i,"docs.yml");if(await sr(o))return{overlayDocsYmlPath:o,overlayDir:i}}function vrc(e,t){if(So(e)){let r=e[t];if(typeof r=="string")return r}}async function TMf({rawNavbarLinks:e,overlayDocsYmlPath:t,context:r}){let n=[];for(let[i,o]of e.entries())try{let s=await Uh.RawSchemas.Serializer.NavbarLink.parseOrThrow(o);n.push(s)}catch(s){r.logger.warn(`Invalid navbar-link at index ${i} in "${t}": ${String(s)}. Skipping this entry.`)}return n}async function BMf({docsYmlContent:e,langFernDir:t,overlayDocsYmlPath:r,context:n}){let i={tabs:void 0,products:void 0,versions:void 0,announcement:void 0,navigation:void 0,navbarLinks:void 0};if(So(e.announcement)){let s=vrc(e.announcement,"message");s!=null&&(i.announcement={message:s})}let o=e["navbar-links"];if(Array.isArray(o)){let s=await TMf({rawNavbarLinks:o,overlayDocsYmlPath:r,context:n});i.navbarLinks=xrc(s,r)??[]}if(So(e.tabs)&&(i.tabs=Trc(e.tabs)),Array.isArray(e.products)){i.products=[];for(let s of e.products){if(!So(s))continue;let a=s,c={slug:typeof a.slug=="string"?a.slug:void 0,displayName:typeof a["display-name"]=="string"?a["display-name"]:void 0,subtitle:typeof a.subtitle=="string"?a.subtitle:void 0,announcement:void 0,tabs:void 0,navigation:void 0,versions:void 0};if(So(a.announcement)){let u=vrc(a.announcement,"message");u!=null&&(c.announcement={message:u})}if(typeof a.path=="string"){let u=await Src({relativeNavPath:a.path,overlayDir:t,overlayKind:"product",context:n});u!=null&&(c.tabs=u.tabs,c.navigation=u.navigation)}if(Array.isArray(a.versions)){c.versions=[];for(let u of a.versions)So(u)&&c.versions.push(await Irc({versionObj:u,overlayDir:t,context:n}))}i.products.push(c)}}if(Array.isArray(e.versions)){i.versions=[];for(let s of e.versions)So(s)&&i.versions.push(await Irc({versionObj:s,overlayDir:t,context:n}))}return Array.isArray(e.navigation)&&(i.navigation=[...i.navigation??[],...mNr(e.navigation)]),i}async function Irc({versionObj:e,overlayDir:t,context:r}){let n={slug:typeof e.slug=="string"?e.slug:void 0,displayName:typeof e["display-name"]=="string"?e["display-name"]:void 0,tabs:void 0,navigation:void 0};if(typeof e.path=="string"){let i=await Src({relativeNavPath:e.path,overlayDir:t,overlayKind:"version",context:r});i!=null&&(n.tabs=i.tabs,n.navigation=i.navigation)}return n}async function Src({relativeNavPath:e,overlayDir:t,overlayKind:r,context:n}){let i=dW.default.resolve(t,e);if(!i.startsWith(t)){n.logger.warn(`Invalid path in ${r} overlay: "${e}" escapes the translations directory. Skipping.`);return}if(await sr(i))try{let o=wr.load(await(0,Ipe.readFile)(i,"utf-8"));if(!So(o))return;let s=o;return{tabs:So(s.tabs)?Trc(s.tabs):void 0,navigation:Array.isArray(s.navigation)?mNr(s.navigation):void 0}}catch(o){n.logger.warn(`Failed to load translation nav file "${i}": ${String(o)}`);return}}function Trc(e){let t={};for(let[r,n]of Object.entries(e))if(So(n)){let i=n;t[r]={displayName:typeof i["display-name"]=="string"?i["display-name"]:void 0,slug:typeof i.slug=="string"?i.slug:void 0}}return t}function mNr(e){let t=[];for(let r of e){if(!So(r))continue;let n=r;if(typeof n.tab=="string"){let i={type:"tab",tabId:n.tab,layout:Array.isArray(n.layout)?mNr(n.layout):void 0,variants:Array.isArray(n.variants)?OMf(n.variants):void 0};t.push(i);continue}if(typeof n.section=="string"){let i={type:"section",title:n.section,slug:typeof n.slug=="string"?n.slug:void 0,contents:Array.isArray(n.contents)?mNr(n.contents):void 0};t.push(i);continue}if(typeof n.page=="string"){let i={type:"page",title:n.page,slug:typeof n.slug=="string"?n.slug:void 0};t.push(i);continue}}return t}function OMf(e){let t=[];for(let r of e){if(!So(r))continue;let n=r;t.push({title:typeof n.title=="string"?n.title:void 0,subtitle:typeof n.subtitle=="string"?n.subtitle:void 0,slug:typeof n.slug=="string"?n.slug:void 0})}return t}jt();tr();_t();var Orc=require("fs/promises");as();var Brc=Bt.strictObject({organization:Bt.string(),version:Bt.string()});async function CO({directory:e,context:t}){let r=Ze(e,Fe.of(qE)),n=await(0,Orc.readFile)(r),i;try{i=JSON.parse(n.toString())}catch(s){throw new D({message:`Failed to parse ${qE}: ${qn(s)}`,code:D.Code.ParseError})}let o=await xOr({schema:Brc,value:i,context:t,filepathBeingParsed:r});return{_absolutePath:r,rawConfig:o,organization:o.organization,version:o.version}}var $e={TYPESCRIPT:"fernapi/fern-typescript",TYPESCRIPT_SDK:"fernapi/fern-typescript-sdk",TYPESCRIPT_NODE_SDK:"fernapi/fern-typescript-node-sdk",TYPESCRIPT_BROWSER_SDK:"fernapi/fern-typescript-browser-sdk",TYPESCRIPT_EXPRESS:"fernapi/fern-typescript-express",JAVA:"fernapi/fern-java",JAVA_MODEL:"fernapi/fern-java-model",JAVA_SDK:"fernapi/fern-java-sdk",JAVA_SPRING:"fernapi/fern-java-spring",PYTHON_FASTAPI:"fernapi/fern-fastapi-server",PYTHON_PYDANTIC:"fernapi/fern-pydantic-model",PYTHON_SDK:"fernapi/fern-python-sdk",GO_MODEL:"fernapi/fern-go-model",GO_SDK:"fernapi/fern-go-sdk",RUBY_SDK:"fernapi/fern-ruby-sdk",CSHARP_MODEL:"fernapi/fern-csharp-model",CSHARP_SDK:"fernapi/fern-csharp-sdk",SWIFT_MODEL:"fernapi/fern-swift-model",SWIFT_SDK:"fernapi/fern-swift-sdk",PHP_MODEL:"fernapi/fern-php-model",PHP_SDK:"fernapi/fern-php-sdk",RUST_MODEL:"fernapi/fern-rust-model",RUST_SDK:"fernapi/fern-rust-sdk",OPENAPI:"fernapi/fern-openapi",STOPLIGHT:"fernapi/fern-stoplight",POSTMAN:"fernapi/fern-postman",OPENAPI_PYTHON_CLIENT:"fernapi/openapi-python-client",CLI:"fernapi/fern-cli-generator"};_t();var Tuo=we(Nx(),1);var $6t={[$e.JAVA]:{version:"2.38.1"},[$e.TYPESCRIPT_EXPRESS]:{version:"0.18.4",output:{location:"local-file-system",path:"../src/fern"}},[$e.JAVA_MODEL]:{version:"1.0.0"},[$e.JAVA_SDK]:{version:"2.38.1",output:{location:"local-file-system",path:"../sdks/java/src/main/java/"}},[$e.JAVA_SPRING]:{version:"0.9.2",output:{location:"local-file-system",path:"../src/main/java/com/fern"}},[$e.TYPESCRIPT]:{version:"0.0.247"},[$e.TYPESCRIPT_SDK]:{version:"3.71.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[$e.TYPESCRIPT_NODE_SDK]:{version:"3.71.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[$e.TYPESCRIPT_BROWSER_SDK]:{version:"1.0.0",output:{location:"local-file-system",path:"../sdks/typescript"}},[$e.PYTHON_PYDANTIC]:{version:"1.4.7"},[$e.PYTHON_FASTAPI]:{version:"1.7.0",output:{location:"local-file-system",path:"../src/fern"}},[$e.PYTHON_SDK]:{version:"4.23.2",output:{location:"local-file-system",path:"../sdks/python"}},[$e.GO_MODEL]:{version:"0.23.5"},[$e.GO_SDK]:{version:"1.4.0",output:{location:"local-file-system",path:"../sdks/go"},config:{module:{path:"sdk"}}},[$e.RUBY_SDK]:{version:"0.8.2",output:{location:"local-file-system",path:"../sdks/ruby"}},[$e.OPENAPI]:{version:"0.1.7",config:{format:"yaml"},output:{location:"local-file-system",path:"../openapi"}},[$e.STOPLIGHT]:{version:"0.0.28",config:{format:"yaml"}},[$e.POSTMAN]:{version:"0.4.0",output:{location:"local-file-system",path:"../postman"}},[$e.OPENAPI_PYTHON_CLIENT]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/python"},config:{format:"yaml"}},[$e.CSHARP_MODEL]:{version:"0.0.1"},[$e.CSHARP_SDK]:{version:"2.0.2",output:{location:"local-file-system",path:"../sdks/csharp"}},[$e.SWIFT_MODEL]:{version:"0.0.0"},[$e.SWIFT_SDK]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/swift/sdk"}},[$e.PHP_MODEL]:{version:"0.0.0"},[$e.PHP_SDK]:{version:"1.16.3",output:{location:"local-file-system",path:"../sdks/php/sdk"}},[$e.RUST_MODEL]:{version:"0.0.1",output:{location:"local-file-system",path:"../models/rust"}},[$e.RUST_SDK]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/rust"}},[$e.CLI]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/cli"}}};_t();var eLt="fernapi",M6e="fern-api";function py(e){return e=gtt(e),e.includes("/")?e:`${eLt}/${e}`}function gtt(e){let t=`${M6e}/`;return e.startsWith(t)?`${eLt}/${e.slice(t.length)}`:e}function hNr(e,t){let r=`${M6e}/`;if(e.startsWith(r)){let n=`${eLt}/${e.slice(r.length)}`;return t.logger.warn(`"${e}" is not a valid generator name. Using "${n}" instead \u2014 the Docker org is "fernapi", not "fern-api".`),n}return e}function L6e(e){let t=`${eLt}/`;return e.startsWith(t)?e.slice(t.length):e}function lao(e,t){let r=z6e(e);return r??t.failAndThrow("Unrecognized generator: "+e,void 0,{code:D.Code.ConfigError})}var PMf={"fernapi/java-model":$e.JAVA_MODEL,"fernapi/fern-typescript-node-sdk":$e.TYPESCRIPT_SDK};function z6e(e){e=py(e);let t=PMf[e];if(t!=null&&(e=t),DMf(e))return e}function DMf(e){return Object.values($e).includes(e)}var tQr=we(Y6e(),1),Nuc=we(Nx(),1);async function M1({generatorName:e,cliVersion:t,channel:r,currentGeneratorVersion:n,includeMajor:i,context:o}){let s=Nuc.default.parse(n),a="https://registry.buildwithfern.com",c=new tQr.FernRegistryClient({environment:a});o?.logger.debug(`Getting latest version for ${e} with CLI version ${t}, includeMajor: ${i}, prior version: ${s}, FDR origin: ${a}`);let u={generator:s9f(e,o),releaseTypes:[r??tQr.FernRegistry.generators.ReleaseType.Ga],cliVersion:t};!i&&s!=null&&(u.generatorMajorVersion=s.major),o?.logger.debug(`[FDR] getLatestGeneratorRelease request: ${JSON.stringify(u)}`);let l=await c.generators.versions.getLatestGeneratorRelease(u);if(l.ok)return o?.logger.debug(`[FDR] getLatestGeneratorRelease response for ${e}: version=${l.body.version}, irVersion=${l.body.irVersion}`),l.body.version;o?.logger.debug(`[FDR] getLatestGeneratorRelease failed for ${e}: ${JSON.stringify(l)}`)}function s9f(e,t){switch(e.startsWith("fernapi/")&&(e=e.replace("fernapi/","")),e){case"fern-python-sdk":return"python-sdk";case"fern-pydantic-model":return"pydantic";case"fern-fastapi-server":return"fastapi";case"fern-typescript":case"fern-typescript-browser-sdk":case"fern-typescript-node-sdk":case"fern-typescript-sdk":return"ts-sdk";case"fern-typescript-express":return"ts-express";case"fern-java-sdk":return"java-sdk";case"fern-java-model":case"java-model":return"java-model";case"fern-java-spring":return"java-spring";case"fern-go-sdk":return"go-sdk";case"fern-go-model":return"go-model";case"fern-csharp-sdk":return"csharp-sdk";case"fern-csharp-model":return"csharp-model";case"fern-ruby-sdk":case"fern-ruby-sdk-v2":return"ruby-sdk-v2";case"fern-postman":return"postman";case"fern-openapi":return"openapi";case"fern-php-sdk":return"php-sdk";case"fern-php-model":return"php-model";case"fern-rust-sdk":return"rust-sdk";case"fern-rust-model":return"rust-model";case"fern-swift-sdk":return"swift-sdk";case"fern-swift-model":return"swift-model";case"fern-cli":case"fern-cli-generator":return"cli";default:return t?.logger.warn(`Unrecognized generator name found, attempting to parse manually: ${e}`),e.startsWith("fern-")?e.replace("fern-",""):e}}_t();async function juc({generatorsConfiguration:e,groupName:t=e[Un.DEFAULT_GROUP_GENERATORS_CONFIG_KEY],context:r,update:n}){if(t==null){let s=Object.keys(e.groups??{});if(s.length>0){let a=`No group specified. Use the --group option:
|
|
3038
3038
|
`+s.map(c=>` \u203A ${c}`).join(`
|
|
3039
3039
|
`);return r.failAndThrow(a,void 0,{code:D.Code.ConfigError})}return r.failAndThrow("No group specified.",void 0,{code:D.Code.ConfigError})}let i=e.groups??={},o=i[t];if(o==null){let s=i[t]??={generators:[]};await n(s,t)}else await n(o,t);return e}async function Buo({generatorName:e,generatorsConfiguration:t,groupName:r=t[Mye],context:n,cliVersion:i}){let o=lao(e,n),s=L6e(o),a=$6t[o];return await juc({generatorsConfiguration:t,groupName:r,context:n,update:async c=>{c.generators.some(p=>py("image"in p?p.image.name:p.name)===o)&&n.failAndThrow(`${e} is already installed in group ${r}.`,void 0,{code:D.Code.ConfigError});let u=await M1({cliVersion:i,generatorName:o,context:n,channel:void 0}),l=u!=null&&Tuo.default.valid(u)&&Tuo.default.gt(u,a.version)?u:a.version;c.generators.push({name:s,...a,version:l})}})}jt();tr();SY();_t();var qr={};te(qr,{ApiId:()=>rQr,CommitSha:()=>nQr,GithubLicense:()=>gve,GithubLicenseId:()=>sQr,GithubOutputModeV2:()=>F$,GithubPublishInfo:()=>L1,GithubPullRequestReviewer:()=>Ave,LogLevel:()=>Ztt,Mode:()=>oQr,OrganizationId:()=>iQr,OutputMode:()=>QQ,PackageCoordinate:()=>eR,PackagePublishStatus:()=>$tt,PublishOutputModeV2:()=>z1,RemoteGenJobId:()=>aQr,RemoteGenTaskId:()=>cQr,TaskStatus:()=>aV,commons:()=>Ouo,definitionRegistry:()=>LA,demoCreation:()=>X6e,health:()=>Z6e,remoteGen:()=>Qi});var Ouo={};te(Ouo,{ApiId:()=>rQr,CommitSha:()=>nQr,OrganizationId:()=>iQr});function rQr(e){return e}function nQr(e){return e}function iQr(e){return e}var LA={};te(LA,{get:()=>Puo,getLatestVersion:()=>Duo,registerUsingOrgToken:()=>Ruo});var Puo={};te(Puo,{Error:()=>a9f});var a9f={orgDoesNotExistError:()=>({error:"OrgDoesNotExistError",_visit:function(e){return LA.get.Error._visit(this,e)}}),apiDoesNotExistError:()=>({error:"ApiDoesNotExistError",_visit:function(e){return LA.get.Error._visit(this,e)}}),versionDoesNotExistError:()=>({error:"VersionDoesNotExistError",_visit:function(e){return LA.get.Error._visit(this,e)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return LA.get.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){case"OrgDoesNotExistError":return t.orgDoesNotExistError();case"ApiDoesNotExistError":return t.apiDoesNotExistError();case"VersionDoesNotExistError":return t.versionDoesNotExistError();default:return t._other(e.content)}}};var Duo={};te(Duo,{Error:()=>c9f});var c9f={orgDoesNotExistError:()=>({error:"OrgDoesNotExistError",_visit:function(e){return LA.getLatestVersion.Error._visit(this,e)}}),apiDoesNotExistError:()=>({error:"ApiDoesNotExistError",_visit:function(e){return LA.getLatestVersion.Error._visit(this,e)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return LA.getLatestVersion.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){case"OrgDoesNotExistError":return t.orgDoesNotExistError();case"ApiDoesNotExistError":return t.apiDoesNotExistError();default:return t._other(e.content)}}};var Ruo={};te(Ruo,{Error:()=>u9f});var u9f={versionAlreadyExists:()=>({error:"VersionAlreadyExists",_visit:function(e){return LA.registerUsingOrgToken.Error._visit(this,e)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return LA.registerUsingOrgToken.Error._visit(this,t)}}),_visit:(e,t)=>e.error==="VersionAlreadyExists"?t.versionAlreadyExists():t._other(e.content)};var X6e={};te(X6e,{Mode:()=>oQr,createSdkDemo:()=>Fuo});var Fuo={};te(Fuo,{Error:()=>l9f});var l9f={_unknown:e=>({error:void 0,content:e,_visit:function(t){return X6e.createSdkDemo.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};var p9f={Fern:"FERN",Openapi:"OPENAPI"},oQr=Object.assign(Object.assign({},p9f),{_visit:(e,t)=>{switch(e){case oQr.Fern:return t.fern();case oQr.Openapi:return t.openapi();default:return t._other()}}});var Z6e={};te(Z6e,{status:()=>kuo});var kuo={};te(kuo,{Error:()=>f9f});var f9f={_unknown:e=>({error:void 0,content:e,_visit:function(t){return Z6e.status.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};var Qi={};te(Qi,{GithubLicense:()=>gve,GithubLicenseId:()=>sQr,GithubOutputModeV2:()=>F$,GithubPublishInfo:()=>L1,GithubPullRequestReviewer:()=>Ave,LogLevel:()=>Ztt,OutputMode:()=>QQ,PackageCoordinate:()=>eR,PackagePublishStatus:()=>$tt,PublishOutputModeV2:()=>z1,RemoteGenJobId:()=>aQr,RemoteGenTaskId:()=>cQr,TaskStatus:()=>aV,createJob:()=>Nuo,createJobV2:()=>juo,createJobV3:()=>Quo,createReplayInitPr:()=>Muo,getDefinitionUploadUrl:()=>Luo,getJobStatus:()=>zuo});var Nuo={};te(Nuo,{Error:()=>d9f});var d9f={illegalApiNameError:()=>({error:"IllegalApiNameError",_visit:function(e){return Qi.createJob.Error._visit(this,e)}}),illegalApiVersionError:e=>({content:e,error:"IllegalApiVersionError",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),generatorsDoNotExistError:e=>({content:e,error:"GeneratorsDoNotExistError",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),cannotPublishToNpmScope:e=>({content:e,error:"CannotPublishToNpmScope",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),cannotPublishToMavenGroup:e=>({content:e,error:"CannotPublishToMavenGroup",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),cannotPublishPypiPackage:e=>({content:e,error:"CannotPublishPypiPackage",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),insufficientPermissions:e=>({content:e,error:"InsufficientPermissions",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),orgNotConfiguredForWhitelabel:e=>({content:e,error:"OrgNotConfiguredForWhitelabel",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),branchDoesNotExist:e=>({content:e,error:"BranchDoesNotExist",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),rateLimitExceeded:e=>({content:e,error:"RateLimitExceeded",_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return Qi.createJob.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){case"IllegalApiNameError":return t.illegalApiNameError();case"IllegalApiVersionError":return t.illegalApiVersionError(e.content);case"GeneratorsDoNotExistError":return t.generatorsDoNotExistError(e.content);case"CannotPublishToNpmScope":return t.cannotPublishToNpmScope(e.content);case"CannotPublishToMavenGroup":return t.cannotPublishToMavenGroup(e.content);case"CannotPublishPypiPackage":return t.cannotPublishPypiPackage(e.content);case"InsufficientPermissions":return t.insufficientPermissions(e.content);case"OrgNotConfiguredForWhitelabel":return t.orgNotConfiguredForWhitelabel(e.content);case"BranchDoesNotExist":return t.branchDoesNotExist(e.content);case"RateLimitExceeded":return t.rateLimitExceeded(e.content);default:return t._other(e.content)}}};var juo={};te(juo,{Error:()=>m9f});var m9f={illegalApiNameError:()=>({error:"IllegalApiNameError",_visit:function(e){return Qi.createJobV2.Error._visit(this,e)}}),illegalApiVersionError:e=>({content:e,error:"IllegalApiVersionError",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),generatorsDoNotExistError:e=>({content:e,error:"GeneratorsDoNotExistError",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),cannotPublishToNpmScope:e=>({content:e,error:"CannotPublishToNpmScope",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),cannotPublishToMavenGroup:e=>({content:e,error:"CannotPublishToMavenGroup",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),cannotPublishPypiPackage:e=>({content:e,error:"CannotPublishPypiPackage",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),insufficientPermissions:e=>({content:e,error:"InsufficientPermissions",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),orgNotConfiguredForWhitelabel:e=>({content:e,error:"OrgNotConfiguredForWhitelabel",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),branchDoesNotExist:e=>({content:e,error:"BranchDoesNotExist",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),rateLimitExceeded:e=>({content:e,error:"RateLimitExceeded",_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return Qi.createJobV2.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){case"IllegalApiNameError":return t.illegalApiNameError();case"IllegalApiVersionError":return t.illegalApiVersionError(e.content);case"GeneratorsDoNotExistError":return t.generatorsDoNotExistError(e.content);case"CannotPublishToNpmScope":return t.cannotPublishToNpmScope(e.content);case"CannotPublishToMavenGroup":return t.cannotPublishToMavenGroup(e.content);case"CannotPublishPypiPackage":return t.cannotPublishPypiPackage(e.content);case"InsufficientPermissions":return t.insufficientPermissions(e.content);case"OrgNotConfiguredForWhitelabel":return t.orgNotConfiguredForWhitelabel(e.content);case"BranchDoesNotExist":return t.branchDoesNotExist(e.content);case"RateLimitExceeded":return t.rateLimitExceeded(e.content);default:return t._other(e.content)}}};var Quo={};te(Quo,{Error:()=>h9f});var h9f={illegalApiNameError:()=>({error:"IllegalApiNameError",_visit:function(e){return Qi.createJobV3.Error._visit(this,e)}}),illegalApiVersionError:e=>({content:e,error:"IllegalApiVersionError",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),generatorsDoNotExistError:e=>({content:e,error:"GeneratorsDoNotExistError",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),cannotPublishToNpmScope:e=>({content:e,error:"CannotPublishToNpmScope",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),cannotPublishToMavenGroup:e=>({content:e,error:"CannotPublishToMavenGroup",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),cannotPublishPypiPackage:e=>({content:e,error:"CannotPublishPypiPackage",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),insufficientPermissions:e=>({content:e,error:"InsufficientPermissions",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),orgNotConfiguredForWhitelabel:e=>({content:e,error:"OrgNotConfiguredForWhitelabel",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),branchDoesNotExist:e=>({content:e,error:"BranchDoesNotExist",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),rateLimitExceeded:e=>({content:e,error:"RateLimitExceeded",_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return Qi.createJobV3.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){case"IllegalApiNameError":return t.illegalApiNameError();case"IllegalApiVersionError":return t.illegalApiVersionError(e.content);case"GeneratorsDoNotExistError":return t.generatorsDoNotExistError(e.content);case"CannotPublishToNpmScope":return t.cannotPublishToNpmScope(e.content);case"CannotPublishToMavenGroup":return t.cannotPublishToMavenGroup(e.content);case"CannotPublishPypiPackage":return t.cannotPublishPypiPackage(e.content);case"InsufficientPermissions":return t.insufficientPermissions(e.content);case"OrgNotConfiguredForWhitelabel":return t.orgNotConfiguredForWhitelabel(e.content);case"BranchDoesNotExist":return t.branchDoesNotExist(e.content);case"RateLimitExceeded":return t.rateLimitExceeded(e.content);default:return t._other(e.content)}}};var Muo={};te(Muo,{Error:()=>g9f});var g9f={insufficientPermissions:e=>({content:e,error:"InsufficientPermissions",_visit:function(t){return Qi.createReplayInitPr.Error._visit(this,t)}}),githubAppNotInstalled:e=>({content:e,error:"GithubAppNotInstalled",_visit:function(t){return Qi.createReplayInitPr.Error._visit(this,t)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return Qi.createReplayInitPr.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){case"InsufficientPermissions":return t.insufficientPermissions(e.content);case"GithubAppNotInstalled":return t.githubAppNotInstalled(e.content);default:return t._other(e.content)}}};var Luo={};te(Luo,{Error:()=>A9f});var A9f={insufficientPermissions:e=>({content:e,error:"InsufficientPermissions",_visit:function(t){return Qi.getDefinitionUploadUrl.Error._visit(this,t)}}),_unknown:e=>({error:void 0,content:e,_visit:function(t){return Qi.getDefinitionUploadUrl.Error._visit(this,t)}}),_visit:(e,t)=>e.error==="InsufficientPermissions"?t.insufficientPermissions(e.content):t._other(e.content)};var zuo={};te(zuo,{Error:()=>y9f});var y9f={_unknown:e=>({error:void 0,content:e,_visit:function(t){return Qi.getJobStatus.Error._visit(this,t)}}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};var gve={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return gve._visit(this,t)}}),custom:e=>Object.assign(Object.assign({},e),{type:"custom",_visit:function(t){return gve._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 b9f={Mit:"MIT",Apache:"APACHE"},sQr=Object.assign(Object.assign({},b9f),{_visit:(e,t)=>{switch(e){case sQr.Mit:return t.mit();case sQr.Apache:return t.apache();default:return t._other()}}});var F$={push:e=>Object.assign(Object.assign({},e),{type:"push",_visit:function(t){return F$._visit(this,t)}}),commitAndRelease:e=>Object.assign(Object.assign({},e),{type:"commitAndRelease",_visit:function(t){return F$._visit(this,t)}}),pullRequest:e=>Object.assign(Object.assign({},e),{type:"pullRequest",_visit:function(t){return F$._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"push":return t.push(e);case"commitAndRelease":return t.commitAndRelease(e);case"pullRequest":return t.pullRequest(e);default:return t._other(e)}}};var L1={npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return L1._visit(this,t)}}),maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return L1._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return L1._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return L1._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return L1._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return L1._visit(this,t)}}),crates:e=>Object.assign(Object.assign({},e),{type:"crates",_visit:function(t){return L1._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 Ave={team:e=>Object.assign(Object.assign({},e),{type:"team",_visit:function(t){return Ave._visit(this,t)}}),user:e=>Object.assign(Object.assign({},e),{type:"user",_visit:function(t){return Ave._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"team":return t.team(e);case"user":return t.user(e);default:return t._other(e)}}};var E9f={Debug:"DEBUG",Info:"INFO",Warn:"WARN",Error:"ERROR"},Ztt=Object.assign(Object.assign({},E9f),{_visit:(e,t)=>{switch(e){case Ztt.Debug:return t.debug();case Ztt.Info:return t.info();case Ztt.Warn:return t.warn();case Ztt.Error:return t.error();default:return t._other()}}});var QQ={publish:e=>Object.assign(Object.assign({},e),{type:"publish",_visit:function(t){return QQ._visit(this,t)}}),publishV2:e=>({publishV2:e,type:"publishV2",_visit:function(t){return QQ._visit(this,t)}}),downloadFiles:e=>Object.assign(Object.assign({},e),{type:"downloadFiles",_visit:function(t){return QQ._visit(this,t)}}),github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return QQ._visit(this,t)}}),githubV2:e=>({githubV2:e,type:"githubV2",_visit:function(t){return QQ._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"publish":return t.publish(e);case"publishV2":return t.publishV2(e.publishV2);case"downloadFiles":return t.downloadFiles(e);case"github":return t.github(e);case"githubV2":return t.githubV2(e.githubV2);default:return t._other(e)}}};var eR={npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return eR._visit(this,t)}}),maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return eR._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return eR._visit(this,t)}}),ruby:e=>Object.assign(Object.assign({},e),{type:"ruby",_visit:function(t){return eR._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return eR._visit(this,t)}}),crates:e=>Object.assign(Object.assign({},e),{type:"crates",_visit:function(t){return eR._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"npm":return t.npm(e);case"maven":return t.maven(e);case"pypi":return t.pypi(e);case"ruby":return t.ruby(e);case"nuget":return t.nuget(e);case"crates":return t.crates(e);default:return t._other(e)}}};var v9f={NotStartedPublishing:"NOT_STARTED_PUBLISHING",Publishing:"PUBLISHING",Published:"PUBLISHED",FailedToPublish:"FAILED_TO_PUBLISH"},$tt=Object.assign(Object.assign({},v9f),{_visit:(e,t)=>{switch(e){case $tt.NotStartedPublishing:return t.notStartedPublishing();case $tt.Publishing:return t.publishing();case $tt.Published:return t.published();case $tt.FailedToPublish:return t.failedToPublish();default:return t._other()}}});var z1={npmOverride:e=>({npmOverride:e,type:"npmOverride",_visit:function(t){return z1._visit(this,t)}}),mavenOverride:e=>({mavenOverride:e,type:"mavenOverride",_visit:function(t){return z1._visit(this,t)}}),pypiOverride:e=>({pypiOverride:e,type:"pypiOverride",_visit:function(t){return z1._visit(this,t)}}),rubyGemsOverride:e=>({rubyGemsOverride:e,type:"rubyGemsOverride",_visit:function(t){return z1._visit(this,t)}}),nugetOverride:e=>({nugetOverride:e,type:"nugetOverride",_visit:function(t){return z1._visit(this,t)}}),cratesOverride:e=>({cratesOverride:e,type:"cratesOverride",_visit:function(t){return z1._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return z1._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"npmOverride":return t.npmOverride(e.npmOverride);case"mavenOverride":return t.mavenOverride(e.mavenOverride);case"pypiOverride":return t.pypiOverride(e.pypiOverride);case"rubyGemsOverride":return t.rubyGemsOverride(e.rubyGemsOverride);case"nugetOverride":return t.nugetOverride(e.nugetOverride);case"cratesOverride":return t.cratesOverride(e.cratesOverride);case"postman":return t.postman(e);default:return t._other(e)}}};function aQr(e){return e}function cQr(e){return e}var aV={notStarted:()=>({type:"notStarted",_visit:function(e){return aV._visit(this,e)}}),running:()=>({type:"running",_visit:function(e){return aV._visit(this,e)}}),failed:e=>Object.assign(Object.assign({},e),{type:"failed",_visit:function(t){return aV._visit(this,t)}}),finished:e=>Object.assign(Object.assign({},e),{type:"finished",_visit:function(t){return aV._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"notStarted":return t.notStarted();case"running":return t.running();case"failed":return t.failed(e);case"finished":return t.finished(e);default:return t._other(e)}}};var FLt=class{getAuthRequest(){return Promise.resolve({headers:{}})}};var I9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},Quc={get:(e,t)=>I9f(void 0,void 0,void 0,function*(){return typeof e=="function"?e(t):e})};var kLt=(e,t,r)=>JSON.stringify(e,t,r);function NLt(e,t){return JSON.parse(e,t)}var IW={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Muc={[IW.Debug]:1,[IW.Info]:2,[IW.Warn]:3,[IW.Error]:4},jLt=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)}},ert=class{constructor(t){this.level=Muc[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=Muc[t]}isDebug(){return this.shouldLog(IW.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(IW.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(IW.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(IW.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}};function Uuo(e){var t,r,n;return e==null?C9f:e instanceof ert?e:(e=e??{},(t=e.level)!==null&&t!==void 0||(e.level=IW.Info),(r=e.logger)!==null&&r!==void 0||(e.logger=new jLt),(n=e.silent)!==null&&n!==void 0||(e.silent=!0),new ert(e))}var C9f=new ert({level:IW.Info,logger:new jLt,silent:!0});var w9f={arrayFormat:"indices",encode:!0};function Luc(e,t){if(e===void 0||e===null)return"";let r=String(e);return t?encodeURIComponent(r):r}function _uo(e,t="",r){let n=[];for(let[i,o]of Object.entries(e)){let s=t?`${t}[${i}]`:i;if(o!==void 0)if(Array.isArray(o)){if(o.length===0)continue;for(let a=0;a<o.length;a++){let c=o[a];if(c!==void 0)if(typeof c=="object"&&!Array.isArray(c)&&c!==null){let u=r.arrayFormat==="indices"?`${s}[${a}]`:s;n.push(..._uo(c,u,r))}else{let u=r.arrayFormat==="indices"?`${s}[${a}]`:s,l=r.encode?encodeURIComponent(u):u;n.push(`${l}=${Luc(c,r.encode)}`)}}}else if(typeof o=="object"&&o!==null){if(Object.keys(o).length===0)continue;n.push(..._uo(o,s,r))}else{let a=r.encode?encodeURIComponent(s):s;n.push(`${a}=${Luc(o,r.encode)}`)}}return n}function trt(e,t){return e==null||typeof e!="object"?"":_uo(e,"",Object.assign(Object.assign({},w9f),t)).join("&")}function zuc(e,t){let r=trt(t,{arrayFormat:"repeat"});return r?`${e}?${r}`:e}function Uuc(e){let t={get bodyUsed(){return e.bodyUsed},stream:()=>e.body,arrayBuffer:e.arrayBuffer.bind(e),blob:e.blob.bind(e)};return"bytes"in e&&typeof e.bytes=="function"&&(t.bytes=e.bytes.bind(e)),t}var x9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};function uQr(e,t){return x9f(this,void 0,void 0,function*(){switch(t){case"binary-response":return Uuc(e);case"blob":return yield e.blob();case"arrayBuffer":return yield e.arrayBuffer();case"sse":return e.body==null?{ok:!1,error:{reason:"body-is-null",statusCode:e.status}}:e.body;case"streaming":return e.body==null?{ok:!1,error:{reason:"body-is-null",statusCode:e.status}}:e.body;case"text":return yield e.text()}let r=yield e.text();if(r.length>0)try{return NLt(r)}catch{return{ok:!1,error:{reason:"non-json",statusCode:e.status,rawBody:r}}}})}var S9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};function _uc(e){return S9f(this,void 0,void 0,function*(){var t,r,n;let i=(t=e.headers.get("Content-Type"))===null||t===void 0?void 0:t.toLowerCase();if(i==null||i.length===0)return uQr(e);switch(i.indexOf(";")!==-1&&(i=(n=(r=i.split(";")[0])===null||r===void 0?void 0:r.trim())!==null&&n!==void 0?n:""),i){case"application/hal+json":case"application/json":case"application/ld+json":case"application/problem+json":case"application/vnd.api+json":case"text/json":{let o=yield e.text();return o.length>0?NLt(o):void 0}default:if(i.startsWith("application/vnd.")&&i.endsWith("+json")){let o=yield e.text();return o.length>0?NLt(o):void 0}return yield e.text()}})}var T9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};function Vuc(){return T9f(this,void 0,void 0,function*(){return fetch})}var B9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};function quc(e){return B9f(this,arguments,void 0,function*({body:t,type:r}){return r==="form"?trt(t,{arrayFormat:"repeat",encode:!0}):r.includes("json")?kLt(t):t})}var yve;typeof globalThis.Headers<"u"?yve=globalThis.Headers:yve=class Guc{constructor(t){if(this.headers=new Map,t)if(t instanceof Guc)t.forEach((r,n)=>this.append(n,r));else if(Array.isArray(t))for(let[r,n]of t)if(typeof r=="string"&&typeof n=="string")this.append(r,n);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[r,n]of Object.entries(t))if(typeof n=="string")this.append(r,n);else throw new TypeError("Header values must be strings")}append(t,r){let n=t.toLowerCase(),i=this.headers.get(n)||[];this.headers.set(n,[...i,r])}delete(t){let r=t.toLowerCase();this.headers.delete(r)}get(t){let r=t.toLowerCase(),n=this.headers.get(r);return n?n.join(", "):null}has(t){let r=t.toLowerCase();return this.headers.has(r)}set(t,r){let n=t.toLowerCase();this.headers.set(n,[r])}forEach(t,r){let n=r?t.bind(r):t;this.headers.forEach((i,o)=>n(i.join(", "),o,this))}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[t,r]of this.headers.entries())yield[t,r.join(", ")]}*keys(){yield*this.headers.keys()}*values(){for(let t of this.headers.values())yield t.join(", ")}[Symbol.iterator](){return this.entries()}};var O9f="timeout";function Wuc(e){let t=new AbortController,r=setTimeout(()=>t.abort(O9f),e);return{signal:t.signal,abortId:r}}function Huc(...e){let t=e.length===1&&Array.isArray(e[0])?e[0]:e,r=new AbortController;for(let n of t){if(n.aborted){r.abort(n?.reason);break}n.addEventListener("abort",()=>r.abort(n?.reason),{signal:r.signal})}return r.signal}var P9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},Kuc=(e,t,r,n,i,o,s,a,c)=>P9f(void 0,void 0,void 0,function*(){let u=[],l;if(o!=null){let{signal:f,abortId:m}=Wuc(o);l=m,u.push(f)}s!=null&&u.push(s);let p=Huc(u),d=yield e(t,{method:r,headers:n,body:i,signal:p,credentials:a?"include":void 0,duplex:c});return l!=null&&clearTimeout(l),d});var Vuo={headers:new yve,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""},quo={headers:new yve,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function Guo(e){return{headers:e.headers,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url}}var D9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};function R9f(e){let t=1+Math.random()*.2;return e*t}function F9f(e){let t=1+(Math.random()-.5)*.2;return e*t}function k9f(e,t){let r=e.headers.get("Retry-After");if(r){let i=parseInt(r,10);if(!Number.isNaN(i)&&i>0)return Math.min(i*1e3,6e4);let o=new Date(r);if(!Number.isNaN(o.getTime())){let s=o.getTime()-Date.now();if(s>0)return Math.min(Math.max(s,0),6e4)}}let n=e.headers.get("X-RateLimit-Reset");if(n){let i=parseInt(n,10);if(!Number.isNaN(i)){let o=i*1e3-Date.now();if(o>0)return R9f(Math.min(o,6e4))}}return F9f(Math.min(1e3*Math.pow(2,t),6e4))}function Juc(e){return D9f(this,arguments,void 0,function*(t,r=2){let n=yield t();for(let i=0;i<r&&([408,429].includes(n.status)||n.status>=500);++i){let o=k9f(n,i);yield new Promise(s=>setTimeout(s,o)),n=yield t()}return n})}var Huo=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},N9f=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function Wuo(e){let t={};for(let[r,n]of e instanceof yve?e.entries():Object.entries(e))N9f.has(r.toLowerCase())?t[r]="[REDACTED]":t[r]=n;return t}var Kuo=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function j9f(e){if(e==null)return e;let t={};for(let[r,n]of Object.entries(e))Kuo.has(r.toLowerCase())?t[r]="[REDACTED]":t[r]=n;return t}function $6e(e){let t=e.indexOf("://");if(t===-1)return e;let r=t+3,n=e.indexOf("/",r),i=e.indexOf("?",r),o=e.indexOf("#",r),s=Math.min(n===-1?e.length:n,i===-1?e.length:i,o===-1?e.length:o),a=-1;for(let m=r;m<s;m++)e[m]==="@"&&(a=m);if(a!==-1&&(e=`${e.slice(0,r)}[REDACTED]@${e.slice(a+1)}`),i=e.indexOf("?"),i===-1)return e;o=e.indexOf("#",i);let c=o!==-1?o:e.length,u=e.slice(i+1,c);if(u.length===0)return e;let l=u.toLowerCase();if(!(l.includes("token")||l.includes("key")||l.includes("password")||l.includes("passwd")||l.includes("secret")||l.includes("session")||l.includes("auth")))return e;let d=[],f=u.split("&");for(let m of f){let h=m.indexOf("=");if(h===-1){d.push(m);continue}let A=m.slice(0,h),y=Kuo.has(A.toLowerCase());if(!y&&A.includes("%"))try{let I=decodeURIComponent(A);y=Kuo.has(I.toLowerCase())}catch{}d.push(y?`${A}=[REDACTED]`:m)}return e.slice(0,i+1)+d.join("&")+e.slice(c)}function Q9f(e){return Huo(this,void 0,void 0,function*(){var t;let r=new yve;if(r.set("Accept",e.responseType==="json"?"application/json":e.responseType==="text"?"text/plain":"*/*"),e.body!==void 0&&e.contentType!=null&&r.set("Content-Type",e.contentType),e.headers==null)return r;for(let[n,i]of Object.entries(e.headers)){let o=yield Quc.get(i,{endpointMetadata:(t=e.endpointMetadata)!==null&&t!==void 0?t:{}});if(typeof o=="string"){r.set(n,o);continue}o!=null&&r.set(n,`${o}`)}return r})}function M9f(e){return Huo(this,void 0,void 0,function*(){var t,r,n;let i=zuc(e.url,e.queryParameters),o=yield quc({body:e.body,type:(t=e.requestType)!==null&&t!==void 0?t:"other"}),s=(r=e.fetchFn)!==null&&r!==void 0?r:yield Vuc(),a=yield Q9f(e),c=Uuo(e.logging);if(c.isDebug()){let u={method:e.method,url:$6e(i),headers:Wuo(a),queryParameters:j9f(e.queryParameters),hasBody:o!=null};c.debug("Making HTTP request",u)}try{let u=yield Juc(()=>Huo(this,void 0,void 0,function*(){return Kuc(s,i,e.method,a,o,e.timeoutMs,e.abortSignal,e.withCredentials,e.duplex)}),e.maxRetries);if(u.status>=200&&u.status<400){if(c.isDebug()){let p={method:e.method,url:$6e(i),statusCode:u.status,responseHeaders:Wuo(u.headers)};c.debug("HTTP request succeeded",p)}return{ok:!0,body:yield uQr(u,e.responseType),headers:u.headers,rawResponse:Guo(u)}}else{if(c.isError()){let l={method:e.method,url:$6e(i),statusCode:u.status,responseHeaders:Wuo(Object.fromEntries(u.headers.entries()))};c.error("HTTP request failed with error status",l)}return{ok:!1,error:{reason:"status-code",statusCode:u.status,body:yield _uc(u)},rawResponse:Guo(u)}}}catch(u){if(!((n=e.abortSignal)===null||n===void 0)&&n.aborted){if(c.isError()){let l={method:e.method,url:$6e(i)};c.error("HTTP request was aborted",l)}return{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:Vuo}}else if(u instanceof Error&&u.name==="AbortError"){if(c.isError()){let l={method:e.method,url:$6e(i),timeoutMs:e.timeoutMs};c.error("HTTP request timed out",l)}return{ok:!1,error:{reason:"timeout"},rawResponse:Vuo}}else if(u instanceof Error){if(c.isError()){let l={method:e.method,url:$6e(i),errorMessage:u.message};c.error("HTTP request failed with error",l)}return{ok:!1,error:{reason:"unknown",errorMessage:u.message},rawResponse:quo}}if(c.isError()){let l={method:e.method,url:$6e(i),error:kLt(u)};c.error("HTTP request failed with unknown error",l)}return{ok:!1,error:{reason:"unknown",errorMessage:kLt(u)},rawResponse:quo}}})}var tR=M9f;var L9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},U1=class e extends Promise{constructor(t){super(r=>{r(void 0)}),this.innerPromise=t}static fromFunction(t,...r){return new e(t(...r))}static interceptFunction(t){return(...r)=>e.fromPromise(t(...r))}static fromPromise(t){return new e(t)}static fromExecutor(t){let r=new Promise(t);return new e(r)}static fromResult(t){let r=Promise.resolve(t);return new e(r)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:t})=>t)),this.unwrappedPromise}then(t,r){return this.unwrap().then(t,r)}catch(t){return this.unwrap().catch(t)}finally(t){return this.unwrap().finally(t)}withRawResponse(){return L9f(this,void 0,void 0,function*(){return yield this.innerPromise})}};var z9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},rA={get:e=>z9f(void 0,void 0,void 0,function*(){return typeof e=="function"?e():e})};var lQr={};te(lQr,{ConsoleLogger:()=>jLt,LogLevel:()=>IW,Logger:()=>ert,createLogger:()=>Uuo});var pQr=U9f();function U9f(){var e,t,r,n,i;return typeof window<"u"&&typeof window.document<"u"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis<"u"&&((e=globalThis?.navigator)===null||e===void 0?void 0:e.userAgent)==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof self?.importScripts=="function"&&(((t=self.constructor)===null||t===void 0?void 0:t.name)==="DedicatedWorkerGlobalScope"||((r=self.constructor)===null||r===void 0?void 0:r.name)==="ServiceWorkerGlobalScope"||((n=self.constructor)===null||n===void 0?void 0:n.name)==="SharedWorkerGlobalScope")?{type:"web-worker"}:typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u"?{type:"deno",version:Deno.version.deno}:typeof Bun<"u"&&typeof Bun.version<"u"?{type:"bun",version:Bun.version}:typeof navigator<"u"&&navigator?.product==="ReactNative"?{type:"react-native"}:typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!(!((i=process.versions)===null||i===void 0)&&i.node)?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:{type:"unknown"}}var ze={};te(ze,{JsonError:()=>rrt,ParseError:()=>nrt,any:()=>llc,bigint:()=>Xuc,boolean:()=>plc,booleanLiteral:()=>clc,date:()=>Zuc,discriminant:()=>vlc,enum_:()=>dQr,getObjectLikeUtils:()=>CW,getObjectUtils:()=>eLe,getSchemaUtils:()=>oh,isProperty:()=>bve,lazy:()=>$uc,lazyObject:()=>slc,list:()=>hQr,never:()=>flc,number:()=>dlc,object:()=>mQr,objectWithoutOptionalProperties:()=>olc,optional:()=>Juo,property:()=>tlc,record:()=>Alc,set:()=>ylc,string:()=>mlc,stringLiteral:()=>ulc,transform:()=>Yuo,undiscriminatedUnion:()=>Elc,union:()=>Clc,unknown:()=>hlc,withParsedProperties:()=>Zuo});var Al={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 Am(e,t){return`Expected ${t}. Received ${_9f(e)}.`}function _9f(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function _1(e){return Object.assign(Object.assign({},e),{json:Yuc(e.json),parse:Yuc(e.parse)})}function Yuc(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(`
|
|
3040
3040
|
`)),{ok:!0,value:t}):n}}function fQr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var rrt=class e extends Error{constructor(t){super(t.map(fQr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var nrt=class e extends Error{constructor(t){super(t.map(fQr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function oh(e){return{nullable:()=>V9f(e),optional:()=>Juo(e),optionalNullable:()=>q9f(e),transform:t=>Yuo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new nrt(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new rrt(n.errors)}}}function V9f(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:()=>Al.NULLABLE};return Object.assign(Object.assign({},t),oh(t))}function Juo(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:()=>Al.OPTIONAL};return Object.assign(Object.assign({},t),oh(t))}function q9f(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:()=>Al.OPTIONAL_NULLABLE};return Object.assign(Object.assign({},t),oh(t))}function Yuo(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 Object.assign(Object.assign({},r),oh(r))}function Xuc(){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:Am(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:Am(t,"bigint")}]}:{ok:!0,value:t},getType:()=>Al.BIGINT};return Object.assign(Object.assign({},_1(e)),oh(e))}var G9f=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function Zuc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Am(t,"string")}]}:G9f.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:Am(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:Am(t,"Date object")}]},getType:()=>Al.DATE};return Object.assign(Object.assign({},_1(e)),oh(e))}function V1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return Object.assign(Object.assign({},_1(r)),oh(r))}}function dQr(e){let t=new Set(e);return V1(Al.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:Am(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:Am(n,"enum")}]}:{ok:!0,value:n})()}function $uc(e){let t=Xuo(e);return Object.assign(Object.assign({},t),oh(t))}function Xuo(e){return{parse:(t,r)=>irt(e).parse(t,r),json:(t,r)=>irt(e).json(t,r),getType:()=>irt(e).getType()}}function irt(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function QLt(e){return Object.entries(e)}function MLt(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}function Ppe(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function LLt(e){return Object.keys(e)}function elc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}function CW(e){return{withParsedProperties:t=>Zuo(e,t)}}function Zuo(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s=Object.entries(t).reduce((a,[c,u])=>Object.assign(Object.assign({},a),{[c]:typeof u=="function"?u(o.value):u}),{});return{ok:!0,value:Object.assign(Object.assign({},o.value),s)}},json:(n,i)=>{var o;if(!Ppe(n))return{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:Am(n,"object")}]};let s=new Set(Object.keys(t)),a=MLt(n,Object.keys(n).filter(c=>!s.has(c)));return e.json(a,i)},getType:()=>e.getType()};return Object.assign(Object.assign(Object.assign({},r),oh(r)),CW(r))}function tlc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function bve(e){return e.isProperty}function mQr(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,n])=>bve(n)?n.rawKey:r),_getParsedProperties:()=>LLt(e),parse:(r,n)=>{let i={},o=[];for(let[s,a]of QLt(e)){let c=bve(a)?a.rawKey:s,u=bve(a)?a.valueSchema:a,l={rawKey:c,parsedKey:s,valueSchema:u};i[c]=l,ilc(u)&&o.push(c)}return rlc({value:r,requiredKeys:o,getProperty:s=>{let a=i[s];if(a!=null)return{transformedKey:a.parsedKey,transform:c=>{var u;return a.valueSchema.parse(c,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(u=n?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],s]}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:(r,n)=>{let i=[];for(let[o,s]of QLt(e)){let a=bve(s)?s.valueSchema:s;ilc(a)&&i.push(o)}return rlc({value:r,requiredKeys:i,getProperty:o=>{let s=e[o];if(s!=null)return bve(s)?{transformedKey:s.rawKey,transform:a=>{var c;return s.valueSchema.json(a,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],o]}))}}:{transformedKey:o,transform:a=>{var c;return s.json(a,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],o]}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:()=>Al.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},_1(t)),oh(t)),CW(t)),eLe(t))}function rlc({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:i=!1,breadcrumbsPrefix:o=[]}){if(!Ppe(e))return{ok:!1,errors:[{path:o,message:Am(e,"object")}]};let s=new Set(t),a=[],c={};for(let[u,l]of Object.entries(e)){let p=r(u);if(p!=null){s.delete(u);let d=p.transform(l);d.ok?c[p.transformedKey]=d.value:(c[u]=l,a.push(...d.errors))}else switch(n){case"fail":a.push({path:[...o,u],message:`Unexpected key "${u}"`});break;case"strip":break;case"passthrough":c[u]=l;break}}return a.push(...t.filter(u=>s.has(u)).map(u=>({path:o,message:`Missing required key "${u}"`}))),a.length===0||i?{ok:!0,value:c}:{ok:!1,errors:a}}function eLe(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>nlc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>nlc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Al.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},r),oh(r)),CW(r)),eLe(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,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},json:(i,o)=>{let s=e.json(i,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},getType:()=>Al.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},n),oh(n)),CW(n)),eLe(n))}}}function nlc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Ppe(t))return{ok:!1,errors:[{path:i,message:Am(t,"object")}]};let o=new Set(e),[s,a]=elc(LLt(t),l=>o.has(l)),c=r(MLt(t,a)),u=n(MLt(t,s));return c.ok&&u.ok?{ok:!0,value:Object.assign(Object.assign({},c.value),u.value)}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function ilc(e){return!W9f(e)}function W9f(e){switch(e.getType()){case Al.ANY:case Al.UNKNOWN:case Al.OPTIONAL:case Al.OPTIONAL_NULLABLE:return!0;default:return!1}}function olc(e){return mQr(e)}function slc(e){let t=Object.assign(Object.assign({},Xuo(e)),{_getRawProperties:()=>irt(e)._getRawProperties(),_getParsedProperties:()=>irt(e)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},t),oh(t)),CW(t)),eLe(t))}function hQr(e){let t={parse:(r,n)=>alc(r,(i,o)=>{var s;return e.parse(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),json:(r,n)=>alc(r,(i,o)=>{var s;return e.json(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),getType:()=>Al.LIST};return Object.assign(Object.assign({},_1(t)),oh(t))}function alc(e,t){return Array.isArray(e)?e.map((n,i)=>t(n,i)).reduce((n,i)=>{if(n.ok&&i.ok)return{ok:!0,value:[...n.value,i.value]};let o=[];return n.ok||o.push(...n.errors),i.ok||o.push(...i.errors),{ok:!1,errors:o}},{ok:!0,value:[]}):{ok:!1,errors:[{message:Am(e,"list"),path:[]}]}}function clc(e){return V1(Al.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Am(r,`${e.toString()}`)}]})()}function ulc(e){return V1(Al.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Am(r,`"${e}"`)}]})()}var llc=V1(Al.ANY,e=>({ok:!0,value:e}));var plc=V1(Al.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Am(e,"boolean")}]});var flc=V1(Al.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}));var dlc=V1(Al.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Am(e,"number")}]});var mlc=V1(Al.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Am(e,"string")}]});var hlc=V1(Al.UNKNOWN,e=>({ok:!0,value:e}));function Alc(e,t){let r={parse:(n,i)=>glc({value:n,isKeyNumeric:e.getType()===Al.NUMBER,transformKey:o=>{var s;return e.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>glc({value:n,isKeyNumeric:e.getType()===Al.NUMBER,transformKey:o=>{var s;return e.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Al.RECORD};return Object.assign(Object.assign({},_1(r)),oh(r))}function glc({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){return Ppe(e)?QLt(e).reduce((o,[s,a])=>{if(a===void 0)return o;let c=o,u=s;if(t){let f=s.length>0?Number(s):NaN;Number.isNaN(f)||(u=f)}let l=r(u),p=n(a,u);if(c.ok&&l.ok&&p.ok)return{ok:!0,value:Object.assign(Object.assign({},c.value),{[l.value]:p.value})};let d=[];return c.ok||d.push(...c.errors),l.ok||d.push(...l.errors),p.ok||d.push(...p.errors),{ok:!1,errors:d}},{ok:!0,value:{}}):{ok:!1,errors:[{path:i,message:Am(e,"object")}]}}function ylc(e){let t=hQr(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)=>{var o;return n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:Am(n,"Set")}]}},getType:()=>Al.SET};return Object.assign(Object.assign({},_1(r)),oh(r))}function Elc(e){let t={parse:(r,n)=>blc((i,o)=>i.parse(r,o),e,n),json:(r,n)=>blc((i,o)=>i.json(r,o),e,n),getType:()=>Al.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},_1(t)),oh(t))}function blc(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,Object.assign(Object.assign({},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}}function vlc(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var H9f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};function Clc(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=dQr(LLt(t)),o={parse:(s,a)=>Ilc({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>{var u;return i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],r]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>Ilc({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>{var u;return i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],n]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>Al.UNION};return Object.assign(Object.assign(Object.assign({},_1(o)),oh(o)),CW(o))}function Ilc({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Ppe(e))return{ok:!1,errors:[{path:a,message:Am(e,"object")}]};let c=e,u=t,l=c[u],p=H9f(c,[typeof u=="symbol"?u:u+""]);if(l==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let d=n(l);if(!d.ok)return{ok:!1,errors:d.errors};let f=i(d.value);if(f==null)return o?{ok:!0,value:Object.assign({[r]:d.value},p)}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let m=s(p,f);return m.ok?{ok:!0,value:Object.assign({[r]:l},m.value)}:m}var $E={};te($E,{encodePathParam:()=>wlc,join:()=>Slc,toQueryString:()=>trt});function wlc(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":case"number":case"boolean":break;default:e=String(e);break}return encodeURIComponent(e)}function Slc(e,...t){if(!e)return"";if(t.length===0)return e;if(e.includes("://")){let r;try{r=new URL(e)}catch{return xlc(e,...t)}let n=t[t.length-1],i=n?.endsWith("/");for(let o of t){let s=Blc(o);s&&(r.pathname=Tlc(r.pathname,s))}return i&&!r.pathname.endsWith("/")&&(r.pathname+="/"),r.toString()}return xlc(e,...t)}function xlc(e,...t){if(t.length===0)return e;let r=e,n=t[t.length-1],i=n?.endsWith("/");for(let o of t){let s=Blc(o);s&&(r=Tlc(r,s))}return i&&!r.endsWith("/")&&(r+="/"),r}function Tlc(e,t){return e.endsWith("/")?e+t:`${e}/${t}`}function Blc(e){if(!e)return e;let t=0,r=e.length;return e.startsWith("/")&&(t=1),e.endsWith("/")&&(r=e.length-1),t===0&&r===e.length?e:e.slice(t,r)}var K9f=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},$uo="token",ort=class{constructor(t){this.options=t}static canCreate(t){return t?.[$uo]!=null}getAuthRequest(){return K9f(this,arguments,void 0,function*({endpointMetadata:t}={}){let r=yield rA.get(this.options[$uo]);return r==null?{headers:{}}:{headers:{Authorization:`Bearer ${r}`}}})}};(function(e){e.AUTH_SCHEME="bearer",e.AUTH_CONFIG_ERROR_MESSAGE=`Please provide '${$uo}' when initializing the client`;function t(r){return new e(r)}e.createInstance=t})(ort||(ort={}));function kO(...e){let t={};for(let[r,n]of e.filter(i=>i!=null).flatMap(i=>Object.entries(i))){let i=r.toLowerCase();n!=null?t[i]=n:i in t&&delete t[i]}return t}function elo(e){let t=kO({"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"@fern-fern/fiddle-sdk","X-Fern-SDK-Version":"1.1.0","User-Agent":"@fern-fern/fiddle-sdk/1.1.0","X-Fern-Runtime":pQr.type,"X-Fern-Runtime-Version":pQr.version},e?.headers);return Object.assign(Object.assign({},e),{logging:lQr.createLogger(e?.logging),headers:t})}function Eve(e){var t;let r=elo(e),n=J9f(r);return(t=r.authProvider)!==null&&t!==void 0||(r.authProvider=new ort(n)),r}function J9f(e){return Object.assign(Object.assign({},e),{authProvider:new FLt})}var tLe=ze.string().transform({transform:rQr,untransform:e=>e});var gQr=ze.string().transform({transform:nQr,untransform:e=>e});var tlo=ze.string().transform({transform:iQr,untransform:e=>e});var AQr=ze.object({apiId:tLe,version:ze.string().optional(),commitSha:gQr.optional(),cliVersion:ze.string(),yamlSchemaVersion:ze.string().optional()});var rLe={};te(rLe,{Api:()=>olo,RegisterApiRequest:()=>AQr,RegisterApiResponse:()=>slo,get:()=>rlo,getLatestVersion:()=>nlo,registerUsingOrgToken:()=>ilo});var rlo={};te(rlo,{Error:()=>X9f});var Y9f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},X9f=ze.union("error",{OrgDoesNotExistError:ze.object({}),ApiDoesNotExistError:ze.object({}),VersionDoesNotExistError:ze.object({})}).transform({transform:e=>{switch(e.error){case"OrgDoesNotExistError":return LA.get.Error.orgDoesNotExistError();case"ApiDoesNotExistError":return LA.get.Error.apiDoesNotExistError();case"VersionDoesNotExistError":return LA.get.Error.versionDoesNotExistError()}},untransform:e=>{var{_visit:t}=e,r=Y9f(e,["_visit"]);return r}});var nlo={};te(nlo,{Error:()=>eWf,Response:()=>$9f});var Z9f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},$9f=ze.string(),eWf=ze.union("error",{OrgDoesNotExistError:ze.object({}),ApiDoesNotExistError:ze.object({})}).transform({transform:e=>{switch(e.error){case"OrgDoesNotExistError":return LA.getLatestVersion.Error.orgDoesNotExistError();case"ApiDoesNotExistError":return LA.getLatestVersion.Error.apiDoesNotExistError()}},untransform:e=>{var{_visit:t}=e,r=Z9f(e,["_visit"]);return r}});var ilo={};te(ilo,{Error:()=>rWf});var tWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},rWf=ze.union("error",{VersionAlreadyExists:ze.object({})}).transform({transform:e=>{if(e.error==="VersionAlreadyExists")return LA.registerUsingOrgToken.Error.versionAlreadyExists()},untransform:e=>{var{_visit:t}=e,r=tWf(e,["_visit"]);return r}});var olo=ze.object({apiId:tLe,version:ze.string(),commitSha:gQr.optional(),cliVersion:ze.string(),definitionS3DownloadUrl:ze.string(),yamlSchemaVersion:ze.string().optional()});var slo=ze.object({version:ze.string(),definitionS3UploadUrl:ze.string()});var Olc=ze.enum_(["FERN","OPENAPI"]);var Plc=ze.object({python:ze.boolean(),typescript:ze.boolean(),java:ze.boolean(),rust:ze.boolean(),openApi:ze.boolean(),postman:ze.boolean()});var Dlc=ze.object({githubOrgId:ze.string(),kebabCaseOrgId:ze.string(),companyDisplayName:ze.string(),docsUrl:ze.string().optional(),logoUrl:ze.string().optional(),fernUserToken:ze.string(),mode:Olc,repoCreationConfig:Plc});var yQr={};te(yQr,{status:()=>alo});var alo={};te(alo,{Response:()=>nWf});var nWf=ze.string();var zLt=ze.object({keyId:ze.string(),password:ze.string(),secretKey:ze.string()});var nLe=ze.object({registryUrl:ze.string(),username:ze.string(),password:ze.string(),coordinate:ze.string(),signature:zLt.optional(),downloadSnippets:ze.boolean().optional()});var iLe=ze.object({registryUrl:ze.string(),packageName:ze.string(),token:ze.string(),downloadSnippets:ze.boolean().optional()});var clo=ze.object({npm:iLe.optional(),maven:nLe.optional()});var ulo=ze.object({id:ze.string(),version:ze.string(),customConfig:ze.unknown(),willDownloadFiles:ze.boolean(),outputs:clo});var bQr=ze.object({apiName:ze.string(),organizationName:ze.string(),version:ze.string().optional(),generators:ze.list(ulo)});var EQr=ze.object({apiName:ze.string(),organizationName:ze.string(),version:ze.string().optional()});var Dpe={};te(Dpe,{BaseGithubInfo:()=>dLe,BasicGithubLicense:()=>klo,BranchDoesNotExistDetails:()=>oLe,CannotPublishPypiPackageDetails:()=>sLe,CannotPublishToMavenGroupDetails:()=>aLe,CannotPublishToNpmScopeDetails:()=>cLe,CratesCoordinate:()=>Alo,CratesOutput:()=>qlo,CratesOutputWithOptionalToken:()=>jlo,CreateJobRequest:()=>bQr,CreateJobRequestV2:()=>vQr,CreateJobResponse:()=>KLt,CreateReplayInitPrRequest:()=>dpo,CreateReplayInitPrResponse:()=>mpo,CustomGithubLicense:()=>Nlo,DownloadFilesOutputMode:()=>Wlo,FailedTaskStatus:()=>Blo,FernDefinitionMetadata:()=>Glo,FinishedTaskStatus:()=>Olo,GeneratorConfig:()=>ulo,GeneratorConfigV2:()=>upo,GeneratorIdAndVersion:()=>llo,GeneratorOutputs:()=>clo,GeneratorsDoNotExistErrorBodyType:()=>uLe,GithubAppNotInstalledDetails:()=>mlo,GithubCommitAndReleaseMode:()=>Klo,GithubLicense:()=>_Lt,GithubLicenseId:()=>Flo,GithubOutputMode:()=>Hlo,GithubOutputModeV2:()=>epo,GithubPublishInfo:()=>WLt,GithubPullRequestMode:()=>Zlo,GithubPullRequestReviewer:()=>Xlo,GithubPushMode:()=>$lo,GithubTeamReviewer:()=>Jlo,GithubUserReviewer:()=>Ylo,GithubWhitelabelConfig:()=>ppo,IllegalApiVersionErrorDetails:()=>lLe,InsufficientPermissionsDetails:()=>wW,LogLevel:()=>Slo,MavenCentralSignature:()=>zLt,MavenCoordinate:()=>ylo,MavenOutput:()=>nLe,MavenOutputWithOptionalCreds:()=>Qlo,NpmCoordinate:()=>blo,NpmOutput:()=>iLe,NpmOutputWithOptionalToken:()=>Mlo,NugetCoordinate:()=>Elo,NugetOutput:()=>npo,NugetOutputWithOptionalCreds:()=>Llo,OrgNotConfiguredForWhitelabelDetails:()=>pLe,OutputMetadata:()=>Ulo,OutputMetadataAuthor:()=>zlo,OutputMode:()=>apo,Package:()=>xlo,PackageCoordinate:()=>Clo,PackagePublishStatus:()=>wlo,PostmanOutput:()=>qLt,PublishOutputMode:()=>rpo,PublishOutputModeV2:()=>spo,PublishingMetadata:()=>cpo,PyPiOutputWithOptionalCreds:()=>_lo,PypiCoordinate:()=>vlo,PypiMetadata:()=>GLt,PypiOutput:()=>ipo,RateLimitExceededDetails:()=>fLe,RegistryOverrides:()=>tpo,RemoteGenJobId:()=>HLt,RemoteGenTaskId:()=>ULt,ReplayConfig:()=>lpo,RubyGemsCoordinate:()=>Ilo,RubyGemsOutput:()=>opo,RubyGemsOutputWithOptionalCreds:()=>Vlo,Task:()=>Dlo,TaskLog:()=>Tlo,TaskStatus:()=>Plo,UploadDefinitionRequest:()=>EQr,UploadDefinitionResponse:()=>hpo,UsernamePassword:()=>VLt,WhitelabelConfig:()=>fpo,createJob:()=>plo,createJobV2:()=>flo,createJobV3:()=>dlo,createReplayInitPr:()=>hlo,getDefinitionUploadUrl:()=>glo,getJobStatus:()=>Rlo});var plo={};te(plo,{Error:()=>oWf});var oLe=ze.object({repositoryOwner:ze.string(),repositoryName:ze.string(),branch:ze.string()});var sLe=ze.object({generatorId:ze.string(),invalidPackageName:ze.string(),validPrefix:ze.string()});var aLe=ze.object({generatorId:ze.string(),invalidGroup:ze.string(),validGroup:ze.string()});var cLe=ze.object({generatorId:ze.string(),invalidScope:ze.string(),validScope:ze.string()});var llo=ze.object({id:ze.string(),version:ze.string()});var uLe=ze.object({nonExistentGenerators:ze.list(llo)});var lLe=ze.object({message:ze.string().optional()});var wW=ze.object({dummy:ze.string().optional(),message:ze.string().optional()});var pLe=ze.object({message:ze.string().optional()});var fLe=ze.object({retryAfter:ze.number().optional()});var iWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},oWf=ze.union("error",{IllegalApiNameError:ze.object({}),IllegalApiVersionError:ze.object({content:lLe}),GeneratorsDoNotExistError:ze.object({content:uLe}),CannotPublishToNpmScope:ze.object({content:cLe}),CannotPublishToMavenGroup:ze.object({content:aLe}),CannotPublishPypiPackage:ze.object({content:sLe}),InsufficientPermissions:ze.object({content:wW}),OrgNotConfiguredForWhitelabel:ze.object({content:pLe}),BranchDoesNotExist:ze.object({content:oLe}),RateLimitExceeded:ze.object({content:fLe})}).transform({transform:e=>{switch(e.error){case"IllegalApiNameError":return Qi.createJob.Error.illegalApiNameError();case"IllegalApiVersionError":return Qi.createJob.Error.illegalApiVersionError(e.content);case"GeneratorsDoNotExistError":return Qi.createJob.Error.generatorsDoNotExistError(e.content);case"CannotPublishToNpmScope":return Qi.createJob.Error.cannotPublishToNpmScope(e.content);case"CannotPublishToMavenGroup":return Qi.createJob.Error.cannotPublishToMavenGroup(e.content);case"CannotPublishPypiPackage":return Qi.createJob.Error.cannotPublishPypiPackage(e.content);case"InsufficientPermissions":return Qi.createJob.Error.insufficientPermissions(e.content);case"OrgNotConfiguredForWhitelabel":return Qi.createJob.Error.orgNotConfiguredForWhitelabel(e.content);case"BranchDoesNotExist":return Qi.createJob.Error.branchDoesNotExist(e.content);case"RateLimitExceeded":return Qi.createJob.Error.rateLimitExceeded(e.content)}},untransform:e=>{var{_visit:t}=e,r=iWf(e,["_visit"]);return r}});var flo={};te(flo,{Error:()=>aWf});var sWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},aWf=ze.union("error",{IllegalApiNameError:ze.object({}),IllegalApiVersionError:ze.object({content:lLe}),GeneratorsDoNotExistError:ze.object({content:uLe}),CannotPublishToNpmScope:ze.object({content:cLe}),CannotPublishToMavenGroup:ze.object({content:aLe}),CannotPublishPypiPackage:ze.object({content:sLe}),InsufficientPermissions:ze.object({content:wW}),OrgNotConfiguredForWhitelabel:ze.object({content:pLe}),BranchDoesNotExist:ze.object({content:oLe}),RateLimitExceeded:ze.object({content:fLe})}).transform({transform:e=>{switch(e.error){case"IllegalApiNameError":return Qi.createJobV2.Error.illegalApiNameError();case"IllegalApiVersionError":return Qi.createJobV2.Error.illegalApiVersionError(e.content);case"GeneratorsDoNotExistError":return Qi.createJobV2.Error.generatorsDoNotExistError(e.content);case"CannotPublishToNpmScope":return Qi.createJobV2.Error.cannotPublishToNpmScope(e.content);case"CannotPublishToMavenGroup":return Qi.createJobV2.Error.cannotPublishToMavenGroup(e.content);case"CannotPublishPypiPackage":return Qi.createJobV2.Error.cannotPublishPypiPackage(e.content);case"InsufficientPermissions":return Qi.createJobV2.Error.insufficientPermissions(e.content);case"OrgNotConfiguredForWhitelabel":return Qi.createJobV2.Error.orgNotConfiguredForWhitelabel(e.content);case"BranchDoesNotExist":return Qi.createJobV2.Error.branchDoesNotExist(e.content);case"RateLimitExceeded":return Qi.createJobV2.Error.rateLimitExceeded(e.content)}},untransform:e=>{var{_visit:t}=e,r=sWf(e,["_visit"]);return r}});var dlo={};te(dlo,{Error:()=>uWf});var cWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},uWf=ze.union("error",{IllegalApiNameError:ze.object({}),IllegalApiVersionError:ze.object({content:lLe}),GeneratorsDoNotExistError:ze.object({content:uLe}),CannotPublishToNpmScope:ze.object({content:cLe}),CannotPublishToMavenGroup:ze.object({content:aLe}),CannotPublishPypiPackage:ze.object({content:sLe}),InsufficientPermissions:ze.object({content:wW}),OrgNotConfiguredForWhitelabel:ze.object({content:pLe}),BranchDoesNotExist:ze.object({content:oLe}),RateLimitExceeded:ze.object({content:fLe})}).transform({transform:e=>{switch(e.error){case"IllegalApiNameError":return Qi.createJobV3.Error.illegalApiNameError();case"IllegalApiVersionError":return Qi.createJobV3.Error.illegalApiVersionError(e.content);case"GeneratorsDoNotExistError":return Qi.createJobV3.Error.generatorsDoNotExistError(e.content);case"CannotPublishToNpmScope":return Qi.createJobV3.Error.cannotPublishToNpmScope(e.content);case"CannotPublishToMavenGroup":return Qi.createJobV3.Error.cannotPublishToMavenGroup(e.content);case"CannotPublishPypiPackage":return Qi.createJobV3.Error.cannotPublishPypiPackage(e.content);case"InsufficientPermissions":return Qi.createJobV3.Error.insufficientPermissions(e.content);case"OrgNotConfiguredForWhitelabel":return Qi.createJobV3.Error.orgNotConfiguredForWhitelabel(e.content);case"BranchDoesNotExist":return Qi.createJobV3.Error.branchDoesNotExist(e.content);case"RateLimitExceeded":return Qi.createJobV3.Error.rateLimitExceeded(e.content)}},untransform:e=>{var{_visit:t}=e,r=cWf(e,["_visit"]);return r}});var hlo={};te(hlo,{Error:()=>pWf});var mlo=ze.object({owner:ze.string(),repo:ze.string(),message:ze.string().optional()});var lWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},pWf=ze.union("error",{InsufficientPermissions:ze.object({content:wW}),GithubAppNotInstalled:ze.object({content:mlo})}).transform({transform:e=>{switch(e.error){case"InsufficientPermissions":return Qi.createReplayInitPr.Error.insufficientPermissions(e.content);case"GithubAppNotInstalled":return Qi.createReplayInitPr.Error.githubAppNotInstalled(e.content)}},untransform:e=>{var{_visit:t}=e,r=lWf(e,["_visit"]);return r}});var glo={};te(glo,{Error:()=>dWf});var fWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},dWf=ze.union("error",{InsufficientPermissions:ze.object({content:wW})}).transform({transform:e=>{if(e.error==="InsufficientPermissions")return Qi.getDefinitionUploadUrl.Error.insufficientPermissions(e.content)},untransform:e=>{var{_visit:t}=e,r=fWf(e,["_visit"]);return r}});var Rlo={};te(Rlo,{Response:()=>gWf});var ULt=ze.string().transform({transform:cQr,untransform:e=>e});var Alo=ze.object({name:ze.string(),version:ze.string()});var ylo=ze.object({group:ze.string(),artifact:ze.string(),version:ze.string()});var blo=ze.object({name:ze.string(),version:ze.string()});var Elo=ze.object({name:ze.string(),version:ze.string()});var vlo=ze.object({name:ze.string(),version:ze.string()});var Ilo=ze.object({name:ze.string(),version:ze.string()});var mWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Clo=ze.union(ze.discriminant("type","_type"),{npm:blo,maven:ylo,pypi:vlo,ruby:Ilo,nuget:Elo,crates:Alo}).transform({transform:e=>{switch(e.type){case"npm":return eR.npm(e);case"maven":return eR.maven(e);case"pypi":return eR.pypi(e);case"ruby":return eR.ruby(e);case"nuget":return eR.nuget(e);case"crates":return eR.crates(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=mWf(e,["_visit"]);return r}});var wlo=ze.enum_(["NOT_STARTED_PUBLISHING","PUBLISHING","PUBLISHED","FAILED_TO_PUBLISH"]);var xlo=ze.object({coordinate:Clo,status:wlo});var Slo=ze.enum_(["DEBUG","INFO","WARN","ERROR"]);var Tlo=ze.object({level:Slo,message:ze.string()});var Blo=ze.object({message:ze.string(),s3PreSignedReadUrl:ze.string().optional()});var Olo=ze.object({createdSnippets:ze.boolean().optional(),hasFilesToDownload:ze.boolean(),s3PreSignedReadUrl:ze.string(),s3PreSignedReadUrlV2:ze.string().optional(),snippetsS3PreSignedReadUrl:ze.string().optional(),pullRequestUrl:ze.string().optional(),noChangesDetected:ze.boolean().optional(),actualVersion:ze.string().optional()});var hWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Plo=ze.union(ze.discriminant("type","_type"),{notStarted:ze.object({}),running:ze.object({}),failed:Blo,finished:Olo}).transform({transform:e=>{switch(e.type){case"notStarted":return aV.notStarted();case"running":return aV.running();case"failed":return aV.failed(e);case"finished":return aV.finished(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=hWf(e,["_visit"]);return r}});var Dlo=ze.object({status:Plo,packages:ze.list(xlo),logs:ze.list(Tlo)});var gWf=ze.record(ULt,Dlo);var Flo=ze.enum_(["MIT","APACHE"]);var klo=ze.object({id:Flo});var Nlo=ze.object({contents:ze.string()});var AWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},_Lt=ze.union("type",{basic:klo,custom:Nlo}).transform({transform:e=>{switch(e.type){case"basic":return gve.basic(e);case"custom":return gve.custom(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=AWf(e,["_visit"]);return r}});var jlo=ze.object({registryUrl:ze.string(),packageName:ze.string(),token:ze.string().optional()});var VLt=ze.object({username:ze.string(),password:ze.string()});var Qlo=ze.object({registryUrl:ze.string(),coordinate:ze.string(),credentials:VLt.optional(),signature:zLt.optional()});var Mlo=ze.object({registryUrl:ze.string(),packageName:ze.string(),token:ze.string().optional()});var Llo=ze.object({registryUrl:ze.string(),packageName:ze.string(),apiKey:ze.string().optional()});var qLt=ze.object({apiKey:ze.string(),workspaceId:ze.string()});var zlo=ze.object({name:ze.string(),email:ze.string()});var Ulo=ze.object({description:ze.string().optional(),authors:ze.list(zlo).optional()});var GLt=ze.object({keywords:ze.list(ze.string()).optional(),documentationLink:ze.string().optional(),homepageLink:ze.string().optional()}).extend(Ulo);var _lo=ze.object({registryUrl:ze.string(),packageName:ze.string(),credentials:VLt.optional(),pypiMetadata:GLt.optional()});var Vlo=ze.object({registryUrl:ze.string(),packageName:ze.string(),apiKey:ze.string().optional()});var yWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},WLt=ze.union("type",{npm:Mlo,maven:Qlo,postman:qLt,pypi:_lo,rubygems:Vlo,nuget:Llo,crates:jlo}).transform({transform:e=>{switch(e.type){case"npm":return L1.npm(e);case"maven":return L1.maven(e);case"postman":return L1.postman(e);case"pypi":return L1.pypi(e);case"rubygems":return L1.rubygems(e);case"nuget":return L1.nuget(e);case"crates":return L1.crates(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=yWf(e,["_visit"]);return r}});var dLe=ze.object({owner:ze.string(),repo:ze.string(),host:ze.string().optional(),directory:ze.string().optional(),publishInfo:WLt.optional(),license:_Lt.optional(),downloadSnippets:ze.boolean().optional()});var qlo=ze.object({registryUrl:ze.string(),token:ze.string(),packageName:ze.string(),downloadSnippets:ze.boolean().optional()});var Glo=ze.object({definitionS3DownloadUrl:ze.string(),outputPath:ze.string().optional(),cliVersion:ze.string().optional()});var Wlo=ze.object({downloadSnippets:ze.boolean().optional()});var Hlo=ze.object({owner:ze.string(),repo:ze.string(),publishInfo:WLt.optional(),makePr:ze.boolean().optional(),branch:ze.string().optional(),license:_Lt.optional()});var Klo=ze.object({branch:ze.string().optional()}).extend(dLe);var Jlo=ze.object({name:ze.string()});var Ylo=ze.object({name:ze.string()});var bWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Xlo=ze.union("type",{team:Jlo,user:Ylo}).transform({transform:e=>{switch(e.type){case"team":return Ave.team(e);case"user":return Ave.user(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=bWf(e,["_visit"]);return r}});var Zlo=ze.object({reviewers:ze.list(Xlo).optional(),branch:ze.string().optional()}).extend(dLe);var $lo=ze.object({branch:ze.string().optional()}).extend(dLe);var EWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},epo=ze.union("type",{push:$lo,commitAndRelease:Klo,pullRequest:Zlo}).transform({transform:e=>{switch(e.type){case"push":return F$.push(e);case"commitAndRelease":return F$.commitAndRelease(e);case"pullRequest":return F$.pullRequest(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=EWf(e,["_visit"]);return r}});var tpo=ze.object({npm:iLe.optional(),maven:nLe.optional()});var rpo=ze.object({registryOverrides:tpo});var npo=ze.object({registryUrl:ze.string(),packageName:ze.string(),apiKey:ze.string(),downloadSnippets:ze.boolean().optional()});var ipo=ze.object({registryUrl:ze.string(),username:ze.string(),password:ze.string(),coordinate:ze.string(),downloadSnippets:ze.boolean().optional(),pypiMetadata:GLt.optional()});var opo=ze.object({registryUrl:ze.string(),packageName:ze.string(),apiKey:ze.string(),downloadSnippets:ze.boolean().optional()});var vWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},spo=ze.union("type",{npmOverride:ze.object({npmOverride:iLe.optional()}),mavenOverride:ze.object({mavenOverride:nLe.optional()}),pypiOverride:ze.object({pypiOverride:ipo.optional()}),rubyGemsOverride:ze.object({rubyGemsOverride:opo.optional()}),nugetOverride:ze.object({nugetOverride:npo.optional()}),cratesOverride:ze.object({cratesOverride:qlo.optional()}),postman:qLt}).transform({transform:e=>{switch(e.type){case"npmOverride":return z1.npmOverride(e.npmOverride);case"mavenOverride":return z1.mavenOverride(e.mavenOverride);case"pypiOverride":return z1.pypiOverride(e.pypiOverride);case"rubyGemsOverride":return z1.rubyGemsOverride(e.rubyGemsOverride);case"nugetOverride":return z1.nugetOverride(e.nugetOverride);case"cratesOverride":return z1.cratesOverride(e.cratesOverride);case"postman":return z1.postman(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=vWf(e,["_visit"]);return r}});var IWf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},apo=ze.union("type",{publish:rpo,publishV2:ze.object({publishV2:spo}),downloadFiles:Wlo,github:Hlo,githubV2:ze.object({githubV2:epo})}).transform({transform:e=>{switch(e.type){case"publish":return QQ.publish(e);case"publishV2":return QQ.publishV2(e.publishV2);case"downloadFiles":return QQ.downloadFiles(e);case"github":return QQ.github(e);case"githubV2":return QQ.githubV2(e.githubV2);default:return e}},untransform:e=>{var{_visit:t}=e,r=IWf(e,["_visit"]);return r}});var cpo=ze.object({packageDescription:ze.property("package_description",ze.string().optional()),publisherEmail:ze.property("publisher_email",ze.string().optional()),referenceUrl:ze.property("reference_url",ze.string().optional()),publisherName:ze.property("publisher_name",ze.string().optional())});var upo=ze.object({id:ze.string(),version:ze.string(),customConfig:ze.unknown(),publishMetadata:cpo.optional(),outputMode:apo});var lpo=ze.object({enabled:ze.boolean()});var ppo=ze.object({token:ze.string(),username:ze.string(),email:ze.string()});var fpo=ze.object({github:ppo});var vQr=ze.object({apiName:ze.string(),organizationName:ze.string(),version:ze.string().optional(),generators:ze.list(upo),uploadToS3:ze.boolean().optional(),preview:ze.boolean().optional(),pushPreviewBranch:ze.boolean().optional(),whitelabel:fpo.optional(),replay:lpo.optional(),fernDefinitionMetadata:Glo.optional(),fernignoreContents:ze.string().optional(),skipIfNoDiff:ze.boolean().optional(),verify:ze.boolean().optional()});var HLt=ze.string().transform({transform:aQr,untransform:e=>e});var KLt=ze.object({jobId:HLt,taskIds:ze.list(ULt)});var dpo=ze.object({owner:ze.string(),repo:ze.string(),lockfileContents:ze.string(),fernignoreEntries:ze.list(ze.string()).optional(),baseBranch:ze.string().optional(),prTitle:ze.string().optional(),prBody:ze.string().optional()});var mpo=ze.object({prUrl:ze.string(),branch:ze.string()});var hpo=ze.object({s3Url:ze.property("s3url",ze.string())});var gpo=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},IQr=class{constructor(t){this._options=Eve(t)}registerUsingOrgToken(t,r){return U1.fromPromise(this.__registerUsingOrgToken(t,r))}__registerUsingOrgToken(t,r){return gpo(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l,p;let d=yield this._options.authProvider.getAuthRequest(),f=kO(d.headers,(n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),m=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/registry/register"),method:"POST",headers:f,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:AQr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});return m.ok?{data:{ok:!0,body:slo.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:m.headers,rawResponse:m.rawResponse},rawResponse:m.rawResponse}:m.error.reason==="status-code"&&((p=m.error.body)===null||p===void 0?void 0:p.error)==="VersionAlreadyExists"?{data:{ok:!1,error:rLe.registerUsingOrgToken.Error.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse},rawResponse:m.rawResponse}:{data:{ok:!1,error:LA.registerUsingOrgToken.Error._unknown(m.error),rawResponse:m.rawResponse},rawResponse:m.rawResponse}})}get(t,r,n,i){return U1.fromPromise(this.__get(t,r,n,i))}__get(t,r,n,i){return gpo(this,void 0,void 0,function*(){var o,s,a,c,u,l,p,d,f;let m=kO((o=this._options)===null||o===void 0?void 0:o.headers,i?.headers),h=yield tR({url:$E.join((s=yield rA.get(this._options.baseUrl))!==null&&s!==void 0?s:yield rA.get(this._options.environment),`/api/registry/definition/${$E.encodePathParam(tlo.jsonOrThrow(t,{omitUndefined:!0}))}/${$E.encodePathParam(tLe.jsonOrThrow(r,{omitUndefined:!0}))}/${$E.encodePathParam(n)}`),method:"GET",headers:m,queryParameters:i?.queryParams,timeoutMs:((u=(a=i?.timeoutInSeconds)!==null&&a!==void 0?a:(c=this._options)===null||c===void 0?void 0:c.timeoutInSeconds)!==null&&u!==void 0?u:60)*1e3,maxRetries:(l=i?.maxRetries)!==null&&l!==void 0?l:(p=this._options)===null||p===void 0?void 0:p.maxRetries,abortSignal:i?.abortSignal,fetchFn:(d=this._options)===null||d===void 0?void 0:d.fetch,logging:this._options.logging});if(h.ok)return{data:{ok:!0,body:olo.parseOrThrow(h.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:h.headers,rawResponse:h.rawResponse},rawResponse:h.rawResponse};if(h.error.reason==="status-code")switch((f=h.error.body)===null||f===void 0?void 0:f.error){case"OrgDoesNotExistError":case"ApiDoesNotExistError":case"VersionDoesNotExistError":return{data:{ok:!1,error:rLe.get.Error.parseOrThrow(h.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:h.rawResponse},rawResponse:h.rawResponse}}return{data:{ok:!1,error:LA.get.Error._unknown(h.error),rawResponse:h.rawResponse},rawResponse:h.rawResponse}})}getLatestVersion(t,r,n){return U1.fromPromise(this.__getLatestVersion(t,r,n))}__getLatestVersion(t,r,n){return gpo(this,void 0,void 0,function*(){var i,o,s,a,c,u,l,p,d;let f=kO((i=this._options)===null||i===void 0?void 0:i.headers,n?.headers),m=yield tR({url:$E.join((o=yield rA.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rA.get(this._options.environment),`/api/registry/latest-version/${$E.encodePathParam(tlo.jsonOrThrow(t,{omitUndefined:!0}))}/${$E.encodePathParam(tLe.jsonOrThrow(r,{omitUndefined:!0}))}`),method:"GET",headers:f,queryParameters:n?.queryParams,timeoutMs:((c=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(a=this._options)===null||a===void 0?void 0:a.timeoutInSeconds)!==null&&c!==void 0?c:60)*1e3,maxRetries:(u=n?.maxRetries)!==null&&u!==void 0?u:(l=this._options)===null||l===void 0?void 0:l.maxRetries,abortSignal:n?.abortSignal,fetchFn:(p=this._options)===null||p===void 0?void 0:p.fetch,logging:this._options.logging});if(m.ok)return{data:{ok:!0,body:rLe.getLatestVersion.Response.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:m.headers,rawResponse:m.rawResponse},rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch((d=m.error.body)===null||d===void 0?void 0:d.error){case"OrgDoesNotExistError":case"ApiDoesNotExistError":return{data:{ok:!1,error:rLe.getLatestVersion.Error.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse},rawResponse:m.rawResponse}}return{data:{ok:!1,error:LA.getLatestVersion.Error._unknown(m.error),rawResponse:m.rawResponse},rawResponse:m.rawResponse}})}};var CWf=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},wQr=class{constructor(t){this._options=Eve(t)}createSdkDemo(t,r){return U1.fromPromise(this.__createSdkDemo(t,r))}__createSdkDemo(t,r){return CWf(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l;let p=yield this._options.authProvider.getAuthRequest(),d=kO(p.headers,(n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),f=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/demo-creation/create"),method:"POST",headers:d,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:Dlc.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});return f.ok?{data:{ok:!0,body:void 0,headers:f.headers,rawResponse:f.rawResponse},rawResponse:f.rawResponse}:{data:{ok:!1,error:X6e.createSdkDemo.Error._unknown(f.error),rawResponse:f.rawResponse},rawResponse:f.rawResponse}})}};var wWf=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},xQr=class{constructor(t){this._options=elo(t)}status(t){return U1.fromPromise(this.__status(t))}__status(t){return wWf(this,void 0,void 0,function*(){var r,n,i,o,s,a,c,u;let l=kO((r=this._options)===null||r===void 0?void 0:r.headers,t?.headers),p=yield tR({url:$E.join((n=yield rA.get(this._options.baseUrl))!==null&&n!==void 0?n:yield rA.get(this._options.environment),"/api/health"),method:"GET",headers:l,queryParameters:t?.queryParams,timeoutMs:((s=(i=t?.timeoutInSeconds)!==null&&i!==void 0?i:(o=this._options)===null||o===void 0?void 0:o.timeoutInSeconds)!==null&&s!==void 0?s:60)*1e3,maxRetries:(a=t?.maxRetries)!==null&&a!==void 0?a:(c=this._options)===null||c===void 0?void 0:c.maxRetries,abortSignal:t?.abortSignal,fetchFn:(u=this._options)===null||u===void 0?void 0:u.fetch,logging:this._options.logging});return p.ok?{data:{ok:!0,body:yQr.status.Response.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:p.headers,rawResponse:p.rawResponse},rawResponse:p.rawResponse}:{data:{ok:!1,error:Z6e.status.Error._unknown(p.error),rawResponse:p.rawResponse},rawResponse:p.rawResponse}})}};var srt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},SQr=class{constructor(t){this._options=Eve(t)}createJob(t,r){return U1.fromPromise(this.__createJob(t,r))}__createJob(t,r){return srt(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l,p;let d=kO((n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),f=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/remote-gen/create-job"),method:"POST",headers:d,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:bQr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});if(f.ok)return{data:{ok:!0,body:KLt.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:f.headers,rawResponse:f.rawResponse},rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch((p=f.error.body)===null||p===void 0?void 0:p.error){case"IllegalApiNameError":case"IllegalApiVersionError":case"GeneratorsDoNotExistError":case"CannotPublishToNpmScope":case"CannotPublishToMavenGroup":case"CannotPublishPypiPackage":case"InsufficientPermissions":case"OrgNotConfiguredForWhitelabel":case"BranchDoesNotExist":case"RateLimitExceeded":return{data:{ok:!1,error:Dpe.createJob.Error.parseOrThrow(f.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse},rawResponse:f.rawResponse}}return{data:{ok:!1,error:Qi.createJob.Error._unknown(f.error),rawResponse:f.rawResponse},rawResponse:f.rawResponse}})}createJobV2(t,r){return U1.fromPromise(this.__createJobV2(t,r))}__createJobV2(t,r){return srt(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l,p;let d=kO((n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),f=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/remote-gen/create-job-v2"),method:"POST",headers:d,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:vQr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});if(f.ok)return{data:{ok:!0,body:KLt.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:f.headers,rawResponse:f.rawResponse},rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch((p=f.error.body)===null||p===void 0?void 0:p.error){case"IllegalApiNameError":case"IllegalApiVersionError":case"GeneratorsDoNotExistError":case"CannotPublishToNpmScope":case"CannotPublishToMavenGroup":case"CannotPublishPypiPackage":case"InsufficientPermissions":case"OrgNotConfiguredForWhitelabel":case"BranchDoesNotExist":case"RateLimitExceeded":return{data:{ok:!1,error:Dpe.createJobV2.Error.parseOrThrow(f.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse},rawResponse:f.rawResponse}}return{data:{ok:!1,error:Qi.createJobV2.Error._unknown(f.error),rawResponse:f.rawResponse},rawResponse:f.rawResponse}})}createJobV3(t,r){return U1.fromPromise(this.__createJobV3(t,r))}__createJobV3(t,r){return srt(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l,p;let d=yield this._options.authProvider.getAuthRequest(),f=kO(d.headers,(n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),m=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/remote-gen/create-job-v3"),method:"POST",headers:f,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:vQr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});if(m.ok)return{data:{ok:!0,body:KLt.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:m.headers,rawResponse:m.rawResponse},rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch((p=m.error.body)===null||p===void 0?void 0:p.error){case"IllegalApiNameError":case"IllegalApiVersionError":case"GeneratorsDoNotExistError":case"CannotPublishToNpmScope":case"CannotPublishToMavenGroup":case"CannotPublishPypiPackage":case"InsufficientPermissions":case"OrgNotConfiguredForWhitelabel":case"BranchDoesNotExist":case"RateLimitExceeded":return{data:{ok:!1,error:Dpe.createJobV3.Error.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse},rawResponse:m.rawResponse}}return{data:{ok:!1,error:Qi.createJobV3.Error._unknown(m.error),rawResponse:m.rawResponse},rawResponse:m.rawResponse}})}getJobStatus(t,r){return U1.fromPromise(this.__getJobStatus(t,r))}__getJobStatus(t,r){return srt(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l;let p=kO((n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),d=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),`/api/remote-gen/jobs/${$E.encodePathParam(HLt.jsonOrThrow(t,{omitUndefined:!0}))}/status`),method:"POST",headers:p,queryParameters:r?.queryParams,timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});return d.ok?{data:{ok:!0,body:Dpe.getJobStatus.Response.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:d.headers,rawResponse:d.rawResponse},rawResponse:d.rawResponse}:{data:{ok:!1,error:Qi.getJobStatus.Error._unknown(d.error),rawResponse:d.rawResponse},rawResponse:d.rawResponse}})}getDefinitionUploadUrl(t,r){return U1.fromPromise(this.__getDefinitionUploadUrl(t,r))}__getDefinitionUploadUrl(t,r){return srt(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l,p;let d=yield this._options.authProvider.getAuthRequest(),f=kO(d.headers,(n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),m=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/remote-gen/definition"),method:"PUT",headers:f,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:EQr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});return m.ok?{data:{ok:!0,body:hpo.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:m.headers,rawResponse:m.rawResponse},rawResponse:m.rawResponse}:m.error.reason==="status-code"&&((p=m.error.body)===null||p===void 0?void 0:p.error)==="InsufficientPermissions"?{data:{ok:!1,error:Dpe.getDefinitionUploadUrl.Error.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse},rawResponse:m.rawResponse}:{data:{ok:!1,error:Qi.getDefinitionUploadUrl.Error._unknown(m.error),rawResponse:m.rawResponse},rawResponse:m.rawResponse}})}createReplayInitPr(t,r){return U1.fromPromise(this.__createReplayInitPr(t,r))}__createReplayInitPr(t,r){return srt(this,void 0,void 0,function*(){var n,i,o,s,a,c,u,l,p;let d=yield this._options.authProvider.getAuthRequest(),f=kO(d.headers,(n=this._options)===null||n===void 0?void 0:n.headers,r?.headers),m=yield tR({url:$E.join((i=yield rA.get(this._options.baseUrl))!==null&&i!==void 0?i:yield rA.get(this._options.environment),"/api/remote-gen/replay/init"),method:"POST",headers:f,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:dpo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((a=(o=r?.timeoutInSeconds)!==null&&o!==void 0?o:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&a!==void 0?a:60)*1e3,maxRetries:(c=r?.maxRetries)!==null&&c!==void 0?c:(u=this._options)===null||u===void 0?void 0:u.maxRetries,abortSignal:r?.abortSignal,fetchFn:(l=this._options)===null||l===void 0?void 0:l.fetch,logging:this._options.logging});if(m.ok)return{data:{ok:!0,body:mpo.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),headers:m.headers,rawResponse:m.rawResponse},rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch((p=m.error.body)===null||p===void 0?void 0:p.error){case"InsufficientPermissions":case"GithubAppNotInstalled":return{data:{ok:!1,error:Dpe.createReplayInitPr.Error.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse},rawResponse:m.rawResponse}}return{data:{ok:!1,error:Qi.createReplayInitPr.Error._unknown(m.error),rawResponse:m.rawResponse},rawResponse:m.rawResponse}})}};var JLt=class{constructor(t){this._options=Eve(t)}get definitionRegistry(){var t;return(t=this._definitionRegistry)!==null&&t!==void 0?t:this._definitionRegistry=new IQr(this._options)}get demoCreation(){var t;return(t=this._demoCreation)!==null&&t!==void 0?t:this._demoCreation=new wQr(this._options)}get health(){var t;return(t=this._health)!==null&&t!==void 0?t:this._health=new xQr(this._options)}get remoteGen(){var t;return(t=this._remoteGen)!==null&&t!==void 0?t:this._remoteGen=new SQr(this._options)}};var Flc=require("fs/promises"),klc=we(require("path"),1);var Nlc={shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,shouldUseIdiomaticRequestNames:void 0,asyncApiMessageNaming:void 0,onlyIncludeReferencedSchemas:void 0,shouldUseOptionalAdditionalProperties:void 0,coerceEnumsToLiterals:void 0,objectQueryParameters:void 0,respectReadonlySchemas:void 0,useReadVariantForResponses:void 0,respectNullableSchemas:void 0,inlinePathParameters:void 0,useBytesForBinaryResponse:void 0,respectForwardCompatibleEnums:void 0,filter:void 0,exampleGeneration:void 0,defaultFormParameterEncoding:void 0,additionalPropertiesDefaultsTo:void 0,typeDatesAsStrings:void 0,preserveSingleSchemaOneOf:void 0,inlineAllOfSchemas:void 0,resolveAliases:void 0,groupMultiApiEnvironments:void 0,groupEnvironmentsByHost:void 0,multiServerStrategy:void 0,inferDefaultEnvironment:void 0,wrapReferencesToNullableInOptional:void 0,coerceOptionalSchemasToNullable:void 0,removeDiscriminantsFromSchemas:void 0,pathParameterOrder:void 0,defaultIntegerFormat:void 0,resolveSchemaCollisions:void 0,inferForwardCompatible:void 0,coerceConstsTo:void 0,shouldInferDiscriminatedUnionBaseProperties:void 0};async function jlc({absolutePathToGeneratorsConfiguration:e,rawGeneratorsConfiguration:t,context:r}){let n=Ulc(t.metadata),i=t.readme;zWf(r,t);let o=await TWf(t);return{absolutePathToConfiguration:e,api:o,rawConfiguration:t,defaultGroup:t["default-group"],groupAliases:t.aliases??{},reviewers:t.reviewers,groups:t.groups!=null?await Promise.all(Object.entries(t.groups).map(([s,a])=>BWf({absolutePathToGeneratorsConfiguration:e,groupName:s,group:a,maybeTopLevelMetadata:n,maybeTopLevelReviewers:t.reviewers,maybeRootAutomation:t.automation,readme:i,context:r}))):[],whitelabel:t.whitelabel!=null&&t.whitelabel.github!=null?{github:t.whitelabel.github}:void 0,ai:t.ai,replay:t.replay}}function TQr(e){return{...Nlc,shouldUseTitleAsName:e?.["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:e?.unions==="v1",asyncApiMessageNaming:e?.["message-naming"],respectNullableSchemas:e?.["respect-nullable-schemas"],wrapReferencesToNullableInOptional:e?.["wrap-references-to-nullable-in-optional"],coerceOptionalSchemasToNullable:e?.["coerce-optional-schemas-to-nullable"],onlyIncludeReferencedSchemas:e?.["only-include-referenced-schemas"],inlinePathParameters:e?.["inline-path-parameters"],shouldUseIdiomaticRequestNames:e?.["idiomatic-request-names"],removeDiscriminantsFromSchemas:Mlc(e?.["remove-discriminants-from-schemas"]),pathParameterOrder:e?.["path-parameter-order"]}}function Qlc(e){return{...BQr(e),shouldUseUndiscriminatedUnionsWithLiterals:e?.["prefer-undiscriminated-unions-with-literals"],onlyIncludeReferencedSchemas:e?.["only-include-referenced-schemas"],objectQueryParameters:e?.["object-query-parameters"],respectReadonlySchemas:e?.["respect-readonly-schemas"],useReadVariantForResponses:e?.["use-read-variant-for-responses"],inlinePathParameters:e?.["inline-path-parameters"],filter:e?.filter,exampleGeneration:e?.["example-generation"],defaultFormParameterEncoding:e?.["default-form-parameter-encoding"],useBytesForBinaryResponse:e?.["use-bytes-for-binary-response"],respectForwardCompatibleEnums:e?.["respect-forward-compatible-enums"],additionalPropertiesDefaultsTo:e?.["additional-properties-defaults-to"],typeDatesAsStrings:e?.["type-dates-as-strings"],preserveSingleSchemaOneOf:e?.["preserve-single-schema-oneof"],inlineAllOfSchemas:e?.["inline-all-of-schemas"],resolveAliases:e?.["resolve-aliases"],groupMultiApiEnvironments:e?.["group-multi-api-environments"],groupEnvironmentsByHost:e?.["group-environments-by-host"],multiServerStrategy:e?.["multi-server-strategy"],defaultIntegerFormat:e?.["default-integer-format"],pathParameterOrder:e?.["path-parameter-order"],shouldInferDiscriminatedUnionBaseProperties:e?.["infer-discriminated-union-base-properties"]}}function xWf(e){return{...BQr(e),asyncApiMessageNaming:e?.["message-naming"]}}function BQr(e){return{...Nlc,shouldUseTitleAsName:e?.["title-as-schema-name"],shouldUseIdiomaticRequestNames:e?.["idiomatic-request-names"],shouldUseOptionalAdditionalProperties:e?.["optional-additional-properties"],coerceEnumsToLiterals:e?.["coerce-enums-to-literals"],respectNullableSchemas:e?.["respect-nullable-schemas"],wrapReferencesToNullableInOptional:e?.["wrap-references-to-nullable-in-optional"],coerceOptionalSchemasToNullable:e?.["coerce-optional-schemas-to-nullable"],groupEnvironmentsByHost:e?.["group-environments-by-host"],multiServerStrategy:e?.["multi-server-strategy"],inferDefaultEnvironment:e?.["infer-default-environment"],groupMultiApiEnvironments:e!=null&&"group-multi-api-environments"in e?e["group-multi-api-environments"]:void 0,removeDiscriminantsFromSchemas:Mlc(e?.["remove-discriminants-from-schemas"]),pathParameterOrder:e?.["path-parameter-order"],resolveSchemaCollisions:e?.["resolve-schema-collisions"],inferForwardCompatible:e?.["infer-forward-compatible"],coerceConstsTo:e?.["coerce-consts-to"]}}function Mlc(e){if(e==null||e==="always")return Un.RemoveDiscriminantsFromSchemas.Always;if(e==="never")return Un.RemoveDiscriminantsFromSchemas.Never;throw new D({message:`Unknown value for generators.yml API setting: remove-discriminants-from-schemas: ${e}`,code:D.Code.ConfigError})}function vve(e,t){return{...e,...Object.fromEntries(Object.entries(t).filter(([r,n])=>n!==void 0))}}async function Rlc(e,t,r){let n=[];if(e!=null)if(typeof e=="string")n.push({schema:{type:"oss",path:e},origin:void 0,overrides:void 0,overlays:void 0,audiences:[],settings:r});else if(Un.isRawProtobufAPIDefinitionSchema(e))n.push({schema:{type:"protobuf",root:e.proto.root,target:e.proto.target??"",localGeneration:e.proto["local-generation"]??!1,fromOpenAPI:e.proto["from-openapi"]??!1,dependencies:e.proto.dependencies??[]},origin:void 0,overrides:e.proto.overrides,overlays:void 0,audiences:[],settings:r});else if(Array.isArray(e))for(let i of e)typeof i=="string"?n.push({schema:{type:"oss",path:i},origin:void 0,overrides:void 0,overlays:void 0,audiences:[],settings:r}):Un.isRawProtobufAPIDefinitionSchema(i)?n.push({schema:{type:"protobuf",root:i.proto.root,target:i.proto.target??"",localGeneration:i.proto["local-generation"]??!1,fromOpenAPI:i.proto["from-openapi"]??!1,dependencies:i.proto.dependencies??[]},origin:void 0,overrides:i.proto.overrides,overlays:void 0,audiences:[],settings:r}):n.push({schema:{type:"oss",path:i.path},origin:i.origin,overrides:i.overrides,overlays:void 0,audiences:i.audiences,settings:vve(r,TQr(i.settings))});else n.push({schema:{type:"oss",path:e.path},origin:e.origin,overrides:e.overrides,overlays:void 0,audiences:e.audiences,settings:vve(r,TQr(e.settings))});else{let i=t[Un.API_SETTINGS_KEY],o=t[Un.OPENAPI_LOCATION_KEY],s=t[Un.API_ORIGIN_LOCATION_KEY],a=t[Un.OPENAPI_OVERRIDES_LOCATION_KEY],c=t[Un.ASYNC_API_LOCATION_KEY];o!=null&&(typeof o=="string"?n.push({schema:{type:"oss",path:o},origin:s,overrides:a,overlays:void 0,audiences:[],settings:vve(r,TQr(i))}):typeof o=="object"&&n.push({schema:{type:"oss",path:o.path},origin:o.origin,overrides:o.overrides,overlays:void 0,audiences:[],settings:vve(r,Qlc(o.settings))})),c!=null&&n.push({schema:{type:"oss",path:c},origin:s,overrides:void 0,overlays:void 0,audiences:[],settings:vve(r,TQr(i))})}return n}async function SWf({apiConfiguration:e,rawConfiguration:t,apiSettings:r}){let n={"auth-schemes":t["auth-schemes"],...e};if(Un.isConjureSchema(e.specs))return{type:"conjure",pathToConjureDefinition:e.specs.conjure,...n,settings:r};let i=[],o={};for(let s of e.specs??[]){let a;if(Un.isOpenApiSpecSchema(s))a={schema:{type:"oss",path:s.openapi},origin:s.origin,overrides:s.overrides,overlays:s.overlays,audiences:[],settings:vve(r,Qlc(s.settings))};else if(Un.isAsyncApiSpecSchema(s))a={schema:{type:"oss",path:s.asyncapi},origin:s.origin,overrides:s.overrides,overlays:void 0,audiences:[],settings:vve(r,xWf(s.settings))};else if(Un.isProtoSpecSchema(s))a={schema:{type:"protobuf",root:s.proto.root,target:s.proto.target??"",localGeneration:s.proto["local-generation"]??!1,fromOpenAPI:s.proto["from-openapi"]??!1,dependencies:s.proto.dependencies??[]},origin:void 0,overrides:s.proto.overrides,overlays:void 0,audiences:[],settings:r};else if(Un.isOpenRpcSpecSchema(s))a={schema:{type:"openrpc",path:s.openrpc},origin:void 0,overrides:s.overrides,overlays:void 0,audiences:[],settings:r};else if(Un.isGraphQLSpecSchema(s))a={schema:{type:"graphql",path:s.graphql,examples:s.examples},origin:s.origin,overrides:s.overrides,overlays:void 0,audiences:[],settings:r};else continue;let c=Un.isGraphQLSpecSchema(s)&&"name"in s?s.name:"namespace"in s?s.namespace:void 0;c!=null?(o[c]??=[],o[c].push(a)):i.push(a)}return Object.keys(o).length===0?{type:"singleNamespace",definitions:i,...n,settings:r}:{type:"multiNamespace",rootDefinitions:i,definitions:o,...n,settings:r}}async function TWf(e){let t=e.api;if(t!=null){if(Un.isApiConfigurationV2Schema(t)){let n=BQr(t.settings);return SWf({apiConfiguration:t,rawConfiguration:e,apiSettings:n})}if(Un.isNamespacedApiConfiguration(t)){let n={},i={};for(let[o,s]of Object.entries(t.namespaces))n[o]=await Rlc(s,e,i);return{type:"multiNamespace",rootDefinitions:void 0,definitions:n}}}return{type:"singleNamespace",definitions:await Rlc(t,e,{})}}async function BWf({absolutePathToGeneratorsConfiguration:e,groupName:t,group:r,maybeTopLevelMetadata:n,maybeTopLevelReviewers:i,maybeRootAutomation:o,readme:s,context:a}){let c=Ulc(r.metadata);return{groupName:t,reviewers:r.reviewers,audiences:r.audiences==null?{type:"all"}:{type:"select",audiences:r.audiences},generators:await Promise.all(r.generators.map(u=>PWf({absolutePathToGeneratorsConfiguration:e,generator:u,maybeTopLevelMetadata:n,maybeGroupLevelMetadata:c,maybeTopLevelReviewers:i,maybeGroupLevelReviewers:r.reviewers,maybeRootAutomation:o,maybeGroupAutomation:r.automation,readme:s,context:a})))}}function OWf(e,t){if("image"in e){let i=hNr(e.image.name,t);return{normalizedName:py(i),containerImage:`${e.image.registry}/${i}`}}let r=hNr(e.name,t);return{normalizedName:py(r),containerImage:void 0}}async function PWf({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n,maybeGroupLevelReviewers:i,maybeTopLevelReviewers:o,maybeRootAutomation:s,maybeGroupAutomation:a,readme:c,context:u}){let{normalizedName:l,containerImage:p}=OWf(t,u);return{raw:t,automation:Un.resolveAutomationConfig({rootAutomation:s,groupAutomation:a,generatorAutomation:t.automation}),name:l,containerImage:p,version:t.version,config:t.config,outputMode:await kWf({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n,maybeGroupLevelReviewers:i,maybeTopLevelReviewers:o}),keywords:t.keywords,smartCasing:t["smart-casing"]??!0,disableExamples:t["disable-examples"]??!1,absolutePathToLocalOutput:t.output?.location==="local-file-system"?Ni(bn(e),t.output.path):void 0,absolutePathToLocalSnippets:t.snippets?.path!=null?Ni(bn(e),t.snippets.path):void 0,language:QWf(l),irVersionOverride:t["ir-version"]??void 0,publishMetadata:RWf({generatorInvocation:t}),readme:c,settings:t.api?.settings??void 0,apiOverride:DWf({generator:t})}}function DWf({generator:e}){if(e.api?.specs!=null||e.api?.auth!=null||e.api?.["auth-schemes"]!=null||e.api?.headers!=null)return{specs:e.api?.specs,auth:e.api?.auth,"auth-schemes":e.api?.["auth-schemes"],headers:e.api?.headers}}function RWf({generatorInvocation:e}){let t=e["publish-metadata"];if(t!=null)return{packageDescription:t["package-description"],publisherEmail:t.email,publisherName:t.author,referenceUrl:t["reference-url"]};if(e.metadata!=null)return{packageDescription:e.metadata["package-description"],publisherEmail:e.metadata.email,publisherName:e.metadata.author,referenceUrl:e.metadata["reference-url"]}}function Llc({pypiOutputMetadata:e,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r}){let n;return e!=null&&(n=LWf(e),n={...r,...t,...n}),n}function FWf({topLevelReviewers:e,groupLevelReviewers:t,outputModeReviewers:r}){let n=new Set,i=new Set,o=[],s=[...e?.teams??[],...t?.teams??[],...r?.teams??[]],a=[...e?.users??[],...t?.users??[],...r?.users??[]];for(let c of s)n.has(c.name)||(o.push(qr.GithubPullRequestReviewer.team({name:c.name})),n.add(c.name));for(let c of a)i.has(c.name)||(o.push(qr.GithubPullRequestReviewer.user({name:c.name})),i.add(c.name));return o}async function kWf({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r={},maybeTopLevelMetadata:n={},maybeGroupLevelReviewers:i,maybeTopLevelReviewers:o}){let s=t.snippets!=null&&t.snippets.path!=="";if(t.github){let a=Ive(t.github)?t.github.uri:t.github.repository,c,u,l;try{({owner:c,repo:u,remote:l}=Aw(a))}catch{throw new D({message:`Invalid GitHub repository "${a}" in generators.yml. Expected a repository like "owner/repo", "github.com/owner/repo", or "https://github.com/owner/repo.git".`,code:D.Code.ConfigError})}let p=l!=="github.com"?l:void 0,d=t.output!=null?jWf(t.output,r,n):void 0,f=MWf(t),m=f!=null?await NWf({absolutePathToGeneratorsConfiguration:e,githubLicense:f}):void 0,h=t.github.mode??"release";switch(h){case"commit":case"release":case"commit-and-release":{let A=t.github,y={owner:c,repo:u,host:p,branch:A.branch,license:m,publishInfo:d,downloadSnippets:s};return qr.OutputMode.githubV2(qr.GithubOutputModeV2.commitAndRelease(y))}case"pull-request":{let A=t.github,y=FWf({topLevelReviewers:o,groupLevelReviewers:i,outputModeReviewers:A.reviewers}),I={owner:c,repo:u,host:p,license:m,publishInfo:d,downloadSnippets:s,reviewers:y,branch:A.branch};return qr.OutputMode.githubV2(qr.GithubOutputModeV2.pullRequest(I))}case"push":{let A={owner:c,repo:u,host:p,branch:t.github.mode==="push"?t.github.branch:void 0,license:m,publishInfo:d,downloadSnippets:s};return qr.OutputMode.githubV2(qr.GithubOutputModeV2.push(A))}default:xe(h)}}if(t.output==null)return qr.remoteGen.OutputMode.publish({registryOverrides:{}});switch(t.output.location){case"local-file-system":return qr.OutputMode.downloadFiles({downloadSnippets:s});case"npm":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://registry.npmjs.org",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:s}));case"maven":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.mavenOverride({registryUrl:zlc(t.output),username:t.output.username??"",password:t.output.password??"",coordinate:t.output.coordinate,signature:t.output.signature!=null?{keyId:t.output.signature.keyId,secretKey:t.output.signature.secretKey,password:t.output.signature.password}:void 0,downloadSnippets:s}));case"postman":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.postman({apiKey:t.output["api-key"],workspaceId:t.output["workspace-id"]}));case"pypi":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.pypiOverride({registryUrl:t.output.url??"https://upload.pypi.org/legacy/",username:t.output.token!=null?"__token__":t.output.password??"",password:t.output.token??t.output.password??"",coordinate:t.output["package-name"],downloadSnippets:s,pypiMetadata:Llc({pypiOutputMetadata:t.output.metadata,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:n})}));case"nuget":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.nugetOverride({registryUrl:t.output.url??"https://nuget.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:s}));case"rubygems":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.rubyGemsOverride({registryUrl:t.output.url??"https://rubygems.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:s}));case"crates":return qr.OutputMode.publishV2(qr.remoteGen.PublishOutputModeV2.cratesOverride({registryUrl:t.output.url??"https://crates.io/api/v1/crates",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:s}));default:xe(t.output)}}async function NWf({absolutePathToGeneratorsConfiguration:e,githubLicense:t}){if(typeof t=="string")switch(t){case"MIT":return qr.GithubLicense.basic({id:qr.GithubLicenseId.Mit});case"Apache-2.0":return qr.GithubLicense.basic({id:qr.GithubLicenseId.Apache});default:xe(t)}let r=Ze(Ht.of(klc.default.dirname(e)),Fe.of(t.custom)),n=await(0,Flc.readFile)(r);return qr.GithubLicense.custom({contents:n.toString()})}function jWf(e,t,r){switch(e.location){case"local-file-system":throw new D({message:"Cannot use local-file-system with github publishing",code:D.Code.ConfigError});case"npm":return qr.GithubPublishInfo.npm({registryUrl:e.url??"https://registry.npmjs.org",packageName:e["package-name"],token:e.token});case"maven":return qr.GithubPublishInfo.maven({registryUrl:zlc(e),coordinate:e.coordinate,credentials:e.username!=null&&e.password!=null?{username:e.username,password:e.password}:void 0,signature:e.signature!=null?{keyId:e.signature.keyId,password:e.signature.password,secretKey:e.signature.secretKey}:void 0});case"postman":return qr.GithubPublishInfo.postman({apiKey:e["api-key"],workspaceId:e["workspace-id"]});case"pypi":return qr.GithubPublishInfo.pypi({registryUrl:e.url??"https://upload.pypi.org/legacy/",packageName:e["package-name"],credentials:e.token!=null?{username:"__token__",password:e.token}:{username:e.username??"",password:e.password??""},pypiMetadata:Llc({pypiOutputMetadata:e.metadata,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r})});case"nuget":return qr.GithubPublishInfo.nuget({registryUrl:e.url??"https://nuget.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"rubygems":return qr.GithubPublishInfo.rubygems({registryUrl:e.url??"https://rubygems.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"crates":return qr.GithubPublishInfo.crates({registryUrl:e.url??"https://crates.io/api/v1/crates",packageName:e["package-name"],token:e.token});default:xe(e)}}function QWf(e){if(e.includes("csharp"))return Un.GenerationLanguage.CSHARP;if(e.includes("go"))return Un.GenerationLanguage.GO;if(e.includes("java")||e.includes("spring"))return Un.GenerationLanguage.JAVA;if(e.includes("php"))return Un.GenerationLanguage.PHP;if(e.includes("python")||e.includes("fastapi")||e.includes("pydantic"))return Un.GenerationLanguage.PYTHON;if(e.includes("ruby"))return Un.GenerationLanguage.RUBY;if(e.includes("swift"))return Un.GenerationLanguage.SWIFT;if(e.includes("typescript"))return Un.GenerationLanguage.TYPESCRIPT}function zlc(e){return e.url!=null?e.url:e.signature!=null?"https://oss.sonatype.org/service/local/staging/deploy/maven2/":"https://s01.oss.sonatype.org/content/repositories/releases/"}function MWf(e){return e["publish-metadata"]?.license!=null?e["publish-metadata"].license:e.metadata?.license!=null?e.metadata.license:Ive(e.github)&&e.github.license!=null?e.github.license:e.github?.license}function Ulc(e){return e!=null?{description:e.description,authors:e.authors?.map(t=>({name:t.name,email:t.email}))}:void 0}function LWf(e){return e!=null?{description:e.description,authors:e.authors?.map(t=>({name:t.name,email:t.email})),keywords:e.keywords,documentationLink:e["documentation-link"],homepageLink:e["homepage-link"]}:void 0}function zWf(e,t){let r=[];t["api-settings"]!=null&&r.push('"api-settings" is deprecated. Please use "api.settings" for global defaults or "api.specs[].settings" for spec-specific settings instead.'),t["async-api"]!=null&&r.push('"async-api" is deprecated. Please use "api.specs[].asyncapi" instead.'),t.openapi!=null&&r.push('"openapi" is deprecated. Please use "api.specs[].openapi" instead.'),t["openapi-overrides"]!=null&&r.push('"openapi-overrides" is deprecated. Please use "api.specs[].overrides" instead.'),t["spec-origin"]&&r.push('"spec-origin" is deprecated. Please use "api.specs[].origin" instead.'),t.api!=null&&(typeof t.api=="string"&&r.push('Using an OpenAPI or AsyncAPI path string for "api" is deprecated. Please use "api.specs[].openapi" or "api.specs[].asyncapi" instead.'),Array.isArray(t.api)?r.push('Using an array for "api" is deprecated. Please use "api.specs[].openapi", "api.specs[].asyncapi", or "api.specs[].proto" instead.'):typeof t.api=="object"&&("path"in t.api&&r.push('Using "api.path" is deprecated. Please use "api.specs[].openapi" or "api.specs[].asyncapi" instead.'),"proto"in t.api&&r.push('Using "api.proto" is deprecated. Please use "api.specs[].proto" instead.'),"namespaces"in t.api&&r.push('Using "api.namespaces" is deprecated. Please use "api.specs[].openapi", "api.specs[].asyncapi", or "api.specs[].proto" with the "namespace" property instead.'))),r.length>0&&(e.logger.warn("Warnings for generators.yml:"),e.logger.warn(" "+r.join(`
|
|
@@ -3222,7 +3222,7 @@ ${mQc.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&pxo(th
|
|
|
3222
3222
|
`+yze.default.red(">> ")+t),this.screen.render(r,n)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?yze.default.cyan(CQc(t,this.opt.mask)):yze.default.italic(yze.default.dim("[hidden]")):this.opt.mask?CQc(t,this.opt.mask):yze.default.italic(yze.default.dim("[input is hidden] "))}getSpinningValue(t){return this.getMaskedValue(t)}filterInput(t){return t||(this.opt.default==null?"":this.opt.default)}onEnd(t){this.status="answered",this.answer=t.value,this.render(),this.screen.done(),this.done(t.value)}onError(t){this.render(t.isValid)}onKeypress(){this.opt.default&&=void 0,this.render()}};var $7r=we(pS(),1);var IMc=we(Wxo(),1),X7r=require("child_process"),Got=require("fs"),Y7r=we(require("path"),1),CMc=we(require("os"),1),wMc=require("crypto"),PSo=we(EMc(),1);var H7r=class extends Error{originalError;constructor(t){super(`Failed to create temporary file. ${t.message}`),this.originalError=t}};var nVt=class extends Error{originalError;constructor(t){super(`Failed to launch editor. ${t.message}`),this.originalError=t}};var K7r=class extends Error{originalError;constructor(t){super(`Failed to read temporary file. ${t.message}`),this.originalError=t}};var J7r=class extends Error{originalError;constructor(t){super(`Failed to remove temporary file. ${t.message}`),this.originalError=t}};function Z7r(e="",t,r){let n=new DSo(e,r);n.runAsync((i,o)=>{if(i)setImmediate(t,i,void 0);else try{n.cleanup(),setImmediate(t,void 0,o)}catch(s){setImmediate(t,s,void 0)}})}function vMc(e){return e?e.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function uVd(e){let t=[],r="";for(let n=0;n<e.length;n++){let i=e.charAt(n);n>0&&i===" "&&e[n-1]!=="\\"&&r.length>0?(t.push(r),r=""):r=`${r}${i}`}return r.length>0&&t.push(r),t}var DSo=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(t="",r){this.text=t,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(t){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(t,void 0,this.text)}catch(r){setImmediate(t,r,void 0)}})}catch(r){setImmediate(t,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let t=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=uVd(t).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let t=this.fileOptions.dir??CMc.default.tmpdir(),r=(0,wMc.randomUUID)(),n=vMc(this.fileOptions.prefix),i=vMc(this.fileOptions.postfix),o=`${n}${r}${i}`,s=Y7r.default.resolve(t,o),a=Y7r.default.resolve(t)+Y7r.default.sep;if(!s.startsWith(a))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=s;let c={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(c.mode=this.fileOptions.mode),(0,Got.writeFileSync)(this.tempFile,this.text,c)}catch(t){throw new H7r(t)}}readTemporaryFile(){try{let t=(0,Got.readFileSync)(this.tempFile);if(t.length===0)this.text="";else{let r=(0,IMc.detect)(t)??"utf8";PSo.default.encodingExists(r)||(r="utf8"),this.text=PSo.default.decode(t,r)}}catch(t){throw new K7r(t)}}removeTemporaryFile(){try{(0,Got.unlinkSync)(this.tempFile)}catch(t){throw new J7r(t)}}launchEditor(){try{let t=(0,X7r.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=t.status??0}catch(t){throw new nVt(t)}}launchEditorAsync(t){try{(0,X7r.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(t)})}catch(r){throw new nVt(r)}}};var xMc=we(yz(),1);var iVt=class extends fS{_run(t){this.done=t,this.editorResult=new xMc.Subject;let r=HO(this.rl);this.lineSubscription=r.line.subscribe(this.startExternalEditor.bind(this));let n=this.opt.waitUserInput===void 0?!0:this.opt.waitUserInput,i=this.handleSubmitEvents(this.editorResult);return i.success.forEach(this.onEnd.bind(this)),i.error.forEach(this.onError.bind(this)),this.currentText=this.opt.default,this.opt.default=null,n?this.render():this.startExternalEditor(),this}render(t){let r="",n=this.getQuestion();n+=this.status==="answered"?$7r.default.dim("Received"):$7r.default.dim("Press <enter> to launch your preferred editor."),t&&(r=$7r.default.red(">> ")+t),this.screen.render(n,r)}startExternalEditor(){this.rl.pause(),Z7r(this.currentText,this.endExternalEditor.bind(this),{postfix:this.opt.postfix??".txt"})}endExternalEditor(t,r){this.rl.resume(),t?this.editorResult.error(t):this.editorResult.next(r)}onEnd(t){this.editorResult.unsubscribe(),this.lineSubscription.unsubscribe(),this.answer=t.value,this.status="answered",this.render(),this.screen.done(),this.done(this.answer)}onError(t){this.render(t.isValid)}};var PMc=require("stream");var BMc=we(require("readline"),1),OMc=we(TMc(),1),Ize=class{constructor(t){this.rl||=BMc.default.createInterface(pVd(t)),this.rl.resume(),this.onForceClose=this.onForceClose.bind(this),process.on("exit",this.onForceClose),this.rl.on("SIGINT",this.onForceClose)}onForceClose(){this.close(),process.kill(process.pid,"SIGINT"),console.log("")}close(){this.rl.removeListener("SIGINT",this.onForceClose),process.removeListener("exit",this.onForceClose),this.rl.output.unmute(),this.activePrompt&&typeof this.activePrompt.close=="function"&&this.activePrompt.close(),this.rl.output.end(),this.rl.pause(),this.rl.close()}};function pVd(e={}){e.skipTTYChecks=e.skipTTYChecks===void 0?!0:e.skipTTYChecks;let t=e.input||process.stdin;if(!e.skipTTYChecks&&!t.isTTY){let i=new Error("Prompts can not be meaningfully rendered in non-TTY environments");throw i.isTtyError=!0,i}let r=new OMc.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var oVt=class extends Ize{constructor(t={}){super(t),this.log=new PMc.Writable({write:(r,n,i)=>{this.writeLog(r),i()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return __t(this.rl,this.bottomBar.split(`
|
|
3223
3223
|
`).length),this}updateBottomBar(t){return __t(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+`
|
|
3224
3224
|
`}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&&v7r(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var qd=we(yz(),1),FMc=we(b_t(),1);var eqr=we(yz(),1),DMc=we(b_t(),1),tqr=function(e,t,r){return typeof e[t]!="function"?(0,eqr.of)(e):(0,eqr.from)((0,DMc.default)(e[t])(r).then(n=>(e[t]=n,e)))};var RMc={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}},Wot=class extends Ize{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,qd.from)(t):(0,qd.isObservable)(t)?n=t:Object.values(t).every(i=>typeof i=="object"&&!Array.isArray(i)&&i!=null)?n=(0,qd.from)(Object.entries(t).map(([i,o])=>({name:i,...o}))):n=(0,qd.from)([t]),this.process=n.pipe((0,qd.concatMap)(this.processQuestion.bind(this)),(0,qd.publish)()),this.process.connect(),this.process.pipe((0,qd.reduce)((i,o)=>(RMc.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,qd.defer)(()=>(0,qd.of)(t).pipe((0,qd.concatMap)(this.setDefaultType.bind(this)),(0,qd.concatMap)(this.filterIfRunnable.bind(this)),(0,qd.concatMap)(()=>tqr(t,"message",this.answers)),(0,qd.concatMap)(()=>tqr(t,"default",this.answers)),(0,qd.concatMap)(()=>tqr(t,"choices",this.answers)),(0,qd.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,qd.defer)(()=>(0,qd.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,qd.defer)(()=>(0,qd.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&RMc.get(this.answers,t.name)!==void 0)return qd.EMPTY;if(t.when===!1)return qd.EMPTY;if(typeof t.when!="function")return(0,qd.of)(t);let{answers:r}=this;return(0,qd.defer)(()=>(0,qd.from)((0,FMc.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,qd.filter)(n=>n!=null)))}};function kMc(e){let t=function(r,n){let i;try{i=new Wot(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",q_t),this.registerPrompt("input",Aze),this.registerPrompt("number",G_t),this.registerPrompt("confirm",W_t),this.registerPrompt("rawlist",H_t),this.registerPrompt("expand",K_t),this.registerPrompt("checkbox",J_t),this.registerPrompt("password",Y_t),this.registerPrompt("editor",iVt)},t.restoreDefaultPrompts(),t}var FSo=kMc();function dVd(e,t){FSo.registerPrompt(e,t)}function mVd(){FSo.restoreDefaultPrompts()}var hVd={prompt:FSo,ui:{BottomBar:oVt,Prompt:Wot},createPromptModule:kMc,registerPrompt:dVd,restoreDefaultPrompts:mVd,Separator:cM},Nu=hVd;var Hot=require("path");function jMc(){let e=gVd();return async t=>{for(let r of t)r.module=e(r.filename);return t}}function gVd(e=process.argv[1]?(0,Hot.dirname)(process.argv[1]):process.cwd(),t=Hot.sep==="\\"){let r=t?NMc(e):e;return n=>{if(!n)return;let i=t?NMc(n):n,{dir:o,base:s,ext:a}=Hot.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 NMc(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var kSo=e=>{if("flags"in e){let t=QMc(e.flags),r=MMc(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,o])=>[i,NSo(o)])),n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,AVd(i,o,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function AVd(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 QMc=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,sVt(r)]).filter(([,t])=>t!==void 0)),MMc=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?NSo(n):void 0]}))};var sVt=e=>e===void 0?void 0:e.variant??e.enabled,NSo=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function LMc(){return"CompressionStream"in globalThis}async function rqr(e,t=!0){try{let n=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return await new Response(n).blob()}catch(r){return t&&console.error("Failed to gzip compress data",r),null}}var nqr="0123456789abcdef",iqr=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+=nqr.charAt(this.bytes[r]>>>4),t+=nqr.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+=nqr.charAt(this.bytes[r]>>>4),t+=nqr.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}},jSo=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??yVd()}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 iqr.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,iqr.ofInner(t)}},yVd=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),zMc,ACe=()=>bVd().toString(),bVd=()=>(zMc||(zMc=new jSo)).generate();var lM=(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.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.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({});var EVd=["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","pinterest","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"],UMc=function(e,t=[]){if(!e)return!1;let r=e.toLowerCase();return EVd.concat(t).some(n=>{let i=n.toLowerCase();return r.indexOf(i)!==-1})};var IVd=Array.isArray,_Mc=Object.prototype,RtE=_Mc.hasOwnProperty,QSo=_Mc.toString,MSo=IVd||function(e){return QSo.call(e)==="[object Array]"};var LSo=e=>e===Object(e)&&!MSo(e);var aVt=e=>e===void 0,cVt=e=>QSo.call(e)=="[object String]",VMc=e=>cVt(e)&&e.trim().length===0;var qMc=e=>QSo.call(e)=="[object Number]"&&e===e;var zSo=e=>e instanceof Error;function oqr(e){return e===null||typeof e!="object"}function Cze(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function GMc(e){return Cze(e,"ErrorEvent")}function Kot(e){return typeof Event<"u"&&CVd(e,Event)}function WMc(e){return Cze(e,"Object")}function CVd(e,t){try{return e instanceof t}catch{return!1}}function uVt(e,t,r,n,i){return t>r&&(n.warn("min cannot be greater than max."),t=r),qMc(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),uVt(i||r,t,r,n))}var wVd=864e5,sqr=class{constructor(t){this._buckets={},this._onBucketRateLimited=t._onBucketRateLimited,this._bucketSize=uVt(t.bucketSize,0,100,t._logger),this._refillRate=uVt(t.refillRate,0,this._bucketSize,t._logger),this._refillInterval=uVt(t.refillInterval,0,wVd,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 aqr=class{add(t){let r=ACe();return this.promiseByIds[r]=t,t.catch(()=>{}).finally(()=>{delete this.promiseByIds[r]}),t}async join(){let t=Object.values(this.promiseByIds),r=t.length;for(;r>0;)await Promise.all(t),t=Object.values(this.promiseByIds),r=t.length}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}};function xVd(e=console){return{log:e.log.bind(e),warn:e.warn.bind(e),error:e.error.bind(e),debug:e.debug.bind(e)}}var HMc=(e,t,r)=>{function n(o,...s){t(()=>{let a=r[o];a(e,...s)})}return{info:(...o)=>{n("log",...o)},warn:(...o)=>{n("warn",...o)},error:(...o)=>{n("error",...o)},critical:(...o)=>{r.error(e,...o)},createLogger:o=>HMc(`${e} ${o}`,t,r)}},SVd=e=>e();function KMc(e,t=SVd){return HMc(e,t,xVd())}var Yot="Mobile",uqr="iOS",Jot="Android",JMc="Tablet",qtE=Jot+" "+JMc;var TVd="Apple",GtE=TVd+" Watch",YMc="Safari",lqr="BlackBerry",XMc="Samsung",BVd=XMc+"Browser",OVd=XMc+" Internet",pqr="Chrome",PVd=pqr+" OS",DVd=pqr+" "+uqr,ZMc="Internet Explorer",RVd=ZMc+" "+Yot,_So="Opera",WtE=_So+" Mini",$Mc="Edge",FVd="Microsoft "+$Mc,VSo="Firefox",kVd=VSo+" "+uqr,qSo="Nintendo",GSo="PlayStation",cqr="Xbox",NVd=Jot+" "+Yot,jVd=Yot+" "+YMc,lVt="Windows",QVd=lVt+" Phone";var e6c="Generic",HtE=e6c+" "+Yot.toLowerCase(),KtE=e6c+" "+JMc.toLowerCase(),MVd="Konqueror",D2="(\\d+(\\.\\d+)?)",USo=new RegExp("Version/"+D2),JtE=new RegExp(cqr,"i"),YtE=new RegExp(GSo+" \\w+","i"),XtE=new RegExp(qSo+" \\w+","i"),LVd=new RegExp(lqr+"|PlayBook|BB10","i"),zVd={"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 ZtE={[RVd]:[new RegExp("rv:"+D2)],[FVd]:[new RegExp($Mc+"?\\/"+D2)],[pqr]:[new RegExp("("+pqr+"|CrMo)\\/"+D2)],[DVd]:[new RegExp("CriOS\\/"+D2)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+D2)],[YMc]:[USo],[jVd]:[USo],[_So]:[new RegExp("("+_So+"|OPR)\\/"+D2)],[VSo]:[new RegExp(VSo+"\\/"+D2)],[kVd]:[new RegExp("FxiOS\\/"+D2)],[MVd]:[new RegExp("Konqueror[:/]?"+D2,"i")],[lqr]:[new RegExp(lqr+" "+D2),USo],[NVd]:[new RegExp("android\\s"+D2,"i")],[OVd]:[new RegExp(BVd+"\\/"+D2)],[ZMc]:[new RegExp("(rv:|MSIE )"+D2)],Mozilla:[new RegExp("rv:"+D2)]};var $tE=[[new RegExp(cqr+"; "+cqr+" (.*?)[);]","i"),e=>[cqr,e&&e[1]||""]],[new RegExp(qSo,"i"),[qSo,""]],[new RegExp(GSo,"i"),[GSo,""]],[LVd,[lqr,""]],[new RegExp(lVt,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[QVd,""];if(new RegExp(Yot).test(t)&&!/IEMobile\b/.test(t))return[lVt+" "+Yot,""];let r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){let n=r[1],i=zVd[n]||"";return/arm/i.test(t)&&(i="RT"),[lVt,i]}return[lVt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){let t=[e[3],e[4],e[5]||"0"];return[uqr,t.join(".")]}return[uqr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=aVt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Jot+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Jot+")","i"),e=>{if(e&&e[2]){let t=[e[2],e[3],e[4]||"0"];return[Jot,t.join(".")]}return[Jot,""]}],[/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/,[PVd,""]],[/Linux|debian/i,["Linux",""]]];var t6c="utf8";function r6c(e,t){if(!e||typeof e!="string"||UVd(e))throw new Error(t)}function UVd(e){return e.trim().length===0}function n6c(e){return e?.replace(/\/+$/,"")}async function i6c(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 fqr(){return new Date().toISOString()}function Nfe(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}var o6c=e=>e instanceof Error;function WSo(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var dqr=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)}};var wze=class extends Error{constructor(t,r){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}},Xot=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function s6c(e){if(e instanceof wze){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function HSo(e){return typeof e=="object"&&(e instanceof wze||e instanceof Xot)}function a6c(e){return typeof e=="object"&&e instanceof wze&&e.status===413}var pVt=class{constructor(t,r={}){this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new aqr,this._events=new dqr,this._isInitialized=!1,r6c(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=n6c(r.host||"https://us.i.posthog.com"),this.flushAt=r.flushAt?Math.max(r.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r.maxQueueSize??1e3),this.flushInterval=r.flushInterval??1e4,this.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:HSo},this.requestTimeout=r.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=r.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r.disableGeoip??!0,this.disabled=r.disabled??!1,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this._logger=KMc("[PostHog]",this.logMsgIfDebug.bind(this)),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=!LMc()||(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(lM.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(lM.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(lM.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){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}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 getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,n,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(i=>i.json()).catch(i=>{this._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};this.evaluationContexts&&this.evaluationContexts.length>0&&(u.evaluation_contexts=this.evaluationContexts);let l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(u)};return this._logger.info("Flags URL",c),this.fetchWithRetry(c,l,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(p=>p.json()).then(p=>({success:!0,response:kSo(p)})).catch(p=>(this._events.emit("error",p),{success:!1,error:this.categorizeRequestError(p)}))}categorizeRequestError(t){if(t instanceof wze)return{type:"api_error",statusCode:t.status};if(t instanceof Xot){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=sVt(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={};(o??this.disableGeoip)&&(a.geoip_disable=!0),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.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).then(o=>{if(o.status!==200||!o.json){let s=`Surveys API could not be loaded: ${o.status}`,a=new Error(s);this._logger.error(a),this._events.emit("error",new Error(s));return}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(lM.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(lM.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(lM.Props,this.props)})}processBeforeEnqueue(t){return t}async flushStorage(){}enqueue(t,r,n){this.wrap(()=>{if(this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let i=this.prepareMessage(t,r,n);if(i=this.processBeforeEnqueue(i),i===null)return;let o=this.getPersistedProperty(lM.Queue)||[];o.length>=this.maxQueueSize&&(o.shift(),this._logger.info("Queue is full, the oldest event is dropped.")),o.push({message:i}),this.setPersistedProperty(lM.Queue,o),this._events.emit(t,i),o.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=Nfe(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n){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 i=this.prepareMessage(t,r,n);if(i=this.processBeforeEnqueue(i),i===null)return;let o={api_key:this.apiKey,batch:[i],sent_at:fqr()};this.historicalMigration&&(o.historical_migration=!0);let s=JSON.stringify(o),a=`${this.host}/batch/`,c=this.disableCompression?null:await rqr(s,this.isDebug),u={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...c!==null&&{"Content-Encoding":"gzip"}},body:c||s};try{await this.fetchWithRetry(a,u)}catch(l){this._events.emit("error",l)}}prepareMessage(t,r,n){let i={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:n?.timestamp?n?.timestamp:fqr(),uuid:n?.uuid?n.uuid:ACe()};return(n?.disableGeoip??this.disableGeoip)&&(i.properties||(i.properties={}),i.properties.$geoip_disable=!0),i.distinctId&&(i.distinct_id=i.distinctId,delete i.distinctId),i}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async t=>{await s6c(t)})}async flush(){let t=WSo([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),WSo([t]).then(()=>{this.flushPromise===t&&(this.flushPromise=null)}),t}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getPersistedProperty(lM.Queue)||[];if(!t.length)return;let r=[],n=t.length;for(;t.length>0&&r.length<n;){let i=t.slice(0,this.maxBatchSize),o=i.map(f=>f.message),s=async()=>{let m=(this.getPersistedProperty(lM.Queue)||[]).slice(i.length);this.setPersistedProperty(lM.Queue,m),t=m,await this.flushStorage()},a={api_key:this.apiKey,batch:o,sent_at:fqr()};this.historicalMigration&&(a.historical_migration=!0);let c=JSON.stringify(a),u=`${this.host}/batch/`,l=this.disableCompression?null:await rqr(c,this.isDebug),p={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...l!==null&&{"Content-Encoding":"gzip"}},body:l||c},d={retryCheck:f=>a6c(f)?!1:HSo(f)};try{await this.fetchWithRetry(u,p,d)}catch(f){if(a6c(f)&&o.length>1){this.maxBatchSize=Math.max(1,Math.floor(o.length/2)),this._logger.warn(`Received 413 when sending batch of size ${o.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw f instanceof Xot||await s(),this._events.emit("error",f),f}await s(),r.push(...o)}this._events.emit("flush",r)}async fetchWithRetry(t,r,n,i){let o=r.body?r.body:"",s=-1;try{s=o instanceof Blob?o.size:Buffer.byteLength(o,t6c)}catch{o instanceof Blob?s=o.size:s=new TextEncoder().encode(o).length}return await i6c(async()=>{let a=new AbortController,c=i??this.requestTimeout,u=Nfe(()=>a.abort(),c),l=null;try{l=await this.fetch(t,{signal:a.signal,...r})}catch(d){throw new Xot(d)}finally{clearTimeout(u)}if(!(r.mode==="no-cors")&&(l.status<200||l.status>=400))throw new wze(l,s);return l},{...this._retryOptions,...n})}async _shutdown(t=3e4){await this._initPromise;let r=!1;this.clearFlushTimer();let n=async()=>{try{for(await this.promiseQueue.join();!((this.getPersistedProperty(lM.Queue)||[]).length===0||(await this.flush(),r)););}catch(o){if(!HSo(o))throw o;await s6c(o)}},i;try{return await Promise.race([new Promise((o,s)=>{i=Nfe(()=>{this._logger.error("Timed out while shutting down PostHog"),r=!0,s("Timeout while shutting down PostHog. Some events may not have been sent.")},t)}),n()])}finally{clearTimeout(i)}}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 pM={};te(pM,{DOMExceptionCoercer:()=>XSo,ErrorCoercer:()=>ZSo,ErrorEventCoercer:()=>$So,ErrorPropertiesBuilder:()=>KSo,EventCoercer:()=>r1o,ObjectCoercer:()=>t1o,PrimitiveCoercer:()=>n1o,PromiseRejectionEventCoercer:()=>i1o,ReduceableCache:()=>o1o,StringCoercer:()=>e1o,chromeStackLineParser:()=>JSo,createDefaultStackParser:()=>r5d,createStackParser:()=>y6c,geckoStackLineParser:()=>YSo,nodeStackLineParser:()=>m6c,opera10StackLineParser:()=>p6c,opera11StackLineParser:()=>f6c,reverseAndStripFrames:()=>A6c,winjsStackLineParser:()=>l6c});var mqr,c6c,hqr;function u6c(e){let t=globalThis._posthogChunkIds;if(!t)return;let r=Object.keys(t);return hqr&&r.length===c6c||(c6c=r.length,hqr=r.reduce((n,i)=>{mqr||(mqr={});let o=mqr[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,mqr[i]=[u,l];break}}}return n},{})),hqr}var VVd=4,KSo=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&&MSo(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;return t.stack!=""&&t.stack!=null&&(i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?r.skipFirstLines:0),r.chunkIdMap)),{...t,cause:n,stack:i}}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={type:t.type,value:t.value,mechanism:{type:r.type??"generic",handled:r.handled??!0,synthetic:t.synthetic??!1}};t.stack&&(n.stacktrace={type:"raw",frames:t.stack});let i=[n];return t.cause!=null&&i.push(...this.convertToExceptionList(t.cause,{...r,handled:!0})),i}buildParsingContext(t){return{chunkIdMap:u6c(this.stackParser),skipFirstLines:t.skipFirstLines??1}}buildCoercingContext(t,r,n=0){let i=(s,a)=>{if(a<=VVd){let c=this.buildCoercingContext(t,r,a);return this.applyCoercers(s,c)}};return{...r,syntheticException:n==0?r.syntheticException:void 0,mechanism:t,apply:s=>i(s,n),next:s=>i(s,n+1)}}};var JO="?";function Aee(e,t,r,n,i){let o={platform:e,filename:t,function:r==="<anonymous>"?JO:r,in_app:!0};return aVt(n)||(o.lineno=n),aVt(i)||(o.colno=i),o}var gqr=(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]:JO,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var qVd=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,GVd=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,WVd=/\((\S*)(?::(\d+))(?::(\d+))\)/,JSo=(e,t)=>{let r=qVd.exec(e);if(r){let[,i,o,s]=r;return Aee(t,i,JO,+o,+s)}let n=GVd.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){let a=WVd.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}let[o,s]=gqr(n[1]||JO,n[2]);return Aee(t,s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}};var HVd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,KVd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,YSo=(e,t)=>{let r=HVd.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let s=KVd.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]||JO;return[o,i]=gqr(o,i),Aee(t,i,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}};var JVd=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,l6c=(e,t)=>{let r=JVd.exec(e);return r?Aee(t,r[2],r[1]||JO,+r[3],r[4]?+r[4]:void 0):void 0};var YVd=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,p6c=(e,t)=>{let r=YVd.exec(e);return r?Aee(t,r[2],r[3]||JO,+r[1]):void 0},XVd=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,f6c=(e,t)=>{let r=XVd.exec(e);return r?Aee(t,r[5],r[3]||r[4]||JO,+r[1],+r[2]):void 0};var ZVd=/^\s*[-]{4,}$/,$Vd=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,m6c=(e,t)=>{let r=e.match($Vd);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||JO,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]),{filename:c?decodeURI(c):void 0,module:void 0,function:o,lineno:d6c(r[3]),colno:d6c(r[4]),in_app:e5d(c||"",u),platform:t}}if(e.match(ZVd))return{filename:e,platform:t}};function e5d(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 d6c(e){return parseInt(e||"",10)||void 0}var h6c=/\(error: (.*)\)/,g6c=50;function A6c(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,g6c).map(r=>({...r,filename:r.filename||t5d(t).filename,function:r.function||JO}))}function t5d(e){return e[e.length-1]||{}}function r5d(){return y6c("web:javascript",JSo,YSo)}function y6c(e,...t){return(r,n=0)=>{let i=[],o=r.split(`
|
|
3225
|
-
`);for(let s=n;s<o.length;s++){let a=o[s];if(a.length>1024)continue;let c=h6c.test(a)?a.replace(h6c,"$1"):a;if(!c.match(/\S*Error: /)){for(let u of t){let l=u(c,e);if(l){i.push(l);break}}if(i.length>=g6c)break}}return A6c(i)}}var XSo=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){let n=cVt(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 Cze(t,"DOMException")}isDOMError(t){return Cze(t,"DOMError")}};var ZSo=class{match(t){return zSo(t)}coerce(t,r){return{type:this.getType(t),value:this.getMessage(t,r),stack:this.getStack(t),cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}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){return t.stacktrace||t.stack||void 0}};var $So=class{constructor(){}match(t){return GMc(t)&&t.error!=null}coerce(t,r){let n=r.apply(t.error);return n||{type:"ErrorEvent",value:t.message,stack:r.syntheticException?.stack,synthetic:!0}}};var n5d=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,e1o=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(n5d);return i&&(r=i[1],n=i[2]),[r,n]}};var b6c=["fatal","error","warning","log","info","debug"];function Aqr(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 t1o=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:r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return Kot(t)?t.constructor.name:"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=Aqr(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${n}`}isSeverityLevel(t){return cVt(t)&&!VMc(t)&&b6c.indexOf(t)>=0}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];if(o6c(n))return n}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var r1o=class{match(t){return Kot(t)}coerce(t,r){let n=t.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${Aqr(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var n1o=class{match(t){return oqr(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var i1o=class{match(t){return Cze(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Kot(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 oqr(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 o1o=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 I6c=require("fs"),C6c=require("readline"),yqr=new pM.ReduceableCache(25),w6c=new pM.ReduceableCache(20),s1o=7,i5d=1e3,o5d=1e4;async function x6c(e){let t={};for(let i=e.length-1;i>=0;i--){let o=e[i],s=o?.filename;if(!o||typeof s!="string"||typeof o.lineno!="number"||u5d(s)||l5d(o))continue;t[s]||(t[s]=[]),t[s].push(o.lineno)}let r=Object.keys(t);if(r.length==0)return e;let n=[];for(let i of r){if(w6c.get(i))continue;let o=t[i];if(!o)continue;o.sort((c,u)=>c-u);let s=f5d(o);if(s.every(c=>p5d(i,c)))continue;let a=d5d(yqr,i,{});n.push(s5d(i,s,a))}return await Promise.all(n).catch(()=>{}),e&&e.length>0&&a5d(e,yqr),yqr.reduce(),e}function s5d(e,t,r){return new Promise(n=>{let i=(0,I6c.createReadStream)(e),o=(0,C6c.createInterface)({input:i});function s(){i.destroy(),n()}let a=0,c=0,u=t[c];if(u===void 0)return void s();let l=u[0],p=u[1];function d(){w6c.set(e,1),o.close(),o.removeAllListeners(),s()}i.on("error",d),o.on("error",d),o.on("close",s),o.on("line",f=>{if(a++,!(a<l)&&(r[a]=m5d(f,0),a>=p)){if(c===t.length-1){o.close(),o.removeAllListeners();return}c++;let m=t[c];if(m===void 0){o.close(),o.removeAllListeners();return}l=m[0],p=m[1]}})})}function a5d(e,t){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let n=t.get(r.filename);if(n===void 0)continue;c5d(r.lineno,r,n)}}function c5d(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=S6c(e);i<e;i++){let o=r[i];if(o===void 0)return void E6c(t);t.pre_context.push(o)}if(r[e]===void 0)return void E6c(t);t.context_line=r[e];let n=T6c(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 E6c(e){delete e.pre_context,delete e.context_line,delete e.post_context}function u5d(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function l5d(e){return e.lineno!==void 0&&e.lineno>o5d||e.colno!==void 0&&e.colno>i5d}function p5d(e,t){let r=yqr.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 f5d(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=v6c(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+s1o:(i.push(n),n=v6c(o)),t++}return i}function v6c(e){return[S6c(e),T6c(e)]}function S6c(e){return Math.max(1,e-s1o)}function T6c(e){return e+s1o}function d5d(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function m5d(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}function h5d(e,t){let r=!1;return Object.assign(n=>{let o=global.process.listeners("uncaughtException").filter(s=>s.name!=="domainUncaughtExceptionClear"&&s._posthogErrorHandler!==!0).length===0;e(n,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&o&&(r=!0,t(n))},{_posthogErrorHandler:!0})}function B6c(e,t){globalThis.process?.on("uncaughtException",h5d(e,t))}function O6c(e){globalThis.process?.on("unhandledRejection",t=>e(t,{mechanism:{type:"onunhandledrejection",handled:!1}}))}var g5d=2e3,gH=class e{constructor(t,r,n){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=n,this._rateLimiter=new sqr({refillRate:1,bucketSize:10,refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(t){return LSo(t)&&"__posthog_previously_captured_error"in t&&t.__posthog_previously_captured_error===!0}static async buildEventMessage(t,r,n,i){let o={...i},s=this.errorPropertiesBuilder.buildFromUnknown(t,r);return s.$exception_list=await this.errorPropertiesBuilder.modifyFrames(s.$exception_list),{event:"$exception",distinctId:n,properties:{...s,...o},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){this.isEnabled()&&(B6c(this.onException.bind(this),this.onFatalError.bind(this)),O6c(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{if(!e.isPreviouslyCapturedError(t)){let n=await e.buildEventMessage(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.capture(n)}})())}async onFatalError(t){console.error(t),await this.client.shutdown(g5d),process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}};var P6c="5.29.1";var fVt={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};async function D6c(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(i=>i.toString(16).padStart(2,"0")).join("")}var A5d=6e4,y5d=1152921504606847e3,b5d=["is_not"],Zot=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},Gd=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},yee=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},bqr=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.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.cacheProvider=a.cacheProvider,this.strictLocalEvaluation=a.strictLocalEvaluation??!1,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}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 yee||u instanceof Gd?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={...t,evaluationCache:t.evaluationCache??{}};return await Promise.all(s.map(async c=>{try{let{value:u,payload:l}=await this.computeFlagAndPayloadLocally(c,a);n[c.key]=u,l&&(i[c.key]=l)}catch(u){u instanceof yee||u instanceof Gd?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(o||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};let s;s=i!==void 0?i:await this.computeFlagValueLocally(t,r);let a=this.getFeatureFlagPayload(t.key,s);return{value:s,payload:a}}async computeFlagValueLocally(t,r){let{distinctId:n,groups:i,personProperties:o,groupProperties:s}=r;if(t.ensure_experience_continuity)throw new Gd("Flag has experience continuity enabled");if(!t.active)return!1;let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let u=this.groupTypeMapping[String(c)];if(!u)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Gd("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 Gd(`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}getFeatureFlagPayload(t,r){let n=null;if(r!==!1&&r!=null&&(typeof r=="boolean"?n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]||null:typeof r=="string"&&(n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]||null),n!=null)){if(typeof n=="object")return n;if(typeof n=="string")try{return JSON.parse(n)}catch{}return n}return null}async evaluateFlagDependency(t,r,n){let{evaluationCache:i}=n,o=t.key;if(!this.featureFlagsByKey)throw new Gd("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new Gd(`Flag dependency property for '${o}' is missing required 'dependency_chain' field`);let s=t.dependency_chain;if(!Array.isArray(s))throw new Gd(`Flag dependency property for '${o}' has an invalid 'dependency_chain' (expected array, got ${typeof s})`);if(s.length===0)throw new Gd(`Circular dependency detected for flag '${o}' (empty dependency chain)`);for(let c of s){if(!(c in i)){let l=this.featureFlagsByKey[c];if(l)if(l.active)try{let p=await this.computeFlagValueLocally(l,n);i[c]=p}catch(p){throw new Gd(`Error evaluating flag dependency '${c}' for flag '${o}': ${p}`)}else i[c]=!1;else throw new Gd(`Missing flag dependency '${c}' for flag '${o}'`)}if(i[c]==null)throw new Gd(`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){let o=t.filters||{},s=o.groups||[],a=!1,c;for(let u of s)try{if(await this.isConditionMatch(t,r,u,n,i)){let l=u.variant,p=o.multivariate?.variants||[];c=l&&p.some(d=>d.key===l)?l:await this.getMatchingVariant(t,r)||!0;break}}catch(l){if(l instanceof yee)throw l;if(l instanceof Gd)a=!0;else throw l}if(c!==void 0)return c;if(a)throw new Gd("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i,o){let s=n.rollout_percentage,a=c=>{this.logMsgIfDebug(()=>console.warn(c))};if((n.properties||[]).length>0){for(let c of n.properties){let u=c.type,l=!1;if(l=u==="cohort"?j6c(c,i,this.cohorts,this.debugMode):u==="flag"?await this.evaluateFlagDependency(c,i,o):N6c(c,i,a),!l)return!1}if(s==null)return!0}return!(s!=null&&await R6c(t.key,r)>s/100)}async getMatchingVariant(t,r){let n=await R6c(t.key,r,"variant"),i=this.variantLookupTable(t).find(o=>n>=o.valueMin&&n<o.valueMax);if(i)return i.key}variantLookupTable(t){let r=[],n=0,i=0;return((t.filters||{}).multivariate?.variants||[]).forEach(a=>{i=n+a.rollout_percentage/100,r.push({valueMin:n,valueMax:i,key:a.key}),n=i}),r}updateFlagState(t){this.featureFlags=t.flags,this.featureFlagsByKey=t.flags.reduce((r,n)=>(r[n.key]=n,r),{}),this.groupTypeMapping=t.groupTypeMapping,this.cohorts=t.cohorts,this.loadedSuccessfullyOnce=!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(r.flags),!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(){return this.shouldBeginExponentialBackoff?Math.min(A5d,this.pollingInterval*2**this.backOffCount):this.pollingInterval}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),this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval());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 Zot(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.beginBackoff(),new Zot(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new Zot(`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={flags:n.flags??[],groupTypeMapping:n.group_type_mapping||{},cohorts:n.cohorts||{}};if(this.updateFlagState(i),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(i)}catch(o){this.onError?.(new Error(`Failed to store in cache: ${o}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(i.flags);break}default:return}}catch(t){t instanceof Zot&&this.onError?.(t)}}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}}_requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),n=null;if(this.timeout&&typeof this.timeout=="number"){let i=new AbortController;n=Nfe(()=>{i.abort()},this.timeout),r.signal=i.signal}try{let i=this.fetch;return i(t,r)}finally{clearTimeout(n)}}async stopPoller(t=3e4){if(clearTimeout(this.poller),this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await Promise.race([r,new Promise((n,i)=>setTimeout(()=>i(new Error(`Cache shutdown timeout after ${t}ms`)),t))])}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};async function R6c(e,t,r=""){let n=await D6c(`${e}.${t}${r}`);return parseInt(n.slice(0,15),16)/y5d}function N6c(e,t,r){let n=e.key,i=e.value,o=e.operator||"exact";if(n in t){if(o==="is_not_set")throw new Gd("Operator is_not_set is not supported")}else throw new Gd(`Property ${n} not found in propertyValues`);let s=t[n];if(s==null&&!b5d.includes(o))return r&&r(`Property ${n} cannot have a value of null/undefined with the ${o} operator`),!1;function a(u,l){return Array.isArray(u)?u.map(p=>String(p).toLowerCase()).includes(String(l).toLowerCase()):String(u).toLowerCase()===String(l).toLowerCase()}function c(u,l,p){if(p==="gt")return u>l;if(p==="gte")return u>=l;if(p==="lt")return u<l;if(p==="lte")return u<=l;throw new Error(`Invalid operator: ${p}`)}switch(o){case"exact":return a(i,s);case"is_not":return!a(i,s);case"is_set":return n in t;case"icontains":return String(s).toLowerCase().includes(String(i).toLowerCase());case"not_icontains":return!String(s).toLowerCase().includes(String(i).toLowerCase());case"regex":return F6c(String(i))&&String(s).match(String(i))!==null;case"not_regex":return F6c(String(i))&&String(s).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let u=typeof i=="number"?i:null;if(typeof i=="string")try{u=parseFloat(i)}catch{}return u==null||s==null?c(String(s),String(i),o):typeof s=="string"?c(s,String(i),o):c(s,u,o)}case"is_date_after":case"is_date_before":{if(typeof i=="boolean")throw new Gd("Date operations cannot be performed on boolean values");let u=w5d(String(i));if(u==null&&(u=k6c(i)),u==null)throw new Gd(`Invalid date: ${i}`);let l=k6c(s);return["is_date_before"].includes(o)?l<u:l>u}case"semver_eq":return qV(YO(String(s)),YO(String(i)))===0;case"semver_neq":return qV(YO(String(s)),YO(String(i)))!==0;case"semver_gt":return qV(YO(String(s)),YO(String(i)))>0;case"semver_gte":return qV(YO(String(s)),YO(String(i)))>=0;case"semver_lt":return qV(YO(String(s)),YO(String(i)))<0;case"semver_lte":return qV(YO(String(s)),YO(String(i)))<=0;case"semver_tilde":{let u=YO(String(s)),{lower:l,upper:p}=v5d(String(i));return qV(u,l)>=0&&qV(u,p)<0}case"semver_caret":{let u=YO(String(s)),{lower:l,upper:p}=I5d(String(i));return qV(u,l)>=0&&qV(u,p)<0}case"semver_wildcard":{let u=YO(String(s)),{lower:l,upper:p}=C5d(String(i));return qV(u,l)>=0&&qV(u,p)<0}default:throw new Gd(`Unknown operator: ${o}`)}}function E5d(e,t){if(!(e in t))throw new yee(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}function j6c(e,t,r,n=!1){let i=String(e.value);E5d(i,r);let o=r[i];return Q6c(o,t,r,n)}function Q6c(e,t,r,n=!1){if(!e)return!0;let i=e.type,o=e.values;if(!o||o.length===0)return!0;let s=!1;if("values"in o[0]){for(let a of o)try{let c=Q6c(a,t,r,n);if(i==="AND"){if(!c)return!1}else if(c)return!0}catch(c){if(c instanceof yee)throw c;if(c instanceof Gd)n&&console.debug(`Failed to compute property ${a} locally: ${c}`),s=!0;else throw c}if(s)throw new Gd("Can't match cohort without a given cohort property value");return i==="AND"}for(let a of o)try{let c;if(a.type==="cohort")c=j6c(a,t,r,n);else if(a.type==="flag"){n&&console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${a.key||"unknown"}'`);continue}else c=N6c(a,t);let u=a.negation||!1;if(i==="AND"){if(!c&&!u||c&&u)return!1}else if(c&&!u||!c&&u)return!0}catch(c){if(c instanceof yee)throw c;if(c instanceof Gd)n&&console.debug(`Failed to compute property ${a} locally: ${c}`),s=!0;else throw c}if(s)throw new Gd("can't match cohort without a given cohort property value");return i==="AND"}function F6c(e){try{return new RegExp(e),!0}catch{return!1}}function YO(e){let r=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!r||r.startsWith("."))throw new Gd(`Invalid semver: ${e}`);let n=r.split("."),i=c=>{if(c===void 0||c==="")return 0;if(!/^\d+$/.test(c))throw new Gd(`Invalid semver: ${e}`);return parseInt(c,10)},o=i(n[0]),s=i(n[1]),a=i(n[2]);return[o,s,a]}function qV(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 v5d(e){let t=YO(e),r=[t[0],t[1],t[2]],n=[t[0],t[1]+1,0];return{lower:r,upper:n}}function I5d(e){let t=YO(e),[r,n,i]=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 C5d(e){let r=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!r)throw new Gd(`Invalid wildcard semver: ${e}`);let n=r.split("."),i=parseInt(n[0],10);if(isNaN(i))throw new Gd(`Invalid wildcard semver: ${e}`);let o,s;if(n.length===1)o=[i,0,0],s=[i+1,0,0];else{let a=parseInt(n[1],10);if(isNaN(a))throw new Gd(`Invalid wildcard semver: ${e}`);o=[i,a,0],s=[i,a+1,0]}return{lower:o,upper:s}}function k6c(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 Gd(`${e} is in an invalid date format`)}throw new Gd(`The date provided ${e} must be a string, number, or date object`)}function w5d(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(!r)return null;{if(!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}}var Eqr=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};var x5d=100,M6c=3e4,S5d=5e4,T5d=50,B5d=500,vqr=class extends pVt{constructor(t,r={}){if(super(t,r),this._memoryStorage=new Eqr,this.options=r,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,x5d):M6c,typeof r.waitUntilDebounceMs=="number"&&(this.options.waitUntilDebounceMs=Math.max(r.waitUntilDebounceMs,0)),typeof r.waitUntilMaxWaitMs=="number"&&(this.options.waitUntilMaxWaitMs=Math.max(r.waitUntilMaxWaitMs,0)),r.personalApiKey){if(r.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');r.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new bqr({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:i=>{this._events.emit("error",i)},onLoad:i=>{this._events.emit("localEvaluationFlagsLoaded",i)},customHeaders:this.getCustomHeaders(),cacheProvider:r.flagDefinitionCacheProvider,strictLocalEvaluation:r.strictLocalEvaluation}))}this.errorTracking=new gH(this,r,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||S5d}enqueue(t,r,n){super.enqueue(t,r,n),this.scheduleDebouncedFlush()}async flush(){let t=super.flush(),r=this.options.waitUntil;if(r&&!this._waitUntilCycle)try{r(t.catch(()=>{}))}catch{}return t}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??B5d,i=r>=n;if(this._waitUntilCycle.timer!==void 0&&clearTimeout(this._waitUntilCycle.timer),i)return void this.resolveWaitUntilFlush();let o=this.options.waitUntilDebounceMs??T5d;this._waitUntilCycle.timer=Nfe(()=>{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 super.flush()}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)}getLibraryVersion(){return P6c}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}capture(t){typeof t=="string"&&this._logger.warn("Called capture() with a string as the first argument when an object was expected."),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:n,properties:i,options:o})=>super.captureStateless(r,n,i,{timestamp:o.timestamp,disableGeoip:o.disableGeoip,uuid:o.uuid})).catch(r=>{r&&console.error(r)}))}async captureImmediate(t){return typeof t=="string"&&this._logger.warn("Called captureImmediate() with a string as the first argument when an object was expected."),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn("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.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:n,properties:i,options:o})=>super.captureStatelessImmediate(r,n,i,{timestamp:o.timestamp,disableGeoip:o.disableGeoip,uuid:o.uuid})).catch(r=>{r&&console.error(r)}))}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};super.identifyStateless(t,l,{disableGeoip:n})}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};super.identifyStatelessImmediate(t,l,{disableGeoip:n})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async aliasImmediate(t){await super.aliasStatelessImmediate(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(t=M6c){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){let o=n.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&t in this._flagOverrides){let T=this._flagOverrides[t];if(T===void 0)return;let O=this._payloadOverrides?.[t];return{key:t,enabled:T!==!1,variant:typeof T=="string"?T:void 0,payload:O}}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,u,l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f,m=!1,h,A,y,I,w,C;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let T=this.featureFlagsPoller?.featureFlagsByKey[t];if(T)try{let O=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(T,d,{matchValue:i});if(O){m=!0;let R=O.value;I=T.id,C="Evaluated locally",f={key:t,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:O.payload??void 0}}}catch(O){if(O instanceof yee||O instanceof Gd)this._logger?.info(`${O.name} when computing flag locally: ${t}: ${O.message}`);else throw O}}if(!m&&!c){let T=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,d.personProperties,d.groupProperties,a,[t]);if(T===void 0)y=fVt.UNKNOWN_ERROR;else{h=T.requestId,A=T.evaluatedAt;let O=[];T.errorsWhileComputingFlags&&O.push(fVt.ERRORS_WHILE_COMPUTING),T.quotaLimited?.includes("feature_flags")&&O.push(fVt.QUOTA_LIMITED);let R=T.flags[t];if(R===void 0)O.push(fVt.FLAG_MISSING);else{I=R.metadata?.id,w=R.metadata?.version,C=R.reason?.description??R.reason?.code;let P;if(R.metadata?.payload!==void 0)try{P=JSON.parse(R.metadata.payload)}catch{P=R.metadata.payload}f={key:t,enabled:R.enabled,variant:R.variant,payload:P}}O.length>0&&(y=O.join(","))}}if(o){let T=f===void 0?void 0:f.enabled===!1?!1:f.variant??!0,O=`${t}_${T}`;if(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(O)){Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(O):this.distinctIdHasSentFlagCalls[r]=[O];let R={$feature_flag:t,$feature_flag_response:T,$feature_flag_id:I,$feature_flag_version:w,$feature_flag_reason:C,locally_evaluated:m,[`$feature/${t}`]:T,$feature_flag_request_id:h,$feature_flag_evaluated_at:m?Date.now():A};if(m&&this.featureFlagsPoller){let P=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();P!==void 0&&(R.$feature_flag_definitions_loaded_at=P)}y&&(R.$feature_flag_error=y),this.capture({distinctId:r,event:"$feature_flag_called",properties:R,groups:s,disableGeoip:a})}}return f!==void 0&&this._payloadOverrides!==void 0&&t in this._payloadOverrides&&(f={...f,payload:this._payloadOverrides[t]}),f}async getFeatureFlag(t,r,n){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(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.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){let i=await this.getFeatureFlag(t,r,n);if(i!==void 0)return!!i||!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:{}};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,u,l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),m={},h={},A=!0;if(f&&(m=f.response,h=f.payloads,A=f.fallbackToFlags),A&&!c){let y=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,d.personProperties,d.groupProperties,s,a);m={...m,...y.flags||{}},h={...h,...y.payloads||{}}}return this._flagOverrides!==void 0&&(m={...m,...this._flagOverrides}),this._payloadOverrides!==void 0&&(h={...h,...this._payloadOverrides}),{featureFlags:m,featureFlagPayloads:h}}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){super.groupIdentifyStateless(t,r,n,{disableGeoip:o},i)}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=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown();try{return await super._shutdown(t)}finally{r?.()}}async _requestRemoteConfigPayload(t){if(!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=Nfe(()=>{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(WMc(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){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={distinct_id:t,...n||{}},s={};if(r)for(let a of Object.keys(r))s[a]={$group_key:r[a],...i?.[a]||{}};return{allPersonProperties:o,allGroupProperties:s}}createFeatureFlagEvaluationContext(t,r,n,i){return{distinctId:t,groups:r||{},personProperties:n||{},groupProperties:i||{},evaluationCache:{}}}captureException(t,r,n,i){if(!gH.isPreviouslyCapturedError(t)){let o=new Error("PostHog syntheticException");this.addPendingPromise(gH.buildEventMessage(t,{syntheticException:o},r,n).then(s=>this.capture({...s,uuid:i})))}}async captureExceptionImmediate(t,r,n){if(!gH.isPreviouslyCapturedError(t)){let i=new Error("PostHog syntheticException");return this.addPendingPromise(gH.buildEventMessage(t,{syntheticException:i},r,n).then(o=>this.captureImmediate(o)))}}async prepareEventMessage(t){let{distinctId:r,event:n,properties:i,groups:o,sendFeatureFlags:s,timestamp:a,disableGeoip:c,uuid:u}=t,l=this.context?.get(),p=r||l?.distinctId,d={...this.props,...l?.properties||{},...i||{}};p||(p=ACe(),d.$process_person_profile=!1),l?.sessionId&&!d.$session_id&&(d.$session_id=l.sessionId);let f=this._runBeforeSend({distinctId:p,event:n,properties:d,groups:o,sendFeatureFlags:s,timestamp:a,disableGeoip:c,uuid:u});if(!f)return Promise.reject(null);let m=await Promise.resolve().then(async()=>{if(s){let h=typeof s=="object"?s:void 0;return await this.getFeatureFlagsForEvent(f.distinctId,o,c,h)}return f.event,{}}).then(h=>{let A={};if(h)for(let[I,w]of Object.entries(h))A[`$feature/${I}`]=w;let y=Object.keys(h||{}).filter(I=>h?.[I]!==!1).sort();return y.length>0&&(A.$active_feature_flags=y),A}).catch(()=>({})).then(h=>({...h,...f.properties||{},$groups:f.groups||o}));return f.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof m.$raw_user_agent=="string"&&UMc(m.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(f.event="$bot_pageview",m.$browser_type="bot"),{distinctId:f.distinctId,event:f.event,properties:m,options:{timestamp:f.timestamp,disableGeoip:f.disableGeoip,uuid:f.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){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)}}return i}};var L6c=require("async_hooks"),Iqr=class{constructor(){this.storage=new L6c.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 z6c="posthog-node";function O5d(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[a1o.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(m=>({...m,stacktrace:m.stacktrace?{...m.stacktrace,type:"raw",frames:(m.stacktrace.frames||[]).map(h=>({...h,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};return 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 a1o=class{static#e=this.POSTHOG_ID_TAG="posthog_distinct_id";constructor(t,r,n,i,o){this.name=z6c,this.name=z6c,this.setupOnce=function(s,a){let c=a()?.getClient()?.getDsn()?.projectId;s(O5d(t,{organization:r,projectId:c,prefix:n,severityAllowList:i,sendExceptionsToPostHog:o??!0}))}}};gH.errorPropertiesBuilder=new pM.ErrorPropertiesBuilder([new pM.EventCoercer,new pM.ErrorCoercer,new pM.ObjectCoercer,new pM.StringCoercer,new pM.PrimitiveCoercer],pM.createStackParser("node:javascript",pM.nodeStackLineParser),[jMc(),x6c]);var yCe=class extends vqr{getLibraryId(){return"posthog-node"}initializeContext(){return new Iqr}};var Cqr=class{posthog;constructor({posthogApiKey:t}){this.posthog=new yCe(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"5.44.4",usingAccessToken:!0,...tce()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:t.properties})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}};var dVt=class{async sendEvent(){}async sendAutomationEvent(){}async identify(){}async flush(){}};tr();var $ot=require("fs/promises"),U6c=require("os"),_6c=require("path");var P5d="id",D5d=".fern",mVt=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new yCe(r),this.userId=t==null?void 0:PEo(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.44.4",...t,...t.properties,usingAccessToken:!1,...r!=null?{userEmail:r}:{},...tce()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:t.properties})}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 Hf({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=lR(),r=Ze(Ht.of((0,U6c.homedir)()),Fe.of(D5d),Fe.of(P5d));try{await sr(r)?this.persistedDistinctId=(await(0,$ot.readFile)(r)).toString():(await(0,$ot.mkdir)((0,_6c.dirname)(r),{recursive:!0}),await(0,$ot.writeFile)(r,t),this.persistedDistinctId=t)}catch{this.persistedDistinctId=t}}return this.persistedDistinctId}};var c1o;async function hVt(){return c1o==null&&(c1o=await R5d()),c1o}async function R5d(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new dVt;let r=await Ait();return r!=null?new mVt({token:r,posthogApiKey:e}):await BV()!=null?new Cqr({posthogApiKey:e}):new mVt({token:void 0,posthogApiKey:e})}catch{return new dVt}}jt();_t();var gVt=we(require("process"),1);b9e();var G6c=we(Edo(),1),W6c=we(q6c(),1);function lT(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=XG(e),e.length===0))return 0;e=e.replace((0,W6c.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(G6c.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function wqr(e){let t=0;for(let r of e.split(`
|
|
3225
|
+
`);for(let s=n;s<o.length;s++){let a=o[s];if(a.length>1024)continue;let c=h6c.test(a)?a.replace(h6c,"$1"):a;if(!c.match(/\S*Error: /)){for(let u of t){let l=u(c,e);if(l){i.push(l);break}}if(i.length>=g6c)break}}return A6c(i)}}var XSo=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){let n=cVt(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 Cze(t,"DOMException")}isDOMError(t){return Cze(t,"DOMError")}};var ZSo=class{match(t){return zSo(t)}coerce(t,r){return{type:this.getType(t),value:this.getMessage(t,r),stack:this.getStack(t),cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}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){return t.stacktrace||t.stack||void 0}};var $So=class{constructor(){}match(t){return GMc(t)&&t.error!=null}coerce(t,r){let n=r.apply(t.error);return n||{type:"ErrorEvent",value:t.message,stack:r.syntheticException?.stack,synthetic:!0}}};var n5d=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,e1o=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(n5d);return i&&(r=i[1],n=i[2]),[r,n]}};var b6c=["fatal","error","warning","log","info","debug"];function Aqr(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 t1o=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:r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return Kot(t)?t.constructor.name:"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=Aqr(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${n}`}isSeverityLevel(t){return cVt(t)&&!VMc(t)&&b6c.indexOf(t)>=0}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];if(o6c(n))return n}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var r1o=class{match(t){return Kot(t)}coerce(t,r){let n=t.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${Aqr(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var n1o=class{match(t){return oqr(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var i1o=class{match(t){return Cze(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Kot(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 oqr(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 o1o=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 I6c=require("fs"),C6c=require("readline"),yqr=new pM.ReduceableCache(25),w6c=new pM.ReduceableCache(20),s1o=7,i5d=1e3,o5d=1e4;async function x6c(e){let t={};for(let i=e.length-1;i>=0;i--){let o=e[i],s=o?.filename;if(!o||typeof s!="string"||typeof o.lineno!="number"||u5d(s)||l5d(o))continue;t[s]||(t[s]=[]),t[s].push(o.lineno)}let r=Object.keys(t);if(r.length==0)return e;let n=[];for(let i of r){if(w6c.get(i))continue;let o=t[i];if(!o)continue;o.sort((c,u)=>c-u);let s=f5d(o);if(s.every(c=>p5d(i,c)))continue;let a=d5d(yqr,i,{});n.push(s5d(i,s,a))}return await Promise.all(n).catch(()=>{}),e&&e.length>0&&a5d(e,yqr),yqr.reduce(),e}function s5d(e,t,r){return new Promise(n=>{let i=(0,I6c.createReadStream)(e),o=(0,C6c.createInterface)({input:i});function s(){i.destroy(),n()}let a=0,c=0,u=t[c];if(u===void 0)return void s();let l=u[0],p=u[1];function d(){w6c.set(e,1),o.close(),o.removeAllListeners(),s()}i.on("error",d),o.on("error",d),o.on("close",s),o.on("line",f=>{if(a++,!(a<l)&&(r[a]=m5d(f,0),a>=p)){if(c===t.length-1){o.close(),o.removeAllListeners();return}c++;let m=t[c];if(m===void 0){o.close(),o.removeAllListeners();return}l=m[0],p=m[1]}})})}function a5d(e,t){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let n=t.get(r.filename);if(n===void 0)continue;c5d(r.lineno,r,n)}}function c5d(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=S6c(e);i<e;i++){let o=r[i];if(o===void 0)return void E6c(t);t.pre_context.push(o)}if(r[e]===void 0)return void E6c(t);t.context_line=r[e];let n=T6c(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 E6c(e){delete e.pre_context,delete e.context_line,delete e.post_context}function u5d(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function l5d(e){return e.lineno!==void 0&&e.lineno>o5d||e.colno!==void 0&&e.colno>i5d}function p5d(e,t){let r=yqr.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 f5d(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=v6c(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+s1o:(i.push(n),n=v6c(o)),t++}return i}function v6c(e){return[S6c(e),T6c(e)]}function S6c(e){return Math.max(1,e-s1o)}function T6c(e){return e+s1o}function d5d(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function m5d(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}function h5d(e,t){let r=!1;return Object.assign(n=>{let o=global.process.listeners("uncaughtException").filter(s=>s.name!=="domainUncaughtExceptionClear"&&s._posthogErrorHandler!==!0).length===0;e(n,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&o&&(r=!0,t(n))},{_posthogErrorHandler:!0})}function B6c(e,t){globalThis.process?.on("uncaughtException",h5d(e,t))}function O6c(e){globalThis.process?.on("unhandledRejection",t=>e(t,{mechanism:{type:"onunhandledrejection",handled:!1}}))}var g5d=2e3,gH=class e{constructor(t,r,n){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=n,this._rateLimiter=new sqr({refillRate:1,bucketSize:10,refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(t){return LSo(t)&&"__posthog_previously_captured_error"in t&&t.__posthog_previously_captured_error===!0}static async buildEventMessage(t,r,n,i){let o={...i},s=this.errorPropertiesBuilder.buildFromUnknown(t,r);return s.$exception_list=await this.errorPropertiesBuilder.modifyFrames(s.$exception_list),{event:"$exception",distinctId:n,properties:{...s,...o},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){this.isEnabled()&&(B6c(this.onException.bind(this),this.onFatalError.bind(this)),O6c(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{if(!e.isPreviouslyCapturedError(t)){let n=await e.buildEventMessage(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.capture(n)}})())}async onFatalError(t){console.error(t),await this.client.shutdown(g5d),process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}};var P6c="5.29.1";var fVt={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};async function D6c(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(i=>i.toString(16).padStart(2,"0")).join("")}var A5d=6e4,y5d=1152921504606847e3,b5d=["is_not"],Zot=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},Gd=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},yee=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},bqr=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.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.cacheProvider=a.cacheProvider,this.strictLocalEvaluation=a.strictLocalEvaluation??!1,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}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 yee||u instanceof Gd?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={...t,evaluationCache:t.evaluationCache??{}};return await Promise.all(s.map(async c=>{try{let{value:u,payload:l}=await this.computeFlagAndPayloadLocally(c,a);n[c.key]=u,l&&(i[c.key]=l)}catch(u){u instanceof yee||u instanceof Gd?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(o||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};let s;s=i!==void 0?i:await this.computeFlagValueLocally(t,r);let a=this.getFeatureFlagPayload(t.key,s);return{value:s,payload:a}}async computeFlagValueLocally(t,r){let{distinctId:n,groups:i,personProperties:o,groupProperties:s}=r;if(t.ensure_experience_continuity)throw new Gd("Flag has experience continuity enabled");if(!t.active)return!1;let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let u=this.groupTypeMapping[String(c)];if(!u)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Gd("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 Gd(`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}getFeatureFlagPayload(t,r){let n=null;if(r!==!1&&r!=null&&(typeof r=="boolean"?n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]||null:typeof r=="string"&&(n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]||null),n!=null)){if(typeof n=="object")return n;if(typeof n=="string")try{return JSON.parse(n)}catch{}return n}return null}async evaluateFlagDependency(t,r,n){let{evaluationCache:i}=n,o=t.key;if(!this.featureFlagsByKey)throw new Gd("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new Gd(`Flag dependency property for '${o}' is missing required 'dependency_chain' field`);let s=t.dependency_chain;if(!Array.isArray(s))throw new Gd(`Flag dependency property for '${o}' has an invalid 'dependency_chain' (expected array, got ${typeof s})`);if(s.length===0)throw new Gd(`Circular dependency detected for flag '${o}' (empty dependency chain)`);for(let c of s){if(!(c in i)){let l=this.featureFlagsByKey[c];if(l)if(l.active)try{let p=await this.computeFlagValueLocally(l,n);i[c]=p}catch(p){throw new Gd(`Error evaluating flag dependency '${c}' for flag '${o}': ${p}`)}else i[c]=!1;else throw new Gd(`Missing flag dependency '${c}' for flag '${o}'`)}if(i[c]==null)throw new Gd(`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){let o=t.filters||{},s=o.groups||[],a=!1,c;for(let u of s)try{if(await this.isConditionMatch(t,r,u,n,i)){let l=u.variant,p=o.multivariate?.variants||[];c=l&&p.some(d=>d.key===l)?l:await this.getMatchingVariant(t,r)||!0;break}}catch(l){if(l instanceof yee)throw l;if(l instanceof Gd)a=!0;else throw l}if(c!==void 0)return c;if(a)throw new Gd("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i,o){let s=n.rollout_percentage,a=c=>{this.logMsgIfDebug(()=>console.warn(c))};if((n.properties||[]).length>0){for(let c of n.properties){let u=c.type,l=!1;if(l=u==="cohort"?j6c(c,i,this.cohorts,this.debugMode):u==="flag"?await this.evaluateFlagDependency(c,i,o):N6c(c,i,a),!l)return!1}if(s==null)return!0}return!(s!=null&&await R6c(t.key,r)>s/100)}async getMatchingVariant(t,r){let n=await R6c(t.key,r,"variant"),i=this.variantLookupTable(t).find(o=>n>=o.valueMin&&n<o.valueMax);if(i)return i.key}variantLookupTable(t){let r=[],n=0,i=0;return((t.filters||{}).multivariate?.variants||[]).forEach(a=>{i=n+a.rollout_percentage/100,r.push({valueMin:n,valueMax:i,key:a.key}),n=i}),r}updateFlagState(t){this.featureFlags=t.flags,this.featureFlagsByKey=t.flags.reduce((r,n)=>(r[n.key]=n,r),{}),this.groupTypeMapping=t.groupTypeMapping,this.cohorts=t.cohorts,this.loadedSuccessfullyOnce=!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(r.flags),!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(){return this.shouldBeginExponentialBackoff?Math.min(A5d,this.pollingInterval*2**this.backOffCount):this.pollingInterval}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),this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval());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 Zot(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.beginBackoff(),new Zot(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new Zot(`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={flags:n.flags??[],groupTypeMapping:n.group_type_mapping||{},cohorts:n.cohorts||{}};if(this.updateFlagState(i),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(i)}catch(o){this.onError?.(new Error(`Failed to store in cache: ${o}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(i.flags);break}default:return}}catch(t){t instanceof Zot&&this.onError?.(t)}}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}}_requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),n=null;if(this.timeout&&typeof this.timeout=="number"){let i=new AbortController;n=Nfe(()=>{i.abort()},this.timeout),r.signal=i.signal}try{let i=this.fetch;return i(t,r)}finally{clearTimeout(n)}}async stopPoller(t=3e4){if(clearTimeout(this.poller),this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await Promise.race([r,new Promise((n,i)=>setTimeout(()=>i(new Error(`Cache shutdown timeout after ${t}ms`)),t))])}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};async function R6c(e,t,r=""){let n=await D6c(`${e}.${t}${r}`);return parseInt(n.slice(0,15),16)/y5d}function N6c(e,t,r){let n=e.key,i=e.value,o=e.operator||"exact";if(n in t){if(o==="is_not_set")throw new Gd("Operator is_not_set is not supported")}else throw new Gd(`Property ${n} not found in propertyValues`);let s=t[n];if(s==null&&!b5d.includes(o))return r&&r(`Property ${n} cannot have a value of null/undefined with the ${o} operator`),!1;function a(u,l){return Array.isArray(u)?u.map(p=>String(p).toLowerCase()).includes(String(l).toLowerCase()):String(u).toLowerCase()===String(l).toLowerCase()}function c(u,l,p){if(p==="gt")return u>l;if(p==="gte")return u>=l;if(p==="lt")return u<l;if(p==="lte")return u<=l;throw new Error(`Invalid operator: ${p}`)}switch(o){case"exact":return a(i,s);case"is_not":return!a(i,s);case"is_set":return n in t;case"icontains":return String(s).toLowerCase().includes(String(i).toLowerCase());case"not_icontains":return!String(s).toLowerCase().includes(String(i).toLowerCase());case"regex":return F6c(String(i))&&String(s).match(String(i))!==null;case"not_regex":return F6c(String(i))&&String(s).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let u=typeof i=="number"?i:null;if(typeof i=="string")try{u=parseFloat(i)}catch{}return u==null||s==null?c(String(s),String(i),o):typeof s=="string"?c(s,String(i),o):c(s,u,o)}case"is_date_after":case"is_date_before":{if(typeof i=="boolean")throw new Gd("Date operations cannot be performed on boolean values");let u=w5d(String(i));if(u==null&&(u=k6c(i)),u==null)throw new Gd(`Invalid date: ${i}`);let l=k6c(s);return["is_date_before"].includes(o)?l<u:l>u}case"semver_eq":return qV(YO(String(s)),YO(String(i)))===0;case"semver_neq":return qV(YO(String(s)),YO(String(i)))!==0;case"semver_gt":return qV(YO(String(s)),YO(String(i)))>0;case"semver_gte":return qV(YO(String(s)),YO(String(i)))>=0;case"semver_lt":return qV(YO(String(s)),YO(String(i)))<0;case"semver_lte":return qV(YO(String(s)),YO(String(i)))<=0;case"semver_tilde":{let u=YO(String(s)),{lower:l,upper:p}=v5d(String(i));return qV(u,l)>=0&&qV(u,p)<0}case"semver_caret":{let u=YO(String(s)),{lower:l,upper:p}=I5d(String(i));return qV(u,l)>=0&&qV(u,p)<0}case"semver_wildcard":{let u=YO(String(s)),{lower:l,upper:p}=C5d(String(i));return qV(u,l)>=0&&qV(u,p)<0}default:throw new Gd(`Unknown operator: ${o}`)}}function E5d(e,t){if(!(e in t))throw new yee(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}function j6c(e,t,r,n=!1){let i=String(e.value);E5d(i,r);let o=r[i];return Q6c(o,t,r,n)}function Q6c(e,t,r,n=!1){if(!e)return!0;let i=e.type,o=e.values;if(!o||o.length===0)return!0;let s=!1;if("values"in o[0]){for(let a of o)try{let c=Q6c(a,t,r,n);if(i==="AND"){if(!c)return!1}else if(c)return!0}catch(c){if(c instanceof yee)throw c;if(c instanceof Gd)n&&console.debug(`Failed to compute property ${a} locally: ${c}`),s=!0;else throw c}if(s)throw new Gd("Can't match cohort without a given cohort property value");return i==="AND"}for(let a of o)try{let c;if(a.type==="cohort")c=j6c(a,t,r,n);else if(a.type==="flag"){n&&console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${a.key||"unknown"}'`);continue}else c=N6c(a,t);let u=a.negation||!1;if(i==="AND"){if(!c&&!u||c&&u)return!1}else if(c&&!u||!c&&u)return!0}catch(c){if(c instanceof yee)throw c;if(c instanceof Gd)n&&console.debug(`Failed to compute property ${a} locally: ${c}`),s=!0;else throw c}if(s)throw new Gd("can't match cohort without a given cohort property value");return i==="AND"}function F6c(e){try{return new RegExp(e),!0}catch{return!1}}function YO(e){let r=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!r||r.startsWith("."))throw new Gd(`Invalid semver: ${e}`);let n=r.split("."),i=c=>{if(c===void 0||c==="")return 0;if(!/^\d+$/.test(c))throw new Gd(`Invalid semver: ${e}`);return parseInt(c,10)},o=i(n[0]),s=i(n[1]),a=i(n[2]);return[o,s,a]}function qV(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 v5d(e){let t=YO(e),r=[t[0],t[1],t[2]],n=[t[0],t[1]+1,0];return{lower:r,upper:n}}function I5d(e){let t=YO(e),[r,n,i]=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 C5d(e){let r=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!r)throw new Gd(`Invalid wildcard semver: ${e}`);let n=r.split("."),i=parseInt(n[0],10);if(isNaN(i))throw new Gd(`Invalid wildcard semver: ${e}`);let o,s;if(n.length===1)o=[i,0,0],s=[i+1,0,0];else{let a=parseInt(n[1],10);if(isNaN(a))throw new Gd(`Invalid wildcard semver: ${e}`);o=[i,a,0],s=[i,a+1,0]}return{lower:o,upper:s}}function k6c(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 Gd(`${e} is in an invalid date format`)}throw new Gd(`The date provided ${e} must be a string, number, or date object`)}function w5d(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(!r)return null;{if(!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}}var Eqr=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};var x5d=100,M6c=3e4,S5d=5e4,T5d=50,B5d=500,vqr=class extends pVt{constructor(t,r={}){if(super(t,r),this._memoryStorage=new Eqr,this.options=r,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,x5d):M6c,typeof r.waitUntilDebounceMs=="number"&&(this.options.waitUntilDebounceMs=Math.max(r.waitUntilDebounceMs,0)),typeof r.waitUntilMaxWaitMs=="number"&&(this.options.waitUntilMaxWaitMs=Math.max(r.waitUntilMaxWaitMs,0)),r.personalApiKey){if(r.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');r.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new bqr({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:i=>{this._events.emit("error",i)},onLoad:i=>{this._events.emit("localEvaluationFlagsLoaded",i)},customHeaders:this.getCustomHeaders(),cacheProvider:r.flagDefinitionCacheProvider,strictLocalEvaluation:r.strictLocalEvaluation}))}this.errorTracking=new gH(this,r,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||S5d}enqueue(t,r,n){super.enqueue(t,r,n),this.scheduleDebouncedFlush()}async flush(){let t=super.flush(),r=this.options.waitUntil;if(r&&!this._waitUntilCycle)try{r(t.catch(()=>{}))}catch{}return t}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??B5d,i=r>=n;if(this._waitUntilCycle.timer!==void 0&&clearTimeout(this._waitUntilCycle.timer),i)return void this.resolveWaitUntilFlush();let o=this.options.waitUntilDebounceMs??T5d;this._waitUntilCycle.timer=Nfe(()=>{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 super.flush()}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)}getLibraryVersion(){return P6c}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}capture(t){typeof t=="string"&&this._logger.warn("Called capture() with a string as the first argument when an object was expected."),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:n,properties:i,options:o})=>super.captureStateless(r,n,i,{timestamp:o.timestamp,disableGeoip:o.disableGeoip,uuid:o.uuid})).catch(r=>{r&&console.error(r)}))}async captureImmediate(t){return typeof t=="string"&&this._logger.warn("Called captureImmediate() with a string as the first argument when an object was expected."),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn("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.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:n,properties:i,options:o})=>super.captureStatelessImmediate(r,n,i,{timestamp:o.timestamp,disableGeoip:o.disableGeoip,uuid:o.uuid})).catch(r=>{r&&console.error(r)}))}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};super.identifyStateless(t,l,{disableGeoip:n})}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};super.identifyStatelessImmediate(t,l,{disableGeoip:n})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async aliasImmediate(t){await super.aliasStatelessImmediate(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(t=M6c){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){let o=n.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&t in this._flagOverrides){let T=this._flagOverrides[t];if(T===void 0)return;let O=this._payloadOverrides?.[t];return{key:t,enabled:T!==!1,variant:typeof T=="string"?T:void 0,payload:O}}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,u,l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f,m=!1,h,A,y,I,w,C;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let T=this.featureFlagsPoller?.featureFlagsByKey[t];if(T)try{let O=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(T,d,{matchValue:i});if(O){m=!0;let R=O.value;I=T.id,C="Evaluated locally",f={key:t,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:O.payload??void 0}}}catch(O){if(O instanceof yee||O instanceof Gd)this._logger?.info(`${O.name} when computing flag locally: ${t}: ${O.message}`);else throw O}}if(!m&&!c){let T=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,d.personProperties,d.groupProperties,a,[t]);if(T===void 0)y=fVt.UNKNOWN_ERROR;else{h=T.requestId,A=T.evaluatedAt;let O=[];T.errorsWhileComputingFlags&&O.push(fVt.ERRORS_WHILE_COMPUTING),T.quotaLimited?.includes("feature_flags")&&O.push(fVt.QUOTA_LIMITED);let R=T.flags[t];if(R===void 0)O.push(fVt.FLAG_MISSING);else{I=R.metadata?.id,w=R.metadata?.version,C=R.reason?.description??R.reason?.code;let P;if(R.metadata?.payload!==void 0)try{P=JSON.parse(R.metadata.payload)}catch{P=R.metadata.payload}f={key:t,enabled:R.enabled,variant:R.variant,payload:P}}O.length>0&&(y=O.join(","))}}if(o){let T=f===void 0?void 0:f.enabled===!1?!1:f.variant??!0,O=`${t}_${T}`;if(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(O)){Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(O):this.distinctIdHasSentFlagCalls[r]=[O];let R={$feature_flag:t,$feature_flag_response:T,$feature_flag_id:I,$feature_flag_version:w,$feature_flag_reason:C,locally_evaluated:m,[`$feature/${t}`]:T,$feature_flag_request_id:h,$feature_flag_evaluated_at:m?Date.now():A};if(m&&this.featureFlagsPoller){let P=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();P!==void 0&&(R.$feature_flag_definitions_loaded_at=P)}y&&(R.$feature_flag_error=y),this.capture({distinctId:r,event:"$feature_flag_called",properties:R,groups:s,disableGeoip:a})}}return f!==void 0&&this._payloadOverrides!==void 0&&t in this._payloadOverrides&&(f={...f,payload:this._payloadOverrides[t]}),f}async getFeatureFlag(t,r,n){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(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.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){let i=await this.getFeatureFlag(t,r,n);if(i!==void 0)return!!i||!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:{}};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,u,l);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),m={},h={},A=!0;if(f&&(m=f.response,h=f.payloads,A=f.fallbackToFlags),A&&!c){let y=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,d.personProperties,d.groupProperties,s,a);m={...m,...y.flags||{}},h={...h,...y.payloads||{}}}return this._flagOverrides!==void 0&&(m={...m,...this._flagOverrides}),this._payloadOverrides!==void 0&&(h={...h,...this._payloadOverrides}),{featureFlags:m,featureFlagPayloads:h}}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){super.groupIdentifyStateless(t,r,n,{disableGeoip:o},i)}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=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown();try{return await super._shutdown(t)}finally{r?.()}}async _requestRemoteConfigPayload(t){if(!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=Nfe(()=>{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(WMc(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){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={distinct_id:t,...n||{}},s={};if(r)for(let a of Object.keys(r))s[a]={$group_key:r[a],...i?.[a]||{}};return{allPersonProperties:o,allGroupProperties:s}}createFeatureFlagEvaluationContext(t,r,n,i){return{distinctId:t,groups:r||{},personProperties:n||{},groupProperties:i||{},evaluationCache:{}}}captureException(t,r,n,i){if(!gH.isPreviouslyCapturedError(t)){let o=new Error("PostHog syntheticException");this.addPendingPromise(gH.buildEventMessage(t,{syntheticException:o},r,n).then(s=>this.capture({...s,uuid:i})))}}async captureExceptionImmediate(t,r,n){if(!gH.isPreviouslyCapturedError(t)){let i=new Error("PostHog syntheticException");return this.addPendingPromise(gH.buildEventMessage(t,{syntheticException:i},r,n).then(o=>this.captureImmediate(o)))}}async prepareEventMessage(t){let{distinctId:r,event:n,properties:i,groups:o,sendFeatureFlags:s,timestamp:a,disableGeoip:c,uuid:u}=t,l=this.context?.get(),p=r||l?.distinctId,d={...this.props,...l?.properties||{},...i||{}};p||(p=ACe(),d.$process_person_profile=!1),l?.sessionId&&!d.$session_id&&(d.$session_id=l.sessionId);let f=this._runBeforeSend({distinctId:p,event:n,properties:d,groups:o,sendFeatureFlags:s,timestamp:a,disableGeoip:c,uuid:u});if(!f)return Promise.reject(null);let m=await Promise.resolve().then(async()=>{if(s){let h=typeof s=="object"?s:void 0;return await this.getFeatureFlagsForEvent(f.distinctId,o,c,h)}return f.event,{}}).then(h=>{let A={};if(h)for(let[I,w]of Object.entries(h))A[`$feature/${I}`]=w;let y=Object.keys(h||{}).filter(I=>h?.[I]!==!1).sort();return y.length>0&&(A.$active_feature_flags=y),A}).catch(()=>({})).then(h=>({...h,...f.properties||{},$groups:f.groups||o}));return f.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof m.$raw_user_agent=="string"&&UMc(m.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(f.event="$bot_pageview",m.$browser_type="bot"),{distinctId:f.distinctId,event:f.event,properties:m,options:{timestamp:f.timestamp,disableGeoip:f.disableGeoip,uuid:f.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){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)}}return i}};var L6c=require("async_hooks"),Iqr=class{constructor(){this.storage=new L6c.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 z6c="posthog-node";function O5d(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[a1o.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(m=>({...m,stacktrace:m.stacktrace?{...m.stacktrace,type:"raw",frames:(m.stacktrace.frames||[]).map(h=>({...h,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};return 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 a1o=class{static#e=this.POSTHOG_ID_TAG="posthog_distinct_id";constructor(t,r,n,i,o){this.name=z6c,this.name=z6c,this.setupOnce=function(s,a){let c=a()?.getClient()?.getDsn()?.projectId;s(O5d(t,{organization:r,projectId:c,prefix:n,severityAllowList:i,sendExceptionsToPostHog:o??!0}))}}};gH.errorPropertiesBuilder=new pM.ErrorPropertiesBuilder([new pM.EventCoercer,new pM.ErrorCoercer,new pM.ObjectCoercer,new pM.StringCoercer,new pM.PrimitiveCoercer],pM.createStackParser("node:javascript",pM.nodeStackLineParser),[jMc(),x6c]);var yCe=class extends vqr{getLibraryId(){return"posthog-node"}initializeContext(){return new Iqr}};var Cqr=class{posthog;constructor({posthogApiKey:t}){this.posthog=new yCe(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"5.44.6",usingAccessToken:!0,...tce()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:t.properties})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}};var dVt=class{async sendEvent(){}async sendAutomationEvent(){}async identify(){}async flush(){}};tr();var $ot=require("fs/promises"),U6c=require("os"),_6c=require("path");var P5d="id",D5d=".fern",mVt=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new yCe(r),this.userId=t==null?void 0:PEo(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.44.6",...t,...t.properties,usingAccessToken:!1,...r!=null?{userEmail:r}:{},...tce()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:t.properties})}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 Hf({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=lR(),r=Ze(Ht.of((0,U6c.homedir)()),Fe.of(D5d),Fe.of(P5d));try{await sr(r)?this.persistedDistinctId=(await(0,$ot.readFile)(r)).toString():(await(0,$ot.mkdir)((0,_6c.dirname)(r),{recursive:!0}),await(0,$ot.writeFile)(r,t),this.persistedDistinctId=t)}catch{this.persistedDistinctId=t}}return this.persistedDistinctId}};var c1o;async function hVt(){return c1o==null&&(c1o=await R5d()),c1o}async function R5d(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new dVt;let r=await Ait();return r!=null?new mVt({token:r,posthogApiKey:e}):await BV()!=null?new Cqr({posthogApiKey:e}):new mVt({token:void 0,posthogApiKey:e})}catch{return new dVt}}jt();_t();var gVt=we(require("process"),1);b9e();var G6c=we(Edo(),1),W6c=we(q6c(),1);function lT(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=XG(e),e.length===0))return 0;e=e.replace((0,W6c.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(G6c.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function wqr(e){let t=0;for(let r of e.split(`
|
|
3226
3226
|
`))t=Math.max(t,lT(r));return t}var fLc=we(l1o(),1);var k5d=/[\p{Lu}]/u,N5d=/[\p{Ll}]/u,J6c=/^[\p{Lu}](?![\p{Lu}])/gu,Z6c=/([\p{Alpha}\p{N}_]|$)/u,p1o=/[_.\- ]+/,j5d=new RegExp("^"+p1o.source),Y6c=new RegExp(p1o.source+Z6c.source,"gu"),X6c=new RegExp("\\d+"+Z6c.source,"gu"),Q5d=(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&&k5d.test(u)?(e=e.slice(0,c)+"-"+e.slice(c),i=!1,s=o,o=!0,c++):o&&s&&N5d.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},M5d=(e,t)=>(J6c.lastIndex=0,e.replace(J6c,r=>t(r))),L5d=(e,t)=>(Y6c.lastIndex=0,X6c.lastIndex=0,e.replace(Y6c,(r,n)=>t(n)).replace(X6c,r=>t(r)));function f1o(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?p1o.test(e)?"":t.pascalCase?n(e):r(e):(e!==r(e)&&(e=Q5d(e,r,n,t.preserveConsecutiveUppercase)),e=e.replace(j5d,""),e=t.preserveConsecutiveUppercase?M5d(e,r):r(e),t.pascalCase&&(e=n(e.charAt(0))+e.slice(1)),L5d(e,n))}var g1o=we(eLc(),1);b9e();var tLc=(e=0)=>t=>`\x1B[${t+e}m`,rLc=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,nLc=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,oE={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]}},uoE=Object.keys(oE.modifier),V5d=Object.keys(oE.color),q5d=Object.keys(oE.bgColor),loE=[...V5d,...q5d];function G5d(){let e=new Map;for(let[t,r]of Object.entries(oE)){for(let[n,i]of Object.entries(r))oE[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=oE[n],e.set(i[0],i[1]);Object.defineProperty(oE,t,{value:r,enumerable:!1})}return Object.defineProperty(oE,"codes",{value:e,enumerable:!1}),oE.color.close="\x1B[39m",oE.bgColor.close="\x1B[49m",oE.color.ansi=tLc(),oE.color.ansi256=rLc(),oE.color.ansi16m=nLc(),oE.bgColor.ansi=tLc(10),oE.bgColor.ansi256=rLc(10),oE.bgColor.ansi16m=nLc(10),Object.defineProperties(oE,{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=>oE.rgbToAnsi256(...oE.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)=>oE.ansi256ToAnsi(oE.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>oE.ansi256ToAnsi(oE.hexToAnsi256(t)),enumerable:!1}}),oE}var W5d=G5d(),iLc=W5d;var xqr=new Set(["\x1B","\x9B"]),H5d=39,m1o="\x07",aLc="[",K5d="]",cLc="m",h1o=`${K5d}8;;`,oLc=e=>`${xqr.values().next().value}${aLc}${e}${cLc}`,sLc=e=>`${xqr.values().next().value}${h1o}${e}${m1o}`,J5d=e=>e.split(" ").map(t=>lT(t)),d1o=(e,t,r)=>{let n=[...t],i=!1,o=!1,s=lT(XG(e[e.length-1]));for(let[a,c]of n.entries()){let u=lT(c);if(s+u<=r?e[e.length-1]+=c:(e.push(c),s=0),xqr.has(c)&&(i=!0,o=n.slice(a+1).join("").startsWith(h1o)),i){o?c===m1o&&(i=!1,o=!1):c===cLc&&(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())},Y5d=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(lT(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},X5d=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,o,s=J5d(e),a=[""];for(let[u,l]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=lT(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(""),d1o(a,l,t);continue}if(p+s[u]>t&&p>0&&s[u]>0){if(r.wordWrap===!1&&p<t){d1o(a,l,t);continue}a.push("")}if(p+s[u]>t&&r.wordWrap===!1){d1o(a,l,t);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(u=>Y5d(u)));let c=[...a.join(`
|
|
3227
3227
|
`)];for(let[u,l]of c.entries()){if(n+=l,xqr.has(l)){let{groups:d}=new RegExp(`(?:\\${aLc}(?<code>\\d+)m|\\${h1o}(?<uri>.*)${m1o})`).exec(c.slice(u).join(""))||{groups:{}};if(d.code!==void 0){let f=Number.parseFloat(d.code);i=f===H5d?void 0:f}else d.uri!==void 0&&(o=d.uri.length===0?void 0:d.uri)}let p=iLc.codes.get(Number(i));c[u+1]===`
|
|
3228
3228
|
`?(o&&(n+=sLc("")),i&&p&&(n+=oLc(p))):l===`
|
|
@@ -3622,7 +3622,7 @@ ${this.indentBlock(this.suggestion)}`}indentBlock(t,r=" "){return t.split(`
|
|
|
3622
3622
|
`&&(r++,n=i);return new GV({absoluteFilePath:this.absoluteFilePath,relativeFilePath:this.relativeFilePath,line:r,column:t-n})}};var kGr="$ref",NGr=class{cwd;constructor({cwd:t}){this.cwd=t}async resolve({document:t}){let r=t.absoluteFilePath,n={cwd:this.cwd,document:t,originalFile:r,currentFile:r,resolutionStack:new Set([r]),referencedDocuments:{},issues:[],pathMappings:[],yamlPathIndex:0,refFromLocation:void 0},i=await this.resolveValue({context:n,yamlPath:[],value:t.toJS()});return n.issues.length>0?{success:!1,issues:n.issues}:{success:!0,data:i,pathMappings:n.pathMappings}}getSourceLocationWithMappings({document:t,pathMappings:r,yamlPath:n}){let i;for(let o of r)this.yamlPathStartsWith(n,o.yamlPath)&&(i==null||o.yamlPath.length>i.yamlPath.length)&&(i=o);if(i!=null){let o=n.slice(i.yamlPath.length);return i.document.getSourceLocation(o).withRefFrom(i.refFromLocation)}return t.getSourceLocation(n)}async resolveValue({context:t,yamlPath:r,value:n}){if(n==null)return n;if(Array.isArray(n))return Promise.all(n.map((i,o)=>this.resolveValue({context:t,yamlPath:[...r,o],value:i})));if(typeof n=="object"){let i=n;if(kGr in i){let s=[...r,kGr];return this.resolveRef({context:t,yamlPath:s,location:this.getSourceLocation({context:t,yamlPath:s}),obj:i,refValue:i[kGr]})}let o={};for(let s of Object.keys(i))o[s]=await this.resolveValue({context:t,yamlPath:[...r,s],value:i[s]});return o}return n}async resolveRef({context:t,yamlPath:r,location:n,obj:i,refValue:o}){if(typeof o!="string")return t.issues.push(new yy({message:`$ref must be a string, got ${typeof o}`,location:n,yamlPath:r})),i;let s=Object.keys(i);if(s.length>1){let d=s.filter(f=>f!==kGr);return t.issues.push(new yy({message:`$ref cannot have sibling keys; found ${d.join(", ")}`,location:n,yamlPath:r})),i}if(o.includes("#"))return t.issues.push(new yy({message:`JSON pointer and in-document references are not supported: ${o}`,location:n,yamlPath:r})),i;let a=this.resolveFilePath({currentFile:t.currentFile,refValue:o});if(t.resolutionStack.has(a)){let d=[...t.resolutionStack,a].join(" -> ");return t.issues.push(new yy({message:`Circular $ref detected: ${d}`,location:n,yamlPath:r})),i}let c=await this.parseFile({context:t,referencedFilePath:a,yamlPath:r,location:n,refValue:o});if(c===void 0)return i;if(c===null)return t.issues.push(new yy({message:`$ref resolves to null: ${o}`,location:n,yamlPath:r})),i;let u=r.slice(0,-1),l=t.referencedDocuments[a];return l!=null&&t.pathMappings.push({yamlPath:u,document:l,refFromLocation:n}),await this.resolveReferencedFile({context:t,referencedFilePath:a,refFromLocation:n,yamlPath:u,value:c})}async resolveReferencedFile({context:t,referencedFilePath:r,refFromLocation:n,yamlPath:i,value:o}){let s=t.currentFile,a=t.yamlPathIndex,c=t.refFromLocation;t.currentFile=r,t.yamlPathIndex=i.length,t.refFromLocation=n,t.resolutionStack.add(r);try{return await this.resolveValue({context:t,yamlPath:i,value:o})}finally{t.resolutionStack.delete(r),t.currentFile=s,t.yamlPathIndex=a,t.refFromLocation=c}}async parseFile({context:t,referencedFilePath:r,yamlPath:n,location:i,refValue:o}){if(!await sr(r)){t.issues.push(new yy({message:`Referenced file does not exist: ${o}`,location:i,yamlPath:n}));return}let s=await(0,G4c.readFile)(r,"utf-8"),a=(0,W4c.parseDocument)(s);if(a.errors.length>0){let u=a.errors.map(l=>l.message).join("; ");t.issues.push(new yy({message:`Failed to parse referenced file ${o}: ${u}`,location:i,yamlPath:n}));return}let c=new Ast({absoluteFilePath:r,relativeFilePath:Fe.of(ds(t.cwd,r)),document:a,source:s});return t.referencedDocuments[r]=c,c.toJS()}getSourceLocation({context:t,yamlPath:r}){if(t.currentFile===t.originalFile)return t.document.getSourceLocation(r);let n=this.getSourceLocationFromCurrentFile({context:t,yamlPath:r});return t.refFromLocation!=null?n.withRefFrom(t.refFromLocation):n}yamlPathStartsWith(t,r){if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(t[n]!==r[n])return!1;return!0}getSourceLocationFromCurrentFile({context:t,yamlPath:r}){let n=t.referencedDocuments[t.currentFile];if(n!=null){let i=r.slice(t.yamlPathIndex);return n.getSourceLocation(i)}return this.createLocationForReferencedFile({context:t,absoluteFilePath:t.currentFile})}createLocationForReferencedFile({context:t,absoluteFilePath:r}){return new GV({absoluteFilePath:r,relativeFilePath:Fe.of(ds(t.cwd,r)),line:1,column:1})}resolveFilePath({currentFile:t,refValue:r}){let n=bn(t);return Ze(n,Fe.of(r))}};jt();tr();_t();function H4c(e){return vee(e,new WeakMap)}function aWd(e){return e._zod?.def}function vee(e,t){if(t.has(e))return t.get(e);let r=aWd(e);if(r==null)return e;switch(r.type){case"object":{let n=r.shape??{},i={};for(let[s,a]of Object.entries(n))i[s]=vee(a,t);let o=ue.object(i).strict();return t.set(e,o),o}case"array":{let n=r.element;return n!=null?ue.array(vee(n,t)):e}case"optional":{let n=r.innerType;return n!=null?vee(n,t).optional():e}case"nullable":{let n=r.innerType;return n!=null?vee(n,t).nullable():e}case"union":{let n=r.options;return n!=null?ue.union(n.map(i=>vee(i,t))):e}case"record":{let n=r.keyType,i=r.valueType;return n!=null&&i!=null?ue.record(n,vee(i,t)):e}case"lazy":{let n=r.getter;if(n==null)return e;let i=ue.lazy(()=>vee(n(),t));return t.set(e,i),i}case"tuple":{let n=r.items;return n==null?e:ue.tuple(n.map(i=>vee(i,t)))}case"default":{let n=r.innerType;return n!=null?vee(n,t).default(r.defaultValue):e}default:return e}}Ry();var wBo=require("fs/promises"),QGr=we(bC(),1);var jGr=class{async parse(t){let r=await(0,wBo.readFile)(t,"utf-8");return(0,QGr.parse)(r)}async parseDocument({absoluteFilePath:t,cwd:r}){let n=await(0,wBo.readFile)(t,"utf-8"),i=(0,QGr.parseDocument)(n),o=sa.of(bWe(r,t));return new Ast({absoluteFilePath:t,relativeFilePath:o,document:i,source:n})}};_t();var MGr=class{document;constructor(t){this.document=t}toSourced(t){return this.toSourcedInternal(t,[])}toSourcedInternal(t,r){let n=this.document.getSourceLocation(r);if(t===null)return new ICe(null,n);if(t===void 0)return new ICe(void 0,n);if(Array.isArray(t))return _1o({value:t,location:n,wrapChild:(i,o)=>this.toSourcedInternal(i,[...r,o])});if(t instanceof Object)return V1o({value:t,location:n,wrapChild:(i,o)=>this.toSourcedInternal(i,[...r,o])});switch(typeof t){case"string":return new RVt(t,n);case"number":return new FVt(t,n);case"boolean":return new kVt(t,n);default:throw new D({message:`Unexpected value type: ${typeof t}`,code:D.Code.InternalError})}}};var f5t=class{parser;cwd;referenceResolver;constructor({cwd:t}){this.parser=new jGr,this.cwd=t,this.referenceResolver=new NGr({cwd:t})}async load({absoluteFilePath:t,schema:r,resolveReferences:n=!0,strict:i=!1}){let o=await this.parseDocument(t),s=this.getYamlErrors(o);if(s.length>0)return{success:!1,issues:s};let a=await this.resolveReferences({document:o,resolveReferences:n});if(!a.success)return{success:!1,issues:a.issues};let u=(i?H4c(r):r).safeParse(a.data);if(!u.success)return{success:!1,issues:u.error.issues.map(d=>{let f=d.path.filter(m=>typeof m!="symbol");return new yy({yamlPath:f,message:this.formatZodIssue(d),location:this.referenceResolver.getSourceLocationWithMappings({document:o,pathMappings:a.pathMappings,yamlPath:f})})})};let l=new MGr(o);return{success:!0,data:u.data,sourced:l.toSourced(u.data),absoluteFilePath:t,relativeFilePath:Fe.of(ds(this.cwd,t)),pathMappings:a.pathMappings}}async parseDocument(t){try{return await this.parser.parseDocument({absoluteFilePath:t,cwd:this.cwd})}catch(r){throw new D({message:`Failed to parse YAML file ${t}: ${qn(r)}`,code:D.Code.ParseError})}}async resolveReferences({document:t,resolveReferences:r}){if(!r)return{success:!0,data:t.toJS(),pathMappings:[]};let n=await this.referenceResolver.resolve({document:t});return n.success?n:{success:!1,issues:n.issues}}getYamlErrors(t){return t.errors.length===0?[]:t.errors.map(r=>{let n=r.linePos?.[0]?.line??1,i=r.linePos?.[0]?.col??1;return new yy({message:r.message,location:new GV({absoluteFilePath:t.absoluteFilePath,relativeFilePath:t.relativeFilePath,line:n,column:i})})})}formatZodIssue(t){let r=t.path.join(".");switch(t.code){case"invalid_type":return t.message.endsWith("received undefined")?r.length>0?`${r} is required`:"value is required":r.length>0?`${r} must be a ${t.expected}`:`must be a ${t.expected}`;case"invalid_value":{if(t.values!=null){let n=t.values.join(", ");return r.length>0?`${r} must be one of: ${n}`:`must be one of: ${n}`}return t.message}case"unrecognized_keys":return`unknown key(s): ${t.keys.join(", ")}`;case"invalid_union":{let n=[];for(let o of t.errors)for(let s of o)s.code==="unrecognized_keys"&&n.push(...s.keys);if(n.length>0)return`unknown key(s): ${[...new Set(n)].join(", ")}`;let i=new Set;for(let o of t.errors)for(let s of o)s.code==="invalid_type"&&i.add(s.expected);if(i.size>0){let o=Array.from(i).join(" or ");return r.length>0?`${r} must be a ${o}`:`must be a ${o}`}return r.length>0?`${r} has an invalid value`:"invalid value"}case"invalid_format":return r.length>0?`${r} must be a valid ${t.format}`:`must be a valid ${t.format}`;default:return t.message}}};tr();_t();var LGr=class{from;constructor(t){this.from=t.from}async findOrThrow({filename:t,remediationMessage:r}){let n=await this.find({filename:t});if(n==null)throw new D({message:`${t} file not found in any parent directory from ${this.from}`,code:D.Code.InternalError});return n}async find({filename:t}){let r=await zd(t,{cwd:this.from,type:"file"});if(r==null)return;let n=Ht.of(r);if(await sr(n))return n}};var K4c="fern.yml",yst=class{finder;loader;constructor(t={}){let r=Ht.of(t.cwd??process.cwd());this.finder=new LGr({from:r}),this.loader=new f5t({cwd:r})}async loadOrThrow(){let t=await this.load();if(t.type==="notFound")throw new D({message:`${K4c} file not found in any parent directory; did you forget to run \`fern init\`?`,code:D.Code.InternalError});if(t.type==="failure")throw new tH(t.issues);return t}async load(){let t=await this.finder.find({filename:K4c});if(t==null)return{type:"notFound"};let r=await this.loader.load({absoluteFilePath:t,schema:q3e,strict:!0});return r.success?{type:"success",...r}:{type:"failure",issues:r.issues}}};tr();_t();var Lze=require("fs/promises"),J4c=we(HMr(),1),zGr=we(require("os"),1),Y4c=require("os"),X4c=require("path");var d5t=class e{posthog;sentry;baseTags;accumulatedTags={};distinctId;static async create({isTTY:t}){let r=await e.getDistinctId();return new e({isTTY:t,distinctId:r})}constructor({isTTY:t,distinctId:r}){this.distinctId=r;let n=this.isTelemetryEnabled(),i="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";this.baseTags={version:"*",arch:zGr.arch(),ci:J4c.default,os:zGr.platform(),tty:t,usingAccessToken:process.env.FERN_TOKEN!=null,...tce()},this.posthog=i!=null&&i.length>0&&n?new yCe(i):void 0;let o="https://84f58b5e457f06999d92f11ce4b79158@o4509504076185600.ingest.us.sentry.io/4511021546602496";if(o!=null&&o.length>0&&n){let s="production";if(s==null||s.length===0)throw new D({message:"SENTRY_ENVIRONMENT must be set when SENTRY_DSN is configured",code:D.Code.ConfigError});this.sentry=kPt({dsn:o,release:`cli@${"*"}`,environment:s,defaultIntegrations:!1,integrations:[tGe(),tAe(),rAe(),Lge(),eAe()],tracesSampleRate:0}),NPt()}}sendEvent(t,r){if(this.posthog!=null)try{this.posthog.capture({distinctId:this.distinctId,event:t,properties:{...this.baseTags,...this.accumulatedTags,...r}})}catch{}}sendLifecycleEvent(t){if(this.posthog!=null)try{this.posthog.capture({distinctId:this.distinctId,event:"cli",properties:{...this.baseTags,...this.accumulatedTags,...t}})}catch{}}tag(t){Object.assign(this.accumulatedTags,t)}captureException(t,r){if(this.sentry!==void 0)try{let n={...this.baseTags,...this.accumulatedTags,...r?.tags},i=r?.context;return NB(o=>{if(o.setTags(n),i!=null)for(let[s,a]of Object.entries(i))a!=null&&o.setContext(s,a);return this.sentry?.captureException(t,void 0,o)})}catch{return}}async flush(){let t=[];this.posthog!=null&&t.push(Promise.race([this.posthog.shutdown().catch(()=>{}),new Promise(r=>setTimeout(r,3e3))])),this.sentry!==void 0&&t.push(Promise.resolve(this.sentry.flush(2e3)).catch(()=>{})),await Promise.all(t)}static async getDistinctId(){let t=e.getDistinctIdFilepath(),r=null;try{await sr(t)||(await(0,Lze.mkdir)((0,X4c.dirname)(t),{recursive:!0}),await(0,Lze.writeFile)(t,lR(),{flag:"wx"}));let n=(await(0,Lze.readFile)(t)).toString().trim();if(r=n,!dbo(n)){let i=lR();await(0,Lze.writeFile)(t,i),r=i}}catch{r=lR()}return(r==null||r.length===0)&&(r=lR()),r}static getDistinctIdFilepath(){return Ze(Ht.of((0,Y4c.homedir)()),Fe.of(".fern"),Fe.of("id"))}isTelemetryEnabled(){let t=process.env.FERN_TELEMETRY_DISABLED;return t!=null&&t.length>0?!1:new rE().loadTelemetryEnabledSync()??!0}};var $4c=we(HMr(),1),xBo=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Z4c=100,UGr=class{isTTY;stdout;stderr;paintables=[];lastPaint="";frameIndex=0;interval;suspended=!1;suspendBuffer=[];finished=!1;constructor(t,r){this.stdout=t,this.stderr=r,this.isTTY=t.isTTY===!0&&!$4c.default;for(let n of[this.stdout,this.stderr])n.on("error",i=>{if(!cWd(i))throw i})}register(t){this.paintables.push(t),this.isTTY&&this.interval==null&&(this.stdout.write(DW.cursorHide),this.repaint(),this.interval=setInterval(()=>this.repaint(),Z4c))}write(t,{stderr:r=!1}={}){let n=r?this.stderr:this.stdout;if(!this.isTTY){n.write(t);return}if(this.suspended){this.suspendBuffer.push({content:t,stderr:r});return}this.stdout.write(this.clear()),n.write(t),this.stdout.write(this.paint())}async takeOverTerminal(t){if(!this.isTTY){await t();return}this.stopLoop(),this.stdout.write(this.clear()),this.suspended=!0;try{await t()}finally{this.suspended=!1;for(let{content:r,stderr:n}of this.suspendBuffer)(n?this.stderr:this.stdout).write(r);this.suspendBuffer=[],this.paintables.length>0&&(this.stdout.write(DW.cursorHide),this.repaint(),this.interval=setInterval(()=>this.repaint(),Z4c))}}finish(){!this.isTTY||this.finished||(this.finished=!0,this.stopLoop(),this.stdout.write(this.clear()+this.paint()),this.stdout.write(DW.cursorShow))}stopLoop(){this.interval!=null&&(clearInterval(this.interval),this.interval=void 0)}repaint(){this.frameIndex=(this.frameIndex+1)%xBo.length,this.stdout.write(this.clear()+this.paint())}clear(){return this.lastPaint.length===0?"":DW.eraseLines(this.lastPaint.split(`
|
|
3623
3623
|
`).length)}paint(){if(this.paintables.length===0)return this.lastPaint="","";let t=xBo[this.frameIndex]??xBo[0],r=this.paintables.map(i=>i.paint(t)).filter(i=>i.length>0);if(r.length===0)return this.lastPaint="","";let n=r.join(`
|
|
3624
3624
|
`)+`
|
|
3625
|
-
`;return this.lastPaint=n,n}};function cWd(e){return uWd(e)&&e.code==="EPIPE"}function uWd(e){return"code"in e&&typeof e.code=="string"}tr();_t();var bst="api",_Gr=class{cwd;issues=[];constructor({cwd:t}){this.cwd=t}async convert({fernYml:t}){let{api:r,apis:n}=t.data,i=t.sourced;if(r!=null&&n!=null)return this.issues.push(new yy({message:"Cannot define both 'api' and 'apis' in fern.yml.",location:i.$loc})),{success:!1,issues:this.issues};if(r==null&&n==null)return{success:!0,apis:{}};let o={};return r!=null&&!nv(i.api)&&(o=await this.convertApi({absoluteFernYmlPath:this.resolveBasePathForKey("api",t),api:r,sourcedApi:i.api})),n!=null&&!nv(i.apis)&&(o=await this.convertApis({absoluteFernYmlPath:t.absoluteFilePath,pathMappings:t.pathMappings,apis:n,sourcedApis:i.apis})),this.issues.length>0?{success:!1,issues:this.issues}:{success:!0,apis:o}}async convertApi({absoluteFernYmlPath:t,api:r,sourcedApi:n}){if(nv(n))return{};let o={specs:await this.convertSpecs({absoluteFernYmlPath:t,specs:r.specs,sourced:n.specs}),auth:r.auth,authSchemes:r.authSchemes,defaultUrl:r.defaultUrl,defaultEnvironment:r.defaultEnvironment,environments:r.environments,headers:r.headers};return{[bst]:o}}async convertApis({absoluteFernYmlPath:t,pathMappings:r,apis:n,sourcedApis:i}){if(nv(i))return{};let o=Object.entries(n).filter(([a])=>!nv(i[a])).map(([a,c])=>({apiName:a,apiDef:c,sourcedApiDef:i[a]})).filter(a=>!nv(a.sourcedApiDef)),s=await Promise.all(o.map(async({apiName:a,apiDef:c,sourcedApiDef:u})=>{let l=this.findBasePathInMappings(["apis",a],r)??this.findBasePathInMappings(["apis"],r)??t,d={specs:await this.convertSpecs({absoluteFernYmlPath:l,specs:c.specs,sourced:u.specs}),auth:c.auth,authSchemes:c.authSchemes,defaultUrl:c.defaultUrl,defaultEnvironment:c.defaultEnvironment,environments:c.environments,headers:c.headers};return[a,d]}));return Object.fromEntries(s)}async convertSpecs({absoluteFernYmlPath:t,specs:r,sourced:n}){this.validateSpecCombinations({specs:r,sourced:n});let i=[];for(let o=0;o<r.length;o++){let s=r[o],a=n[o];s==null||nv(a)||i.push({spec:s,sourced:a})}return await Promise.all(i.map(({spec:o,sourced:s})=>this.convertSpec({absoluteFernYmlPath:t,spec:o,sourced:s})))}async convertSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){if("openapi"in r&&"openapi"in n)return await this.convertOpenApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("asyncapi"in r&&"asyncapi"in n)return await this.convertAsyncApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("proto"in r&&"proto"in n)return await this.convertProtobufSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("fern"in r&&"fern"in n)return await this.convertFernSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("conjure"in r&&"conjure"in n)return await this.convertConjureSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("openrpc"in r&&"openrpc"in n)return await this.convertOpenRpcSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("graphql"in r&&"graphql"in n)return await this.convertGraphQlSpec({absoluteFernYmlPath:t,spec:r,sourced:n});throw new D({message:`Unknown spec type: ${JSON.stringify(r)}`,code:D.Code.InternalError})}async convertOpenApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={openapi:await this.resolvePath({absoluteFernYmlPath:t,path:r.openapi,sourced:n.openapi})};return r.origin!=null&&(i.origin=r.origin),r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.overlays!=null&&!nv(n.overlays)&&(i.overlays=await this.resolvePath({absoluteFernYmlPath:t,path:r.overlays,sourced:n.overlays})),r.namespace!=null&&(i.namespace=r.namespace),r.settings!=null&&(i.settings=r.settings),i}async convertAsyncApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={asyncapi:await this.resolvePath({absoluteFernYmlPath:t,path:r.asyncapi,sourced:n.asyncapi})};return r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.settings!=null&&(i.settings=r.settings),i}async convertProtobufSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={root:await this.resolvePath({absoluteFernYmlPath:t,path:r.proto.root,sourced:n.proto.root})};if(r.proto.target!=null&&!nv(n.proto.target)&&(i.target=await this.resolvePath({absoluteFernYmlPath:t,path:r.proto.target,sourced:n.proto.target})),r.proto.overrides!=null&&!nv(n.proto.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.proto.overrides,sourced:n.proto.overrides})),r.proto.localGeneration!=null&&(i.localGeneration=r.proto.localGeneration),r.proto.fromOpenapi!=null&&(i.fromOpenapi=r.proto.fromOpenapi),r.proto.dependencies!=null&&!nv(n.proto.dependencies)){let s=[];for(let a=0;a<r.proto.dependencies.length;a++){let c=r.proto.dependencies[a],u=n.proto.dependencies[a];c!=null&&!nv(u)&&s.push(await this.resolvePath({absoluteFernYmlPath:t,path:c,sourced:u}))}i.dependencies=s}let o={proto:i};return r.settings!=null&&(o.settings=r.settings),o}async convertFernSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={fern:await this.resolvePath({absoluteFernYmlPath:t,path:r.fern,sourced:n.fern})};return r.settings!=null&&(i.settings=r.settings),i}async convertConjureSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={conjure:await this.resolvePath({absoluteFernYmlPath:t,path:r.conjure,sourced:n.conjure})};return r.settings!=null&&(i.settings=r.settings),i}async convertGraphQlSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={graphql:await this.resolvePath({absoluteFernYmlPath:t,path:r.graphql,sourced:n.graphql})};return r.origin!=null&&(i.origin=r.origin),r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.examples!=null&&!nv(n.examples)&&(i.examples=await this.resolvePath({absoluteFernYmlPath:t,path:r.examples,sourced:n.examples})),r.name!=null&&(i.name=r.name),i}async convertOpenRpcSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={openrpc:await this.resolvePath({absoluteFernYmlPath:t,path:r.openrpc,sourced:n.openrpc})};return r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.settings!=null&&(i.settings=r.settings),i}async resolvePathOrPaths({absoluteFernYmlPath:t,paths:r,sourced:n}){if(!Array.isArray(r))return await this.resolvePath({absoluteFernYmlPath:t,path:r,sourced:n});let i=[],o=n;for(let s=0;s<r.length;s++){let a=r[s],c=o[s];a!=null&&!nv(c)&&i.push(await this.resolvePath({absoluteFernYmlPath:t,path:a,sourced:c}))}return i}async resolvePath({absoluteFernYmlPath:t,path:r,sourced:n}){let i=bn(t),o=Ze(i,Fe.of(r));if(!await sr(o)){let s=Fe.of(ds(this.cwd,o));this.issues.push(new yy({message:`File "${s}" does not exist`,location:n.$loc}))}return o}validateSpecCombinations({specs:t,sourced:r}){let n=[],i=[],o=[];for(let s=0;s<t.length;s++){let a=t[s],c=r[s];if(!(a==null||nv(c))){if("fern"in a){n.push(c);continue}if("conjure"in a){i.push(c);continue}o.push(c)}}if(n.length>1)for(let s of n)this.issues.push(new yy({message:"Multiple Fern specs are not allowed. Use multiple definition files within a single Fern definition directory instead.",location:s.fern.$loc}));if(i.length>1)for(let s of i)this.issues.push(new yy({message:"Multiple Conjure specs are not allowed.",location:s.conjure.$loc}));if(n.length>0&&(i.length>0||o.length>0))for(let s of n)this.issues.push(new yy({message:"Fern specs cannot be mixed with other spec types. Fern definitions are a standalone definition type.",location:s.fern.$loc}));if(i.length>0&&(o.length>0||n.length>0))for(let s of i)this.issues.push(new yy({message:"Conjure specs cannot be mixed with other spec types. Conjure definitions are a standalone definition type.",location:s.conjure.$loc}))}findBasePathInMappings(t,r){for(let n of r)if(n.yamlPath.length===t.length&&t.every((i,o)=>i===n.yamlPath[o]))return n.document.absoluteFilePath}resolveBasePathForKey(t,r){return this.findBasePathInMappings([t],r.pathMappings)??r.absoluteFilePath}};var lWd="docs",VGr=class{issues=[];convert({fernYml:t}){let r=t.data.docs;if(r==null)return{success:!1,issues:[]};if(this.validateInstances({docs:r,fernYml:t}),this.issues.length>0)return{success:!1,issues:this.issues};let n=t.pathMappings.find(o=>o.yamlPath.length===1&&o.yamlPath[0]===lWd),i=n!=null?n.document.absoluteFilePath:t.absoluteFilePath;return{success:!0,config:{raw:r,absoluteFilePath:i}}}validateInstances({docs:t,fernYml:r}){t.instances.length===0&&this.issues.push(new yy({message:"You must specify at least one docs instance",location:r.sourced.$loc}))}};var vz=["csharp","go","java","php","python","ruby","rust","swift","typescript"],FCe={typescript:"TypeScript",python:"Python",go:"Go",java:"Java",csharp:"C#",ruby:"Ruby",php:"PHP",rust:"Rust",swift:"Swift"},qGr=["typescript","python","go","java","csharp","ruby","php","rust","swift"];var GGr={csharp:"fernapi/fern-csharp-sdk",go:"fernapi/fern-go-sdk",java:"fernapi/fern-java-sdk",php:"fernapi/fern-php-sdk",python:"fernapi/fern-python-sdk",ruby:"fernapi/fern-ruby-sdk",rust:"fernapi/fern-rust-sdk",swift:"fernapi/fern-swift-sdk",typescript:"fernapi/fern-typescript-sdk"},eUc={"fernapi/fern-csharp-sdk":"csharp","fernapi/fern-go-sdk":"go","fernapi/fern-java-sdk":"java","fernapi/fern-php-sdk":"php","fernapi/fern-python-sdk":"python","fernapi/fern-ruby-sdk":"ruby","fernapi/fern-rust-sdk":"rust","fernapi/fern-swift-sdk":"swift","fernapi/fern-typescript-sdk":"typescript","fernapi/fern-typescript-express":"typescript","fernapi/fern-fastapi-server":"python","fernapi/fern-java-spring":"java"},tUc={"fernapi/fern-python-sdk":"python-sdk","fernapi/fern-pydantic-model":"pydantic","fernapi/fern-fastapi-server":"fastapi","fernapi/fern-typescript":"ts-sdk","fernapi/fern-typescript-browser-sdk":"ts-sdk","fernapi/fern-typescript-node-sdk":"ts-sdk","fernapi/fern-typescript-sdk":"ts-sdk","fernapi/fern-typescript-express":"ts-express","fernapi/fern-java-sdk":"java-sdk","fernapi/fern-java-model":"java-model","java-model":"java-model","fernapi/fern-java-spring":"java-spring","fernapi/fern-go-sdk":"go-sdk","fernapi/fern-go-model":"go-model","fernapi/fern-csharp-sdk":"csharp-sdk","fernapi/fern-csharp-model":"csharp-model","fernapi/fern-ruby-sdk":"ruby-sdk-v2","fernapi/fern-ruby-sdk-v2":"ruby-sdk-v2","fernapi/fern-php-sdk":"php-sdk","fernapi/fern-php-model":"php-model","fernapi/fern-rust-sdk":"rust-sdk","fernapi/fern-rust-model":"rust-model","fernapi/fern-swift-sdk":"swift-sdk","fernapi/fern-swift-model":"swift-model","fernapi/fern-postman":"postman","fernapi/fern-openapi":"openapi","fernapi/fern-cli":"cli"},SBo={"fernapi/fern-typescript-sdk":"https://buildwithfern.com/learn/sdks/generators/typescript/changelog","fernapi/fern-python-sdk":"https://buildwithfern.com/learn/sdks/generators/python/changelog","fernapi/fern-go-sdk":"https://buildwithfern.com/learn/sdks/generators/go/changelog","fernapi/fern-java-sdk":"https://buildwithfern.com/learn/sdks/generators/java/changelog","fernapi/fern-csharp-sdk":"https://buildwithfern.com/learn/sdks/generators/csharp/changelog","fernapi/fern-php-sdk":"https://buildwithfern.com/learn/sdks/generators/php/changelog","fernapi/fern-ruby-sdk":"https://buildwithfern.com/learn/sdks/generators/ruby/changelog","fernapi/fern-swift-sdk":"https://buildwithfern.com/learn/sdks/generators/swift/changelog"};function WGr({lang:e,version:t}){return{image:GGr[e],tag:t??"latest"}}function rUc({image:e}){return eUc[e]}var HGr=class{logger;issues=[];constructor({logger:t}){this.logger=t}convert({fernYml:t}){let r=t.data.sdks,n=t.sourced.sdks;if(r==null||nv(n))return{success:!1,issues:[]};let i={org:t.data.org,defaultGroup:r.defaultGroup,defaultGroupLocation:n.defaultGroup?.$loc,targets:this.convertTargets({targetsConfig:r.targets,sourced:n.targets,globalReadme:r.readme})};return this.issues.length>0?{success:!1,issues:this.issues}:{success:!0,config:i}}convertTargets({targetsConfig:t,sourced:r,globalReadme:n}){let i=[];for(let[o,s]of Object.entries(t)){let a=r[o];if(a==null)continue;let c=this.convertTarget({name:o,target:s,sourced:a,globalReadme:n});c!=null&&i.push(c)}return i}convertTarget({name:t,target:r,sourced:n,globalReadme:i}){let o=this.resolveGeneratorInfo({name:t,target:r,sourced:n});if(o==null)return;let s=this.mergeReadme({globalReadme:i,targetReadme:r.readme});return{name:t,lang:o.lang,image:o.image,registry:o.registry,version:o.version,api:this.resolveApi({api:r.api}),sourceLocation:n.$loc,config:r.config!=null?this.convertConfig(r.config):void 0,output:gy.resolveOutputObjectSchema(r.output),publish:r.publish,groups:r.group??[],metadata:r.metadata,readme:s}}mergeReadme({globalReadme:t,targetReadme:r}){if(t==null&&r==null)return;if(t==null)return r;if(r==null)return t;let n={...t,...r};return(t.customSections!=null||r.customSections!=null)&&(n.customSections=[...t.customSections??[],...r.customSections??[]]),n}resolveApi({api:t}){return t??bst}resolveGeneratorInfo({name:t,target:r,sourced:n}){let i=this.resolveLanguage({name:t,target:r,sourced:n});if(i==null)return;if(r.image!=null)return typeof r.image=="string"?{lang:i,image:py(r.image),version:r.version??"latest",registry:void 0}:{lang:i,image:py(r.image.name),version:r.version??"latest",registry:r.image.registry};let o=WGr({lang:i,version:r.version});return{lang:i,image:o.image,version:o.tag,registry:void 0}}convertConfig(t){return t}resolveLanguage({name:t,target:r,sourced:n}){if(r.lang!=null)return r.lang;if(r.image!=null){let o=typeof r.image=="string"?r.image:r.image.name;return rUc({image:py(o)})}let i=t;if(vz.includes(i))return i;this.issues.push(new yy({message:`target "${t}" is not a recognized language; please specify the "lang" property`,location:n.$loc}))}};var m5t=class{cwd;logger;issues=[];constructor({cwd:t,logger:r}){this.cwd=t,this.logger=r}async loadOrThrow({fernYml:t}){let r=await this.load({fernYml:t});if(!r.success)throw new tH(r.issues);return r.workspace}async load({fernYml:t}){let r=this.convertAi({fernYml:t}),n=this.convertDocs({fernYml:t}),[i,o,s]=await Promise.all([this.convertApis({fernYml:t}),this.convertCliVersion({fernYml:t}),this.convertSdks({fernYml:t})]);return this.issues.length>0?{success:!1,issues:this.issues}:{success:!0,workspace:{absoluteFilePath:t.absoluteFilePath,fernYml:t,ai:r,apis:i,cliVersion:o,docs:n,org:t.data.org,sdks:s}}}convertAi({fernYml:t}){let r=t.data.ai;if(r!=null)return{provider:r.provider,model:r.model}}async convertApis({fernYml:t}){let n=await new _Gr({cwd:this.cwd}).convert({fernYml:t});return n.success?n.apis:(this.issues.push(...n.issues),{})}async convertCliVersion({fernYml:t}){return t.data.cli?.version??"*"}convertDocs({fernYml:t}){let n=new VGr().convert({fernYml:t});if(!n.success){this.issues.push(...n.issues);return}return n.config}async convertSdks({fernYml:t}){let n=new HGr({logger:this.logger}).convert({fernYml:t});if(!n.success){this.issues.push(...n.issues);return}return n.config}};function nUc(e){return{command:pWd(e),flags:fWd(e)}}function pWd(e){let t=[];for(let r of e.slice(2)){if(r.startsWith("-"))break;t.push(r)}return t.join(" ")}function fWd(e){return e.slice(2).filter(t=>t.startsWith("--")).map(t=>{let r=t.slice(2),n=r.indexOf("=");return n>=0?r.slice(0,n):r}).filter(t=>t.length>0).sort()}tr();var Est=require("fs"),KGr=class{absoluteFilePath;initialized=!1;constructor(t){let r=new Date().toISOString().replace(/[:.]/g,"-");this.absoluteFilePath=Ze(t,Fe.of(`${r}.log`))}write({taskName:t,level:r,message:n}){this.ensureInitialized();let o=`[${new Date().toISOString()}] [${r.toUpperCase().padEnd(5)}] [${t}] ${n}
|
|
3625
|
+
`;return this.lastPaint=n,n}};function cWd(e){return uWd(e)&&e.code==="EPIPE"}function uWd(e){return"code"in e&&typeof e.code=="string"}tr();_t();var bst="api",_Gr=class{cwd;issues=[];constructor({cwd:t}){this.cwd=t}async convert({fernYml:t}){let{api:r,apis:n}=t.data,i=t.sourced;if(r!=null&&n!=null)return this.issues.push(new yy({message:"Cannot define both 'api' and 'apis' in fern.yml.",location:i.$loc})),{success:!1,issues:this.issues};if(r==null&&n==null)return{success:!0,apis:{}};let o={};return r!=null&&!nv(i.api)&&(o=await this.convertApi({absoluteFernYmlPath:this.resolveBasePathForKey("api",t),api:r,sourcedApi:i.api})),n!=null&&!nv(i.apis)&&(o=await this.convertApis({absoluteFernYmlPath:t.absoluteFilePath,pathMappings:t.pathMappings,apis:n,sourcedApis:i.apis})),this.issues.length>0?{success:!1,issues:this.issues}:{success:!0,apis:o}}async convertApi({absoluteFernYmlPath:t,api:r,sourcedApi:n}){if(nv(n))return{};let o={specs:await this.convertSpecs({absoluteFernYmlPath:t,specs:r.specs,sourced:n.specs}),auth:r.auth,authSchemes:r.authSchemes,defaultUrl:r.defaultUrl,defaultEnvironment:r.defaultEnvironment,environments:r.environments,headers:r.headers};return{[bst]:o}}async convertApis({absoluteFernYmlPath:t,pathMappings:r,apis:n,sourcedApis:i}){if(nv(i))return{};let o=Object.entries(n).filter(([a])=>!nv(i[a])).map(([a,c])=>({apiName:a,apiDef:c,sourcedApiDef:i[a]})).filter(a=>!nv(a.sourcedApiDef)),s=await Promise.all(o.map(async({apiName:a,apiDef:c,sourcedApiDef:u})=>{let l=this.findBasePathInMappings(["apis",a],r)??this.findBasePathInMappings(["apis"],r)??t,d={specs:await this.convertSpecs({absoluteFernYmlPath:l,specs:c.specs,sourced:u.specs}),auth:c.auth,authSchemes:c.authSchemes,defaultUrl:c.defaultUrl,defaultEnvironment:c.defaultEnvironment,environments:c.environments,headers:c.headers};return[a,d]}));return Object.fromEntries(s)}async convertSpecs({absoluteFernYmlPath:t,specs:r,sourced:n}){this.validateSpecCombinations({specs:r,sourced:n});let i=[];for(let o=0;o<r.length;o++){let s=r[o],a=n[o];s==null||nv(a)||i.push({spec:s,sourced:a})}return await Promise.all(i.map(({spec:o,sourced:s})=>this.convertSpec({absoluteFernYmlPath:t,spec:o,sourced:s})))}async convertSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){if("openapi"in r&&"openapi"in n)return await this.convertOpenApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("asyncapi"in r&&"asyncapi"in n)return await this.convertAsyncApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("proto"in r&&"proto"in n)return await this.convertProtobufSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("fern"in r&&"fern"in n)return await this.convertFernSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("conjure"in r&&"conjure"in n)return await this.convertConjureSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("openrpc"in r&&"openrpc"in n)return await this.convertOpenRpcSpec({absoluteFernYmlPath:t,spec:r,sourced:n});if("graphql"in r&&"graphql"in n)return await this.convertGraphQlSpec({absoluteFernYmlPath:t,spec:r,sourced:n});throw new D({message:`Unknown spec type: ${JSON.stringify(r)}`,code:D.Code.InternalError})}async convertOpenApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={openapi:await this.resolvePath({absoluteFernYmlPath:t,path:r.openapi,sourced:n.openapi})};return r.origin!=null&&(i.origin=r.origin),r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.overlays!=null&&!nv(n.overlays)&&(i.overlays=await this.resolvePath({absoluteFernYmlPath:t,path:r.overlays,sourced:n.overlays})),r.namespace!=null&&(i.namespace=r.namespace),r.settings!=null&&(i.settings=r.settings),i}async convertAsyncApiSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={asyncapi:await this.resolvePath({absoluteFernYmlPath:t,path:r.asyncapi,sourced:n.asyncapi})};return r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.settings!=null&&(i.settings=r.settings),i}async convertProtobufSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={root:await this.resolvePath({absoluteFernYmlPath:t,path:r.proto.root,sourced:n.proto.root})};if(r.proto.target!=null&&!nv(n.proto.target)&&(i.target=await this.resolvePath({absoluteFernYmlPath:t,path:r.proto.target,sourced:n.proto.target})),r.proto.overrides!=null&&!nv(n.proto.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.proto.overrides,sourced:n.proto.overrides})),r.proto.localGeneration!=null&&(i.localGeneration=r.proto.localGeneration),r.proto.fromOpenapi!=null&&(i.fromOpenapi=r.proto.fromOpenapi),r.proto.dependencies!=null&&!nv(n.proto.dependencies)){let s=[];for(let a=0;a<r.proto.dependencies.length;a++){let c=r.proto.dependencies[a],u=n.proto.dependencies[a];c!=null&&!nv(u)&&s.push(await this.resolvePath({absoluteFernYmlPath:t,path:c,sourced:u}))}i.dependencies=s}let o={proto:i};return r.settings!=null&&(o.settings=r.settings),o}async convertFernSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={fern:await this.resolvePath({absoluteFernYmlPath:t,path:r.fern,sourced:n.fern})};return r.settings!=null&&(i.settings=r.settings),i}async convertConjureSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={conjure:await this.resolvePath({absoluteFernYmlPath:t,path:r.conjure,sourced:n.conjure})};return r.settings!=null&&(i.settings=r.settings),i}async convertGraphQlSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={graphql:await this.resolvePath({absoluteFernYmlPath:t,path:r.graphql,sourced:n.graphql})};return r.origin!=null&&(i.origin=r.origin),r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.examples!=null&&!nv(n.examples)&&(i.examples=await this.resolvePath({absoluteFernYmlPath:t,path:r.examples,sourced:n.examples})),r.name!=null&&(i.name=r.name),i}async convertOpenRpcSpec({absoluteFernYmlPath:t,spec:r,sourced:n}){let i={openrpc:await this.resolvePath({absoluteFernYmlPath:t,path:r.openrpc,sourced:n.openrpc})};return r.overrides!=null&&!nv(n.overrides)&&(i.overrides=await this.resolvePathOrPaths({absoluteFernYmlPath:t,paths:r.overrides,sourced:n.overrides})),r.settings!=null&&(i.settings=r.settings),i}async resolvePathOrPaths({absoluteFernYmlPath:t,paths:r,sourced:n}){if(!Array.isArray(r))return await this.resolvePath({absoluteFernYmlPath:t,path:r,sourced:n});let i=[],o=n;for(let s=0;s<r.length;s++){let a=r[s],c=o[s];a!=null&&!nv(c)&&i.push(await this.resolvePath({absoluteFernYmlPath:t,path:a,sourced:c}))}return i}async resolvePath({absoluteFernYmlPath:t,path:r,sourced:n}){let i=bn(t),o=Ze(i,Fe.of(r));if(!await sr(o)){let s=Fe.of(ds(this.cwd,o));this.issues.push(new yy({message:`File "${s}" does not exist`,location:n.$loc}))}return o}validateSpecCombinations({specs:t,sourced:r}){let n=[],i=[],o=[];for(let s=0;s<t.length;s++){let a=t[s],c=r[s];if(!(a==null||nv(c))){if("fern"in a){n.push(c);continue}if("conjure"in a){i.push(c);continue}o.push(c)}}if(n.length>1)for(let s of n)this.issues.push(new yy({message:"Multiple Fern specs are not allowed. Use multiple definition files within a single Fern definition directory instead.",location:s.fern.$loc}));if(i.length>1)for(let s of i)this.issues.push(new yy({message:"Multiple Conjure specs are not allowed.",location:s.conjure.$loc}));if(n.length>0&&(i.length>0||o.length>0))for(let s of n)this.issues.push(new yy({message:"Fern specs cannot be mixed with other spec types. Fern definitions are a standalone definition type.",location:s.fern.$loc}));if(i.length>0&&(o.length>0||n.length>0))for(let s of i)this.issues.push(new yy({message:"Conjure specs cannot be mixed with other spec types. Conjure definitions are a standalone definition type.",location:s.conjure.$loc}))}findBasePathInMappings(t,r){for(let n of r)if(n.yamlPath.length===t.length&&t.every((i,o)=>i===n.yamlPath[o]))return n.document.absoluteFilePath}resolveBasePathForKey(t,r){return this.findBasePathInMappings([t],r.pathMappings)??r.absoluteFilePath}};var lWd="docs",VGr=class{issues=[];convert({fernYml:t}){let r=t.data.docs;if(r==null)return{success:!1,issues:[]};if(this.validateInstances({docs:r,fernYml:t}),this.issues.length>0)return{success:!1,issues:this.issues};let n=t.pathMappings.find(o=>o.yamlPath.length===1&&o.yamlPath[0]===lWd),i=n!=null?n.document.absoluteFilePath:t.absoluteFilePath;return{success:!0,config:{raw:r,absoluteFilePath:i}}}validateInstances({docs:t,fernYml:r}){t.instances.length===0&&this.issues.push(new yy({message:"You must specify at least one docs instance",location:r.sourced.$loc}))}};var vz=["csharp","go","java","php","python","ruby","rust","swift","typescript"],FCe={typescript:"TypeScript",python:"Python",go:"Go",java:"Java",csharp:"C#",ruby:"Ruby",php:"PHP",rust:"Rust",swift:"Swift"},qGr=["typescript","python","go","java","csharp","ruby","php","rust","swift"];var GGr={csharp:"fernapi/fern-csharp-sdk",go:"fernapi/fern-go-sdk",java:"fernapi/fern-java-sdk",php:"fernapi/fern-php-sdk",python:"fernapi/fern-python-sdk",ruby:"fernapi/fern-ruby-sdk",rust:"fernapi/fern-rust-sdk",swift:"fernapi/fern-swift-sdk",typescript:"fernapi/fern-typescript-sdk"},eUc={"fernapi/fern-csharp-sdk":"csharp","fernapi/fern-go-sdk":"go","fernapi/fern-java-sdk":"java","fernapi/fern-php-sdk":"php","fernapi/fern-python-sdk":"python","fernapi/fern-ruby-sdk":"ruby","fernapi/fern-rust-sdk":"rust","fernapi/fern-swift-sdk":"swift","fernapi/fern-typescript-sdk":"typescript","fernapi/fern-typescript-express":"typescript","fernapi/fern-fastapi-server":"python","fernapi/fern-java-spring":"java"},tUc={"fernapi/fern-python-sdk":"python-sdk","fernapi/fern-pydantic-model":"pydantic","fernapi/fern-fastapi-server":"fastapi","fernapi/fern-typescript":"ts-sdk","fernapi/fern-typescript-browser-sdk":"ts-sdk","fernapi/fern-typescript-node-sdk":"ts-sdk","fernapi/fern-typescript-sdk":"ts-sdk","fernapi/fern-typescript-express":"ts-express","fernapi/fern-java-sdk":"java-sdk","fernapi/fern-java-model":"java-model","java-model":"java-model","fernapi/fern-java-spring":"java-spring","fernapi/fern-go-sdk":"go-sdk","fernapi/fern-go-model":"go-model","fernapi/fern-csharp-sdk":"csharp-sdk","fernapi/fern-csharp-model":"csharp-model","fernapi/fern-ruby-sdk":"ruby-sdk-v2","fernapi/fern-ruby-sdk-v2":"ruby-sdk-v2","fernapi/fern-php-sdk":"php-sdk","fernapi/fern-php-model":"php-model","fernapi/fern-rust-sdk":"rust-sdk","fernapi/fern-rust-model":"rust-model","fernapi/fern-swift-sdk":"swift-sdk","fernapi/fern-swift-model":"swift-model","fernapi/fern-postman":"postman","fernapi/fern-openapi":"openapi","fernapi/fern-cli-generator":"cli"},SBo={"fernapi/fern-typescript-sdk":"https://buildwithfern.com/learn/sdks/generators/typescript/changelog","fernapi/fern-python-sdk":"https://buildwithfern.com/learn/sdks/generators/python/changelog","fernapi/fern-go-sdk":"https://buildwithfern.com/learn/sdks/generators/go/changelog","fernapi/fern-java-sdk":"https://buildwithfern.com/learn/sdks/generators/java/changelog","fernapi/fern-csharp-sdk":"https://buildwithfern.com/learn/sdks/generators/csharp/changelog","fernapi/fern-php-sdk":"https://buildwithfern.com/learn/sdks/generators/php/changelog","fernapi/fern-ruby-sdk":"https://buildwithfern.com/learn/sdks/generators/ruby/changelog","fernapi/fern-swift-sdk":"https://buildwithfern.com/learn/sdks/generators/swift/changelog"};function WGr({lang:e,version:t}){return{image:GGr[e],tag:t??"latest"}}function rUc({image:e}){return eUc[e]}var HGr=class{logger;issues=[];constructor({logger:t}){this.logger=t}convert({fernYml:t}){let r=t.data.sdks,n=t.sourced.sdks;if(r==null||nv(n))return{success:!1,issues:[]};let i={org:t.data.org,defaultGroup:r.defaultGroup,defaultGroupLocation:n.defaultGroup?.$loc,targets:this.convertTargets({targetsConfig:r.targets,sourced:n.targets,globalReadme:r.readme})};return this.issues.length>0?{success:!1,issues:this.issues}:{success:!0,config:i}}convertTargets({targetsConfig:t,sourced:r,globalReadme:n}){let i=[];for(let[o,s]of Object.entries(t)){let a=r[o];if(a==null)continue;let c=this.convertTarget({name:o,target:s,sourced:a,globalReadme:n});c!=null&&i.push(c)}return i}convertTarget({name:t,target:r,sourced:n,globalReadme:i}){let o=this.resolveGeneratorInfo({name:t,target:r,sourced:n});if(o==null)return;let s=this.mergeReadme({globalReadme:i,targetReadme:r.readme});return{name:t,lang:o.lang,image:o.image,registry:o.registry,version:o.version,api:this.resolveApi({api:r.api}),sourceLocation:n.$loc,config:r.config!=null?this.convertConfig(r.config):void 0,output:gy.resolveOutputObjectSchema(r.output),publish:r.publish,groups:r.group??[],metadata:r.metadata,readme:s}}mergeReadme({globalReadme:t,targetReadme:r}){if(t==null&&r==null)return;if(t==null)return r;if(r==null)return t;let n={...t,...r};return(t.customSections!=null||r.customSections!=null)&&(n.customSections=[...t.customSections??[],...r.customSections??[]]),n}resolveApi({api:t}){return t??bst}resolveGeneratorInfo({name:t,target:r,sourced:n}){let i=this.resolveLanguage({name:t,target:r,sourced:n});if(i==null)return;if(r.image!=null)return typeof r.image=="string"?{lang:i,image:py(r.image),version:r.version??"latest",registry:void 0}:{lang:i,image:py(r.image.name),version:r.version??"latest",registry:r.image.registry};let o=WGr({lang:i,version:r.version});return{lang:i,image:o.image,version:o.tag,registry:void 0}}convertConfig(t){return t}resolveLanguage({name:t,target:r,sourced:n}){if(r.lang!=null)return r.lang;if(r.image!=null){let o=typeof r.image=="string"?r.image:r.image.name;return rUc({image:py(o)})}let i=t;if(vz.includes(i))return i;this.issues.push(new yy({message:`target "${t}" is not a recognized language; please specify the "lang" property`,location:n.$loc}))}};var m5t=class{cwd;logger;issues=[];constructor({cwd:t,logger:r}){this.cwd=t,this.logger=r}async loadOrThrow({fernYml:t}){let r=await this.load({fernYml:t});if(!r.success)throw new tH(r.issues);return r.workspace}async load({fernYml:t}){let r=this.convertAi({fernYml:t}),n=this.convertDocs({fernYml:t}),[i,o,s]=await Promise.all([this.convertApis({fernYml:t}),this.convertCliVersion({fernYml:t}),this.convertSdks({fernYml:t})]);return this.issues.length>0?{success:!1,issues:this.issues}:{success:!0,workspace:{absoluteFilePath:t.absoluteFilePath,fernYml:t,ai:r,apis:i,cliVersion:o,docs:n,org:t.data.org,sdks:s}}}convertAi({fernYml:t}){let r=t.data.ai;if(r!=null)return{provider:r.provider,model:r.model}}async convertApis({fernYml:t}){let n=await new _Gr({cwd:this.cwd}).convert({fernYml:t});return n.success?n.apis:(this.issues.push(...n.issues),{})}async convertCliVersion({fernYml:t}){return t.data.cli?.version??"*"}convertDocs({fernYml:t}){let n=new VGr().convert({fernYml:t});if(!n.success){this.issues.push(...n.issues);return}return n.config}async convertSdks({fernYml:t}){let n=new HGr({logger:this.logger}).convert({fernYml:t});if(!n.success){this.issues.push(...n.issues);return}return n.config}};function nUc(e){return{command:pWd(e),flags:fWd(e)}}function pWd(e){let t=[];for(let r of e.slice(2)){if(r.startsWith("-"))break;t.push(r)}return t.join(" ")}function fWd(e){return e.slice(2).filter(t=>t.startsWith("--")).map(t=>{let r=t.slice(2),n=r.indexOf("=");return n>=0?r.slice(0,n):r}).filter(t=>t.length>0).sort()}tr();var Est=require("fs"),KGr=class{absoluteFilePath;initialized=!1;constructor(t){let r=new Date().toISOString().replace(/[:.]/g,"-");this.absoluteFilePath=Ze(t,Fe.of(`${r}.log`))}write({taskName:t,level:r,message:n}){this.ensureInitialized();let o=`[${new Date().toISOString()}] [${r.toUpperCase().padEnd(5)}] [${t}] ${n}
|
|
3626
3626
|
`;(0,Est.appendFileSync)(this.absoluteFilePath,o)}empty(){return!this.initialized}ensureInitialized(){this.initialized||((0,Est.mkdirSync)(bn(this.absoluteFilePath),{recursive:!0}),(0,Est.writeFileSync)(this.absoluteFilePath,`Fern Debug Log - ${new Date().toISOString()}
|
|
3627
3627
|
${"=".repeat(60)}
|
|
3628
3628
|
|
|
@@ -3645,7 +3645,7 @@ ${Ae.dim(`Logs written to: ${this.logs.absoluteFilePath}`)}
|
|
|
3645
3645
|
`);break;case Gn.Error:process.stderr.write(`${n}: ${Ae.red(r)}
|
|
3646
3646
|
`);break;default:process.stderr.write(`${n}: ${r}
|
|
3647
3647
|
`);break}}shouldLogToTask(t){return this.enabled&&kx.indexOf(t)>=kx.indexOf(this.logLevel)}};var Cd=class{result=Uf.Success;lastFailureMessage=void 0;context;logger;constructor({context:t,task:r,logLevel:n=Gn.Warn}){this.context=t,r!=null?this.logger=new ZGr({context:t,task:r,logLevel:n}):this.logger=VI((i,...o)=>{kx.indexOf(i)>=kx.indexOf(n)&&t.stderr.log(i,...o)})}async takeOverTerminal(t){await t()}failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),new fu}failWithoutThrowing(t,r,n){if(this.result=Uf.Failure,r instanceof fu)return;let i=this.getFullErrorMessage(t,r);i!=null&&(this.lastFailureMessage=i,this.logger.error(i)),OBo(this.context,r,{...n,message:t})}getLastFailureMessage(){return this.lastFailureMessage}captureException(t,r){return this.context.telemetry.captureException(t,r)}getFullErrorMessage(t,r){let n=this.formatError(r);return t!=null&&n!=null?t.includes(n)?t:`${t}: ${n}`:t??n}getResult(){return this.result}addInteractiveTask(t){let r={logger:this.logger,takeOverTerminal:this.takeOverTerminal.bind(this),failAndThrow:this.failAndThrow.bind(this),failWithoutThrowing:this.failWithoutThrowing.bind(this),captureException:this.captureException.bind(this),getResult:()=>this.result,getLastFailureMessage:this.getLastFailureMessage.bind(this),addInteractiveTask:this.addInteractiveTask.bind(this),runInteractiveTask:this.runInteractiveTask.bind(this),instrumentPostHogEvent:this.instrumentPostHogEvent.bind(this),setSubtitle:n=>{},start:()=>r,isStarted:()=>!0,finish:()=>{},isFinished:()=>!0};return r}async runInteractiveTask(t,r){let n=this.addInteractiveTask(t).start();try{return await r(n),!0}catch{return!1}}instrumentPostHogEvent(t){try{if(t.command==null||t.command.length===0)return;let r=t.command,n={};t.orgId!=null&&(n.org=t.orgId);for(let[i,o]of Object.entries(t.properties??{}))(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o===null)&&(n[String(i)]=o);this.context.telemetry.sendEvent(r,n)}catch{}}formatError(t){if(t!=null){if(t instanceof Error)return t.message;if(typeof t=="string")return t;if(typeof t=="object"){let r=this.extractErrorMessage(t);if(r!=null)return r}try{return JSON.stringify(t)}catch{return String(t)}}}extractErrorMessage(t){let r=t;if(typeof r.message=="string")return r.message;if(r.body!=null&&typeof r.body=="object"){let n=r.body;if(typeof n.message=="string")return n.message}if(r.content!=null&&typeof r.content=="object")return this.extractErrorMessage(r.content)}};tr();_t();function $Gr(e){return"graphql"in e}function AUc(e){return"openrpc"in e}function yUc(e){return"proto"in e}function e9r(e){let t=e.filter(n=>!(n.type==="openrpc"||n.type==="graphql"||n.type==="protobuf"&&!n.fromOpenAPI)),r=e.filter(n=>!(n.type==="protobuf"&&n.fromOpenAPI));return{filteredSpecs:t,allSpecs:r}}var vst=class{context;constructor(t){this.context=t.context}adapt(t){if(Hce(t))return this.adaptOpenApiSpec(t);if(RWe(t))return this.adaptAsyncApiSpec(t);if(yUc(t))return this.adaptProtobufSpec(t);if(AUc(t))return this.adaptOpenRpcSpec(t);if($Gr(t))return this.adaptGraphQlSpec(t);throw new D({message:`Unsupported spec type: ${JSON.stringify(t)}`,code:D.Code.InternalError})}convertAll(t){return t.map(r=>this.adapt(r))}adaptOpenApiSpec(t){return{type:"openapi",absoluteFilepath:t.openapi,absoluteFilepathToOverrides:t.overrides,absoluteFilepathToOverlays:t.overlays,namespace:t.namespace,source:{type:"openapi",file:t.openapi},settings:this.adaptOpenApiSettings(t.settings)}}adaptAsyncApiSpec(t){return{type:"openapi",absoluteFilepath:t.asyncapi,absoluteFilepathToOverrides:t.overrides,absoluteFilepathToOverlays:void 0,namespace:t.namespace,source:{type:"asyncapi",file:t.asyncapi},settings:this.adaptAsyncApiSettings(t.settings)}}adaptProtobufSpec(t){let r=t.proto;return{type:"protobuf",absoluteFilepathToProtobufRoot:r.root,absoluteFilepathToProtobufTarget:r.target,absoluteFilepathToOverrides:r.overrides,relativeFilepathToProtobufRoot:LE(this.context.cwd,r.root),generateLocally:r.localGeneration??!1,fromOpenAPI:r.fromOpenapi??!1,dependencies:r.dependencies?.map(n=>n.toString())??[],settings:void 0}}adaptOpenRpcSpec(t){return{type:"openrpc",absoluteFilepath:t.openrpc,absoluteFilepathToOverrides:t.overrides,namespace:void 0}}adaptGraphQlSpec(t){return{type:"graphql",absoluteFilepath:t.graphql,absoluteFilepathToOverrides:t.overrides,absoluteFilepathToExamples:t.examples,namespace:t.name}}adaptOpenApiSettings(t){if(t==null)return;let r={respectNullableSchemas:t.respectNullableSchemas,wrapReferencesToNullableInOptional:t.wrapReferencesToNullableInOptional,coerceOptionalSchemasToNullable:t.coerceOptionalSchemasToNullable,useTitlesAsName:t.titleAsSchemaName,coerceEnumsToLiterals:t.coerceEnumsToLiterals,optionalAdditionalProperties:t.optionalAdditionalProperties,shouldUseIdiomaticRequestNames:t.idiomaticRequestNames,groupEnvironmentsByHost:t.groupEnvironmentsByHost,multiServerStrategy:this.adaptMultiServerStrategy(t.multiServerStrategy),removeDiscriminantsFromSchemas:this.adaptRemoveDiscriminantsFromSchemas(t.removeDiscriminantsFromSchemas),pathParameterOrder:this.adaptPathParameterOrder(t.pathParameterOrder),respectReadonlySchemas:t.respectReadonlySchemas,useReadVariantForResponses:t.useReadVariantForResponses,onlyIncludeReferencedSchemas:t.onlyIncludeReferencedSchemas,inlinePathParameters:t.inlinePathParameters,shouldUseUndiscriminatedUnionsWithLiterals:t.preferUndiscriminatedUnionsWithLiterals,objectQueryParameters:t.objectQueryParameters,respectForwardCompatibleEnums:t.respectForwardCompatibleEnums,useBytesForBinaryResponse:t.useBytesForBinaryResponse,defaultFormParameterEncoding:t.defaultFormParameterEncoding,filter:t.filter,exampleGeneration:this.adaptExampleGeneration(t.exampleGeneration),additionalPropertiesDefaultsTo:t.additionalPropertiesDefaultsTo,typeDatesAsStrings:t.typeDatesAsStrings,preserveSingleSchemaOneOf:t.preserveSingleSchemaOneof,inlineAllOfSchemas:t.inlineAllOfSchemas,resolveAliases:t.resolveAliases,groupMultiApiEnvironments:t.groupMultiApiEnvironments,defaultIntegerFormat:this.adaptDefaultIntegerFormat(t.defaultIntegerFormat),coerceConstsTo:t.coerceConstsTo,shouldInferDiscriminatedUnionBaseProperties:t.inferDiscriminatedUnionBaseProperties};return Object.values(r).some(i=>i!=null)?r:void 0}adaptAsyncApiSettings(t){if(t==null)return;let r={respectNullableSchemas:t.respectNullableSchemas,wrapReferencesToNullableInOptional:t.wrapReferencesToNullableInOptional,coerceOptionalSchemasToNullable:t.coerceOptionalSchemasToNullable,useTitlesAsName:t.titleAsSchemaName,coerceEnumsToLiterals:t.coerceEnumsToLiterals,optionalAdditionalProperties:t.optionalAdditionalProperties,shouldUseIdiomaticRequestNames:t.idiomaticRequestNames,groupEnvironmentsByHost:t.groupEnvironmentsByHost,multiServerStrategy:this.adaptMultiServerStrategy(t.multiServerStrategy),removeDiscriminantsFromSchemas:this.adaptRemoveDiscriminantsFromSchemas(t.removeDiscriminantsFromSchemas),pathParameterOrder:this.adaptPathParameterOrder(t.pathParameterOrder),asyncApiNaming:t.messageNaming,coerceConstsTo:t.coerceConstsTo};return Object.values(r).some(i=>i!=null)?r:void 0}adaptRemoveDiscriminantsFromSchemas(t){if(t!=null)switch(t){case"always":return Un.RemoveDiscriminantsFromSchemas.Always;case"never":return Un.RemoveDiscriminantsFromSchemas.Never;default:return}}adaptMultiServerStrategy(t){if(t!=null)switch(t){case"environmentPerServer":return Un.MultiServerStrategy.EnvironmentPerServer;case"urlsPerEnvironment":return Un.MultiServerStrategy.UrlsPerEnvironment;default:return}}adaptPathParameterOrder(t){if(t!=null)switch(t){case"urlOrder":return Un.PathParameterOrder.UrlOrder;case"specOrder":return Un.PathParameterOrder.SpecOrder;default:return}}adaptDefaultIntegerFormat(t){if(t!=null)switch(t){case"int32":return Un.DefaultIntegerFormat.Int32;case"int64":return Un.DefaultIntegerFormat.Int64;case"uint32":return Un.DefaultIntegerFormat.Uint32;case"uint64":return Un.DefaultIntegerFormat.Uint64;default:return}}adaptExampleGeneration(t){if(t==null)return;let r={};return t.request!=null&&(r.request={"max-depth":t.request.maxDepth}),t.response!=null&&(r.response={"max-depth":t.response.maxDepth}),r}};function zze(e){return"conjure"in e}var t9r=class{context;taskContext;cliVersion;constructor(t){this.context=t.context,this.taskContext=new Cd({context:this.context,task:t.task}),this.cliVersion=t.cliVersion}async validate(t){let r=performance.now(),n=[],i=t.specs.find(Wce);if(i!=null){let a=await this.validateFernSpec(i);return n.push(...a),{violations:n,hasErrors:n.some(c=>c.severity==="fatal"||c.severity==="error"),workspaceRoot:i.fern,elapsedMillis:performance.now()-r}}if(t.specs.find(zze)!=null)return{violations:[],hasErrors:!1,workspaceRoot:this.context.cwd,elapsedMillis:performance.now()-r};let s=await this.validateOssSpecs(t.specs);return n.push(...s),{violations:n,hasErrors:n.some(a=>a.severity==="fatal"||a.severity==="error"),workspaceRoot:this.context.cwd,elapsedMillis:performance.now()-r}}async validateFernSpec(t){let r=[],i=await new JQ({absoluteFilePath:bn(t.fern),context:this.taskContext,cliVersion:this.cliVersion,generatorsConfiguration:void 0,workspaceName:void 0,changelog:void 0}).toFernWorkspace({context:this.taskContext}),o=SLe(i,this.context.stderr);return r.push(...o),r}async validateOssSpecs(t){let r=[],n=t.filter(d=>!Wce(d)&&!zze(d));if(n.length===0)return r;let o=new vst({context:this.context}).convertAll(n),{filteredSpecs:s,allSpecs:a}=e9r(o);if(s.length===0)return r;let c=new _p({specs:s,allSpecs:a,absoluteFilePath:this.context.cwd,cliVersion:this.cliVersion,changelog:void 0,generatorsConfiguration:void 0,workspaceName:void 0}),u=await c.toFernWorkspace({context:this.taskContext}),l=SLe(u,this.context.stderr);r.push(...l);let p=await TIe(c,this.taskContext);return r.push(...p),r}};var Iee=class{context;cliVersion;task;constructor(t){this.context=t.context,this.cliVersion=t.cliVersion,this.task=t.task}async check({workspace:t,apiNames:r,strict:n=!1}){let i=performance.now(),o=new Set,s=new Set,a=r??Object.keys(t.apis);if(a.length===0)return{validApis:o,invalidApis:s,violations:[],errorCount:0,warningCount:0,elapsedMillis:performance.now()-i};let c=new t9r({context:this.context,cliVersion:this.cliVersion,task:this.task}),u=[];for(let p of a){let d=t.apis[p];if(d==null){s.add(p);continue}let f=await c.validate(d);f.hasErrors?s.add(p):o.add(p);let m=d.specs.some(Wce)?"fern":"openapi",h=this.resolveViolationPaths({workspaceRoot:f.workspaceRoot,apiName:p,apiSpecType:m,apiDefinition:d,violations:f.violations});u.push(...h)}let l=this.deduplicateViolations(u);return{...this.countViolations(l),validApis:o,invalidApis:s,violations:n?l:l.filter(p=>p.severity==="fatal"||p.severity==="error"),elapsedMillis:performance.now()-i}}resolveViolationPaths({violations:t,workspaceRoot:r,apiName:n,apiSpecType:i,apiDefinition:o}){return t.map(s=>{let a=i==="fern"?s.message:this.formatOssMessage(s);return{...s,message:a,displayRelativeFilepath:this.resolveDisplayPath({workspaceRoot:r,apiDefinition:o,apiSpecType:i,violation:s}),apiSpecType:i,apiName:n,line:1,column:1}})}formatOssMessage(t){let r=this.stripSyntheticFilePaths(t.message),n=this.formatNodePath(t.nodePath);return n.length===0?r:`${n} - ${r}`}formatNodePath(t){let r=[];for(let n of t)typeof n=="string"?r.push(n):r.push(n.key);return r[0]==="service"&&r.shift(),r.join(" -> ")}resolveDisplayPath({workspaceRoot:t,apiDefinition:r,apiSpecType:n,violation:i}){if(n==="fern"){let o=Ze(t,Fe.of(i.relativeFilepath));return LE(this.context.cwd,o)}return this.resolveOssDisplayPath(r,i)}resolveOssDisplayPath(t,r){let n=t.specs.filter(s=>Hce(s)||RWe(s));if(n.length===0)return r.relativeFilepath;if(n.length>1)for(let s of n){let a=(Hce(s),s.namespace);if(a!=null&&r.relativeFilepath.startsWith(a)){let c=Hce(s)?s.openapi:s.asyncapi;return LE(this.context.cwd,c)}}let i=n[0];if(i==null)return r.relativeFilepath;let o=Hce(i)?i.openapi:i.asyncapi;return LE(this.context.cwd,o)}deduplicateViolations(t){let r=new Set;return t.filter(n=>{let i=`${n.apiName}|${n.displayRelativeFilepath}|${n.severity}|${JSON.stringify(n.nodePath)}|${n.message}`;return r.has(i)?!1:(r.add(i),!0)})}stripSyntheticFilePaths(t){return t.replace(/^(\s*- )\S+\.[a-zA-Z]+ -> /gm,"$1")}countViolations(t){let r=0,n=0;for(let i of t)switch(i.severity){case"fatal":case"error":r++;break;case"warning":n++;break;default:xe(i.severity)}return{errorCount:r,warningCount:n}}};function ai(e,t,r,n,i){e.command(t,r,o=>{let s=o.version(!1).usage(r);return i!=null?i(s):s},XGr(n))}var jWd=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function QWd(e){return e.replace(jWd,"")}function Cee(e,t){let r={severity:e.severity,message:QWd(e.message)};return t?.api!=null&&(r.api=t.api),e.name!=null&&(r.rule=e.name),e.displayRelativeFilepath!=null&&(r.filepath=e.displayRelativeFilepath),e.line!=null&&(r.line=e.line),e.column!=null&&(r.column=e.column),r}var PBo=class{async handle(t,r){let n=await t.loadWorkspaceOrThrow();if(r.api!=null&&n.apis[r.api]==null){let a=Object.keys(n.apis).join(", ");throw new D({message:`API '${r.api}' not found. Available APIs: ${a}`,code:D.Code.ConfigError})}let o=await new Iee({context:t,cliVersion:n.cliVersion}).check({workspace:n,apiNames:r.api!=null?[r.api]:void 0,strict:r.strict}),s=o.invalidApis.size>0||r.strict&&o.warningCount>0;if(r.json){let a=this.buildJsonResponse({apiCheckResult:o,hasErrors:s});if(t.stdout.info(JSON.stringify(a,null,2)),s)throw D.validationError();return}if(o.violations.length>0)for(let a of o.violations){let c=a.severity==="warning"?Ae.yellow:Ae.red;process.stderr.write(`${c(`${a.displayRelativeFilepath}:${a.line}:${a.column}: ${a.message}`)}
|
|
3648
|
-
`)}if(s)throw D.validationError();if(o.warningCount>0){t.stderr.info(`${Nr.warning} ${Ae.yellow(`Found ${o.warningCount} warnings`)}`),t.stderr.info(Ae.dim(" Run 'fern api check --strict' to treat warnings as errors"));return}t.stderr.info(`${Nr.success} ${Ae.green("All checks passed")}`)}buildJsonResponse({apiCheckResult:t,hasErrors:r}){let n={},i=new Set(t.violations.map(o=>o.apiName)).size>1;return t.violations.length>0&&(n.apis=t.violations.map(o=>Cee(o,i?{api:o.apiName}:void 0))),{success:!r,results:n}}};function DBo(e){let t=new PBo;ai(e,"check","Validate API definitions",(r,n)=>t.handle(r,n),r=>r.option("api",{type:"string",description:"Validate a specific API"}).option("strict",{type:"boolean",description:"Treat warnings as errors",default:!1}).option("json",{type:"boolean",description:"Output results as JSON to stdout",default:!1}))}_t();tr();var bUc=require("fs"),r9r=class{parse({absoluteFilePath:t}){let r=(0,bUc.readFileSync)(t,"utf-8"),n=r.match(/option\s+csharp_namespace\s*=\s*"([^"]+)";/),i=r.match(/package\s+([a-zA-Z_][\w.]*);/),o=r.match(/service\s+([a-zA-Z_]\w*)\s*{/);return{csharpNamespace:n?.[1],packageName:i?.[1],serviceName:o?.[1]}}};var Yh=class{context;workspace;sourceCache;constructor(t,r){this.context=t,this.workspace=r,this.sourceCache=new Map}resolveSourceOrThrow({source:t,relativeFilepath:r}){let n=this.resolveSource({source:t});return n==null&&eNe(t)&&this.context.logger.warn(`Cannot resolve source ${t.proto} from file ${r}`),n}resolveSource({source:t}){return eNe(t)?this.resolveProtobufSource({source:t}):this.resolveOpenAPISource({source:t})}resolveProtobufSource({source:t}){let r=Ze(this.workspace.absoluteFilePath,Fe.of(t.proto));if(this.sourceCache.has(r))return this.sourceCache.get(r);if(!rY(r))return;let i=new r9r().parse({absoluteFilePath:r}),o={type:"protobuf",absoluteFilePath:r,relativeFilePath:Fe.of(t.proto),csharpNamespace:i.csharpNamespace,packageName:i.packageName,serviceName:i.serviceName};return this.sourceCache.set(r,o),o}resolveOpenAPISource({source:t}){let r=Ze(this.workspace.absoluteFilePath,Fe.of(t.openapi));if(this.sourceCache.has(r))return this.sourceCache.get(r);if(!rY(r))return;let n={type:"openapi",absoluteFilePath:r,relativeFilePath:Fe.of(t.openapi)};return this.sourceCache.set(r,n),n}};_t();var EUc={"fernapi/fern-cli":"0.0.1","fernapi/fern-csharp-model":"0.0.2","fernapi/fern-csharp-sdk":"0.5.0","fernapi/fern-express":"0.17.3","fernapi/fern-fastapi":"1.1.0-rc0","fernapi/fern-go-model":"0.23.5","fernapi/fern-go-sdk":"0.28.3","fernapi/fern-java-model":"1.3.0","fernapi/fern-java-sdk":"2.5.0","fernapi/fern-openapi":"0.1.0","fernapi/fern-php-model":"0.0.1","fernapi/fern-php-sdk":"0.1.0","fernapi/fern-postman":"0.2.0","fernapi/fern-pydantic":"1.1.0-rc0","fernapi/fern-python-sdk":"3.3.0-rc0","fernapi/fern-ruby-sdk":"1.0.0-rc1","fernapi/fern-rust-model":"0.0.0","fernapi/fern-rust-sdk":"0.0.0","fernapi/fern-spring":"1.3.0","fernapi/fern-swift-sdk":"0.0.0","fernapi/fern-typescript-browser-sdk":"0.38.0-rc0","fernapi/fern-typescript-node-sdk":"0.38.0-rc0","fernapi/fern-typescript-sdk":"0.38.0-rc0"};co();var Mg={};te(Mg,{V53:()=>$s,V54:()=>ea,V55:()=>Ls,V56:()=>Us,V57:()=>Vs,V58:()=>Gs,V59:()=>Hs,V60:()=>Fs,V61:()=>bs,V62:()=>Es,V63:()=>vs,V65:()=>Is,V66:()=>Cs,V67:()=>uo});var $s={};te($s,{AliasTypeDeclaration:()=>IKr,ApiAuth:()=>S9r,ApiDefinitionSource:()=>VHr,ApiDefinitionSourceId:()=>UHr,ApiVersionScheme:()=>GHr,AuthScheme:()=>w9r,AuthSchemesRequirement:()=>x9r,AutogeneratedEndpointExample:()=>XWr,Availability:()=>Fee,AvailabilityStatus:()=>h9r,Base64Type:()=>rKr,BasicAuthScheme:()=>f9r,BearerAuthScheme:()=>d9r,BigIntegerType:()=>nKr,BooleanType:()=>iKr,BytesRequest:()=>$st,Constants:()=>P9r,ContainerType:()=>mat,CsharpProtobufFileOptions:()=>pHr,CursorPagination:()=>ZWr,DateTimeType:()=>oKr,DateType:()=>sKr,Declaration:()=>qw,DeclaredErrorName:()=>swe,DeclaredServiceName:()=>$Wr,DeclaredTypeName:()=>$y,DirectPublish:()=>JHr,DoubleType:()=>cKr,DoubleValidationRules:()=>aKr,Encoding:()=>uat,EndpointId:()=>EH,EndpointName:()=>eHr,EndpointReference:()=>Rst,EnumTypeDeclaration:()=>lat,EnumTypeReference:()=>v_c,EnumValue:()=>Vfe,EnvironmentBaseUrlId:()=>iwe,EnvironmentBaseUrlWithId:()=>uWr,EnvironmentId:()=>owe,EnvironmentUrl:()=>Ust,EnvironmentVariable:()=>ZV,Environments:()=>mWr,EnvironmentsConfig:()=>hWr,ErrorDeclaration:()=>AWr,ErrorDeclarationDiscriminantValue:()=>y_c,ErrorDiscriminationByPropertyStrategy:()=>WHr,ErrorDiscriminationStrategy:()=>HHr,ErrorId:()=>rwe,EscapedString:()=>T9r,ExampleAliasType:()=>uJr,ExampleCodeSample:()=>iHr,ExampleCodeSampleLanguage:()=>tHr,ExampleCodeSampleSdk:()=>nHr,ExampleContainer:()=>fJr,ExampleDatetime:()=>lJr,ExampleEndpointCall:()=>Zst,ExampleEndpointErrorResponse:()=>HWr,ExampleEndpointSuccessResponse:()=>JWr,ExampleEnumType:()=>AJr,ExampleError:()=>gWr,ExampleHeader:()=>qze,ExampleInlinedRequestBody:()=>Xst,ExampleInlinedRequestBodyProperty:()=>GWr,ExampleKeyValuePair:()=>yJr,ExampleListContainer:()=>dJr,ExampleLiteralContainer:()=>pJr,ExampleMapContainer:()=>mJr,ExampleNamedType:()=>bJr,ExampleObjectProperty:()=>EJr,ExampleObjectType:()=>yat,ExampleObjectTypeWithTypeId:()=>vJr,ExampleOptionalContainer:()=>hJr,ExamplePathParameter:()=>awe,ExamplePrimitive:()=>Aat,ExampleQueryParameter:()=>Yst,ExampleQueryParameterShape:()=>qWr,ExampleRequestBody:()=>WWr,ExampleResponse:()=>YWr,ExampleServerSideEvent:()=>KWr,ExampleSetContainer:()=>gJr,ExampleSingleUnionType:()=>IJr,ExampleSingleUnionTypeProperties:()=>CJr,ExampleType:()=>b5t,ExampleTypeReference:()=>Dp,ExampleTypeReferenceShape:()=>wJr,ExampleTypeShape:()=>fat,ExampleUndiscriminatedUnionType:()=>xJr,ExampleUnionType:()=>SJr,ExampleWebSocketMessage:()=>VKr,ExampleWebSocketMessageBody:()=>_Kr,ExampleWebSocketSession:()=>qKr,ExampleWebhookCall:()=>FKr,FeatureId:()=>B9r,FernFilepath:()=>bM,FileDownloadResponse:()=>eat,FileProperty:()=>aHr,FilePropertyArray:()=>oHr,FilePropertySingle:()=>sHr,FileUploadBodyProperty:()=>cHr,FileUploadRequest:()=>lHr,FileUploadRequestProperty:()=>uHr,FloatType:()=>uKr,GithubPublish:()=>YHr,GrpcTransport:()=>mHr,HeaderApiVersionScheme:()=>qHr,HeaderAuthScheme:()=>m9r,HttpEndpoint:()=>QHr,HttpHeader:()=>j2,HttpMethod:()=>Qst,HttpPath:()=>e5,HttpPathPart:()=>hHr,HttpRequestBody:()=>AHr,HttpRequestBodyReference:()=>nat,HttpResponse:()=>SHr,HttpResponseBody:()=>xHr,HttpService:()=>zHr,InlinedRequestBody:()=>gHr,InlinedRequestBodyProperty:()=>tat,InlinedWebSocketMessageBody:()=>WKr,InlinedWebSocketMessageBodyProperty:()=>GKr,InlinedWebhookPayload:()=>QKr,InlinedWebhookPayloadProperty:()=>jKr,IntegerType:()=>pKr,IntegerValidationRules:()=>lKr,IntermediateRepresentation:()=>E_c,JsonEncoding:()=>MHr,JsonResponse:()=>iat,JsonResponseBody:()=>yHr,JsonResponseBodyWithProperty:()=>bHr,JsonStreamChunk:()=>EHr,Literal:()=>aJr,LongType:()=>fKr,MapType:()=>cJr,MultipleBaseUrlsEnvironment:()=>lWr,MultipleBaseUrlsEnvironments:()=>pWr,Name:()=>po,NameAndWireValue:()=>js,NamedType:()=>BJr,NamedTypeDefault:()=>TJr,NonStreamHttpResponseBody:()=>CHr,OAuthAccessTokenRequestProperties:()=>b9r,OAuthAccessTokenResponseProperties:()=>Fst,OAuthClientCredentials:()=>v9r,OAuthConfiguration:()=>I9r,OAuthRefreshEndpoint:()=>y9r,OAuthRefreshTokenRequestProperties:()=>A9r,OAuthScheme:()=>C9r,OAuthTokenEndpoint:()=>E9r,ObjectProperty:()=>k2,ObjectTypeDeclaration:()=>CKr,OffsetPagination:()=>THr,Package:()=>gat,PackageNavigationConfig:()=>$Kr,Pagination:()=>BHr,PathParameter:()=>vH,PathParameterLocation:()=>OHr,PlatformHeaders:()=>rJr,PostmanPublishTarget:()=>KHr,PrimitiveType:()=>dat,PrimitiveTypeV1:()=>zst,PrimitiveTypeV2:()=>yKr,ProtoEncoding:()=>LHr,ProtoSource:()=>_Hr,ProtobufFile:()=>rat,ProtobufFileOptions:()=>fHr,ProtobufService:()=>dHr,ProtobufType:()=>eKr,PublishTarget:()=>pat,PublishingConfig:()=>XHr,QueryParameter:()=>twe,ReadmeConfig:()=>eJr,RequestProperty:()=>N2,RequestPropertyValue:()=>g9r,ResolvedNamedType:()=>EKr,ResolvedTypeReference:()=>vKr,ResponseError:()=>PHr,ResponseErrors:()=>DHr,ResponseProperty:()=>$V,SafeAndUnsafeString:()=>Vze,SdkConfig:()=>nJr,SdkRequest:()=>NHr,SdkRequestBodyType:()=>RHr,SdkRequestShape:()=>kHr,SdkRequestWrapper:()=>FHr,ServiceId:()=>Dee,ServiceTypeReferenceInfo:()=>iJr,ShapeType:()=>bKr,SingleBaseUrlEnvironment:()=>fWr,SingleBaseUrlEnvironments:()=>dWr,SingleUnionType:()=>BKr,SingleUnionTypeProperties:()=>TKr,SingleUnionTypeProperty:()=>SKr,Source:()=>tKr,SourceConfig:()=>oJr,SseStreamChunk:()=>vHr,StreamParameterResponse:()=>wHr,StreamingResponse:()=>oat,StringType:()=>mKr,StringValidationRules:()=>dKr,Subpackage:()=>sJr,SubpackageId:()=>Ree,SupportedSdkLanguage:()=>rHr,TextResponse:()=>sat,TextStreamChunk:()=>IHr,Transport:()=>cat,Type:()=>PKr,TypeDeclaration:()=>DKr,TypeId:()=>iv,TypeReference:()=>lc,Uint64Type:()=>hKr,UintType:()=>gKr,UndiscriminatedUnionMember:()=>wKr,UndiscriminatedUnionTypeDeclaration:()=>xKr,UnionTypeDeclaration:()=>OKr,UserAgent:()=>tJr,UserDefinedProtobufType:()=>ZHr,UserSpecifiedEndpointExample:()=>jHr,UuidType:()=>AKr,VariableDeclaration:()=>RKr,VariableId:()=>aat,WebSocketChannel:()=>ZKr,WebSocketChannelId:()=>Nst,WebSocketMessage:()=>YKr,WebSocketMessageBody:()=>KKr,WebSocketMessageBodyReference:()=>HKr,WebSocketMessageId:()=>hat,WebSocketMessageOrigin:()=>JKr,WebSocketName:()=>XKr,Webhook:()=>zKr,WebhookGroup:()=>UKr,WebhookGroupId:()=>kst,WebhookHttpMethod:()=>kKr,WebhookId:()=>O9r,WebhookName:()=>NKr,WebhookPayload:()=>LKr,WebhookPayloadReference:()=>MKr,WellKnownProtobufType:()=>$Hr,WithDocs:()=>os,WithDocsAndAvailability:()=>nwe,WithJsonExample:()=>kee,auth:()=>$Bo,commons:()=>eOo,constants:()=>tOo,dynamic:()=>EC,environment:()=>cOo,errors:()=>uOo,generatorExec:()=>pOo,http:()=>fOo,ir:()=>dOo,proto:()=>mOo,publish:()=>hOo,types:()=>gOo,variables:()=>AOo,webhooks:()=>yOo,websocket:()=>bOo});var $Bo={};te($Bo,{ApiAuth:()=>S9r,AuthScheme:()=>w9r,AuthSchemesRequirement:()=>x9r,BasicAuthScheme:()=>f9r,BearerAuthScheme:()=>d9r,EnvironmentVariable:()=>ZV,HeaderAuthScheme:()=>m9r,OAuthAccessTokenRequestProperties:()=>b9r,OAuthAccessTokenResponseProperties:()=>Fst,OAuthClientCredentials:()=>v9r,OAuthConfiguration:()=>I9r,OAuthRefreshEndpoint:()=>y9r,OAuthRefreshTokenRequestProperties:()=>A9r,OAuthScheme:()=>C9r,OAuthTokenEndpoint:()=>E9r});var Y={};te(Y,{JsonError:()=>Ist,ParseError:()=>Cst,any:()=>kUc,bigint:()=>IUc,boolean:()=>NUc,booleanLiteral:()=>RUc,date:()=>CUc,discriminant:()=>GUc,enum_:()=>i9r,getObjectLikeUtils:()=>bH,getObjectUtils:()=>Uze,getSchemaUtils:()=>dh,isProperty:()=>_fe,lazy:()=>wUc,lazyObject:()=>PUc,list:()=>s9r,never:()=>jUc,number:()=>QUc,object:()=>o9r,objectWithoutOptionalProperties:()=>OUc,optional:()=>RBo,property:()=>SUc,record:()=>UUc,set:()=>_Uc,string:()=>MUc,stringLiteral:()=>FUc,transform:()=>FBo,undiscriminatedUnion:()=>qUc,union:()=>HUc,unknown:()=>LUc,withParsedProperties:()=>jBo});var vl={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 wm(e,t){return`Expected ${t}. Received ${MWd(e)}.`}function MWd(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function pT(e){return Object.assign(Object.assign({},e),{json:vUc(e.json),parse:vUc(e.parse)})}function vUc(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(`
|
|
3648
|
+
`)}if(s)throw D.validationError();if(o.warningCount>0){t.stderr.info(`${Nr.warning} ${Ae.yellow(`Found ${o.warningCount} warnings`)}`),t.stderr.info(Ae.dim(" Run 'fern api check --strict' to treat warnings as errors"));return}t.stderr.info(`${Nr.success} ${Ae.green("All checks passed")}`)}buildJsonResponse({apiCheckResult:t,hasErrors:r}){let n={},i=new Set(t.violations.map(o=>o.apiName)).size>1;return t.violations.length>0&&(n.apis=t.violations.map(o=>Cee(o,i?{api:o.apiName}:void 0))),{success:!r,results:n}}};function DBo(e){let t=new PBo;ai(e,"check","Validate API definitions",(r,n)=>t.handle(r,n),r=>r.option("api",{type:"string",description:"Validate a specific API"}).option("strict",{type:"boolean",description:"Treat warnings as errors",default:!1}).option("json",{type:"boolean",description:"Output results as JSON to stdout",default:!1}))}_t();tr();var bUc=require("fs"),r9r=class{parse({absoluteFilePath:t}){let r=(0,bUc.readFileSync)(t,"utf-8"),n=r.match(/option\s+csharp_namespace\s*=\s*"([^"]+)";/),i=r.match(/package\s+([a-zA-Z_][\w.]*);/),o=r.match(/service\s+([a-zA-Z_]\w*)\s*{/);return{csharpNamespace:n?.[1],packageName:i?.[1],serviceName:o?.[1]}}};var Yh=class{context;workspace;sourceCache;constructor(t,r){this.context=t,this.workspace=r,this.sourceCache=new Map}resolveSourceOrThrow({source:t,relativeFilepath:r}){let n=this.resolveSource({source:t});return n==null&&eNe(t)&&this.context.logger.warn(`Cannot resolve source ${t.proto} from file ${r}`),n}resolveSource({source:t}){return eNe(t)?this.resolveProtobufSource({source:t}):this.resolveOpenAPISource({source:t})}resolveProtobufSource({source:t}){let r=Ze(this.workspace.absoluteFilePath,Fe.of(t.proto));if(this.sourceCache.has(r))return this.sourceCache.get(r);if(!rY(r))return;let i=new r9r().parse({absoluteFilePath:r}),o={type:"protobuf",absoluteFilePath:r,relativeFilePath:Fe.of(t.proto),csharpNamespace:i.csharpNamespace,packageName:i.packageName,serviceName:i.serviceName};return this.sourceCache.set(r,o),o}resolveOpenAPISource({source:t}){let r=Ze(this.workspace.absoluteFilePath,Fe.of(t.openapi));if(this.sourceCache.has(r))return this.sourceCache.get(r);if(!rY(r))return;let n={type:"openapi",absoluteFilePath:r,relativeFilePath:Fe.of(t.openapi)};return this.sourceCache.set(r,n),n}};_t();var EUc={"fernapi/fern-cli-generator":"0.0.1","fernapi/fern-csharp-model":"0.0.2","fernapi/fern-csharp-sdk":"0.5.0","fernapi/fern-express":"0.17.3","fernapi/fern-fastapi":"1.1.0-rc0","fernapi/fern-go-model":"0.23.5","fernapi/fern-go-sdk":"0.28.3","fernapi/fern-java-model":"1.3.0","fernapi/fern-java-sdk":"2.5.0","fernapi/fern-openapi":"0.1.0","fernapi/fern-php-model":"0.0.1","fernapi/fern-php-sdk":"0.1.0","fernapi/fern-postman":"0.2.0","fernapi/fern-pydantic":"1.1.0-rc0","fernapi/fern-python-sdk":"3.3.0-rc0","fernapi/fern-ruby-sdk":"1.0.0-rc1","fernapi/fern-rust-model":"0.0.0","fernapi/fern-rust-sdk":"0.0.0","fernapi/fern-spring":"1.3.0","fernapi/fern-swift-sdk":"0.0.0","fernapi/fern-typescript-browser-sdk":"0.38.0-rc0","fernapi/fern-typescript-node-sdk":"0.38.0-rc0","fernapi/fern-typescript-sdk":"0.38.0-rc0"};co();var Mg={};te(Mg,{V53:()=>$s,V54:()=>ea,V55:()=>Ls,V56:()=>Us,V57:()=>Vs,V58:()=>Gs,V59:()=>Hs,V60:()=>Fs,V61:()=>bs,V62:()=>Es,V63:()=>vs,V65:()=>Is,V66:()=>Cs,V67:()=>uo});var $s={};te($s,{AliasTypeDeclaration:()=>IKr,ApiAuth:()=>S9r,ApiDefinitionSource:()=>VHr,ApiDefinitionSourceId:()=>UHr,ApiVersionScheme:()=>GHr,AuthScheme:()=>w9r,AuthSchemesRequirement:()=>x9r,AutogeneratedEndpointExample:()=>XWr,Availability:()=>Fee,AvailabilityStatus:()=>h9r,Base64Type:()=>rKr,BasicAuthScheme:()=>f9r,BearerAuthScheme:()=>d9r,BigIntegerType:()=>nKr,BooleanType:()=>iKr,BytesRequest:()=>$st,Constants:()=>P9r,ContainerType:()=>mat,CsharpProtobufFileOptions:()=>pHr,CursorPagination:()=>ZWr,DateTimeType:()=>oKr,DateType:()=>sKr,Declaration:()=>qw,DeclaredErrorName:()=>swe,DeclaredServiceName:()=>$Wr,DeclaredTypeName:()=>$y,DirectPublish:()=>JHr,DoubleType:()=>cKr,DoubleValidationRules:()=>aKr,Encoding:()=>uat,EndpointId:()=>EH,EndpointName:()=>eHr,EndpointReference:()=>Rst,EnumTypeDeclaration:()=>lat,EnumTypeReference:()=>v_c,EnumValue:()=>Vfe,EnvironmentBaseUrlId:()=>iwe,EnvironmentBaseUrlWithId:()=>uWr,EnvironmentId:()=>owe,EnvironmentUrl:()=>Ust,EnvironmentVariable:()=>ZV,Environments:()=>mWr,EnvironmentsConfig:()=>hWr,ErrorDeclaration:()=>AWr,ErrorDeclarationDiscriminantValue:()=>y_c,ErrorDiscriminationByPropertyStrategy:()=>WHr,ErrorDiscriminationStrategy:()=>HHr,ErrorId:()=>rwe,EscapedString:()=>T9r,ExampleAliasType:()=>uJr,ExampleCodeSample:()=>iHr,ExampleCodeSampleLanguage:()=>tHr,ExampleCodeSampleSdk:()=>nHr,ExampleContainer:()=>fJr,ExampleDatetime:()=>lJr,ExampleEndpointCall:()=>Zst,ExampleEndpointErrorResponse:()=>HWr,ExampleEndpointSuccessResponse:()=>JWr,ExampleEnumType:()=>AJr,ExampleError:()=>gWr,ExampleHeader:()=>qze,ExampleInlinedRequestBody:()=>Xst,ExampleInlinedRequestBodyProperty:()=>GWr,ExampleKeyValuePair:()=>yJr,ExampleListContainer:()=>dJr,ExampleLiteralContainer:()=>pJr,ExampleMapContainer:()=>mJr,ExampleNamedType:()=>bJr,ExampleObjectProperty:()=>EJr,ExampleObjectType:()=>yat,ExampleObjectTypeWithTypeId:()=>vJr,ExampleOptionalContainer:()=>hJr,ExamplePathParameter:()=>awe,ExamplePrimitive:()=>Aat,ExampleQueryParameter:()=>Yst,ExampleQueryParameterShape:()=>qWr,ExampleRequestBody:()=>WWr,ExampleResponse:()=>YWr,ExampleServerSideEvent:()=>KWr,ExampleSetContainer:()=>gJr,ExampleSingleUnionType:()=>IJr,ExampleSingleUnionTypeProperties:()=>CJr,ExampleType:()=>b5t,ExampleTypeReference:()=>Dp,ExampleTypeReferenceShape:()=>wJr,ExampleTypeShape:()=>fat,ExampleUndiscriminatedUnionType:()=>xJr,ExampleUnionType:()=>SJr,ExampleWebSocketMessage:()=>VKr,ExampleWebSocketMessageBody:()=>_Kr,ExampleWebSocketSession:()=>qKr,ExampleWebhookCall:()=>FKr,FeatureId:()=>B9r,FernFilepath:()=>bM,FileDownloadResponse:()=>eat,FileProperty:()=>aHr,FilePropertyArray:()=>oHr,FilePropertySingle:()=>sHr,FileUploadBodyProperty:()=>cHr,FileUploadRequest:()=>lHr,FileUploadRequestProperty:()=>uHr,FloatType:()=>uKr,GithubPublish:()=>YHr,GrpcTransport:()=>mHr,HeaderApiVersionScheme:()=>qHr,HeaderAuthScheme:()=>m9r,HttpEndpoint:()=>QHr,HttpHeader:()=>j2,HttpMethod:()=>Qst,HttpPath:()=>e5,HttpPathPart:()=>hHr,HttpRequestBody:()=>AHr,HttpRequestBodyReference:()=>nat,HttpResponse:()=>SHr,HttpResponseBody:()=>xHr,HttpService:()=>zHr,InlinedRequestBody:()=>gHr,InlinedRequestBodyProperty:()=>tat,InlinedWebSocketMessageBody:()=>WKr,InlinedWebSocketMessageBodyProperty:()=>GKr,InlinedWebhookPayload:()=>QKr,InlinedWebhookPayloadProperty:()=>jKr,IntegerType:()=>pKr,IntegerValidationRules:()=>lKr,IntermediateRepresentation:()=>E_c,JsonEncoding:()=>MHr,JsonResponse:()=>iat,JsonResponseBody:()=>yHr,JsonResponseBodyWithProperty:()=>bHr,JsonStreamChunk:()=>EHr,Literal:()=>aJr,LongType:()=>fKr,MapType:()=>cJr,MultipleBaseUrlsEnvironment:()=>lWr,MultipleBaseUrlsEnvironments:()=>pWr,Name:()=>po,NameAndWireValue:()=>js,NamedType:()=>BJr,NamedTypeDefault:()=>TJr,NonStreamHttpResponseBody:()=>CHr,OAuthAccessTokenRequestProperties:()=>b9r,OAuthAccessTokenResponseProperties:()=>Fst,OAuthClientCredentials:()=>v9r,OAuthConfiguration:()=>I9r,OAuthRefreshEndpoint:()=>y9r,OAuthRefreshTokenRequestProperties:()=>A9r,OAuthScheme:()=>C9r,OAuthTokenEndpoint:()=>E9r,ObjectProperty:()=>k2,ObjectTypeDeclaration:()=>CKr,OffsetPagination:()=>THr,Package:()=>gat,PackageNavigationConfig:()=>$Kr,Pagination:()=>BHr,PathParameter:()=>vH,PathParameterLocation:()=>OHr,PlatformHeaders:()=>rJr,PostmanPublishTarget:()=>KHr,PrimitiveType:()=>dat,PrimitiveTypeV1:()=>zst,PrimitiveTypeV2:()=>yKr,ProtoEncoding:()=>LHr,ProtoSource:()=>_Hr,ProtobufFile:()=>rat,ProtobufFileOptions:()=>fHr,ProtobufService:()=>dHr,ProtobufType:()=>eKr,PublishTarget:()=>pat,PublishingConfig:()=>XHr,QueryParameter:()=>twe,ReadmeConfig:()=>eJr,RequestProperty:()=>N2,RequestPropertyValue:()=>g9r,ResolvedNamedType:()=>EKr,ResolvedTypeReference:()=>vKr,ResponseError:()=>PHr,ResponseErrors:()=>DHr,ResponseProperty:()=>$V,SafeAndUnsafeString:()=>Vze,SdkConfig:()=>nJr,SdkRequest:()=>NHr,SdkRequestBodyType:()=>RHr,SdkRequestShape:()=>kHr,SdkRequestWrapper:()=>FHr,ServiceId:()=>Dee,ServiceTypeReferenceInfo:()=>iJr,ShapeType:()=>bKr,SingleBaseUrlEnvironment:()=>fWr,SingleBaseUrlEnvironments:()=>dWr,SingleUnionType:()=>BKr,SingleUnionTypeProperties:()=>TKr,SingleUnionTypeProperty:()=>SKr,Source:()=>tKr,SourceConfig:()=>oJr,SseStreamChunk:()=>vHr,StreamParameterResponse:()=>wHr,StreamingResponse:()=>oat,StringType:()=>mKr,StringValidationRules:()=>dKr,Subpackage:()=>sJr,SubpackageId:()=>Ree,SupportedSdkLanguage:()=>rHr,TextResponse:()=>sat,TextStreamChunk:()=>IHr,Transport:()=>cat,Type:()=>PKr,TypeDeclaration:()=>DKr,TypeId:()=>iv,TypeReference:()=>lc,Uint64Type:()=>hKr,UintType:()=>gKr,UndiscriminatedUnionMember:()=>wKr,UndiscriminatedUnionTypeDeclaration:()=>xKr,UnionTypeDeclaration:()=>OKr,UserAgent:()=>tJr,UserDefinedProtobufType:()=>ZHr,UserSpecifiedEndpointExample:()=>jHr,UuidType:()=>AKr,VariableDeclaration:()=>RKr,VariableId:()=>aat,WebSocketChannel:()=>ZKr,WebSocketChannelId:()=>Nst,WebSocketMessage:()=>YKr,WebSocketMessageBody:()=>KKr,WebSocketMessageBodyReference:()=>HKr,WebSocketMessageId:()=>hat,WebSocketMessageOrigin:()=>JKr,WebSocketName:()=>XKr,Webhook:()=>zKr,WebhookGroup:()=>UKr,WebhookGroupId:()=>kst,WebhookHttpMethod:()=>kKr,WebhookId:()=>O9r,WebhookName:()=>NKr,WebhookPayload:()=>LKr,WebhookPayloadReference:()=>MKr,WellKnownProtobufType:()=>$Hr,WithDocs:()=>os,WithDocsAndAvailability:()=>nwe,WithJsonExample:()=>kee,auth:()=>$Bo,commons:()=>eOo,constants:()=>tOo,dynamic:()=>EC,environment:()=>cOo,errors:()=>uOo,generatorExec:()=>pOo,http:()=>fOo,ir:()=>dOo,proto:()=>mOo,publish:()=>hOo,types:()=>gOo,variables:()=>AOo,webhooks:()=>yOo,websocket:()=>bOo});var $Bo={};te($Bo,{ApiAuth:()=>S9r,AuthScheme:()=>w9r,AuthSchemesRequirement:()=>x9r,BasicAuthScheme:()=>f9r,BearerAuthScheme:()=>d9r,EnvironmentVariable:()=>ZV,HeaderAuthScheme:()=>m9r,OAuthAccessTokenRequestProperties:()=>b9r,OAuthAccessTokenResponseProperties:()=>Fst,OAuthClientCredentials:()=>v9r,OAuthConfiguration:()=>I9r,OAuthRefreshEndpoint:()=>y9r,OAuthRefreshTokenRequestProperties:()=>A9r,OAuthScheme:()=>C9r,OAuthTokenEndpoint:()=>E9r});var Y={};te(Y,{JsonError:()=>Ist,ParseError:()=>Cst,any:()=>kUc,bigint:()=>IUc,boolean:()=>NUc,booleanLiteral:()=>RUc,date:()=>CUc,discriminant:()=>GUc,enum_:()=>i9r,getObjectLikeUtils:()=>bH,getObjectUtils:()=>Uze,getSchemaUtils:()=>dh,isProperty:()=>_fe,lazy:()=>wUc,lazyObject:()=>PUc,list:()=>s9r,never:()=>jUc,number:()=>QUc,object:()=>o9r,objectWithoutOptionalProperties:()=>OUc,optional:()=>RBo,property:()=>SUc,record:()=>UUc,set:()=>_Uc,string:()=>MUc,stringLiteral:()=>FUc,transform:()=>FBo,undiscriminatedUnion:()=>qUc,union:()=>HUc,unknown:()=>LUc,withParsedProperties:()=>jBo});var vl={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 wm(e,t){return`Expected ${t}. Received ${MWd(e)}.`}function MWd(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function pT(e){return Object.assign(Object.assign({},e),{json:vUc(e.json),parse:vUc(e.parse)})}function vUc(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(`
|
|
3649
3649
|
`)),{ok:!0,value:t}):n}}function n9r(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var Ist=class e extends Error{constructor(t){super(t.map(n9r).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var Cst=class e extends Error{constructor(t){super(t.map(n9r).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function dh(e){return{nullable:()=>LWd(e),optional:()=>RBo(e),optionalNullable:()=>zWd(e),transform:t=>FBo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new Cst(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new Ist(n.errors)}}}function LWd(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:()=>vl.NULLABLE};return Object.assign(Object.assign({},t),dh(t))}function RBo(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:()=>vl.OPTIONAL};return Object.assign(Object.assign({},t),dh(t))}function zWd(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:()=>vl.OPTIONAL_NULLABLE};return Object.assign(Object.assign({},t),dh(t))}function FBo(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 Object.assign(Object.assign({},r),dh(r))}function IUc(){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:wm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:wm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>vl.BIGINT};return Object.assign(Object.assign({},pT(e)),dh(e))}var UWd=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function CUc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:wm(t,"string")}]}:UWd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:wm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:wm(t,"Date object")}]},getType:()=>vl.DATE};return Object.assign(Object.assign({},pT(e)),dh(e))}function fT(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return Object.assign(Object.assign({},pT(r)),dh(r))}}function i9r(e){let t=new Set(e);return fT(vl.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:wm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:wm(n,"enum")}]}:{ok:!0,value:n})()}function wUc(e){let t=kBo(e);return Object.assign(Object.assign({},t),dh(t))}function kBo(e){return{parse:(t,r)=>wst(e).parse(t,r),json:(t,r)=>wst(e).json(t,r),getType:()=>wst(e).getType()}}function wst(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function NBo(e){return Object.entries(e)}function g5t(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}function Ufe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}function A5t(e){return Object.keys(e)}function xUc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var _Wd=Object.prototype.hasOwnProperty;function bH(e){return{withParsedProperties:t=>jBo(e,t)}}function jBo(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(_Wd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:Object.assign(Object.assign({},o.value),s)}},json:(n,i)=>{var o;if(!Ufe(n))return{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:wm(n,"object")}]};let s=new Set(Object.keys(t)),a=g5t(n,Object.keys(n).filter(c=>!s.has(c)));return e.json(a,i)},getType:()=>e.getType()};return Object.assign(Object.assign(Object.assign({},r),dh(r)),bH(r))}function SUc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function _fe(e){return e.isProperty}var VWd=Object.prototype.hasOwnProperty;function o9r(e){let t;function r(){if(t==null){t={};for(let[d,f]of NBo(e)){let m=_fe(f)?f.rawKey:d,h=_fe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:h}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of NBo(e)){let m=_fe(f)?f.rawKey:d,h=_fe(f)?f.valueSchema:f;qWd(h)&&(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])=>_fe(f)?f.rawKey:d),_getParsedProperties:()=>A5t(e),parse:(d,f)=>{var m;let h=(m=f?.breadcrumbsPrefix)!==null&&m!==void 0?m:[];return TUc({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:A=>{let y=r()[A];if(y!=null)return{transformedKey:y.parsedKey,transform:I=>{let w=[...h,A];return y.valueSchema.parse(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:h,omitUndefined:f?.omitUndefined})},json:(d,f)=>{var m;let h=(m=f?.breadcrumbsPrefix)!==null&&m!==void 0?m:[];return TUc({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:A=>{let y=e[A];if(y!=null)return _fe(y)?{transformedKey:y.rawKey,transform:I=>{let w=[...h,A];return y.valueSchema.json(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}:{transformedKey:A,transform:I=>{let w=[...h,A];return y.json(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:h,omitUndefined:f?.omitUndefined})},getType:()=>vl.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},pT(p)),dh(p)),bH(p)),Uze(p))}function TUc({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Ufe(e))return{ok:!1,errors:[{path:s,message:wm(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!VWd.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 Uze(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>BUc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>BUc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>vl.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},r),dh(r)),bH(r)),Uze(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,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},json:(i,o)=>{let s=e.json(i,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},getType:()=>vl.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},n),dh(n)),bH(n)),Uze(n))}}}function BUc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Ufe(t))return{ok:!1,errors:[{path:i,message:wm(t,"object")}]};let o=new Set(e),[s,a]=xUc(A5t(t),l=>o.has(l)),c=r(g5t(t,a)),u=n(g5t(t,s));return c.ok&&u.ok?{ok:!0,value:Object.assign(Object.assign({},c.value),u.value)}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function qWd(e){return!GWd(e)}function GWd(e){switch(e.getType()){case vl.ANY:case vl.UNKNOWN:case vl.OPTIONAL:case vl.OPTIONAL_NULLABLE:return!0;default:return!1}}function OUc(e){return o9r(e)}function PUc(e){let t=Object.assign(Object.assign({},kBo(e)),{_getRawProperties:()=>wst(e)._getRawProperties(),_getParsedProperties:()=>wst(e)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},t),dh(t)),bH(t)),Uze(t))}function s9r(e){let t={parse:(r,n)=>DUc(r,(i,o)=>{var s;return e.parse(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),json:(r,n)=>DUc(r,(i,o)=>{var s;return e.json(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),getType:()=>vl.LIST};return Object.assign(Object.assign({},pT(t)),dh(t))}function DUc(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:wm(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}}function RUc(e){return fT(vl.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:wm(r,`${e.toString()}`)}]})()}function FUc(e){return fT(vl.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:wm(r,`"${e}"`)}]})()}var kUc=fT(vl.ANY,e=>({ok:!0,value:e}));var NUc=fT(vl.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:wm(e,"boolean")}]});var jUc=fT(vl.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}));var QUc=fT(vl.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:wm(e,"number")}]});var MUc=fT(vl.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:wm(e,"string")}]});var LUc=fT(vl.UNKNOWN,e=>({ok:!0,value:e}));var WWd=Object.prototype.hasOwnProperty;function UUc(e,t){let r={parse:(n,i)=>zUc({value:n,isKeyNumeric:e.getType()===vl.NUMBER,transformKey:o=>{var s;return e.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>zUc({value:n,isKeyNumeric:e.getType()===vl.NUMBER,transformKey:o=>{var s;return e.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>vl.RECORD};return Object.assign(Object.assign({},pT(r)),dh(r))}function zUc({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Ufe(e))return{ok:!1,errors:[{path:i,message:wm(e,"object")}]};let o={},s=[];for(let a in e){if(!WWd.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}}function _Uc(e){let t=s9r(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)=>{var o;return n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:wm(n,"Set")}]}},getType:()=>vl.SET};return Object.assign(Object.assign({},pT(r)),dh(r))}function qUc(e){let t={parse:(r,n)=>VUc((i,o)=>i.parse(r,o),e,n),json:(r,n)=>VUc((i,o)=>i.json(r,o),e,n),getType:()=>vl.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},pT(t)),dh(t))}function VUc(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,Object.assign(Object.assign({},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}}function GUc(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var HWd=Object.prototype.hasOwnProperty;function HUc(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=i9r(A5t(t)),o={parse:(s,a)=>WUc({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>{var u;return i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],r]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>WUc({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>{var u;return i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],n]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>vl.UNION};return Object.assign(Object.assign(Object.assign({},pT(o)),dh(o)),bH(o))}function WUc({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Ufe(e))return{ok:!1,errors:[{path:a,message:wm(e,"object")}]};let c=e[t],u={};for(let f in e)HWd.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:Object.assign({[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:Object.assign({[r]:c},d.value)}:d}var os=Y.objectWithoutOptionalProperties({docs:Y.string().optional()});var En={};te(En,{ApiDefinitionSource:()=>HCe,ApiVersionScheme:()=>Tst,AuthScheme:()=>HV,AuthSchemesRequirement:()=>a9r,AvailabilityStatus:()=>Sst,ContainerType:()=>hM,Environments:()=>kCe,ErrorDeclarationDiscriminantValue:()=>NCe,ErrorDiscriminationStrategy:()=>KCe,ExampleCodeSample:()=>jCe,ExampleContainer:()=>gM,ExampleEndpointSuccessResponse:()=>wee,ExamplePrimitive:()=>gg,ExampleQueryParameterShape:()=>xee,ExampleRequestBody:()=>QCe,ExampleResponse:()=>MCe,ExampleSingleUnionTypeProperties:()=>Oee,ExampleTypeReferenceShape:()=>JV,ExampleTypeShape:()=>AM,ExampleWebSocketMessageBody:()=>$Ce,FileProperty:()=>LCe,FileUploadRequestProperty:()=>zCe,HttpMethod:()=>_ze,HttpRequestBody:()=>KV,HttpResponseBody:()=>mM,JsonResponse:()=>UCe,Literal:()=>XCe,NamedTypeDefault:()=>Ost,NonStreamHttpResponseBody:()=>See,OAuthConfiguration:()=>xst,Pagination:()=>_Ce,PathParameterLocation:()=>y5t,PrimitiveTypeV1:()=>F2,PrimitiveTypeV2:()=>Ag,ProtobufType:()=>JCe,PublishTarget:()=>Bst,PublishingConfig:()=>YCe,RequestPropertyValue:()=>VCe,ResolvedTypeReference:()=>YV,SdkRequestBodyType:()=>qCe,SdkRequestShape:()=>GCe,ShapeType:()=>Pst,SingleUnionTypeProperties:()=>Pee,Source:()=>Dst,StreamingResponse:()=>Tee,SupportedSdkLanguage:()=>Bee,Transport:()=>WCe,Type:()=>yM,TypeReference:()=>XV,WebSocketMessageBody:()=>ewe,WebSocketMessageOrigin:()=>p9r,WebhookHttpMethod:()=>l9r,WebhookPayload:()=>ZCe,WellKnownProtobufType:()=>la,auth:()=>QBo,commons:()=>MBo,constants:()=>KUc,dynamic:()=>Ti,environment:()=>VBo,errors:()=>qBo,generatorExec:()=>tu,http:()=>WBo,ir:()=>HBo,proto:()=>KBo,publish:()=>JBo,types:()=>YBo,variables:()=>d_c,webhooks:()=>XBo,websocket:()=>ZBo});var QBo={};te(QBo,{AuthScheme:()=>HV,AuthSchemesRequirement:()=>a9r,OAuthConfiguration:()=>xst});var HV={bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return HV._visit(this,t)}}),basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return HV._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return HV._visit(this,t)}}),oauth:e=>Object.assign(Object.assign({},e),{type:"oauth",_visit:function(t){return HV._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bearer":return t.bearer(e);case"basic":return t.basic(e);case"header":return t.header(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var KWd={All:"ALL",Any:"ANY"},a9r=Object.assign(Object.assign({},KWd),{_visit:(e,t)=>{switch(e){case a9r.All:return t.all();case a9r.Any:return t.any();default:return t._other()}}});var xst={clientCredentials:e=>Object.assign(Object.assign({},e),{type:"clientCredentials",_visit:function(t){return xst._visit(this,t)}}),_visit:(e,t)=>e.type==="clientCredentials"?t.clientCredentials(e):t._other(e)};var MBo={};te(MBo,{AvailabilityStatus:()=>Sst});var JWd={InDevelopment:"IN_DEVELOPMENT",PreRelease:"PRE_RELEASE",GeneralAvailability:"GENERAL_AVAILABILITY",Deprecated:"DEPRECATED"},Sst=Object.assign(Object.assign({},JWd),{_visit:(e,t)=>{switch(e){case Sst.InDevelopment:return t.inDevelopment();case Sst.PreRelease:return t.preRelease();case Sst.GeneralAvailability:return t.generalAvailability();case Sst.Deprecated:return t.deprecated();default:return t._other()}}});var KUc={};var Ti={};te(Ti,{Auth:()=>JUc,AuthValues:()=>YUc,ErrorSeverity:()=>c9r,FileUploadRequestBodyProperty:()=>ZUc,InlinedRequestBody:()=>$Uc,LiteralType:()=>i_c,NamedType:()=>o_c,ReferencedRequestBodyType:()=>e_c,Request:()=>t_c,Response:()=>r_c,SingleDiscriminatedUnionType:()=>s_c,TypeReference:()=>a_c,auth:()=>LBo,declaration:()=>XUc,endpoints:()=>zBo,ir:()=>n_c,snippets:()=>UBo,types:()=>_Bo});var LBo={};te(LBo,{Auth:()=>JUc,AuthValues:()=>YUc});var JUc={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return Ti.Auth._visit(this,t)}}),bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return Ti.Auth._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Ti.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);default:return t._other(e)}}};var YUc={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return Ti.AuthValues._visit(this,t)}}),bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return Ti.AuthValues._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Ti.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);default:return t._other(e)}}};var XUc={};var zBo={};te(zBo,{FileUploadRequestBodyProperty:()=>ZUc,InlinedRequestBody:()=>$Uc,ReferencedRequestBodyType:()=>e_c,Request:()=>t_c,Response:()=>r_c});var ZUc={file:e=>Object.assign(Object.assign({},e),{type:"file",_visit:function(t){return Ti.FileUploadRequestBodyProperty._visit(this,t)}}),fileArray:e=>Object.assign(Object.assign({},e),{type:"fileArray",_visit:function(t){return Ti.FileUploadRequestBodyProperty._visit(this,t)}}),bodyProperty:e=>Object.assign(Object.assign({},e),{type:"bodyProperty",_visit:function(t){return Ti.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 $Uc={properties:e=>({value:e,type:"properties",_visit:function(t){return Ti.InlinedRequestBody._visit(this,t)}}),referenced:e=>Object.assign(Object.assign({},e),{type:"referenced",_visit:function(t){return Ti.InlinedRequestBody._visit(this,t)}}),fileUpload:e=>Object.assign(Object.assign({},e),{type:"fileUpload",_visit:function(t){return Ti.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 e_c={bytes:()=>({type:"bytes",_visit:function(e){return Ti.ReferencedRequestBodyType._visit(this,e)}}),typeReference:e=>({value:e,type:"typeReference",_visit:function(t){return Ti.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 t_c={body:e=>Object.assign(Object.assign({},e),{type:"body",_visit:function(t){return Ti.Request._visit(this,t)}}),inlined:e=>Object.assign(Object.assign({},e),{type:"inlined",_visit:function(t){return Ti.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 r_c={json:()=>({type:"json",_visit:function(e){return Ti.Response._visit(this,e)}}),_visit:(e,t)=>e.type==="json"?t.json():t._other(e)};var n_c={};var UBo={};te(UBo,{ErrorSeverity:()=>c9r});var YWd={Critical:"CRITICAL",Warning:"WARNING"},c9r=Object.assign(Object.assign({},YWd),{_visit:(e,t)=>{switch(e){case c9r.Critical:return t.critical();case c9r.Warning:return t.warning();default:return t._other()}}});var _Bo={};te(_Bo,{LiteralType:()=>i_c,NamedType:()=>o_c,SingleDiscriminatedUnionType:()=>s_c,TypeReference:()=>a_c});var i_c={boolean:e=>({value:e,type:"boolean",_visit:function(t){return Ti.LiteralType._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Ti.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 o_c={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return Ti.NamedType._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return Ti.NamedType._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return Ti.NamedType._visit(this,t)}}),discriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"discriminatedUnion",_visit:function(t){return Ti.NamedType._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return Ti.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 s_c={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{type:"samePropertiesAsObject",_visit:function(t){return Ti.SingleDiscriminatedUnionType._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{type:"singleProperty",_visit:function(t){return Ti.SingleDiscriminatedUnionType._visit(this,t)}}),noProperties:e=>Object.assign(Object.assign({},e),{type:"noProperties",_visit:function(t){return Ti.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 a_c={list:e=>({value:e,type:"list",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),named:e=>({value:e,type:"named",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),optional:e=>({value:e,type:"optional",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),primitive:e=>({value:e,type:"primitive",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),set:e=>({value:e,type:"set",_visit:function(t){return Ti.TypeReference._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return Ti.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"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 VBo={};te(VBo,{Environments:()=>kCe});var kCe={singleBaseUrl:e=>Object.assign(Object.assign({},e),{type:"singleBaseUrl",_visit:function(t){return kCe._visit(this,t)}}),multipleBaseUrls:e=>Object.assign(Object.assign({},e),{type:"multipleBaseUrls",_visit:function(t){return kCe._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 qBo={};te(qBo,{ErrorDeclarationDiscriminantValue:()=>NCe});var NCe={property:e=>Object.assign(Object.assign({},e),{type:"property",_visit:function(t){return NCe._visit(this,t)}}),statusCode:()=>({type:"statusCode",_visit:function(e){return NCe._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"property":return t.property(e);case"statusCode":return t.statusCode();default:return t._other(e)}}};var tu={};te(tu,{GeneratorEnvironment:()=>c_c,GeneratorPublishTarget:()=>u_c,GithubPublishInfo:()=>l_c,LicenseConfig:()=>p_c,LicenseId:()=>u9r,OutputMode:()=>f_c,config:()=>GBo});var GBo={};te(GBo,{GeneratorEnvironment:()=>c_c,GeneratorPublishTarget:()=>u_c,GithubPublishInfo:()=>l_c,LicenseConfig:()=>p_c,LicenseId:()=>u9r,OutputMode:()=>f_c});var c_c={local:()=>({type:"local",_visit:function(e){return tu.GeneratorEnvironment._visit(this,e)}}),remote:e=>Object.assign(Object.assign({},e),{type:"remote",_visit:function(t){return tu.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 u_c={maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return tu.GeneratorPublishTarget._visit(this,t)}}),npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return tu.GeneratorPublishTarget._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return tu.GeneratorPublishTarget._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return tu.GeneratorPublishTarget._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return tu.GeneratorPublishTarget._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return tu.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);default:return t._other(e)}}};var l_c={npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return tu.GithubPublishInfo._visit(this,t)}}),maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return tu.GithubPublishInfo._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return tu.GithubPublishInfo._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return tu.GithubPublishInfo._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return tu.GithubPublishInfo._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return tu.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);default:return t._other(e)}}};var p_c={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return tu.LicenseConfig._visit(this,t)}}),custom:e=>Object.assign(Object.assign({},e),{type:"custom",_visit:function(t){return tu.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 XWd={Mit:"MIT",Apache2:"Apache-2.0"},u9r=Object.assign(Object.assign({},XWd),{_visit:(e,t)=>{switch(e){case u9r.Mit:return t.mit();case u9r.Apache2:return t.apache2();default:return t._other()}}});var f_c={publish:e=>Object.assign(Object.assign({},e),{type:"publish",_visit:function(t){return tu.OutputMode._visit(this,t)}}),downloadFiles:()=>({type:"downloadFiles",_visit:function(e){return tu.OutputMode._visit(this,e)}}),github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return tu.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 WBo={};te(WBo,{ExampleCodeSample:()=>jCe,ExampleEndpointSuccessResponse:()=>wee,ExampleQueryParameterShape:()=>xee,ExampleRequestBody:()=>QCe,ExampleResponse:()=>MCe,FileProperty:()=>LCe,FileUploadRequestProperty:()=>zCe,HttpMethod:()=>_ze,HttpRequestBody:()=>KV,HttpResponseBody:()=>mM,JsonResponse:()=>UCe,NonStreamHttpResponseBody:()=>See,Pagination:()=>_Ce,PathParameterLocation:()=>y5t,RequestPropertyValue:()=>VCe,SdkRequestBodyType:()=>qCe,SdkRequestShape:()=>GCe,StreamingResponse:()=>Tee,SupportedSdkLanguage:()=>Bee,Transport:()=>WCe});var jCe={language:e=>Object.assign(Object.assign({},e),{type:"language",_visit:function(t){return jCe._visit(this,t)}}),sdk:e=>Object.assign(Object.assign({},e),{type:"sdk",_visit:function(t){return jCe._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 wee={body:e=>({value:e,type:"body",_visit:function(t){return wee._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return wee._visit(this,t)}}),sse:e=>({value:e,type:"sse",_visit:function(t){return wee._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 xee={single:()=>({type:"single",_visit:function(e){return xee._visit(this,e)}}),exploded:()=>({type:"exploded",_visit:function(e){return xee._visit(this,e)}}),commaSeparated:()=>({type:"commaSeparated",_visit:function(e){return xee._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 QCe={inlinedRequestBody:e=>Object.assign(Object.assign({},e),{type:"inlinedRequestBody",_visit:function(t){return QCe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return QCe._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 MCe={ok:e=>({value:e,type:"ok",_visit:function(t){return MCe._visit(this,t)}}),error:e=>Object.assign(Object.assign({},e),{type:"error",_visit:function(t){return MCe._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 LCe={file:e=>Object.assign(Object.assign({},e),{type:"file",_visit:function(t){return LCe._visit(this,t)}}),fileArray:e=>Object.assign(Object.assign({},e),{type:"fileArray",_visit:function(t){return LCe._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 zCe={file:e=>({value:e,type:"file",_visit:function(t){return zCe._visit(this,t)}}),bodyProperty:e=>Object.assign(Object.assign({},e),{type:"bodyProperty",_visit:function(t){return zCe._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 ZWd={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE"},_ze=Object.assign(Object.assign({},ZWd),{_visit:(e,t)=>{switch(e){case _ze.Get:return t.get();case _ze.Post:return t.post();case _ze.Put:return t.put();case _ze.Patch:return t.patch();case _ze.Delete:return t.delete();default:return t._other()}}});var KV={inlinedRequestBody:e=>Object.assign(Object.assign({},e),{type:"inlinedRequestBody",_visit:function(t){return KV._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return KV._visit(this,t)}}),fileUpload:e=>Object.assign(Object.assign({},e),{type:"fileUpload",_visit:function(t){return KV._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return KV._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 mM={json:e=>({value:e,type:"json",_visit:function(t){return mM._visit(this,t)}}),fileDownload:e=>Object.assign(Object.assign({},e),{type:"fileDownload",_visit:function(t){return mM._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return mM._visit(this,t)}}),streaming:e=>({value:e,type:"streaming",_visit:function(t){return mM._visit(this,t)}}),streamParameter:e=>Object.assign(Object.assign({},e),{type:"streamParameter",_visit:function(t){return mM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e.value);case"fileDownload":return t.fileDownload(e);case"text":return t.text(e);case"streaming":return t.streaming(e.value);case"streamParameter":return t.streamParameter(e);default:return t._other(e)}}};var UCe={response:e=>Object.assign(Object.assign({},e),{type:"response",_visit:function(t){return UCe._visit(this,t)}}),nestedPropertyAsResponse:e=>Object.assign(Object.assign({},e),{type:"nestedPropertyAsResponse",_visit:function(t){return UCe._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 See={json:e=>({value:e,type:"json",_visit:function(t){return See._visit(this,t)}}),fileDownload:e=>Object.assign(Object.assign({},e),{type:"fileDownload",_visit:function(t){return See._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return See._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e.value);case"fileDownload":return t.fileDownload(e);case"text":return t.text(e);default:return t._other(e)}}};var _Ce={cursor:e=>Object.assign(Object.assign({},e),{type:"cursor",_visit:function(t){return _Ce._visit(this,t)}}),offset:e=>Object.assign(Object.assign({},e),{type:"offset",_visit:function(t){return _Ce._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);default:return t._other(e)}}};var $Wd={Root:"ROOT",Service:"SERVICE",Endpoint:"ENDPOINT"},y5t=Object.assign(Object.assign({},$Wd),{_visit:(e,t)=>{switch(e){case y5t.Root:return t.root();case y5t.Service:return t.service();case y5t.Endpoint:return t.endpoint();default:return t._other()}}});var VCe={query:e=>Object.assign(Object.assign({},e),{type:"query",_visit:function(t){return VCe._visit(this,t)}}),body:e=>Object.assign(Object.assign({},e),{type:"body",_visit:function(t){return VCe._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 qCe={typeReference:e=>Object.assign(Object.assign({},e),{type:"typeReference",_visit:function(t){return qCe._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return qCe._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 GCe={justRequestBody:e=>({value:e,type:"justRequestBody",_visit:function(t){return GCe._visit(this,t)}}),wrapper:e=>Object.assign(Object.assign({},e),{type:"wrapper",_visit:function(t){return GCe._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 Tee={json:e=>Object.assign(Object.assign({},e),{type:"json",_visit:function(t){return Tee._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return Tee._visit(this,t)}}),sse:e=>Object.assign(Object.assign({},e),{type:"sse",_visit:function(t){return Tee._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 eHd={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java"},Bee=Object.assign(Object.assign({},eHd),{_visit:(e,t)=>{switch(e){case Bee.Curl:return t.curl();case Bee.Python:return t.python();case Bee.Javascript:return t.javascript();case Bee.Typescript:return t.typescript();case Bee.Go:return t.go();case Bee.Ruby:return t.ruby();case Bee.Csharp:return t.csharp();case Bee.Java:return t.java();default:return t._other()}}});var WCe={http:()=>({type:"http",_visit:function(e){return WCe._visit(this,e)}}),grpc:e=>Object.assign(Object.assign({},e),{type:"grpc",_visit:function(t){return WCe._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 HBo={};te(HBo,{ApiDefinitionSource:()=>HCe,ApiVersionScheme:()=>Tst,ErrorDiscriminationStrategy:()=>KCe});var HCe={proto:e=>Object.assign(Object.assign({},e),{type:"proto",_visit:function(t){return HCe._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return HCe._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 Tst={header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Tst._visit(this,t)}}),_visit:(e,t)=>e.type==="header"?t.header(e):t._other(e)};var KCe={statusCode:()=>({type:"statusCode",_visit:function(e){return KCe._visit(this,e)}}),property:e=>Object.assign(Object.assign({},e),{type:"property",_visit:function(t){return KCe._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 KBo={};te(KBo,{ProtobufType:()=>JCe,WellKnownProtobufType:()=>la});var JCe={wellKnown:e=>({value:e,type:"wellKnown",_visit:function(t){return JCe._visit(this,t)}}),userDefined:e=>Object.assign(Object.assign({},e),{type:"userDefined",_visit:function(t){return JCe._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 la={any:()=>({type:"any",_visit:function(e){return la._visit(this,e)}}),api:()=>({type:"api",_visit:function(e){return la._visit(this,e)}}),boolValue:()=>({type:"boolValue",_visit:function(e){return la._visit(this,e)}}),bytesValue:()=>({type:"bytesValue",_visit:function(e){return la._visit(this,e)}}),doubleValue:()=>({type:"doubleValue",_visit:function(e){return la._visit(this,e)}}),duration:()=>({type:"duration",_visit:function(e){return la._visit(this,e)}}),empty:()=>({type:"empty",_visit:function(e){return la._visit(this,e)}}),enum:()=>({type:"enum",_visit:function(e){return la._visit(this,e)}}),enumValue:()=>({type:"enumValue",_visit:function(e){return la._visit(this,e)}}),field:()=>({type:"field",_visit:function(e){return la._visit(this,e)}}),fieldCardinality:()=>({type:"fieldCardinality",_visit:function(e){return la._visit(this,e)}}),fieldKind:()=>({type:"fieldKind",_visit:function(e){return la._visit(this,e)}}),fieldMask:()=>({type:"fieldMask",_visit:function(e){return la._visit(this,e)}}),floatValue:()=>({type:"floatValue",_visit:function(e){return la._visit(this,e)}}),int32Value:()=>({type:"int32Value",_visit:function(e){return la._visit(this,e)}}),int64Value:()=>({type:"int64Value",_visit:function(e){return la._visit(this,e)}}),listValue:()=>({type:"listValue",_visit:function(e){return la._visit(this,e)}}),method:()=>({type:"method",_visit:function(e){return la._visit(this,e)}}),mixin:()=>({type:"mixin",_visit:function(e){return la._visit(this,e)}}),nullValue:()=>({type:"nullValue",_visit:function(e){return la._visit(this,e)}}),option:()=>({type:"option",_visit:function(e){return la._visit(this,e)}}),sourceContext:()=>({type:"sourceContext",_visit:function(e){return la._visit(this,e)}}),stringValue:()=>({type:"stringValue",_visit:function(e){return la._visit(this,e)}}),struct:()=>({type:"struct",_visit:function(e){return la._visit(this,e)}}),syntax:()=>({type:"syntax",_visit:function(e){return la._visit(this,e)}}),timestamp:()=>({type:"timestamp",_visit:function(e){return la._visit(this,e)}}),type:()=>({type:"type",_visit:function(e){return la._visit(this,e)}}),uint32Value:()=>({type:"uint32Value",_visit:function(e){return la._visit(this,e)}}),uint64Value:()=>({type:"uint64Value",_visit:function(e){return la._visit(this,e)}}),value:()=>({type:"value",_visit:function(e){return la._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 JBo={};te(JBo,{PublishTarget:()=>Bst,PublishingConfig:()=>YCe});var YCe={github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return YCe._visit(this,t)}}),direct:e=>Object.assign(Object.assign({},e),{type:"direct",_visit:function(t){return YCe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"github":return t.github(e);case"direct":return t.direct(e);default:return t._other(e)}}};var Bst={postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return Bst._visit(this,t)}}),_visit:(e,t)=>e.type==="postman"?t.postman(e):t._other(e)};var YBo={};te(YBo,{ContainerType:()=>hM,ExampleContainer:()=>gM,ExamplePrimitive:()=>gg,ExampleSingleUnionTypeProperties:()=>Oee,ExampleTypeReferenceShape:()=>JV,ExampleTypeShape:()=>AM,Literal:()=>XCe,NamedTypeDefault:()=>Ost,PrimitiveTypeV1:()=>F2,PrimitiveTypeV2:()=>Ag,ResolvedTypeReference:()=>YV,ShapeType:()=>Pst,SingleUnionTypeProperties:()=>Pee,Source:()=>Dst,Type:()=>yM,TypeReference:()=>XV});var hM={list:e=>({list:e,type:"list",_visit:function(t){return hM._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return hM._visit(this,t)}}),optional:e=>({optional:e,type:"optional",_visit:function(t){return hM._visit(this,t)}}),set:e=>({set:e,type:"set",_visit:function(t){return hM._visit(this,t)}}),literal:e=>({literal:e,type:"literal",_visit:function(t){return hM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.list);case"map":return t.map(e);case"optional":return t.optional(e.optional);case"set":return t.set(e.set);case"literal":return t.literal(e.literal);default:return t._other(e)}}};var gM={list:e=>Object.assign(Object.assign({},e),{type:"list",_visit:function(t){return gM._visit(this,t)}}),set:e=>Object.assign(Object.assign({},e),{type:"set",_visit:function(t){return gM._visit(this,t)}}),optional:e=>Object.assign(Object.assign({},e),{type:"optional",_visit:function(t){return gM._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return gM._visit(this,t)}}),literal:e=>Object.assign(Object.assign({},e),{type:"literal",_visit:function(t){return gM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e);case"set":return t.set(e);case"optional":return t.optional(e);case"map":return t.map(e);case"literal":return t.literal(e);default:return t._other(e)}}};var gg={integer:e=>({integer:e,type:"integer",_visit:function(t){return gg._visit(this,t)}}),long:e=>({long:e,type:"long",_visit:function(t){return gg._visit(this,t)}}),uint:e=>({uint:e,type:"uint",_visit:function(t){return gg._visit(this,t)}}),uint64:e=>({uint64:e,type:"uint64",_visit:function(t){return gg._visit(this,t)}}),float:e=>({float:e,type:"float",_visit:function(t){return gg._visit(this,t)}}),double:e=>({double:e,type:"double",_visit:function(t){return gg._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return gg._visit(this,t)}}),string:e=>({string:e,type:"string",_visit:function(t){return gg._visit(this,t)}}),date:e=>({date:e,type:"date",_visit:function(t){return gg._visit(this,t)}}),datetime:e=>Object.assign(Object.assign({},e),{type:"datetime",_visit:function(t){return gg._visit(this,t)}}),uuid:e=>({uuid:e,type:"uuid",_visit:function(t){return gg._visit(this,t)}}),base64:e=>({base64:e,type:"base64",_visit:function(t){return gg._visit(this,t)}}),bigInteger:e=>({bigInteger:e,type:"bigInteger",_visit:function(t){return gg._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e.integer);case"long":return t.long(e.long);case"uint":return t.uint(e.uint);case"uint64":return t.uint64(e.uint64);case"float":return t.float(e.float);case"double":return t.double(e.double);case"boolean":return t.boolean(e.boolean);case"string":return t.string(e.string);case"date":return t.date(e.date);case"datetime":return t.datetime(e);case"uuid":return t.uuid(e.uuid);case"base64":return t.base64(e.base64);case"bigInteger":return t.bigInteger(e.bigInteger);default:return t._other(e)}}};var Oee={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{type:"samePropertiesAsObject",_visit:function(t){return Oee._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{type:"singleProperty",_visit:function(t){return Oee._visit(this,t)}}),noProperties:()=>({type:"noProperties",_visit:function(e){return Oee._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 JV={primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return JV._visit(this,t)}}),container:e=>({container:e,type:"container",_visit:function(t){return JV._visit(this,t)}}),unknown:e=>({unknown:e,type:"unknown",_visit:function(t){return JV._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return JV._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 AM={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return AM._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return AM._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return AM._visit(this,t)}}),union:e=>Object.assign(Object.assign({},e),{type:"union",_visit:function(t){return AM._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return AM._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 XCe={string:e=>({string:e,type:"string",_visit:function(t){return XCe._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return XCe._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 Ost={enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return Ost._visit(this,t)}}),_visit:(e,t)=>e.type==="enum"?t.enum(e):t._other(e)};var tHd={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER"},F2=Object.assign(Object.assign({},tHd),{_visit:(e,t)=>{switch(e){case F2.Integer:return t.integer();case F2.Long:return t.long();case F2.Uint:return t.uint();case F2.Uint64:return t.uint64();case F2.Float:return t.float();case F2.Double:return t.double();case F2.Boolean:return t.boolean();case F2.String:return t.string();case F2.Date:return t.date();case F2.DateTime:return t.dateTime();case F2.Uuid:return t.uuid();case F2.Base64:return t.base64();case F2.BigInteger:return t.bigInteger();default:return t._other()}}});var Ag={integer:e=>Object.assign(Object.assign({},e),{type:"integer",_visit:function(t){return Ag._visit(this,t)}}),long:e=>Object.assign(Object.assign({},e),{type:"long",_visit:function(t){return Ag._visit(this,t)}}),uint:e=>Object.assign(Object.assign({},e),{type:"uint",_visit:function(t){return Ag._visit(this,t)}}),uint64:e=>Object.assign(Object.assign({},e),{type:"uint64",_visit:function(t){return Ag._visit(this,t)}}),float:e=>Object.assign(Object.assign({},e),{type:"float",_visit:function(t){return Ag._visit(this,t)}}),double:e=>Object.assign(Object.assign({},e),{type:"double",_visit:function(t){return Ag._visit(this,t)}}),boolean:e=>Object.assign(Object.assign({},e),{type:"boolean",_visit:function(t){return Ag._visit(this,t)}}),string:e=>Object.assign(Object.assign({},e),{type:"string",_visit:function(t){return Ag._visit(this,t)}}),date:e=>Object.assign(Object.assign({},e),{type:"date",_visit:function(t){return Ag._visit(this,t)}}),dateTime:e=>Object.assign(Object.assign({},e),{type:"dateTime",_visit:function(t){return Ag._visit(this,t)}}),uuid:e=>Object.assign(Object.assign({},e),{type:"uuid",_visit:function(t){return Ag._visit(this,t)}}),base64:e=>Object.assign(Object.assign({},e),{type:"base64",_visit:function(t){return Ag._visit(this,t)}}),bigInteger:e=>Object.assign(Object.assign({},e),{type:"bigInteger",_visit:function(t){return Ag._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e);case"long":return t.long(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"boolean":return t.boolean(e);case"string":return t.string(e);case"date":return t.date(e);case"dateTime":return t.dateTime(e);case"uuid":return t.uuid(e);case"base64":return t.base64(e);case"bigInteger":return t.bigInteger(e);default:return t._other(e)}}};var YV={container:e=>({container:e,type:"container",_visit:function(t){return YV._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return YV._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return YV._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return YV._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 rHd={Enum:"ENUM",Object:"OBJECT",Union:"UNION",UndiscriminatedUnion:"UNDISCRIMINATED_UNION"},Pst=Object.assign(Object.assign({},rHd),{_visit:(e,t)=>{switch(e){case Pst.Enum:return t.enum();case Pst.Object:return t.object();case Pst.Union:return t.union();case Pst.UndiscriminatedUnion:return t.undiscriminatedUnion();default:return t._other()}}});var Pee={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{propertiesType:"samePropertiesAsObject",_visit:function(t){return Pee._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{propertiesType:"singleProperty",_visit:function(t){return Pee._visit(this,t)}}),noProperties:()=>({propertiesType:"noProperties",_visit:function(e){return Pee._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 Dst={proto:e=>({value:e,type:"proto",_visit:function(t){return Dst._visit(this,t)}}),_visit:(e,t)=>e.type==="proto"?t.proto(e.value):t._other(e)};var yM={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return yM._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return yM._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return yM._visit(this,t)}}),union:e=>Object.assign(Object.assign({},e),{type:"union",_visit:function(t){return yM._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return yM._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 XV={container:e=>({container:e,type:"container",_visit:function(t){return XV._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return XV._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return XV._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return XV._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 d_c={};var XBo={};te(XBo,{WebhookHttpMethod:()=>l9r,WebhookPayload:()=>ZCe});var nHd={Get:"GET",Post:"POST"},l9r=Object.assign(Object.assign({},nHd),{_visit:(e,t)=>{switch(e){case l9r.Get:return t.get();case l9r.Post:return t.post();default:return t._other()}}});var ZCe={inlinedPayload:e=>Object.assign(Object.assign({},e),{type:"inlinedPayload",_visit:function(t){return ZCe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return ZCe._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 ZBo={};te(ZBo,{ExampleWebSocketMessageBody:()=>$Ce,WebSocketMessageBody:()=>ewe,WebSocketMessageOrigin:()=>p9r});var $Ce={inlinedBody:e=>Object.assign(Object.assign({},e),{type:"inlinedBody",_visit:function(t){return $Ce._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return $Ce._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 ewe={inlinedBody:e=>Object.assign(Object.assign({},e),{type:"inlinedBody",_visit:function(t){return ewe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return ewe._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 iHd={Client:"client",Server:"server"},p9r=Object.assign(Object.assign({},iHd),{_visit:(e,t)=>{switch(e){case p9r.Client:return t.client();case p9r.Server:return t.server();default:return t._other()}}});var Vze=Y.objectWithoutOptionalProperties({unsafeName:Y.string(),safeName:Y.string()});var po=Y.objectWithoutOptionalProperties({originalName:Y.string(),camelCase:Vze,pascalCase:Vze,snakeCase:Vze,screamingSnakeCase:Vze});var ZV=Y.string();var f9r=Y.objectWithoutOptionalProperties({username:po,usernameEnvVar:ZV.optional(),password:po,passwordEnvVar:ZV.optional()}).extend(os);var d9r=Y.objectWithoutOptionalProperties({token:po,tokenEnvVar:ZV.optional()}).extend(os);var js=Y.objectWithoutOptionalProperties({wireValue:Y.string(),name:po});var m9r=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc),prefix:Y.string().optional(),headerEnvVar:ZV.optional()}).extend(os);var EH=Y.string();var Dee=Y.string();var Ree=Y.string();var Rst=Y.objectWithoutOptionalProperties({endpointId:EH,serviceId:Dee,subpackageId:Ree.optional()});var h9r=Y.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var Fee=Y.objectWithoutOptionalProperties({status:h9r,message:Y.string().optional()});var qw=Y.objectWithoutOptionalProperties({availability:Fee.optional()}).extend(os);var k2=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc)}).extend(qw);var $V=Y.objectWithoutOptionalProperties({propertyPath:Y.list(po).optional(),property:k2});var Fst=Y.objectWithoutOptionalProperties({accessToken:$V,expiresIn:$V.optional(),refreshToken:$V.optional()});var twe=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc),allowMultiple:Y.boolean()}).extend(qw);var oHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},g9r=Y.union("type",{query:twe,body:k2}).transform({transform:e=>{switch(e.type){case"query":return VCe.query(e);case"body":return VCe.body(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=oHd(e,["_visit"]);return r}});var N2=Y.objectWithoutOptionalProperties({propertyPath:Y.list(po).optional(),property:g9r});var A9r=Y.objectWithoutOptionalProperties({refreshToken:N2});var y9r=Y.objectWithoutOptionalProperties({endpointReference:Rst,requestProperties:A9r,responseProperties:Fst});var b9r=Y.objectWithoutOptionalProperties({clientId:N2,clientSecret:N2,scopes:N2.optional()});var E9r=Y.objectWithoutOptionalProperties({endpointReference:Rst,requestProperties:b9r,responseProperties:Fst});var v9r=Y.objectWithoutOptionalProperties({clientIdEnvVar:ZV.optional(),clientSecretEnvVar:ZV.optional(),tokenPrefix:Y.string().optional(),tokenHeader:Y.string().optional(),scopes:Y.list(Y.string()).optional(),tokenEndpoint:E9r,refreshEndpoint:y9r.optional()});var sHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},I9r=Y.union("type",{clientCredentials:v9r}).transform({transform:e=>e.type==="clientCredentials"?xst.clientCredentials(e):e,untransform:e=>{var{_visit:t}=e,r=sHd(e,["_visit"]);return r}});var C9r=Y.objectWithoutOptionalProperties({configuration:I9r}).extend(os);var aHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},w9r=Y.union(Y.discriminant("type","_type"),{bearer:d9r,basic:f9r,header:m9r,oauth:C9r}).transform({transform:e=>{switch(e.type){case"bearer":return HV.bearer(e);case"basic":return HV.basic(e);case"header":return HV.header(e);case"oauth":return HV.oauth(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=aHd(e,["_visit"]);return r}});var x9r=Y.enum_(["ALL","ANY"]);var S9r=Y.objectWithoutOptionalProperties({requirement:x9r,schemes:Y.list(w9r)}).extend(os);var eOo={};te(eOo,{Availability:()=>Fee,AvailabilityStatus:()=>h9r,Declaration:()=>qw,EndpointId:()=>EH,EndpointReference:()=>Rst,ErrorId:()=>rwe,EscapedString:()=>T9r,FeatureId:()=>B9r,FernFilepath:()=>bM,Name:()=>po,NameAndWireValue:()=>js,SafeAndUnsafeString:()=>Vze,ServiceId:()=>Dee,SubpackageId:()=>Ree,TypeId:()=>iv,WebSocketChannelId:()=>Nst,WebhookGroupId:()=>kst,WebhookId:()=>O9r,WithDocs:()=>os,WithDocsAndAvailability:()=>nwe,WithJsonExample:()=>kee});var rwe=Y.string();var T9r=Y.objectWithoutOptionalProperties({original:Y.string()});var B9r=Y.string();var bM=Y.objectWithoutOptionalProperties({allParts:Y.list(po),packagePath:Y.list(po),file:po.optional()});var iv=Y.string();var kst=Y.string();var O9r=Y.string();var Nst=Y.string();var nwe=Y.objectWithoutOptionalProperties({availability:Fee.optional()}).extend(os);var kee=Y.objectWithoutOptionalProperties({jsonExample:Y.unknown()});var tOo={};te(tOo,{Constants:()=>P9r});var P9r=Y.objectWithoutOptionalProperties({errorInstanceIdKey:js});var EC={};te(EC,{AliasType:()=>J9r,Auth:()=>k9r,AuthValues:()=>M9r,BasicAuth:()=>D9r,BasicAuthValues:()=>N9r,BearerAuth:()=>R9r,BearerAuthValues:()=>j9r,BodyRequest:()=>L9r,Declaration:()=>gR,DiscriminatedUnionType:()=>eWr,DynamicIntermediateRepresentation:()=>oWr,Endpoint:()=>K9r,EndpointLocation:()=>Mst,EndpointSnippetRequest:()=>m_c,EndpointSnippetResponse:()=>h_c,EnumType:()=>tWr,ErrorSeverity:()=>sWr,Error_:()=>aWr,FileUploadRequestBody:()=>U9r,FileUploadRequestBodyProperty:()=>z9r,HeaderAuth:()=>F9r,HeaderAuthValues:()=>Q9r,InlinedRequest:()=>G9r,InlinedRequestBody:()=>V9r,InlinedRequestMetadata:()=>q9r,LiteralType:()=>cWr,MapType:()=>g_c,NamedParameter:()=>sE,NamedType:()=>iWr,ObjectType:()=>rWr,ReferencedRequestBody:()=>_9r,ReferencedRequestBodyType:()=>jst,Request:()=>W9r,Response:()=>H9r,SingleDiscriminatedUnionType:()=>$9r,SingleDiscriminatedUnionTypeNoProperties:()=>Y9r,SingleDiscriminatedUnionTypeObject:()=>X9r,SingleDiscriminatedUnionTypeSingleProperty:()=>Z9r,TypeReference:()=>A_c,UndiscriminatedUnionType:()=>nWr,Values:()=>Lst,auth:()=>rOo,declaration:()=>nOo,endpoints:()=>iOo,ir:()=>oOo,snippets:()=>sOo,types:()=>aOo});var rOo={};te(rOo,{Auth:()=>k9r,AuthValues:()=>M9r,BasicAuth:()=>D9r,BasicAuthValues:()=>N9r,BearerAuth:()=>R9r,BearerAuthValues:()=>j9r,HeaderAuth:()=>F9r,HeaderAuthValues:()=>Q9r});var D9r=Y.objectWithoutOptionalProperties({username:po,password:po});var R9r=Y.objectWithoutOptionalProperties({token:po});var sE=Y.objectWithoutOptionalProperties({name:js,typeReference:Y.lazy(()=>EC.TypeReference)});var F9r=Y.objectWithoutOptionalProperties({header:sE});var cHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},k9r=Y.union("type",{basic:D9r,bearer:R9r,header:F9r}).transform({transform:e=>{switch(e.type){case"basic":return Ti.Auth.basic(e);case"bearer":return Ti.Auth.bearer(e);case"header":return Ti.Auth.header(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=cHd(e,["_visit"]);return r}});var N9r=Y.objectWithoutOptionalProperties({username:Y.string(),password:Y.string()});var j9r=Y.objectWithoutOptionalProperties({token:Y.string()});var Q9r=Y.objectWithoutOptionalProperties({value:Y.unknown()});var uHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},M9r=Y.union("type",{basic:N9r,bearer:j9r,header:Q9r}).transform({transform:e=>{switch(e.type){case"basic":return Ti.AuthValues.basic(e);case"bearer":return Ti.AuthValues.bearer(e);case"header":return Ti.AuthValues.header(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=uHd(e,["_visit"]);return r}});var nOo={};te(nOo,{Declaration:()=>gR});var gR=Y.objectWithoutOptionalProperties({fernFilepath:bM,name:po});var iOo={};te(iOo,{BodyRequest:()=>L9r,Endpoint:()=>K9r,EndpointLocation:()=>Mst,FileUploadRequestBody:()=>U9r,FileUploadRequestBodyProperty:()=>z9r,InlinedRequest:()=>G9r,InlinedRequestBody:()=>V9r,InlinedRequestMetadata:()=>q9r,ReferencedRequestBody:()=>_9r,ReferencedRequestBodyType:()=>jst,Request:()=>W9r,Response:()=>H9r});var lHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},jst=Y.union("type",{bytes:Y.object({}),typeReference:Y.object({value:Y.lazy(()=>EC.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return Ti.ReferencedRequestBodyType.bytes();case"typeReference":return Ti.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=lHd(e,["_visit"]);return r}});var L9r=Y.objectWithoutOptionalProperties({pathParameters:Y.list(sE).optional(),body:jst.optional()});var Qst=Y.enum_(["GET","POST","PUT","PATCH","DELETE"]);var Mst=Y.objectWithoutOptionalProperties({method:Qst,path:Y.string()});var pHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},z9r=Y.union("type",{file:js,fileArray:js,bodyProperty:sE}).transform({transform:e=>{switch(e.type){case"file":return Ti.FileUploadRequestBodyProperty.file(e);case"fileArray":return Ti.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return Ti.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=pHd(e,["_visit"]);return r}});var U9r=Y.objectWithoutOptionalProperties({properties:Y.list(z9r)});var _9r=Y.objectWithoutOptionalProperties({bodyKey:po,bodyType:jst});var fHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},V9r=Y.union("type",{properties:Y.object({value:Y.list(sE)}),referenced:_9r,fileUpload:U9r}).transform({transform:e=>{switch(e.type){case"properties":return Ti.InlinedRequestBody.properties(e.value);case"referenced":return Ti.InlinedRequestBody.referenced(e);case"fileUpload":return Ti.InlinedRequestBody.fileUpload(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=fHd(e,["_visit"]);return r}});var q9r=Y.objectWithoutOptionalProperties({includePathParameters:Y.boolean(),onlyPathParameters:Y.boolean()});var G9r=Y.objectWithoutOptionalProperties({declaration:gR,pathParameters:Y.list(sE).optional(),queryParameters:Y.list(sE).optional(),headers:Y.list(sE).optional(),body:V9r.optional(),metadata:q9r.optional()});var dHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},W9r=Y.union("type",{body:L9r,inlined:G9r}).transform({transform:e=>{switch(e.type){case"body":return Ti.Request.body(e);case"inlined":return Ti.Request.inlined(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=dHd(e,["_visit"]);return r}});var mHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},H9r=Y.union("type",{json:Y.object({})}).transform({transform:e=>e.type==="json"?Ti.Response.json():e,untransform:e=>{var{_visit:t}=e,r=mHd(e,["_visit"]);return r}});var K9r=Y.objectWithoutOptionalProperties({auth:k9r.optional(),declaration:gR,location:Mst,request:W9r,response:H9r});var oOo={};te(oOo,{DynamicIntermediateRepresentation:()=>oWr});var J9r=Y.objectWithoutOptionalProperties({declaration:gR,typeReference:Y.lazy(()=>EC.TypeReference)});var Y9r=Y.objectWithoutOptionalProperties({discriminantValue:js,properties:Y.list(sE).optional()});var X9r=Y.objectWithoutOptionalProperties({typeId:iv,discriminantValue:js,properties:Y.list(sE)});var Z9r=Y.objectWithoutOptionalProperties({typeReference:Y.lazy(()=>EC.TypeReference),discriminantValue:js,properties:Y.list(sE).optional()});var hHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},$9r=Y.union("type",{samePropertiesAsObject:X9r,singleProperty:Z9r,noProperties:Y9r}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return Ti.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return Ti.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return Ti.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=hHd(e,["_visit"]);return r}});var eWr=Y.objectWithoutOptionalProperties({declaration:gR,discriminant:js,types:Y.record(Y.string(),$9r)});var tWr=Y.objectWithoutOptionalProperties({declaration:gR,values:Y.list(js)});var rWr=Y.objectWithoutOptionalProperties({declaration:gR,properties:Y.list(sE)});var nWr=Y.objectWithoutOptionalProperties({declaration:gR,types:Y.list(Y.lazy(()=>EC.TypeReference))});var gHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},iWr=Y.union("type",{alias:J9r,enum:tWr,object:rWr,discriminatedUnion:eWr,undiscriminatedUnion:nWr}).transform({transform:e=>{switch(e.type){case"alias":return Ti.NamedType.alias(e);case"enum":return Ti.NamedType.enum(e);case"object":return Ti.NamedType.object(e);case"discriminatedUnion":return Ti.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return Ti.NamedType.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=gHd(e,["_visit"]);return r}});var oWr=Y.objectWithoutOptionalProperties({version:Y.stringLiteral("1.0.0"),types:Y.record(iv,iWr),endpoints:Y.record(EH,K9r),headers:Y.list(sE).optional()});var sOo={};te(sOo,{EndpointSnippetRequest:()=>m_c,EndpointSnippetResponse:()=>h_c,ErrorSeverity:()=>sWr,Error_:()=>aWr,Values:()=>Lst});var Lst=Y.record(Y.string(),Y.unknown());var m_c=Y.objectWithoutOptionalProperties({endpoint:Mst,auth:M9r.optional(),pathParameters:Lst.optional(),queryParameters:Lst.optional(),headers:Lst.optional(),requestBody:Y.unknown().optional()});var sWr=Y.enum_(["CRITICAL","WARNING"]);var aWr=Y.objectWithoutOptionalProperties({severity:sWr,message:Y.string()});var h_c=Y.objectWithoutOptionalProperties({snippet:Y.string(),errors:Y.list(aWr).optional()});var aOo={};te(aOo,{AliasType:()=>J9r,DiscriminatedUnionType:()=>eWr,EnumType:()=>tWr,LiteralType:()=>cWr,MapType:()=>g_c,NamedParameter:()=>sE,NamedType:()=>iWr,ObjectType:()=>rWr,SingleDiscriminatedUnionType:()=>$9r,SingleDiscriminatedUnionTypeNoProperties:()=>Y9r,SingleDiscriminatedUnionTypeObject:()=>X9r,SingleDiscriminatedUnionTypeSingleProperty:()=>Z9r,TypeReference:()=>A_c,UndiscriminatedUnionType:()=>nWr});var AHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},cWr=Y.union("type",{boolean:Y.object({value:Y.boolean()}),string:Y.object({value:Y.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return Ti.LiteralType.boolean(e.value);case"string":return Ti.LiteralType.string(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=AHd(e,["_visit"]);return r}});var g_c=Y.objectWithoutOptionalProperties({key:Y.lazy(()=>EC.TypeReference),value:Y.lazy(()=>EC.TypeReference)});var zst=Y.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var yHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},A_c=Y.union("type",{list:Y.object({value:Y.lazy(()=>EC.TypeReference)}),literal:Y.object({value:cWr}),map:Y.lazyObject(()=>EC.MapType),named:Y.object({value:iv}),optional:Y.object({value:Y.lazy(()=>EC.TypeReference)}),primitive:Y.object({value:zst}),set:Y.object({value:Y.lazy(()=>EC.TypeReference)}),unknown:Y.object({})}).transform({transform:e=>{switch(e.type){case"list":return Ti.TypeReference.list(e.value);case"literal":return Ti.TypeReference.literal(e.value);case"map":return Ti.TypeReference.map(e);case"named":return Ti.TypeReference.named(e.value);case"optional":return Ti.TypeReference.optional(e.value);case"primitive":return Ti.TypeReference.primitive(e.value);case"set":return Ti.TypeReference.set(e.value);case"unknown":return Ti.TypeReference.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=yHd(e,["_visit"]);return r}});var cOo={};te(cOo,{EnvironmentBaseUrlId:()=>iwe,EnvironmentBaseUrlWithId:()=>uWr,EnvironmentId:()=>owe,EnvironmentUrl:()=>Ust,Environments:()=>mWr,EnvironmentsConfig:()=>hWr,MultipleBaseUrlsEnvironment:()=>lWr,MultipleBaseUrlsEnvironments:()=>pWr,SingleBaseUrlEnvironment:()=>fWr,SingleBaseUrlEnvironments:()=>dWr});var iwe=Y.string();var uWr=Y.objectWithoutOptionalProperties({id:iwe,name:po});var owe=Y.string();var Ust=Y.string();var lWr=Y.objectWithoutOptionalProperties({id:owe,name:po,urls:Y.record(iwe,Ust)}).extend(os);var pWr=Y.objectWithoutOptionalProperties({baseUrls:Y.list(uWr),environments:Y.list(lWr)});var fWr=Y.objectWithoutOptionalProperties({id:owe,name:po,url:Ust}).extend(os);var dWr=Y.objectWithoutOptionalProperties({environments:Y.list(fWr)});var bHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},mWr=Y.union("type",{singleBaseUrl:dWr,multipleBaseUrls:pWr}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return kCe.singleBaseUrl(e);case"multipleBaseUrls":return kCe.multipleBaseUrls(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=bHd(e,["_visit"]);return r}});var hWr=Y.objectWithoutOptionalProperties({defaultEnvironment:owe.optional(),environments:mWr});var uOo={};te(uOo,{DeclaredErrorName:()=>swe,ErrorDeclaration:()=>AWr,ErrorDeclarationDiscriminantValue:()=>y_c,ExampleError:()=>gWr});var swe=Y.objectWithoutOptionalProperties({errorId:rwe,fernFilepath:bM,name:po});var gWr=Y.objectWithoutOptionalProperties({name:po.optional(),shape:Y.lazyObject(()=>Dp)}).extend(kee).extend(os);var AWr=Y.objectWithoutOptionalProperties({name:swe,discriminantValue:js,type:Y.lazy(()=>lc).optional(),statusCode:Y.number(),examples:Y.list(gWr)}).extend(os);var EHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},y_c=Y.union("type",{property:js,statusCode:Y.object({})}).transform({transform:e=>{switch(e.type){case"property":return NCe.property(e);case"statusCode":return NCe.statusCode();default:return e}},untransform:e=>{var{_visit:t}=e,r=EHd(e,["_visit"]);return r}});var pOo={};te(pOo,{BasicLicense:()=>bWr,CustomLicense:()=>EWr,EnvironmentVariable:()=>vC,GeneratorConfig:()=>b_c,GeneratorEnvironment:()=>IWr,GeneratorOutputConfig:()=>_Wr,GeneratorPublishConfig:()=>Jst,GeneratorPublishTarget:()=>SWr,GeneratorRegistriesConfig:()=>OWr,GeneratorRegistriesConfigV2:()=>PWr,GithubOutputMode:()=>LWr,GithubPublishInfo:()=>MWr,LicenseConfig:()=>VWr,LicenseId:()=>yWr,MavenCentralSignature:()=>_st,MavenCentralSignatureGithubInfo:()=>DWr,MavenGithubPublishInfo:()=>RWr,MavenRegistryConfig:()=>TWr,MavenRegistryConfigV2:()=>Vst,NpmGithubPublishInfo:()=>FWr,NpmRegistryConfig:()=>BWr,NpmRegistryConfigV2:()=>qst,NugetGithubPublishInfo:()=>kWr,NugetRegistryConfig:()=>Gst,OutputMetadata:()=>xWr,OutputMetadataAuthor:()=>wWr,OutputMode:()=>zWr,PostmanConfig:()=>CWr,PostmanGithubPublishInfo:()=>NWr,PublishingMetadata:()=>UWr,PypiGithubPublishInfo:()=>jWr,PypiMetadata:()=>Wst,PypiRegistryConfig:()=>Hst,RemoteGeneratorEnvironment:()=>vWr,RubyGemsGithubPublishInfo:()=>QWr,RubyGemsRegistryConfig:()=>Kst,config:()=>lOo});var lOo={};te(lOo,{BasicLicense:()=>bWr,CustomLicense:()=>EWr,EnvironmentVariable:()=>vC,GeneratorConfig:()=>b_c,GeneratorEnvironment:()=>IWr,GeneratorOutputConfig:()=>_Wr,GeneratorPublishConfig:()=>Jst,GeneratorPublishTarget:()=>SWr,GeneratorRegistriesConfig:()=>OWr,GeneratorRegistriesConfigV2:()=>PWr,GithubOutputMode:()=>LWr,GithubPublishInfo:()=>MWr,LicenseConfig:()=>VWr,LicenseId:()=>yWr,MavenCentralSignature:()=>_st,MavenCentralSignatureGithubInfo:()=>DWr,MavenGithubPublishInfo:()=>RWr,MavenRegistryConfig:()=>TWr,MavenRegistryConfigV2:()=>Vst,NpmGithubPublishInfo:()=>FWr,NpmRegistryConfig:()=>BWr,NpmRegistryConfigV2:()=>qst,NugetGithubPublishInfo:()=>kWr,NugetRegistryConfig:()=>Gst,OutputMetadata:()=>xWr,OutputMetadataAuthor:()=>wWr,OutputMode:()=>zWr,PostmanConfig:()=>CWr,PostmanGithubPublishInfo:()=>NWr,PublishingMetadata:()=>UWr,PypiGithubPublishInfo:()=>jWr,PypiMetadata:()=>Wst,PypiRegistryConfig:()=>Hst,RemoteGeneratorEnvironment:()=>vWr,RubyGemsGithubPublishInfo:()=>QWr,RubyGemsRegistryConfig:()=>Kst});var yWr=Y.enum_(["MIT","Apache-2.0"]);var bWr=Y.objectWithoutOptionalProperties({id:yWr});var EWr=Y.objectWithoutOptionalProperties({filename:Y.string()});var vC=Y.string();var vWr=Y.objectWithoutOptionalProperties({coordinatorUrl:Y.string(),coordinatorUrlV2:Y.string(),id:Y.string()});var vHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},IWr=Y.union(Y.discriminant("type","_type"),{local:Y.object({}),remote:vWr}).transform({transform:e=>{switch(e.type){case"local":return tu.GeneratorEnvironment.local();case"remote":return tu.GeneratorEnvironment.remote(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=vHd(e,["_visit"]);return r}});var _st=Y.objectWithoutOptionalProperties({keyId:Y.string(),password:Y.string(),secretKey:Y.string()});var Vst=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),username:Y.string(),password:Y.string(),coordinate:Y.string(),signature:_st.optional()});var qst=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),token:Y.string(),packageName:Y.string()});var Gst=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),apiKey:Y.string(),packageName:Y.string()});var CWr=Y.objectWithoutOptionalProperties({apiKey:Y.string(),workspaceId:Y.string()});var wWr=Y.objectWithoutOptionalProperties({name:Y.string(),email:Y.string()});var xWr=Y.objectWithoutOptionalProperties({description:Y.string().optional(),authors:Y.list(wWr).optional()});var Wst=Y.objectWithoutOptionalProperties({keywords:Y.list(Y.string()).optional(),documentationLink:Y.string().optional(),homepageLink:Y.string().optional()}).extend(xWr);var Hst=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),username:Y.string(),password:Y.string(),packageName:Y.string(),pypiMetadata:Wst.optional()});var Kst=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),apiKey:Y.string(),packageName:Y.string()});var IHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},SWr=Y.union("type",{maven:Vst,npm:qst,pypi:Hst,postman:CWr,rubygems:Kst,nuget:Gst}).transform({transform:e=>{switch(e.type){case"maven":return tu.GeneratorPublishTarget.maven(e);case"npm":return tu.GeneratorPublishTarget.npm(e);case"pypi":return tu.GeneratorPublishTarget.pypi(e);case"postman":return tu.GeneratorPublishTarget.postman(e);case"rubygems":return tu.GeneratorPublishTarget.rubygems(e);case"nuget":return tu.GeneratorPublishTarget.nuget(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=IHd(e,["_visit"]);return r}});var TWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),username:Y.string(),password:Y.string(),group:Y.string(),signature:_st.optional()});var BWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),token:Y.string(),scope:Y.string()});var OWr=Y.objectWithoutOptionalProperties({maven:TWr,npm:BWr});var PWr=Y.objectWithoutOptionalProperties({maven:Vst,npm:qst,pypi:Hst,rubygems:Kst,nuget:Gst});var Jst=Y.objectWithoutOptionalProperties({registries:OWr,registriesV2:PWr,publishTarget:SWr.optional(),version:Y.string()});var DWr=Y.objectWithoutOptionalProperties({keyIdEnvironmentVariable:vC,passwordEnvironmentVariable:vC,secretKeyEnvironmentVariable:vC});var RWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),coordinate:Y.string(),usernameEnvironmentVariable:vC,passwordEnvironmentVariable:vC,signature:DWr.optional(),shouldGeneratePublishWorkflow:Y.boolean().optional()});var FWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),packageName:Y.string(),tokenEnvironmentVariable:vC,shouldGeneratePublishWorkflow:Y.boolean().optional()});var kWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),packageName:Y.string(),apiKeyEnvironmentVariable:vC,shouldGeneratePublishWorkflow:Y.boolean().optional()});var NWr=Y.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:vC,workspaceIdEnvironmentVariable:vC});var jWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),packageName:Y.string(),usernameEnvironmentVariable:vC,passwordEnvironmentVariable:vC,pypiMetadata:Wst.optional(),shouldGeneratePublishWorkflow:Y.boolean().optional()});var QWr=Y.objectWithoutOptionalProperties({registryUrl:Y.string(),packageName:Y.string(),apiKeyEnvironmentVariable:vC,shouldGeneratePublishWorkflow:Y.boolean().optional()});var CHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},MWr=Y.union("type",{npm:FWr,maven:RWr,postman:NWr,pypi:jWr,rubygems:QWr,nuget:kWr}).transform({transform:e=>{switch(e.type){case"npm":return tu.GithubPublishInfo.npm(e);case"maven":return tu.GithubPublishInfo.maven(e);case"postman":return tu.GithubPublishInfo.postman(e);case"pypi":return tu.GithubPublishInfo.pypi(e);case"rubygems":return tu.GithubPublishInfo.rubygems(e);case"nuget":return tu.GithubPublishInfo.nuget(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=CHd(e,["_visit"]);return r}});var LWr=Y.objectWithoutOptionalProperties({version:Y.string(),repoUrl:Y.string(),installationToken:Y.string().optional(),publishInfo:MWr.optional()});var wHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},zWr=Y.union("type",{publish:Jst,downloadFiles:Y.object({}),github:LWr}).transform({transform:e=>{switch(e.type){case"publish":return tu.OutputMode.publish(e);case"downloadFiles":return tu.OutputMode.downloadFiles();case"github":return tu.OutputMode.github(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=wHd(e,["_visit"]);return r}});var UWr=Y.objectWithoutOptionalProperties({packageDescription:Y.property("package_description",Y.string().optional()),publisherEmail:Y.property("publisher_email",Y.string().optional()),referenceUrl:Y.property("reference_url",Y.string().optional()),publisherName:Y.property("publisher_name",Y.string().optional())});var _Wr=Y.objectWithoutOptionalProperties({path:Y.string(),snippetFilepath:Y.string().optional(),snippetTemplateFilepath:Y.string().optional(),publishingMetadata:UWr.optional(),mode:zWr});var xHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},VWr=Y.union("type",{basic:bWr,custom:EWr}).transform({transform:e=>{switch(e.type){case"basic":return tu.LicenseConfig.basic(e);case"custom":return tu.LicenseConfig.custom(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=xHd(e,["_visit"]);return r}});var b_c=Y.objectWithoutOptionalProperties({dryRun:Y.boolean(),irFilepath:Y.string(),originalReadmeFilepath:Y.string().optional(),license:VWr.optional(),output:_Wr,publish:Jst.optional(),workspaceName:Y.string(),organization:Y.string(),customConfig:Y.unknown(),environment:IWr,whitelabel:Y.boolean(),writeUnitTests:Y.boolean(),generatePaginatedClients:Y.boolean().optional(),generateOauthClients:Y.boolean()});var fOo={};te(fOo,{AutogeneratedEndpointExample:()=>XWr,BytesRequest:()=>$st,CursorPagination:()=>ZWr,DeclaredServiceName:()=>$Wr,EndpointName:()=>eHr,ExampleCodeSample:()=>iHr,ExampleCodeSampleLanguage:()=>tHr,ExampleCodeSampleSdk:()=>nHr,ExampleEndpointCall:()=>Zst,ExampleEndpointErrorResponse:()=>HWr,ExampleEndpointSuccessResponse:()=>JWr,ExampleHeader:()=>qze,ExampleInlinedRequestBody:()=>Xst,ExampleInlinedRequestBodyProperty:()=>GWr,ExamplePathParameter:()=>awe,ExampleQueryParameter:()=>Yst,ExampleQueryParameterShape:()=>qWr,ExampleRequestBody:()=>WWr,ExampleResponse:()=>YWr,ExampleServerSideEvent:()=>KWr,FileDownloadResponse:()=>eat,FileProperty:()=>aHr,FilePropertyArray:()=>oHr,FilePropertySingle:()=>sHr,FileUploadBodyProperty:()=>cHr,FileUploadRequest:()=>lHr,FileUploadRequestProperty:()=>uHr,GrpcTransport:()=>mHr,HttpEndpoint:()=>QHr,HttpHeader:()=>j2,HttpMethod:()=>Qst,HttpPath:()=>e5,HttpPathPart:()=>hHr,HttpRequestBody:()=>AHr,HttpRequestBodyReference:()=>nat,HttpResponse:()=>SHr,HttpResponseBody:()=>xHr,HttpService:()=>zHr,InlinedRequestBody:()=>gHr,InlinedRequestBodyProperty:()=>tat,JsonResponse:()=>iat,JsonResponseBody:()=>yHr,JsonResponseBodyWithProperty:()=>bHr,JsonStreamChunk:()=>EHr,NonStreamHttpResponseBody:()=>CHr,OffsetPagination:()=>THr,Pagination:()=>BHr,PathParameter:()=>vH,PathParameterLocation:()=>OHr,QueryParameter:()=>twe,RequestProperty:()=>N2,RequestPropertyValue:()=>g9r,ResponseError:()=>PHr,ResponseErrors:()=>DHr,ResponseProperty:()=>$V,SdkRequest:()=>NHr,SdkRequestBodyType:()=>RHr,SdkRequestShape:()=>kHr,SdkRequestWrapper:()=>FHr,SseStreamChunk:()=>vHr,StreamParameterResponse:()=>wHr,StreamingResponse:()=>oat,SupportedSdkLanguage:()=>rHr,TextResponse:()=>sat,TextStreamChunk:()=>IHr,Transport:()=>cat,UserSpecifiedEndpointExample:()=>jHr});var qze=Y.objectWithoutOptionalProperties({name:js,value:Y.lazyObject(()=>Dp)});var awe=Y.objectWithoutOptionalProperties({name:po,value:Y.lazyObject(()=>Dp)});var SHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},qWr=Y.union("type",{single:Y.object({}),exploded:Y.object({}),commaSeparated:Y.object({})}).transform({transform:e=>{switch(e.type){case"single":return xee.single();case"exploded":return xee.exploded();case"commaSeparated":return xee.commaSeparated();default:return e}},untransform:e=>{var{_visit:t}=e,r=SHd(e,["_visit"]);return r}});var Yst=Y.objectWithoutOptionalProperties({name:js,value:Y.lazyObject(()=>Dp),shape:qWr.optional()});var $y=Y.objectWithoutOptionalProperties({typeId:iv,fernFilepath:bM,name:po});var GWr=Y.objectWithoutOptionalProperties({name:js,value:Y.lazyObject(()=>Dp),originalTypeDeclaration:$y.optional()});var Xst=Y.objectWithoutOptionalProperties({properties:Y.list(GWr)}).extend(kee);var THd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},WWr=Y.union("type",{inlinedRequestBody:Xst,reference:Y.lazyObject(()=>Dp)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return QCe.inlinedRequestBody(e);case"reference":return QCe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=THd(e,["_visit"]);return r}});var HWr=Y.objectWithoutOptionalProperties({error:swe,body:Y.lazyObject(()=>Dp).optional()});var KWr=Y.objectWithoutOptionalProperties({event:Y.string(),data:Y.lazyObject(()=>Dp)});var BHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},JWr=Y.union("type",{body:Y.object({value:Y.lazyObject(()=>Dp).optional()}),stream:Y.object({value:Y.list(Y.lazyObject(()=>Dp))}),sse:Y.object({value:Y.list(KWr)})}).transform({transform:e=>{switch(e.type){case"body":return wee.body(e.value);case"stream":return wee.stream(e.value);case"sse":return wee.sse(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=BHd(e,["_visit"]);return r}});var OHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},YWr=Y.union("type",{ok:Y.object({value:JWr}),error:HWr}).transform({transform:e=>{switch(e.type){case"ok":return MCe.ok(e.value);case"error":return MCe.error(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=OHd(e,["_visit"]);return r}});var Zst=Y.objectWithoutOptionalProperties({id:Y.string().optional(),name:po.optional(),url:Y.string(),rootPathParameters:Y.list(awe),servicePathParameters:Y.list(awe),endpointPathParameters:Y.list(awe),serviceHeaders:Y.list(qze),endpointHeaders:Y.list(qze),queryParameters:Y.list(Yst),request:WWr.optional(),response:YWr}).extend(os);var XWr=Y.objectWithoutOptionalProperties({example:Zst});var $st=Y.objectWithoutOptionalProperties({isOptional:Y.boolean(),contentType:Y.string().optional()}).extend(os);var ZWr=Y.objectWithoutOptionalProperties({page:N2,next:$V,results:$V});var $Wr=Y.objectWithoutOptionalProperties({fernFilepath:bM});var eHr=po;var tHr=Y.objectWithoutOptionalProperties({name:po.optional(),language:Y.string(),code:Y.string(),install:Y.string().optional()}).extend(os);var rHr=Y.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var nHr=Y.objectWithoutOptionalProperties({name:po.optional(),sdk:rHr,code:Y.string()}).extend(os);var PHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},iHr=Y.union("type",{language:tHr,sdk:nHr}).transform({transform:e=>{switch(e.type){case"language":return jCe.language(e);case"sdk":return jCe.sdk(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=PHd(e,["_visit"]);return r}});var eat=Y.objectWithoutOptionalProperties({}).extend(os);var oHr=Y.objectWithoutOptionalProperties({key:js,isOptional:Y.boolean(),contentType:Y.string().optional()});var sHr=Y.objectWithoutOptionalProperties({key:js,isOptional:Y.boolean(),contentType:Y.string().optional()});var DHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},aHr=Y.union("type",{file:sHr,fileArray:oHr}).transform({transform:e=>{switch(e.type){case"file":return LCe.file(e);case"fileArray":return LCe.fileArray(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=DHd(e,["_visit"]);return r}});var tat=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc)}).extend(nwe);var cHr=Y.objectWithoutOptionalProperties({contentType:Y.string().optional()}).extend(tat);var RHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},uHr=Y.union("type",{file:Y.object({value:aHr}),bodyProperty:cHr}).transform({transform:e=>{switch(e.type){case"file":return zCe.file(e.value);case"bodyProperty":return zCe.bodyProperty(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=RHd(e,["_visit"]);return r}});var lHr=Y.objectWithoutOptionalProperties({name:po,properties:Y.list(uHr)}).extend(os);var pHr=Y.objectWithoutOptionalProperties({namespace:Y.string()});var fHr=Y.objectWithoutOptionalProperties({csharp:pHr.optional()});var rat=Y.objectWithoutOptionalProperties({filepath:Y.string(),packageName:Y.string().optional(),options:fHr.optional()});var dHr=Y.objectWithoutOptionalProperties({file:rat,name:po});var mHr=Y.objectWithoutOptionalProperties({service:dHr});var j2=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc),env:Y.string().optional()}).extend(qw);var hHr=Y.objectWithoutOptionalProperties({pathParameter:Y.string(),tail:Y.string()});var e5=Y.objectWithoutOptionalProperties({head:Y.string(),parts:Y.list(hHr)});var nat=Y.objectWithoutOptionalProperties({requestBodyType:Y.lazy(()=>lc),contentType:Y.string().optional()}).extend(os);var gHr=Y.objectWithoutOptionalProperties({name:po,extends:Y.list($y),properties:Y.list(tat),extendedProperties:Y.list(k2).optional(),contentType:Y.string().optional(),extraProperties:Y.property("extra-properties",Y.boolean())}).extend(os);var FHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},AHr=Y.union("type",{inlinedRequestBody:gHr,reference:nat,fileUpload:lHr,bytes:$st}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return KV.inlinedRequestBody(e);case"reference":return KV.reference(e);case"fileUpload":return KV.fileUpload(e);case"bytes":return KV.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=FHd(e,["_visit"]);return r}});var yHr=Y.objectWithoutOptionalProperties({responseBodyType:Y.lazy(()=>lc)}).extend(os);var bHr=Y.objectWithoutOptionalProperties({responseBodyType:Y.lazy(()=>lc),responseProperty:k2.optional()}).extend(os);var kHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},iat=Y.union("type",{response:yHr,nestedPropertyAsResponse:bHr}).transform({transform:e=>{switch(e.type){case"response":return UCe.response(e);case"nestedPropertyAsResponse":return UCe.nestedPropertyAsResponse(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=kHd(e,["_visit"]);return r}});var EHr=Y.objectWithoutOptionalProperties({payload:Y.lazy(()=>lc),terminator:Y.string().optional()}).extend(os);var vHr=Y.objectWithoutOptionalProperties({payload:Y.lazy(()=>lc),terminator:Y.string().optional()}).extend(os);var IHr=Y.objectWithoutOptionalProperties({}).extend(os);var NHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},oat=Y.union("type",{json:EHr,text:IHr,sse:vHr}).transform({transform:e=>{switch(e.type){case"json":return Tee.json(e);case"text":return Tee.text(e);case"sse":return Tee.sse(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=NHd(e,["_visit"]);return r}});var sat=Y.objectWithoutOptionalProperties({}).extend(os);var jHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},CHr=Y.union("type",{json:Y.object({value:iat}),fileDownload:eat,text:sat}).transform({transform:e=>{switch(e.type){case"json":return See.json(e.value);case"fileDownload":return See.fileDownload(e);case"text":return See.text(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=jHd(e,["_visit"]);return r}});var wHr=Y.objectWithoutOptionalProperties({nonStreamResponse:CHr,streamResponse:oat});var QHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},xHr=Y.union("type",{json:Y.object({value:iat}),fileDownload:eat,text:sat,streaming:Y.object({value:oat}),streamParameter:wHr}).transform({transform:e=>{switch(e.type){case"json":return mM.json(e.value);case"fileDownload":return mM.fileDownload(e);case"text":return mM.text(e);case"streaming":return mM.streaming(e.value);case"streamParameter":return mM.streamParameter(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=QHd(e,["_visit"]);return r}});var SHr=Y.objectWithoutOptionalProperties({statusCode:Y.property("status-code",Y.number().optional()),body:xHr.optional()});var THr=Y.objectWithoutOptionalProperties({page:N2,results:$V,hasNextPage:$V.optional(),step:N2.optional()});var MHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},BHr=Y.union("type",{cursor:ZWr,offset:THr}).transform({transform:e=>{switch(e.type){case"cursor":return _Ce.cursor(e);case"offset":return _Ce.offset(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=MHd(e,["_visit"]);return r}});var aat=Y.string();var OHr=Y.enum_(["ROOT","SERVICE","ENDPOINT"]);var vH=Y.objectWithoutOptionalProperties({name:po,valueType:Y.lazy(()=>lc),location:OHr,variable:aat.optional()}).extend(os);var PHr=Y.objectWithoutOptionalProperties({error:swe}).extend(os);var DHr=Y.list(PHr);var LHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},RHr=Y.union("type",{typeReference:nat,bytes:$st}).transform({transform:e=>{switch(e.type){case"typeReference":return qCe.typeReference(e);case"bytes":return qCe.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=LHd(e,["_visit"]);return r}});var FHr=Y.objectWithoutOptionalProperties({wrapperName:po,bodyKey:po,includePathParameters:Y.boolean().optional(),onlyPathParameters:Y.boolean().optional()});var zHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},kHr=Y.union("type",{justRequestBody:Y.object({value:RHr}),wrapper:FHr}).transform({transform:e=>{switch(e.type){case"justRequestBody":return GCe.justRequestBody(e.value);case"wrapper":return GCe.wrapper(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=zHd(e,["_visit"]);return r}});var NHr=Y.objectWithoutOptionalProperties({streamParameter:N2.optional(),requestParameterName:po,shape:kHr});var UHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},cat=Y.union("type",{http:Y.object({}),grpc:mHr}).transform({transform:e=>{switch(e.type){case"http":return WCe.http();case"grpc":return WCe.grpc(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=UHd(e,["_visit"]);return r}});var jHr=Y.objectWithoutOptionalProperties({codeSamples:Y.list(iHr).optional(),example:Zst.optional()});var QHr=Y.objectWithoutOptionalProperties({id:EH,name:eHr,displayName:Y.string().optional(),method:Qst,headers:Y.list(j2),baseUrl:iwe.optional(),basePath:e5.optional(),path:e5,fullPath:e5,pathParameters:Y.list(vH),allPathParameters:Y.list(vH),queryParameters:Y.list(twe),requestBody:AHr.optional(),sdkRequest:NHr.optional(),response:SHr.optional(),errors:DHr,auth:Y.boolean(),idempotent:Y.boolean(),pagination:BHr.optional(),userSpecifiedExamples:Y.list(jHr),autogeneratedExamples:Y.list(XWr),transport:cat.optional()}).extend(qw);var MHr=Y.objectWithoutOptionalProperties({});var LHr=Y.objectWithoutOptionalProperties({});var uat=Y.objectWithoutOptionalProperties({json:MHr.optional(),proto:LHr.optional()});var zHr=Y.objectWithoutOptionalProperties({availability:Fee.optional(),name:$Wr,displayName:Y.string().optional(),basePath:e5,endpoints:Y.list(QHr),headers:Y.list(j2),pathParameters:Y.list(vH),encoding:uat.optional(),transport:cat.optional()});var dOo={};te(dOo,{ApiDefinitionSource:()=>VHr,ApiDefinitionSourceId:()=>UHr,ApiVersionScheme:()=>GHr,ErrorDiscriminationByPropertyStrategy:()=>WHr,ErrorDiscriminationStrategy:()=>HHr,HeaderApiVersionScheme:()=>qHr,IntermediateRepresentation:()=>E_c,Package:()=>gat,PackageNavigationConfig:()=>$Kr,PlatformHeaders:()=>rJr,ProtoSource:()=>_Hr,ReadmeConfig:()=>eJr,SdkConfig:()=>nJr,ServiceTypeReferenceInfo:()=>iJr,SourceConfig:()=>oJr,Subpackage:()=>sJr,UserAgent:()=>tJr});var UHr=Y.string();var _Hr=Y.objectWithoutOptionalProperties({id:UHr,protoRootUrl:Y.string()});var _Hd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},VHr=Y.union("type",{proto:_Hr,openapi:Y.object({})}).transform({transform:e=>{switch(e.type){case"proto":return HCe.proto(e);case"openapi":return HCe.openapi();default:return e}},untransform:e=>{var{_visit:t}=e,r=_Hd(e,["_visit"]);return r}});var Vfe=Y.objectWithoutOptionalProperties({name:js}).extend(qw);var lat=Y.objectWithoutOptionalProperties({default:Vfe.optional(),values:Y.list(Vfe)});var qHr=Y.objectWithoutOptionalProperties({header:j2,value:lat});var VHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},GHr=Y.union("type",{header:qHr}).transform({transform:e=>e.type==="header"?Tst.header(e):e,untransform:e=>{var{_visit:t}=e,r=VHd(e,["_visit"]);return r}});var WHr=Y.objectWithoutOptionalProperties({discriminant:js,contentProperty:js});var qHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},HHr=Y.union("type",{statusCode:Y.object({}),property:WHr}).transform({transform:e=>{switch(e.type){case"statusCode":return KCe.statusCode();case"property":return KCe.property(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=qHd(e,["_visit"]);return r}});var KHr=Y.objectWithoutOptionalProperties({apiKey:Y.string(),workspaceId:Y.string(),collectionId:Y.string().optional()});var GHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},pat=Y.union("type",{postman:KHr}).transform({transform:e=>e.type==="postman"?Bst.postman(e):e,untransform:e=>{var{_visit:t}=e,r=GHd(e,["_visit"]);return r}});var JHr=Y.objectWithoutOptionalProperties({target:pat});var YHr=Y.objectWithoutOptionalProperties({owner:Y.string(),repo:Y.string(),target:pat});var WHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},XHr=Y.union("type",{github:YHr,direct:JHr}).transform({transform:e=>{switch(e.type){case"github":return YCe.github(e);case"direct":return YCe.direct(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=WHd(e,["_visit"]);return r}});var b5t=Y.objectWithoutOptionalProperties({name:po.optional(),shape:Y.lazy(()=>fat)}).extend(kee).extend(os);var ZHr=Y.objectWithoutOptionalProperties({file:rat,name:po});var HHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},$Hr=Y.union("type",{any:Y.object({}),api:Y.object({}),boolValue:Y.object({}),bytesValue:Y.object({}),doubleValue:Y.object({}),duration:Y.object({}),empty:Y.object({}),enum:Y.object({}),enumValue:Y.object({}),field:Y.object({}),fieldCardinality:Y.object({}),fieldKind:Y.object({}),fieldMask:Y.object({}),floatValue:Y.object({}),int32Value:Y.object({}),int64Value:Y.object({}),listValue:Y.object({}),method:Y.object({}),mixin:Y.object({}),nullValue:Y.object({}),option:Y.object({}),sourceContext:Y.object({}),stringValue:Y.object({}),struct:Y.object({}),syntax:Y.object({}),timestamp:Y.object({}),type:Y.object({}),uint32Value:Y.object({}),uint64Value:Y.object({}),value:Y.object({})}).transform({transform:e=>{switch(e.type){case"any":return la.any();case"api":return la.api();case"boolValue":return la.boolValue();case"bytesValue":return la.bytesValue();case"doubleValue":return la.doubleValue();case"duration":return la.duration();case"empty":return la.empty();case"enum":return la.enum();case"enumValue":return la.enumValue();case"field":return la.field();case"fieldCardinality":return la.fieldCardinality();case"fieldKind":return la.fieldKind();case"fieldMask":return la.fieldMask();case"floatValue":return la.floatValue();case"int32Value":return la.int32Value();case"int64Value":return la.int64Value();case"listValue":return la.listValue();case"method":return la.method();case"mixin":return la.mixin();case"nullValue":return la.nullValue();case"option":return la.option();case"sourceContext":return la.sourceContext();case"stringValue":return la.stringValue();case"struct":return la.struct();case"syntax":return la.syntax();case"timestamp":return la.timestamp();case"type":return la.type();case"uint32Value":return la.uint32Value();case"uint64Value":return la.uint64Value();case"value":return la.value();default:return e}},untransform:e=>{var{_visit:t}=e,r=HHd(e,["_visit"]);return r}});var KHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},eKr=Y.union("type",{wellKnown:Y.object({value:$Hr}),userDefined:ZHr}).transform({transform:e=>{switch(e.type){case"wellKnown":return JCe.wellKnown(e.value);case"userDefined":return JCe.userDefined(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=KHd(e,["_visit"]);return r}});var JHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},tKr=Y.union("type",{proto:Y.object({value:eKr})}).transform({transform:e=>e.type==="proto"?Dst.proto(e.value):e,untransform:e=>{var{_visit:t}=e,r=JHd(e,["_visit"]);return r}});var rKr=Y.objectWithoutOptionalProperties({});var nKr=Y.objectWithoutOptionalProperties({default:Y.string().optional()});var iKr=Y.objectWithoutOptionalProperties({default:Y.boolean().optional()});var oKr=Y.objectWithoutOptionalProperties({});var sKr=Y.objectWithoutOptionalProperties({});var aKr=Y.objectWithoutOptionalProperties({min:Y.number().optional(),max:Y.number().optional(),exclusiveMin:Y.boolean().optional(),exclusiveMax:Y.boolean().optional(),multipleOf:Y.number().optional()});var cKr=Y.objectWithoutOptionalProperties({default:Y.number().optional(),validation:aKr.optional()});var uKr=Y.objectWithoutOptionalProperties({});var lKr=Y.objectWithoutOptionalProperties({min:Y.number().optional(),max:Y.number().optional(),exclusiveMin:Y.boolean().optional(),exclusiveMax:Y.boolean().optional(),multipleOf:Y.number().optional()});var pKr=Y.objectWithoutOptionalProperties({default:Y.number().optional(),validation:lKr.optional()});var fKr=Y.objectWithoutOptionalProperties({default:Y.number().optional()});var dKr=Y.objectWithoutOptionalProperties({format:Y.string().optional(),pattern:Y.string().optional(),minLength:Y.number().optional(),maxLength:Y.number().optional()});var mKr=Y.objectWithoutOptionalProperties({default:Y.string().optional(),validation:dKr.optional()});var hKr=Y.objectWithoutOptionalProperties({});var gKr=Y.objectWithoutOptionalProperties({});var AKr=Y.objectWithoutOptionalProperties({});var YHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},yKr=Y.union("type",{integer:pKr,long:fKr,uint:gKr,uint64:hKr,float:uKr,double:cKr,boolean:iKr,string:mKr,date:sKr,dateTime:oKr,uuid:AKr,base64:rKr,bigInteger:nKr}).transform({transform:e=>{switch(e.type){case"integer":return Ag.integer(e);case"long":return Ag.long(e);case"uint":return Ag.uint(e);case"uint64":return Ag.uint64(e);case"float":return Ag.float(e);case"double":return Ag.double(e);case"boolean":return Ag.boolean(e);case"string":return Ag.string(e);case"date":return Ag.date(e);case"dateTime":return Ag.dateTime(e);case"uuid":return Ag.uuid(e);case"base64":return Ag.base64(e);case"bigInteger":return Ag.bigInteger(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=YHd(e,["_visit"]);return r}});var dat=Y.objectWithoutOptionalProperties({v1:zst,v2:yKr.optional()});var bKr=Y.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var EKr=Y.objectWithoutOptionalProperties({name:$y,shape:bKr});var XHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},vKr=Y.union(Y.discriminant("type","_type"),{container:Y.object({container:Y.lazy(()=>mat)}),named:EKr,primitive:Y.object({primitive:dat}),unknown:Y.object({})}).transform({transform:e=>{switch(e.type){case"container":return YV.container(e.container);case"named":return YV.named(e);case"primitive":return YV.primitive(e.primitive);case"unknown":return YV.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=XHd(e,["_visit"]);return r}});var IKr=Y.objectWithoutOptionalProperties({aliasOf:Y.lazy(()=>lc),resolvedType:vKr});var CKr=Y.objectWithoutOptionalProperties({extends:Y.list($y),properties:Y.list(k2),extendedProperties:Y.list(k2).optional(),extraProperties:Y.property("extra-properties",Y.boolean())});var wKr=Y.objectWithoutOptionalProperties({type:Y.lazy(()=>lc)}).extend(os);var xKr=Y.objectWithoutOptionalProperties({members:Y.list(wKr)});var SKr=Y.objectWithoutOptionalProperties({name:js,type:Y.lazy(()=>lc)});var ZHd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},TKr=Y.union(Y.discriminant("propertiesType","_type"),{samePropertiesAsObject:$y,singleProperty:SKr,noProperties:Y.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return Pee.samePropertiesAsObject(e);case"singleProperty":return Pee.singleProperty(e);case"noProperties":return Pee.noProperties();default:return e}},untransform:e=>{var{_visit:t}=e,r=ZHd(e,["_visit"]);return r}});var BKr=Y.objectWithoutOptionalProperties({discriminantValue:js,shape:TKr,displayName:Y.string().optional(),availability:Fee.optional()}).extend(os);var OKr=Y.objectWithoutOptionalProperties({discriminant:js,extends:Y.list($y),types:Y.list(BKr),baseProperties:Y.list(k2)});var $Hd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},PKr=Y.union(Y.discriminant("type","_type"),{alias:IKr,enum:lat,object:CKr,union:OKr,undiscriminatedUnion:xKr}).transform({transform:e=>{switch(e.type){case"alias":return yM.alias(e);case"enum":return yM.enum(e);case"object":return yM.object(e);case"union":return yM.union(e);case"undiscriminatedUnion":return yM.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=$Hd(e,["_visit"]);return r}});var DKr=Y.objectWithoutOptionalProperties({name:$y,shape:PKr,autogeneratedExamples:Y.list(b5t),userProvidedExamples:Y.list(b5t),referencedTypes:Y.set(iv),encoding:uat.optional(),source:tKr.optional(),inline:Y.boolean().optional()}).extend(qw);var RKr=Y.objectWithoutOptionalProperties({id:aat,name:po,type:Y.lazy(()=>lc)}).extend(os);var FKr=Y.objectWithoutOptionalProperties({name:po.optional(),payload:Y.lazyObject(()=>Dp)}).extend(os);var kKr=Y.enum_(["GET","POST"]);var NKr=po;var jKr=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc)}).extend(nwe);var QKr=Y.objectWithoutOptionalProperties({name:po,extends:Y.list($y),properties:Y.list(jKr)});var MKr=Y.objectWithoutOptionalProperties({payloadType:Y.lazy(()=>lc)}).extend(os);var eKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},LKr=Y.union("type",{inlinedPayload:QKr,reference:MKr}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return ZCe.inlinedPayload(e);case"reference":return ZCe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=eKd(e,["_visit"]);return r}});var zKr=Y.objectWithoutOptionalProperties({id:O9r,name:NKr,displayName:Y.string().optional(),method:kKr,headers:Y.list(j2),payload:LKr,examples:Y.list(FKr).optional()}).extend(qw);var UKr=Y.list(zKr);var tKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},_Kr=Y.union("type",{inlinedBody:Xst,reference:Y.lazyObject(()=>Dp)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return $Ce.inlinedBody(e);case"reference":return $Ce.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=tKd(e,["_visit"]);return r}});var hat=Y.string();var VKr=Y.objectWithoutOptionalProperties({type:hat,body:_Kr});var qKr=Y.objectWithoutOptionalProperties({name:po.optional(),url:Y.string(),pathParameters:Y.list(awe),headers:Y.list(qze),queryParameters:Y.list(Yst),messages:Y.list(VKr)}).extend(os);var GKr=Y.objectWithoutOptionalProperties({name:js,valueType:Y.lazy(()=>lc)}).extend(nwe);var WKr=Y.objectWithoutOptionalProperties({name:po,extends:Y.list($y),properties:Y.list(GKr)});var HKr=Y.objectWithoutOptionalProperties({bodyType:Y.lazy(()=>lc)}).extend(os);var rKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},KKr=Y.union("type",{inlinedBody:WKr,reference:HKr}).transform({transform:e=>{switch(e.type){case"inlinedBody":return ewe.inlinedBody(e);case"reference":return ewe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=rKd(e,["_visit"]);return r}});var JKr=Y.enum_(["client","server"]);var YKr=Y.objectWithoutOptionalProperties({type:hat,displayName:Y.string().optional(),origin:JKr,body:KKr}).extend(qw);var XKr=po;var ZKr=Y.objectWithoutOptionalProperties({name:XKr,displayName:Y.string().optional(),path:e5,auth:Y.boolean(),headers:Y.list(j2),queryParameters:Y.list(twe),pathParameters:Y.list(vH),messages:Y.list(YKr),examples:Y.list(qKr)}).extend(qw);var $Kr=Y.objectWithoutOptionalProperties({pointsTo:Ree});var gat=Y.objectWithoutOptionalProperties({fernFilepath:bM,service:Dee.optional(),types:Y.list(iv),errors:Y.list(rwe),webhooks:kst.optional(),websocket:Nst.optional(),subpackages:Y.list(Ree),hasEndpointsInTree:Y.boolean(),navigationConfig:$Kr.optional()}).extend(os);var eJr=Y.objectWithoutOptionalProperties({defaultEndpoint:EH.optional(),bannerLink:Y.string().optional(),introduction:Y.string().optional(),apiReferenceLink:Y.string().optional(),features:Y.record(B9r,Y.list(EH)).optional()});var tJr=Y.objectWithoutOptionalProperties({header:Y.stringLiteral("User-Agent"),value:Y.string()});var rJr=Y.objectWithoutOptionalProperties({language:Y.string(),sdkName:Y.string(),sdkVersion:Y.string(),userAgent:tJr.optional()});var nJr=Y.objectWithoutOptionalProperties({isAuthMandatory:Y.boolean(),hasStreamingEndpoints:Y.boolean(),hasPaginatedEndpoints:Y.boolean(),hasFileDownloadEndpoints:Y.boolean(),platformHeaders:rJr});var iJr=Y.objectWithoutOptionalProperties({typesReferencedOnlyByService:Y.record(Dee,Y.list(iv)),sharedTypes:Y.list(iv)});var oJr=Y.objectWithoutOptionalProperties({sources:Y.list(VHr)});var sJr=Y.objectWithoutOptionalProperties({name:po}).extend(gat);var E_c=Y.objectWithoutOptionalProperties({fdrApiDefinitionId:Y.string().optional(),apiVersion:GHr.optional(),apiName:po,apiDisplayName:Y.string().optional(),apiDocs:Y.string().optional(),auth:S9r,headers:Y.list(j2),idempotencyHeaders:Y.list(j2),types:Y.record(iv,DKr),services:Y.record(Dee,zHr),webhookGroups:Y.record(kst,UKr),websocketChannels:Y.record(Nst,ZKr).optional(),errors:Y.record(rwe,AWr),subpackages:Y.record(Ree,sJr),rootPackage:gat,constants:P9r,environments:hWr.optional(),basePath:e5.optional(),pathParameters:Y.list(vH),errorDiscriminationStrategy:HHr,sdkConfig:nJr,variables:Y.list(RKr),serviceTypeReferenceInfo:iJr,readmeConfig:eJr.optional(),sourceConfig:oJr.optional(),publishConfig:XHr.optional(),dynamic:oWr.optional()});var mOo={};te(mOo,{CsharpProtobufFileOptions:()=>pHr,ProtobufFile:()=>rat,ProtobufFileOptions:()=>fHr,ProtobufService:()=>dHr,ProtobufType:()=>eKr,UserDefinedProtobufType:()=>ZHr,WellKnownProtobufType:()=>$Hr});var hOo={};te(hOo,{DirectPublish:()=>JHr,GithubPublish:()=>YHr,PostmanPublishTarget:()=>KHr,PublishTarget:()=>pat,PublishingConfig:()=>XHr});var gOo={};te(gOo,{AliasTypeDeclaration:()=>IKr,Base64Type:()=>rKr,BigIntegerType:()=>nKr,BooleanType:()=>iKr,ContainerType:()=>mat,DateTimeType:()=>oKr,DateType:()=>sKr,DeclaredTypeName:()=>$y,DoubleType:()=>cKr,DoubleValidationRules:()=>aKr,Encoding:()=>uat,EnumTypeDeclaration:()=>lat,EnumTypeReference:()=>v_c,EnumValue:()=>Vfe,ExampleAliasType:()=>uJr,ExampleContainer:()=>fJr,ExampleDatetime:()=>lJr,ExampleEnumType:()=>AJr,ExampleKeyValuePair:()=>yJr,ExampleListContainer:()=>dJr,ExampleLiteralContainer:()=>pJr,ExampleMapContainer:()=>mJr,ExampleNamedType:()=>bJr,ExampleObjectProperty:()=>EJr,ExampleObjectType:()=>yat,ExampleObjectTypeWithTypeId:()=>vJr,ExampleOptionalContainer:()=>hJr,ExamplePrimitive:()=>Aat,ExampleSetContainer:()=>gJr,ExampleSingleUnionType:()=>IJr,ExampleSingleUnionTypeProperties:()=>CJr,ExampleType:()=>b5t,ExampleTypeReference:()=>Dp,ExampleTypeReferenceShape:()=>wJr,ExampleTypeShape:()=>fat,ExampleUndiscriminatedUnionType:()=>xJr,ExampleUnionType:()=>SJr,FloatType:()=>uKr,IntegerType:()=>pKr,IntegerValidationRules:()=>lKr,JsonEncoding:()=>MHr,Literal:()=>aJr,LongType:()=>fKr,MapType:()=>cJr,NamedType:()=>BJr,NamedTypeDefault:()=>TJr,ObjectProperty:()=>k2,ObjectTypeDeclaration:()=>CKr,PrimitiveType:()=>dat,PrimitiveTypeV1:()=>zst,PrimitiveTypeV2:()=>yKr,ProtoEncoding:()=>LHr,ResolvedNamedType:()=>EKr,ResolvedTypeReference:()=>vKr,ShapeType:()=>bKr,SingleUnionType:()=>BKr,SingleUnionTypeProperties:()=>TKr,SingleUnionTypeProperty:()=>SKr,Source:()=>tKr,StringType:()=>mKr,StringValidationRules:()=>dKr,Type:()=>PKr,TypeDeclaration:()=>DKr,TypeReference:()=>lc,Uint64Type:()=>hKr,UintType:()=>gKr,UndiscriminatedUnionMember:()=>wKr,UndiscriminatedUnionTypeDeclaration:()=>xKr,UnionTypeDeclaration:()=>OKr,UuidType:()=>AKr});var nKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},aJr=Y.union("type",{string:Y.object({string:Y.string()}),boolean:Y.object({boolean:Y.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return XCe.string(e.string);case"boolean":return XCe.boolean(e.boolean);default:return e}},untransform:e=>{var{_visit:t}=e,r=nKd(e,["_visit"]);return r}});var iKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},mat=Y.union(Y.discriminant("type","_type"),{list:Y.object({list:Y.lazy(()=>lc)}),map:Y.lazyObject(()=>cJr),optional:Y.object({optional:Y.lazy(()=>lc)}),set:Y.object({set:Y.lazy(()=>lc)}),literal:Y.object({literal:aJr})}).transform({transform:e=>{switch(e.type){case"list":return hM.list(e.list);case"map":return hM.map(e);case"optional":return hM.optional(e.optional);case"set":return hM.set(e.set);case"literal":return hM.literal(e.literal);default:return e}},untransform:e=>{var{_visit:t}=e,r=iKd(e,["_visit"]);return r}});var v_c=Y.objectWithoutOptionalProperties({default:Vfe.optional(),name:$y});var uJr=Y.objectWithoutOptionalProperties({value:Y.lazyObject(()=>Dp)});var lJr=Y.objectWithoutOptionalProperties({datetime:Y.date(),raw:Y.string().optional()});var oKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Aat=Y.union("type",{integer:Y.object({integer:Y.number()}),long:Y.object({long:Y.number()}),uint:Y.object({uint:Y.number()}),uint64:Y.object({uint64:Y.number()}),float:Y.object({float:Y.number()}),double:Y.object({double:Y.number()}),boolean:Y.object({boolean:Y.boolean()}),string:Y.object({string:T9r}),date:Y.object({date:Y.string()}),datetime:lJr,uuid:Y.object({uuid:Y.string()}),base64:Y.object({base64:Y.string()}),bigInteger:Y.object({bigInteger:Y.string()})}).transform({transform:e=>{switch(e.type){case"integer":return gg.integer(e.integer);case"long":return gg.long(e.long);case"uint":return gg.uint(e.uint);case"uint64":return gg.uint64(e.uint64);case"float":return gg.float(e.float);case"double":return gg.double(e.double);case"boolean":return gg.boolean(e.boolean);case"string":return gg.string(e.string);case"date":return gg.date(e.date);case"datetime":return gg.datetime(e);case"uuid":return gg.uuid(e.uuid);case"base64":return gg.base64(e.base64);case"bigInteger":return gg.bigInteger(e.bigInteger);default:return e}},untransform:e=>{var{_visit:t}=e,r=oKd(e,["_visit"]);return r}});var pJr=Y.objectWithoutOptionalProperties({literal:Aat});var sKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},fJr=Y.union("type",{list:Y.lazyObject(()=>dJr),set:Y.lazyObject(()=>gJr),optional:Y.lazyObject(()=>hJr),map:Y.lazyObject(()=>mJr),literal:pJr}).transform({transform:e=>{switch(e.type){case"list":return gM.list(e);case"set":return gM.set(e);case"optional":return gM.optional(e);case"map":return gM.map(e);case"literal":return gM.literal(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=sKd(e,["_visit"]);return r}});var AJr=Y.objectWithoutOptionalProperties({value:js});var yJr=Y.objectWithoutOptionalProperties({key:Y.lazyObject(()=>Dp),value:Y.lazyObject(()=>Dp)});var dJr=Y.objectWithoutOptionalProperties({list:Y.list(Y.lazyObject(()=>Dp)),itemType:Y.lazy(()=>lc)});var mJr=Y.objectWithoutOptionalProperties({map:Y.list(Y.lazyObject(()=>yJr)),keyType:Y.lazy(()=>lc),valueType:Y.lazy(()=>lc)});var bJr=Y.objectWithoutOptionalProperties({typeName:$y,shape:Y.lazy(()=>fat)});var EJr=Y.objectWithoutOptionalProperties({name:js,value:Y.lazyObject(()=>Dp),originalTypeDeclaration:$y});var yat=Y.objectWithoutOptionalProperties({properties:Y.list(Y.lazyObject(()=>EJr))});var vJr=Y.objectWithoutOptionalProperties({typeId:iv,object:Y.lazyObject(()=>yat)});var hJr=Y.objectWithoutOptionalProperties({optional:Y.lazyObject(()=>Dp).optional(),valueType:Y.lazy(()=>lc)});var gJr=Y.objectWithoutOptionalProperties({set:Y.list(Y.lazyObject(()=>Dp)),itemType:Y.lazy(()=>lc)});var IJr=Y.objectWithoutOptionalProperties({wireDiscriminantValue:js,shape:Y.lazy(()=>CJr)});var aKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},CJr=Y.union("type",{samePropertiesAsObject:Y.lazyObject(()=>vJr),singleProperty:Y.lazyObject(()=>Dp),noProperties:Y.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return Oee.samePropertiesAsObject(e);case"singleProperty":return Oee.singleProperty(e);case"noProperties":return Oee.noProperties();default:return e}},untransform:e=>{var{_visit:t}=e,r=aKd(e,["_visit"]);return r}});var Dp=Y.objectWithoutOptionalProperties({shape:Y.lazy(()=>wJr)}).extend(kee);var cKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},wJr=Y.union("type",{primitive:Y.object({primitive:Aat}),container:Y.object({container:Y.lazy(()=>fJr)}),unknown:Y.object({unknown:Y.unknown()}),named:Y.lazyObject(()=>bJr)}).transform({transform:e=>{switch(e.type){case"primitive":return JV.primitive(e.primitive);case"container":return JV.container(e.container);case"unknown":return JV.unknown(e.unknown);case"named":return JV.named(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=cKd(e,["_visit"]);return r}});var uKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},fat=Y.union("type",{alias:Y.lazyObject(()=>uJr),enum:AJr,object:Y.lazyObject(()=>yat),union:Y.lazyObject(()=>SJr),undiscriminatedUnion:Y.lazyObject(()=>xJr)}).transform({transform:e=>{switch(e.type){case"alias":return AM.alias(e);case"enum":return AM.enum(e);case"object":return AM.object(e);case"union":return AM.union(e);case"undiscriminatedUnion":return AM.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=uKd(e,["_visit"]);return r}});var xJr=Y.objectWithoutOptionalProperties({index:Y.number(),singleUnionType:Y.lazyObject(()=>Dp)});var SJr=Y.objectWithoutOptionalProperties({discriminant:js,singleUnionType:Y.lazyObject(()=>IJr)});var cJr=Y.objectWithoutOptionalProperties({keyType:Y.lazy(()=>lc),valueType:Y.lazy(()=>lc)});var lKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},TJr=Y.union("type",{enum:Vfe}).transform({transform:e=>e.type==="enum"?Ost.enum(e):e,untransform:e=>{var{_visit:t}=e,r=lKd(e,["_visit"]);return r}});var BJr=Y.objectWithoutOptionalProperties({typeId:iv,fernFilepath:bM,name:po,default:TJr.optional(),inline:Y.boolean().optional()});var pKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},lc=Y.union(Y.discriminant("type","_type"),{container:Y.object({container:Y.lazy(()=>mat)}),named:BJr,primitive:Y.object({primitive:dat}),unknown:Y.object({})}).transform({transform:e=>{switch(e.type){case"container":return XV.container(e.container);case"named":return XV.named(e);case"primitive":return XV.primitive(e.primitive);case"unknown":return XV.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=pKd(e,["_visit"]);return r}});var AOo={};te(AOo,{VariableDeclaration:()=>RKr,VariableId:()=>aat});var yOo={};te(yOo,{ExampleWebhookCall:()=>FKr,InlinedWebhookPayload:()=>QKr,InlinedWebhookPayloadProperty:()=>jKr,Webhook:()=>zKr,WebhookGroup:()=>UKr,WebhookHttpMethod:()=>kKr,WebhookName:()=>NKr,WebhookPayload:()=>LKr,WebhookPayloadReference:()=>MKr});var bOo={};te(bOo,{ExampleWebSocketMessage:()=>VKr,ExampleWebSocketMessageBody:()=>_Kr,ExampleWebSocketSession:()=>qKr,InlinedWebSocketMessageBody:()=>WKr,InlinedWebSocketMessageBodyProperty:()=>GKr,WebSocketChannel:()=>ZKr,WebSocketMessage:()=>YKr,WebSocketMessageBody:()=>KKr,WebSocketMessageBodyReference:()=>HKr,WebSocketMessageId:()=>hat,WebSocketMessageOrigin:()=>JKr,WebSocketName:()=>XKr});var ea={};te(ea,{AliasTypeDeclaration:()=>JZr,ApiAuth:()=>ZJr,ApiDefinitionSource:()=>gZr,ApiDefinitionSourceId:()=>mZr,ApiVersionScheme:()=>yZr,AuthScheme:()=>YJr,AuthSchemesRequirement:()=>XJr,AutogeneratedEndpointExample:()=>wXr,Availability:()=>Vee,AvailabilityStatus:()=>UJr,Base64Type:()=>OZr,BasicAuthScheme:()=>MJr,BearerAuthScheme:()=>LJr,BigIntegerType:()=>PZr,BooleanType:()=>DZr,BytesRequest:()=>Yat,BytesResponse:()=>Xat,Constants:()=>rYr,ContainerType:()=>fct,CsharpProtobufFileOptions:()=>MXr,CursorPagination:()=>xXr,DateTimeType:()=>RZr,DateType:()=>FZr,Declaration:()=>Gw,DeclaredErrorName:()=>Fwe,DeclaredServiceName:()=>SXr,DeclaredTypeName:()=>eb,DirectPublish:()=>IZr,DoubleType:()=>NZr,DoubleValidationRules:()=>kZr,Encoding:()=>act,EndpointId:()=>CH,EndpointName:()=>TXr,EndpointReference:()=>Oat,EnumTypeDeclaration:()=>cct,EnumTypeReference:()=>CVc,EnumValue:()=>Wfe,EnvironmentBaseUrlId:()=>Wee,EnvironmentBaseUrlWithId:()=>CYr,EnvironmentId:()=>Gee,EnvironmentUrl:()=>Rwe,EnvironmentVariable:()=>a5,Environments:()=>BYr,EnvironmentsConfig:()=>jat,ErrorDeclaration:()=>qYr,ErrorDeclarationDiscriminantValue:()=>EVc,ErrorDiscriminationByPropertyStrategy:()=>bZr,ErrorDiscriminationStrategy:()=>EZr,ErrorId:()=>Pwe,EscapedString:()=>$Jr,ExampleAliasType:()=>j$r,ExampleCodeSample:()=>DXr,ExampleCodeSampleLanguage:()=>BXr,ExampleCodeSampleSdk:()=>PXr,ExampleContainer:()=>L$r,ExampleDatetime:()=>Q$r,ExampleEndpointCall:()=>Jat,ExampleEndpointErrorResponse:()=>EXr,ExampleEndpointSuccessResponse:()=>IXr,ExampleEnumType:()=>q$r,ExampleError:()=>VYr,ExampleHeader:()=>Kze,ExampleInlinedRequestBody:()=>Kat,ExampleInlinedRequestBodyProperty:()=>yXr,ExampleKeyValuePair:()=>G$r,ExampleListContainer:()=>z$r,ExampleLiteralContainer:()=>M$r,ExampleMapContainer:()=>U$r,ExampleNamedType:()=>W$r,ExampleObjectProperty:()=>H$r,ExampleObjectType:()=>gct,ExampleObjectTypeWithTypeId:()=>K$r,ExampleOptionalContainer:()=>_$r,ExamplePathParameter:()=>kwe,ExamplePrimitive:()=>hct,ExampleQueryParameter:()=>Hat,ExampleQueryParameterShape:()=>AXr,ExampleRequestBody:()=>bXr,ExampleResponse:()=>CXr,ExampleServerSideEvent:()=>vXr,ExampleSetContainer:()=>V$r,ExampleSingleUnionType:()=>J$r,ExampleSingleUnionTypeProperties:()=>Y$r,ExampleType:()=>C5t,ExampleTypeReference:()=>Rp,ExampleTypeReferenceShape:()=>X$r,ExampleTypeShape:()=>lct,ExampleUndiscriminatedUnionType:()=>Z$r,ExampleUnionType:()=>$$r,ExampleWebSocketMessage:()=>g$r,ExampleWebSocketMessageBody:()=>h$r,ExampleWebSocketSession:()=>A$r,ExampleWebhookCall:()=>s$r,FeatureId:()=>eYr,FernFilepath:()=>wM,FileDownloadResponse:()=>Zat,FileProperty:()=>kXr,FilePropertyArray:()=>RXr,FilePropertySingle:()=>FXr,FileUploadBodyProperty:()=>NXr,FileUploadRequest:()=>QXr,FileUploadRequestProperty:()=>jXr,FloatType:()=>jZr,GithubPublish:()=>CZr,GrpcTransport:()=>UXr,HeaderApiVersionScheme:()=>AZr,HeaderAuthScheme:()=>zJr,HttpEndpoint:()=>lZr,HttpHeader:()=>z2,HttpMethod:()=>kat,HttpPath:()=>u5,HttpPathPart:()=>_Xr,HttpRequestBody:()=>qXr,HttpRequestBodyReference:()=>tct,HttpResponse:()=>$Xr,HttpResponseBody:()=>ZXr,HttpService:()=>dZr,InlinedRequestBody:()=>VXr,InlinedRequestBodyProperty:()=>$at,InlinedWebSocketMessageBody:()=>b$r,InlinedWebSocketMessageBodyProperty:()=>y$r,InlinedWebhookPayload:()=>l$r,InlinedWebhookPayloadProperty:()=>u$r,IntegerType:()=>MZr,IntegerValidationRules:()=>QZr,IntermediateRepresentation:()=>IVc,JsonEncoding:()=>pZr,JsonResponse:()=>rct,JsonResponseBody:()=>GXr,JsonResponseBodyWithProperty:()=>WXr,JsonStreamChunk:()=>HXr,Literal:()=>k$r,LongType:()=>LZr,MapType:()=>N$r,MultipleBaseUrlsEnvironment:()=>wYr,MultipleBaseUrlsEnvironments:()=>xYr,Name:()=>fo,NameAndWireValue:()=>Qs,NamedType:()=>ten,NamedTypeDefault:()=>een,NonStreamHttpResponseBody:()=>YXr,OAuthAccessTokenRequestProperties:()=>GJr,OAuthAccessTokenResponseProperties:()=>Pat,OAuthClientCredentials:()=>HJr,OAuthConfiguration:()=>KJr,OAuthRefreshEndpoint:()=>qJr,OAuthRefreshTokenRequestProperties:()=>VJr,OAuthScheme:()=>JJr,OAuthTokenEndpoint:()=>WJr,ObjectProperty:()=>M2,ObjectTypeDeclaration:()=>YZr,OffsetPagination:()=>eZr,Package:()=>mct,PackageNavigationConfig:()=>S$r,Pagination:()=>tZr,PathParameter:()=>wH,PathParameterLocation:()=>rZr,PlatformHeaders:()=>O$r,PostmanPublishTarget:()=>vZr,PrimitiveType:()=>pct,PrimitiveTypeV1:()=>Mat,PrimitiveTypeV2:()=>GZr,ProtoEncoding:()=>fZr,ProtoSource:()=>hZr,ProtobufFile:()=>ect,ProtobufFileOptions:()=>LXr,ProtobufService:()=>zXr,ProtobufType:()=>TZr,PublishTarget:()=>uct,PublishingConfig:()=>wZr,QueryParameter:()=>Owe,ReadmeConfig:()=>T$r,RequestProperty:()=>L2,RequestPropertyValue:()=>_Jr,ResolvedNamedType:()=>HZr,ResolvedTypeReference:()=>KZr,ResponseError:()=>nZr,ResponseErrors:()=>iZr,ResponseProperty:()=>c5,SafeAndUnsafeString:()=>Hze,SdkConfig:()=>P$r,SdkRequest:()=>cZr,SdkRequestBodyType:()=>oZr,SdkRequestShape:()=>aZr,SdkRequestWrapper:()=>sZr,ServiceId:()=>Uee,ServiceTypeReferenceInfo:()=>D$r,ShapeType:()=>WZr,SingleBaseUrlEnvironment:()=>SYr,SingleBaseUrlEnvironments:()=>TYr,SingleUnionType:()=>t$r,SingleUnionTypeProperties:()=>e$r,SingleUnionTypeProperty:()=>$Zr,Source:()=>BZr,SourceConfig:()=>R$r,SseStreamChunk:()=>KXr,StreamParameterResponse:()=>XXr,StreamingResponse:()=>nct,StringType:()=>UZr,StringValidationRules:()=>zZr,Subpackage:()=>F$r,SubpackageId:()=>_ee,SupportedSdkLanguage:()=>OXr,TextResponse:()=>ict,TextStreamChunk:()=>JXr,Transport:()=>sct,Type:()=>n$r,TypeDeclaration:()=>i$r,TypeId:()=>ov,TypeReference:()=>pc,Uint64Type:()=>_Zr,UintType:()=>VZr,UndiscriminatedUnionMember:()=>XZr,UndiscriminatedUnionTypeDeclaration:()=>ZZr,UnionTypeDeclaration:()=>r$r,UserAgent:()=>B$r,UserDefinedProtobufType:()=>xZr,UserSpecifiedEndpointExample:()=>uZr,UuidType:()=>qZr,VariableDeclaration:()=>o$r,VariableId:()=>oct,WebSocketChannel:()=>x$r,WebSocketChannelId:()=>Rat,WebSocketMessage:()=>C$r,WebSocketMessageBody:()=>v$r,WebSocketMessageBodyReference:()=>E$r,WebSocketMessageId:()=>dct,WebSocketMessageOrigin:()=>I$r,WebSocketName:()=>w$r,Webhook:()=>d$r,WebhookGroup:()=>m$r,WebhookGroupId:()=>Dat,WebhookHttpMethod:()=>a$r,WebhookId:()=>tYr,WebhookName:()=>c$r,WebhookPayload:()=>f$r,WebhookPayloadReference:()=>p$r,WellKnownProtobufType:()=>SZr,WithDocs:()=>Vo,WithDocsAndAvailability:()=>Dwe,WithJsonExample:()=>qee,auth:()=>UOo,commons:()=>_Oo,constants:()=>VOo,dynamic:()=>IC,environment:()=>XOo,errors:()=>ZOo,generatorExec:()=>ePo,http:()=>tPo,ir:()=>rPo,proto:()=>nPo,publish:()=>iPo,types:()=>oPo,variables:()=>sPo,webhooks:()=>aPo,websocket:()=>cPo});var UOo={};te(UOo,{ApiAuth:()=>ZJr,AuthScheme:()=>YJr,AuthSchemesRequirement:()=>XJr,BasicAuthScheme:()=>MJr,BearerAuthScheme:()=>LJr,EnvironmentVariable:()=>a5,HeaderAuthScheme:()=>zJr,OAuthAccessTokenRequestProperties:()=>GJr,OAuthAccessTokenResponseProperties:()=>Pat,OAuthClientCredentials:()=>HJr,OAuthConfiguration:()=>KJr,OAuthRefreshEndpoint:()=>qJr,OAuthRefreshTokenRequestProperties:()=>VJr,OAuthScheme:()=>JJr,OAuthTokenEndpoint:()=>WJr});var J={};te(J,{JsonError:()=>bat,ParseError:()=>Eat,any:()=>N_c,bigint:()=>C_c,boolean:()=>j_c,booleanLiteral:()=>F_c,date:()=>w_c,discriminant:()=>W_c,enum_:()=>PJr,getObjectLikeUtils:()=>IH,getObjectUtils:()=>Gze,getSchemaUtils:()=>mh,isProperty:()=>Gfe,lazy:()=>x_c,lazyObject:()=>D_c,list:()=>RJr,never:()=>Q_c,number:()=>M_c,object:()=>DJr,objectWithoutOptionalProperties:()=>P_c,optional:()=>EOo,property:()=>T_c,record:()=>__c,set:()=>V_c,string:()=>L_c,stringLiteral:()=>k_c,transform:()=>vOo,undiscriminatedUnion:()=>G_c,union:()=>K_c,unknown:()=>z_c,withParsedProperties:()=>wOo});var Il={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 xm(e,t){return`Expected ${t}. Received ${fKd(e)}.`}function fKd(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function dT(e){return Object.assign(Object.assign({},e),{json:I_c(e.json),parse:I_c(e.parse)})}function I_c(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(`
|
|
3650
3650
|
`)),{ok:!0,value:t}):n}}function OJr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var bat=class e extends Error{constructor(t){super(t.map(OJr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var Eat=class e extends Error{constructor(t){super(t.map(OJr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function mh(e){return{nullable:()=>dKd(e),optional:()=>EOo(e),optionalNullable:()=>mKd(e),transform:t=>vOo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new Eat(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new bat(n.errors)}}}function dKd(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:()=>Il.NULLABLE};return Object.assign(Object.assign({},t),mh(t))}function EOo(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:()=>Il.OPTIONAL};return Object.assign(Object.assign({},t),mh(t))}function mKd(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:()=>Il.OPTIONAL_NULLABLE};return Object.assign(Object.assign({},t),mh(t))}function vOo(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 Object.assign(Object.assign({},r),mh(r))}function C_c(){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:xm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:xm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>Il.BIGINT};return Object.assign(Object.assign({},dT(e)),mh(e))}var hKd=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function w_c(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:xm(t,"string")}]}:hKd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:xm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:xm(t,"Date object")}]},getType:()=>Il.DATE};return Object.assign(Object.assign({},dT(e)),mh(e))}function mT(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return Object.assign(Object.assign({},dT(r)),mh(r))}}function PJr(e){let t=new Set(e);return mT(Il.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:xm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:xm(n,"enum")}]}:{ok:!0,value:n})()}function x_c(e){let t=IOo(e);return Object.assign(Object.assign({},t),mh(t))}function IOo(e){return{parse:(t,r)=>vat(e).parse(t,r),json:(t,r)=>vat(e).json(t,r),getType:()=>vat(e).getType()}}function vat(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function COo(e){return Object.entries(e)}function E5t(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}function qfe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}function v5t(e){return Object.keys(e)}function S_c(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var gKd=Object.prototype.hasOwnProperty;function IH(e){return{withParsedProperties:t=>wOo(e,t)}}function wOo(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(gKd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:Object.assign(Object.assign({},o.value),s)}},json:(n,i)=>{var o;if(!qfe(n))return{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:xm(n,"object")}]};let s=new Set(Object.keys(t)),a=E5t(n,Object.keys(n).filter(c=>!s.has(c)));return e.json(a,i)},getType:()=>e.getType()};return Object.assign(Object.assign(Object.assign({},r),mh(r)),IH(r))}function T_c(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Gfe(e){return e.isProperty}var AKd=Object.prototype.hasOwnProperty;function DJr(e){let t;function r(){if(t==null){t={};for(let[d,f]of COo(e)){let m=Gfe(f)?f.rawKey:d,h=Gfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:h}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of COo(e)){let m=Gfe(f)?f.rawKey:d,h=Gfe(f)?f.valueSchema:f;yKd(h)&&(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])=>Gfe(f)?f.rawKey:d),_getParsedProperties:()=>v5t(e),parse:(d,f)=>{var m;let h=(m=f?.breadcrumbsPrefix)!==null&&m!==void 0?m:[];return B_c({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:A=>{let y=r()[A];if(y!=null)return{transformedKey:y.parsedKey,transform:I=>{let w=[...h,A];return y.valueSchema.parse(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:h,omitUndefined:f?.omitUndefined})},json:(d,f)=>{var m;let h=(m=f?.breadcrumbsPrefix)!==null&&m!==void 0?m:[];return B_c({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:A=>{let y=e[A];if(y!=null)return Gfe(y)?{transformedKey:y.rawKey,transform:I=>{let w=[...h,A];return y.valueSchema.json(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}:{transformedKey:A,transform:I=>{let w=[...h,A];return y.json(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:h,omitUndefined:f?.omitUndefined})},getType:()=>Il.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},dT(p)),mh(p)),IH(p)),Gze(p))}function B_c({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!qfe(e))return{ok:!1,errors:[{path:s,message:xm(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!AKd.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 Gze(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>O_c({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>O_c({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Il.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},r),mh(r)),IH(r)),Gze(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,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},json:(i,o)=>{let s=e.json(i,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},getType:()=>Il.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},n),mh(n)),IH(n)),Gze(n))}}}function O_c({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!qfe(t))return{ok:!1,errors:[{path:i,message:xm(t,"object")}]};let o=new Set(e),[s,a]=S_c(v5t(t),l=>o.has(l)),c=r(E5t(t,a)),u=n(E5t(t,s));return c.ok&&u.ok?{ok:!0,value:Object.assign(Object.assign({},c.value),u.value)}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function yKd(e){return!bKd(e)}function bKd(e){switch(e.getType()){case Il.ANY:case Il.UNKNOWN:case Il.OPTIONAL:case Il.OPTIONAL_NULLABLE:return!0;default:return!1}}function P_c(e){return DJr(e)}function D_c(e){let t=Object.assign(Object.assign({},IOo(e)),{_getRawProperties:()=>vat(e)._getRawProperties(),_getParsedProperties:()=>vat(e)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},t),mh(t)),IH(t)),Gze(t))}function RJr(e){let t={parse:(r,n)=>R_c(r,(i,o)=>{var s;return e.parse(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),json:(r,n)=>R_c(r,(i,o)=>{var s;return e.json(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),getType:()=>Il.LIST};return Object.assign(Object.assign({},dT(t)),mh(t))}function R_c(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:xm(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}}function F_c(e){return mT(Il.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:xm(r,`${e.toString()}`)}]})()}function k_c(e){return mT(Il.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:xm(r,`"${e}"`)}]})()}var N_c=mT(Il.ANY,e=>({ok:!0,value:e}));var j_c=mT(Il.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:xm(e,"boolean")}]});var Q_c=mT(Il.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}));var M_c=mT(Il.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:xm(e,"number")}]});var L_c=mT(Il.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:xm(e,"string")}]});var z_c=mT(Il.UNKNOWN,e=>({ok:!0,value:e}));var EKd=Object.prototype.hasOwnProperty;function __c(e,t){let r={parse:(n,i)=>U_c({value:n,isKeyNumeric:e.getType()===Il.NUMBER,transformKey:o=>{var s;return e.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>U_c({value:n,isKeyNumeric:e.getType()===Il.NUMBER,transformKey:o=>{var s;return e.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Il.RECORD};return Object.assign(Object.assign({},dT(r)),mh(r))}function U_c({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!qfe(e))return{ok:!1,errors:[{path:i,message:xm(e,"object")}]};let o={},s=[];for(let a in e){if(!EKd.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}}function V_c(e){let t=RJr(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)=>{var o;return n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:xm(n,"Set")}]}},getType:()=>Il.SET};return Object.assign(Object.assign({},dT(r)),mh(r))}function G_c(e){let t={parse:(r,n)=>q_c((i,o)=>i.parse(r,o),e,n),json:(r,n)=>q_c((i,o)=>i.json(r,o),e,n),getType:()=>Il.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},dT(t)),mh(t))}function q_c(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,Object.assign(Object.assign({},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}}function W_c(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var vKd=Object.prototype.hasOwnProperty;function K_c(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=PJr(v5t(t)),o={parse:(s,a)=>H_c({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>{var u;return i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],r]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>H_c({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>{var u;return i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],n]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>Il.UNION};return Object.assign(Object.assign(Object.assign({},dT(o)),mh(o)),IH(o))}function H_c({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!qfe(e))return{ok:!1,errors:[{path:a,message:xm(e,"object")}]};let c=e[t],u={};for(let f in e)vKd.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:Object.assign({[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:Object.assign({[r]:c},d.value)}:d}var Vo=J.objectWithoutOptionalProperties({docs:J.string().optional()});var vn={};te(vn,{ApiDefinitionSource:()=>vwe,ApiVersionScheme:()=>wat,AuthScheme:()=>t5,AuthSchemesRequirement:()=>FJr,AvailabilityStatus:()=>Cat,ContainerType:()=>EM,Environments:()=>cwe,ErrorDeclarationDiscriminantValue:()=>uwe,ErrorDiscriminationStrategy:()=>Iwe,ExampleCodeSample:()=>lwe,ExampleContainer:()=>vM,ExampleEndpointSuccessResponse:()=>Nee,ExamplePrimitive:()=>yg,ExampleQueryParameterShape:()=>jee,ExampleRequestBody:()=>pwe,ExampleResponse:()=>fwe,ExampleSingleUnionTypeProperties:()=>Lee,ExampleTypeReferenceShape:()=>i5,ExampleTypeShape:()=>IM,ExampleWebSocketMessageBody:()=>Twe,FileProperty:()=>dwe,FileUploadRequestProperty:()=>mwe,HttpMethod:()=>Wze,HttpRequestBody:()=>r5,HttpResponseBody:()=>AR,JsonResponse:()=>hwe,Literal:()=>xwe,NamedTypeDefault:()=>Sat,NonStreamHttpResponseBody:()=>n5,OAuthConfiguration:()=>Iat,Pagination:()=>gwe,PathParameterLocation:()=>I5t,PrimitiveTypeV1:()=>Q2,PrimitiveTypeV2:()=>bg,ProtobufType:()=>Cwe,PublishTarget:()=>xat,PublishingConfig:()=>wwe,RequestPropertyValue:()=>Awe,ResolvedTypeReference:()=>o5,SdkRequestBodyType:()=>ywe,SdkRequestShape:()=>bwe,ShapeType:()=>Tat,SingleUnionTypeProperties:()=>zee,Source:()=>Bat,StreamingResponse:()=>Qee,SupportedSdkLanguage:()=>Mee,Transport:()=>Ewe,Type:()=>CM,TypeReference:()=>s5,WebSocketMessageBody:()=>Bwe,WebSocketMessageOrigin:()=>QJr,WebhookHttpMethod:()=>jJr,WebhookPayload:()=>Swe,WellKnownProtobufType:()=>pa,auth:()=>xOo,commons:()=>SOo,constants:()=>J_c,dynamic:()=>Bi,environment:()=>DOo,errors:()=>ROo,generatorExec:()=>ru,http:()=>kOo,ir:()=>NOo,proto:()=>jOo,publish:()=>QOo,types:()=>MOo,variables:()=>hVc,webhooks:()=>LOo,websocket:()=>zOo});var xOo={};te(xOo,{AuthScheme:()=>t5,AuthSchemesRequirement:()=>FJr,OAuthConfiguration:()=>Iat});var t5={bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return t5._visit(this,t)}}),basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return t5._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return t5._visit(this,t)}}),oauth:e=>Object.assign(Object.assign({},e),{type:"oauth",_visit:function(t){return t5._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bearer":return t.bearer(e);case"basic":return t.basic(e);case"header":return t.header(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var IKd={All:"ALL",Any:"ANY"},FJr=Object.assign(Object.assign({},IKd),{_visit:(e,t)=>{switch(e){case FJr.All:return t.all();case FJr.Any:return t.any();default:return t._other()}}});var Iat={clientCredentials:e=>Object.assign(Object.assign({},e),{type:"clientCredentials",_visit:function(t){return Iat._visit(this,t)}}),_visit:(e,t)=>e.type==="clientCredentials"?t.clientCredentials(e):t._other(e)};var SOo={};te(SOo,{AvailabilityStatus:()=>Cat});var CKd={InDevelopment:"IN_DEVELOPMENT",PreRelease:"PRE_RELEASE",GeneralAvailability:"GENERAL_AVAILABILITY",Deprecated:"DEPRECATED"},Cat=Object.assign(Object.assign({},CKd),{_visit:(e,t)=>{switch(e){case Cat.InDevelopment:return t.inDevelopment();case Cat.PreRelease:return t.preRelease();case Cat.GeneralAvailability:return t.generalAvailability();case Cat.Deprecated:return t.deprecated();default:return t._other()}}});var J_c={};var Bi={};te(Bi,{Auth:()=>Y_c,AuthValues:()=>X_c,ErrorSeverity:()=>kJr,FileUploadRequestBodyProperty:()=>$_c,InlinedRequestBody:()=>eVc,LiteralType:()=>sVc,NamedType:()=>aVc,ReferencedRequestBodyType:()=>tVc,Request:()=>rVc,Response:()=>nVc,SingleDiscriminatedUnionType:()=>cVc,TypeReference:()=>uVc,auth:()=>TOo,declaration:()=>Z_c,endpoints:()=>BOo,environment:()=>iVc,ir:()=>oVc,snippets:()=>OOo,types:()=>POo});var TOo={};te(TOo,{Auth:()=>Y_c,AuthValues:()=>X_c});var Y_c={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return Bi.Auth._visit(this,t)}}),bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return Bi.Auth._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Bi.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);default:return t._other(e)}}};var X_c={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return Bi.AuthValues._visit(this,t)}}),bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return Bi.AuthValues._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Bi.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);default:return t._other(e)}}};var Z_c={};var BOo={};te(BOo,{FileUploadRequestBodyProperty:()=>$_c,InlinedRequestBody:()=>eVc,ReferencedRequestBodyType:()=>tVc,Request:()=>rVc,Response:()=>nVc});var $_c={file:e=>Object.assign(Object.assign({},e),{type:"file",_visit:function(t){return Bi.FileUploadRequestBodyProperty._visit(this,t)}}),fileArray:e=>Object.assign(Object.assign({},e),{type:"fileArray",_visit:function(t){return Bi.FileUploadRequestBodyProperty._visit(this,t)}}),bodyProperty:e=>Object.assign(Object.assign({},e),{type:"bodyProperty",_visit:function(t){return Bi.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 eVc={properties:e=>({value:e,type:"properties",_visit:function(t){return Bi.InlinedRequestBody._visit(this,t)}}),referenced:e=>Object.assign(Object.assign({},e),{type:"referenced",_visit:function(t){return Bi.InlinedRequestBody._visit(this,t)}}),fileUpload:e=>Object.assign(Object.assign({},e),{type:"fileUpload",_visit:function(t){return Bi.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 tVc={bytes:()=>({type:"bytes",_visit:function(e){return Bi.ReferencedRequestBodyType._visit(this,e)}}),typeReference:e=>({value:e,type:"typeReference",_visit:function(t){return Bi.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 rVc={body:e=>Object.assign(Object.assign({},e),{type:"body",_visit:function(t){return Bi.Request._visit(this,t)}}),inlined:e=>Object.assign(Object.assign({},e),{type:"inlined",_visit:function(t){return Bi.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 nVc={json:()=>({type:"json",_visit:function(e){return Bi.Response._visit(this,e)}}),_visit:(e,t)=>e.type==="json"?t.json():t._other(e)};var iVc={};var oVc={};var OOo={};te(OOo,{ErrorSeverity:()=>kJr});var wKd={Critical:"CRITICAL",Warning:"WARNING"},kJr=Object.assign(Object.assign({},wKd),{_visit:(e,t)=>{switch(e){case kJr.Critical:return t.critical();case kJr.Warning:return t.warning();default:return t._other()}}});var POo={};te(POo,{LiteralType:()=>sVc,NamedType:()=>aVc,SingleDiscriminatedUnionType:()=>cVc,TypeReference:()=>uVc});var sVc={boolean:e=>({value:e,type:"boolean",_visit:function(t){return Bi.LiteralType._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Bi.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 aVc={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return Bi.NamedType._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return Bi.NamedType._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return Bi.NamedType._visit(this,t)}}),discriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"discriminatedUnion",_visit:function(t){return Bi.NamedType._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return Bi.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 cVc={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{type:"samePropertiesAsObject",_visit:function(t){return Bi.SingleDiscriminatedUnionType._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{type:"singleProperty",_visit:function(t){return Bi.SingleDiscriminatedUnionType._visit(this,t)}}),noProperties:e=>Object.assign(Object.assign({},e),{type:"noProperties",_visit:function(t){return Bi.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 uVc={list:e=>({value:e,type:"list",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),named:e=>({value:e,type:"named",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),optional:e=>({value:e,type:"optional",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),primitive:e=>({value:e,type:"primitive",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),set:e=>({value:e,type:"set",_visit:function(t){return Bi.TypeReference._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return Bi.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"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 DOo={};te(DOo,{Environments:()=>cwe});var cwe={singleBaseUrl:e=>Object.assign(Object.assign({},e),{type:"singleBaseUrl",_visit:function(t){return cwe._visit(this,t)}}),multipleBaseUrls:e=>Object.assign(Object.assign({},e),{type:"multipleBaseUrls",_visit:function(t){return cwe._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 ROo={};te(ROo,{ErrorDeclarationDiscriminantValue:()=>uwe});var uwe={property:e=>Object.assign(Object.assign({},e),{type:"property",_visit:function(t){return uwe._visit(this,t)}}),statusCode:()=>({type:"statusCode",_visit:function(e){return uwe._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"property":return t.property(e);case"statusCode":return t.statusCode();default:return t._other(e)}}};var ru={};te(ru,{GeneratorEnvironment:()=>lVc,GeneratorPublishTarget:()=>pVc,GithubPublishInfo:()=>fVc,LicenseConfig:()=>dVc,LicenseId:()=>NJr,OutputMode:()=>mVc,config:()=>FOo});var FOo={};te(FOo,{GeneratorEnvironment:()=>lVc,GeneratorPublishTarget:()=>pVc,GithubPublishInfo:()=>fVc,LicenseConfig:()=>dVc,LicenseId:()=>NJr,OutputMode:()=>mVc});var lVc={local:()=>({type:"local",_visit:function(e){return ru.GeneratorEnvironment._visit(this,e)}}),remote:e=>Object.assign(Object.assign({},e),{type:"remote",_visit:function(t){return ru.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 pVc={maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return ru.GeneratorPublishTarget._visit(this,t)}}),npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return ru.GeneratorPublishTarget._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return ru.GeneratorPublishTarget._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return ru.GeneratorPublishTarget._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return ru.GeneratorPublishTarget._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return ru.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);default:return t._other(e)}}};var fVc={npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return ru.GithubPublishInfo._visit(this,t)}}),maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return ru.GithubPublishInfo._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return ru.GithubPublishInfo._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return ru.GithubPublishInfo._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return ru.GithubPublishInfo._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return ru.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);default:return t._other(e)}}};var dVc={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return ru.LicenseConfig._visit(this,t)}}),custom:e=>Object.assign(Object.assign({},e),{type:"custom",_visit:function(t){return ru.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 xKd={Mit:"MIT",Apache2:"Apache-2.0"},NJr=Object.assign(Object.assign({},xKd),{_visit:(e,t)=>{switch(e){case NJr.Mit:return t.mit();case NJr.Apache2:return t.apache2();default:return t._other()}}});var mVc={publish:e=>Object.assign(Object.assign({},e),{type:"publish",_visit:function(t){return ru.OutputMode._visit(this,t)}}),downloadFiles:()=>({type:"downloadFiles",_visit:function(e){return ru.OutputMode._visit(this,e)}}),github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return ru.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 kOo={};te(kOo,{ExampleCodeSample:()=>lwe,ExampleEndpointSuccessResponse:()=>Nee,ExampleQueryParameterShape:()=>jee,ExampleRequestBody:()=>pwe,ExampleResponse:()=>fwe,FileProperty:()=>dwe,FileUploadRequestProperty:()=>mwe,HttpMethod:()=>Wze,HttpRequestBody:()=>r5,HttpResponseBody:()=>AR,JsonResponse:()=>hwe,NonStreamHttpResponseBody:()=>n5,Pagination:()=>gwe,PathParameterLocation:()=>I5t,RequestPropertyValue:()=>Awe,SdkRequestBodyType:()=>ywe,SdkRequestShape:()=>bwe,StreamingResponse:()=>Qee,SupportedSdkLanguage:()=>Mee,Transport:()=>Ewe});var lwe={language:e=>Object.assign(Object.assign({},e),{type:"language",_visit:function(t){return lwe._visit(this,t)}}),sdk:e=>Object.assign(Object.assign({},e),{type:"sdk",_visit:function(t){return lwe._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 Nee={body:e=>({value:e,type:"body",_visit:function(t){return Nee._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return Nee._visit(this,t)}}),sse:e=>({value:e,type:"sse",_visit:function(t){return Nee._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 jee={single:()=>({type:"single",_visit:function(e){return jee._visit(this,e)}}),exploded:()=>({type:"exploded",_visit:function(e){return jee._visit(this,e)}}),commaSeparated:()=>({type:"commaSeparated",_visit:function(e){return jee._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 pwe={inlinedRequestBody:e=>Object.assign(Object.assign({},e),{type:"inlinedRequestBody",_visit:function(t){return pwe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return pwe._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 fwe={ok:e=>({value:e,type:"ok",_visit:function(t){return fwe._visit(this,t)}}),error:e=>Object.assign(Object.assign({},e),{type:"error",_visit:function(t){return fwe._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 dwe={file:e=>Object.assign(Object.assign({},e),{type:"file",_visit:function(t){return dwe._visit(this,t)}}),fileArray:e=>Object.assign(Object.assign({},e),{type:"fileArray",_visit:function(t){return dwe._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 mwe={file:e=>({value:e,type:"file",_visit:function(t){return mwe._visit(this,t)}}),bodyProperty:e=>Object.assign(Object.assign({},e),{type:"bodyProperty",_visit:function(t){return mwe._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 SKd={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE"},Wze=Object.assign(Object.assign({},SKd),{_visit:(e,t)=>{switch(e){case Wze.Get:return t.get();case Wze.Post:return t.post();case Wze.Put:return t.put();case Wze.Patch:return t.patch();case Wze.Delete:return t.delete();default:return t._other()}}});var r5={inlinedRequestBody:e=>Object.assign(Object.assign({},e),{type:"inlinedRequestBody",_visit:function(t){return r5._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return r5._visit(this,t)}}),fileUpload:e=>Object.assign(Object.assign({},e),{type:"fileUpload",_visit:function(t){return r5._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return r5._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 AR={json:e=>({value:e,type:"json",_visit:function(t){return AR._visit(this,t)}}),fileDownload:e=>Object.assign(Object.assign({},e),{type:"fileDownload",_visit:function(t){return AR._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return AR._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return AR._visit(this,t)}}),streaming:e=>({value:e,type:"streaming",_visit:function(t){return AR._visit(this,t)}}),streamParameter:e=>Object.assign(Object.assign({},e),{type:"streamParameter",_visit:function(t){return AR._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 hwe={response:e=>Object.assign(Object.assign({},e),{type:"response",_visit:function(t){return hwe._visit(this,t)}}),nestedPropertyAsResponse:e=>Object.assign(Object.assign({},e),{type:"nestedPropertyAsResponse",_visit:function(t){return hwe._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 n5={json:e=>({value:e,type:"json",_visit:function(t){return n5._visit(this,t)}}),fileDownload:e=>Object.assign(Object.assign({},e),{type:"fileDownload",_visit:function(t){return n5._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return n5._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return n5._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 gwe={cursor:e=>Object.assign(Object.assign({},e),{type:"cursor",_visit:function(t){return gwe._visit(this,t)}}),offset:e=>Object.assign(Object.assign({},e),{type:"offset",_visit:function(t){return gwe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);default:return t._other(e)}}};var TKd={Root:"ROOT",Service:"SERVICE",Endpoint:"ENDPOINT"},I5t=Object.assign(Object.assign({},TKd),{_visit:(e,t)=>{switch(e){case I5t.Root:return t.root();case I5t.Service:return t.service();case I5t.Endpoint:return t.endpoint();default:return t._other()}}});var Awe={query:e=>Object.assign(Object.assign({},e),{type:"query",_visit:function(t){return Awe._visit(this,t)}}),body:e=>Object.assign(Object.assign({},e),{type:"body",_visit:function(t){return Awe._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 ywe={typeReference:e=>Object.assign(Object.assign({},e),{type:"typeReference",_visit:function(t){return ywe._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return ywe._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 bwe={justRequestBody:e=>({value:e,type:"justRequestBody",_visit:function(t){return bwe._visit(this,t)}}),wrapper:e=>Object.assign(Object.assign({},e),{type:"wrapper",_visit:function(t){return bwe._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 Qee={json:e=>Object.assign(Object.assign({},e),{type:"json",_visit:function(t){return Qee._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return Qee._visit(this,t)}}),sse:e=>Object.assign(Object.assign({},e),{type:"sse",_visit:function(t){return Qee._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 BKd={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java"},Mee=Object.assign(Object.assign({},BKd),{_visit:(e,t)=>{switch(e){case Mee.Curl:return t.curl();case Mee.Python:return t.python();case Mee.Javascript:return t.javascript();case Mee.Typescript:return t.typescript();case Mee.Go:return t.go();case Mee.Ruby:return t.ruby();case Mee.Csharp:return t.csharp();case Mee.Java:return t.java();default:return t._other()}}});var Ewe={http:()=>({type:"http",_visit:function(e){return Ewe._visit(this,e)}}),grpc:e=>Object.assign(Object.assign({},e),{type:"grpc",_visit:function(t){return Ewe._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 NOo={};te(NOo,{ApiDefinitionSource:()=>vwe,ApiVersionScheme:()=>wat,ErrorDiscriminationStrategy:()=>Iwe});var vwe={proto:e=>Object.assign(Object.assign({},e),{type:"proto",_visit:function(t){return vwe._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return vwe._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 wat={header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return wat._visit(this,t)}}),_visit:(e,t)=>e.type==="header"?t.header(e):t._other(e)};var Iwe={statusCode:()=>({type:"statusCode",_visit:function(e){return Iwe._visit(this,e)}}),property:e=>Object.assign(Object.assign({},e),{type:"property",_visit:function(t){return Iwe._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 jOo={};te(jOo,{ProtobufType:()=>Cwe,WellKnownProtobufType:()=>pa});var Cwe={wellKnown:e=>({value:e,type:"wellKnown",_visit:function(t){return Cwe._visit(this,t)}}),userDefined:e=>Object.assign(Object.assign({},e),{type:"userDefined",_visit:function(t){return Cwe._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 pa={any:()=>({type:"any",_visit:function(e){return pa._visit(this,e)}}),api:()=>({type:"api",_visit:function(e){return pa._visit(this,e)}}),boolValue:()=>({type:"boolValue",_visit:function(e){return pa._visit(this,e)}}),bytesValue:()=>({type:"bytesValue",_visit:function(e){return pa._visit(this,e)}}),doubleValue:()=>({type:"doubleValue",_visit:function(e){return pa._visit(this,e)}}),duration:()=>({type:"duration",_visit:function(e){return pa._visit(this,e)}}),empty:()=>({type:"empty",_visit:function(e){return pa._visit(this,e)}}),enum:()=>({type:"enum",_visit:function(e){return pa._visit(this,e)}}),enumValue:()=>({type:"enumValue",_visit:function(e){return pa._visit(this,e)}}),field:()=>({type:"field",_visit:function(e){return pa._visit(this,e)}}),fieldCardinality:()=>({type:"fieldCardinality",_visit:function(e){return pa._visit(this,e)}}),fieldKind:()=>({type:"fieldKind",_visit:function(e){return pa._visit(this,e)}}),fieldMask:()=>({type:"fieldMask",_visit:function(e){return pa._visit(this,e)}}),floatValue:()=>({type:"floatValue",_visit:function(e){return pa._visit(this,e)}}),int32Value:()=>({type:"int32Value",_visit:function(e){return pa._visit(this,e)}}),int64Value:()=>({type:"int64Value",_visit:function(e){return pa._visit(this,e)}}),listValue:()=>({type:"listValue",_visit:function(e){return pa._visit(this,e)}}),method:()=>({type:"method",_visit:function(e){return pa._visit(this,e)}}),mixin:()=>({type:"mixin",_visit:function(e){return pa._visit(this,e)}}),nullValue:()=>({type:"nullValue",_visit:function(e){return pa._visit(this,e)}}),option:()=>({type:"option",_visit:function(e){return pa._visit(this,e)}}),sourceContext:()=>({type:"sourceContext",_visit:function(e){return pa._visit(this,e)}}),stringValue:()=>({type:"stringValue",_visit:function(e){return pa._visit(this,e)}}),struct:()=>({type:"struct",_visit:function(e){return pa._visit(this,e)}}),syntax:()=>({type:"syntax",_visit:function(e){return pa._visit(this,e)}}),timestamp:()=>({type:"timestamp",_visit:function(e){return pa._visit(this,e)}}),type:()=>({type:"type",_visit:function(e){return pa._visit(this,e)}}),uint32Value:()=>({type:"uint32Value",_visit:function(e){return pa._visit(this,e)}}),uint64Value:()=>({type:"uint64Value",_visit:function(e){return pa._visit(this,e)}}),value:()=>({type:"value",_visit:function(e){return pa._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 QOo={};te(QOo,{PublishTarget:()=>xat,PublishingConfig:()=>wwe});var wwe={github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return wwe._visit(this,t)}}),direct:e=>Object.assign(Object.assign({},e),{type:"direct",_visit:function(t){return wwe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"github":return t.github(e);case"direct":return t.direct(e);default:return t._other(e)}}};var xat={postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return xat._visit(this,t)}}),_visit:(e,t)=>e.type==="postman"?t.postman(e):t._other(e)};var MOo={};te(MOo,{ContainerType:()=>EM,ExampleContainer:()=>vM,ExamplePrimitive:()=>yg,ExampleSingleUnionTypeProperties:()=>Lee,ExampleTypeReferenceShape:()=>i5,ExampleTypeShape:()=>IM,Literal:()=>xwe,NamedTypeDefault:()=>Sat,PrimitiveTypeV1:()=>Q2,PrimitiveTypeV2:()=>bg,ResolvedTypeReference:()=>o5,ShapeType:()=>Tat,SingleUnionTypeProperties:()=>zee,Source:()=>Bat,Type:()=>CM,TypeReference:()=>s5});var EM={list:e=>({list:e,type:"list",_visit:function(t){return EM._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return EM._visit(this,t)}}),optional:e=>({optional:e,type:"optional",_visit:function(t){return EM._visit(this,t)}}),set:e=>({set:e,type:"set",_visit:function(t){return EM._visit(this,t)}}),literal:e=>({literal:e,type:"literal",_visit:function(t){return EM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.list);case"map":return t.map(e);case"optional":return t.optional(e.optional);case"set":return t.set(e.set);case"literal":return t.literal(e.literal);default:return t._other(e)}}};var vM={list:e=>Object.assign(Object.assign({},e),{type:"list",_visit:function(t){return vM._visit(this,t)}}),set:e=>Object.assign(Object.assign({},e),{type:"set",_visit:function(t){return vM._visit(this,t)}}),optional:e=>Object.assign(Object.assign({},e),{type:"optional",_visit:function(t){return vM._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return vM._visit(this,t)}}),literal:e=>Object.assign(Object.assign({},e),{type:"literal",_visit:function(t){return vM._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e);case"set":return t.set(e);case"optional":return t.optional(e);case"map":return t.map(e);case"literal":return t.literal(e);default:return t._other(e)}}};var yg={integer:e=>({integer:e,type:"integer",_visit:function(t){return yg._visit(this,t)}}),long:e=>({long:e,type:"long",_visit:function(t){return yg._visit(this,t)}}),uint:e=>({uint:e,type:"uint",_visit:function(t){return yg._visit(this,t)}}),uint64:e=>({uint64:e,type:"uint64",_visit:function(t){return yg._visit(this,t)}}),float:e=>({float:e,type:"float",_visit:function(t){return yg._visit(this,t)}}),double:e=>({double:e,type:"double",_visit:function(t){return yg._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return yg._visit(this,t)}}),string:e=>({string:e,type:"string",_visit:function(t){return yg._visit(this,t)}}),date:e=>({date:e,type:"date",_visit:function(t){return yg._visit(this,t)}}),datetime:e=>Object.assign(Object.assign({},e),{type:"datetime",_visit:function(t){return yg._visit(this,t)}}),uuid:e=>({uuid:e,type:"uuid",_visit:function(t){return yg._visit(this,t)}}),base64:e=>({base64:e,type:"base64",_visit:function(t){return yg._visit(this,t)}}),bigInteger:e=>({bigInteger:e,type:"bigInteger",_visit:function(t){return yg._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e.integer);case"long":return t.long(e.long);case"uint":return t.uint(e.uint);case"uint64":return t.uint64(e.uint64);case"float":return t.float(e.float);case"double":return t.double(e.double);case"boolean":return t.boolean(e.boolean);case"string":return t.string(e.string);case"date":return t.date(e.date);case"datetime":return t.datetime(e);case"uuid":return t.uuid(e.uuid);case"base64":return t.base64(e.base64);case"bigInteger":return t.bigInteger(e.bigInteger);default:return t._other(e)}}};var Lee={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{type:"samePropertiesAsObject",_visit:function(t){return Lee._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{type:"singleProperty",_visit:function(t){return Lee._visit(this,t)}}),noProperties:()=>({type:"noProperties",_visit:function(e){return Lee._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 i5={primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return i5._visit(this,t)}}),container:e=>({container:e,type:"container",_visit:function(t){return i5._visit(this,t)}}),unknown:e=>({unknown:e,type:"unknown",_visit:function(t){return i5._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return i5._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 IM={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return IM._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return IM._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return IM._visit(this,t)}}),union:e=>Object.assign(Object.assign({},e),{type:"union",_visit:function(t){return IM._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return IM._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 xwe={string:e=>({string:e,type:"string",_visit:function(t){return xwe._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return xwe._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 Sat={enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return Sat._visit(this,t)}}),_visit:(e,t)=>e.type==="enum"?t.enum(e):t._other(e)};var OKd={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER"},Q2=Object.assign(Object.assign({},OKd),{_visit:(e,t)=>{switch(e){case Q2.Integer:return t.integer();case Q2.Long:return t.long();case Q2.Uint:return t.uint();case Q2.Uint64:return t.uint64();case Q2.Float:return t.float();case Q2.Double:return t.double();case Q2.Boolean:return t.boolean();case Q2.String:return t.string();case Q2.Date:return t.date();case Q2.DateTime:return t.dateTime();case Q2.Uuid:return t.uuid();case Q2.Base64:return t.base64();case Q2.BigInteger:return t.bigInteger();default:return t._other()}}});var bg={integer:e=>Object.assign(Object.assign({},e),{type:"integer",_visit:function(t){return bg._visit(this,t)}}),long:e=>Object.assign(Object.assign({},e),{type:"long",_visit:function(t){return bg._visit(this,t)}}),uint:e=>Object.assign(Object.assign({},e),{type:"uint",_visit:function(t){return bg._visit(this,t)}}),uint64:e=>Object.assign(Object.assign({},e),{type:"uint64",_visit:function(t){return bg._visit(this,t)}}),float:e=>Object.assign(Object.assign({},e),{type:"float",_visit:function(t){return bg._visit(this,t)}}),double:e=>Object.assign(Object.assign({},e),{type:"double",_visit:function(t){return bg._visit(this,t)}}),boolean:e=>Object.assign(Object.assign({},e),{type:"boolean",_visit:function(t){return bg._visit(this,t)}}),string:e=>Object.assign(Object.assign({},e),{type:"string",_visit:function(t){return bg._visit(this,t)}}),date:e=>Object.assign(Object.assign({},e),{type:"date",_visit:function(t){return bg._visit(this,t)}}),dateTime:e=>Object.assign(Object.assign({},e),{type:"dateTime",_visit:function(t){return bg._visit(this,t)}}),uuid:e=>Object.assign(Object.assign({},e),{type:"uuid",_visit:function(t){return bg._visit(this,t)}}),base64:e=>Object.assign(Object.assign({},e),{type:"base64",_visit:function(t){return bg._visit(this,t)}}),bigInteger:e=>Object.assign(Object.assign({},e),{type:"bigInteger",_visit:function(t){return bg._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e);case"long":return t.long(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"boolean":return t.boolean(e);case"string":return t.string(e);case"date":return t.date(e);case"dateTime":return t.dateTime(e);case"uuid":return t.uuid(e);case"base64":return t.base64(e);case"bigInteger":return t.bigInteger(e);default:return t._other(e)}}};var o5={container:e=>({container:e,type:"container",_visit:function(t){return o5._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return o5._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return o5._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return o5._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 PKd={Enum:"ENUM",Object:"OBJECT",Union:"UNION",UndiscriminatedUnion:"UNDISCRIMINATED_UNION"},Tat=Object.assign(Object.assign({},PKd),{_visit:(e,t)=>{switch(e){case Tat.Enum:return t.enum();case Tat.Object:return t.object();case Tat.Union:return t.union();case Tat.UndiscriminatedUnion:return t.undiscriminatedUnion();default:return t._other()}}});var zee={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{propertiesType:"samePropertiesAsObject",_visit:function(t){return zee._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{propertiesType:"singleProperty",_visit:function(t){return zee._visit(this,t)}}),noProperties:()=>({propertiesType:"noProperties",_visit:function(e){return zee._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 Bat={proto:e=>({value:e,type:"proto",_visit:function(t){return Bat._visit(this,t)}}),_visit:(e,t)=>e.type==="proto"?t.proto(e.value):t._other(e)};var CM={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return CM._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return CM._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return CM._visit(this,t)}}),union:e=>Object.assign(Object.assign({},e),{type:"union",_visit:function(t){return CM._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return CM._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 s5={container:e=>({container:e,type:"container",_visit:function(t){return s5._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return s5._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return s5._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return s5._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 hVc={};var LOo={};te(LOo,{WebhookHttpMethod:()=>jJr,WebhookPayload:()=>Swe});var DKd={Get:"GET",Post:"POST"},jJr=Object.assign(Object.assign({},DKd),{_visit:(e,t)=>{switch(e){case jJr.Get:return t.get();case jJr.Post:return t.post();default:return t._other()}}});var Swe={inlinedPayload:e=>Object.assign(Object.assign({},e),{type:"inlinedPayload",_visit:function(t){return Swe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return Swe._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 zOo={};te(zOo,{ExampleWebSocketMessageBody:()=>Twe,WebSocketMessageBody:()=>Bwe,WebSocketMessageOrigin:()=>QJr});var Twe={inlinedBody:e=>Object.assign(Object.assign({},e),{type:"inlinedBody",_visit:function(t){return Twe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return Twe._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 Bwe={inlinedBody:e=>Object.assign(Object.assign({},e),{type:"inlinedBody",_visit:function(t){return Bwe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return Bwe._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 RKd={Client:"client",Server:"server"},QJr=Object.assign(Object.assign({},RKd),{_visit:(e,t)=>{switch(e){case QJr.Client:return t.client();case QJr.Server:return t.server();default:return t._other()}}});var Hze=J.objectWithoutOptionalProperties({unsafeName:J.string(),safeName:J.string()});var fo=J.objectWithoutOptionalProperties({originalName:J.string(),camelCase:Hze,pascalCase:Hze,snakeCase:Hze,screamingSnakeCase:Hze});var a5=J.string();var MJr=J.objectWithoutOptionalProperties({username:fo,usernameEnvVar:a5.optional(),password:fo,passwordEnvVar:a5.optional()}).extend(Vo);var LJr=J.objectWithoutOptionalProperties({token:fo,tokenEnvVar:a5.optional()}).extend(Vo);var Qs=J.objectWithoutOptionalProperties({wireValue:J.string(),name:fo});var zJr=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc),prefix:J.string().optional(),headerEnvVar:a5.optional()}).extend(Vo);var CH=J.string();var Uee=J.string();var _ee=J.string();var Oat=J.objectWithoutOptionalProperties({endpointId:CH,serviceId:Uee,subpackageId:_ee.optional()});var UJr=J.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var Vee=J.objectWithoutOptionalProperties({status:UJr,message:J.string().optional()});var Gw=J.objectWithoutOptionalProperties({availability:Vee.optional()}).extend(Vo);var M2=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc)}).extend(Gw);var c5=J.objectWithoutOptionalProperties({propertyPath:J.list(fo).optional(),property:M2});var Pat=J.objectWithoutOptionalProperties({accessToken:c5,expiresIn:c5.optional(),refreshToken:c5.optional()});var Owe=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc),allowMultiple:J.boolean()}).extend(Gw);var FKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},_Jr=J.union("type",{query:Owe,body:M2}).transform({transform:e=>{switch(e.type){case"query":return Awe.query(e);case"body":return Awe.body(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=FKd(e,["_visit"]);return r}});var L2=J.objectWithoutOptionalProperties({propertyPath:J.list(fo).optional(),property:_Jr});var VJr=J.objectWithoutOptionalProperties({refreshToken:L2});var qJr=J.objectWithoutOptionalProperties({endpointReference:Oat,requestProperties:VJr,responseProperties:Pat});var GJr=J.objectWithoutOptionalProperties({clientId:L2,clientSecret:L2,scopes:L2.optional()});var WJr=J.objectWithoutOptionalProperties({endpointReference:Oat,requestProperties:GJr,responseProperties:Pat});var HJr=J.objectWithoutOptionalProperties({clientIdEnvVar:a5.optional(),clientSecretEnvVar:a5.optional(),tokenPrefix:J.string().optional(),tokenHeader:J.string().optional(),scopes:J.list(J.string()).optional(),tokenEndpoint:WJr,refreshEndpoint:qJr.optional()});var kKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},KJr=J.union("type",{clientCredentials:HJr}).transform({transform:e=>e.type==="clientCredentials"?Iat.clientCredentials(e):e,untransform:e=>{var{_visit:t}=e,r=kKd(e,["_visit"]);return r}});var JJr=J.objectWithoutOptionalProperties({configuration:KJr}).extend(Vo);var NKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},YJr=J.union(J.discriminant("type","_type"),{bearer:LJr,basic:MJr,header:zJr,oauth:JJr}).transform({transform:e=>{switch(e.type){case"bearer":return t5.bearer(e);case"basic":return t5.basic(e);case"header":return t5.header(e);case"oauth":return t5.oauth(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=NKd(e,["_visit"]);return r}});var XJr=J.enum_(["ALL","ANY"]);var ZJr=J.objectWithoutOptionalProperties({requirement:XJr,schemes:J.list(YJr)}).extend(Vo);var _Oo={};te(_Oo,{Availability:()=>Vee,AvailabilityStatus:()=>UJr,Declaration:()=>Gw,EndpointId:()=>CH,EndpointReference:()=>Oat,ErrorId:()=>Pwe,EscapedString:()=>$Jr,FeatureId:()=>eYr,FernFilepath:()=>wM,Name:()=>fo,NameAndWireValue:()=>Qs,SafeAndUnsafeString:()=>Hze,ServiceId:()=>Uee,SubpackageId:()=>_ee,TypeId:()=>ov,WebSocketChannelId:()=>Rat,WebhookGroupId:()=>Dat,WebhookId:()=>tYr,WithDocs:()=>Vo,WithDocsAndAvailability:()=>Dwe,WithJsonExample:()=>qee});var Pwe=J.string();var $Jr=J.objectWithoutOptionalProperties({original:J.string()});var eYr=J.string();var wM=J.objectWithoutOptionalProperties({allParts:J.list(fo),packagePath:J.list(fo),file:fo.optional()});var ov=J.string();var Dat=J.string();var tYr=J.string();var Rat=J.string();var Dwe=J.objectWithoutOptionalProperties({availability:Vee.optional()}).extend(Vo);var qee=J.objectWithoutOptionalProperties({jsonExample:J.unknown()});var VOo={};te(VOo,{Constants:()=>rYr});var rYr=J.objectWithoutOptionalProperties({errorInstanceIdKey:Qs});var IC={};te(IC,{AliasType:()=>OYr,Auth:()=>sYr,AuthValues:()=>lYr,BasicAuth:()=>nYr,BasicAuthValues:()=>aYr,BearerAuth:()=>iYr,BearerAuthValues:()=>cYr,BodyRequest:()=>pYr,Declaration:()=>yR,DiscriminatedUnionType:()=>kYr,DynamicIntermediateRepresentation:()=>LYr,Endpoint:()=>EYr,EndpointLocation:()=>Nat,EndpointSnippetRequest:()=>gVc,EndpointSnippetResponse:()=>AVc,EnumType:()=>NYr,EnvironmentValues:()=>IYr,ErrorSeverity:()=>zYr,Error_:()=>UYr,FileUploadRequestBody:()=>dYr,FileUploadRequestBodyProperty:()=>fYr,HeaderAuth:()=>oYr,HeaderAuthValues:()=>uYr,InlinedRequest:()=>AYr,InlinedRequestBody:()=>hYr,InlinedRequestMetadata:()=>gYr,LiteralType:()=>_Yr,MapType:()=>yVc,MultipleEnvironmentUrlValues:()=>vYr,NamedParameter:()=>aE,NamedType:()=>MYr,ObjectType:()=>jYr,ReferencedRequestBody:()=>mYr,ReferencedRequestBodyType:()=>Fat,Request:()=>yYr,Response:()=>bYr,SingleDiscriminatedUnionType:()=>FYr,SingleDiscriminatedUnionTypeNoProperties:()=>PYr,SingleDiscriminatedUnionTypeObject:()=>DYr,SingleDiscriminatedUnionTypeSingleProperty:()=>RYr,TypeReference:()=>bVc,UndiscriminatedUnionType:()=>QYr,Values:()=>Qat,auth:()=>qOo,declaration:()=>GOo,endpoints:()=>WOo,environment:()=>HOo,ir:()=>KOo,snippets:()=>JOo,types:()=>YOo});var qOo={};te(qOo,{Auth:()=>sYr,AuthValues:()=>lYr,BasicAuth:()=>nYr,BasicAuthValues:()=>aYr,BearerAuth:()=>iYr,BearerAuthValues:()=>cYr,HeaderAuth:()=>oYr,HeaderAuthValues:()=>uYr});var nYr=J.objectWithoutOptionalProperties({username:fo,password:fo});var iYr=J.objectWithoutOptionalProperties({token:fo});var aE=J.objectWithoutOptionalProperties({name:Qs,typeReference:J.lazy(()=>IC.TypeReference)});var oYr=J.objectWithoutOptionalProperties({header:aE});var jKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},sYr=J.union("type",{basic:nYr,bearer:iYr,header:oYr}).transform({transform:e=>{switch(e.type){case"basic":return Bi.Auth.basic(e);case"bearer":return Bi.Auth.bearer(e);case"header":return Bi.Auth.header(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=jKd(e,["_visit"]);return r}});var aYr=J.objectWithoutOptionalProperties({username:J.string(),password:J.string()});var cYr=J.objectWithoutOptionalProperties({token:J.string()});var uYr=J.objectWithoutOptionalProperties({value:J.unknown()});var QKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},lYr=J.union("type",{basic:aYr,bearer:cYr,header:uYr}).transform({transform:e=>{switch(e.type){case"basic":return Bi.AuthValues.basic(e);case"bearer":return Bi.AuthValues.bearer(e);case"header":return Bi.AuthValues.header(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=QKd(e,["_visit"]);return r}});var GOo={};te(GOo,{Declaration:()=>yR});var yR=J.objectWithoutOptionalProperties({fernFilepath:wM,name:fo});var WOo={};te(WOo,{BodyRequest:()=>pYr,Endpoint:()=>EYr,EndpointLocation:()=>Nat,FileUploadRequestBody:()=>dYr,FileUploadRequestBodyProperty:()=>fYr,InlinedRequest:()=>AYr,InlinedRequestBody:()=>hYr,InlinedRequestMetadata:()=>gYr,ReferencedRequestBody:()=>mYr,ReferencedRequestBodyType:()=>Fat,Request:()=>yYr,Response:()=>bYr});var MKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Fat=J.union("type",{bytes:J.object({}),typeReference:J.object({value:J.lazy(()=>IC.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return Bi.ReferencedRequestBodyType.bytes();case"typeReference":return Bi.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=MKd(e,["_visit"]);return r}});var pYr=J.objectWithoutOptionalProperties({pathParameters:J.list(aE).optional(),body:Fat.optional()});var kat=J.enum_(["GET","POST","PUT","PATCH","DELETE"]);var Nat=J.objectWithoutOptionalProperties({method:kat,path:J.string()});var LKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},fYr=J.union("type",{file:Qs,fileArray:Qs,bodyProperty:aE}).transform({transform:e=>{switch(e.type){case"file":return Bi.FileUploadRequestBodyProperty.file(e);case"fileArray":return Bi.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return Bi.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=LKd(e,["_visit"]);return r}});var dYr=J.objectWithoutOptionalProperties({properties:J.list(fYr)});var mYr=J.objectWithoutOptionalProperties({bodyKey:fo,bodyType:Fat});var zKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},hYr=J.union("type",{properties:J.object({value:J.list(aE)}),referenced:mYr,fileUpload:dYr}).transform({transform:e=>{switch(e.type){case"properties":return Bi.InlinedRequestBody.properties(e.value);case"referenced":return Bi.InlinedRequestBody.referenced(e);case"fileUpload":return Bi.InlinedRequestBody.fileUpload(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=zKd(e,["_visit"]);return r}});var gYr=J.objectWithoutOptionalProperties({includePathParameters:J.boolean(),onlyPathParameters:J.boolean()});var AYr=J.objectWithoutOptionalProperties({declaration:yR,pathParameters:J.list(aE).optional(),queryParameters:J.list(aE).optional(),headers:J.list(aE).optional(),body:hYr.optional(),metadata:gYr.optional()});var UKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},yYr=J.union("type",{body:pYr,inlined:AYr}).transform({transform:e=>{switch(e.type){case"body":return Bi.Request.body(e);case"inlined":return Bi.Request.inlined(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=UKd(e,["_visit"]);return r}});var _Kd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},bYr=J.union("type",{json:J.object({})}).transform({transform:e=>e.type==="json"?Bi.Response.json():e,untransform:e=>{var{_visit:t}=e,r=_Kd(e,["_visit"]);return r}});var EYr=J.objectWithoutOptionalProperties({auth:sYr.optional(),declaration:yR,location:Nat,request:yYr,response:bYr});var HOo={};te(HOo,{EnvironmentValues:()=>IYr,MultipleEnvironmentUrlValues:()=>vYr});var Gee=J.string();var Wee=J.string();var Rwe=J.string();var vYr=J.record(Wee,Rwe);var IYr=J.undiscriminatedUnion([Gee,vYr]);var KOo={};te(KOo,{DynamicIntermediateRepresentation:()=>LYr});var CYr=J.objectWithoutOptionalProperties({id:Wee,name:fo});var wYr=J.objectWithoutOptionalProperties({id:Gee,name:fo,urls:J.record(Wee,Rwe)}).extend(Vo);var xYr=J.objectWithoutOptionalProperties({baseUrls:J.list(CYr),environments:J.list(wYr)});var SYr=J.objectWithoutOptionalProperties({id:Gee,name:fo,url:Rwe}).extend(Vo);var TYr=J.objectWithoutOptionalProperties({environments:J.list(SYr)});var VKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},BYr=J.union("type",{singleBaseUrl:TYr,multipleBaseUrls:xYr}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return cwe.singleBaseUrl(e);case"multipleBaseUrls":return cwe.multipleBaseUrls(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=VKd(e,["_visit"]);return r}});var jat=J.objectWithoutOptionalProperties({defaultEnvironment:Gee.optional(),environments:BYr});var OYr=J.objectWithoutOptionalProperties({declaration:yR,typeReference:J.lazy(()=>IC.TypeReference)});var PYr=J.objectWithoutOptionalProperties({discriminantValue:Qs,properties:J.list(aE).optional()});var DYr=J.objectWithoutOptionalProperties({typeId:ov,discriminantValue:Qs,properties:J.list(aE)});var RYr=J.objectWithoutOptionalProperties({typeReference:J.lazy(()=>IC.TypeReference),discriminantValue:Qs,properties:J.list(aE).optional()});var qKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},FYr=J.union("type",{samePropertiesAsObject:DYr,singleProperty:RYr,noProperties:PYr}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return Bi.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return Bi.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return Bi.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=qKd(e,["_visit"]);return r}});var kYr=J.objectWithoutOptionalProperties({declaration:yR,discriminant:Qs,types:J.record(J.string(),FYr)});var NYr=J.objectWithoutOptionalProperties({declaration:yR,values:J.list(Qs)});var jYr=J.objectWithoutOptionalProperties({declaration:yR,properties:J.list(aE)});var QYr=J.objectWithoutOptionalProperties({declaration:yR,types:J.list(J.lazy(()=>IC.TypeReference))});var GKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},MYr=J.union("type",{alias:OYr,enum:NYr,object:jYr,discriminatedUnion:kYr,undiscriminatedUnion:QYr}).transform({transform:e=>{switch(e.type){case"alias":return Bi.NamedType.alias(e);case"enum":return Bi.NamedType.enum(e);case"object":return Bi.NamedType.object(e);case"discriminatedUnion":return Bi.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return Bi.NamedType.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=GKd(e,["_visit"]);return r}});var LYr=J.objectWithoutOptionalProperties({version:J.stringLiteral("1.0.0"),types:J.record(ov,MYr),endpoints:J.record(CH,EYr),headers:J.list(aE).optional(),environments:jat.optional()});var JOo={};te(JOo,{EndpointSnippetRequest:()=>gVc,EndpointSnippetResponse:()=>AVc,ErrorSeverity:()=>zYr,Error_:()=>UYr,Values:()=>Qat});var Qat=J.record(J.string(),J.unknown());var gVc=J.objectWithoutOptionalProperties({endpoint:Nat,baseUrl:J.property("baseURL",J.string().optional()),environment:IYr.optional(),auth:lYr.optional(),pathParameters:Qat.optional(),queryParameters:Qat.optional(),headers:Qat.optional(),requestBody:J.unknown().optional()});var zYr=J.enum_(["CRITICAL","WARNING"]);var UYr=J.objectWithoutOptionalProperties({severity:zYr,message:J.string()});var AVc=J.objectWithoutOptionalProperties({snippet:J.string(),errors:J.list(UYr).optional()});var YOo={};te(YOo,{AliasType:()=>OYr,DiscriminatedUnionType:()=>kYr,EnumType:()=>NYr,LiteralType:()=>_Yr,MapType:()=>yVc,NamedParameter:()=>aE,NamedType:()=>MYr,ObjectType:()=>jYr,SingleDiscriminatedUnionType:()=>FYr,SingleDiscriminatedUnionTypeNoProperties:()=>PYr,SingleDiscriminatedUnionTypeObject:()=>DYr,SingleDiscriminatedUnionTypeSingleProperty:()=>RYr,TypeReference:()=>bVc,UndiscriminatedUnionType:()=>QYr});var WKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},_Yr=J.union("type",{boolean:J.object({value:J.boolean()}),string:J.object({value:J.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return Bi.LiteralType.boolean(e.value);case"string":return Bi.LiteralType.string(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=WKd(e,["_visit"]);return r}});var yVc=J.objectWithoutOptionalProperties({key:J.lazy(()=>IC.TypeReference),value:J.lazy(()=>IC.TypeReference)});var Mat=J.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var HKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},bVc=J.union("type",{list:J.object({value:J.lazy(()=>IC.TypeReference)}),literal:J.object({value:_Yr}),map:J.lazyObject(()=>IC.MapType),named:J.object({value:ov}),optional:J.object({value:J.lazy(()=>IC.TypeReference)}),primitive:J.object({value:Mat}),set:J.object({value:J.lazy(()=>IC.TypeReference)}),unknown:J.object({})}).transform({transform:e=>{switch(e.type){case"list":return Bi.TypeReference.list(e.value);case"literal":return Bi.TypeReference.literal(e.value);case"map":return Bi.TypeReference.map(e);case"named":return Bi.TypeReference.named(e.value);case"optional":return Bi.TypeReference.optional(e.value);case"primitive":return Bi.TypeReference.primitive(e.value);case"set":return Bi.TypeReference.set(e.value);case"unknown":return Bi.TypeReference.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=HKd(e,["_visit"]);return r}});var XOo={};te(XOo,{EnvironmentBaseUrlId:()=>Wee,EnvironmentBaseUrlWithId:()=>CYr,EnvironmentId:()=>Gee,EnvironmentUrl:()=>Rwe,Environments:()=>BYr,EnvironmentsConfig:()=>jat,MultipleBaseUrlsEnvironment:()=>wYr,MultipleBaseUrlsEnvironments:()=>xYr,SingleBaseUrlEnvironment:()=>SYr,SingleBaseUrlEnvironments:()=>TYr});var ZOo={};te(ZOo,{DeclaredErrorName:()=>Fwe,ErrorDeclaration:()=>qYr,ErrorDeclarationDiscriminantValue:()=>EVc,ExampleError:()=>VYr});var Fwe=J.objectWithoutOptionalProperties({errorId:Pwe,fernFilepath:wM,name:fo});var VYr=J.objectWithoutOptionalProperties({name:fo.optional(),shape:J.lazyObject(()=>Rp)}).extend(qee).extend(Vo);var qYr=J.objectWithoutOptionalProperties({name:Fwe,discriminantValue:Qs,type:J.lazy(()=>pc).optional(),statusCode:J.number(),examples:J.list(VYr)}).extend(Vo);var KKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},EVc=J.union("type",{property:Qs,statusCode:J.object({})}).transform({transform:e=>{switch(e.type){case"property":return uwe.property(e);case"statusCode":return uwe.statusCode();default:return e}},untransform:e=>{var{_visit:t}=e,r=KKd(e,["_visit"]);return r}});var ePo={};te(ePo,{BasicLicense:()=>WYr,CustomLicense:()=>HYr,EnvironmentVariable:()=>CC,GeneratorConfig:()=>vVc,GeneratorEnvironment:()=>JYr,GeneratorOutputConfig:()=>hXr,GeneratorPublishConfig:()=>Wat,GeneratorPublishTarget:()=>$Yr,GeneratorRegistriesConfig:()=>rXr,GeneratorRegistriesConfigV2:()=>nXr,GithubOutputMode:()=>fXr,GithubPublishInfo:()=>pXr,LicenseConfig:()=>gXr,LicenseId:()=>GYr,MavenCentralSignature:()=>Lat,MavenCentralSignatureGithubInfo:()=>iXr,MavenGithubPublishInfo:()=>oXr,MavenRegistryConfig:()=>eXr,MavenRegistryConfigV2:()=>zat,NpmGithubPublishInfo:()=>sXr,NpmRegistryConfig:()=>tXr,NpmRegistryConfigV2:()=>Uat,NugetGithubPublishInfo:()=>aXr,NugetRegistryConfig:()=>_at,OutputMetadata:()=>ZYr,OutputMetadataAuthor:()=>XYr,OutputMode:()=>dXr,PostmanConfig:()=>YYr,PostmanGithubPublishInfo:()=>cXr,PublishingMetadata:()=>mXr,PypiGithubPublishInfo:()=>uXr,PypiMetadata:()=>Vat,PypiRegistryConfig:()=>qat,RemoteGeneratorEnvironment:()=>KYr,RubyGemsGithubPublishInfo:()=>lXr,RubyGemsRegistryConfig:()=>Gat,config:()=>$Oo});var $Oo={};te($Oo,{BasicLicense:()=>WYr,CustomLicense:()=>HYr,EnvironmentVariable:()=>CC,GeneratorConfig:()=>vVc,GeneratorEnvironment:()=>JYr,GeneratorOutputConfig:()=>hXr,GeneratorPublishConfig:()=>Wat,GeneratorPublishTarget:()=>$Yr,GeneratorRegistriesConfig:()=>rXr,GeneratorRegistriesConfigV2:()=>nXr,GithubOutputMode:()=>fXr,GithubPublishInfo:()=>pXr,LicenseConfig:()=>gXr,LicenseId:()=>GYr,MavenCentralSignature:()=>Lat,MavenCentralSignatureGithubInfo:()=>iXr,MavenGithubPublishInfo:()=>oXr,MavenRegistryConfig:()=>eXr,MavenRegistryConfigV2:()=>zat,NpmGithubPublishInfo:()=>sXr,NpmRegistryConfig:()=>tXr,NpmRegistryConfigV2:()=>Uat,NugetGithubPublishInfo:()=>aXr,NugetRegistryConfig:()=>_at,OutputMetadata:()=>ZYr,OutputMetadataAuthor:()=>XYr,OutputMode:()=>dXr,PostmanConfig:()=>YYr,PostmanGithubPublishInfo:()=>cXr,PublishingMetadata:()=>mXr,PypiGithubPublishInfo:()=>uXr,PypiMetadata:()=>Vat,PypiRegistryConfig:()=>qat,RemoteGeneratorEnvironment:()=>KYr,RubyGemsGithubPublishInfo:()=>lXr,RubyGemsRegistryConfig:()=>Gat});var GYr=J.enum_(["MIT","Apache-2.0"]);var WYr=J.objectWithoutOptionalProperties({id:GYr});var HYr=J.objectWithoutOptionalProperties({filename:J.string()});var CC=J.string();var KYr=J.objectWithoutOptionalProperties({coordinatorUrl:J.string(),coordinatorUrlV2:J.string(),id:J.string()});var JKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},JYr=J.union(J.discriminant("type","_type"),{local:J.object({}),remote:KYr}).transform({transform:e=>{switch(e.type){case"local":return ru.GeneratorEnvironment.local();case"remote":return ru.GeneratorEnvironment.remote(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=JKd(e,["_visit"]);return r}});var Lat=J.objectWithoutOptionalProperties({keyId:J.string(),password:J.string(),secretKey:J.string()});var zat=J.objectWithoutOptionalProperties({registryUrl:J.string(),username:J.string(),password:J.string(),coordinate:J.string(),signature:Lat.optional()});var Uat=J.objectWithoutOptionalProperties({registryUrl:J.string(),token:J.string(),packageName:J.string()});var _at=J.objectWithoutOptionalProperties({registryUrl:J.string(),apiKey:J.string(),packageName:J.string()});var YYr=J.objectWithoutOptionalProperties({apiKey:J.string(),workspaceId:J.string()});var XYr=J.objectWithoutOptionalProperties({name:J.string(),email:J.string()});var ZYr=J.objectWithoutOptionalProperties({description:J.string().optional(),authors:J.list(XYr).optional()});var Vat=J.objectWithoutOptionalProperties({keywords:J.list(J.string()).optional(),documentationLink:J.string().optional(),homepageLink:J.string().optional()}).extend(ZYr);var qat=J.objectWithoutOptionalProperties({registryUrl:J.string(),username:J.string(),password:J.string(),packageName:J.string(),pypiMetadata:Vat.optional()});var Gat=J.objectWithoutOptionalProperties({registryUrl:J.string(),apiKey:J.string(),packageName:J.string()});var YKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},$Yr=J.union("type",{maven:zat,npm:Uat,pypi:qat,postman:YYr,rubygems:Gat,nuget:_at}).transform({transform:e=>{switch(e.type){case"maven":return ru.GeneratorPublishTarget.maven(e);case"npm":return ru.GeneratorPublishTarget.npm(e);case"pypi":return ru.GeneratorPublishTarget.pypi(e);case"postman":return ru.GeneratorPublishTarget.postman(e);case"rubygems":return ru.GeneratorPublishTarget.rubygems(e);case"nuget":return ru.GeneratorPublishTarget.nuget(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=YKd(e,["_visit"]);return r}});var eXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),username:J.string(),password:J.string(),group:J.string(),signature:Lat.optional()});var tXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),token:J.string(),scope:J.string()});var rXr=J.objectWithoutOptionalProperties({maven:eXr,npm:tXr});var nXr=J.objectWithoutOptionalProperties({maven:zat,npm:Uat,pypi:qat,rubygems:Gat,nuget:_at});var Wat=J.objectWithoutOptionalProperties({registries:rXr,registriesV2:nXr,publishTarget:$Yr.optional(),version:J.string()});var iXr=J.objectWithoutOptionalProperties({keyIdEnvironmentVariable:CC,passwordEnvironmentVariable:CC,secretKeyEnvironmentVariable:CC});var oXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),coordinate:J.string(),usernameEnvironmentVariable:CC,passwordEnvironmentVariable:CC,signature:iXr.optional(),shouldGeneratePublishWorkflow:J.boolean().optional()});var sXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),packageName:J.string(),tokenEnvironmentVariable:CC,shouldGeneratePublishWorkflow:J.boolean().optional()});var aXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),packageName:J.string(),apiKeyEnvironmentVariable:CC,shouldGeneratePublishWorkflow:J.boolean().optional()});var cXr=J.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:CC,workspaceIdEnvironmentVariable:CC});var uXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),packageName:J.string(),usernameEnvironmentVariable:CC,passwordEnvironmentVariable:CC,pypiMetadata:Vat.optional(),shouldGeneratePublishWorkflow:J.boolean().optional()});var lXr=J.objectWithoutOptionalProperties({registryUrl:J.string(),packageName:J.string(),apiKeyEnvironmentVariable:CC,shouldGeneratePublishWorkflow:J.boolean().optional()});var XKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},pXr=J.union("type",{npm:sXr,maven:oXr,postman:cXr,pypi:uXr,rubygems:lXr,nuget:aXr}).transform({transform:e=>{switch(e.type){case"npm":return ru.GithubPublishInfo.npm(e);case"maven":return ru.GithubPublishInfo.maven(e);case"postman":return ru.GithubPublishInfo.postman(e);case"pypi":return ru.GithubPublishInfo.pypi(e);case"rubygems":return ru.GithubPublishInfo.rubygems(e);case"nuget":return ru.GithubPublishInfo.nuget(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=XKd(e,["_visit"]);return r}});var fXr=J.objectWithoutOptionalProperties({version:J.string(),repoUrl:J.string(),installationToken:J.string().optional(),publishInfo:pXr.optional()});var ZKd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},dXr=J.union("type",{publish:Wat,downloadFiles:J.object({}),github:fXr}).transform({transform:e=>{switch(e.type){case"publish":return ru.OutputMode.publish(e);case"downloadFiles":return ru.OutputMode.downloadFiles();case"github":return ru.OutputMode.github(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=ZKd(e,["_visit"]);return r}});var mXr=J.objectWithoutOptionalProperties({packageDescription:J.property("package_description",J.string().optional()),publisherEmail:J.property("publisher_email",J.string().optional()),referenceUrl:J.property("reference_url",J.string().optional()),publisherName:J.property("publisher_name",J.string().optional())});var hXr=J.objectWithoutOptionalProperties({path:J.string(),snippetFilepath:J.string().optional(),snippetTemplateFilepath:J.string().optional(),publishingMetadata:mXr.optional(),mode:dXr});var $Kd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},gXr=J.union("type",{basic:WYr,custom:HYr}).transform({transform:e=>{switch(e.type){case"basic":return ru.LicenseConfig.basic(e);case"custom":return ru.LicenseConfig.custom(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=$Kd(e,["_visit"]);return r}});var vVc=J.objectWithoutOptionalProperties({dryRun:J.boolean(),irFilepath:J.string(),originalReadmeFilepath:J.string().optional(),license:gXr.optional(),output:hXr,publish:Wat.optional(),workspaceName:J.string(),organization:J.string(),customConfig:J.unknown(),environment:JYr,whitelabel:J.boolean(),writeUnitTests:J.boolean(),generatePaginatedClients:J.boolean().optional(),generateOauthClients:J.boolean()});var tPo={};te(tPo,{AutogeneratedEndpointExample:()=>wXr,BytesRequest:()=>Yat,BytesResponse:()=>Xat,CursorPagination:()=>xXr,DeclaredServiceName:()=>SXr,EndpointName:()=>TXr,ExampleCodeSample:()=>DXr,ExampleCodeSampleLanguage:()=>BXr,ExampleCodeSampleSdk:()=>PXr,ExampleEndpointCall:()=>Jat,ExampleEndpointErrorResponse:()=>EXr,ExampleEndpointSuccessResponse:()=>IXr,ExampleHeader:()=>Kze,ExampleInlinedRequestBody:()=>Kat,ExampleInlinedRequestBodyProperty:()=>yXr,ExamplePathParameter:()=>kwe,ExampleQueryParameter:()=>Hat,ExampleQueryParameterShape:()=>AXr,ExampleRequestBody:()=>bXr,ExampleResponse:()=>CXr,ExampleServerSideEvent:()=>vXr,FileDownloadResponse:()=>Zat,FileProperty:()=>kXr,FilePropertyArray:()=>RXr,FilePropertySingle:()=>FXr,FileUploadBodyProperty:()=>NXr,FileUploadRequest:()=>QXr,FileUploadRequestProperty:()=>jXr,GrpcTransport:()=>UXr,HttpEndpoint:()=>lZr,HttpHeader:()=>z2,HttpMethod:()=>kat,HttpPath:()=>u5,HttpPathPart:()=>_Xr,HttpRequestBody:()=>qXr,HttpRequestBodyReference:()=>tct,HttpResponse:()=>$Xr,HttpResponseBody:()=>ZXr,HttpService:()=>dZr,InlinedRequestBody:()=>VXr,InlinedRequestBodyProperty:()=>$at,JsonResponse:()=>rct,JsonResponseBody:()=>GXr,JsonResponseBodyWithProperty:()=>WXr,JsonStreamChunk:()=>HXr,NonStreamHttpResponseBody:()=>YXr,OffsetPagination:()=>eZr,Pagination:()=>tZr,PathParameter:()=>wH,PathParameterLocation:()=>rZr,QueryParameter:()=>Owe,RequestProperty:()=>L2,RequestPropertyValue:()=>_Jr,ResponseError:()=>nZr,ResponseErrors:()=>iZr,ResponseProperty:()=>c5,SdkRequest:()=>cZr,SdkRequestBodyType:()=>oZr,SdkRequestShape:()=>aZr,SdkRequestWrapper:()=>sZr,SseStreamChunk:()=>KXr,StreamParameterResponse:()=>XXr,StreamingResponse:()=>nct,SupportedSdkLanguage:()=>OXr,TextResponse:()=>ict,TextStreamChunk:()=>JXr,Transport:()=>sct,UserSpecifiedEndpointExample:()=>uZr});var Kze=J.objectWithoutOptionalProperties({name:Qs,value:J.lazyObject(()=>Rp)});var kwe=J.objectWithoutOptionalProperties({name:fo,value:J.lazyObject(()=>Rp)});var eJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},AXr=J.union("type",{single:J.object({}),exploded:J.object({}),commaSeparated:J.object({})}).transform({transform:e=>{switch(e.type){case"single":return jee.single();case"exploded":return jee.exploded();case"commaSeparated":return jee.commaSeparated();default:return e}},untransform:e=>{var{_visit:t}=e,r=eJd(e,["_visit"]);return r}});var Hat=J.objectWithoutOptionalProperties({name:Qs,value:J.lazyObject(()=>Rp),shape:AXr.optional()});var eb=J.objectWithoutOptionalProperties({typeId:ov,fernFilepath:wM,name:fo});var yXr=J.objectWithoutOptionalProperties({name:Qs,value:J.lazyObject(()=>Rp),originalTypeDeclaration:eb.optional()});var Kat=J.objectWithoutOptionalProperties({properties:J.list(yXr)}).extend(qee);var tJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},bXr=J.union("type",{inlinedRequestBody:Kat,reference:J.lazyObject(()=>Rp)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return pwe.inlinedRequestBody(e);case"reference":return pwe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=tJd(e,["_visit"]);return r}});var EXr=J.objectWithoutOptionalProperties({error:Fwe,body:J.lazyObject(()=>Rp).optional()});var vXr=J.objectWithoutOptionalProperties({event:J.string(),data:J.lazyObject(()=>Rp)});var rJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},IXr=J.union("type",{body:J.object({value:J.lazyObject(()=>Rp).optional()}),stream:J.object({value:J.list(J.lazyObject(()=>Rp))}),sse:J.object({value:J.list(vXr)})}).transform({transform:e=>{switch(e.type){case"body":return Nee.body(e.value);case"stream":return Nee.stream(e.value);case"sse":return Nee.sse(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=rJd(e,["_visit"]);return r}});var nJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},CXr=J.union("type",{ok:J.object({value:IXr}),error:EXr}).transform({transform:e=>{switch(e.type){case"ok":return fwe.ok(e.value);case"error":return fwe.error(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=nJd(e,["_visit"]);return r}});var Jat=J.objectWithoutOptionalProperties({id:J.string().optional(),name:fo.optional(),url:J.string(),rootPathParameters:J.list(kwe),servicePathParameters:J.list(kwe),endpointPathParameters:J.list(kwe),serviceHeaders:J.list(Kze),endpointHeaders:J.list(Kze),queryParameters:J.list(Hat),request:bXr.optional(),response:CXr}).extend(Vo);var wXr=J.objectWithoutOptionalProperties({example:Jat});var Yat=J.objectWithoutOptionalProperties({isOptional:J.boolean(),contentType:J.string().optional()}).extend(Vo);var Xat=J.objectWithoutOptionalProperties({}).extend(Vo);var xXr=J.objectWithoutOptionalProperties({page:L2,next:c5,results:c5});var SXr=J.objectWithoutOptionalProperties({fernFilepath:wM});var TXr=fo;var BXr=J.objectWithoutOptionalProperties({name:fo.optional(),language:J.string(),code:J.string(),install:J.string().optional()}).extend(Vo);var OXr=J.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var PXr=J.objectWithoutOptionalProperties({name:fo.optional(),sdk:OXr,code:J.string()}).extend(Vo);var iJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},DXr=J.union("type",{language:BXr,sdk:PXr}).transform({transform:e=>{switch(e.type){case"language":return lwe.language(e);case"sdk":return lwe.sdk(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=iJd(e,["_visit"]);return r}});var Zat=J.objectWithoutOptionalProperties({}).extend(Vo);var RXr=J.objectWithoutOptionalProperties({key:Qs,isOptional:J.boolean(),contentType:J.string().optional()});var FXr=J.objectWithoutOptionalProperties({key:Qs,isOptional:J.boolean(),contentType:J.string().optional()});var oJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},kXr=J.union("type",{file:FXr,fileArray:RXr}).transform({transform:e=>{switch(e.type){case"file":return dwe.file(e);case"fileArray":return dwe.fileArray(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=oJd(e,["_visit"]);return r}});var $at=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc)}).extend(Dwe);var NXr=J.objectWithoutOptionalProperties({contentType:J.string().optional()}).extend($at);var sJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},jXr=J.union("type",{file:J.object({value:kXr}),bodyProperty:NXr}).transform({transform:e=>{switch(e.type){case"file":return mwe.file(e.value);case"bodyProperty":return mwe.bodyProperty(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=sJd(e,["_visit"]);return r}});var QXr=J.objectWithoutOptionalProperties({name:fo,properties:J.list(jXr)}).extend(Vo);var MXr=J.objectWithoutOptionalProperties({namespace:J.string()});var LXr=J.objectWithoutOptionalProperties({csharp:MXr.optional()});var ect=J.objectWithoutOptionalProperties({filepath:J.string(),packageName:J.string().optional(),options:LXr.optional()});var zXr=J.objectWithoutOptionalProperties({file:ect,name:fo});var UXr=J.objectWithoutOptionalProperties({service:zXr});var z2=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc),env:J.string().optional()}).extend(Gw);var _Xr=J.objectWithoutOptionalProperties({pathParameter:J.string(),tail:J.string()});var u5=J.objectWithoutOptionalProperties({head:J.string(),parts:J.list(_Xr)});var tct=J.objectWithoutOptionalProperties({requestBodyType:J.lazy(()=>pc),contentType:J.string().optional()}).extend(Vo);var VXr=J.objectWithoutOptionalProperties({name:fo,extends:J.list(eb),properties:J.list($at),extendedProperties:J.list(M2).optional(),contentType:J.string().optional(),extraProperties:J.property("extra-properties",J.boolean())}).extend(Vo);var aJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},qXr=J.union("type",{inlinedRequestBody:VXr,reference:tct,fileUpload:QXr,bytes:Yat}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return r5.inlinedRequestBody(e);case"reference":return r5.reference(e);case"fileUpload":return r5.fileUpload(e);case"bytes":return r5.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=aJd(e,["_visit"]);return r}});var GXr=J.objectWithoutOptionalProperties({responseBodyType:J.lazy(()=>pc)}).extend(Vo);var WXr=J.objectWithoutOptionalProperties({responseBodyType:J.lazy(()=>pc),responseProperty:M2.optional()}).extend(Vo);var cJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},rct=J.union("type",{response:GXr,nestedPropertyAsResponse:WXr}).transform({transform:e=>{switch(e.type){case"response":return hwe.response(e);case"nestedPropertyAsResponse":return hwe.nestedPropertyAsResponse(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=cJd(e,["_visit"]);return r}});var HXr=J.objectWithoutOptionalProperties({payload:J.lazy(()=>pc),terminator:J.string().optional()}).extend(Vo);var KXr=J.objectWithoutOptionalProperties({payload:J.lazy(()=>pc),terminator:J.string().optional()}).extend(Vo);var JXr=J.objectWithoutOptionalProperties({}).extend(Vo);var uJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},nct=J.union("type",{json:HXr,text:JXr,sse:KXr}).transform({transform:e=>{switch(e.type){case"json":return Qee.json(e);case"text":return Qee.text(e);case"sse":return Qee.sse(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=uJd(e,["_visit"]);return r}});var ict=J.objectWithoutOptionalProperties({}).extend(Vo);var lJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},YXr=J.union("type",{json:J.object({value:rct}),fileDownload:Zat,text:ict,bytes:Xat}).transform({transform:e=>{switch(e.type){case"json":return n5.json(e.value);case"fileDownload":return n5.fileDownload(e);case"text":return n5.text(e);case"bytes":return n5.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=lJd(e,["_visit"]);return r}});var XXr=J.objectWithoutOptionalProperties({nonStreamResponse:YXr,streamResponse:nct});var pJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},ZXr=J.union("type",{json:J.object({value:rct}),fileDownload:Zat,text:ict,bytes:Xat,streaming:J.object({value:nct}),streamParameter:XXr}).transform({transform:e=>{switch(e.type){case"json":return AR.json(e.value);case"fileDownload":return AR.fileDownload(e);case"text":return AR.text(e);case"bytes":return AR.bytes(e);case"streaming":return AR.streaming(e.value);case"streamParameter":return AR.streamParameter(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=pJd(e,["_visit"]);return r}});var $Xr=J.objectWithoutOptionalProperties({statusCode:J.property("status-code",J.number().optional()),body:ZXr.optional()});var eZr=J.objectWithoutOptionalProperties({page:L2,results:c5,hasNextPage:c5.optional(),step:L2.optional()});var fJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},tZr=J.union("type",{cursor:xXr,offset:eZr}).transform({transform:e=>{switch(e.type){case"cursor":return gwe.cursor(e);case"offset":return gwe.offset(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=fJd(e,["_visit"]);return r}});var oct=J.string();var rZr=J.enum_(["ROOT","SERVICE","ENDPOINT"]);var wH=J.objectWithoutOptionalProperties({name:fo,valueType:J.lazy(()=>pc),location:rZr,variable:oct.optional()}).extend(Vo);var nZr=J.objectWithoutOptionalProperties({error:Fwe}).extend(Vo);var iZr=J.list(nZr);var dJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},oZr=J.union("type",{typeReference:tct,bytes:Yat}).transform({transform:e=>{switch(e.type){case"typeReference":return ywe.typeReference(e);case"bytes":return ywe.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=dJd(e,["_visit"]);return r}});var sZr=J.objectWithoutOptionalProperties({wrapperName:fo,bodyKey:fo,includePathParameters:J.boolean().optional(),onlyPathParameters:J.boolean().optional()});var mJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},aZr=J.union("type",{justRequestBody:J.object({value:oZr}),wrapper:sZr}).transform({transform:e=>{switch(e.type){case"justRequestBody":return bwe.justRequestBody(e.value);case"wrapper":return bwe.wrapper(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=mJd(e,["_visit"]);return r}});var cZr=J.objectWithoutOptionalProperties({streamParameter:L2.optional(),requestParameterName:fo,shape:aZr});var hJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},sct=J.union("type",{http:J.object({}),grpc:UXr}).transform({transform:e=>{switch(e.type){case"http":return Ewe.http();case"grpc":return Ewe.grpc(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=hJd(e,["_visit"]);return r}});var uZr=J.objectWithoutOptionalProperties({codeSamples:J.list(DXr).optional(),example:Jat.optional()});var lZr=J.objectWithoutOptionalProperties({id:CH,name:TXr,displayName:J.string().optional(),method:kat,headers:J.list(z2),baseUrl:Wee.optional(),basePath:u5.optional(),path:u5,fullPath:u5,pathParameters:J.list(wH),allPathParameters:J.list(wH),queryParameters:J.list(Owe),requestBody:qXr.optional(),sdkRequest:cZr.optional(),response:$Xr.optional(),errors:iZr,auth:J.boolean(),idempotent:J.boolean(),pagination:tZr.optional(),userSpecifiedExamples:J.list(uZr),autogeneratedExamples:J.list(wXr),transport:sct.optional()}).extend(Gw);var pZr=J.objectWithoutOptionalProperties({});var fZr=J.objectWithoutOptionalProperties({});var act=J.objectWithoutOptionalProperties({json:pZr.optional(),proto:fZr.optional()});var dZr=J.objectWithoutOptionalProperties({availability:Vee.optional(),name:SXr,displayName:J.string().optional(),basePath:u5,endpoints:J.list(lZr),headers:J.list(z2),pathParameters:J.list(wH),encoding:act.optional(),transport:sct.optional()});var rPo={};te(rPo,{ApiDefinitionSource:()=>gZr,ApiDefinitionSourceId:()=>mZr,ApiVersionScheme:()=>yZr,ErrorDiscriminationByPropertyStrategy:()=>bZr,ErrorDiscriminationStrategy:()=>EZr,HeaderApiVersionScheme:()=>AZr,IntermediateRepresentation:()=>IVc,Package:()=>mct,PackageNavigationConfig:()=>S$r,PlatformHeaders:()=>O$r,ProtoSource:()=>hZr,ReadmeConfig:()=>T$r,SdkConfig:()=>P$r,ServiceTypeReferenceInfo:()=>D$r,SourceConfig:()=>R$r,Subpackage:()=>F$r,UserAgent:()=>B$r});var mZr=J.string();var hZr=J.objectWithoutOptionalProperties({id:mZr,protoRootUrl:J.string()});var gJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},gZr=J.union("type",{proto:hZr,openapi:J.object({})}).transform({transform:e=>{switch(e.type){case"proto":return vwe.proto(e);case"openapi":return vwe.openapi();default:return e}},untransform:e=>{var{_visit:t}=e,r=gJd(e,["_visit"]);return r}});var Wfe=J.objectWithoutOptionalProperties({name:Qs}).extend(Gw);var cct=J.objectWithoutOptionalProperties({default:Wfe.optional(),values:J.list(Wfe)});var AZr=J.objectWithoutOptionalProperties({header:z2,value:cct});var AJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},yZr=J.union("type",{header:AZr}).transform({transform:e=>e.type==="header"?wat.header(e):e,untransform:e=>{var{_visit:t}=e,r=AJd(e,["_visit"]);return r}});var bZr=J.objectWithoutOptionalProperties({discriminant:Qs,contentProperty:Qs});var yJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},EZr=J.union("type",{statusCode:J.object({}),property:bZr}).transform({transform:e=>{switch(e.type){case"statusCode":return Iwe.statusCode();case"property":return Iwe.property(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=yJd(e,["_visit"]);return r}});var vZr=J.objectWithoutOptionalProperties({apiKey:J.string(),workspaceId:J.string(),collectionId:J.string().optional()});var bJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},uct=J.union("type",{postman:vZr}).transform({transform:e=>e.type==="postman"?xat.postman(e):e,untransform:e=>{var{_visit:t}=e,r=bJd(e,["_visit"]);return r}});var IZr=J.objectWithoutOptionalProperties({target:uct});var CZr=J.objectWithoutOptionalProperties({owner:J.string(),repo:J.string(),target:uct});var EJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},wZr=J.union("type",{github:CZr,direct:IZr}).transform({transform:e=>{switch(e.type){case"github":return wwe.github(e);case"direct":return wwe.direct(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=EJd(e,["_visit"]);return r}});var C5t=J.objectWithoutOptionalProperties({name:fo.optional(),shape:J.lazy(()=>lct)}).extend(qee).extend(Vo);var xZr=J.objectWithoutOptionalProperties({file:ect,name:fo});var vJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},SZr=J.union("type",{any:J.object({}),api:J.object({}),boolValue:J.object({}),bytesValue:J.object({}),doubleValue:J.object({}),duration:J.object({}),empty:J.object({}),enum:J.object({}),enumValue:J.object({}),field:J.object({}),fieldCardinality:J.object({}),fieldKind:J.object({}),fieldMask:J.object({}),floatValue:J.object({}),int32Value:J.object({}),int64Value:J.object({}),listValue:J.object({}),method:J.object({}),mixin:J.object({}),nullValue:J.object({}),option:J.object({}),sourceContext:J.object({}),stringValue:J.object({}),struct:J.object({}),syntax:J.object({}),timestamp:J.object({}),type:J.object({}),uint32Value:J.object({}),uint64Value:J.object({}),value:J.object({})}).transform({transform:e=>{switch(e.type){case"any":return pa.any();case"api":return pa.api();case"boolValue":return pa.boolValue();case"bytesValue":return pa.bytesValue();case"doubleValue":return pa.doubleValue();case"duration":return pa.duration();case"empty":return pa.empty();case"enum":return pa.enum();case"enumValue":return pa.enumValue();case"field":return pa.field();case"fieldCardinality":return pa.fieldCardinality();case"fieldKind":return pa.fieldKind();case"fieldMask":return pa.fieldMask();case"floatValue":return pa.floatValue();case"int32Value":return pa.int32Value();case"int64Value":return pa.int64Value();case"listValue":return pa.listValue();case"method":return pa.method();case"mixin":return pa.mixin();case"nullValue":return pa.nullValue();case"option":return pa.option();case"sourceContext":return pa.sourceContext();case"stringValue":return pa.stringValue();case"struct":return pa.struct();case"syntax":return pa.syntax();case"timestamp":return pa.timestamp();case"type":return pa.type();case"uint32Value":return pa.uint32Value();case"uint64Value":return pa.uint64Value();case"value":return pa.value();default:return e}},untransform:e=>{var{_visit:t}=e,r=vJd(e,["_visit"]);return r}});var IJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},TZr=J.union("type",{wellKnown:J.object({value:SZr}),userDefined:xZr}).transform({transform:e=>{switch(e.type){case"wellKnown":return Cwe.wellKnown(e.value);case"userDefined":return Cwe.userDefined(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=IJd(e,["_visit"]);return r}});var CJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},BZr=J.union("type",{proto:J.object({value:TZr})}).transform({transform:e=>e.type==="proto"?Bat.proto(e.value):e,untransform:e=>{var{_visit:t}=e,r=CJd(e,["_visit"]);return r}});var OZr=J.objectWithoutOptionalProperties({});var PZr=J.objectWithoutOptionalProperties({default:J.string().optional()});var DZr=J.objectWithoutOptionalProperties({default:J.boolean().optional()});var RZr=J.objectWithoutOptionalProperties({});var FZr=J.objectWithoutOptionalProperties({});var kZr=J.objectWithoutOptionalProperties({min:J.number().optional(),max:J.number().optional(),exclusiveMin:J.boolean().optional(),exclusiveMax:J.boolean().optional(),multipleOf:J.number().optional()});var NZr=J.objectWithoutOptionalProperties({default:J.number().optional(),validation:kZr.optional()});var jZr=J.objectWithoutOptionalProperties({});var QZr=J.objectWithoutOptionalProperties({min:J.number().optional(),max:J.number().optional(),exclusiveMin:J.boolean().optional(),exclusiveMax:J.boolean().optional(),multipleOf:J.number().optional()});var MZr=J.objectWithoutOptionalProperties({default:J.number().optional(),validation:QZr.optional()});var LZr=J.objectWithoutOptionalProperties({default:J.number().optional()});var zZr=J.objectWithoutOptionalProperties({format:J.string().optional(),pattern:J.string().optional(),minLength:J.number().optional(),maxLength:J.number().optional()});var UZr=J.objectWithoutOptionalProperties({default:J.string().optional(),validation:zZr.optional()});var _Zr=J.objectWithoutOptionalProperties({});var VZr=J.objectWithoutOptionalProperties({});var qZr=J.objectWithoutOptionalProperties({});var wJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},GZr=J.union("type",{integer:MZr,long:LZr,uint:VZr,uint64:_Zr,float:jZr,double:NZr,boolean:DZr,string:UZr,date:FZr,dateTime:RZr,uuid:qZr,base64:OZr,bigInteger:PZr}).transform({transform:e=>{switch(e.type){case"integer":return bg.integer(e);case"long":return bg.long(e);case"uint":return bg.uint(e);case"uint64":return bg.uint64(e);case"float":return bg.float(e);case"double":return bg.double(e);case"boolean":return bg.boolean(e);case"string":return bg.string(e);case"date":return bg.date(e);case"dateTime":return bg.dateTime(e);case"uuid":return bg.uuid(e);case"base64":return bg.base64(e);case"bigInteger":return bg.bigInteger(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=wJd(e,["_visit"]);return r}});var pct=J.objectWithoutOptionalProperties({v1:Mat,v2:GZr.optional()});var WZr=J.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var HZr=J.objectWithoutOptionalProperties({name:eb,shape:WZr});var xJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},KZr=J.union(J.discriminant("type","_type"),{container:J.object({container:J.lazy(()=>fct)}),named:HZr,primitive:J.object({primitive:pct}),unknown:J.object({})}).transform({transform:e=>{switch(e.type){case"container":return o5.container(e.container);case"named":return o5.named(e);case"primitive":return o5.primitive(e.primitive);case"unknown":return o5.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=xJd(e,["_visit"]);return r}});var JZr=J.objectWithoutOptionalProperties({aliasOf:J.lazy(()=>pc),resolvedType:KZr});var YZr=J.objectWithoutOptionalProperties({extends:J.list(eb),properties:J.list(M2),extendedProperties:J.list(M2).optional(),extraProperties:J.property("extra-properties",J.boolean())});var XZr=J.objectWithoutOptionalProperties({type:J.lazy(()=>pc)}).extend(Vo);var ZZr=J.objectWithoutOptionalProperties({members:J.list(XZr)});var $Zr=J.objectWithoutOptionalProperties({name:Qs,type:J.lazy(()=>pc)});var SJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},e$r=J.union(J.discriminant("propertiesType","_type"),{samePropertiesAsObject:eb,singleProperty:$Zr,noProperties:J.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return zee.samePropertiesAsObject(e);case"singleProperty":return zee.singleProperty(e);case"noProperties":return zee.noProperties();default:return e}},untransform:e=>{var{_visit:t}=e,r=SJd(e,["_visit"]);return r}});var t$r=J.objectWithoutOptionalProperties({discriminantValue:Qs,shape:e$r,displayName:J.string().optional(),availability:Vee.optional()}).extend(Vo);var r$r=J.objectWithoutOptionalProperties({discriminant:Qs,extends:J.list(eb),types:J.list(t$r),baseProperties:J.list(M2)});var TJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},n$r=J.union(J.discriminant("type","_type"),{alias:JZr,enum:cct,object:YZr,union:r$r,undiscriminatedUnion:ZZr}).transform({transform:e=>{switch(e.type){case"alias":return CM.alias(e);case"enum":return CM.enum(e);case"object":return CM.object(e);case"union":return CM.union(e);case"undiscriminatedUnion":return CM.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=TJd(e,["_visit"]);return r}});var i$r=J.objectWithoutOptionalProperties({name:eb,shape:n$r,autogeneratedExamples:J.list(C5t),userProvidedExamples:J.list(C5t),referencedTypes:J.set(ov),encoding:act.optional(),source:BZr.optional(),inline:J.boolean().optional()}).extend(Gw);var o$r=J.objectWithoutOptionalProperties({id:oct,name:fo,type:J.lazy(()=>pc)}).extend(Vo);var s$r=J.objectWithoutOptionalProperties({name:fo.optional(),payload:J.lazyObject(()=>Rp)}).extend(Vo);var a$r=J.enum_(["GET","POST"]);var c$r=fo;var u$r=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc)}).extend(Dwe);var l$r=J.objectWithoutOptionalProperties({name:fo,extends:J.list(eb),properties:J.list(u$r)});var p$r=J.objectWithoutOptionalProperties({payloadType:J.lazy(()=>pc)}).extend(Vo);var BJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},f$r=J.union("type",{inlinedPayload:l$r,reference:p$r}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return Swe.inlinedPayload(e);case"reference":return Swe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=BJd(e,["_visit"]);return r}});var d$r=J.objectWithoutOptionalProperties({id:tYr,name:c$r,displayName:J.string().optional(),method:a$r,headers:J.list(z2),payload:f$r,examples:J.list(s$r).optional()}).extend(Gw);var m$r=J.list(d$r);var OJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},h$r=J.union("type",{inlinedBody:Kat,reference:J.lazyObject(()=>Rp)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return Twe.inlinedBody(e);case"reference":return Twe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=OJd(e,["_visit"]);return r}});var dct=J.string();var g$r=J.objectWithoutOptionalProperties({type:dct,body:h$r});var A$r=J.objectWithoutOptionalProperties({name:fo.optional(),url:J.string(),pathParameters:J.list(kwe),headers:J.list(Kze),queryParameters:J.list(Hat),messages:J.list(g$r)}).extend(Vo);var y$r=J.objectWithoutOptionalProperties({name:Qs,valueType:J.lazy(()=>pc)}).extend(Dwe);var b$r=J.objectWithoutOptionalProperties({name:fo,extends:J.list(eb),properties:J.list(y$r)});var E$r=J.objectWithoutOptionalProperties({bodyType:J.lazy(()=>pc)}).extend(Vo);var PJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},v$r=J.union("type",{inlinedBody:b$r,reference:E$r}).transform({transform:e=>{switch(e.type){case"inlinedBody":return Bwe.inlinedBody(e);case"reference":return Bwe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=PJd(e,["_visit"]);return r}});var I$r=J.enum_(["client","server"]);var C$r=J.objectWithoutOptionalProperties({type:dct,displayName:J.string().optional(),origin:I$r,body:v$r}).extend(Gw);var w$r=fo;var x$r=J.objectWithoutOptionalProperties({name:w$r,displayName:J.string().optional(),path:u5,auth:J.boolean(),headers:J.list(z2),queryParameters:J.list(Owe),pathParameters:J.list(wH),messages:J.list(C$r),examples:J.list(A$r)}).extend(Gw);var S$r=J.objectWithoutOptionalProperties({pointsTo:_ee});var mct=J.objectWithoutOptionalProperties({fernFilepath:wM,service:Uee.optional(),types:J.list(ov),errors:J.list(Pwe),webhooks:Dat.optional(),websocket:Rat.optional(),subpackages:J.list(_ee),hasEndpointsInTree:J.boolean(),navigationConfig:S$r.optional()}).extend(Vo);var T$r=J.objectWithoutOptionalProperties({defaultEndpoint:CH.optional(),bannerLink:J.string().optional(),introduction:J.string().optional(),apiReferenceLink:J.string().optional(),features:J.record(eYr,J.list(CH)).optional()});var B$r=J.objectWithoutOptionalProperties({header:J.stringLiteral("User-Agent"),value:J.string()});var O$r=J.objectWithoutOptionalProperties({language:J.string(),sdkName:J.string(),sdkVersion:J.string(),userAgent:B$r.optional()});var P$r=J.objectWithoutOptionalProperties({isAuthMandatory:J.boolean(),hasStreamingEndpoints:J.boolean(),hasPaginatedEndpoints:J.boolean(),hasFileDownloadEndpoints:J.boolean(),platformHeaders:O$r});var D$r=J.objectWithoutOptionalProperties({typesReferencedOnlyByService:J.record(Uee,J.list(ov)),sharedTypes:J.list(ov)});var R$r=J.objectWithoutOptionalProperties({sources:J.list(gZr)});var F$r=J.objectWithoutOptionalProperties({name:fo}).extend(mct);var IVc=J.objectWithoutOptionalProperties({fdrApiDefinitionId:J.string().optional(),apiVersion:yZr.optional(),apiName:fo,apiDisplayName:J.string().optional(),apiDocs:J.string().optional(),auth:ZJr,headers:J.list(z2),idempotencyHeaders:J.list(z2),types:J.record(ov,i$r),services:J.record(Uee,dZr),webhookGroups:J.record(Dat,m$r),websocketChannels:J.record(Rat,x$r).optional(),errors:J.record(Pwe,qYr),subpackages:J.record(_ee,F$r),rootPackage:mct,constants:rYr,environments:jat.optional(),basePath:u5.optional(),pathParameters:J.list(wH),errorDiscriminationStrategy:EZr,sdkConfig:P$r,variables:J.list(o$r),serviceTypeReferenceInfo:D$r,readmeConfig:T$r.optional(),sourceConfig:R$r.optional(),publishConfig:wZr.optional(),dynamic:LYr.optional()});var nPo={};te(nPo,{CsharpProtobufFileOptions:()=>MXr,ProtobufFile:()=>ect,ProtobufFileOptions:()=>LXr,ProtobufService:()=>zXr,ProtobufType:()=>TZr,UserDefinedProtobufType:()=>xZr,WellKnownProtobufType:()=>SZr});var iPo={};te(iPo,{DirectPublish:()=>IZr,GithubPublish:()=>CZr,PostmanPublishTarget:()=>vZr,PublishTarget:()=>uct,PublishingConfig:()=>wZr});var oPo={};te(oPo,{AliasTypeDeclaration:()=>JZr,Base64Type:()=>OZr,BigIntegerType:()=>PZr,BooleanType:()=>DZr,ContainerType:()=>fct,DateTimeType:()=>RZr,DateType:()=>FZr,DeclaredTypeName:()=>eb,DoubleType:()=>NZr,DoubleValidationRules:()=>kZr,Encoding:()=>act,EnumTypeDeclaration:()=>cct,EnumTypeReference:()=>CVc,EnumValue:()=>Wfe,ExampleAliasType:()=>j$r,ExampleContainer:()=>L$r,ExampleDatetime:()=>Q$r,ExampleEnumType:()=>q$r,ExampleKeyValuePair:()=>G$r,ExampleListContainer:()=>z$r,ExampleLiteralContainer:()=>M$r,ExampleMapContainer:()=>U$r,ExampleNamedType:()=>W$r,ExampleObjectProperty:()=>H$r,ExampleObjectType:()=>gct,ExampleObjectTypeWithTypeId:()=>K$r,ExampleOptionalContainer:()=>_$r,ExamplePrimitive:()=>hct,ExampleSetContainer:()=>V$r,ExampleSingleUnionType:()=>J$r,ExampleSingleUnionTypeProperties:()=>Y$r,ExampleType:()=>C5t,ExampleTypeReference:()=>Rp,ExampleTypeReferenceShape:()=>X$r,ExampleTypeShape:()=>lct,ExampleUndiscriminatedUnionType:()=>Z$r,ExampleUnionType:()=>$$r,FloatType:()=>jZr,IntegerType:()=>MZr,IntegerValidationRules:()=>QZr,JsonEncoding:()=>pZr,Literal:()=>k$r,LongType:()=>LZr,MapType:()=>N$r,NamedType:()=>ten,NamedTypeDefault:()=>een,ObjectProperty:()=>M2,ObjectTypeDeclaration:()=>YZr,PrimitiveType:()=>pct,PrimitiveTypeV1:()=>Mat,PrimitiveTypeV2:()=>GZr,ProtoEncoding:()=>fZr,ResolvedNamedType:()=>HZr,ResolvedTypeReference:()=>KZr,ShapeType:()=>WZr,SingleUnionType:()=>t$r,SingleUnionTypeProperties:()=>e$r,SingleUnionTypeProperty:()=>$Zr,Source:()=>BZr,StringType:()=>UZr,StringValidationRules:()=>zZr,Type:()=>n$r,TypeDeclaration:()=>i$r,TypeReference:()=>pc,Uint64Type:()=>_Zr,UintType:()=>VZr,UndiscriminatedUnionMember:()=>XZr,UndiscriminatedUnionTypeDeclaration:()=>ZZr,UnionTypeDeclaration:()=>r$r,UuidType:()=>qZr});var DJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},k$r=J.union("type",{string:J.object({string:J.string()}),boolean:J.object({boolean:J.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return xwe.string(e.string);case"boolean":return xwe.boolean(e.boolean);default:return e}},untransform:e=>{var{_visit:t}=e,r=DJd(e,["_visit"]);return r}});var RJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},fct=J.union(J.discriminant("type","_type"),{list:J.object({list:J.lazy(()=>pc)}),map:J.lazyObject(()=>N$r),optional:J.object({optional:J.lazy(()=>pc)}),set:J.object({set:J.lazy(()=>pc)}),literal:J.object({literal:k$r})}).transform({transform:e=>{switch(e.type){case"list":return EM.list(e.list);case"map":return EM.map(e);case"optional":return EM.optional(e.optional);case"set":return EM.set(e.set);case"literal":return EM.literal(e.literal);default:return e}},untransform:e=>{var{_visit:t}=e,r=RJd(e,["_visit"]);return r}});var CVc=J.objectWithoutOptionalProperties({default:Wfe.optional(),name:eb});var j$r=J.objectWithoutOptionalProperties({value:J.lazyObject(()=>Rp)});var Q$r=J.objectWithoutOptionalProperties({datetime:J.date(),raw:J.string().optional()});var FJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},hct=J.union("type",{integer:J.object({integer:J.number()}),long:J.object({long:J.number()}),uint:J.object({uint:J.number()}),uint64:J.object({uint64:J.number()}),float:J.object({float:J.number()}),double:J.object({double:J.number()}),boolean:J.object({boolean:J.boolean()}),string:J.object({string:$Jr}),date:J.object({date:J.string()}),datetime:Q$r,uuid:J.object({uuid:J.string()}),base64:J.object({base64:J.string()}),bigInteger:J.object({bigInteger:J.string()})}).transform({transform:e=>{switch(e.type){case"integer":return yg.integer(e.integer);case"long":return yg.long(e.long);case"uint":return yg.uint(e.uint);case"uint64":return yg.uint64(e.uint64);case"float":return yg.float(e.float);case"double":return yg.double(e.double);case"boolean":return yg.boolean(e.boolean);case"string":return yg.string(e.string);case"date":return yg.date(e.date);case"datetime":return yg.datetime(e);case"uuid":return yg.uuid(e.uuid);case"base64":return yg.base64(e.base64);case"bigInteger":return yg.bigInteger(e.bigInteger);default:return e}},untransform:e=>{var{_visit:t}=e,r=FJd(e,["_visit"]);return r}});var M$r=J.objectWithoutOptionalProperties({literal:hct});var kJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},L$r=J.union("type",{list:J.lazyObject(()=>z$r),set:J.lazyObject(()=>V$r),optional:J.lazyObject(()=>_$r),map:J.lazyObject(()=>U$r),literal:M$r}).transform({transform:e=>{switch(e.type){case"list":return vM.list(e);case"set":return vM.set(e);case"optional":return vM.optional(e);case"map":return vM.map(e);case"literal":return vM.literal(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=kJd(e,["_visit"]);return r}});var q$r=J.objectWithoutOptionalProperties({value:Qs});var G$r=J.objectWithoutOptionalProperties({key:J.lazyObject(()=>Rp),value:J.lazyObject(()=>Rp)});var z$r=J.objectWithoutOptionalProperties({list:J.list(J.lazyObject(()=>Rp)),itemType:J.lazy(()=>pc)});var U$r=J.objectWithoutOptionalProperties({map:J.list(J.lazyObject(()=>G$r)),keyType:J.lazy(()=>pc),valueType:J.lazy(()=>pc)});var W$r=J.objectWithoutOptionalProperties({typeName:eb,shape:J.lazy(()=>lct)});var H$r=J.objectWithoutOptionalProperties({name:Qs,value:J.lazyObject(()=>Rp),originalTypeDeclaration:eb});var gct=J.objectWithoutOptionalProperties({properties:J.list(J.lazyObject(()=>H$r))});var K$r=J.objectWithoutOptionalProperties({typeId:ov,object:J.lazyObject(()=>gct)});var _$r=J.objectWithoutOptionalProperties({optional:J.lazyObject(()=>Rp).optional(),valueType:J.lazy(()=>pc)});var V$r=J.objectWithoutOptionalProperties({set:J.list(J.lazyObject(()=>Rp)),itemType:J.lazy(()=>pc)});var J$r=J.objectWithoutOptionalProperties({wireDiscriminantValue:Qs,shape:J.lazy(()=>Y$r)});var NJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Y$r=J.union("type",{samePropertiesAsObject:J.lazyObject(()=>K$r),singleProperty:J.lazyObject(()=>Rp),noProperties:J.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return Lee.samePropertiesAsObject(e);case"singleProperty":return Lee.singleProperty(e);case"noProperties":return Lee.noProperties();default:return e}},untransform:e=>{var{_visit:t}=e,r=NJd(e,["_visit"]);return r}});var Rp=J.objectWithoutOptionalProperties({shape:J.lazy(()=>X$r)}).extend(qee);var jJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},X$r=J.union("type",{primitive:J.object({primitive:hct}),container:J.object({container:J.lazy(()=>L$r)}),unknown:J.object({unknown:J.unknown()}),named:J.lazyObject(()=>W$r)}).transform({transform:e=>{switch(e.type){case"primitive":return i5.primitive(e.primitive);case"container":return i5.container(e.container);case"unknown":return i5.unknown(e.unknown);case"named":return i5.named(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=jJd(e,["_visit"]);return r}});var QJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},lct=J.union("type",{alias:J.lazyObject(()=>j$r),enum:q$r,object:J.lazyObject(()=>gct),union:J.lazyObject(()=>$$r),undiscriminatedUnion:J.lazyObject(()=>Z$r)}).transform({transform:e=>{switch(e.type){case"alias":return IM.alias(e);case"enum":return IM.enum(e);case"object":return IM.object(e);case"union":return IM.union(e);case"undiscriminatedUnion":return IM.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=QJd(e,["_visit"]);return r}});var Z$r=J.objectWithoutOptionalProperties({index:J.number(),singleUnionType:J.lazyObject(()=>Rp)});var $$r=J.objectWithoutOptionalProperties({discriminant:Qs,singleUnionType:J.lazyObject(()=>J$r)});var N$r=J.objectWithoutOptionalProperties({keyType:J.lazy(()=>pc),valueType:J.lazy(()=>pc)});var MJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},een=J.union("type",{enum:Wfe}).transform({transform:e=>e.type==="enum"?Sat.enum(e):e,untransform:e=>{var{_visit:t}=e,r=MJd(e,["_visit"]);return r}});var ten=J.objectWithoutOptionalProperties({typeId:ov,fernFilepath:wM,name:fo,default:een.optional(),inline:J.boolean().optional()});var LJd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},pc=J.union(J.discriminant("type","_type"),{container:J.object({container:J.lazy(()=>fct)}),named:ten,primitive:J.object({primitive:pct}),unknown:J.object({})}).transform({transform:e=>{switch(e.type){case"container":return s5.container(e.container);case"named":return s5.named(e);case"primitive":return s5.primitive(e.primitive);case"unknown":return s5.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=LJd(e,["_visit"]);return r}});var sPo={};te(sPo,{VariableDeclaration:()=>o$r,VariableId:()=>oct});var aPo={};te(aPo,{ExampleWebhookCall:()=>s$r,InlinedWebhookPayload:()=>l$r,InlinedWebhookPayloadProperty:()=>u$r,Webhook:()=>d$r,WebhookGroup:()=>m$r,WebhookHttpMethod:()=>a$r,WebhookName:()=>c$r,WebhookPayload:()=>f$r,WebhookPayloadReference:()=>p$r});var cPo={};te(cPo,{ExampleWebSocketMessage:()=>g$r,ExampleWebSocketMessageBody:()=>h$r,ExampleWebSocketSession:()=>A$r,InlinedWebSocketMessageBody:()=>b$r,InlinedWebSocketMessageBodyProperty:()=>y$r,WebSocketChannel:()=>x$r,WebSocketMessage:()=>C$r,WebSocketMessageBody:()=>v$r,WebSocketMessageBodyReference:()=>E$r,WebSocketMessageId:()=>dct,WebSocketMessageOrigin:()=>I$r,WebSocketName:()=>w$r});var Ls={};te(Ls,{AliasTypeDeclaration:()=>Tnn,ApiAuth:()=>Ten,ApiDefinitionSource:()=>Krn,ApiDefinitionSourceId:()=>Wrn,ApiVersionScheme:()=>Yrn,AuthScheme:()=>xen,AuthSchemesRequirement:()=>Sen,AutogeneratedEndpointExample:()=>trn,Availability:()=>tte,AvailabilityStatus:()=>hen,Base64Type:()=>ann,BasicAuthScheme:()=>fen,BearerAuthScheme:()=>den,BigIntegerType:()=>cnn,BooleanType:()=>unn,BytesRequest:()=>Kct,BytesResponse:()=>Jct,Constants:()=>Den,ContainerType:()=>lut,CsharpProtobufFileOptions:()=>grn,CursorPagination:()=>rrn,DateTimeType:()=>lnn,DateType:()=>pnn,Declaration:()=>Ww,DeclaredErrorName:()=>sxe,DeclaredServiceName:()=>nrn,DeclaredTypeName:()=>tb,DirectPublish:()=>enn,DoubleType:()=>dnn,DoubleValidationRules:()=>fnn,Encoding:()=>out,EndpointId:()=>SH,EndpointName:()=>irn,EndpointReference:()=>Tct,EnumTypeDeclaration:()=>sut,EnumTypeReference:()=>w5c,EnumValue:()=>Jfe,EnvironmentBaseUrlId:()=>y5,EnvironmentBaseUrlWithId:()=>etn,EnvironmentId:()=>nte,EnvironmentUrl:()=>oxe,EnvironmentVariable:()=>g5,Environments:()=>otn,EnvironmentsConfig:()=>Nct,ErrorDeclaration:()=>vtn,ErrorDeclarationDiscriminantValue:()=>v5c,ErrorDiscriminationByPropertyStrategy:()=>Xrn,ErrorDiscriminationStrategy:()=>Zrn,ErrorId:()=>nxe,EscapedString:()=>Ben,ExampleAliasType:()=>min,ExampleCodeSample:()=>crn,ExampleCodeSampleLanguage:()=>orn,ExampleCodeSampleSdk:()=>arn,ExampleContainer:()=>Ain,ExampleDatetime:()=>hin,ExampleEndpointCall:()=>Hct,ExampleEndpointErrorResponse:()=>Xtn,ExampleEndpointSuccessResponse:()=>$tn,ExampleEnumType:()=>Cin,ExampleError:()=>Etn,ExampleHeader:()=>Zze,ExampleInlinedRequestBody:()=>Wct,ExampleInlinedRequestBodyProperty:()=>Jtn,ExampleKeyValuePair:()=>win,ExampleListContainer:()=>yin,ExampleLiteralContainer:()=>gin,ExampleMapContainer:()=>bin,ExampleNamedType:()=>xin,ExampleNullableContainer:()=>Ein,ExampleObjectProperty:()=>Sin,ExampleObjectType:()=>mut,ExampleObjectTypeWithTypeId:()=>Tin,ExampleOptionalContainer:()=>vin,ExamplePathParameter:()=>axe,ExamplePrimitive:()=>dut,ExampleQueryParameter:()=>Gct,ExampleQueryParameterShape:()=>Ktn,ExampleRequestBody:()=>Ytn,ExampleResponse:()=>ern,ExampleServerSideEvent:()=>Ztn,ExampleSetContainer:()=>Iin,ExampleSingleUnionType:()=>Bin,ExampleSingleUnionTypeProperties:()=>Oin,ExampleType:()=>B5t,ExampleTypeReference:()=>np,ExampleTypeReferenceShape:()=>Pin,ExampleTypeShape:()=>cut,ExampleUndiscriminatedUnionType:()=>Din,ExampleUnionType:()=>Rin,ExampleWebSocketMessage:()=>Knn,ExampleWebSocketMessageBody:()=>Hnn,ExampleWebSocketSession:()=>Jnn,ExampleWebhookCall:()=>Mnn,FeatureId:()=>Oen,FernFilepath:()=>TM,FileDownloadResponse:()=>Yct,FileProperty:()=>prn,FilePropertyArray:()=>urn,FilePropertySingle:()=>lrn,FileUploadBodyProperty:()=>drn,FileUploadBodyPropertyEncoding:()=>frn,FileUploadRequest:()=>hrn,FileUploadRequestProperty:()=>mrn,FloatType:()=>mnn,GithubPublish:()=>tnn,GrpcTransport:()=>brn,HeaderApiVersionScheme:()=>Jrn,HeaderAuthScheme:()=>men,HttpEndpoint:()=>_rn,HttpHeader:()=>V2,HttpMethod:()=>Rct,HttpPath:()=>b5,HttpPathPart:()=>Ern,HttpRequestBody:()=>Irn,HttpRequestBodyReference:()=>$ct,HttpResponse:()=>Drn,HttpResponseBody:()=>Prn,HttpService:()=>Grn,InlinedRequestBody:()=>vrn,InlinedRequestBodyProperty:()=>Xct,InlinedWebSocketMessageBody:()=>Xnn,InlinedWebSocketMessageBodyProperty:()=>Ynn,InlinedWebhookPayload:()=>_nn,InlinedWebhookPayloadProperty:()=>Unn,IntegerType:()=>gnn,IntegerValidationRules:()=>hnn,IntermediateRepresentation:()=>C5c,JsonEncoding:()=>Vrn,JsonResponse:()=>eut,JsonResponseBody:()=>Crn,JsonResponseBodyWithProperty:()=>wrn,JsonStreamChunk:()=>xrn,Literal:()=>fin,LongType:()=>Ann,MapType:()=>din,MultipleBaseUrlsEnvironment:()=>ttn,MultipleBaseUrlsEnvironments:()=>rtn,Name:()=>mo,NameAndWireValue:()=>Ms,NamedType:()=>kin,NamedTypeDefault:()=>Fin,NonStreamHttpResponseBody:()=>Brn,OAuthAccessTokenRequestProperties:()=>Een,OAuthAccessTokenResponseProperties:()=>Bct,OAuthClientCredentials:()=>Ien,OAuthConfiguration:()=>Cen,OAuthRefreshEndpoint:()=>ben,OAuthRefreshTokenRequestProperties:()=>yen,OAuthScheme:()=>wen,OAuthTokenEndpoint:()=>ven,ObjectProperty:()=>_2,ObjectPropertyAccess:()=>gen,ObjectTypeDeclaration:()=>Bnn,OffsetPagination:()=>Rrn,Package:()=>fut,PackageNavigationConfig:()=>iin,Pagination:()=>Frn,PathParameter:()=>TH,PathParameterLocation:()=>krn,PlatformHeaders:()=>ain,PostmanPublishTarget:()=>$rn,PrimitiveType:()=>uut,PrimitiveTypeV1:()=>jct,PrimitiveTypeV2:()=>Cnn,ProtoEncoding:()=>qrn,ProtoSource:()=>Hrn,ProtobufFile:()=>Zct,ProtobufFileOptions:()=>Arn,ProtobufService:()=>yrn,ProtobufType:()=>onn,PublishTarget:()=>aut,PublishingConfig:()=>rnn,QueryParameter:()=>rxe,ReadmeConfig:()=>oin,RequestProperty:()=>IR,RequestPropertyValue:()=>Aen,ResolvedNamedType:()=>xnn,ResolvedTypeReference:()=>Snn,ResponseError:()=>Nrn,ResponseErrors:()=>jrn,ResponseProperty:()=>A5,SafeAndUnsafeString:()=>Xze,SdkConfig:()=>cin,SdkRequest:()=>zrn,SdkRequestBodyType:()=>Qrn,SdkRequestShape:()=>Lrn,SdkRequestWrapper:()=>Mrn,ServiceId:()=>$ee,ServiceTypeReferenceInfo:()=>uin,ShapeType:()=>wnn,SingleBaseUrlEnvironment:()=>ntn,SingleBaseUrlEnvironments:()=>itn,SingleUnionType:()=>Fnn,SingleUnionTypeProperties:()=>Rnn,SingleUnionTypeProperty:()=>Dnn,Source:()=>snn,SourceConfig:()=>lin,SseStreamChunk:()=>Srn,StreamParameterResponse:()=>Orn,StreamingResponse:()=>tut,StringType:()=>bnn,StringValidationRules:()=>ynn,Subpackage:()=>pin,SubpackageId:()=>ete,SupportedSdkLanguage:()=>srn,TextResponse:()=>rut,TextStreamChunk:()=>Trn,Transport:()=>iut,Type:()=>Nnn,TypeDeclaration:()=>jnn,TypeId:()=>sv,TypeReference:()=>Va,Uint64Type:()=>Enn,UintType:()=>vnn,UndiscriminatedUnionMember:()=>Onn,UndiscriminatedUnionTypeDeclaration:()=>Pnn,UnionTypeDeclaration:()=>knn,UserAgent:()=>sin,UserDefinedProtobufType:()=>nnn,UserSpecifiedEndpointExample:()=>Urn,UuidType:()=>Inn,VariableDeclaration:()=>Qnn,VariableId:()=>nut,WebSocketChannel:()=>nin,WebSocketChannelId:()=>Pct,WebSocketMessage:()=>tin,WebSocketMessageBody:()=>$nn,WebSocketMessageBodyReference:()=>Znn,WebSocketMessageId:()=>put,WebSocketMessageOrigin:()=>ein,WebSocketName:()=>rin,Webhook:()=>Gnn,WebhookGroup:()=>Wnn,WebhookGroupId:()=>Oct,WebhookHttpMethod:()=>Lnn,WebhookId:()=>Pen,WebhookName:()=>znn,WebhookPayload:()=>qnn,WebhookPayloadReference:()=>Vnn,WellKnownProtobufType:()=>inn,WithDocs:()=>qo,WithDocsAndAvailability:()=>ixe,WithJsonExample:()=>rte,auth:()=>PPo,commons:()=>DPo,constants:()=>RPo,dynamic:()=>fI,environment:()=>zPo,errors:()=>UPo,generatorExec:()=>VPo,http:()=>qPo,ir:()=>GPo,proto:()=>WPo,publish:()=>HPo,types:()=>KPo,variables:()=>JPo,webhooks:()=>YPo,websocket:()=>XPo});var PPo={};te(PPo,{ApiAuth:()=>Ten,AuthScheme:()=>xen,AuthSchemesRequirement:()=>Sen,BasicAuthScheme:()=>fen,BearerAuthScheme:()=>den,EnvironmentVariable:()=>g5,HeaderAuthScheme:()=>men,OAuthAccessTokenRequestProperties:()=>Een,OAuthAccessTokenResponseProperties:()=>Bct,OAuthClientCredentials:()=>Ien,OAuthConfiguration:()=>Cen,OAuthRefreshEndpoint:()=>ben,OAuthRefreshTokenRequestProperties:()=>yen,OAuthScheme:()=>wen,OAuthTokenEndpoint:()=>ven});var H={};te(H,{JsonError:()=>Act,ParseError:()=>yct,any:()=>QVc,bigint:()=>xVc,boolean:()=>MVc,booleanLiteral:()=>NVc,date:()=>SVc,discriminant:()=>KVc,enum_:()=>nen,getObjectLikeUtils:()=>xH,getObjectUtils:()=>Jze,getSchemaUtils:()=>hh,isProperty:()=>Kfe,lazy:()=>TVc,lazyObject:()=>FVc,list:()=>oen,never:()=>LVc,number:()=>zVc,object:()=>ien,objectWithoutOptionalProperties:()=>RVc,optional:()=>uPo,property:()=>OVc,record:()=>qVc,set:()=>GVc,string:()=>UVc,stringLiteral:()=>jVc,transform:()=>lPo,undiscriminatedUnion:()=>HVc,union:()=>YVc,unknown:()=>_Vc,withParsedProperties:()=>dPo});var Cl={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 Sm(e,t){return`Expected ${t}. Received ${zJd(e)}.`}function zJd(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function hT(e){return Object.assign(Object.assign({},e),{json:wVc(e.json),parse:wVc(e.parse)})}function wVc(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(`
|
|
3651
3651
|
`)),{ok:!0,value:t}):n}}function ren(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var Act=class e extends Error{constructor(t){super(t.map(ren).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var yct=class e extends Error{constructor(t){super(t.map(ren).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function hh(e){return{nullable:()=>UJd(e),optional:()=>uPo(e),optionalNullable:()=>_Jd(e),transform:t=>lPo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new yct(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new Act(n.errors)}}}function UJd(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:()=>Cl.NULLABLE};return Object.assign(Object.assign({},t),hh(t))}function uPo(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:()=>Cl.OPTIONAL};return Object.assign(Object.assign({},t),hh(t))}function _Jd(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:()=>Cl.OPTIONAL_NULLABLE};return Object.assign(Object.assign({},t),hh(t))}function lPo(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 Object.assign(Object.assign({},r),hh(r))}function xVc(){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:Sm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:Sm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>Cl.BIGINT};return Object.assign(Object.assign({},hT(e)),hh(e))}var VJd=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function SVc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:Sm(t,"string")}]}:VJd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:Sm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:Sm(t,"Date object")}]},getType:()=>Cl.DATE};return Object.assign(Object.assign({},hT(e)),hh(e))}function gT(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return Object.assign(Object.assign({},hT(r)),hh(r))}}function nen(e){let t=new Set(e);return gT(Cl.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:Sm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:Sm(n,"enum")}]}:{ok:!0,value:n})()}function TVc(e){let t=pPo(e);return Object.assign(Object.assign({},t),hh(t))}function pPo(e){return{parse:(t,r)=>bct(e).parse(t,r),json:(t,r)=>bct(e).json(t,r),getType:()=>bct(e).getType()}}function bct(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function fPo(e){return Object.entries(e)}function w5t(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}function Hfe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}function x5t(e){return Object.keys(e)}function BVc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var qJd=Object.prototype.hasOwnProperty;function xH(e){return{withParsedProperties:t=>dPo(e,t)}}function dPo(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(qJd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:Object.assign(Object.assign({},o.value),s)}},json:(n,i)=>{var o;if(!Hfe(n))return{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:Sm(n,"object")}]};let s=new Set(Object.keys(t)),a=w5t(n,Object.keys(n).filter(c=>!s.has(c)));return e.json(a,i)},getType:()=>e.getType()};return Object.assign(Object.assign(Object.assign({},r),hh(r)),xH(r))}function OVc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Kfe(e){return e.isProperty}var GJd=Object.prototype.hasOwnProperty;function ien(e){let t;function r(){if(t==null){t={};for(let[d,f]of fPo(e)){let m=Kfe(f)?f.rawKey:d,h=Kfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:h}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of fPo(e)){let m=Kfe(f)?f.rawKey:d,h=Kfe(f)?f.valueSchema:f;WJd(h)&&(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])=>Kfe(f)?f.rawKey:d),_getParsedProperties:()=>x5t(e),parse:(d,f)=>{var m;let h=(m=f?.breadcrumbsPrefix)!==null&&m!==void 0?m:[];return PVc({value:d,requiredKeys:a(),requiredKeysSet:u(),getProperty:A=>{let y=r()[A];if(y!=null)return{transformedKey:y.parsedKey,transform:I=>{let w=[...h,A];return y.valueSchema.parse(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:h,omitUndefined:f?.omitUndefined})},json:(d,f)=>{var m;let h=(m=f?.breadcrumbsPrefix)!==null&&m!==void 0?m:[];return PVc({value:d,requiredKeys:c(),requiredKeysSet:l(),getProperty:A=>{let y=e[A];if(y!=null)return Kfe(y)?{transformedKey:y.rawKey,transform:I=>{let w=[...h,A];return y.valueSchema.json(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}:{transformedKey:A,transform:I=>{let w=[...h,A];return y.json(I,Object.assign(Object.assign({},f),{breadcrumbsPrefix:w}))}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:h,omitUndefined:f?.omitUndefined})},getType:()=>Cl.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},hT(p)),hh(p)),xH(p)),Jze(p))}function PVc({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Hfe(e))return{ok:!1,errors:[{path:s,message:Sm(e,"object")}]};let a=t.length,c=[],u={};for(let l in e){if(!GJd.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 Jze(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>DVc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>DVc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Cl.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},r),hh(r)),xH(r)),Jze(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,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},json:(i,o)=>{let s=e.json(i,Object.assign(Object.assign({},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:Object.assign(Object.assign({},a),s.value)}},getType:()=>Cl.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},n),hh(n)),xH(n)),Jze(n))}}}function DVc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Hfe(t))return{ok:!1,errors:[{path:i,message:Sm(t,"object")}]};let o=new Set(e),[s,a]=BVc(x5t(t),l=>o.has(l)),c=r(w5t(t,a)),u=n(w5t(t,s));return c.ok&&u.ok?{ok:!0,value:Object.assign(Object.assign({},c.value),u.value)}:{ok:!1,errors:[...c.ok?[]:c.errors,...u.ok?[]:u.errors]}}function WJd(e){return!HJd(e)}function HJd(e){switch(e.getType()){case Cl.ANY:case Cl.UNKNOWN:case Cl.OPTIONAL:case Cl.OPTIONAL_NULLABLE:return!0;default:return!1}}function RVc(e){return ien(e)}function FVc(e){let t=Object.assign(Object.assign({},pPo(e)),{_getRawProperties:()=>bct(e)._getRawProperties(),_getParsedProperties:()=>bct(e)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},t),hh(t)),xH(t)),Jze(t))}function oen(e){let t={parse:(r,n)=>kVc(r,(i,o)=>{var s;return e.parse(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),json:(r,n)=>kVc(r,(i,o)=>{var s;return e.json(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`[${o}]`]}))}),getType:()=>Cl.LIST};return Object.assign(Object.assign({},hT(t)),hh(t))}function kVc(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:Sm(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}}function NVc(e){return gT(Cl.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Sm(r,`${e.toString()}`)}]})()}function jVc(e){return gT(Cl.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:Sm(r,`"${e}"`)}]})()}var QVc=gT(Cl.ANY,e=>({ok:!0,value:e}));var MVc=gT(Cl.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Sm(e,"boolean")}]});var LVc=gT(Cl.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}));var zVc=gT(Cl.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Sm(e,"number")}]});var UVc=gT(Cl.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:Sm(e,"string")}]});var _Vc=gT(Cl.UNKNOWN,e=>({ok:!0,value:e}));var KJd=Object.prototype.hasOwnProperty;function qVc(e,t){let r={parse:(n,i)=>VVc({value:n,isKeyNumeric:e.getType()===Cl.NUMBER,transformKey:o=>{var s;return e.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.parse(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>VVc({value:n,isKeyNumeric:e.getType()===Cl.NUMBER,transformKey:o=>{var s;return e.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${o} (key)`]}))},transformValue:(o,s)=>{var a;return t.json(o,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${s}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Cl.RECORD};return Object.assign(Object.assign({},hT(r)),hh(r))}function VVc({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Hfe(e))return{ok:!1,errors:[{path:i,message:Sm(e,"object")}]};let o={},s=[];for(let a in e){if(!KJd.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}}function GVc(e){let t=oen(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)=>{var o;return n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:(o=i?.breadcrumbsPrefix)!==null&&o!==void 0?o:[],message:Sm(n,"Set")}]}},getType:()=>Cl.SET};return Object.assign(Object.assign({},hT(r)),hh(r))}function HVc(e){let t={parse:(r,n)=>WVc((i,o)=>i.parse(r,o),e,n),json:(r,n)=>WVc((i,o)=>i.json(r,o),e,n),getType:()=>Cl.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},hT(t)),hh(t))}function WVc(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,Object.assign(Object.assign({},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}}function KVc(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var JJd=Object.prototype.hasOwnProperty;function YVc(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=nen(x5t(t)),o={parse:(s,a)=>JVc({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>{var u;return i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],r]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>JVc({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>{var u;return i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(u=a?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],n]})},getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,u)=>u.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>Cl.UNION};return Object.assign(Object.assign(Object.assign({},hT(o)),hh(o)),xH(o))}function JVc({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Hfe(e))return{ok:!1,errors:[{path:a,message:Sm(e,"object")}]};let c=e[t],u={};for(let f in e)JJd.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:Object.assign({[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:Object.assign({[r]:c},d.value)}:d}var qo=H.objectWithoutOptionalProperties({docs:H.string().optional()});var In={};te(In,{ApiDefinitionSource:()=>Kwe,ApiVersionScheme:()=>Ict,AuthScheme:()=>l5,AuthSchemesRequirement:()=>sen,AvailabilityStatus:()=>vct,ContainerType:()=>ER,Environments:()=>Nwe,ErrorDeclarationDiscriminantValue:()=>jwe,ErrorDiscriminationStrategy:()=>Jwe,ExampleCodeSample:()=>Qwe,ExampleContainer:()=>vR,ExampleEndpointSuccessResponse:()=>Hee,ExamplePrimitive:()=>Eg,ExampleQueryParameterShape:()=>Kee,ExampleRequestBody:()=>Mwe,ExampleResponse:()=>Lwe,ExampleSingleUnionTypeProperties:()=>Xee,ExampleTypeReferenceShape:()=>d5,ExampleTypeShape:()=>xM,ExampleWebSocketMessageBody:()=>exe,FileProperty:()=>zwe,FileUploadBodyPropertyEncoding:()=>S5t,FileUploadRequestProperty:()=>Uwe,HttpMethod:()=>Yze,HttpRequestBody:()=>p5,HttpResponseBody:()=>bR,JsonResponse:()=>_we,Literal:()=>Zwe,NamedTypeDefault:()=>wct,NonStreamHttpResponseBody:()=>f5,OAuthConfiguration:()=>Ect,ObjectPropertyAccess:()=>uen,Pagination:()=>Vwe,PathParameterLocation:()=>T5t,PrimitiveTypeV1:()=>U2,PrimitiveTypeV2:()=>vg,ProtobufType:()=>Ywe,PublishTarget:()=>Cct,PublishingConfig:()=>Xwe,RequestPropertyValue:()=>qwe,ResolvedTypeReference:()=>m5,SdkRequestBodyType:()=>Gwe,SdkRequestShape:()=>Wwe,ShapeType:()=>xct,SingleUnionTypeProperties:()=>Zee,Source:()=>Sct,StreamingResponse:()=>Jee,SupportedSdkLanguage:()=>Yee,Transport:()=>Hwe,Type:()=>SM,TypeReference:()=>h5,WebSocketMessageBody:()=>txe,WebSocketMessageOrigin:()=>pen,WebhookHttpMethod:()=>len,WebhookPayload:()=>$we,WellKnownProtobufType:()=>fa,auth:()=>mPo,commons:()=>hPo,constants:()=>XVc,dynamic:()=>Ai,environment:()=>EPo,errors:()=>vPo,generatorExec:()=>nu,http:()=>CPo,ir:()=>wPo,proto:()=>xPo,publish:()=>SPo,types:()=>TPo,variables:()=>A5c,webhooks:()=>BPo,websocket:()=>OPo});var mPo={};te(mPo,{AuthScheme:()=>l5,AuthSchemesRequirement:()=>sen,OAuthConfiguration:()=>Ect});var l5={bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return l5._visit(this,t)}}),basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return l5._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return l5._visit(this,t)}}),oauth:e=>Object.assign(Object.assign({},e),{type:"oauth",_visit:function(t){return l5._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bearer":return t.bearer(e);case"basic":return t.basic(e);case"header":return t.header(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var YJd={All:"ALL",Any:"ANY"},sen=Object.assign(Object.assign({},YJd),{_visit:(e,t)=>{switch(e){case sen.All:return t.all();case sen.Any:return t.any();default:return t._other()}}});var Ect={clientCredentials:e=>Object.assign(Object.assign({},e),{type:"clientCredentials",_visit:function(t){return Ect._visit(this,t)}}),_visit:(e,t)=>e.type==="clientCredentials"?t.clientCredentials(e):t._other(e)};var hPo={};te(hPo,{AvailabilityStatus:()=>vct});var XJd={InDevelopment:"IN_DEVELOPMENT",PreRelease:"PRE_RELEASE",GeneralAvailability:"GENERAL_AVAILABILITY",Deprecated:"DEPRECATED"},vct=Object.assign(Object.assign({},XJd),{_visit:(e,t)=>{switch(e){case vct.InDevelopment:return t.inDevelopment();case vct.PreRelease:return t.preRelease();case vct.GeneralAvailability:return t.generalAvailability();case vct.Deprecated:return t.deprecated();default:return t._other()}}});var XVc={};var Ai={};te(Ai,{Auth:()=>ZVc,AuthValues:()=>$Vc,ErrorSeverity:()=>aen,FileUploadRequestBodyProperty:()=>t5c,InlinedRequestBody:()=>r5c,LiteralType:()=>c5c,NamedType:()=>u5c,ReferencedRequestBodyType:()=>n5c,Request:()=>i5c,Response:()=>o5c,SingleDiscriminatedUnionType:()=>l5c,TypeReference:()=>p5c,auth:()=>gPo,declaration:()=>e5c,endpoints:()=>APo,environment:()=>s5c,ir:()=>a5c,snippets:()=>yPo,types:()=>bPo});var gPo={};te(gPo,{Auth:()=>ZVc,AuthValues:()=>$Vc});var ZVc={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return Ai.Auth._visit(this,t)}}),bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return Ai.Auth._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Ai.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);default:return t._other(e)}}};var $Vc={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return Ai.AuthValues._visit(this,t)}}),bearer:e=>Object.assign(Object.assign({},e),{type:"bearer",_visit:function(t){return Ai.AuthValues._visit(this,t)}}),header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Ai.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);default:return t._other(e)}}};var e5c={};var APo={};te(APo,{FileUploadRequestBodyProperty:()=>t5c,InlinedRequestBody:()=>r5c,ReferencedRequestBodyType:()=>n5c,Request:()=>i5c,Response:()=>o5c});var t5c={file:e=>Object.assign(Object.assign({},e),{type:"file",_visit:function(t){return Ai.FileUploadRequestBodyProperty._visit(this,t)}}),fileArray:e=>Object.assign(Object.assign({},e),{type:"fileArray",_visit:function(t){return Ai.FileUploadRequestBodyProperty._visit(this,t)}}),bodyProperty:e=>Object.assign(Object.assign({},e),{type:"bodyProperty",_visit:function(t){return Ai.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 r5c={properties:e=>({value:e,type:"properties",_visit:function(t){return Ai.InlinedRequestBody._visit(this,t)}}),referenced:e=>Object.assign(Object.assign({},e),{type:"referenced",_visit:function(t){return Ai.InlinedRequestBody._visit(this,t)}}),fileUpload:e=>Object.assign(Object.assign({},e),{type:"fileUpload",_visit:function(t){return Ai.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 n5c={bytes:()=>({type:"bytes",_visit:function(e){return Ai.ReferencedRequestBodyType._visit(this,e)}}),typeReference:e=>({value:e,type:"typeReference",_visit:function(t){return Ai.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 i5c={body:e=>Object.assign(Object.assign({},e),{type:"body",_visit:function(t){return Ai.Request._visit(this,t)}}),inlined:e=>Object.assign(Object.assign({},e),{type:"inlined",_visit:function(t){return Ai.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 o5c={json:()=>({type:"json",_visit:function(e){return Ai.Response._visit(this,e)}}),_visit:(e,t)=>e.type==="json"?t.json():t._other(e)};var s5c={};var a5c={};var yPo={};te(yPo,{ErrorSeverity:()=>aen});var ZJd={Critical:"CRITICAL",Warning:"WARNING"},aen=Object.assign(Object.assign({},ZJd),{_visit:(e,t)=>{switch(e){case aen.Critical:return t.critical();case aen.Warning:return t.warning();default:return t._other()}}});var bPo={};te(bPo,{LiteralType:()=>c5c,NamedType:()=>u5c,SingleDiscriminatedUnionType:()=>l5c,TypeReference:()=>p5c});var c5c={boolean:e=>({value:e,type:"boolean",_visit:function(t){return Ai.LiteralType._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Ai.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 u5c={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return Ai.NamedType._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return Ai.NamedType._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return Ai.NamedType._visit(this,t)}}),discriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"discriminatedUnion",_visit:function(t){return Ai.NamedType._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return Ai.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 l5c={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{type:"samePropertiesAsObject",_visit:function(t){return Ai.SingleDiscriminatedUnionType._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{type:"singleProperty",_visit:function(t){return Ai.SingleDiscriminatedUnionType._visit(this,t)}}),noProperties:e=>Object.assign(Object.assign({},e),{type:"noProperties",_visit:function(t){return Ai.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 p5c={list:e=>({value:e,type:"list",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),named:e=>({value:e,type:"named",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),nullable:e=>({value:e,type:"nullable",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),optional:e=>({value:e,type:"optional",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),primitive:e=>({value:e,type:"primitive",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),set:e=>({value:e,type:"set",_visit:function(t){return Ai.TypeReference._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return Ai.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 EPo={};te(EPo,{Environments:()=>Nwe});var Nwe={singleBaseUrl:e=>Object.assign(Object.assign({},e),{type:"singleBaseUrl",_visit:function(t){return Nwe._visit(this,t)}}),multipleBaseUrls:e=>Object.assign(Object.assign({},e),{type:"multipleBaseUrls",_visit:function(t){return Nwe._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 vPo={};te(vPo,{ErrorDeclarationDiscriminantValue:()=>jwe});var jwe={property:e=>Object.assign(Object.assign({},e),{type:"property",_visit:function(t){return jwe._visit(this,t)}}),statusCode:()=>({type:"statusCode",_visit:function(e){return jwe._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"property":return t.property(e);case"statusCode":return t.statusCode();default:return t._other(e)}}};var nu={};te(nu,{GeneratorEnvironment:()=>f5c,GeneratorPublishTarget:()=>d5c,GithubPublishInfo:()=>m5c,LicenseConfig:()=>h5c,LicenseId:()=>cen,OutputMode:()=>g5c,config:()=>IPo});var IPo={};te(IPo,{GeneratorEnvironment:()=>f5c,GeneratorPublishTarget:()=>d5c,GithubPublishInfo:()=>m5c,LicenseConfig:()=>h5c,LicenseId:()=>cen,OutputMode:()=>g5c});var f5c={local:()=>({type:"local",_visit:function(e){return nu.GeneratorEnvironment._visit(this,e)}}),remote:e=>Object.assign(Object.assign({},e),{type:"remote",_visit:function(t){return nu.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 d5c={maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return nu.GeneratorPublishTarget._visit(this,t)}}),npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return nu.GeneratorPublishTarget._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return nu.GeneratorPublishTarget._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return nu.GeneratorPublishTarget._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return nu.GeneratorPublishTarget._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return nu.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);default:return t._other(e)}}};var m5c={npm:e=>Object.assign(Object.assign({},e),{type:"npm",_visit:function(t){return nu.GithubPublishInfo._visit(this,t)}}),maven:e=>Object.assign(Object.assign({},e),{type:"maven",_visit:function(t){return nu.GithubPublishInfo._visit(this,t)}}),postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return nu.GithubPublishInfo._visit(this,t)}}),pypi:e=>Object.assign(Object.assign({},e),{type:"pypi",_visit:function(t){return nu.GithubPublishInfo._visit(this,t)}}),rubygems:e=>Object.assign(Object.assign({},e),{type:"rubygems",_visit:function(t){return nu.GithubPublishInfo._visit(this,t)}}),nuget:e=>Object.assign(Object.assign({},e),{type:"nuget",_visit:function(t){return nu.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);default:return t._other(e)}}};var h5c={basic:e=>Object.assign(Object.assign({},e),{type:"basic",_visit:function(t){return nu.LicenseConfig._visit(this,t)}}),custom:e=>Object.assign(Object.assign({},e),{type:"custom",_visit:function(t){return nu.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 $Jd={Mit:"MIT",Apache2:"Apache-2.0"},cen=Object.assign(Object.assign({},$Jd),{_visit:(e,t)=>{switch(e){case cen.Mit:return t.mit();case cen.Apache2:return t.apache2();default:return t._other()}}});var g5c={publish:e=>Object.assign(Object.assign({},e),{type:"publish",_visit:function(t){return nu.OutputMode._visit(this,t)}}),downloadFiles:()=>({type:"downloadFiles",_visit:function(e){return nu.OutputMode._visit(this,e)}}),github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return nu.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 CPo={};te(CPo,{ExampleCodeSample:()=>Qwe,ExampleEndpointSuccessResponse:()=>Hee,ExampleQueryParameterShape:()=>Kee,ExampleRequestBody:()=>Mwe,ExampleResponse:()=>Lwe,FileProperty:()=>zwe,FileUploadBodyPropertyEncoding:()=>S5t,FileUploadRequestProperty:()=>Uwe,HttpMethod:()=>Yze,HttpRequestBody:()=>p5,HttpResponseBody:()=>bR,JsonResponse:()=>_we,NonStreamHttpResponseBody:()=>f5,Pagination:()=>Vwe,PathParameterLocation:()=>T5t,RequestPropertyValue:()=>qwe,SdkRequestBodyType:()=>Gwe,SdkRequestShape:()=>Wwe,StreamingResponse:()=>Jee,SupportedSdkLanguage:()=>Yee,Transport:()=>Hwe});var Qwe={language:e=>Object.assign(Object.assign({},e),{type:"language",_visit:function(t){return Qwe._visit(this,t)}}),sdk:e=>Object.assign(Object.assign({},e),{type:"sdk",_visit:function(t){return Qwe._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 Hee={body:e=>({value:e,type:"body",_visit:function(t){return Hee._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return Hee._visit(this,t)}}),sse:e=>({value:e,type:"sse",_visit:function(t){return Hee._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 Kee={single:()=>({type:"single",_visit:function(e){return Kee._visit(this,e)}}),exploded:()=>({type:"exploded",_visit:function(e){return Kee._visit(this,e)}}),commaSeparated:()=>({type:"commaSeparated",_visit:function(e){return Kee._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 Mwe={inlinedRequestBody:e=>Object.assign(Object.assign({},e),{type:"inlinedRequestBody",_visit:function(t){return Mwe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return Mwe._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 Lwe={ok:e=>({value:e,type:"ok",_visit:function(t){return Lwe._visit(this,t)}}),error:e=>Object.assign(Object.assign({},e),{type:"error",_visit:function(t){return Lwe._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 zwe={file:e=>Object.assign(Object.assign({},e),{type:"file",_visit:function(t){return zwe._visit(this,t)}}),fileArray:e=>Object.assign(Object.assign({},e),{type:"fileArray",_visit:function(t){return zwe._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 eYd={Exploded:"exploded",Json:"json",Form:"form"},S5t=Object.assign(Object.assign({},eYd),{_visit:(e,t)=>{switch(e){case S5t.Exploded:return t.exploded();case S5t.Json:return t.json();case S5t.Form:return t.form();default:return t._other()}}});var Uwe={file:e=>({value:e,type:"file",_visit:function(t){return Uwe._visit(this,t)}}),bodyProperty:e=>Object.assign(Object.assign({},e),{type:"bodyProperty",_visit:function(t){return Uwe._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 tYd={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE"},Yze=Object.assign(Object.assign({},tYd),{_visit:(e,t)=>{switch(e){case Yze.Get:return t.get();case Yze.Post:return t.post();case Yze.Put:return t.put();case Yze.Patch:return t.patch();case Yze.Delete:return t.delete();default:return t._other()}}});var p5={inlinedRequestBody:e=>Object.assign(Object.assign({},e),{type:"inlinedRequestBody",_visit:function(t){return p5._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return p5._visit(this,t)}}),fileUpload:e=>Object.assign(Object.assign({},e),{type:"fileUpload",_visit:function(t){return p5._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return p5._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 bR={json:e=>({value:e,type:"json",_visit:function(t){return bR._visit(this,t)}}),fileDownload:e=>Object.assign(Object.assign({},e),{type:"fileDownload",_visit:function(t){return bR._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return bR._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return bR._visit(this,t)}}),streaming:e=>({value:e,type:"streaming",_visit:function(t){return bR._visit(this,t)}}),streamParameter:e=>Object.assign(Object.assign({},e),{type:"streamParameter",_visit:function(t){return bR._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 _we={response:e=>Object.assign(Object.assign({},e),{type:"response",_visit:function(t){return _we._visit(this,t)}}),nestedPropertyAsResponse:e=>Object.assign(Object.assign({},e),{type:"nestedPropertyAsResponse",_visit:function(t){return _we._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 f5={json:e=>({value:e,type:"json",_visit:function(t){return f5._visit(this,t)}}),fileDownload:e=>Object.assign(Object.assign({},e),{type:"fileDownload",_visit:function(t){return f5._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return f5._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return f5._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 Vwe={cursor:e=>Object.assign(Object.assign({},e),{type:"cursor",_visit:function(t){return Vwe._visit(this,t)}}),offset:e=>Object.assign(Object.assign({},e),{type:"offset",_visit:function(t){return Vwe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);default:return t._other(e)}}};var rYd={Root:"ROOT",Service:"SERVICE",Endpoint:"ENDPOINT"},T5t=Object.assign(Object.assign({},rYd),{_visit:(e,t)=>{switch(e){case T5t.Root:return t.root();case T5t.Service:return t.service();case T5t.Endpoint:return t.endpoint();default:return t._other()}}});var qwe={query:e=>Object.assign(Object.assign({},e),{type:"query",_visit:function(t){return qwe._visit(this,t)}}),body:e=>Object.assign(Object.assign({},e),{type:"body",_visit:function(t){return qwe._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 Gwe={typeReference:e=>Object.assign(Object.assign({},e),{type:"typeReference",_visit:function(t){return Gwe._visit(this,t)}}),bytes:e=>Object.assign(Object.assign({},e),{type:"bytes",_visit:function(t){return Gwe._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 Wwe={justRequestBody:e=>({value:e,type:"justRequestBody",_visit:function(t){return Wwe._visit(this,t)}}),wrapper:e=>Object.assign(Object.assign({},e),{type:"wrapper",_visit:function(t){return Wwe._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 Jee={json:e=>Object.assign(Object.assign({},e),{type:"json",_visit:function(t){return Jee._visit(this,t)}}),text:e=>Object.assign(Object.assign({},e),{type:"text",_visit:function(t){return Jee._visit(this,t)}}),sse:e=>Object.assign(Object.assign({},e),{type:"sse",_visit:function(t){return Jee._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 nYd={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java"},Yee=Object.assign(Object.assign({},nYd),{_visit:(e,t)=>{switch(e){case Yee.Curl:return t.curl();case Yee.Python:return t.python();case Yee.Javascript:return t.javascript();case Yee.Typescript:return t.typescript();case Yee.Go:return t.go();case Yee.Ruby:return t.ruby();case Yee.Csharp:return t.csharp();case Yee.Java:return t.java();default:return t._other()}}});var Hwe={http:()=>({type:"http",_visit:function(e){return Hwe._visit(this,e)}}),grpc:e=>Object.assign(Object.assign({},e),{type:"grpc",_visit:function(t){return Hwe._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 wPo={};te(wPo,{ApiDefinitionSource:()=>Kwe,ApiVersionScheme:()=>Ict,ErrorDiscriminationStrategy:()=>Jwe});var Kwe={proto:e=>Object.assign(Object.assign({},e),{type:"proto",_visit:function(t){return Kwe._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return Kwe._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 Ict={header:e=>Object.assign(Object.assign({},e),{type:"header",_visit:function(t){return Ict._visit(this,t)}}),_visit:(e,t)=>e.type==="header"?t.header(e):t._other(e)};var Jwe={statusCode:()=>({type:"statusCode",_visit:function(e){return Jwe._visit(this,e)}}),property:e=>Object.assign(Object.assign({},e),{type:"property",_visit:function(t){return Jwe._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 xPo={};te(xPo,{ProtobufType:()=>Ywe,WellKnownProtobufType:()=>fa});var Ywe={wellKnown:e=>({value:e,type:"wellKnown",_visit:function(t){return Ywe._visit(this,t)}}),userDefined:e=>Object.assign(Object.assign({},e),{type:"userDefined",_visit:function(t){return Ywe._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 fa={any:()=>({type:"any",_visit:function(e){return fa._visit(this,e)}}),api:()=>({type:"api",_visit:function(e){return fa._visit(this,e)}}),boolValue:()=>({type:"boolValue",_visit:function(e){return fa._visit(this,e)}}),bytesValue:()=>({type:"bytesValue",_visit:function(e){return fa._visit(this,e)}}),doubleValue:()=>({type:"doubleValue",_visit:function(e){return fa._visit(this,e)}}),duration:()=>({type:"duration",_visit:function(e){return fa._visit(this,e)}}),empty:()=>({type:"empty",_visit:function(e){return fa._visit(this,e)}}),enum:()=>({type:"enum",_visit:function(e){return fa._visit(this,e)}}),enumValue:()=>({type:"enumValue",_visit:function(e){return fa._visit(this,e)}}),field:()=>({type:"field",_visit:function(e){return fa._visit(this,e)}}),fieldCardinality:()=>({type:"fieldCardinality",_visit:function(e){return fa._visit(this,e)}}),fieldKind:()=>({type:"fieldKind",_visit:function(e){return fa._visit(this,e)}}),fieldMask:()=>({type:"fieldMask",_visit:function(e){return fa._visit(this,e)}}),floatValue:()=>({type:"floatValue",_visit:function(e){return fa._visit(this,e)}}),int32Value:()=>({type:"int32Value",_visit:function(e){return fa._visit(this,e)}}),int64Value:()=>({type:"int64Value",_visit:function(e){return fa._visit(this,e)}}),listValue:()=>({type:"listValue",_visit:function(e){return fa._visit(this,e)}}),method:()=>({type:"method",_visit:function(e){return fa._visit(this,e)}}),mixin:()=>({type:"mixin",_visit:function(e){return fa._visit(this,e)}}),nullValue:()=>({type:"nullValue",_visit:function(e){return fa._visit(this,e)}}),option:()=>({type:"option",_visit:function(e){return fa._visit(this,e)}}),sourceContext:()=>({type:"sourceContext",_visit:function(e){return fa._visit(this,e)}}),stringValue:()=>({type:"stringValue",_visit:function(e){return fa._visit(this,e)}}),struct:()=>({type:"struct",_visit:function(e){return fa._visit(this,e)}}),syntax:()=>({type:"syntax",_visit:function(e){return fa._visit(this,e)}}),timestamp:()=>({type:"timestamp",_visit:function(e){return fa._visit(this,e)}}),type:()=>({type:"type",_visit:function(e){return fa._visit(this,e)}}),uint32Value:()=>({type:"uint32Value",_visit:function(e){return fa._visit(this,e)}}),uint64Value:()=>({type:"uint64Value",_visit:function(e){return fa._visit(this,e)}}),value:()=>({type:"value",_visit:function(e){return fa._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 SPo={};te(SPo,{PublishTarget:()=>Cct,PublishingConfig:()=>Xwe});var Xwe={github:e=>Object.assign(Object.assign({},e),{type:"github",_visit:function(t){return Xwe._visit(this,t)}}),direct:e=>Object.assign(Object.assign({},e),{type:"direct",_visit:function(t){return Xwe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"github":return t.github(e);case"direct":return t.direct(e);default:return t._other(e)}}};var Cct={postman:e=>Object.assign(Object.assign({},e),{type:"postman",_visit:function(t){return Cct._visit(this,t)}}),_visit:(e,t)=>e.type==="postman"?t.postman(e):t._other(e)};var TPo={};te(TPo,{ContainerType:()=>ER,ExampleContainer:()=>vR,ExamplePrimitive:()=>Eg,ExampleSingleUnionTypeProperties:()=>Xee,ExampleTypeReferenceShape:()=>d5,ExampleTypeShape:()=>xM,Literal:()=>Zwe,NamedTypeDefault:()=>wct,ObjectPropertyAccess:()=>uen,PrimitiveTypeV1:()=>U2,PrimitiveTypeV2:()=>vg,ResolvedTypeReference:()=>m5,ShapeType:()=>xct,SingleUnionTypeProperties:()=>Zee,Source:()=>Sct,Type:()=>SM,TypeReference:()=>h5});var ER={list:e=>({list:e,type:"list",_visit:function(t){return ER._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return ER._visit(this,t)}}),nullable:e=>({nullable:e,type:"nullable",_visit:function(t){return ER._visit(this,t)}}),optional:e=>({optional:e,type:"optional",_visit:function(t){return ER._visit(this,t)}}),set:e=>({set:e,type:"set",_visit:function(t){return ER._visit(this,t)}}),literal:e=>({literal:e,type:"literal",_visit:function(t){return ER._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 vR={list:e=>Object.assign(Object.assign({},e),{type:"list",_visit:function(t){return vR._visit(this,t)}}),set:e=>Object.assign(Object.assign({},e),{type:"set",_visit:function(t){return vR._visit(this,t)}}),optional:e=>Object.assign(Object.assign({},e),{type:"optional",_visit:function(t){return vR._visit(this,t)}}),nullable:e=>Object.assign(Object.assign({},e),{type:"nullable",_visit:function(t){return vR._visit(this,t)}}),map:e=>Object.assign(Object.assign({},e),{type:"map",_visit:function(t){return vR._visit(this,t)}}),literal:e=>Object.assign(Object.assign({},e),{type:"literal",_visit:function(t){return vR._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 Eg={integer:e=>({integer:e,type:"integer",_visit:function(t){return Eg._visit(this,t)}}),long:e=>({long:e,type:"long",_visit:function(t){return Eg._visit(this,t)}}),uint:e=>({uint:e,type:"uint",_visit:function(t){return Eg._visit(this,t)}}),uint64:e=>({uint64:e,type:"uint64",_visit:function(t){return Eg._visit(this,t)}}),float:e=>({float:e,type:"float",_visit:function(t){return Eg._visit(this,t)}}),double:e=>({double:e,type:"double",_visit:function(t){return Eg._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return Eg._visit(this,t)}}),string:e=>({string:e,type:"string",_visit:function(t){return Eg._visit(this,t)}}),date:e=>({date:e,type:"date",_visit:function(t){return Eg._visit(this,t)}}),datetime:e=>Object.assign(Object.assign({},e),{type:"datetime",_visit:function(t){return Eg._visit(this,t)}}),uuid:e=>({uuid:e,type:"uuid",_visit:function(t){return Eg._visit(this,t)}}),base64:e=>({base64:e,type:"base64",_visit:function(t){return Eg._visit(this,t)}}),bigInteger:e=>({bigInteger:e,type:"bigInteger",_visit:function(t){return Eg._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e.integer);case"long":return t.long(e.long);case"uint":return t.uint(e.uint);case"uint64":return t.uint64(e.uint64);case"float":return t.float(e.float);case"double":return t.double(e.double);case"boolean":return t.boolean(e.boolean);case"string":return t.string(e.string);case"date":return t.date(e.date);case"datetime":return t.datetime(e);case"uuid":return t.uuid(e.uuid);case"base64":return t.base64(e.base64);case"bigInteger":return t.bigInteger(e.bigInteger);default:return t._other(e)}}};var Xee={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{type:"samePropertiesAsObject",_visit:function(t){return Xee._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{type:"singleProperty",_visit:function(t){return Xee._visit(this,t)}}),noProperties:()=>({type:"noProperties",_visit:function(e){return Xee._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 d5={primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return d5._visit(this,t)}}),container:e=>({container:e,type:"container",_visit:function(t){return d5._visit(this,t)}}),unknown:e=>({unknown:e,type:"unknown",_visit:function(t){return d5._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return d5._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 xM={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return xM._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return xM._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return xM._visit(this,t)}}),union:e=>Object.assign(Object.assign({},e),{type:"union",_visit:function(t){return xM._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return xM._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 Zwe={string:e=>({string:e,type:"string",_visit:function(t){return Zwe._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return Zwe._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 wct={enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return wct._visit(this,t)}}),_visit:(e,t)=>e.type==="enum"?t.enum(e):t._other(e)};var iYd={ReadOnly:"READ_ONLY",WriteOnly:"WRITE_ONLY"},uen=Object.assign(Object.assign({},iYd),{_visit:(e,t)=>{switch(e){case uen.ReadOnly:return t.readOnly();case uen.WriteOnly:return t.writeOnly();default:return t._other()}}});var oYd={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER"},U2=Object.assign(Object.assign({},oYd),{_visit:(e,t)=>{switch(e){case U2.Integer:return t.integer();case U2.Long:return t.long();case U2.Uint:return t.uint();case U2.Uint64:return t.uint64();case U2.Float:return t.float();case U2.Double:return t.double();case U2.Boolean:return t.boolean();case U2.String:return t.string();case U2.Date:return t.date();case U2.DateTime:return t.dateTime();case U2.Uuid:return t.uuid();case U2.Base64:return t.base64();case U2.BigInteger:return t.bigInteger();default:return t._other()}}});var vg={integer:e=>Object.assign(Object.assign({},e),{type:"integer",_visit:function(t){return vg._visit(this,t)}}),long:e=>Object.assign(Object.assign({},e),{type:"long",_visit:function(t){return vg._visit(this,t)}}),uint:e=>Object.assign(Object.assign({},e),{type:"uint",_visit:function(t){return vg._visit(this,t)}}),uint64:e=>Object.assign(Object.assign({},e),{type:"uint64",_visit:function(t){return vg._visit(this,t)}}),float:e=>Object.assign(Object.assign({},e),{type:"float",_visit:function(t){return vg._visit(this,t)}}),double:e=>Object.assign(Object.assign({},e),{type:"double",_visit:function(t){return vg._visit(this,t)}}),boolean:e=>Object.assign(Object.assign({},e),{type:"boolean",_visit:function(t){return vg._visit(this,t)}}),string:e=>Object.assign(Object.assign({},e),{type:"string",_visit:function(t){return vg._visit(this,t)}}),date:e=>Object.assign(Object.assign({},e),{type:"date",_visit:function(t){return vg._visit(this,t)}}),dateTime:e=>Object.assign(Object.assign({},e),{type:"dateTime",_visit:function(t){return vg._visit(this,t)}}),uuid:e=>Object.assign(Object.assign({},e),{type:"uuid",_visit:function(t){return vg._visit(this,t)}}),base64:e=>Object.assign(Object.assign({},e),{type:"base64",_visit:function(t){return vg._visit(this,t)}}),bigInteger:e=>Object.assign(Object.assign({},e),{type:"bigInteger",_visit:function(t){return vg._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e);case"long":return t.long(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"boolean":return t.boolean(e);case"string":return t.string(e);case"date":return t.date(e);case"dateTime":return t.dateTime(e);case"uuid":return t.uuid(e);case"base64":return t.base64(e);case"bigInteger":return t.bigInteger(e);default:return t._other(e)}}};var m5={container:e=>({container:e,type:"container",_visit:function(t){return m5._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return m5._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return m5._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return m5._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 sYd={Enum:"ENUM",Object:"OBJECT",Union:"UNION",UndiscriminatedUnion:"UNDISCRIMINATED_UNION"},xct=Object.assign(Object.assign({},sYd),{_visit:(e,t)=>{switch(e){case xct.Enum:return t.enum();case xct.Object:return t.object();case xct.Union:return t.union();case xct.UndiscriminatedUnion:return t.undiscriminatedUnion();default:return t._other()}}});var Zee={samePropertiesAsObject:e=>Object.assign(Object.assign({},e),{propertiesType:"samePropertiesAsObject",_visit:function(t){return Zee._visit(this,t)}}),singleProperty:e=>Object.assign(Object.assign({},e),{propertiesType:"singleProperty",_visit:function(t){return Zee._visit(this,t)}}),noProperties:()=>({propertiesType:"noProperties",_visit:function(e){return Zee._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 Sct={proto:e=>({value:e,type:"proto",_visit:function(t){return Sct._visit(this,t)}}),_visit:(e,t)=>e.type==="proto"?t.proto(e.value):t._other(e)};var SM={alias:e=>Object.assign(Object.assign({},e),{type:"alias",_visit:function(t){return SM._visit(this,t)}}),enum:e=>Object.assign(Object.assign({},e),{type:"enum",_visit:function(t){return SM._visit(this,t)}}),object:e=>Object.assign(Object.assign({},e),{type:"object",_visit:function(t){return SM._visit(this,t)}}),union:e=>Object.assign(Object.assign({},e),{type:"union",_visit:function(t){return SM._visit(this,t)}}),undiscriminatedUnion:e=>Object.assign(Object.assign({},e),{type:"undiscriminatedUnion",_visit:function(t){return SM._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 h5={container:e=>({container:e,type:"container",_visit:function(t){return h5._visit(this,t)}}),named:e=>Object.assign(Object.assign({},e),{type:"named",_visit:function(t){return h5._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return h5._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return h5._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 A5c={};var BPo={};te(BPo,{WebhookHttpMethod:()=>len,WebhookPayload:()=>$we});var aYd={Get:"GET",Post:"POST"},len=Object.assign(Object.assign({},aYd),{_visit:(e,t)=>{switch(e){case len.Get:return t.get();case len.Post:return t.post();default:return t._other()}}});var $we={inlinedPayload:e=>Object.assign(Object.assign({},e),{type:"inlinedPayload",_visit:function(t){return $we._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return $we._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 OPo={};te(OPo,{ExampleWebSocketMessageBody:()=>exe,WebSocketMessageBody:()=>txe,WebSocketMessageOrigin:()=>pen});var exe={inlinedBody:e=>Object.assign(Object.assign({},e),{type:"inlinedBody",_visit:function(t){return exe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return exe._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 txe={inlinedBody:e=>Object.assign(Object.assign({},e),{type:"inlinedBody",_visit:function(t){return txe._visit(this,t)}}),reference:e=>Object.assign(Object.assign({},e),{type:"reference",_visit:function(t){return txe._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 cYd={Client:"client",Server:"server"},pen=Object.assign(Object.assign({},cYd),{_visit:(e,t)=>{switch(e){case pen.Client:return t.client();case pen.Server:return t.server();default:return t._other()}}});var Xze=H.objectWithoutOptionalProperties({unsafeName:H.string(),safeName:H.string()});var mo=H.objectWithoutOptionalProperties({originalName:H.string(),camelCase:Xze,pascalCase:Xze,snakeCase:Xze,screamingSnakeCase:Xze});var g5=H.string();var fen=H.objectWithoutOptionalProperties({username:mo,usernameEnvVar:g5.optional(),password:mo,passwordEnvVar:g5.optional()}).extend(qo);var den=H.objectWithoutOptionalProperties({token:mo,tokenEnvVar:g5.optional()}).extend(qo);var Ms=H.objectWithoutOptionalProperties({wireValue:H.string(),name:mo});var men=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va),prefix:H.string().optional(),headerEnvVar:g5.optional()}).extend(qo);var SH=H.string();var $ee=H.string();var ete=H.string();var Tct=H.objectWithoutOptionalProperties({endpointId:SH,serviceId:$ee,subpackageId:ete.optional()});var hen=H.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var tte=H.objectWithoutOptionalProperties({status:hen,message:H.string().optional()});var Ww=H.objectWithoutOptionalProperties({availability:tte.optional()}).extend(qo);var gen=H.enum_(["READ_ONLY","WRITE_ONLY"]);var _2=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va),propertyAccess:gen.optional()}).extend(Ww);var A5=H.objectWithoutOptionalProperties({propertyPath:H.list(mo).optional(),property:_2});var Bct=H.objectWithoutOptionalProperties({accessToken:A5,expiresIn:A5.optional(),refreshToken:A5.optional()});var rxe=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va),allowMultiple:H.boolean()}).extend(Ww);var uYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Aen=H.union("type",{query:rxe,body:_2}).transform({transform:e=>{switch(e.type){case"query":return qwe.query(e);case"body":return qwe.body(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=uYd(e,["_visit"]);return r}});var IR=H.objectWithoutOptionalProperties({propertyPath:H.list(mo).optional(),property:Aen});var yen=H.objectWithoutOptionalProperties({refreshToken:IR});var ben=H.objectWithoutOptionalProperties({endpointReference:Tct,requestProperties:yen,responseProperties:Bct});var Een=H.objectWithoutOptionalProperties({clientId:IR,clientSecret:IR,scopes:IR.optional(),customProperties:H.list(IR).optional()});var ven=H.objectWithoutOptionalProperties({endpointReference:Tct,requestProperties:Een,responseProperties:Bct});var Ien=H.objectWithoutOptionalProperties({clientIdEnvVar:g5.optional(),clientSecretEnvVar:g5.optional(),tokenPrefix:H.string().optional(),tokenHeader:H.string().optional(),scopes:H.list(H.string()).optional(),tokenEndpoint:ven,refreshEndpoint:ben.optional()});var lYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Cen=H.union("type",{clientCredentials:Ien}).transform({transform:e=>e.type==="clientCredentials"?Ect.clientCredentials(e):e,untransform:e=>{var{_visit:t}=e,r=lYd(e,["_visit"]);return r}});var wen=H.objectWithoutOptionalProperties({configuration:Cen}).extend(qo);var pYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},xen=H.union(H.discriminant("type","_type"),{bearer:den,basic:fen,header:men,oauth:wen}).transform({transform:e=>{switch(e.type){case"bearer":return l5.bearer(e);case"basic":return l5.basic(e);case"header":return l5.header(e);case"oauth":return l5.oauth(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=pYd(e,["_visit"]);return r}});var Sen=H.enum_(["ALL","ANY"]);var Ten=H.objectWithoutOptionalProperties({requirement:Sen,schemes:H.list(xen)}).extend(qo);var DPo={};te(DPo,{Availability:()=>tte,AvailabilityStatus:()=>hen,Declaration:()=>Ww,EndpointId:()=>SH,EndpointReference:()=>Tct,ErrorId:()=>nxe,EscapedString:()=>Ben,FeatureId:()=>Oen,FernFilepath:()=>TM,Name:()=>mo,NameAndWireValue:()=>Ms,SafeAndUnsafeString:()=>Xze,ServiceId:()=>$ee,SubpackageId:()=>ete,TypeId:()=>sv,WebSocketChannelId:()=>Pct,WebhookGroupId:()=>Oct,WebhookId:()=>Pen,WithDocs:()=>qo,WithDocsAndAvailability:()=>ixe,WithJsonExample:()=>rte});var nxe=H.string();var Ben=H.objectWithoutOptionalProperties({original:H.string()});var Oen=H.string();var TM=H.objectWithoutOptionalProperties({allParts:H.list(mo),packagePath:H.list(mo),file:mo.optional()});var sv=H.string();var Oct=H.string();var Pen=H.string();var Pct=H.string();var ixe=H.objectWithoutOptionalProperties({availability:tte.optional()}).extend(qo);var rte=H.objectWithoutOptionalProperties({jsonExample:H.unknown()});var RPo={};te(RPo,{Constants:()=>Den});var Den=H.objectWithoutOptionalProperties({errorInstanceIdKey:Ms});var fI={};te(fI,{AliasType:()=>stn,Auth:()=>Nen,AuthValues:()=>Len,BasicAuth:()=>Ren,BasicAuthValues:()=>jen,BearerAuth:()=>Fen,BearerAuthValues:()=>Qen,BodyRequest:()=>zen,Declaration:()=>CR,DiscriminatedUnionType:()=>ptn,DynamicIntermediateRepresentation:()=>gtn,Endpoint:()=>$en,EndpointExample:()=>qen,EndpointLocation:()=>Fct,EndpointSnippetRequest:()=>Ven,EndpointSnippetResponse:()=>y5c,EnumType:()=>ftn,EnvironmentValues:()=>_en,ErrorSeverity:()=>Atn,Error_:()=>ytn,FileUploadRequestBody:()=>Wen,FileUploadRequestBodyProperty:()=>Gen,HeaderAuth:()=>ken,HeaderAuthValues:()=>Men,InlinedRequest:()=>Yen,InlinedRequestBody:()=>Ken,InlinedRequestMetadata:()=>Jen,LiteralType:()=>btn,MapType:()=>b5c,MultipleEnvironmentUrlValues:()=>Uen,NamedParameter:()=>cE,NamedType:()=>htn,ObjectType:()=>dtn,ReferencedRequestBody:()=>Hen,ReferencedRequestBodyType:()=>Dct,Request:()=>Xen,Response:()=>Zen,SingleDiscriminatedUnionType:()=>ltn,SingleDiscriminatedUnionTypeNoProperties:()=>atn,SingleDiscriminatedUnionTypeObject:()=>ctn,SingleDiscriminatedUnionTypeSingleProperty:()=>utn,TypeReference:()=>E5c,UndiscriminatedUnionType:()=>mtn,Values:()=>kct,auth:()=>FPo,declaration:()=>kPo,endpoints:()=>NPo,environment:()=>jPo,ir:()=>QPo,snippets:()=>MPo,types:()=>LPo});var FPo={};te(FPo,{Auth:()=>Nen,AuthValues:()=>Len,BasicAuth:()=>Ren,BasicAuthValues:()=>jen,BearerAuth:()=>Fen,BearerAuthValues:()=>Qen,HeaderAuth:()=>ken,HeaderAuthValues:()=>Men});var Ren=H.objectWithoutOptionalProperties({username:mo,password:mo});var Fen=H.objectWithoutOptionalProperties({token:mo});var cE=H.objectWithoutOptionalProperties({name:Ms,typeReference:H.lazy(()=>fI.TypeReference)});var ken=H.objectWithoutOptionalProperties({header:cE});var fYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Nen=H.union("type",{basic:Ren,bearer:Fen,header:ken}).transform({transform:e=>{switch(e.type){case"basic":return Ai.Auth.basic(e);case"bearer":return Ai.Auth.bearer(e);case"header":return Ai.Auth.header(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=fYd(e,["_visit"]);return r}});var jen=H.objectWithoutOptionalProperties({username:H.string(),password:H.string()});var Qen=H.objectWithoutOptionalProperties({token:H.string()});var Men=H.objectWithoutOptionalProperties({value:H.unknown()});var dYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Len=H.union("type",{basic:jen,bearer:Qen,header:Men}).transform({transform:e=>{switch(e.type){case"basic":return Ai.AuthValues.basic(e);case"bearer":return Ai.AuthValues.bearer(e);case"header":return Ai.AuthValues.header(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=dYd(e,["_visit"]);return r}});var kPo={};te(kPo,{Declaration:()=>CR});var CR=H.objectWithoutOptionalProperties({fernFilepath:TM,name:mo});var NPo={};te(NPo,{BodyRequest:()=>zen,Endpoint:()=>$en,EndpointExample:()=>qen,EndpointLocation:()=>Fct,FileUploadRequestBody:()=>Wen,FileUploadRequestBodyProperty:()=>Gen,InlinedRequest:()=>Yen,InlinedRequestBody:()=>Ken,InlinedRequestMetadata:()=>Jen,ReferencedRequestBody:()=>Hen,ReferencedRequestBodyType:()=>Dct,Request:()=>Xen,Response:()=>Zen});var mYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Dct=H.union("type",{bytes:H.object({}),typeReference:H.object({value:H.lazy(()=>fI.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return Ai.ReferencedRequestBodyType.bytes();case"typeReference":return Ai.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=mYd(e,["_visit"]);return r}});var zen=H.objectWithoutOptionalProperties({pathParameters:H.list(cE).optional(),body:Dct.optional()});var Rct=H.enum_(["GET","POST","PUT","PATCH","DELETE"]);var Fct=H.objectWithoutOptionalProperties({method:Rct,path:H.string()});var nte=H.string();var y5=H.string();var oxe=H.string();var Uen=H.record(y5,oxe);var _en=H.undiscriminatedUnion([nte,Uen]);var kct=H.record(H.string(),H.unknown());var Ven=H.objectWithoutOptionalProperties({endpoint:Fct,baseUrl:H.property("baseURL",H.string().optional()),environment:_en.optional(),auth:Len.optional(),pathParameters:kct.optional(),queryParameters:kct.optional(),headers:kct.optional(),requestBody:H.unknown().optional()});var qen=H.objectWithoutOptionalProperties({id:H.string(),name:H.string().optional()}).extend(Ven);var hYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Gen=H.union("type",{file:Ms,fileArray:Ms,bodyProperty:cE}).transform({transform:e=>{switch(e.type){case"file":return Ai.FileUploadRequestBodyProperty.file(e);case"fileArray":return Ai.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return Ai.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=hYd(e,["_visit"]);return r}});var Wen=H.objectWithoutOptionalProperties({properties:H.list(Gen)});var Hen=H.objectWithoutOptionalProperties({bodyKey:mo,bodyType:Dct});var gYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Ken=H.union("type",{properties:H.object({value:H.list(cE)}),referenced:Hen,fileUpload:Wen}).transform({transform:e=>{switch(e.type){case"properties":return Ai.InlinedRequestBody.properties(e.value);case"referenced":return Ai.InlinedRequestBody.referenced(e);case"fileUpload":return Ai.InlinedRequestBody.fileUpload(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=gYd(e,["_visit"]);return r}});var Jen=H.objectWithoutOptionalProperties({includePathParameters:H.boolean(),onlyPathParameters:H.boolean()});var Yen=H.objectWithoutOptionalProperties({declaration:CR,pathParameters:H.list(cE).optional(),queryParameters:H.list(cE).optional(),headers:H.list(cE).optional(),body:Ken.optional(),metadata:Jen.optional()});var AYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Xen=H.union("type",{body:zen,inlined:Yen}).transform({transform:e=>{switch(e.type){case"body":return Ai.Request.body(e);case"inlined":return Ai.Request.inlined(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=AYd(e,["_visit"]);return r}});var yYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Zen=H.union("type",{json:H.object({})}).transform({transform:e=>e.type==="json"?Ai.Response.json():e,untransform:e=>{var{_visit:t}=e,r=yYd(e,["_visit"]);return r}});var $en=H.objectWithoutOptionalProperties({auth:Nen.optional(),declaration:CR,location:Fct,request:Xen,response:Zen,examples:H.list(qen).optional()});var jPo={};te(jPo,{EnvironmentValues:()=>_en,MultipleEnvironmentUrlValues:()=>Uen});var QPo={};te(QPo,{DynamicIntermediateRepresentation:()=>gtn});var etn=H.objectWithoutOptionalProperties({id:y5,name:mo});var ttn=H.objectWithoutOptionalProperties({id:nte,name:mo,urls:H.record(y5,oxe)}).extend(qo);var rtn=H.objectWithoutOptionalProperties({baseUrls:H.list(etn),environments:H.list(ttn)});var ntn=H.objectWithoutOptionalProperties({id:nte,name:mo,url:oxe}).extend(qo);var itn=H.objectWithoutOptionalProperties({environments:H.list(ntn)});var bYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},otn=H.union("type",{singleBaseUrl:itn,multipleBaseUrls:rtn}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return Nwe.singleBaseUrl(e);case"multipleBaseUrls":return Nwe.multipleBaseUrls(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=bYd(e,["_visit"]);return r}});var Nct=H.objectWithoutOptionalProperties({defaultEnvironment:nte.optional(),environments:otn});var stn=H.objectWithoutOptionalProperties({declaration:CR,typeReference:H.lazy(()=>fI.TypeReference)});var atn=H.objectWithoutOptionalProperties({discriminantValue:Ms,properties:H.list(cE).optional()});var ctn=H.objectWithoutOptionalProperties({typeId:sv,discriminantValue:Ms,properties:H.list(cE)});var utn=H.objectWithoutOptionalProperties({typeReference:H.lazy(()=>fI.TypeReference),discriminantValue:Ms,properties:H.list(cE).optional()});var EYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},ltn=H.union("type",{samePropertiesAsObject:ctn,singleProperty:utn,noProperties:atn}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return Ai.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return Ai.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return Ai.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=EYd(e,["_visit"]);return r}});var ptn=H.objectWithoutOptionalProperties({declaration:CR,discriminant:Ms,types:H.record(H.string(),ltn)});var ftn=H.objectWithoutOptionalProperties({declaration:CR,values:H.list(Ms)});var dtn=H.objectWithoutOptionalProperties({declaration:CR,properties:H.list(cE)});var mtn=H.objectWithoutOptionalProperties({declaration:CR,types:H.list(H.lazy(()=>fI.TypeReference))});var vYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},htn=H.union("type",{alias:stn,enum:ftn,object:dtn,discriminatedUnion:ptn,undiscriminatedUnion:mtn}).transform({transform:e=>{switch(e.type){case"alias":return Ai.NamedType.alias(e);case"enum":return Ai.NamedType.enum(e);case"object":return Ai.NamedType.object(e);case"discriminatedUnion":return Ai.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return Ai.NamedType.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=vYd(e,["_visit"]);return r}});var gtn=H.objectWithoutOptionalProperties({version:H.stringLiteral("1.0.0"),types:H.record(sv,htn),endpoints:H.record(SH,$en),headers:H.list(cE).optional(),environments:Nct.optional()});var MPo={};te(MPo,{EndpointSnippetRequest:()=>Ven,EndpointSnippetResponse:()=>y5c,ErrorSeverity:()=>Atn,Error_:()=>ytn,Values:()=>kct});var Atn=H.enum_(["CRITICAL","WARNING"]);var ytn=H.objectWithoutOptionalProperties({severity:Atn,message:H.string()});var y5c=H.objectWithoutOptionalProperties({snippet:H.string(),errors:H.list(ytn).optional()});var LPo={};te(LPo,{AliasType:()=>stn,DiscriminatedUnionType:()=>ptn,EnumType:()=>ftn,LiteralType:()=>btn,MapType:()=>b5c,NamedParameter:()=>cE,NamedType:()=>htn,ObjectType:()=>dtn,SingleDiscriminatedUnionType:()=>ltn,SingleDiscriminatedUnionTypeNoProperties:()=>atn,SingleDiscriminatedUnionTypeObject:()=>ctn,SingleDiscriminatedUnionTypeSingleProperty:()=>utn,TypeReference:()=>E5c,UndiscriminatedUnionType:()=>mtn});var IYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},btn=H.union("type",{boolean:H.object({value:H.boolean()}),string:H.object({value:H.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return Ai.LiteralType.boolean(e.value);case"string":return Ai.LiteralType.string(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=IYd(e,["_visit"]);return r}});var b5c=H.objectWithoutOptionalProperties({key:H.lazy(()=>fI.TypeReference),value:H.lazy(()=>fI.TypeReference)});var jct=H.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var CYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},E5c=H.union("type",{list:H.object({value:H.lazy(()=>fI.TypeReference)}),literal:H.object({value:btn}),map:H.lazyObject(()=>fI.MapType),named:H.object({value:sv}),nullable:H.object({value:H.lazy(()=>fI.TypeReference)}),optional:H.object({value:H.lazy(()=>fI.TypeReference)}),primitive:H.object({value:jct}),set:H.object({value:H.lazy(()=>fI.TypeReference)}),unknown:H.object({})}).transform({transform:e=>{switch(e.type){case"list":return Ai.TypeReference.list(e.value);case"literal":return Ai.TypeReference.literal(e.value);case"map":return Ai.TypeReference.map(e);case"named":return Ai.TypeReference.named(e.value);case"nullable":return Ai.TypeReference.nullable(e.value);case"optional":return Ai.TypeReference.optional(e.value);case"primitive":return Ai.TypeReference.primitive(e.value);case"set":return Ai.TypeReference.set(e.value);case"unknown":return Ai.TypeReference.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=CYd(e,["_visit"]);return r}});var zPo={};te(zPo,{EnvironmentBaseUrlId:()=>y5,EnvironmentBaseUrlWithId:()=>etn,EnvironmentId:()=>nte,EnvironmentUrl:()=>oxe,Environments:()=>otn,EnvironmentsConfig:()=>Nct,MultipleBaseUrlsEnvironment:()=>ttn,MultipleBaseUrlsEnvironments:()=>rtn,SingleBaseUrlEnvironment:()=>ntn,SingleBaseUrlEnvironments:()=>itn});var UPo={};te(UPo,{DeclaredErrorName:()=>sxe,ErrorDeclaration:()=>vtn,ErrorDeclarationDiscriminantValue:()=>v5c,ExampleError:()=>Etn});var sxe=H.objectWithoutOptionalProperties({errorId:nxe,fernFilepath:TM,name:mo});var Etn=H.objectWithoutOptionalProperties({name:mo.optional(),shape:H.lazyObject(()=>np)}).extend(rte).extend(qo);var vtn=H.objectWithoutOptionalProperties({name:sxe,discriminantValue:Ms,type:H.lazy(()=>Va).optional(),statusCode:H.number(),examples:H.list(Etn)}).extend(qo);var wYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},v5c=H.union("type",{property:Ms,statusCode:H.object({})}).transform({transform:e=>{switch(e.type){case"property":return jwe.property(e);case"statusCode":return jwe.statusCode();default:return e}},untransform:e=>{var{_visit:t}=e,r=wYd(e,["_visit"]);return r}});var VPo={};te(VPo,{BasicLicense:()=>Ctn,CustomLicense:()=>wtn,EnvironmentVariable:()=>wC,GeneratorConfig:()=>I5c,GeneratorEnvironment:()=>Stn,GeneratorOutputConfig:()=>Wtn,GeneratorPublishConfig:()=>qct,GeneratorPublishTarget:()=>Ptn,GeneratorRegistriesConfig:()=>Ftn,GeneratorRegistriesConfigV2:()=>ktn,GithubOutputMode:()=>Vtn,GithubPublishInfo:()=>_tn,LicenseConfig:()=>Htn,LicenseId:()=>Itn,MavenCentralSignature:()=>Qct,MavenCentralSignatureGithubInfo:()=>Ntn,MavenGithubPublishInfo:()=>jtn,MavenRegistryConfig:()=>Dtn,MavenRegistryConfigV2:()=>Mct,NpmGithubPublishInfo:()=>Qtn,NpmRegistryConfig:()=>Rtn,NpmRegistryConfigV2:()=>Lct,NugetGithubPublishInfo:()=>Mtn,NugetRegistryConfig:()=>zct,OutputMetadata:()=>Otn,OutputMetadataAuthor:()=>Btn,OutputMode:()=>qtn,PostmanConfig:()=>Ttn,PostmanGithubPublishInfo:()=>Ltn,PublishingMetadata:()=>Gtn,PypiGithubPublishInfo:()=>ztn,PypiMetadata:()=>Uct,PypiRegistryConfig:()=>_ct,RemoteGeneratorEnvironment:()=>xtn,RubyGemsGithubPublishInfo:()=>Utn,RubyGemsRegistryConfig:()=>Vct,config:()=>_Po});var _Po={};te(_Po,{BasicLicense:()=>Ctn,CustomLicense:()=>wtn,EnvironmentVariable:()=>wC,GeneratorConfig:()=>I5c,GeneratorEnvironment:()=>Stn,GeneratorOutputConfig:()=>Wtn,GeneratorPublishConfig:()=>qct,GeneratorPublishTarget:()=>Ptn,GeneratorRegistriesConfig:()=>Ftn,GeneratorRegistriesConfigV2:()=>ktn,GithubOutputMode:()=>Vtn,GithubPublishInfo:()=>_tn,LicenseConfig:()=>Htn,LicenseId:()=>Itn,MavenCentralSignature:()=>Qct,MavenCentralSignatureGithubInfo:()=>Ntn,MavenGithubPublishInfo:()=>jtn,MavenRegistryConfig:()=>Dtn,MavenRegistryConfigV2:()=>Mct,NpmGithubPublishInfo:()=>Qtn,NpmRegistryConfig:()=>Rtn,NpmRegistryConfigV2:()=>Lct,NugetGithubPublishInfo:()=>Mtn,NugetRegistryConfig:()=>zct,OutputMetadata:()=>Otn,OutputMetadataAuthor:()=>Btn,OutputMode:()=>qtn,PostmanConfig:()=>Ttn,PostmanGithubPublishInfo:()=>Ltn,PublishingMetadata:()=>Gtn,PypiGithubPublishInfo:()=>ztn,PypiMetadata:()=>Uct,PypiRegistryConfig:()=>_ct,RemoteGeneratorEnvironment:()=>xtn,RubyGemsGithubPublishInfo:()=>Utn,RubyGemsRegistryConfig:()=>Vct});var Itn=H.enum_(["MIT","Apache-2.0"]);var Ctn=H.objectWithoutOptionalProperties({id:Itn});var wtn=H.objectWithoutOptionalProperties({filename:H.string()});var wC=H.string();var xtn=H.objectWithoutOptionalProperties({coordinatorUrl:H.string(),coordinatorUrlV2:H.string(),id:H.string()});var xYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Stn=H.union(H.discriminant("type","_type"),{local:H.object({}),remote:xtn}).transform({transform:e=>{switch(e.type){case"local":return nu.GeneratorEnvironment.local();case"remote":return nu.GeneratorEnvironment.remote(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=xYd(e,["_visit"]);return r}});var Qct=H.objectWithoutOptionalProperties({keyId:H.string(),password:H.string(),secretKey:H.string()});var Mct=H.objectWithoutOptionalProperties({registryUrl:H.string(),username:H.string(),password:H.string(),coordinate:H.string(),signature:Qct.optional()});var Lct=H.objectWithoutOptionalProperties({registryUrl:H.string(),token:H.string(),packageName:H.string()});var zct=H.objectWithoutOptionalProperties({registryUrl:H.string(),apiKey:H.string(),packageName:H.string()});var Ttn=H.objectWithoutOptionalProperties({apiKey:H.string(),workspaceId:H.string()});var Btn=H.objectWithoutOptionalProperties({name:H.string(),email:H.string()});var Otn=H.objectWithoutOptionalProperties({description:H.string().optional(),authors:H.list(Btn).optional()});var Uct=H.objectWithoutOptionalProperties({keywords:H.list(H.string()).optional(),documentationLink:H.string().optional(),homepageLink:H.string().optional()}).extend(Otn);var _ct=H.objectWithoutOptionalProperties({registryUrl:H.string(),username:H.string(),password:H.string(),packageName:H.string(),pypiMetadata:Uct.optional()});var Vct=H.objectWithoutOptionalProperties({registryUrl:H.string(),apiKey:H.string(),packageName:H.string()});var SYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Ptn=H.union("type",{maven:Mct,npm:Lct,pypi:_ct,postman:Ttn,rubygems:Vct,nuget:zct}).transform({transform:e=>{switch(e.type){case"maven":return nu.GeneratorPublishTarget.maven(e);case"npm":return nu.GeneratorPublishTarget.npm(e);case"pypi":return nu.GeneratorPublishTarget.pypi(e);case"postman":return nu.GeneratorPublishTarget.postman(e);case"rubygems":return nu.GeneratorPublishTarget.rubygems(e);case"nuget":return nu.GeneratorPublishTarget.nuget(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=SYd(e,["_visit"]);return r}});var Dtn=H.objectWithoutOptionalProperties({registryUrl:H.string(),username:H.string(),password:H.string(),group:H.string(),signature:Qct.optional()});var Rtn=H.objectWithoutOptionalProperties({registryUrl:H.string(),token:H.string(),scope:H.string()});var Ftn=H.objectWithoutOptionalProperties({maven:Dtn,npm:Rtn});var ktn=H.objectWithoutOptionalProperties({maven:Mct,npm:Lct,pypi:_ct,rubygems:Vct,nuget:zct});var qct=H.objectWithoutOptionalProperties({registries:Ftn,registriesV2:ktn,publishTarget:Ptn.optional(),version:H.string()});var Ntn=H.objectWithoutOptionalProperties({keyIdEnvironmentVariable:wC,passwordEnvironmentVariable:wC,secretKeyEnvironmentVariable:wC});var jtn=H.objectWithoutOptionalProperties({registryUrl:H.string(),coordinate:H.string(),usernameEnvironmentVariable:wC,passwordEnvironmentVariable:wC,signature:Ntn.optional(),shouldGeneratePublishWorkflow:H.boolean().optional()});var Qtn=H.objectWithoutOptionalProperties({registryUrl:H.string(),packageName:H.string(),tokenEnvironmentVariable:wC,shouldGeneratePublishWorkflow:H.boolean().optional()});var Mtn=H.objectWithoutOptionalProperties({registryUrl:H.string(),packageName:H.string(),apiKeyEnvironmentVariable:wC,shouldGeneratePublishWorkflow:H.boolean().optional()});var Ltn=H.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:wC,workspaceIdEnvironmentVariable:wC});var ztn=H.objectWithoutOptionalProperties({registryUrl:H.string(),packageName:H.string(),usernameEnvironmentVariable:wC,passwordEnvironmentVariable:wC,pypiMetadata:Uct.optional(),shouldGeneratePublishWorkflow:H.boolean().optional()});var Utn=H.objectWithoutOptionalProperties({registryUrl:H.string(),packageName:H.string(),apiKeyEnvironmentVariable:wC,shouldGeneratePublishWorkflow:H.boolean().optional()});var TYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},_tn=H.union("type",{npm:Qtn,maven:jtn,postman:Ltn,pypi:ztn,rubygems:Utn,nuget:Mtn}).transform({transform:e=>{switch(e.type){case"npm":return nu.GithubPublishInfo.npm(e);case"maven":return nu.GithubPublishInfo.maven(e);case"postman":return nu.GithubPublishInfo.postman(e);case"pypi":return nu.GithubPublishInfo.pypi(e);case"rubygems":return nu.GithubPublishInfo.rubygems(e);case"nuget":return nu.GithubPublishInfo.nuget(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=TYd(e,["_visit"]);return r}});var Vtn=H.objectWithoutOptionalProperties({version:H.string(),repoUrl:H.string(),installationToken:H.string().optional(),publishInfo:_tn.optional()});var BYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},qtn=H.union("type",{publish:qct,downloadFiles:H.object({}),github:Vtn}).transform({transform:e=>{switch(e.type){case"publish":return nu.OutputMode.publish(e);case"downloadFiles":return nu.OutputMode.downloadFiles();case"github":return nu.OutputMode.github(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=BYd(e,["_visit"]);return r}});var Gtn=H.objectWithoutOptionalProperties({packageDescription:H.property("package_description",H.string().optional()),publisherEmail:H.property("publisher_email",H.string().optional()),referenceUrl:H.property("reference_url",H.string().optional()),publisherName:H.property("publisher_name",H.string().optional())});var Wtn=H.objectWithoutOptionalProperties({path:H.string(),snippetFilepath:H.string().optional(),snippetTemplateFilepath:H.string().optional(),publishingMetadata:Gtn.optional(),mode:qtn});var OYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Htn=H.union("type",{basic:Ctn,custom:wtn}).transform({transform:e=>{switch(e.type){case"basic":return nu.LicenseConfig.basic(e);case"custom":return nu.LicenseConfig.custom(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=OYd(e,["_visit"]);return r}});var I5c=H.objectWithoutOptionalProperties({dryRun:H.boolean(),irFilepath:H.string(),originalReadmeFilepath:H.string().optional(),license:Htn.optional(),output:Wtn,publish:qct.optional(),workspaceName:H.string(),organization:H.string(),customConfig:H.unknown(),environment:Stn,whitelabel:H.boolean(),writeUnitTests:H.boolean(),generatePaginatedClients:H.boolean().optional(),generateOauthClients:H.boolean()});var qPo={};te(qPo,{AutogeneratedEndpointExample:()=>trn,BytesRequest:()=>Kct,BytesResponse:()=>Jct,CursorPagination:()=>rrn,DeclaredServiceName:()=>nrn,EndpointName:()=>irn,ExampleCodeSample:()=>crn,ExampleCodeSampleLanguage:()=>orn,ExampleCodeSampleSdk:()=>arn,ExampleEndpointCall:()=>Hct,ExampleEndpointErrorResponse:()=>Xtn,ExampleEndpointSuccessResponse:()=>$tn,ExampleHeader:()=>Zze,ExampleInlinedRequestBody:()=>Wct,ExampleInlinedRequestBodyProperty:()=>Jtn,ExamplePathParameter:()=>axe,ExampleQueryParameter:()=>Gct,ExampleQueryParameterShape:()=>Ktn,ExampleRequestBody:()=>Ytn,ExampleResponse:()=>ern,ExampleServerSideEvent:()=>Ztn,FileDownloadResponse:()=>Yct,FileProperty:()=>prn,FilePropertyArray:()=>urn,FilePropertySingle:()=>lrn,FileUploadBodyProperty:()=>drn,FileUploadBodyPropertyEncoding:()=>frn,FileUploadRequest:()=>hrn,FileUploadRequestProperty:()=>mrn,GrpcTransport:()=>brn,HttpEndpoint:()=>_rn,HttpHeader:()=>V2,HttpMethod:()=>Rct,HttpPath:()=>b5,HttpPathPart:()=>Ern,HttpRequestBody:()=>Irn,HttpRequestBodyReference:()=>$ct,HttpResponse:()=>Drn,HttpResponseBody:()=>Prn,HttpService:()=>Grn,InlinedRequestBody:()=>vrn,InlinedRequestBodyProperty:()=>Xct,JsonResponse:()=>eut,JsonResponseBody:()=>Crn,JsonResponseBodyWithProperty:()=>wrn,JsonStreamChunk:()=>xrn,NonStreamHttpResponseBody:()=>Brn,OffsetPagination:()=>Rrn,Pagination:()=>Frn,PathParameter:()=>TH,PathParameterLocation:()=>krn,QueryParameter:()=>rxe,RequestProperty:()=>IR,RequestPropertyValue:()=>Aen,ResponseError:()=>Nrn,ResponseErrors:()=>jrn,ResponseProperty:()=>A5,SdkRequest:()=>zrn,SdkRequestBodyType:()=>Qrn,SdkRequestShape:()=>Lrn,SdkRequestWrapper:()=>Mrn,SseStreamChunk:()=>Srn,StreamParameterResponse:()=>Orn,StreamingResponse:()=>tut,SupportedSdkLanguage:()=>srn,TextResponse:()=>rut,TextStreamChunk:()=>Trn,Transport:()=>iut,UserSpecifiedEndpointExample:()=>Urn});var Zze=H.objectWithoutOptionalProperties({name:Ms,value:H.lazyObject(()=>np)});var axe=H.objectWithoutOptionalProperties({name:mo,value:H.lazyObject(()=>np)});var PYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Ktn=H.union("type",{single:H.object({}),exploded:H.object({}),commaSeparated:H.object({})}).transform({transform:e=>{switch(e.type){case"single":return Kee.single();case"exploded":return Kee.exploded();case"commaSeparated":return Kee.commaSeparated();default:return e}},untransform:e=>{var{_visit:t}=e,r=PYd(e,["_visit"]);return r}});var Gct=H.objectWithoutOptionalProperties({name:Ms,value:H.lazyObject(()=>np),shape:Ktn.optional()});var tb=H.objectWithoutOptionalProperties({typeId:sv,fernFilepath:TM,name:mo});var Jtn=H.objectWithoutOptionalProperties({name:Ms,value:H.lazyObject(()=>np),originalTypeDeclaration:tb.optional()});var Wct=H.objectWithoutOptionalProperties({properties:H.list(Jtn)}).extend(rte);var DYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Ytn=H.union("type",{inlinedRequestBody:Wct,reference:H.lazyObject(()=>np)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return Mwe.inlinedRequestBody(e);case"reference":return Mwe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=DYd(e,["_visit"]);return r}});var Xtn=H.objectWithoutOptionalProperties({error:sxe,body:H.lazyObject(()=>np).optional()});var Ztn=H.objectWithoutOptionalProperties({event:H.string(),data:H.lazyObject(()=>np)});var RYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},$tn=H.union("type",{body:H.object({value:H.lazyObject(()=>np).optional()}),stream:H.object({value:H.list(H.lazyObject(()=>np))}),sse:H.object({value:H.list(Ztn)})}).transform({transform:e=>{switch(e.type){case"body":return Hee.body(e.value);case"stream":return Hee.stream(e.value);case"sse":return Hee.sse(e.value);default:return e}},untransform:e=>{var{_visit:t}=e,r=RYd(e,["_visit"]);return r}});var FYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},ern=H.union("type",{ok:H.object({value:$tn}),error:Xtn}).transform({transform:e=>{switch(e.type){case"ok":return Lwe.ok(e.value);case"error":return Lwe.error(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=FYd(e,["_visit"]);return r}});var Hct=H.objectWithoutOptionalProperties({id:H.string().optional(),name:mo.optional(),url:H.string(),rootPathParameters:H.list(axe),servicePathParameters:H.list(axe),endpointPathParameters:H.list(axe),serviceHeaders:H.list(Zze),endpointHeaders:H.list(Zze),queryParameters:H.list(Gct),request:Ytn.optional(),response:ern}).extend(qo);var trn=H.objectWithoutOptionalProperties({example:Hct});var Kct=H.objectWithoutOptionalProperties({isOptional:H.boolean(),contentType:H.string().optional()}).extend(qo);var Jct=H.objectWithoutOptionalProperties({}).extend(qo);var rrn=H.objectWithoutOptionalProperties({page:IR,next:A5,results:A5});var nrn=H.objectWithoutOptionalProperties({fernFilepath:TM});var irn=mo;var orn=H.objectWithoutOptionalProperties({name:mo.optional(),language:H.string(),code:H.string(),install:H.string().optional()}).extend(qo);var srn=H.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var arn=H.objectWithoutOptionalProperties({name:mo.optional(),sdk:srn,code:H.string()}).extend(qo);var kYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},crn=H.union("type",{language:orn,sdk:arn}).transform({transform:e=>{switch(e.type){case"language":return Qwe.language(e);case"sdk":return Qwe.sdk(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=kYd(e,["_visit"]);return r}});var Yct=H.objectWithoutOptionalProperties({}).extend(qo);var urn=H.objectWithoutOptionalProperties({key:Ms,isOptional:H.boolean(),contentType:H.string().optional()});var lrn=H.objectWithoutOptionalProperties({key:Ms,isOptional:H.boolean(),contentType:H.string().optional()});var NYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},prn=H.union("type",{file:lrn,fileArray:urn}).transform({transform:e=>{switch(e.type){case"file":return zwe.file(e);case"fileArray":return zwe.fileArray(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=NYd(e,["_visit"]);return r}});var frn=H.enum_(["exploded","json","form"]);var Xct=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va)}).extend(ixe);var drn=H.objectWithoutOptionalProperties({contentType:H.string().optional(),style:frn.optional()}).extend(Xct);var jYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},mrn=H.union("type",{file:H.object({value:prn}),bodyProperty:drn}).transform({transform:e=>{switch(e.type){case"file":return Uwe.file(e.value);case"bodyProperty":return Uwe.bodyProperty(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=jYd(e,["_visit"]);return r}});var hrn=H.objectWithoutOptionalProperties({name:mo,properties:H.list(mrn)}).extend(qo);var grn=H.objectWithoutOptionalProperties({namespace:H.string()});var Arn=H.objectWithoutOptionalProperties({csharp:grn.optional()});var Zct=H.objectWithoutOptionalProperties({filepath:H.string(),packageName:H.string().optional(),options:Arn.optional()});var yrn=H.objectWithoutOptionalProperties({file:Zct,name:mo});var brn=H.objectWithoutOptionalProperties({service:yrn});var V2=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va),env:H.string().optional()}).extend(Ww);var Ern=H.objectWithoutOptionalProperties({pathParameter:H.string(),tail:H.string()});var b5=H.objectWithoutOptionalProperties({head:H.string(),parts:H.list(Ern)});var $ct=H.objectWithoutOptionalProperties({requestBodyType:H.lazy(()=>Va),contentType:H.string().optional()}).extend(qo);var vrn=H.objectWithoutOptionalProperties({name:mo,extends:H.list(tb),properties:H.list(Xct),extendedProperties:H.list(_2).optional(),contentType:H.string().optional(),extraProperties:H.property("extra-properties",H.boolean())}).extend(qo);var QYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Irn=H.union("type",{inlinedRequestBody:vrn,reference:$ct,fileUpload:hrn,bytes:Kct}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return p5.inlinedRequestBody(e);case"reference":return p5.reference(e);case"fileUpload":return p5.fileUpload(e);case"bytes":return p5.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=QYd(e,["_visit"]);return r}});var Crn=H.objectWithoutOptionalProperties({responseBodyType:H.lazy(()=>Va)}).extend(qo);var wrn=H.objectWithoutOptionalProperties({responseBodyType:H.lazy(()=>Va),responseProperty:_2.optional()}).extend(qo);var MYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},eut=H.union("type",{response:Crn,nestedPropertyAsResponse:wrn}).transform({transform:e=>{switch(e.type){case"response":return _we.response(e);case"nestedPropertyAsResponse":return _we.nestedPropertyAsResponse(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=MYd(e,["_visit"]);return r}});var xrn=H.objectWithoutOptionalProperties({payload:H.lazy(()=>Va),terminator:H.string().optional()}).extend(qo);var Srn=H.objectWithoutOptionalProperties({payload:H.lazy(()=>Va),terminator:H.string().optional()}).extend(qo);var Trn=H.objectWithoutOptionalProperties({}).extend(qo);var LYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},tut=H.union("type",{json:xrn,text:Trn,sse:Srn}).transform({transform:e=>{switch(e.type){case"json":return Jee.json(e);case"text":return Jee.text(e);case"sse":return Jee.sse(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=LYd(e,["_visit"]);return r}});var rut=H.objectWithoutOptionalProperties({}).extend(qo);var zYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Brn=H.union("type",{json:H.object({value:eut}),fileDownload:Yct,text:rut,bytes:Jct}).transform({transform:e=>{switch(e.type){case"json":return f5.json(e.value);case"fileDownload":return f5.fileDownload(e);case"text":return f5.text(e);case"bytes":return f5.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=zYd(e,["_visit"]);return r}});var Orn=H.objectWithoutOptionalProperties({nonStreamResponse:Brn,streamResponse:tut});var UYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Prn=H.union("type",{json:H.object({value:eut}),fileDownload:Yct,text:rut,bytes:Jct,streaming:H.object({value:tut}),streamParameter:Orn}).transform({transform:e=>{switch(e.type){case"json":return bR.json(e.value);case"fileDownload":return bR.fileDownload(e);case"text":return bR.text(e);case"bytes":return bR.bytes(e);case"streaming":return bR.streaming(e.value);case"streamParameter":return bR.streamParameter(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=UYd(e,["_visit"]);return r}});var Drn=H.objectWithoutOptionalProperties({statusCode:H.property("status-code",H.number().optional()),body:Prn.optional()});var Rrn=H.objectWithoutOptionalProperties({page:IR,results:A5,hasNextPage:A5.optional(),step:IR.optional()});var _Yd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Frn=H.union("type",{cursor:rrn,offset:Rrn}).transform({transform:e=>{switch(e.type){case"cursor":return Vwe.cursor(e);case"offset":return Vwe.offset(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=_Yd(e,["_visit"]);return r}});var nut=H.string();var krn=H.enum_(["ROOT","SERVICE","ENDPOINT"]);var TH=H.objectWithoutOptionalProperties({name:mo,valueType:H.lazy(()=>Va),location:krn,variable:nut.optional()}).extend(qo);var Nrn=H.objectWithoutOptionalProperties({error:sxe}).extend(qo);var jrn=H.list(Nrn);var VYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Qrn=H.union("type",{typeReference:$ct,bytes:Kct}).transform({transform:e=>{switch(e.type){case"typeReference":return Gwe.typeReference(e);case"bytes":return Gwe.bytes(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=VYd(e,["_visit"]);return r}});var Mrn=H.objectWithoutOptionalProperties({wrapperName:mo,bodyKey:mo,includePathParameters:H.boolean().optional(),onlyPathParameters:H.boolean().optional()});var qYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Lrn=H.union("type",{justRequestBody:H.object({value:Qrn}),wrapper:Mrn}).transform({transform:e=>{switch(e.type){case"justRequestBody":return Wwe.justRequestBody(e.value);case"wrapper":return Wwe.wrapper(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=qYd(e,["_visit"]);return r}});var zrn=H.objectWithoutOptionalProperties({streamParameter:IR.optional(),requestParameterName:mo,shape:Lrn});var GYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},iut=H.union("type",{http:H.object({}),grpc:brn}).transform({transform:e=>{switch(e.type){case"http":return Hwe.http();case"grpc":return Hwe.grpc(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=GYd(e,["_visit"]);return r}});var Urn=H.objectWithoutOptionalProperties({codeSamples:H.list(crn).optional(),example:Hct.optional()});var _rn=H.objectWithoutOptionalProperties({id:SH,name:irn,displayName:H.string().optional(),method:Rct,headers:H.list(V2),baseUrl:y5.optional(),basePath:b5.optional(),path:b5,fullPath:b5,pathParameters:H.list(TH),allPathParameters:H.list(TH),queryParameters:H.list(rxe),requestBody:Irn.optional(),sdkRequest:zrn.optional(),response:Drn.optional(),errors:jrn,auth:H.boolean(),idempotent:H.boolean(),pagination:Frn.optional(),userSpecifiedExamples:H.list(Urn),autogeneratedExamples:H.list(trn),transport:iut.optional()}).extend(Ww);var Vrn=H.objectWithoutOptionalProperties({});var qrn=H.objectWithoutOptionalProperties({});var out=H.objectWithoutOptionalProperties({json:Vrn.optional(),proto:qrn.optional()});var Grn=H.objectWithoutOptionalProperties({availability:tte.optional(),name:nrn,displayName:H.string().optional(),basePath:b5,endpoints:H.list(_rn),headers:H.list(V2),pathParameters:H.list(TH),encoding:out.optional(),transport:iut.optional()});var GPo={};te(GPo,{ApiDefinitionSource:()=>Krn,ApiDefinitionSourceId:()=>Wrn,ApiVersionScheme:()=>Yrn,ErrorDiscriminationByPropertyStrategy:()=>Xrn,ErrorDiscriminationStrategy:()=>Zrn,HeaderApiVersionScheme:()=>Jrn,IntermediateRepresentation:()=>C5c,Package:()=>fut,PackageNavigationConfig:()=>iin,PlatformHeaders:()=>ain,ProtoSource:()=>Hrn,ReadmeConfig:()=>oin,SdkConfig:()=>cin,ServiceTypeReferenceInfo:()=>uin,SourceConfig:()=>lin,Subpackage:()=>pin,UserAgent:()=>sin});var Wrn=H.string();var Hrn=H.objectWithoutOptionalProperties({id:Wrn,protoRootUrl:H.string()});var WYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Krn=H.union("type",{proto:Hrn,openapi:H.object({})}).transform({transform:e=>{switch(e.type){case"proto":return Kwe.proto(e);case"openapi":return Kwe.openapi();default:return e}},untransform:e=>{var{_visit:t}=e,r=WYd(e,["_visit"]);return r}});var Jfe=H.objectWithoutOptionalProperties({name:Ms}).extend(Ww);var sut=H.objectWithoutOptionalProperties({default:Jfe.optional(),values:H.list(Jfe)});var Jrn=H.objectWithoutOptionalProperties({header:V2,value:sut});var HYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Yrn=H.union("type",{header:Jrn}).transform({transform:e=>e.type==="header"?Ict.header(e):e,untransform:e=>{var{_visit:t}=e,r=HYd(e,["_visit"]);return r}});var Xrn=H.objectWithoutOptionalProperties({discriminant:Ms,contentProperty:Ms});var KYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Zrn=H.union("type",{statusCode:H.object({}),property:Xrn}).transform({transform:e=>{switch(e.type){case"statusCode":return Jwe.statusCode();case"property":return Jwe.property(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=KYd(e,["_visit"]);return r}});var $rn=H.objectWithoutOptionalProperties({apiKey:H.string(),workspaceId:H.string(),collectionId:H.string().optional()});var JYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},aut=H.union("type",{postman:$rn}).transform({transform:e=>e.type==="postman"?Cct.postman(e):e,untransform:e=>{var{_visit:t}=e,r=JYd(e,["_visit"]);return r}});var enn=H.objectWithoutOptionalProperties({target:aut});var tnn=H.objectWithoutOptionalProperties({owner:H.string(),repo:H.string(),target:aut});var YYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},rnn=H.union("type",{github:tnn,direct:enn}).transform({transform:e=>{switch(e.type){case"github":return Xwe.github(e);case"direct":return Xwe.direct(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=YYd(e,["_visit"]);return r}});var B5t=H.objectWithoutOptionalProperties({name:mo.optional(),shape:H.lazy(()=>cut)}).extend(rte).extend(qo);var nnn=H.objectWithoutOptionalProperties({file:Zct,name:mo});var XYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},inn=H.union("type",{any:H.object({}),api:H.object({}),boolValue:H.object({}),bytesValue:H.object({}),doubleValue:H.object({}),duration:H.object({}),empty:H.object({}),enum:H.object({}),enumValue:H.object({}),field:H.object({}),fieldCardinality:H.object({}),fieldKind:H.object({}),fieldMask:H.object({}),floatValue:H.object({}),int32Value:H.object({}),int64Value:H.object({}),listValue:H.object({}),method:H.object({}),mixin:H.object({}),nullValue:H.object({}),option:H.object({}),sourceContext:H.object({}),stringValue:H.object({}),struct:H.object({}),syntax:H.object({}),timestamp:H.object({}),type:H.object({}),uint32Value:H.object({}),uint64Value:H.object({}),value:H.object({})}).transform({transform:e=>{switch(e.type){case"any":return fa.any();case"api":return fa.api();case"boolValue":return fa.boolValue();case"bytesValue":return fa.bytesValue();case"doubleValue":return fa.doubleValue();case"duration":return fa.duration();case"empty":return fa.empty();case"enum":return fa.enum();case"enumValue":return fa.enumValue();case"field":return fa.field();case"fieldCardinality":return fa.fieldCardinality();case"fieldKind":return fa.fieldKind();case"fieldMask":return fa.fieldMask();case"floatValue":return fa.floatValue();case"int32Value":return fa.int32Value();case"int64Value":return fa.int64Value();case"listValue":return fa.listValue();case"method":return fa.method();case"mixin":return fa.mixin();case"nullValue":return fa.nullValue();case"option":return fa.option();case"sourceContext":return fa.sourceContext();case"stringValue":return fa.stringValue();case"struct":return fa.struct();case"syntax":return fa.syntax();case"timestamp":return fa.timestamp();case"type":return fa.type();case"uint32Value":return fa.uint32Value();case"uint64Value":return fa.uint64Value();case"value":return fa.value();default:return e}},untransform:e=>{var{_visit:t}=e,r=XYd(e,["_visit"]);return r}});var ZYd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},onn=H.union("type",{wellKnown:H.object({value:inn}),userDefined:nnn}).transform({transform:e=>{switch(e.type){case"wellKnown":return Ywe.wellKnown(e.value);case"userDefined":return Ywe.userDefined(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=ZYd(e,["_visit"]);return r}});var $Yd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},snn=H.union("type",{proto:H.object({value:onn})}).transform({transform:e=>e.type==="proto"?Sct.proto(e.value):e,untransform:e=>{var{_visit:t}=e,r=$Yd(e,["_visit"]);return r}});var ann=H.objectWithoutOptionalProperties({});var cnn=H.objectWithoutOptionalProperties({default:H.string().optional()});var unn=H.objectWithoutOptionalProperties({default:H.boolean().optional()});var lnn=H.objectWithoutOptionalProperties({});var pnn=H.objectWithoutOptionalProperties({});var fnn=H.objectWithoutOptionalProperties({min:H.number().optional(),max:H.number().optional(),exclusiveMin:H.boolean().optional(),exclusiveMax:H.boolean().optional(),multipleOf:H.number().optional()});var dnn=H.objectWithoutOptionalProperties({default:H.number().optional(),validation:fnn.optional()});var mnn=H.objectWithoutOptionalProperties({});var hnn=H.objectWithoutOptionalProperties({min:H.number().optional(),max:H.number().optional(),exclusiveMin:H.boolean().optional(),exclusiveMax:H.boolean().optional(),multipleOf:H.number().optional()});var gnn=H.objectWithoutOptionalProperties({default:H.number().optional(),validation:hnn.optional()});var Ann=H.objectWithoutOptionalProperties({default:H.number().optional()});var ynn=H.objectWithoutOptionalProperties({format:H.string().optional(),pattern:H.string().optional(),minLength:H.number().optional(),maxLength:H.number().optional()});var bnn=H.objectWithoutOptionalProperties({default:H.string().optional(),validation:ynn.optional()});var Enn=H.objectWithoutOptionalProperties({});var vnn=H.objectWithoutOptionalProperties({});var Inn=H.objectWithoutOptionalProperties({});var eXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Cnn=H.union("type",{integer:gnn,long:Ann,uint:vnn,uint64:Enn,float:mnn,double:dnn,boolean:unn,string:bnn,date:pnn,dateTime:lnn,uuid:Inn,base64:ann,bigInteger:cnn}).transform({transform:e=>{switch(e.type){case"integer":return vg.integer(e);case"long":return vg.long(e);case"uint":return vg.uint(e);case"uint64":return vg.uint64(e);case"float":return vg.float(e);case"double":return vg.double(e);case"boolean":return vg.boolean(e);case"string":return vg.string(e);case"date":return vg.date(e);case"dateTime":return vg.dateTime(e);case"uuid":return vg.uuid(e);case"base64":return vg.base64(e);case"bigInteger":return vg.bigInteger(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=eXd(e,["_visit"]);return r}});var uut=H.objectWithoutOptionalProperties({v1:jct,v2:Cnn.optional()});var wnn=H.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var xnn=H.objectWithoutOptionalProperties({name:tb,shape:wnn});var tXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Snn=H.union(H.discriminant("type","_type"),{container:H.object({container:H.lazy(()=>lut)}),named:xnn,primitive:H.object({primitive:uut}),unknown:H.object({})}).transform({transform:e=>{switch(e.type){case"container":return m5.container(e.container);case"named":return m5.named(e);case"primitive":return m5.primitive(e.primitive);case"unknown":return m5.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=tXd(e,["_visit"]);return r}});var Tnn=H.objectWithoutOptionalProperties({aliasOf:H.lazy(()=>Va),resolvedType:Snn});var Bnn=H.objectWithoutOptionalProperties({extends:H.list(tb),properties:H.list(_2),extendedProperties:H.list(_2).optional(),extraProperties:H.property("extra-properties",H.boolean())});var Onn=H.objectWithoutOptionalProperties({type:H.lazy(()=>Va)}).extend(qo);var Pnn=H.objectWithoutOptionalProperties({members:H.list(Onn)});var Dnn=H.objectWithoutOptionalProperties({name:Ms,type:H.lazy(()=>Va)});var rXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Rnn=H.union(H.discriminant("propertiesType","_type"),{samePropertiesAsObject:tb,singleProperty:Dnn,noProperties:H.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return Zee.samePropertiesAsObject(e);case"singleProperty":return Zee.singleProperty(e);case"noProperties":return Zee.noProperties();default:return e}},untransform:e=>{var{_visit:t}=e,r=rXd(e,["_visit"]);return r}});var Fnn=H.objectWithoutOptionalProperties({discriminantValue:Ms,shape:Rnn,displayName:H.string().optional(),availability:tte.optional()}).extend(qo);var knn=H.objectWithoutOptionalProperties({discriminant:Ms,extends:H.list(tb),types:H.list(Fnn),baseProperties:H.list(_2)});var nXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Nnn=H.union(H.discriminant("type","_type"),{alias:Tnn,enum:sut,object:Bnn,union:knn,undiscriminatedUnion:Pnn}).transform({transform:e=>{switch(e.type){case"alias":return SM.alias(e);case"enum":return SM.enum(e);case"object":return SM.object(e);case"union":return SM.union(e);case"undiscriminatedUnion":return SM.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=nXd(e,["_visit"]);return r}});var jnn=H.objectWithoutOptionalProperties({name:tb,shape:Nnn,autogeneratedExamples:H.list(B5t),userProvidedExamples:H.list(B5t),referencedTypes:H.set(sv),encoding:out.optional(),source:snn.optional(),inline:H.boolean().optional()}).extend(Ww);var Qnn=H.objectWithoutOptionalProperties({id:nut,name:mo,type:H.lazy(()=>Va)}).extend(qo);var Mnn=H.objectWithoutOptionalProperties({name:mo.optional(),payload:H.lazyObject(()=>np)}).extend(qo);var Lnn=H.enum_(["GET","POST"]);var znn=mo;var Unn=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va)}).extend(ixe);var _nn=H.objectWithoutOptionalProperties({name:mo,extends:H.list(tb),properties:H.list(Unn)});var Vnn=H.objectWithoutOptionalProperties({payloadType:H.lazy(()=>Va)}).extend(qo);var iXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},qnn=H.union("type",{inlinedPayload:_nn,reference:Vnn}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return $we.inlinedPayload(e);case"reference":return $we.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=iXd(e,["_visit"]);return r}});var Gnn=H.objectWithoutOptionalProperties({id:Pen,name:znn,displayName:H.string().optional(),method:Lnn,headers:H.list(V2),payload:qnn,examples:H.list(Mnn).optional()}).extend(Ww);var Wnn=H.list(Gnn);var oXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Hnn=H.union("type",{inlinedBody:Wct,reference:H.lazyObject(()=>np)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return exe.inlinedBody(e);case"reference":return exe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=oXd(e,["_visit"]);return r}});var put=H.string();var Knn=H.objectWithoutOptionalProperties({type:put,body:Hnn});var Jnn=H.objectWithoutOptionalProperties({name:mo.optional(),url:H.string(),pathParameters:H.list(axe),headers:H.list(Zze),queryParameters:H.list(Gct),messages:H.list(Knn)}).extend(qo);var Ynn=H.objectWithoutOptionalProperties({name:Ms,valueType:H.lazy(()=>Va)}).extend(ixe);var Xnn=H.objectWithoutOptionalProperties({name:mo,extends:H.list(tb),properties:H.list(Ynn)});var Znn=H.objectWithoutOptionalProperties({bodyType:H.lazy(()=>Va)}).extend(qo);var sXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},$nn=H.union("type",{inlinedBody:Xnn,reference:Znn}).transform({transform:e=>{switch(e.type){case"inlinedBody":return txe.inlinedBody(e);case"reference":return txe.reference(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=sXd(e,["_visit"]);return r}});var ein=H.enum_(["client","server"]);var tin=H.objectWithoutOptionalProperties({type:put,displayName:H.string().optional(),origin:ein,body:$nn}).extend(Ww);var rin=mo;var nin=H.objectWithoutOptionalProperties({name:rin,displayName:H.string().optional(),baseUrl:y5.optional(),path:b5,auth:H.boolean(),headers:H.list(V2),queryParameters:H.list(rxe),pathParameters:H.list(TH),messages:H.list(tin),examples:H.list(Jnn)}).extend(Ww);var iin=H.objectWithoutOptionalProperties({pointsTo:ete});var fut=H.objectWithoutOptionalProperties({fernFilepath:TM,service:$ee.optional(),types:H.list(sv),errors:H.list(nxe),webhooks:Oct.optional(),websocket:Pct.optional(),subpackages:H.list(ete),hasEndpointsInTree:H.boolean(),navigationConfig:iin.optional()}).extend(qo);var oin=H.objectWithoutOptionalProperties({defaultEndpoint:SH.optional(),bannerLink:H.string().optional(),introduction:H.string().optional(),apiReferenceLink:H.string().optional(),features:H.record(Oen,H.list(SH)).optional()});var sin=H.objectWithoutOptionalProperties({header:H.stringLiteral("User-Agent"),value:H.string()});var ain=H.objectWithoutOptionalProperties({language:H.string(),sdkName:H.string(),sdkVersion:H.string(),userAgent:sin.optional()});var cin=H.objectWithoutOptionalProperties({isAuthMandatory:H.boolean(),hasStreamingEndpoints:H.boolean(),hasPaginatedEndpoints:H.boolean(),hasFileDownloadEndpoints:H.boolean(),platformHeaders:ain});var uin=H.objectWithoutOptionalProperties({typesReferencedOnlyByService:H.record($ee,H.list(sv)),sharedTypes:H.list(sv)});var lin=H.objectWithoutOptionalProperties({sources:H.list(Krn)});var pin=H.objectWithoutOptionalProperties({name:mo}).extend(fut);var C5c=H.objectWithoutOptionalProperties({fdrApiDefinitionId:H.string().optional(),apiVersion:Yrn.optional(),apiName:mo,apiDisplayName:H.string().optional(),apiDocs:H.string().optional(),auth:Ten,headers:H.list(V2),idempotencyHeaders:H.list(V2),types:H.record(sv,jnn),services:H.record($ee,Grn),webhookGroups:H.record(Oct,Wnn),websocketChannels:H.record(Pct,nin).optional(),errors:H.record(nxe,vtn),subpackages:H.record(ete,pin),rootPackage:fut,constants:Den,environments:Nct.optional(),basePath:b5.optional(),pathParameters:H.list(TH),errorDiscriminationStrategy:Zrn,sdkConfig:cin,variables:H.list(Qnn),serviceTypeReferenceInfo:uin,readmeConfig:oin.optional(),sourceConfig:lin.optional(),publishConfig:rnn.optional(),dynamic:gtn.optional()});var WPo={};te(WPo,{CsharpProtobufFileOptions:()=>grn,ProtobufFile:()=>Zct,ProtobufFileOptions:()=>Arn,ProtobufService:()=>yrn,ProtobufType:()=>onn,UserDefinedProtobufType:()=>nnn,WellKnownProtobufType:()=>inn});var HPo={};te(HPo,{DirectPublish:()=>enn,GithubPublish:()=>tnn,PostmanPublishTarget:()=>$rn,PublishTarget:()=>aut,PublishingConfig:()=>rnn});var KPo={};te(KPo,{AliasTypeDeclaration:()=>Tnn,Base64Type:()=>ann,BigIntegerType:()=>cnn,BooleanType:()=>unn,ContainerType:()=>lut,DateTimeType:()=>lnn,DateType:()=>pnn,DeclaredTypeName:()=>tb,DoubleType:()=>dnn,DoubleValidationRules:()=>fnn,Encoding:()=>out,EnumTypeDeclaration:()=>sut,EnumTypeReference:()=>w5c,EnumValue:()=>Jfe,ExampleAliasType:()=>min,ExampleContainer:()=>Ain,ExampleDatetime:()=>hin,ExampleEnumType:()=>Cin,ExampleKeyValuePair:()=>win,ExampleListContainer:()=>yin,ExampleLiteralContainer:()=>gin,ExampleMapContainer:()=>bin,ExampleNamedType:()=>xin,ExampleNullableContainer:()=>Ein,ExampleObjectProperty:()=>Sin,ExampleObjectType:()=>mut,ExampleObjectTypeWithTypeId:()=>Tin,ExampleOptionalContainer:()=>vin,ExamplePrimitive:()=>dut,ExampleSetContainer:()=>Iin,ExampleSingleUnionType:()=>Bin,ExampleSingleUnionTypeProperties:()=>Oin,ExampleType:()=>B5t,ExampleTypeReference:()=>np,ExampleTypeReferenceShape:()=>Pin,ExampleTypeShape:()=>cut,ExampleUndiscriminatedUnionType:()=>Din,ExampleUnionType:()=>Rin,FloatType:()=>mnn,IntegerType:()=>gnn,IntegerValidationRules:()=>hnn,JsonEncoding:()=>Vrn,Literal:()=>fin,LongType:()=>Ann,MapType:()=>din,NamedType:()=>kin,NamedTypeDefault:()=>Fin,ObjectProperty:()=>_2,ObjectPropertyAccess:()=>gen,ObjectTypeDeclaration:()=>Bnn,PrimitiveType:()=>uut,PrimitiveTypeV1:()=>jct,PrimitiveTypeV2:()=>Cnn,ProtoEncoding:()=>qrn,ResolvedNamedType:()=>xnn,ResolvedTypeReference:()=>Snn,ShapeType:()=>wnn,SingleUnionType:()=>Fnn,SingleUnionTypeProperties:()=>Rnn,SingleUnionTypeProperty:()=>Dnn,Source:()=>snn,StringType:()=>bnn,StringValidationRules:()=>ynn,Type:()=>Nnn,TypeDeclaration:()=>jnn,TypeReference:()=>Va,Uint64Type:()=>Enn,UintType:()=>vnn,UndiscriminatedUnionMember:()=>Onn,UndiscriminatedUnionTypeDeclaration:()=>Pnn,UnionTypeDeclaration:()=>knn,UuidType:()=>Inn});var aXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},fin=H.union("type",{string:H.object({string:H.string()}),boolean:H.object({boolean:H.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return Zwe.string(e.string);case"boolean":return Zwe.boolean(e.boolean);default:return e}},untransform:e=>{var{_visit:t}=e,r=aXd(e,["_visit"]);return r}});var cXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},lut=H.union(H.discriminant("type","_type"),{list:H.object({list:H.lazy(()=>Va)}),map:H.lazyObject(()=>din),nullable:H.object({nullable:H.lazy(()=>Va)}),optional:H.object({optional:H.lazy(()=>Va)}),set:H.object({set:H.lazy(()=>Va)}),literal:H.object({literal:fin})}).transform({transform:e=>{switch(e.type){case"list":return ER.list(e.list);case"map":return ER.map(e);case"nullable":return ER.nullable(e.nullable);case"optional":return ER.optional(e.optional);case"set":return ER.set(e.set);case"literal":return ER.literal(e.literal);default:return e}},untransform:e=>{var{_visit:t}=e,r=cXd(e,["_visit"]);return r}});var w5c=H.objectWithoutOptionalProperties({default:Jfe.optional(),name:tb});var min=H.objectWithoutOptionalProperties({value:H.lazyObject(()=>np)});var hin=H.objectWithoutOptionalProperties({datetime:H.date(),raw:H.string().optional()});var uXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},dut=H.union("type",{integer:H.object({integer:H.number()}),long:H.object({long:H.number()}),uint:H.object({uint:H.number()}),uint64:H.object({uint64:H.number()}),float:H.object({float:H.number()}),double:H.object({double:H.number()}),boolean:H.object({boolean:H.boolean()}),string:H.object({string:Ben}),date:H.object({date:H.string()}),datetime:hin,uuid:H.object({uuid:H.string()}),base64:H.object({base64:H.string()}),bigInteger:H.object({bigInteger:H.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Eg.integer(e.integer);case"long":return Eg.long(e.long);case"uint":return Eg.uint(e.uint);case"uint64":return Eg.uint64(e.uint64);case"float":return Eg.float(e.float);case"double":return Eg.double(e.double);case"boolean":return Eg.boolean(e.boolean);case"string":return Eg.string(e.string);case"date":return Eg.date(e.date);case"datetime":return Eg.datetime(e);case"uuid":return Eg.uuid(e.uuid);case"base64":return Eg.base64(e.base64);case"bigInteger":return Eg.bigInteger(e.bigInteger);default:return e}},untransform:e=>{var{_visit:t}=e,r=uXd(e,["_visit"]);return r}});var gin=H.objectWithoutOptionalProperties({literal:dut});var lXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Ain=H.union("type",{list:H.lazyObject(()=>yin),set:H.lazyObject(()=>Iin),optional:H.lazyObject(()=>vin),nullable:H.lazyObject(()=>Ein),map:H.lazyObject(()=>bin),literal:gin}).transform({transform:e=>{switch(e.type){case"list":return vR.list(e);case"set":return vR.set(e);case"optional":return vR.optional(e);case"nullable":return vR.nullable(e);case"map":return vR.map(e);case"literal":return vR.literal(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=lXd(e,["_visit"]);return r}});var Cin=H.objectWithoutOptionalProperties({value:Ms});var win=H.objectWithoutOptionalProperties({key:H.lazyObject(()=>np),value:H.lazyObject(()=>np)});var yin=H.objectWithoutOptionalProperties({list:H.list(H.lazyObject(()=>np)),itemType:H.lazy(()=>Va)});var bin=H.objectWithoutOptionalProperties({map:H.list(H.lazyObject(()=>win)),keyType:H.lazy(()=>Va),valueType:H.lazy(()=>Va)});var xin=H.objectWithoutOptionalProperties({typeName:tb,shape:H.lazy(()=>cut)});var Ein=H.objectWithoutOptionalProperties({nullable:H.lazyObject(()=>np).optional(),valueType:H.lazy(()=>Va)});var Sin=H.objectWithoutOptionalProperties({name:Ms,value:H.lazyObject(()=>np),originalTypeDeclaration:tb});var mut=H.objectWithoutOptionalProperties({properties:H.list(H.lazyObject(()=>Sin))});var Tin=H.objectWithoutOptionalProperties({typeId:sv,object:H.lazyObject(()=>mut)});var vin=H.objectWithoutOptionalProperties({optional:H.lazyObject(()=>np).optional(),valueType:H.lazy(()=>Va)});var Iin=H.objectWithoutOptionalProperties({set:H.list(H.lazyObject(()=>np)),itemType:H.lazy(()=>Va)});var Bin=H.objectWithoutOptionalProperties({wireDiscriminantValue:Ms,shape:H.lazy(()=>Oin)});var pXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Oin=H.union("type",{samePropertiesAsObject:H.lazyObject(()=>Tin),singleProperty:H.lazyObject(()=>np),noProperties:H.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return Xee.samePropertiesAsObject(e);case"singleProperty":return Xee.singleProperty(e);case"noProperties":return Xee.noProperties();default:return e}},untransform:e=>{var{_visit:t}=e,r=pXd(e,["_visit"]);return r}});var np=H.objectWithoutOptionalProperties({shape:H.lazy(()=>Pin)}).extend(rte);var fXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Pin=H.union("type",{primitive:H.object({primitive:dut}),container:H.object({container:H.lazy(()=>Ain)}),unknown:H.object({unknown:H.unknown()}),named:H.lazyObject(()=>xin)}).transform({transform:e=>{switch(e.type){case"primitive":return d5.primitive(e.primitive);case"container":return d5.container(e.container);case"unknown":return d5.unknown(e.unknown);case"named":return d5.named(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=fXd(e,["_visit"]);return r}});var dXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},cut=H.union("type",{alias:H.lazyObject(()=>min),enum:Cin,object:H.lazyObject(()=>mut),union:H.lazyObject(()=>Rin),undiscriminatedUnion:H.lazyObject(()=>Din)}).transform({transform:e=>{switch(e.type){case"alias":return xM.alias(e);case"enum":return xM.enum(e);case"object":return xM.object(e);case"union":return xM.union(e);case"undiscriminatedUnion":return xM.undiscriminatedUnion(e);default:return e}},untransform:e=>{var{_visit:t}=e,r=dXd(e,["_visit"]);return r}});var Din=H.objectWithoutOptionalProperties({index:H.number(),singleUnionType:H.lazyObject(()=>np)});var Rin=H.objectWithoutOptionalProperties({discriminant:Ms,singleUnionType:H.lazyObject(()=>Bin)});var din=H.objectWithoutOptionalProperties({keyType:H.lazy(()=>Va),valueType:H.lazy(()=>Va)});var mXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Fin=H.union("type",{enum:Jfe}).transform({transform:e=>e.type==="enum"?wct.enum(e):e,untransform:e=>{var{_visit:t}=e,r=mXd(e,["_visit"]);return r}});var kin=H.objectWithoutOptionalProperties({typeId:sv,fernFilepath:TM,name:mo,default:Fin.optional(),inline:H.boolean().optional()});var hXd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Va=H.union(H.discriminant("type","_type"),{container:H.object({container:H.lazy(()=>lut)}),named:kin,primitive:H.object({primitive:uut}),unknown:H.object({})}).transform({transform:e=>{switch(e.type){case"container":return h5.container(e.container);case"named":return h5.named(e);case"primitive":return h5.primitive(e.primitive);case"unknown":return h5.unknown();default:return e}},untransform:e=>{var{_visit:t}=e,r=hXd(e,["_visit"]);return r}});var JPo={};te(JPo,{VariableDeclaration:()=>Qnn,VariableId:()=>nut});var YPo={};te(YPo,{ExampleWebhookCall:()=>Mnn,InlinedWebhookPayload:()=>_nn,InlinedWebhookPayloadProperty:()=>Unn,Webhook:()=>Gnn,WebhookGroup:()=>Wnn,WebhookHttpMethod:()=>Lnn,WebhookName:()=>znn,WebhookPayload:()=>qnn,WebhookPayloadReference:()=>Vnn});var XPo={};te(XPo,{ExampleWebSocketMessage:()=>Knn,ExampleWebSocketMessageBody:()=>Hnn,ExampleWebSocketSession:()=>Jnn,InlinedWebSocketMessageBody:()=>Xnn,InlinedWebSocketMessageBodyProperty:()=>Ynn,WebSocketChannel:()=>nin,WebSocketMessage:()=>tin,WebSocketMessageBody:()=>$nn,WebSocketMessageBodyReference:()=>Znn,WebSocketMessageId:()=>put,WebSocketMessageOrigin:()=>ein,WebSocketName:()=>rin});var Us={};te(Us,{AliasTypeDeclaration:()=>acn,ApiAuth:()=>son,ApiDefinitionSource:()=>Ban,ApiDefinitionSourceId:()=>San,ApiVersionScheme:()=>Pan,AuthScheme:()=>ion,AuthSchemesRequirement:()=>oon,AutogeneratedEndpointExample:()=>ksn,Availability:()=>dte,AvailabilityStatus:()=>Kin,Base64Type:()=>Uan,BasicAuthScheme:()=>Gin,BearerAuthScheme:()=>Win,BigIntegerType:()=>_an,BooleanType:()=>Van,BytesRequest:()=>Wut,BytesResponse:()=>Hut,Constants:()=>lon,ContainerType:()=>clt,CsharpProtobufFileOptions:()=>Ysn,CursorPagination:()=>Nsn,CustomPagination:()=>jsn,DateTimeType:()=>qan,DateType:()=>Gan,Declaration:()=>Hw,DeclaredErrorName:()=>Rxe,DeclaredServiceName:()=>Qsn,DeclaredTypeName:()=>rb,DirectPublish:()=>kan,DoubleType:()=>Han,DoubleValidationRules:()=>Wan,Encoding:()=>nlt,EndpointId:()=>OH,EndpointName:()=>Msn,EndpointReference:()=>xut,EnumTypeDeclaration:()=>ilt,EnumTypeReference:()=>x8c,EnumValue:()=>Zfe,EnvironmentBaseUrlId:()=>T5,EnvironmentBaseUrlWithId:()=>Fon,EnvironmentId:()=>hte,EnvironmentUrl:()=>Dxe,EnvironmentVariable:()=>S5,Environments:()=>Mon,EnvironmentsConfig:()=>Fut,ErrorDeclaration:()=>esn,ErrorDeclarationDiscriminantValue:()=>I8c,ErrorDiscriminationByPropertyStrategy:()=>Dan,ErrorDiscriminationStrategy:()=>Ran,ErrorId:()=>Oxe,EscapedString:()=>aon,ExampleAliasType:()=>Kcn,ExampleCodeSample:()=>_sn,ExampleCodeSampleLanguage:()=>Lsn,ExampleCodeSampleSdk:()=>Usn,ExampleContainer:()=>Xcn,ExampleDatetime:()=>Jcn,ExampleEndpointCall:()=>Gut,ExampleEndpointErrorResponse:()=>Psn,ExampleEndpointSuccessResponse:()=>Rsn,ExampleEnumType:()=>nun,ExampleError:()=>$on,ExampleHeader:()=>r4e,ExampleInlinedRequestBody:()=>qut,ExampleInlinedRequestBodyProperty:()=>Bsn,ExampleKeyValuePair:()=>iun,ExampleListContainer:()=>Zcn,ExampleLiteralContainer:()=>Ycn,ExampleMapContainer:()=>$cn,ExampleNamedType:()=>oun,ExampleNullableContainer:()=>eun,ExampleObjectProperty:()=>sun,ExampleObjectType:()=>flt,ExampleObjectTypeWithTypeId:()=>aun,ExampleOptionalContainer:()=>tun,ExamplePathParameter:()=>Fxe,ExamplePrimitive:()=>plt,ExampleQueryParameter:()=>Vut,ExampleQueryParameterShape:()=>Tsn,ExampleRequestBody:()=>Osn,ExampleResponse:()=>Fsn,ExampleServerSideEvent:()=>Dsn,ExampleSetContainer:()=>run,ExampleSingleUnionType:()=>cun,ExampleSingleUnionTypeProperties:()=>uun,ExampleType:()=>F5t,ExampleTypeReference:()=>ip,ExampleTypeReferenceShape:()=>lun,ExampleTypeShape:()=>slt,ExampleUndiscriminatedUnionType:()=>pun,ExampleUnionType:()=>fun,ExampleWebSocketMessage:()=>Bcn,ExampleWebSocketMessageBody:()=>Tcn,ExampleWebSocketSession:()=>Ocn,ExampleWebhookCall:()=>ycn,FeatureId:()=>con,FernFilepath:()=>DM,FileDownloadResponse:()=>Kut,FileProperty:()=>Gsn,FilePropertyArray:()=>Vsn,FilePropertySingle:()=>qsn,FileUploadBodyProperty:()=>Hsn,FileUploadBodyPropertyEncoding:()=>Wsn,FileUploadRequest:()=>Jsn,FileUploadRequestProperty:()=>Ksn,FloatType:()=>Kan,GithubPublish:()=>Nan,GrpcTransport:()=>$sn,HeaderApiVersionScheme:()=>Oan,HeaderAuthScheme:()=>Hin,HttpEndpoint:()=>Ian,HttpHeader:()=>W2,HttpMethod:()=>Put,HttpPath:()=>B5,HttpPathPart:()=>ean,HttpRequestBody:()=>ran,HttpRequestBodyReference:()=>Xut,HttpResponse:()=>pan,HttpResponseBody:()=>lan,HttpService:()=>xan,InlinedRequestBody:()=>tan,InlinedRequestBodyProperty:()=>Jut,InlinedWebSocketMessageBody:()=>Dcn,InlinedWebSocketMessageBodyProperty:()=>Pcn,InlinedWebhookPayload:()=>Icn,InlinedWebhookPayloadProperty:()=>vcn,IntegerType:()=>Yan,IntegerValidationRules:()=>Jan,IntermediateRepresentation:()=>w8c,JsonEncoding:()=>Can,JsonResponse:()=>Zut,JsonResponseBody:()=>nan,JsonResponseBodyWithProperty:()=>ian,JsonStreamChunk:()=>oan,Literal:()=>Wcn,LongType:()=>Xan,MapType:()=>Hcn,MultipleBaseUrlsEnvironment:()=>kon,MultipleBaseUrlsEnvironments:()=>Non,Name:()=>ho,NameAndWireValue:()=>zs,NamedType:()=>mun,NamedTypeDefault:()=>dun,NonStreamHttpResponseBody:()=>can,OAuthAccessTokenRequestProperties:()=>$in,OAuthAccessTokenResponseProperties:()=>Sut,OAuthClientCredentials:()=>ton,OAuthConfiguration:()=>ron,OAuthRefreshEndpoint:()=>Zin,OAuthRefreshTokenRequestProperties:()=>Xin,OAuthScheme:()=>non,OAuthTokenEndpoint:()=>eon,ObjectProperty:()=>G2,ObjectPropertyAccess:()=>Jin,ObjectTypeDeclaration:()=>ccn,OffsetPagination:()=>fan,Package:()=>llt,PackageNavigationConfig:()=>Mcn,Pagination:()=>dan,PathParameter:()=>PH,PathParameterLocation:()=>man,PlatformHeaders:()=>Ucn,PostmanPublishTarget:()=>Fan,PrimitiveType:()=>alt,PrimitiveTypeV1:()=>kut,PrimitiveTypeV2:()=>ncn,ProtoEncoding:()=>wan,ProtoSource:()=>Tan,ProtobufFile:()=>Yut,ProtobufFileOptions:()=>Xsn,ProtobufService:()=>Zsn,ProtobufType:()=>Lan,PublishTarget:()=>olt,PublishingConfig:()=>jan,QueryParameter:()=>Bxe,ReadmeConfig:()=>Lcn,RequestProperty:()=>TR,RequestPropertyValue:()=>Yin,ResolvedNamedType:()=>ocn,ResolvedTypeReference:()=>scn,ResponseError:()=>han,ResponseErrors:()=>gan,ResponseProperty:()=>PM,SafeAndUnsafeString:()=>t4e,SdkConfig:()=>_cn,SdkRequest:()=>Ean,SdkRequestBodyType:()=>Aan,SdkRequestShape:()=>ban,SdkRequestWrapper:()=>yan,ServiceId:()=>pte,ServiceTypeReferenceInfo:()=>Vcn,ShapeType:()=>icn,SingleBaseUrlEnvironment:()=>jon,SingleBaseUrlEnvironments:()=>Qon,SingleUnionType:()=>dcn,SingleUnionTypeProperties:()=>fcn,SingleUnionTypeProperty:()=>pcn,Source:()=>zan,SourceConfig:()=>qcn,SseStreamChunk:()=>san,StreamParameterResponse:()=>uan,StreamingResponse:()=>$ut,StringType:()=>$an,StringValidationRules:()=>Zan,Subpackage:()=>Gcn,SubpackageId:()=>fte,SupportedSdkLanguage:()=>zsn,TextResponse:()=>elt,TextStreamChunk:()=>aan,Transport:()=>rlt,Type:()=>hcn,TypeDeclaration:()=>gcn,TypeId:()=>av,TypeReference:()=>qa,Uint64Type:()=>ecn,UintType:()=>tcn,UndiscriminatedUnionMember:()=>ucn,UndiscriminatedUnionTypeDeclaration:()=>lcn,UnionTypeDeclaration:()=>mcn,UserAgent:()=>zcn,UserDefinedProtobufType:()=>Qan,UserSpecifiedEndpointExample:()=>van,UuidType:()=>rcn,VariableDeclaration:()=>Acn,VariableId:()=>tlt,WebSocketChannel:()=>Qcn,WebSocketChannelId:()=>But,WebSocketMessage:()=>Ncn,WebSocketMessageBody:()=>Fcn,WebSocketMessageBodyReference:()=>Rcn,WebSocketMessageId:()=>ult,WebSocketMessageOrigin:()=>kcn,WebSocketName:()=>jcn,Webhook:()=>xcn,WebhookGroup:()=>Scn,WebhookGroupId:()=>Tut,WebhookHttpMethod:()=>bcn,WebhookId:()=>uon,WebhookName:()=>Ecn,WebhookPayload:()=>wcn,WebhookPayloadReference:()=>Ccn,WellKnownProtobufType:()=>Man,WithDocs:()=>Go,WithDocsAndAvailability:()=>Pxe,WithJsonExample:()=>mte,auth:()=>bDo,commons:()=>EDo,constants:()=>vDo,dynamic:()=>dI,environment:()=>ODo,errors:()=>PDo,generatorExec:()=>RDo,http:()=>FDo,ir:()=>kDo,proto:()=>NDo,publish:()=>jDo,types:()=>QDo,variables:()=>MDo,webhooks:()=>LDo,websocket:()=>zDo});var bDo={};te(bDo,{ApiAuth:()=>son,AuthScheme:()=>ion,AuthSchemesRequirement:()=>oon,BasicAuthScheme:()=>Gin,BearerAuthScheme:()=>Win,EnvironmentVariable:()=>S5,HeaderAuthScheme:()=>Hin,OAuthAccessTokenRequestProperties:()=>$in,OAuthAccessTokenResponseProperties:()=>Sut,OAuthClientCredentials:()=>ton,OAuthConfiguration:()=>ron,OAuthRefreshEndpoint:()=>Zin,OAuthRefreshTokenRequestProperties:()=>Xin,OAuthScheme:()=>non,OAuthTokenEndpoint:()=>eon});var W={};te(W,{JsonError:()=>hut,ParseError:()=>gut,any:()=>M5c,bigint:()=>S5c,boolean:()=>L5c,booleanLiteral:()=>j5c,date:()=>T5c,discriminant:()=>J5c,enum_:()=>jin,getObjectLikeUtils:()=>BH,getObjectUtils:()=>$ze,getSchemaUtils:()=>gh,isProperty:()=>Xfe,lazy:()=>B5c,lazyObject:()=>k5c,list:()=>Min,never:()=>z5c,number:()=>U5c,object:()=>Qin,objectWithoutOptionalProperties:()=>F5c,optional:()=>ZPo,property:()=>P5c,record:()=>G5c,set:()=>W5c,string:()=>_5c,stringLiteral:()=>Q5c,transform:()=>$Po,undiscriminatedUnion:()=>K5c,union:()=>X5c,unknown:()=>V5c,withParsedProperties:()=>rDo});var wl={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 Tm(e,t){return`Expected ${t}. Received ${gXd(e)}.`}function gXd(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function AT(e){return Object.assign(Object.assign({},e),{json:x5c(e.json),parse:x5c(e.parse)})}function x5c(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(`
|
|
@@ -3812,7 +3812,7 @@ Hint: Values starting with "@" (such as scoped npm packages) must be wrapped in
|
|
|
3812
3812
|
Add a 'docs:' section to your fern.yml to get started.`,code:D.Code.ConfigError});let o=await new VPe({context:t}).check({workspace:n,strict:r.strict}),s=new Set(o.mdxParseErrors.map(p=>p.displayRelativeFilepath)),a=new Set(o.mdxParseErrors.map(p=>p.rawMessage)),c=o.violations.filter(p=>!(s.size>0&&sFm(p,s,a))),u=o.hasErrors||r.strict&&o.hasWarnings;if(r.json){let p=this.buildJsonResponse({result:o,filteredViolations:c,hasErrors:u});if(t.stdout.info(JSON.stringify(p,null,2)),u)throw new D({code:D.Code.ValidationError});return}if(c.length>0)for(let p of c){let d=p.severity==="warning"?Ae.yellow:Ae.red;process.stderr.write(`${d(`${p.displayRelativeFilepath}:${p.line}:${p.column}: ${p.message}`)}
|
|
3813
3813
|
`)}let l=0;if(o.mdxParseErrors.length>0){for(let p of o.mdxParseErrors)t.stderr.info(`
|
|
3814
3814
|
${p.toString()}
|
|
3815
|
-
`);r.fix?l+=await Rei(t,o.mdxParseErrors):process.stdout.isTTY===!0&&!hXn()&&await Fei(t,o.mdxParseErrors)}if(r.fix&&c.length>0){let d=await new rEt({context:t}).fix({workspace:n,violations:c});l+=d.fixedCount}if(u&&(!r.fix||l===0))throw new D({code:D.Code.ValidationError});if(o.warningCount>0){t.stderr.info(`${Nr.warning} ${Ae.yellow(`Found ${o.warningCount} warnings`)}`),t.stderr.info(Ae.dim(" Run 'fern docs check --strict' to treat warnings as errors"));return}t.stderr.info(`${Nr.success} ${Ae.green("All checks passed")}`)}buildJsonResponse({result:t,filteredViolations:r,hasErrors:n}){let i={};return(r.length>0||t.mdxParseErrors.length>0)&&(i.docs=[...r.map(o=>Cee(o)),...t.mdxParseErrors.map(o=>({severity:"error",rule:o.code.code,filepath:o.displayRelativeFilepath,...o.line!=null?{line:o.line}:{},...o.column!=null?{column:o.column}:{},message:`[${o.code.code}] ${o.code.title}: ${o.rawMessage}`}))]),{success:!n,results:i}}};function sFm(e,t,r){if(!/failed to parse|failed to initialize/i.test(e.message))return!1;for(let n of r)if(n.length>0&&e.message.includes(n))return!0;for(let n of t){if(e.message.includes(n))return!0;let i=n.split("/").filter(Boolean);for(let o=i.length;o>=2;o--){let s=i.slice(i.length-o).join("/");if(e.message.includes(s))return!0}if(i.length===1){let o=i[0];if(o!=null&&e.message.includes(o))return!0}}return!1}function aVo(e){let t=new sVo;ai(e,"check","Validate docs configuration",(r,n)=>t.handle(r,n),r=>r.option("strict",{type:"boolean",description:"Treat warnings as errors",default:!1}).option("json",{type:"boolean",description:"Output results as JSON to stdout",default:!1}).option("fix",{type:"boolean",description:"Automatically fix issues that have a known resolution",default:!1}))}Hb();_t();var sfu=we(require("net"),1),afu=we(require("os"),1),jei=class extends Error{constructor(t){super(`${t} is locked`)}},sEt={old:new Set,young:new Set},aFm=1e3*15,cfu=new Set;var oGt,cFm=()=>{let e=afu.default.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(e))for(let n of r)t.add(n.address);return t},ifu=e=>new Promise((t,r)=>{let n=sfu.default.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{let{port:i}=n.address();n.close(()=>{t(i)})})}),ofu=async(e,t)=>{if(e.host||e.port===0)return ifu(e);for(let r of t)try{await ifu({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},uFm=e=>sEt.old.has(e)||sEt.young.has(e)||cfu.has(e),lFm=function*(e){e&&(yield*e),yield 0};async function GPe(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){let s=e.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let a of s){if(typeof a!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(a))throw new TypeError(`Number ${a} in the exclude option is not a safe integer and can't be used`)}r=new Set(s)}let{reserve:n,...i}=e??{};oGt===void 0&&(oGt=setTimeout(()=>{oGt=void 0,sEt.old=sEt.young,sEt.young=new Set},aFm),oGt.unref&&oGt.unref());let o=cFm();for(let s of lFm(t))try{if(r.has(s))continue;let a=await ofu({...i,port:s},o);for(;uFm(a);){if(s!==0)throw new jei(s);a=await ofu({...i,port:s},o)}return n?cfu.add(a):sEt.young.add(a),a}catch(a){if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof jei))throw a}throw new Error("No available ports found")}_t();var pfu=/^[a-z0-9-]+-preview-[a-z0-9-]+\.docs\.buildwithfern\.com$/i,ufu="docs.buildwithfern.com",lfu=62;function DUe(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)),pfu.test(t)}function ffu(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return t.length===0?"default":t}function sGt({orgId:e,previewId:t}){let r=ffu(t),n=`${e}-preview-${r}.${ufu}`;if(n.length<=lfu)return n;let i=`${e}-preview-`,o=lfu-i.length;if(o<8)throw new D({message:`Organization name "${e}" is too long to generate a valid preview URL`,code:D.Code.ValidationError});let a=r.slice(0,o).replace(/-+$/,"");return`${i}${a}.${ufu}`}jt();Hh();tr();aS();_t();var H7o=require("child_process"),kCu=we(lVo(),1),K7o=we(Iti(),1),J7o=we(require("fs"),1),n_e=require("fs/promises"),NCu=we(require("http"),1),Z7o=we(require("path"),1);Qti();tr();var Y7=require("fs/promises"),YAu=require("os"),X5o=we(require("path"),1),XLm=".fern",ZLm="logs",Y5o=100*1024*1024;function $Lm(){return"cli@5.44.
|
|
3815
|
+
`);r.fix?l+=await Rei(t,o.mdxParseErrors):process.stdout.isTTY===!0&&!hXn()&&await Fei(t,o.mdxParseErrors)}if(r.fix&&c.length>0){let d=await new rEt({context:t}).fix({workspace:n,violations:c});l+=d.fixedCount}if(u&&(!r.fix||l===0))throw new D({code:D.Code.ValidationError});if(o.warningCount>0){t.stderr.info(`${Nr.warning} ${Ae.yellow(`Found ${o.warningCount} warnings`)}`),t.stderr.info(Ae.dim(" Run 'fern docs check --strict' to treat warnings as errors"));return}t.stderr.info(`${Nr.success} ${Ae.green("All checks passed")}`)}buildJsonResponse({result:t,filteredViolations:r,hasErrors:n}){let i={};return(r.length>0||t.mdxParseErrors.length>0)&&(i.docs=[...r.map(o=>Cee(o)),...t.mdxParseErrors.map(o=>({severity:"error",rule:o.code.code,filepath:o.displayRelativeFilepath,...o.line!=null?{line:o.line}:{},...o.column!=null?{column:o.column}:{},message:`[${o.code.code}] ${o.code.title}: ${o.rawMessage}`}))]),{success:!n,results:i}}};function sFm(e,t,r){if(!/failed to parse|failed to initialize/i.test(e.message))return!1;for(let n of r)if(n.length>0&&e.message.includes(n))return!0;for(let n of t){if(e.message.includes(n))return!0;let i=n.split("/").filter(Boolean);for(let o=i.length;o>=2;o--){let s=i.slice(i.length-o).join("/");if(e.message.includes(s))return!0}if(i.length===1){let o=i[0];if(o!=null&&e.message.includes(o))return!0}}return!1}function aVo(e){let t=new sVo;ai(e,"check","Validate docs configuration",(r,n)=>t.handle(r,n),r=>r.option("strict",{type:"boolean",description:"Treat warnings as errors",default:!1}).option("json",{type:"boolean",description:"Output results as JSON to stdout",default:!1}).option("fix",{type:"boolean",description:"Automatically fix issues that have a known resolution",default:!1}))}Hb();_t();var sfu=we(require("net"),1),afu=we(require("os"),1),jei=class extends Error{constructor(t){super(`${t} is locked`)}},sEt={old:new Set,young:new Set},aFm=1e3*15,cfu=new Set;var oGt,cFm=()=>{let e=afu.default.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(e))for(let n of r)t.add(n.address);return t},ifu=e=>new Promise((t,r)=>{let n=sfu.default.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{let{port:i}=n.address();n.close(()=>{t(i)})})}),ofu=async(e,t)=>{if(e.host||e.port===0)return ifu(e);for(let r of t)try{await ifu({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},uFm=e=>sEt.old.has(e)||sEt.young.has(e)||cfu.has(e),lFm=function*(e){e&&(yield*e),yield 0};async function GPe(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){let s=e.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let a of s){if(typeof a!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(a))throw new TypeError(`Number ${a} in the exclude option is not a safe integer and can't be used`)}r=new Set(s)}let{reserve:n,...i}=e??{};oGt===void 0&&(oGt=setTimeout(()=>{oGt=void 0,sEt.old=sEt.young,sEt.young=new Set},aFm),oGt.unref&&oGt.unref());let o=cFm();for(let s of lFm(t))try{if(r.has(s))continue;let a=await ofu({...i,port:s},o);for(;uFm(a);){if(s!==0)throw new jei(s);a=await ofu({...i,port:s},o)}return n?cfu.add(a):sEt.young.add(a),a}catch(a){if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof jei))throw a}throw new Error("No available ports found")}_t();var pfu=/^[a-z0-9-]+-preview-[a-z0-9-]+\.docs\.buildwithfern\.com$/i,ufu="docs.buildwithfern.com",lfu=62;function DUe(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)),pfu.test(t)}function ffu(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return t.length===0?"default":t}function sGt({orgId:e,previewId:t}){let r=ffu(t),n=`${e}-preview-${r}.${ufu}`;if(n.length<=lfu)return n;let i=`${e}-preview-`,o=lfu-i.length;if(o<8)throw new D({message:`Organization name "${e}" is too long to generate a valid preview URL`,code:D.Code.ValidationError});let a=r.slice(0,o).replace(/-+$/,"");return`${i}${a}.${ufu}`}jt();Hh();tr();aS();_t();var H7o=require("child_process"),kCu=we(lVo(),1),K7o=we(Iti(),1),J7o=we(require("fs"),1),n_e=require("fs/promises"),NCu=we(require("http"),1),Z7o=we(require("path"),1);Qti();tr();var Y7=require("fs/promises"),YAu=require("os"),X5o=we(require("path"),1),XLm=".fern",ZLm="logs",Y5o=100*1024*1024;function $Lm(){return"cli@5.44.6"}var GUe=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??Ze(Ze(Ht.of((0,YAu.homedir)()),Fe.of(XLm)),Fe.of(ZLm));await sr(n)||await(0,Y7.mkdir)(n,{recursive:!0});let o=`${new Date().toISOString().replace(/[:.]/g,"-")}.debug.log`;this.logFilePath=Ze(n,Fe.of(o));let s=["================================================================================","Fern Docs Dev Debug Log",`Session started: ${new Date().toISOString()}`,`Log file: ${X5o.default.basename(this.logFilePath)}`,"================================================================================",""].join(`
|
|
3816
3816
|
`);await(0,Y7.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)+`
|
|
3817
3817
|
`;try{await(0,Y7.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:$Lm(),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,Y7.readdir)(t)).filter(c=>c.endsWith(".log")),i=[];for(let c of n){let u=X5o.default.join(t,c);try{let l=await(0,Y7.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=Y5o/1024/1024;if(o<=Y5o){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<=Y5o)break;if(!(this.logFilePath!=null&&c.fullPath===this.logFilePath))try{await(0,Y7.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 Mti={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"};function XAu(e){let t=e3m();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:Mti});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",...Mti}})}catch{return new Response(JSON.stringify(i()),{headers:{"Content-Type":"application/json",...Mti}})}let d=/^\/_local\/(.*)/.exec(p.pathname);return u.method==="GET"&&d!=null?new Response(t.file(`/${d[1]}`),{headers:Mti}):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 GUe.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 e3m(){return globalThis.Bun}_t();var gyu=require("events"),Vti=we(require("fs"),1),HUe=we(require("path"),1);var ZAu=we(require("os"),1),$Au=300,eDe=20,LGt=1e7,eyu=ZAu.default.platform();var t3m=eyu==="darwin",Z5o=eyu==="win32",tDe=t3m||Z5o,tyu=3e3,ryu=2e4,$5o=1250;var Sie;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})(Sie||(Sie={}));var WUe;(function(e){e.CHANGE="change",e.RENAME="rename"})(WUe||(WUe={}));var zGt;(function(e){e.CHANGE="change",e.ERROR="error"})(zGt||(zGt={}));var Hc;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(Hc||(Hc={}));var NN;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(NN||(NN={}));var r3m=(e,t=1,r)=>{t=Math.max(1,t);let n=r?.leading??!1,i=r?.trailing??!0,o=Math.max(r?.maxWait??1/0,t),s,a,c=0,u=0,l=()=>{let C=Date.now(),x=C-c,T=C-u,O=x>=t||T>=o;return[C,O]},p=C=>{if(u=C,!s)return;let x=s;s=void 0,e.apply(void 0,x)},d=()=>{I(0)},f=()=>{a&&(d(),p(Date.now()))},m=C=>{if(u=C,n)return p(C)},h=C=>{if(i&&s)return p(C);s=void 0},A=()=>{a=void 0;let[C,x]=l();return x?h(C):y(C)},y=C=>{let x=C-c,T=C-u,O=t-x,R=o-T,P=Math.min(O,R);return I(P)},I=C=>{a&&clearTimeout(a),!(C<=0)&&(a=setTimeout(A,C))},w=(...C)=>{let[x,T]=l(),O=!!a;if(s=C,c=x,(T||!a)&&I(t),T)return O?p(x):m(x)};return w.cancel=d,w.flush=f,w},Lti=r3m;var n8o=we(require("fs"),1),Uti=we(require("path"),1);var Kd=we(require("fs"),1),dP=require("util");var lme=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},Tie=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(i){return t(i)}};var e8o=we(require("process"),1),nyu=e8o.default.getuid?!e8o.default.getuid():!1,iyu=1e4,P6=()=>{};var UGt={isChangeErrorOk:e=>{if(!UGt.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!nyu&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!UGt.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!UGt.isNodeError(e))throw e;if(!UGt.isChangeErrorOk(e))throw e}},FC=UGt;var t8o=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=iyu,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(n),n=()=>t(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},oyu=new t8o;var pme=(e,t)=>function(n){return function i(...o){return oyu.schedule().then(s=>{let a=u=>(s(),u),c=u=>{if(s(),Date.now()>=n)throw u;if(t(u)){let l=Math.round(100*Math.random());return new Promise(d=>setTimeout(d,l)).then(()=>i.apply(void 0,o))}throw u};return e.apply(void 0,o).then(a,c)})}},fme=(e,t)=>function(n){return function i(...o){try{return e.apply(void 0,o)}catch(s){if(Date.now()>n)throw s;if(t(s))return i.apply(void 0,o);throw s}}};var n3m={attempt:{chmod:lme((0,dP.promisify)(Kd.default.chmod),FC.onChangeError),chown:lme((0,dP.promisify)(Kd.default.chown),FC.onChangeError),close:lme((0,dP.promisify)(Kd.default.close),P6),fsync:lme((0,dP.promisify)(Kd.default.fsync),P6),mkdir:lme((0,dP.promisify)(Kd.default.mkdir),P6),realpath:lme((0,dP.promisify)(Kd.default.realpath),P6),stat:lme((0,dP.promisify)(Kd.default.stat),P6),unlink:lme((0,dP.promisify)(Kd.default.unlink),P6),chmodSync:Tie(Kd.default.chmodSync,FC.onChangeError),chownSync:Tie(Kd.default.chownSync,FC.onChangeError),closeSync:Tie(Kd.default.closeSync,P6),existsSync:Tie(Kd.default.existsSync,P6),fsyncSync:Tie(Kd.default.fsync,P6),mkdirSync:Tie(Kd.default.mkdirSync,P6),realpathSync:Tie(Kd.default.realpathSync,P6),statSync:Tie(Kd.default.statSync,P6),unlinkSync:Tie(Kd.default.unlinkSync,P6)},retry:{close:pme((0,dP.promisify)(Kd.default.close),FC.isRetriableError),fsync:pme((0,dP.promisify)(Kd.default.fsync),FC.isRetriableError),open:pme((0,dP.promisify)(Kd.default.open),FC.isRetriableError),readFile:pme((0,dP.promisify)(Kd.default.readFile),FC.isRetriableError),rename:pme((0,dP.promisify)(Kd.default.rename),FC.isRetriableError),stat:pme((0,dP.promisify)(Kd.default.stat),FC.isRetriableError),write:pme((0,dP.promisify)(Kd.default.write),FC.isRetriableError),writeFile:pme((0,dP.promisify)(Kd.default.writeFile),FC.isRetriableError),closeSync:fme(Kd.default.closeSync,FC.isRetriableError),fsyncSync:fme(Kd.default.fsyncSync,FC.isRetriableError),openSync:fme(Kd.default.openSync,FC.isRetriableError),readFileSync:fme(Kd.default.readFileSync,FC.isRetriableError),renameSync:fme(Kd.default.renameSync,FC.isRetriableError),statSync:fme(Kd.default.statSync,FC.isRetriableError),writeSync:fme(Kd.default.writeSync,FC.isRetriableError),writeFileSync:fme(Kd.default.writeFileSync,FC.isRetriableError)}},syu=n3m;var zti=we(require("fs"),1),_Gt=we(require("path"),1);var r8o=()=>{};var i3m=()=>{let e=r8o,t=r8o,r=!1,n=!1;return{promise:new Promise((c,u)=>{e=l=>(r=!0,c(l)),t=l=>(n=!0,u(l))}),resolve:e,reject:t,isPending:()=>!r&&!n,isResolved:()=>r,isRejected:()=>n}},ayu=i3m;var o3m=()=>{let{promise:e,resolve:t,isPending:r}=ayu(),n=0,i=()=>{n+=1},o=()=>{n-=1,!n&&t()};return i(),queueMicrotask(o),{promise:e,isPending:r,increment:i,decrement:o}},cyu=o3m;var uyu={then:e=>{e()}};var lyu=e=>Array.isArray(e)?e:[e],pyu=e=>typeof e=="function";var s3m=(e,t)=>{let r=t?.followSymlinks??!1,n=t?.depth??1/0,i=t?.limit??1/0,o=t?.ignore??[],s=lyu(o).map(oe=>pyu(oe)?oe:ae=>oe.test(ae)),a=oe=>s.some(ae=>ae(oe)),c=t?.signal??{aborted:!1},u=t?.onDirents||(()=>{}),l=[],p=new Set,d={},f=[],m=new Set,h={},A=[],y=new Set,I={},w={},C=new Set,x={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},T={directories:l,directoriesNames:p,directoriesNamesToPaths:d,files:f,filesNames:m,filesNamesToPaths:h,symlinks:A,symlinksNames:y,symlinksNamesToPaths:I,map:w},{promise:O,increment:R,decrement:P}=cyu(),U=0,X=(oe,ae,Be,ve)=>{C.has(ae)||U>=i||(U+=1,oe.directories.push(ae),oe.directoriesNames.add(Be),l.push(ae),p.add(Be),d.propertyIsEnumerable(Be)||(d[Be]=[]),d[Be].push(ae),C.add(ae),!(ve>=n)&&(U>=i||fe(ae,ve+1)))},$=(oe,ae,Be)=>{C.has(ae)||U>=i||(U+=1,oe.files.push(ae),oe.filesNames.add(Be),f.push(ae),m.add(Be),h.propertyIsEnumerable(Be)||(h[Be]=[]),h[Be].push(ae),C.add(ae))},ne=(oe,ae,Be,ve)=>{C.has(ae)||U>=i||(U+=1,oe.symlinks.push(ae),oe.symlinksNames.add(Be),A.push(ae),y.add(Be),I.propertyIsEnumerable(Be)||(I[Be]=[]),I[Be].push(ae),C.add(ae),r&&(ve>=n||U>=i||Le(ae,ve+1)))},le=(oe,ae,Be,ve,Qe)=>{c.aborted||a(ae)||(ve.isDirectory()?X(oe,ae,Be,Qe):ve.isFile()?$(oe,ae,Be):ve.isSymbolicLink()&&ne(oe,ae,Be,Qe))},ge=(oe,ae,Be,ve)=>{if(c.aborted)return;let Qe=ae===_Gt.default.sep?"":_Gt.default.sep,qe=Be.name,ct=`${ae}${Qe}${qe}`;a(ct)||(Be.isDirectory()?X(oe,ct,qe,ve):Be.isFile()?$(oe,ct,qe):Be.isSymbolicLink()&&ne(oe,ct,qe,ve))},me=(oe,ae,Be,ve)=>{for(let Qe=0,qe=Be.length;Qe<qe;Qe++)ge(oe,ae,Be[Qe],ve)},fe=(oe,ae)=>{c.aborted||ae>n||U>=i||(R(),zti.default.readdir(oe,{withFileTypes:!0},(Be,ve)=>{if(Be||c.aborted||!ve.length)return P();(u(ve)||uyu).then(()=>{let qe=w[oe]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};me(qe,oe,ve,ae),P()})}))},Le=(oe,ae)=>{R(),zti.default.realpath(oe,(Be,ve)=>{if(Be||c.aborted)return P();zti.default.stat(ve,(Qe,qe)=>{if(Qe||c.aborted)return P();let ct=_Gt.default.basename(ve),At=w[oe]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};le(At,ve,ct,qe,ae),P()})})};return(async(oe,ae=1)=>(oe=_Gt.default.normalize(oe),C.add(oe),fe(oe,ae),await O,c.aborted?x:T))(e)},fyu=s3m;var Bie={lang:{debounce:Lti,attempt:e=>{try{return e()}catch(t){return Bie.lang.castError(t)}},castArray:e=>Bie.lang.isArray(e)?e:[e],castError:e=>Bie.lang.isError(e)?e:Bie.lang.isString(e)?new Error(e):new Error("Unknown error"),defer:e=>setTimeout(e,0),isArray:e=>Array.isArray(e),isError:e=>e instanceof Error,isFunction:e=>typeof e=="function",isNaN:e=>Number.isNaN(e),isNumber:e=>typeof e=="number",isPrimitive:e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},isShallowEqual:(e,t)=>{if(e===t)return!0;if(Bie.lang.isNaN(e))return Bie.lang.isNaN(t);if(Bie.lang.isPrimitive(e)||Bie.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},isSet:e=>e instanceof Set,isString:e=>typeof e=="string",isUndefined:e=>e===void 0,noop:()=>{},uniq:e=>e.length<2?e:Array.from(new Set(e))},fs:{getDepth:e=>Math.max(0,e.split(Uti.default.sep).length-1),getRealPath:(e,t)=>{try{return t?n8o.default.realpathSync.native(e):n8o.default.realpathSync(e)}catch{return}},isSubPath:(e,t)=>t.startsWith(e)&&t[e.length]===Uti.default.sep&&t.length-e.length>Uti.default.sep.length,poll:(e,t=ryu)=>syu.retry.stat(t)(e,{bigint:!0}).catch(Bie.lang.noop),readdir:async(e,t,r=1/0,n=1/0,i,o)=>{if(o&&r===1&&e in o){let s=o[e];return[s.directories,s.files]}else{let s=await fyu(e,{depth:r,limit:n,ignore:t,signal:i});return[s.directories,s.files]}}}},Ep=Bie;var _ti=we(require("path"),1);var i8o=class{constructor(t,r,n){this.base=n,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||Ep.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=$Au){return(()=>{let r=this.watcher._readyWait,n=[],i=new Set,o=async(a,c)=>{let u=this.options.ignoreInitial?[]:a,l=await this.eventsPopulate([...c]),p=this.eventsDeduplicate([...u,...l]);this.onTargetEvents(p)},s=Ep.lang.debounce(()=>{this.watcher.isClosed()||(r=o(n,i),n=[],i=new Set)},t);return async(a,c="",u=!1)=>{u?await this.eventsPopulate([c],n,!0):i.add(c),r.then(s)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((n,i)=>{let[o,s]=i,a=r[s];return o===a||o===Hc.CHANGE&&a===Hc.ADD||(r[s]=o,n.push(i)),n},[])}async eventsPopulate(t,r=[],n=!1){return await Promise.all(t.map(async i=>{let o=await this.watcher._poller.update(i,this.options.pollingTimeout);await Promise.all(o.map(async s=>{r.push([s,i]),s===Hc.ADD_DIR?await this.eventsPopulateAddDir(t,i,r,n):s===Hc.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,i,r,n)}))})),r}async eventsPopulateAddDir(t,r,n=[],i=!1){if(i)return n;let o=this.options.recursive?this.options.depth??eDe:Math.min(1,this.options.depth??eDe),s=this.options.limit??LGt,[a,c]=await Ep.fs.readdir(r,this.options.ignore,o,s,this.watcher._closeSignal),u=[...a,...c];return await Promise.all(u.map(l=>{if(!this.watcher.isIgnored(l,this.options.ignore)&&!t.includes(l))return this.eventsPopulate([l],n,!0)})),n}async eventsPopulateUnlinkDir(t,r,n=[],i=!1){if(i)return n;for(let o of this.watcher._poller.stats.keys())Ep.fs.isSubPath(r,o)&&(t.includes(o)||await this.eventsPopulate([o],n,!0));return n}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(Hc.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!tDe&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(Hc.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(Hc.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(_ti.default.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(Hc.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(_ti.default.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(Hc.UNLINK_DIR,t))}onTargetEvent(t){let[r,n]=t;r===Hc.ADD?this.onTargetAdd(n):r===Hc.ADD_DIR?this.onTargetAddDir(n):r===Hc.CHANGE?this.onTargetChange(n):r===Hc.UNLINK?this.onTargetUnlink(n):r===Hc.UNLINK_DIR&&this.onTargetUnlinkDir(n)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,n=!1){return this.handlerBatched(t,r,n)}onWatcherChange(t=WUe.CHANGE,r){if(this.watcher.isClosed())return;let n=_ti.default.resolve(this.folderPath,r||"");this.filePath&&n!==this.folderPath&&n!==this.filePath||this.watcher.isIgnored(n,this.options.ignore)||this.onWatcherEvent(t,n)}onWatcherError(t){Z5o&&t.code==="EPERM"?this.onWatcherChange(WUe.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on(zGt.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on(zGt.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(WUe.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&tDe&&this.options.native!==!1?this.options.depth??eDe:Math.min(1,this.options.depth??eDe),n=this.options.limit??LGt,[i,o]=await Ep.fs.readdir(this.folderPath,this.options.ignore,r,n,this.watcher._closeSignal,this.options.readdirMap),s=[this.folderPath,...i,...o];await Promise.all(s.map(a=>{if(!this.watcher._poller.stats.has(a)&&!this.watcher.isIgnored(a,this.options.ignore))return this.onWatcherEvent(WUe.CHANGE,a,t)}))}}},dyu=i8o;var jN={interval:100,intervalId:void 0,fns:new Map,init:()=>{jN.intervalId||(jN.intervalId=setInterval(jN.resolve,jN.interval))},reset:()=>{jN.intervalId&&(clearInterval(jN.intervalId),delete jN.intervalId)},add:(e,t)=>{jN.fns.set(e,Date.now()+t),jN.init()},remove:e=>{jN.fns.delete(e)},resolve:()=>{if(!jN.fns.size)return jN.reset();let e=Date.now();for(let[t,r]of jN.fns)r>=e||(jN.remove(t),t())}},VGt=jN;var qGt=class e{constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=$5o){let{ino:n,targetPath:i,events:o,locks:s}=t,a=()=>{let p=this._watcher._poller.paths.find(n||-1,d=>d!==i);if(p&&p!==i){if(Ep.fs.getRealPath(i,!0)===p)return;this._watcher.event(o.rename,p,i)}else this._watcher.event(o.add,i)};if(!n)return a();let c=()=>{s.add.delete(n),VGt.remove(u)},u=()=>{c(),a()};VGt.add(u,r);let l=()=>{let p=s.unlink.get(n);if(!p)return;c();let d=p();i===d?o.change&&this._watcher._poller.stats.has(i)&&this._watcher.event(o.change,i):this._watcher.event(o.rename,d,i)};s.add.set(n,l),l()}getLockUnlink(t,r=$5o){let{ino:n,targetPath:i,events:o,locks:s}=t,a=()=>{this._watcher.event(o.unlink,i)};if(!n)return a();let c=()=>{s.unlink.delete(n),VGt.remove(u)},u=()=>{c(),a()};VGt.add(u,r);let l=()=>(c(),i);s.unlink.set(n,l),s.add.get(n)?.()}getLockTargetAdd(t,r){let n=this._watcher._poller.getIno(t,Hc.ADD,Sie.FILE);return this.getLockAdd({ino:n,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let n=this._watcher._poller.getIno(t,Hc.ADD_DIR,Sie.DIR);return this.getLockAdd({ino:n,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let n=this._watcher._poller.getIno(t,Hc.UNLINK,Sie.FILE);return this.getLockUnlink({ino:n,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let n=this._watcher._poller.getIno(t,Hc.UNLINK_DIR,Sie.DIR);return this.getLockUnlink({ino:n,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};qGt.DIR_EVENTS={add:Hc.ADD_DIR,rename:Hc.RENAME_DIR,unlink:Hc.UNLINK_DIR};qGt.FILE_EVENTS={add:Hc.ADD,change:Hc.CHANGE,rename:Hc.RENAME,unlink:Hc.UNLINK};var myu=qGt;var o8o=class{constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(Ep.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let n=this.map.get(t);if(Ep.lang.isSet(n)){let i=n.delete(r);return n.size||this.map.delete(t),i}else if(n===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let n=this.map.get(t);if(Ep.lang.isSet(n))return Array.from(n).find(r);if(r(n))return n}}get(t){return this.map.get(t)}has(t,r){if(Ep.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let n=this.map.get(t);return Ep.lang.isSet(n)?n.has(r):n===r}return!1}set(t,r){if(this.map.has(t)){let n=this.map.get(t);Ep.lang.isSet(n)?n.add(r):n!==r&&this.map.set(t,new Set([n,r]))}else this.map.set(t,r);return this}},s8o=o8o;var a8o=class{constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},hyu=a8o;var c8o=class{constructor(){this.inos={},this.paths=new s8o,this.stats=new Map}getIno(t,r,n){let i=this.inos[r];if(!i)return;let o=i[t];if(o&&!(n&&o[1]!==n))return o[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let n=await Ep.fs.poll(t,r);if(!(!n||!(n.isFile()||n.isDirectory())))return new hyu(n)}reset(){this.inos={},this.paths=new s8o,this.stats=new Map}async update(t,r){let n=this.getStats(t),i=await this.poll(t,r);if(this.updateStats(t,i),!n&&i){if(i.isFile())return this.updateIno(t,Hc.ADD,i),[Hc.ADD];if(i.isDirectory())return this.updateIno(t,Hc.ADD_DIR,i),[Hc.ADD_DIR]}else if(n&&!i){if(n.isFile())return this.updateIno(t,Hc.UNLINK,n),[Hc.UNLINK];if(n.isDirectory())return this.updateIno(t,Hc.UNLINK_DIR,n),[Hc.UNLINK_DIR]}else if(n&&i){if(n.isFile()){if(i.isFile())return n.ino===i.ino&&!n.size&&!i.size?[]:(this.updateIno(t,Hc.CHANGE,i),[Hc.CHANGE]);if(i.isDirectory())return this.updateIno(t,Hc.UNLINK,n),this.updateIno(t,Hc.ADD_DIR,i),[Hc.UNLINK,Hc.ADD_DIR]}else if(n.isDirectory()){if(i.isFile())return this.updateIno(t,Hc.UNLINK_DIR,n),this.updateIno(t,Hc.ADD,i),[Hc.UNLINK_DIR,Hc.ADD];if(i.isDirectory())return n.ino===i.ino?[]:(this.updateIno(t,Hc.UNLINK_DIR,n),this.updateIno(t,Hc.ADD_DIR,i),[Hc.UNLINK_DIR,Hc.ADD_DIR])}}return[]}updateIno(t,r,n){let i=this.inos[r]=this.inos[r]||(this.inos[r]={}),o=n.isFile()?Sie.FILE:Sie.DIR;i[t]=[n.ino,o]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let n=this.stats.get(t)?.ino||-1;this.paths.delete(n,t),this.stats.delete(t)}}},u8o=c8o;var l8o=class e extends gyu.EventEmitter{constructor(t,r,n){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(NN.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(i=>this.on(NN.CLOSE,i)),this._readyWait=new Promise(i=>this.on(NN.READY,i)),this._locker=new myu(this),this._roots=new Set,this._poller=new u8o,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,n)}isClosed(){return this._closed}isIgnored(t,r){return!!r&&(Ep.lang.isFunction(r)?!!r(t):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(NN.CLOSE))}error(t){if(this.isClosed())return!1;let r=Ep.lang.castError(t);return this.emit(NN.ERROR,r)}event(t,r,n){return this.isClosed()?!1:(this.emit(NN.ALL,t,r,n),this.emit(t,r,n))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(NN.READY))}pollerExists(t,r){for(let n of this._pollers)if(n.targetPath===t&&Ep.lang.isShallowEqual(n.options,r))return!0;return!1}subwatcherExists(t,r){for(let n of this._subwatchers)if(n.targetPath===t&&Ep.lang.isShallowEqual(n.options,r))return!0;return!1}watchersClose(t,r,n=!0){if(t){let i=this._watchers[t];if(i)for(let o of[...i])r&&o.filePath!==r||this.watcherClose(o);if(n)for(let o in this._watchers)Ep.fs.isSubPath(t,o)&&this.watchersClose(o,r,!1)}else for(let i in this._watchers)this.watchersClose(i,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,n]of t)this.watchPath(r,n.options,n.handler)}async watcherAdd(t,r){let{folderPath:n}=t;(this._watchers[n]=this._watchers[n]||[]).push(t);let o=new dyu(this,t,r);return await o.init(),o}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let o=r.indexOf(t);r.splice(o,1),r.length||delete this._watchers[t.folderPath]}let n=t.filePath||t.folderPath;this._roots.has(n)&&(this._watchersRestorable[n]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=Ep.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,n,i){if(this._watchers[t]?.find(a=>a.handler===n&&(!a.filePath||a.filePath===i)&&a.options.ignore===r.ignore&&!!a.options.native==!!r.native&&(!r.recursive||a.options.recursive)))return!0;let s=HUe.default.dirname(t);for(let a=1;a<1/0;a++){if(this._watchers[s]?.find(l=>(a===1||l.options.recursive&&a<=(l.options.depth??eDe))&&l.handler===n&&(!l.filePath||l.filePath===i)&&l.options.ignore===r.ignore&&!!l.options.native==!!r.native&&(!r.recursive||l.options.recursive&&tDe&&l.options.native!==!1)))return!0;if(!tDe)break;let u=HUe.default.dirname(t);if(s===u)break;s=u}return!1}async watchDirectories(t,r,n,i,o){if(this.isClosed())return;t=Ep.lang.uniq(t).sort();let s;for(let a of t)if(!this.isIgnored(a,r.ignore)&&!this.watcherExists(a,r,n,i))try{let c=!r.recursive||tDe&&r.native!==!1?r:{...r,recursive:!1},l={watcher:Vti.default.watch(a,c),handler:n,options:r,folderPath:a,filePath:i},p=s=await this.watcherAdd(l,o);if(this._roots.has(i||a)){let f={...r,ignoreInitial:!0,recursive:!1},m=HUe.default.dirname(a),h=a;await this.watchDirectories([m],f,n,h,p)}}catch(c){this.error(c)}return s}async watchDirectory(t,r,n,i,o){if(!this.isClosed()&&!this.isIgnored(t,r.ignore)){if(!r.recursive||tDe&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,n,i,o));{r={...r,recursive:!0};let s=r.depth??eDe,a=r.limit??LGt,[c]=await Ep.fs.readdir(t,r.ignore,s,a,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let u=await this.watchDirectories([t],r,n,i,o);if(c.length){let l=Ep.fs.getDepth(t);for(let p of c){let d=Ep.fs.getDepth(p),f=Math.max(0,s-(d-l)),m={...r,depth:f};await this.watchDirectories([p],m,n,i,o||u)}}})}}}async watchFileOnce(t,r,n){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let i={targetPath:t,options:r},o=(u,l)=>{l===t&&(c(),n())},s=new e(o),a=()=>{this._subwatchers.add(i),this.on(NN.CLOSE,c),s.watchFile(t,r,o)},c=()=>{this._subwatchers.delete(i),this.removeListener(NN.CLOSE,c),s.close()};return a()}async watchFile(t,r,n){if(this.isClosed()||this.isIgnored(t,r.ignore))return;r={...r,recursive:!1};let i=HUe.default.dirname(t);return this.watchDirectory(i,r,n,t)}async watchPollingOnce(t,r,n){if(this.isClosed())return;let i=!1,o=new u8o,s=await this.watchPolling(t,r,async()=>{i||!(await o.update(t,r.pollingTimeout)).length||i||(i=!0,s(),n())})}async watchPolling(t,r,n){if(this.isClosed())return Ep.lang.noop;if(this.pollerExists(t,r))return Ep.lang.noop;let i={...r,interval:r.pollingInterval??tyu},o={targetPath:t,options:r},s=()=>{this._pollers.add(o),this.on(NN.CLOSE,a),Vti.default.watchFile(t,i,n)},a=()=>{this._pollers.delete(o),this.removeListener(NN.CLOSE,a),Vti.default.unwatchFile(t,n)};return Ep.lang.attempt(s),()=>Ep.lang.attempt(a)}async watchUnknownChild(t,r,n){if(this.isClosed())return;let i=()=>this.watchPath(t,r,n);return this.watchFileOnce(t,r,i)}async watchUnknownTarget(t,r,n){if(this.isClosed())return;let i=()=>this.watchPath(t,r,n);return this.watchPollingOnce(t,r,i)}async watchPaths(t,r,n){if(this.isClosed())return;if(t=Ep.lang.uniq(t).sort(),t.every((o,s)=>t.every((a,c)=>c===s||!Ep.fs.isSubPath(o,a))))await Promise.all(t.map(o=>this.watchPath(o,r,n)));else for(let o of t)await this.watchPath(o,r,n)}async watchPath(t,r,n){if(this.isClosed()||(t=HUe.default.resolve(t),this.isIgnored(t,r.ignore)))return;let i=await Ep.fs.poll(t,r.pollingTimeout);if(i){if(i.isFile())return this.watchFile(t,r,n);if(i.isDirectory())return this.watchDirectory(t,r,n);this.error(`"${t}" is not supported`)}else{let o=HUe.default.dirname(t);return(await Ep.fs.poll(o,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,n):this.watchUnknownTarget(t,r,n)}}async watch(t,r,n=Ep.lang.noop){if(Ep.lang.isFunction(t))return this.watch([],{},t);if(Ep.lang.isUndefined(t))return this.watch([],r,n);if(Ep.lang.isFunction(r))return this.watch(t,{},r);if(Ep.lang.isUndefined(r))return this.watch(t,{},n);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let i=Ep.lang.castArray(t);i.forEach(o=>this._roots.add(o)),await this.watchPaths(i,r,n),!this.isClosed()&&(n!==Ep.lang.noop&&this.on(NN.ALL,n),r.readdirMap=void 0,this.ready())}},Ayu=l8o;function a3m(e){return"code"in e&&typeof e.code=="string"}function yyu(e){return e instanceof Error?e:new Error(String(e))}function byu(e){return a3m(e)&&e.code==="ENOSPC"?"Unable to watch Fern docs files for changes because the system limit for file watchers was reached. Close other file-watching processes or increase the file watcher limit, then restart `fern docs dev`.":`Unable to watch Fern docs files for changes: ${e.message}`}async function qti({absoluteFilePathToFern:e,additionalFilepaths:t,context:r}){let n=new Ayu([e,...t],{recursive:!0,ignoreInitial:!0,debounce:100,renameDetection:!0}),i=await new Promise(o=>{let s=()=>{n.off("error",a),o(void 0)},a=c=>{n.off("ready",s),o(yyu(c))};n.once("ready",s),n.once("error",a)});return i!=null&&(n.close(),r.failAndThrow(byu(i),i,{code:D.Code.EnvironmentError})),n.on("error",o=>{let s=yyu(o);r.failWithoutThrowing(byu(s),s,{code:D.Code.EnvironmentError}),n.close()}),n}tr();aS();_t();var vCu=require("child_process"),nni=we(b8o(),1),ICu=we(R7o(),1),Iv=require("fs"),LN=require("fs/promises"),CCu=require("os"),MN=we(require("path"),1),wCu=we(fw(),1),xCu=we(ECu(),1),r_e=process.platform==="win32",rni=Ae.cyan("[docs]:"),Q_m="etag",M_m=23,V7o=e=>e.padEnd(M_m," "),L_m="preview",z_m="app-preview",U_m="bundle",__m=".next",V_m="standalone",q_m=".fern",G_m="packages/fern-docs/bundle/.next/server/instrumentation.js",W_m='Cannot find matching keyid: {"signatures":',H_m="ERR_PNPM_IGNORED_BUILDS";function K_m(e){try{let r=(0,vCu.execSync)('reg query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem" /v LongPathsEnabled',{encoding:"utf-8",timeout:5e3}).match(/LongPathsEnabled\s+REG_DWORD\s+0x(\d+)/i);if(r!=null&&r[1]==="1")return}catch(t){e.debug(`Registry query for LongPathsEnabled failed: ${t}`)}throw new D({message:`Windows long path support is not enabled. The docs bundle contains deeply nested .pnpm paths that exceed the 260-character MAX_PATH limit.
|
|
3818
3818
|
|
|
@@ -4378,7 +4378,7 @@ Please ensure you have membership at https://dashboard.buildwithfern.com, and as
|
|
|
4378
4378
|
|
|
4379
4379
|
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`:r}function TAh(e,t,r){return t!=null&&t.includes("Invalid authorization token")?`Your authentication token is invalid or expired. Please run '${r}' to re-authenticate.`:`You are not authorized to publish docs under organization '${e}'. Please run '${r}' to ensure you are logged in with the correct account.
|
|
4380
4380
|
|
|
4381
|
-
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`}function BAh(e){if(e==null)return{code:void 0,message:void 0};let t=e.body;if(t!=null&&typeof t=="object"){let n=typeof t.code=="string"?t.code:void 0,i=typeof t.message=="string"?t.message:void 0;return{code:n,message:i}}return{code:void 0,message:typeof t=="string"&&t.length>0?t:typeof e.errorMessage=="string"?e.errorMessage:typeof e.message=="string"?e.message:void 0}}function OAh(e){try{return new URL(TN(e)).pathname}catch{return}}async function PAh({fdr:e,workspace:t,organization:r,context:n,snippetsConfig:i}){if(!t)return;let o=await DAh({fdr:e,workspace:t,snippetsConfig:i,context:n});if(Object.keys(o).length===0){n.logger.debug("[SDK Dynamic IR] No snippet configs found, skipping S3 check");return}try{let s=Object.fromEntries(Object.entries(o).map(([l,p])=>[l,{packageName:p.packageName,version:p.version}])),c=(await e.api.register.checkSdkDynamicIrExists({orgId:mn.OrgId(r),snippetConfiguration:s})).existingDynamicIrs??{};if(Object.keys(c).length===0){n.logger.debug("[SDK Dynamic IR] No existing SDK dynamic IRs found in S3");return}let u={};for(let[l,p]of Object.entries(c??{}))try{n.logger.debug(`Downloading existing SDK dynamic IR for ${l}...`);let d=await fetch(p.downloadUrl);if(d.ok){let f=await d.json();u[l]={dynamicIR:f},n.logger.debug(`Successfully downloaded SDK dynamic IR for ${l}`)}else n.logger.warn(`Failed to download SDK dynamic IR for ${l}: ${d.status}`)}catch(d){n.logger.warn(`Error downloading SDK dynamic IR for ${l}: ${d}`)}return Object.keys(u).length>0?u:void 0}catch(s){n.logger.debug(`Error checking for existing SDK dynamic IRs: ${s}`);return}}function Yes(e){return e.replace(/^https:\/\//,"")}async function DAh({fdr:e,workspace:t,snippetsConfig:r,context:n}){let i={},o=[{language:"typescript",snippetName:r.typescriptSdk?.package??void 0,explicitVersion:r.typescriptSdk?.version??void 0},{language:"python",snippetName:r.pythonSdk?.package??void 0,explicitVersion:r.pythonSdk?.version??void 0},{language:"java",snippetName:r.javaSdk?.coordinate??void 0,explicitVersion:r.javaSdk?.version??void 0},{language:"go",snippetName:r.goSdk?.githubRepo&&Yes(r.goSdk?.githubRepo),explicitVersion:r.goSdk?.version??void 0},{language:"csharp",snippetName:r.csharpSdk?.package??void 0,explicitVersion:r.csharpSdk?.version??void 0},{language:"ruby",snippetName:r.rubySdk?.gem??void 0,explicitVersion:r.rubySdk?.version??void 0},{language:"php",snippetName:r.phpSdk?.package??void 0,explicitVersion:r.phpSdk?.version??void 0},{language:"swift",snippetName:r.swiftSdk?.package??void 0,explicitVersion:r.swiftSdk?.version??void 0},{language:"rust",snippetName:r.rustSdk?.package??void 0,explicitVersion:r.rustSdk?.version??void 0}];for(let s of o){if(!s.snippetName)continue;let a=s.explicitVersion??void 0;a||(a=(await RAh({fdr:e,workspace:t,language:s.language,snippetName:s.snippetName,context:n}))?.version),i[s.language]={packageName:s.snippetName,version:a},a||n.logger.debug(`[SDK Dynamic IR] ${s.language}: no version specified, will use latest`)}return i}async function RAh({fdr:e,workspace:t,language:r,snippetName:n,context:i}){let o;switch(r){case"csharp":o="Csharp";break;case"go":o="Go";break;case"java":o="Java";break;case"python":o="Python";break;case"ruby":o="Ruby";break;case"typescript":o="TypeScript";break;case"php":o="Php";break;case"swift":o="Swift";break;default:return}let s,a,c;if(t.generatorsConfiguration?.groups){let u=[];for(let l of t.generatorsConfiguration.groups)for(let p of l.generators)if(p.language===r){let d=Un.getPackageName({generatorInvocation:p});d&&u.push(d),!a&&d&&(a=d,c=p.name,p.outputMode.type==="githubV2"&&(s=`${p.outputMode.githubV2.owner}/${p.outputMode.githubV2.repo}`))}}if(!a){i.logger.debug(`[SDK Dynamic IR] ${r}: no generator found with a package name`);return}try{let u=await e.sdks.computeSemanticVersion({githubRepository:s,language:o,package:a});return i.logger.debug(`[SDK Dynamic IR] ${r}: computed version ${u.version} for package "${a}"`),{version:u.version,generatorPackage:a}}catch(u){i.logger.debug(`[SDK Dynamic IR] ${r}: error computing version: ${u}`);return}}async function FAh({workspace:e,organization:t,context:r,snippetsConfig:n,skipLanguages:i=new Set}){let o={};if(!e)return;let s={typescript:n.typescriptSdk?.package,python:n.pythonSdk?.package,java:n.javaSdk?.coordinate,go:n.goSdk?.githubRepo&&Yes(n.goSdk?.githubRepo),csharp:n.csharpSdk?.package,ruby:n.rubySdk?.gem,php:n.phpSdk?.package,swift:n.swiftSdk?.package,rust:n.rustSdk?.package};if(e.generatorsConfiguration?.groups)for(let a of e.generatorsConfiguration.groups)for(let c of a.generators){let u=fVe({apiName:e.workspaceName??"",organization:t,generatorInvocation:c}),l="";if(u?.outputConfig.type==="publish")switch(u.outputConfig.value.type){case"npm":case"nuget":case"pypi":case"rubygems":l=u.outputConfig.value.packageName;break;case"maven":l=u.outputConfig.value.coordinate;break;case"go":l=u.outputConfig.value.repoUrl;break;case"swift":l=u.outputConfig.value.repoUrl;break;case"crates":l=u.outputConfig.value.packageName;break}if(c.language==="php"&&c.config&&typeof c.config=="object"&&"packageName"in c.config&&(l=c.config.packageName??""),c.language==="go"&&l&&(l=Yes(l)),!!c.language){if(i.has(c.language)){r.logger.debug(`Skipping dynamic IR generation for ${c.language} (using existing SDK dynamic IR)`);continue}if(c.language&&s[c.language]===l){let p=iA({workspace:e,generationLanguage:c.language,keywords:void 0,smartCasing:c.smartCasing,exampleGeneration:{disabled:!0,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},audiences:{type:"all"},readme:void 0,packageName:l,version:void 0,context:r,sourceResolver:new Yh(r,e),dynamicGeneratorConfig:u}),d=vLe({ir:p,disableExamples:!0,smartCasing:c.smartCasing,generationLanguage:c.language,generatorConfig:u});d?o[c.language]={dynamicIR:d}:r.logger.debug(`Failed to create dynamic IR for ${c.language}`)}}}for(let[a,c]of Object.entries(s))a&&c&&!Object.keys(o).includes(a)&&!i.has(a)&&(r.logger.warn(),r.logger.warn(`Failed to upload ${a} SDK snippets because of unknown package \`${c}\`.`),r.logger.warn(`Please make sure your ${e.workspaceName?`${e.workspaceName}/`:""}generators.yml has a generator that publishes a ${c} package.`),r.logger.warn());if(Object.keys(o).length>0)return o}async function kAh({dynamicIRs:e,dynamicIRUploadUrls:t,context:r,apiId:n}){if(Object.keys(t).length>0)for(let[i,o]of Object.entries(t)){let s=e[i]?.dynamicIR;if(s){let a=JSON.stringify(s);try{(await fetch(o.uploadUrl,{method:"PUT",body:a,headers:{"Content-Type":"application/octet-stream","Content-Length":Buffer.byteLength(a,"utf8").toString()}})).ok?r.logger.debug(`Uploaded dynamic IR for ${n}:${i}`):r.logger.warn(`Failed to upload dynamic IR for ${n}:${i}`)}catch(c){r.logger.warn(`Network error uploading dynamic IR for ${n}:${i}: ${c}`)}}else r.logger.warn(`Could not find matching dynamic IR to upload for ${n}:${i}`)}}async function NAh({docsDefinition:e,isPreview:t,context:r}){e.config.aiChatConfig==null||t||r.logger.warn(Ae.yellow("Enabling Ask Fern from docs.yml is deprecated. Please enable it from the Fern dashboard instead."))}function jAh(e,t){if(e)return{enabled:!0,model:process.env.FERN_AI_MODEL||"gpt-4o-mini",maxRetries:parseInt(process.env.FERN_AI_MAX_RETRIES||"3"),requestTimeoutMs:parseInt(process.env.FERN_AI_TIMEOUT_MS||"25000"),styleInstructions:t}}function sUu(e){let t=e,r=t?.content;return{errorType:t?.error,statusCode:t?.statusCode??r?.statusCode,reason:r?.reason,errorMessage:r?.errorMessage??r?.message,body:r?.body,cause:r?.cause,rawError:e}}var ZHt=[60*1e3,300*1e3,300*1e3];async function $Ht({organization:e,apiWorkspaces:t,ossWorkspaces:r,docsWorkspace:n,context:i,token:o,instanceUrl:s,preview:a,previewId:c,disableTemplates:u,skipUpload:l,cliVersion:p,ciSource:d,deployerAuthor:f,loginCommand:m}){let h=a&&!n.config.settings?.substituteEnvVars;n.config=Dy(n.config,{onError:x=>i.failAndThrow(void 0,x,{code:D.Code.EnvironmentError})},{substituteAsEmpty:h});let A=n.config.instances;if(A.length===0){i.failAndThrow("No instances specified in docs.yml! Cannot register docs.",void 0,{code:D.Code.ConfigError});return}if(A.length>1&&s==null){i.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${A[0]?.url})`,void 0,{code:D.Code.ConfigError});return}let y=A.find(x=>x.url===s)??A[0];if(y==null){i.failAndThrow(`No docs instance with url ${s}. Failed to register.`,void 0,{code:D.Code.ConfigError});return}let I=(typeof y.customDomain=="string"?[y.customDomain]:y.customDomain??[]).map(s4u);(y.multiSource===!0||n.config.experimental?.basepathAware===!0)&&a4u(y.url,I,i),i.logger.info(`Starting docs publishing for ${a?"preview":"production"}: ${y.url}`),i.logger.debug(`Organization: ${e}, Preview: ${a}, APIs: ${t.length}, OSS: ${r.length}`);let C;return await i.runInteractiveTask({name:y.url},async()=>{let x=performance.now(),T=()=>nUu({docsWorkspace:n,customDomains:I,domain:y.url,token:o,organization:e,context:i,apiWorkspaces:t,ossWorkspaces:r,preview:a,previewId:c,editThisPage:y.editThisPage,disableTemplates:u,skipUpload:l,withAiExamples:n.config.aiExamples?.enabled??n.config.experimental?.aiExamples??!0,excludeApis:n.config.experimental?.excludeApis??!1,targetAudiences:y.audiences?Array.isArray(y.audiences)?y.audiences:[y.audiences]:void 0,docsUrl:y.url,cliVersion:p,ciSource:d,deployerAuthor:f,loginCommand:m,multiSource:y.multiSource??!1});for(let R=0;;R++)try{C=await T();break}catch(P){if(!(P instanceof iwt)||R>=ZHt.length){if(P instanceof iwt)return i.failAndThrow("Another docs publish is currently in progress. Please try again once the other publish is complete.",void 0,{code:D.Code.NetworkError});throw P}let U=ZHt[R]??ZHt[ZHt.length-1]??6e4,X=U/6e4;i.logger.warn(`Another docs publish is in progress. Retrying in ${X} minute${X===1?"":"s"} (attempt ${R+1}/${ZHt.length})...`),await new Promise($=>setTimeout($,U))}let O=performance.now()-x;i.logger.debug(`Docs publishing completed in ${O.toFixed(0)}ms`)}),C}_t();var Ipi=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 Cd({context:this.context,task:this.task});try{let s=await $Ht({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.44.4",loginCommand:"fern auth login"});return o.getResult()===Uf.Failure?{success:!1}:{success:!0,url:s}}catch(s){return{success:!1,error:qn(s)}}}};jt();var owt=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(`
|
|
4381
|
+
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`}function BAh(e){if(e==null)return{code:void 0,message:void 0};let t=e.body;if(t!=null&&typeof t=="object"){let n=typeof t.code=="string"?t.code:void 0,i=typeof t.message=="string"?t.message:void 0;return{code:n,message:i}}return{code:void 0,message:typeof t=="string"&&t.length>0?t:typeof e.errorMessage=="string"?e.errorMessage:typeof e.message=="string"?e.message:void 0}}function OAh(e){try{return new URL(TN(e)).pathname}catch{return}}async function PAh({fdr:e,workspace:t,organization:r,context:n,snippetsConfig:i}){if(!t)return;let o=await DAh({fdr:e,workspace:t,snippetsConfig:i,context:n});if(Object.keys(o).length===0){n.logger.debug("[SDK Dynamic IR] No snippet configs found, skipping S3 check");return}try{let s=Object.fromEntries(Object.entries(o).map(([l,p])=>[l,{packageName:p.packageName,version:p.version}])),c=(await e.api.register.checkSdkDynamicIrExists({orgId:mn.OrgId(r),snippetConfiguration:s})).existingDynamicIrs??{};if(Object.keys(c).length===0){n.logger.debug("[SDK Dynamic IR] No existing SDK dynamic IRs found in S3");return}let u={};for(let[l,p]of Object.entries(c??{}))try{n.logger.debug(`Downloading existing SDK dynamic IR for ${l}...`);let d=await fetch(p.downloadUrl);if(d.ok){let f=await d.json();u[l]={dynamicIR:f},n.logger.debug(`Successfully downloaded SDK dynamic IR for ${l}`)}else n.logger.warn(`Failed to download SDK dynamic IR for ${l}: ${d.status}`)}catch(d){n.logger.warn(`Error downloading SDK dynamic IR for ${l}: ${d}`)}return Object.keys(u).length>0?u:void 0}catch(s){n.logger.debug(`Error checking for existing SDK dynamic IRs: ${s}`);return}}function Yes(e){return e.replace(/^https:\/\//,"")}async function DAh({fdr:e,workspace:t,snippetsConfig:r,context:n}){let i={},o=[{language:"typescript",snippetName:r.typescriptSdk?.package??void 0,explicitVersion:r.typescriptSdk?.version??void 0},{language:"python",snippetName:r.pythonSdk?.package??void 0,explicitVersion:r.pythonSdk?.version??void 0},{language:"java",snippetName:r.javaSdk?.coordinate??void 0,explicitVersion:r.javaSdk?.version??void 0},{language:"go",snippetName:r.goSdk?.githubRepo&&Yes(r.goSdk?.githubRepo),explicitVersion:r.goSdk?.version??void 0},{language:"csharp",snippetName:r.csharpSdk?.package??void 0,explicitVersion:r.csharpSdk?.version??void 0},{language:"ruby",snippetName:r.rubySdk?.gem??void 0,explicitVersion:r.rubySdk?.version??void 0},{language:"php",snippetName:r.phpSdk?.package??void 0,explicitVersion:r.phpSdk?.version??void 0},{language:"swift",snippetName:r.swiftSdk?.package??void 0,explicitVersion:r.swiftSdk?.version??void 0},{language:"rust",snippetName:r.rustSdk?.package??void 0,explicitVersion:r.rustSdk?.version??void 0}];for(let s of o){if(!s.snippetName)continue;let a=s.explicitVersion??void 0;a||(a=(await RAh({fdr:e,workspace:t,language:s.language,snippetName:s.snippetName,context:n}))?.version),i[s.language]={packageName:s.snippetName,version:a},a||n.logger.debug(`[SDK Dynamic IR] ${s.language}: no version specified, will use latest`)}return i}async function RAh({fdr:e,workspace:t,language:r,snippetName:n,context:i}){let o;switch(r){case"csharp":o="Csharp";break;case"go":o="Go";break;case"java":o="Java";break;case"python":o="Python";break;case"ruby":o="Ruby";break;case"typescript":o="TypeScript";break;case"php":o="Php";break;case"swift":o="Swift";break;default:return}let s,a,c;if(t.generatorsConfiguration?.groups){let u=[];for(let l of t.generatorsConfiguration.groups)for(let p of l.generators)if(p.language===r){let d=Un.getPackageName({generatorInvocation:p});d&&u.push(d),!a&&d&&(a=d,c=p.name,p.outputMode.type==="githubV2"&&(s=`${p.outputMode.githubV2.owner}/${p.outputMode.githubV2.repo}`))}}if(!a){i.logger.debug(`[SDK Dynamic IR] ${r}: no generator found with a package name`);return}try{let u=await e.sdks.computeSemanticVersion({githubRepository:s,language:o,package:a});return i.logger.debug(`[SDK Dynamic IR] ${r}: computed version ${u.version} for package "${a}"`),{version:u.version,generatorPackage:a}}catch(u){i.logger.debug(`[SDK Dynamic IR] ${r}: error computing version: ${u}`);return}}async function FAh({workspace:e,organization:t,context:r,snippetsConfig:n,skipLanguages:i=new Set}){let o={};if(!e)return;let s={typescript:n.typescriptSdk?.package,python:n.pythonSdk?.package,java:n.javaSdk?.coordinate,go:n.goSdk?.githubRepo&&Yes(n.goSdk?.githubRepo),csharp:n.csharpSdk?.package,ruby:n.rubySdk?.gem,php:n.phpSdk?.package,swift:n.swiftSdk?.package,rust:n.rustSdk?.package};if(e.generatorsConfiguration?.groups)for(let a of e.generatorsConfiguration.groups)for(let c of a.generators){let u=fVe({apiName:e.workspaceName??"",organization:t,generatorInvocation:c}),l="";if(u?.outputConfig.type==="publish")switch(u.outputConfig.value.type){case"npm":case"nuget":case"pypi":case"rubygems":l=u.outputConfig.value.packageName;break;case"maven":l=u.outputConfig.value.coordinate;break;case"go":l=u.outputConfig.value.repoUrl;break;case"swift":l=u.outputConfig.value.repoUrl;break;case"crates":l=u.outputConfig.value.packageName;break}if(c.language==="php"&&c.config&&typeof c.config=="object"&&"packageName"in c.config&&(l=c.config.packageName??""),c.language==="go"&&l&&(l=Yes(l)),!!c.language){if(i.has(c.language)){r.logger.debug(`Skipping dynamic IR generation for ${c.language} (using existing SDK dynamic IR)`);continue}if(c.language&&s[c.language]===l){let p=iA({workspace:e,generationLanguage:c.language,keywords:void 0,smartCasing:c.smartCasing,exampleGeneration:{disabled:!0,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},audiences:{type:"all"},readme:void 0,packageName:l,version:void 0,context:r,sourceResolver:new Yh(r,e),dynamicGeneratorConfig:u}),d=vLe({ir:p,disableExamples:!0,smartCasing:c.smartCasing,generationLanguage:c.language,generatorConfig:u});d?o[c.language]={dynamicIR:d}:r.logger.debug(`Failed to create dynamic IR for ${c.language}`)}}}for(let[a,c]of Object.entries(s))a&&c&&!Object.keys(o).includes(a)&&!i.has(a)&&(r.logger.warn(),r.logger.warn(`Failed to upload ${a} SDK snippets because of unknown package \`${c}\`.`),r.logger.warn(`Please make sure your ${e.workspaceName?`${e.workspaceName}/`:""}generators.yml has a generator that publishes a ${c} package.`),r.logger.warn());if(Object.keys(o).length>0)return o}async function kAh({dynamicIRs:e,dynamicIRUploadUrls:t,context:r,apiId:n}){if(Object.keys(t).length>0)for(let[i,o]of Object.entries(t)){let s=e[i]?.dynamicIR;if(s){let a=JSON.stringify(s);try{(await fetch(o.uploadUrl,{method:"PUT",body:a,headers:{"Content-Type":"application/octet-stream","Content-Length":Buffer.byteLength(a,"utf8").toString()}})).ok?r.logger.debug(`Uploaded dynamic IR for ${n}:${i}`):r.logger.warn(`Failed to upload dynamic IR for ${n}:${i}`)}catch(c){r.logger.warn(`Network error uploading dynamic IR for ${n}:${i}: ${c}`)}}else r.logger.warn(`Could not find matching dynamic IR to upload for ${n}:${i}`)}}async function NAh({docsDefinition:e,isPreview:t,context:r}){e.config.aiChatConfig==null||t||r.logger.warn(Ae.yellow("Enabling Ask Fern from docs.yml is deprecated. Please enable it from the Fern dashboard instead."))}function jAh(e,t){if(e)return{enabled:!0,model:process.env.FERN_AI_MODEL||"gpt-4o-mini",maxRetries:parseInt(process.env.FERN_AI_MAX_RETRIES||"3"),requestTimeoutMs:parseInt(process.env.FERN_AI_TIMEOUT_MS||"25000"),styleInstructions:t}}function sUu(e){let t=e,r=t?.content;return{errorType:t?.error,statusCode:t?.statusCode??r?.statusCode,reason:r?.reason,errorMessage:r?.errorMessage??r?.message,body:r?.body,cause:r?.cause,rawError:e}}var ZHt=[60*1e3,300*1e3,300*1e3];async function $Ht({organization:e,apiWorkspaces:t,ossWorkspaces:r,docsWorkspace:n,context:i,token:o,instanceUrl:s,preview:a,previewId:c,disableTemplates:u,skipUpload:l,cliVersion:p,ciSource:d,deployerAuthor:f,loginCommand:m}){let h=a&&!n.config.settings?.substituteEnvVars;n.config=Dy(n.config,{onError:x=>i.failAndThrow(void 0,x,{code:D.Code.EnvironmentError})},{substituteAsEmpty:h});let A=n.config.instances;if(A.length===0){i.failAndThrow("No instances specified in docs.yml! Cannot register docs.",void 0,{code:D.Code.ConfigError});return}if(A.length>1&&s==null){i.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${A[0]?.url})`,void 0,{code:D.Code.ConfigError});return}let y=A.find(x=>x.url===s)??A[0];if(y==null){i.failAndThrow(`No docs instance with url ${s}. Failed to register.`,void 0,{code:D.Code.ConfigError});return}let I=(typeof y.customDomain=="string"?[y.customDomain]:y.customDomain??[]).map(s4u);(y.multiSource===!0||n.config.experimental?.basepathAware===!0)&&a4u(y.url,I,i),i.logger.info(`Starting docs publishing for ${a?"preview":"production"}: ${y.url}`),i.logger.debug(`Organization: ${e}, Preview: ${a}, APIs: ${t.length}, OSS: ${r.length}`);let C;return await i.runInteractiveTask({name:y.url},async()=>{let x=performance.now(),T=()=>nUu({docsWorkspace:n,customDomains:I,domain:y.url,token:o,organization:e,context:i,apiWorkspaces:t,ossWorkspaces:r,preview:a,previewId:c,editThisPage:y.editThisPage,disableTemplates:u,skipUpload:l,withAiExamples:n.config.aiExamples?.enabled??n.config.experimental?.aiExamples??!0,excludeApis:n.config.experimental?.excludeApis??!1,targetAudiences:y.audiences?Array.isArray(y.audiences)?y.audiences:[y.audiences]:void 0,docsUrl:y.url,cliVersion:p,ciSource:d,deployerAuthor:f,loginCommand:m,multiSource:y.multiSource??!1});for(let R=0;;R++)try{C=await T();break}catch(P){if(!(P instanceof iwt)||R>=ZHt.length){if(P instanceof iwt)return i.failAndThrow("Another docs publish is currently in progress. Please try again once the other publish is complete.",void 0,{code:D.Code.NetworkError});throw P}let U=ZHt[R]??ZHt[ZHt.length-1]??6e4,X=U/6e4;i.logger.warn(`Another docs publish is in progress. Retrying in ${X} minute${X===1?"":"s"} (attempt ${R+1}/${ZHt.length})...`),await new Promise($=>setTimeout($,U))}let O=performance.now()-x;i.logger.debug(`Docs publishing completed in ${O.toFixed(0)}ms`)}),C}_t();var Ipi=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 Cd({context:this.context,task:this.task});try{let s=await $Ht({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.44.6",loginCommand:"fern auth login"});return o.getResult()===Uf.Failure?{success:!1}:{success:!0,url:s}}catch(s){return{success:!1,error:qn(s)}}}};jt();var owt=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(`
|
|
4382
4382
|
`),this.stream.write(`${Ae.cyan("\u25C6")} ${Ae.bold(t.title)}
|
|
4383
4383
|
`),t.subtitle!=null&&this.stream.write(` ${Ae.dim(t.subtitle)}
|
|
4384
4384
|
`),this.stream.write(`
|
|
@@ -4615,7 +4615,7 @@ Exclude patterns: ${i.excludePatterns.join(", ")}`)}catch(i){throw i instanceof
|
|
|
4615
4615
|
|
|
4616
4616
|
Please specify a local path (e.g. ./sdks/my-sdk) or a git URL:
|
|
4617
4617
|
https://github.com/owner/repo`,code:D.Code.ConfigError});return{path:t}}async resolveStableVersion({context:t,language:r}){let n=GGr[r];try{return await M1({generatorName:n,cliVersion:"*",channel:void 0})??void 0}catch{return t.stderr.info(Ae.dim(` Failed to resolve latest stable version for ${r}; using "latest".`)),"latest"}}checkForDuplicate({existingTargets:t,language:r}){if(t.some(n=>n.name===r))throw new D({message:`Target '${r}' already exists in ${d0}.`,code:D.Code.ConfigError})}async addTarget({fernYmlPath:t,language:r,output:n,version:i,group:o}){let s=await h6.load({fernYmlPath:t}),a={output:this.buildOutputForYaml(n)};i!=null&&(a.version=i),o!=null&&(a.group=[o]),await s.addTarget(r,a),await s.save()}buildOutputForYaml(t){if(typeof t=="string")return t;if(t.git!=null){let r=t.git;if(gy.isGitOutputGitHubRepository(r)){let n={repository:r.repository};return r.mode!=null&&(n.mode=r.mode),{git:n}}if(gy.isGitOutputSelfHosted(r)){let n={uri:r.uri,token:r.token};return r.mode!=null&&(n.mode=r.mode),{git:n}}}return t.path??""}parseLanguage(t){let r=t;if(vz.includes(r))return r;throw new D({message:`"${t}" is not a supported language. Supported: ${vz.join(", ")}`,code:D.Code.ConfigError})}};function Pgs(e){let t=new Ogs;ai(e,"add","Add a new SDK target to fern.yml",(r,n)=>t.handle(r,n),r=>r.option("target",{type:"string",description:"The SDK language to add (e.g. typescript, python, go)"}).option("stable",{type:"boolean",default:!1,description:"Pin the latest stable version from the Fern registry"}).option("output",{type:"string",description:"Output path or git URL (e.g. ./sdks/go)"}).option("group",{type:"string",description:"Add the target to a specific group"}).option("yes",{type:"boolean",description:"Accept all defaults (non-interactive mode)",default:!1}))}_t();var Dgs=class{async handle(t,r){let n=await t.loadWorkspaceOrThrow(),o=await new G7({context:t}).check({workspace:n}),s=o.errorCount>0||r.strict&&o.warningCount>0;if(r.json){let c=this.buildJsonResponse({sdkCheckResult:o,hasErrors:s});if(t.stdout.info(JSON.stringify(c,null,2)),s)throw new D({code:D.Code.ValidationError});return}if(o.violations.length>0)for(let c of o.violations){let u=c.severity==="warning"?Ae.yellow:Ae.red;process.stderr.write(`${u(`${c.displayRelativeFilepath}:${c.line}:${c.column}: ${c.message}`)}
|
|
4618
|
-
`)}let a=0;if(r.fix&&o.violations.length>0&&(a=(await new nEt({context:t}).fix({workspace:n,violations:o.violations})).fixedCount),s&&(!r.fix||a===0))throw new D({code:D.Code.ValidationError});if(o.warningCount>0){t.stderr.info(`${Nr.warning} ${Ae.yellow(`Found ${o.warningCount} warnings`)}`),t.stderr.info(Ae.dim(" Run 'fern sdk check --strict' to treat warnings as errors"));return}t.stderr.info(`${Nr.success} ${Ae.green("All checks passed")}`)}buildJsonResponse({sdkCheckResult:t,hasErrors:r}){let n={};return t.violations.length>0&&(n.sdks=t.violations.map(i=>Cee(i))),{success:!r,results:n}}};function Rgs(e){let t=new Dgs;ai(e,"check","Validate SDK configuration",(r,n)=>t.handle(r,n),r=>r.option("strict",{type:"boolean",description:"Treat warnings as errors",default:!1}).option("json",{type:"boolean",description:"Output results as JSON to stdout",default:!1}).option("fix",{type:"boolean",description:"Automatically fix issues that have a known resolution",default:!1}))}jt();tr();_t();var Cel=require("fs/promises");ks();tr();_t();var BRe=require("fs/promises"),Fgs=require("os"),YKt=we(require("path"),1);_t();ks();var rHh=["openapi","asyncapi"],nHh=[".graphql",".graphqls",".gql"],Mdi=class{async detect({absoluteFilePath:t,reference:r,content:n}){if(this.hasGraphQlExtension(t)||this.hasGraphQlExtension(r))return"graphql";let i=this.parseOrThrow({content:n,reference:r});if(typeof i!="object"||i==null)throw new D({message:`Could not determine API type for "${r}". File must contain a top-level "openapi" or "asyncapi" key.`,code:D.Code.InternalError});for(let o of rHh)if(o in i)return o;throw new D({message:`Could not determine API type for "${r}". File must contain a top-level "openapi" or "asyncapi" key.`,code:D.Code.InternalError})}hasGraphQlExtension(t){let r=t.toLowerCase();return nHh.some(n=>r.endsWith(n))}parseOrThrow({content:t,reference:r}){try{return wr.load(t)}catch{throw new D({message:`Could not parse "${r}" as YAML or JSON. Ensure the file is a valid OpenAPI or AsyncAPI specification.`,code:D.Code.ParseError})}}};var XKt=class{context;detector;constructor({context:t}){this.context=t,this.detector=new Mdi}async resolve(t){return C7(t.reference)?this.resolveStdin({stdin:t.stdin}):this.isUrl(t.reference)?this.resolveUrl(t):this.resolveLocal(t)}async resolveStdin({stdin:t}){let r=await HXc(v6o,{stdin:t});if(r.trim().length===0)throw new D({message:'No input received on stdin (--api "-").',code:D.Code.ConfigError});let n=this.inferExtensionFromContent(r),i=await(0,BRe.mkdtemp)(YKt.default.join((0,Fgs.tmpdir)(),"fern-")),o=Ht.of(YKt.default.join(i,`spec${n}`));await(0,BRe.writeFile)(o,r,"utf-8");let s=await this.detector.detect({absoluteFilePath:o,content:r,reference:"stdin"});return{absoluteFilePath:o,reference:"stdin",spec:this.buildApiSpec({absoluteFilePath:o,specType:s,origin:"stdin"})}}inferExtensionFromContent(t){let n=t.trimStart()[0];return n==="{"||n==="["?".json":".yaml"}async resolveUrl({reference:t}){let{content:r,contentType:n}=await this.fetchContent({url:t}),i=this.inferExtension({url:t,contentType:n}),o=await(0,BRe.mkdtemp)(YKt.default.join((0,Fgs.tmpdir)(),"fern-")),s=Ht.of(YKt.default.join(o,`spec${i}`));await(0,BRe.writeFile)(s,r,"utf-8");let a=await this.detector.detect({absoluteFilePath:s,content:r,reference:t});return{absoluteFilePath:s,reference:t,spec:this.buildApiSpec({absoluteFilePath:s,specType:a,origin:t})}}async resolveLocal({reference:t}){let r=Ni(this.context.cwd,t);if(!await sr(r))throw new D({message:`API spec file does not exist: ${t}`,code:D.Code.ConfigError});let n=await(0,BRe.readFile)(r,"utf-8"),i=await this.detector.detect({absoluteFilePath:r,content:n,reference:t});return{absoluteFilePath:r,reference:t,spec:this.buildApiSpec({absoluteFilePath:r,specType:i})}}async fetchContent({url:t}){let r=await fetch(t,{signal:AbortSignal.timeout(3e4)});if(!r.ok)throw new D({message:`Failed to fetch "${t}": HTTP ${r.status} ${r.statusText}`,code:D.Code.NetworkError});let n=r.headers.get("content-type")??"";if(n.includes("text/html"))throw new D({message:`The URL "${t}" returned HTML content. Ensure you're pointing to a raw spec URL, not a documentation page.`,code:D.Code.ConfigError});return{content:await r.text(),contentType:n}}inferExtension({url:t,contentType:r}){let n=new URL(t).pathname.toLowerCase();return n.endsWith(".graphql")||n.endsWith(".graphqls")||n.endsWith(".gql")?".graphql":n.endsWith(".json")?".json":n.endsWith(".yaml")||n.endsWith(".yml")?".yaml":r.includes("json")?".json":".yaml"}buildApiSpec({absoluteFilePath:t,specType:r,origin:n}){switch(r){case"openapi":return{openapi:t,origin:n};case"asyncapi":return{asyncapi:t,origin:n};case"graphql":return{graphql:t,origin:n};default:throw new D({message:`Unsupported spec type for flags mode: "${r}". Supported: openapi, asyncapi, graphql`,code:D.Code.ConfigError})}}isUrl(t){return t.startsWith("https://")||t.startsWith("http://")}};jt();_t();jt();tr();ves();_t();var yhe=we(require("path"),1),ORe="/fern",kgs="output",Ngs="config.json",jgs="ir.json",iHh="snippet.json",oHh="snippet-templates.json",sHh="generators",aHh="sources",Qgs="specs",a5e="specs-manifest.json",cHh=yhe.default.join(ORe,kgs),uHh=yhe.default.join(ORe,Ngs),lHh=yhe.default.join(ORe,jgs),pHh=yhe.default.join(ORe,iHh),fHh=yhe.default.join(ORe,oHh),p7S=yhe.default.join(ORe,sHh),dHh=yhe.default.join(ORe,aHh);var Ldi=cHh,ZKt=uHh,zdi=lHh,Udi=pHh,_di=fHh;var Mgs=dHh,mHh=yhe.default.join(ORe,Qgs),Lgs=mHh,Vdi="9229",hHh=new Set(["fernapi/fern-cli"]);function $Kt(e){return hHh.has(e)}var c5e=class{usesContainerPaths=!0;containerImage;keepContainer;runner;disableTelemetry;constructor({containerImage:t,keepContainer:r,runner:n,disableTelemetry:i,dockerImage:o,keepDocker:s}){this.containerImage=t??o??"",this.keepContainer=r??s??!1,this.runner=n,this.disableTelemetry=i??!1}async execute({generatorName:t,irPath:r,configPath:n,outputPath:i,snippetPath:o,snippetTemplatePath:s,licenseFilePath:a,sourceMounts:c,context:u,inspect:l,runner:p}){u.logger.info(`Executing generator ${t} using container image: ${this.containerImage}`);let d=[`${n}:${ZKt}:ro`,`${r}:${zdi}:ro`,`${i}:${Ldi}`];o&&d.push(`${o}:${Udi}`),s&&d.push(`${s}:${_di}`),a&&d.push(`${a}:/tmp/LICENSE:ro`);for(let h of c??[])d.push(`${h.hostPath}:${h.containerPath}:ro`);let f={},m={};l&&(f.NODE_OPTIONS=`--inspect-brk=0.0.0.0:${Vdi}`,m[Vdi]=Vdi),this.disableTelemetry&&(f.FERN_DISABLE_TELEMETRY="true");try{await HHt({logger:u.logger,imageName:this.containerImage,args:[ZKt],binds:d,envVars:f,ports:m,removeAfterCompletion:!this.keepContainer,runner:this.runner??p})}catch(h){throw h instanceof D?h:new D({message:`Container execution failed: ${h instanceof Error?h.message:String(h)}`,code:D.Code.ContainerError})}}};tr();var bel=we(Mli(),1);_t();_t();function NGu(e,t){if(e.success)return;let r=e.steps.verify,n=e.errors??[],i;throw r?.stderr!=null&&r.stderr.length>0?i=r.stderr:n.length>0?i=n.join(`
|
|
4618
|
+
`)}let a=0;if(r.fix&&o.violations.length>0&&(a=(await new nEt({context:t}).fix({workspace:n,violations:o.violations})).fixedCount),s&&(!r.fix||a===0))throw new D({code:D.Code.ValidationError});if(o.warningCount>0){t.stderr.info(`${Nr.warning} ${Ae.yellow(`Found ${o.warningCount} warnings`)}`),t.stderr.info(Ae.dim(" Run 'fern sdk check --strict' to treat warnings as errors"));return}t.stderr.info(`${Nr.success} ${Ae.green("All checks passed")}`)}buildJsonResponse({sdkCheckResult:t,hasErrors:r}){let n={};return t.violations.length>0&&(n.sdks=t.violations.map(i=>Cee(i))),{success:!r,results:n}}};function Rgs(e){let t=new Dgs;ai(e,"check","Validate SDK configuration",(r,n)=>t.handle(r,n),r=>r.option("strict",{type:"boolean",description:"Treat warnings as errors",default:!1}).option("json",{type:"boolean",description:"Output results as JSON to stdout",default:!1}).option("fix",{type:"boolean",description:"Automatically fix issues that have a known resolution",default:!1}))}jt();tr();_t();var Cel=require("fs/promises");ks();tr();_t();var BRe=require("fs/promises"),Fgs=require("os"),YKt=we(require("path"),1);_t();ks();var rHh=["openapi","asyncapi"],nHh=[".graphql",".graphqls",".gql"],Mdi=class{async detect({absoluteFilePath:t,reference:r,content:n}){if(this.hasGraphQlExtension(t)||this.hasGraphQlExtension(r))return"graphql";let i=this.parseOrThrow({content:n,reference:r});if(typeof i!="object"||i==null)throw new D({message:`Could not determine API type for "${r}". File must contain a top-level "openapi" or "asyncapi" key.`,code:D.Code.InternalError});for(let o of rHh)if(o in i)return o;throw new D({message:`Could not determine API type for "${r}". File must contain a top-level "openapi" or "asyncapi" key.`,code:D.Code.InternalError})}hasGraphQlExtension(t){let r=t.toLowerCase();return nHh.some(n=>r.endsWith(n))}parseOrThrow({content:t,reference:r}){try{return wr.load(t)}catch{throw new D({message:`Could not parse "${r}" as YAML or JSON. Ensure the file is a valid OpenAPI or AsyncAPI specification.`,code:D.Code.ParseError})}}};var XKt=class{context;detector;constructor({context:t}){this.context=t,this.detector=new Mdi}async resolve(t){return C7(t.reference)?this.resolveStdin({stdin:t.stdin}):this.isUrl(t.reference)?this.resolveUrl(t):this.resolveLocal(t)}async resolveStdin({stdin:t}){let r=await HXc(v6o,{stdin:t});if(r.trim().length===0)throw new D({message:'No input received on stdin (--api "-").',code:D.Code.ConfigError});let n=this.inferExtensionFromContent(r),i=await(0,BRe.mkdtemp)(YKt.default.join((0,Fgs.tmpdir)(),"fern-")),o=Ht.of(YKt.default.join(i,`spec${n}`));await(0,BRe.writeFile)(o,r,"utf-8");let s=await this.detector.detect({absoluteFilePath:o,content:r,reference:"stdin"});return{absoluteFilePath:o,reference:"stdin",spec:this.buildApiSpec({absoluteFilePath:o,specType:s,origin:"stdin"})}}inferExtensionFromContent(t){let n=t.trimStart()[0];return n==="{"||n==="["?".json":".yaml"}async resolveUrl({reference:t}){let{content:r,contentType:n}=await this.fetchContent({url:t}),i=this.inferExtension({url:t,contentType:n}),o=await(0,BRe.mkdtemp)(YKt.default.join((0,Fgs.tmpdir)(),"fern-")),s=Ht.of(YKt.default.join(o,`spec${i}`));await(0,BRe.writeFile)(s,r,"utf-8");let a=await this.detector.detect({absoluteFilePath:s,content:r,reference:t});return{absoluteFilePath:s,reference:t,spec:this.buildApiSpec({absoluteFilePath:s,specType:a,origin:t})}}async resolveLocal({reference:t}){let r=Ni(this.context.cwd,t);if(!await sr(r))throw new D({message:`API spec file does not exist: ${t}`,code:D.Code.ConfigError});let n=await(0,BRe.readFile)(r,"utf-8"),i=await this.detector.detect({absoluteFilePath:r,content:n,reference:t});return{absoluteFilePath:r,reference:t,spec:this.buildApiSpec({absoluteFilePath:r,specType:i})}}async fetchContent({url:t}){let r=await fetch(t,{signal:AbortSignal.timeout(3e4)});if(!r.ok)throw new D({message:`Failed to fetch "${t}": HTTP ${r.status} ${r.statusText}`,code:D.Code.NetworkError});let n=r.headers.get("content-type")??"";if(n.includes("text/html"))throw new D({message:`The URL "${t}" returned HTML content. Ensure you're pointing to a raw spec URL, not a documentation page.`,code:D.Code.ConfigError});return{content:await r.text(),contentType:n}}inferExtension({url:t,contentType:r}){let n=new URL(t).pathname.toLowerCase();return n.endsWith(".graphql")||n.endsWith(".graphqls")||n.endsWith(".gql")?".graphql":n.endsWith(".json")?".json":n.endsWith(".yaml")||n.endsWith(".yml")?".yaml":r.includes("json")?".json":".yaml"}buildApiSpec({absoluteFilePath:t,specType:r,origin:n}){switch(r){case"openapi":return{openapi:t,origin:n};case"asyncapi":return{asyncapi:t,origin:n};case"graphql":return{graphql:t,origin:n};default:throw new D({message:`Unsupported spec type for flags mode: "${r}". Supported: openapi, asyncapi, graphql`,code:D.Code.ConfigError})}}isUrl(t){return t.startsWith("https://")||t.startsWith("http://")}};jt();_t();jt();tr();ves();_t();var yhe=we(require("path"),1),ORe="/fern",kgs="output",Ngs="config.json",jgs="ir.json",iHh="snippet.json",oHh="snippet-templates.json",sHh="generators",aHh="sources",Qgs="specs",a5e="specs-manifest.json",cHh=yhe.default.join(ORe,kgs),uHh=yhe.default.join(ORe,Ngs),lHh=yhe.default.join(ORe,jgs),pHh=yhe.default.join(ORe,iHh),fHh=yhe.default.join(ORe,oHh),p7S=yhe.default.join(ORe,sHh),dHh=yhe.default.join(ORe,aHh);var Ldi=cHh,ZKt=uHh,zdi=lHh,Udi=pHh,_di=fHh;var Mgs=dHh,mHh=yhe.default.join(ORe,Qgs),Lgs=mHh,Vdi="9229",hHh=new Set(["fernapi/fern-cli-generator"]);function $Kt(e){return hHh.has(e)}var c5e=class{usesContainerPaths=!0;containerImage;keepContainer;runner;disableTelemetry;constructor({containerImage:t,keepContainer:r,runner:n,disableTelemetry:i,dockerImage:o,keepDocker:s}){this.containerImage=t??o??"",this.keepContainer=r??s??!1,this.runner=n,this.disableTelemetry=i??!1}async execute({generatorName:t,irPath:r,configPath:n,outputPath:i,snippetPath:o,snippetTemplatePath:s,licenseFilePath:a,sourceMounts:c,context:u,inspect:l,runner:p}){u.logger.info(`Executing generator ${t} using container image: ${this.containerImage}`);let d=[`${n}:${ZKt}:ro`,`${r}:${zdi}:ro`,`${i}:${Ldi}`];o&&d.push(`${o}:${Udi}`),s&&d.push(`${s}:${_di}`),a&&d.push(`${a}:/tmp/LICENSE:ro`);for(let h of c??[])d.push(`${h.hostPath}:${h.containerPath}:ro`);let f={},m={};l&&(f.NODE_OPTIONS=`--inspect-brk=0.0.0.0:${Vdi}`,m[Vdi]=Vdi),this.disableTelemetry&&(f.FERN_DISABLE_TELEMETRY="true");try{await HHt({logger:u.logger,imageName:this.containerImage,args:[ZKt],binds:d,envVars:f,ports:m,removeAfterCompletion:!this.keepContainer,runner:this.runner??p})}catch(h){throw h instanceof D?h:new D({message:`Container execution failed: ${h instanceof Error?h.message:String(h)}`,code:D.Code.ContainerError})}}};tr();var bel=we(Mli(),1);_t();_t();function NGu(e,t){if(e.success)return;let r=e.steps.verify,n=e.errors??[],i;throw r?.stderr!=null&&r.stderr.length>0?i=r.stderr:n.length>0?i=n.join(`
|
|
4619
4619
|
`):r?.errorMessage!=null?i=r.errorMessage:i="verification pipeline failed",new D({message:`Verification failed for ${t}: ${i}`,code:D.Code.InternalError})}var IJt=process.env.FERN_STACK_TRACK?.toLowerCase()??"",IL=IJt!==""&&IJt!=="0"&&IJt!=="false",cys=["single","multiline","box"].includes(IJt)?IJt:"single";IL&&(Error.stackTraceLimit=50);var lXu=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),_tg=new Set(["stacktrace"]);function uys(e){IL&&lXu.add(e)}function CJt({maxFrames:e=50,skip:t=0,filterPaths:r=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,formatFilename:a=c=>c}={}){if(!IL)return[];n=[...n,...lXu],r=[...r,..._tg],i=[...i,"runInteractiveTask"];let c=!1;return(new Error().stack??"").split(`
|
|
4620
4620
|
`).map(u=>{let l=u.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(l&&l.length===5){let[,p,d,f,m]=l;if(!p||!d||!f||!m)return;if(c||i.some(h=>p?.includes(h))){c=!0;return}switch(p){case"Object.<anonymous>":p="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":p=`${p.substring(p.indexOf(".")+1)}()=> { ... }`;break}return{fn:p,path:a(d),position:`${f}:${m}`}}}).filter(u=>u&&!n.some(l=>u.fn.includes(l))&&!(o&&u.path?.startsWith("node:"))&&!(s&&u.path?.endsWith(".js"))&&!r.some(l=>u.path.includes(l))).slice(t,t+e)}function wJt({maxFrames:e=50,skip:t=0,filterPaths:r=[],filterFunctions:n=[],stopOn:i=["runInteractiveTask"],filterNode:o=!0,filterJs:s=!0,multiline:a=!1,formatFilename:c=u=>u}={}){return IL?`${CJt({maxFrames:e,skip:t,filterPaths:r,filterFunctions:n,stopOn:i,filterNode:o,filterJs:s,formatFilename:c}).map(u=>`${a?`
|
|
4621
4621
|
`:" > "}${u.fn} - ${u.path}:${u.position}`).join("")}`:""}var lhi=class{maxFrames;skip;filterPaths;filterFunctions;stopOn;filterNode;filterJs;multiline;formatFilename;tracking=new WeakMap;constructor({maxFrames:t=50,skip:r=0,filterPaths:n=[],filterFunctions:i=[],stopOn:o=[],filterNode:s=!0,filterJs:a=!0,multiline:c=!1,formatFilename:u=l=>l}={}){this.maxFrames=t,this.skip=r,this.filterPaths=n,this.filterFunctions=i,this.stopOn=o,this.filterNode=s,this.filterJs=a,this.multiline=c,this.formatFilename=u}tag(t){let r=this.tracking.get(t)||new Set;CJt({maxFrames:this.maxFrames,skip:this.skip,filterPaths:this.filterPaths,filterFunctions:this.filterFunctions,stopOn:this.stopOn,filterNode:this.filterNode,filterJs:this.filterJs,formatFilename:this.formatFilename}).forEach(n=>r.add(n)),this.tracking.set(t,r)}trace(t){if(!IL)return"";let r=this.tracking.get(t);return r?[...r].map(n=>`${this.multiline?`
|
|
@@ -5023,7 +5023,7 @@ ${r}`}function tyi(e){let t=this,{emitParseErrors:r,...n}={...t.data("settings")
|
|
|
5023
5023
|
`),h="";return c&&(h=l.style.error(c)),[`${p} ${f} ${s}`,[m,h].filter(Boolean).join(`
|
|
5024
5024
|
`)]});var Gfg=$C((e,t)=>{let{validate:r=()=>!0}=e,n=kv(e.theme),[i,o]=Iu("idle"),[s,a]=Iu(),[c,u]=Iu(""),l=XC({status:i,theme:n});ZC(async(h,A)=>{if(i==="idle")if(YC(h)){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]")}${E1t}`),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 p7e=we(pS(),1);var Wfg={icon:{cursor:_w.pointer},style:{disabled:e=>p7e.default.dim(`- ${e}`),searchTerm:e=>p7e.default.cyan(e),description:e=>p7e.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${p7e.default.bold(t)} ${p7e.default.dim(r)}`).join(p7e.default.dim(" \u2022 "))},helpMode:"always"};function yvs(e){return!Pd.isSeparator(e)&&!e.disabled}function Hfg(e){return e.map(t=>{if(Pd.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 Kfg=$C((e,t)=>{let{pageSize:r=7,validate:n=()=>!0}=e,i=kv(Wfg,e.theme),[o,s]=Iu("loading"),[a,c]=Iu(""),[u,l]=Iu([]),[p,d]=Iu(),f=XC({status:o,theme:i}),m=OL(()=>{let U=u.findIndex(yvs),X=u.findLastIndex(yvs);return{first:U,last:X}},[u]),[h=m.first,A]=Iu();x4(()=>{let U=new AbortController;return s("loading"),d(void 0),(async()=>{try{let $=await e.source(a||void 0,{signal:U.signal});U.signal.aborted||(A(void 0),d(void 0),l(Hfg($)),s("idle"))}catch($){!U.signal.aborted&&$ instanceof Error&&d($.message)}})(),()=>{U.abort()}},[a]);let y=u[h];ZC(async(U,X)=>{if(YC(U))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"):(X.write(y.name),c(y.name))}else X.write(a);else if(Zhe(U)&&y)X.clearLine(0),X.write(y.name),c(y.name);else if(o!=="loading"&&(OP(U)||BL(U))){if(X.clearLine(0),OP(U)&&h!==m.first||BL(U)&&h!==m.last){let $=OP(U)?-1:1,ne=h;do ne=(ne+$+u.length)%u.length;while(!yvs(u[ne]));A(ne)}}else c(X.line)});let I=i.style.message(e.message,o),w;if(i.helpMode!=="never")if(e.instructions){let{pager:U,navigation:X}=e.instructions;w=i.style.help(u.length>r?U:X)}else w=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let C=a7e({items:u,active:h,renderItem({item:U,isActive:X}){if(Pd.isSeparator(U))return` ${U.separator}`;if(U.disabled){let le=typeof U.disabled=="string"?U.disabled:"(disabled)";return i.style.disabled(`${U.name} ${le}`)}let $=X?i.style.highlight:le=>le,ne=X?i.icon.cursor:" ";return $(`${ne} ${U.name}`)},pageSize:r,loop:!1}),x;p?x=i.style.error(p):u.length===0&&a!==""&&o==="idle"&&(x=i.style.error("No results found"));let T;if(o==="done"&&y)return[f,I,i.style.answer(y.short)].filter(Boolean).join(" ").trimEnd();T=i.style.searchTerm(a);let O=y?.description,R=[f,I,T].filter(Boolean).join(" ").trimEnd(),P=[x??C," ",O?i.style.description(O):"",w].filter(Boolean).join(`
|
|
5025
5025
|
`).trimEnd();return[R,P]});var I1t=we(pS(),1);var Jfg={icon:{cursor:_w.pointer},style:{disabled:e=>I1t.default.dim(`- ${e}`),description:e=>I1t.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${I1t.default.bold(t)} ${I1t.default.dim(r)}`).join(I1t.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function v1t(e){return!Pd.isSeparator(e)&&!e.disabled}function Yfg(e){return e.map(t=>{if(Pd.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 bvs=$C((e,t)=>{let{loop:r=!0,pageSize:n=7}=e,i=kv(Jfg,e.theme),{keybindings:o}=i,[s,a]=Iu("idle"),c=XC({status:s,theme:i}),u=s7e(),l=!o.includes("vim"),p=OL(()=>Yfg(e.choices),[e.choices]),d=OL(()=>{let O=p.findIndex(v1t),R=p.findLastIndex(v1t);if(O===-1)throw new Iae("[select prompt] No selectable choices. All choices are disabled.");return{first:O,last:R}},[p]),f=OL(()=>"default"in e?p.findIndex(O=>v1t(O)&&O.value===e.default):-1,[e.default,p]),[m,h]=Iu(f===-1?d.first:f),A=p[m];ZC((O,R)=>{if(clearTimeout(u.current),YC(O))a("done"),t(A.value);else if(OP(O,o)||BL(O,o)){if(R.clearLine(0),r||OP(O,o)&&m!==d.first||BL(O,o)&&m!==d.last){let P=OP(O,o)?-1:1,U=m;do U=(U+P+p.length)%p.length;while(!v1t(p[U]));h(U)}}else if(xXt(O)&&!Number.isNaN(Number(R.line))){let P=Number(R.line)-1,U=-1,X=p.findIndex(ne=>Pd.isSeparator(ne)?!1:(U++,U===P)),$=p[X];$!=null&&v1t($)&&h(X),u.current=setTimeout(()=>{R.clearLine(0)},700)}else if(n7e(O))R.clearLine(0);else if(l){let P=R.line.toLowerCase(),U=p.findIndex(X=>Pd.isSeparator(X)||!v1t(X)?!1:X.name.toLowerCase().startsWith(P));U!==-1&&h(U),u.current=setTimeout(()=>{R.clearLine(0)},700)}}),x4(()=>()=>{clearTimeout(u.current)},[]);let y=i.style.message(e.message,s),I;if(i.helpMode!=="never")if(e.instructions){let{pager:O,navigation:R}=e.instructions;I=i.style.help(p.length>n?O:R)}else I=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let w=0,C=a7e({items:p,active:m,renderItem({item:O,isActive:R,index:P}){if(Pd.isSeparator(O))return w++,` ${O.separator}`;let U=i.indexMode==="number"?`${P+1-w}. `:"";if(O.disabled){let ne=typeof O.disabled=="string"?O.disabled:"(disabled)";return i.style.disabled(`${U}${O.name} ${ne}`)}let X=R?i.style.highlight:ne=>ne,$=R?i.icon.cursor:" ";return X(`${$} ${U}${O.name}`)},pageSize:n,loop:r});if(s==="done")return[c,y,i.style.answer(A.short)].filter(Boolean).join(" ");let{description:x}=A;return`${[[c,y].filter(Boolean).join(" "),C," ",x?i.style.description(x):"",I].filter(Boolean).join(`
|
|
5026
|
-
`).trimEnd()}${E1t}`});co();var Cae={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"},Xfg={[Cae.GENERATION_STARTED]:!1,[Cae.GENERATION_COMPLETED]:!1,[Cae.GENERATION_FAILED]:!0,[Cae.VERIFICATION_FAILED]:!0,[Cae.SDK_PR_CREATED]:!1,[Cae.UPGRADE_APPLIED]:!1,[Cae.MAJOR_VERSION_BUMP]:!1};function Asl(e){return Xfg[e]}function ysl(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 bsl(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 Esl(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 vsl(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 Isl(e){let t=e.join(" ");return/\bautomations\s+generate\b/.test(t)?Cae.GENERATION_FAILED:/\bautomations\s+preview\b/.test(t)?Cae.VERIFICATION_FAILED:Cae.GENERATION_FAILED}var Zfg="",$fg="FERN_AUTOMATION_EVENTS_ORIGIN",edg=3e3,Qyi=class e{static instance;origin;inflight=[];static getInstance(){return e.instance==null&&(e.instance=new e(process.env[$fg]??Zfg)),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(),edg);try{let s={"content-type":"application/json"},a=await BV();a!=null&&a.value.length>0&&(s.Authorization=`Bearer ${a.value}`);let c=await fetch(n,{method:"POST",headers:s,body:JSON.stringify(vsl(t,r)),signal:i.signal})}catch{return}finally{clearTimeout(o)}}};function Csl(){let{fern_run_id:e,github_run_id:t}=tce();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.44.
|
|
5026
|
+
`).trimEnd()}${E1t}`});co();var Cae={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"},Xfg={[Cae.GENERATION_STARTED]:!1,[Cae.GENERATION_COMPLETED]:!1,[Cae.GENERATION_FAILED]:!0,[Cae.VERIFICATION_FAILED]:!0,[Cae.SDK_PR_CREATED]:!1,[Cae.UPGRADE_APPLIED]:!1,[Cae.MAJOR_VERSION_BUMP]:!1};function Asl(e){return Xfg[e]}function ysl(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 bsl(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 Esl(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 vsl(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 Isl(e){let t=e.join(" ");return/\bautomations\s+generate\b/.test(t)?Cae.GENERATION_FAILED:/\bautomations\s+preview\b/.test(t)?Cae.VERIFICATION_FAILED:Cae.GENERATION_FAILED}var Zfg="",$fg="FERN_AUTOMATION_EVENTS_ORIGIN",edg=3e3,Qyi=class e{static instance;origin;inflight=[];static getInstance(){return e.instance==null&&(e.instance=new e(process.env[$fg]??Zfg)),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(),edg);try{let s={"content-type":"application/json"},a=await BV();a!=null&&a.value.length>0&&(s.Authorization=`Bearer ${a.value}`);let c=await fetch(n,{method:"POST",headers:s,body:JSON.stringify(vsl(t,r)),signal:i.signal})}catch{return}finally{clearTimeout(o)}}};function Csl(){let{fern_run_id:e,github_run_id:t}=tce();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.44.6"}}function wsl(){return process.env.FERN_AUTOMATION==="true"}var Myi=class{constructor(t,r=Qyi.getInstance()){this.reporter=t;this.automationEventApiClient=r;this.context=Csl()}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(){await this.automationEventApiClient.shutdown()}capturePostHogEvent({event:t,context:r}){this.reporter.instrumentPostHogAutomationEvent({distinctId:r.run_id??void 0,event:t.event,properties:ysl(t,r)})}captureSentryForFailure({event:t,context:r,error:n}){if(!(!Asl(t.event)||t.errorCode==null))return this.reporter.captureException(n,{tags:bsl(t,r),context:{automation:Esl(t,r)}})}captureAutomationEventApiEvent(t,r){this.automationEventApiClient.post(t,r)}};_t();function Lyi(e,t,r){if(t instanceof fu)return;let n=OAe(t,r?.code),i=r?.argv??process.argv,o=i.join(" "),s=r?.message??(t instanceof Error?t.message:void 0)??"",a=t??new D({message:s,code:n});wsl()?rdg(i,e,n,s,a):tdg(e,o,n,a)}function tdg(e,t,r,n){e.instrumentPostHogEvent({command:t,properties:{failed:!0,errorCode:r}}),y9e(r)&&e.captureException(n,{tags:{"error.code":r}})}function rdg(e,t,r,n,i){let o=Isl(e);t.emitAutomationTelemetryEvent({event:o,errorCode:r,attributes:{error_message:n}},{error:i})}_t();function f7e(){return process.env.FERN_DISABLE_TELEMETRY==="true"}function zyi({cliName:e,packageVersion:t,isLocal:r}){return f7e()||r?!1:!(t==="0.0.0")&&(e==="fern"&&!0)}var Uyi=class{sentry;constructor({release:t,telemetry:r}){let n="https://84f58b5e457f06999d92f11ce4b79158@o4509504076185600.ingest.us.sentry.io/4511021546602496";if(zyi(r)&&n!=null&&n.length>0){let i="production";if(i==null||i.length===0)throw new D({message:"SENTRY_ENVIRONMENT must be set when SENTRY_DSN is configured",code:D.Code.ConfigError});this.sentry=kPt({dsn:n,release:t,environment:i,defaultIntegrations:!1,integrations:[tGe(),tAe(),rAe(),Lge(),eAe()],tracesSampleRate:0,attachStacktrace:!0,sendClientReports:!1}),NPt()}}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):NB(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(()=>{})}};_t();var _yi=class{originalWrite;redirected=!1;redirect(){if(this.redirected)throw new D({message:"StdoutRedirector: already redirected \u2014 did you forget to restore()?",code:D.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()}}};jt();Hb();_t();var OXt=class{result=Uf.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 fu}failWithoutThrowing(t,r,n){this.result=Uf.Failure,!(r instanceof fu)&&(t!=null&&(this.lastFailureMessage=t),S3t({message:t,error:r,logger:this.logger}),Lyi(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=VI(this.logAtLevel.bind(this));addInteractiveTask({name:t,subtitle:r}){let n=new Evs({name:t,subtitle:r,logImmediately:i=>this.logImmediately(i),logPrefix:`${this.logPrefix}${Ae.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(i){n.failWithoutThrowing(void 0,i)}finally{n.finish()}return n.getResult()===Uf.Success}printInteractiveTasks({spinner:t}){return this.subtasks.map(r=>r.print({spinner:t})).join(`
|
|
5027
5027
|
`)}},Evs=class extends OXt{name;subtitle;constructor({name:t,subtitle:r,...n}){super(n),this.name=t,this.subtitle=r}start(){return super.start(),this.logAtLevelWithOverrides(Gn.Info,["Started."],{omitOnTTY:!0}),this.flushLogs(),this}isStarted(){return this.status!=="notStarted"}finish(){this.status!=="finished"&&(this.result===Uf.Success?this.logAtLevelWithOverrides(Gn.Info,["Finished."],{omitOnTTY:!0}):this.logAtLevelWithOverrides(Gn.Error,["Failed."],{omitOnTTY:!0}),super.finish())}setSubtitle(t){this.subtitle=t}print({spinner:t}){let r=[this.name];return this.subtitle!=null&&r.push(Ae.dim(this.subtitle)),r.push(...this.subtasks.map(n=>n.print({spinner:t}))),Fj({prefix:this.getIcon({spinner:t}),content:r.join(`
|
|
5028
5028
|
`)})}printInteractiveTasks({spinner:t}){return this.print({spinner:t})}getIcon({spinner:t}){let r=this.subtasks.length>0;switch(this.status){case"notStarted":return r?Ae.dim("\u25B8 "):Ae.dim("\u25E6 ");case"running":return r?Ae.cyan("\u25BE "):t;case"finished":switch(this.getResult()){case Uf.Success:return r?Ae.green("\u25BE "):Ae.green("\u2713 ");case Uf.Failure:return r?Ae.red("\u25BE "):Ae.red("x ")}}}getResult(){if(this.result===Uf.Failure)return Uf.Failure;for(let t of this.subtasks)if(t.getResult()===Uf.Failure)return Uf.Failure;return Uf.Success}};_t();var xsl=we(Y6e(),1);function Ssl(e){return e.filter(t=>t.isUpgradeAvailable).length>0}function ndg(e){return(e.cliUpgradeInfo?.isUpgradeAvailable??!1)||Ssl(e.generatorUpgradeInfo)}async function Tsl({cliEnvironment:e,upgradeInfo:t}){if(!ndg(t)||e.packageVersion==t.cliUpgradeInfo?.latestVersion)return;let r=`${Ae.underline("Upgrades available")}
|
|
5029
5029
|
|
|
@@ -5032,7 +5032,7 @@ ${r}`}function tyi(e){let t=this,{emitParseErrors:r,...n}={...t.data("settings")
|
|
|
5032
5032
|
Run ${Ae.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
|
|
5033
5033
|
Run ${Ae.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),est(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function vvs({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!Ssl(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+=`
|
|
5034
5034
|
${await idg(a.generatorName)} (${a.apiName!=null?"API: "+a.apiName+", ":""}Group: ${a.generatorGroup}) `+Ae.dim(a.currentVersion)+Ae.reset(" \u2192 ")+Ae.green(a.latestVersion);return i+=`
|
|
5035
|
-
`,n?est(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function idg(e){let r=await new xsl.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new D({message:`Generator ${e} not found`,code:D.Code.ConfigError});return r.body.displayName}_t();async function odg({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:o}){if(t.length===1){let a={type:"singleApi",versions:{}};return await Bsl({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,u,l,p)=>{a.versions[u]==null&&(a.versions[u]={});let d=z6e(l.name);if(d==null){p.logger.debug(`Skipping unknown generator: ${l.name}`);return}let f=await M1({generatorName:d,cliVersion:e.environment.packageVersion,currentGeneratorVersion:l.version,channel:i,includeMajor:o,context:p});f!=null&&(a.versions[u][l.name]={previousVersion:l.version,latestVersion:f})},generatorFilter:r,groupFilter:n}),a}let s={type:"multiApi",versions:{}};return await Bsl({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(a,c,u,l)=>{if(a==null)return;s.versions[a]==null&&(s.versions[a]={}),s.versions[a][c]==null&&(s.versions[a][c]={});let p=z6e(u.name);if(p==null){l.logger.debug(`Skipping unknown generator: ${u.name}`);return}let d=await M1({generatorName:p,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:i,includeMajor:o,context:l});d!=null&&(s.versions[a][c][u.name]={previousVersion:u.version,latestVersion:d})},generatorFilter:r,groupFilter:n}),s}async function Bsl({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 W3({absolutePathToWorkspace:o.absoluteFilePath,context:s});if(a==null||a.groups==null)return;let c=n!=null?py(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 Osl(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;try{c=qQ(a.latestVersion,a.previousVersion)}catch{throw new D({message:`Generator "${s}" has an invalid version "${a.previousVersion}" in generators.yml. Use an exact version like 1.2.3.`,code:D.Code.ConfigError})}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 Vyi({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o}){let s=[];if(e!=null){let a=await odg({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o});if(a.type==="multiApi")for(let[c,u]of Object.entries(a.versions))s.push(...Osl(u,c,t.logger));else s.push(...Osl(a.versions,void 0,t.logger))}return s}_t();async function $he({cliEnvironment:e,includePreReleases:t=!1}){if(e.packageName!=="fern-api"||e.packageVersion==="0.0.0")return e.packageVersion;try{return await fFt(e.packageName,{version:t?"prerelease":"latest"})}catch(r){throw new D({message:`Failed to resolve latest CLI version: ${r instanceof Error?r.message:String(r)}`,code:D.Code.NetworkError})}}var Psl=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],qyi=class e{environment;sentryClient;posthogManager;automationTelemetryManager;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Gn.Info;isLocal;stdoutRedirector=new _yi;jsonMode=!1;static async create(t,r,{isLocal:n}){let i=await hVt();return new e(t,r,{isLocal:n,posthogManager:i})}constructor(t,r,{isLocal:n,posthogManager:i}){this.ttyAwareLogger=new V3t(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 Uyi({release:`cli@${this.environment.packageVersion}`,telemetry:{cliName:this.environment.cliName,packageVersion:this.environment.packageVersion,isLocal:this.isLocal}}),this.automationTelemetryManager=new Myi(this)}getPackageName(){return"fern-api"}getPackageVersion(){return"5.44.
|
|
5035
|
+
`,n?est(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function idg(e){let r=await new xsl.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new D({message:`Generator ${e} not found`,code:D.Code.ConfigError});return r.body.displayName}_t();async function odg({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:o}){if(t.length===1){let a={type:"singleApi",versions:{}};return await Bsl({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,u,l,p)=>{a.versions[u]==null&&(a.versions[u]={});let d=z6e(l.name);if(d==null){p.logger.debug(`Skipping unknown generator: ${l.name}`);return}let f=await M1({generatorName:d,cliVersion:e.environment.packageVersion,currentGeneratorVersion:l.version,channel:i,includeMajor:o,context:p});f!=null&&(a.versions[u][l.name]={previousVersion:l.version,latestVersion:f})},generatorFilter:r,groupFilter:n}),a}let s={type:"multiApi",versions:{}};return await Bsl({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(a,c,u,l)=>{if(a==null)return;s.versions[a]==null&&(s.versions[a]={}),s.versions[a][c]==null&&(s.versions[a][c]={});let p=z6e(u.name);if(p==null){l.logger.debug(`Skipping unknown generator: ${u.name}`);return}let d=await M1({generatorName:p,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:i,includeMajor:o,context:l});d!=null&&(s.versions[a][c][u.name]={previousVersion:u.version,latestVersion:d})},generatorFilter:r,groupFilter:n}),s}async function Bsl({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 W3({absolutePathToWorkspace:o.absoluteFilePath,context:s});if(a==null||a.groups==null)return;let c=n!=null?py(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 Osl(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;try{c=qQ(a.latestVersion,a.previousVersion)}catch{throw new D({message:`Generator "${s}" has an invalid version "${a.previousVersion}" in generators.yml. Use an exact version like 1.2.3.`,code:D.Code.ConfigError})}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 Vyi({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o}){let s=[];if(e!=null){let a=await odg({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o});if(a.type==="multiApi")for(let[c,u]of Object.entries(a.versions))s.push(...Osl(u,c,t.logger));else s.push(...Osl(a.versions,void 0,t.logger))}return s}_t();async function $he({cliEnvironment:e,includePreReleases:t=!1}){if(e.packageName!=="fern-api"||e.packageVersion==="0.0.0")return e.packageVersion;try{return await fFt(e.packageName,{version:t?"prerelease":"latest"})}catch(r){throw new D({message:`Failed to resolve latest CLI version: ${r instanceof Error?r.message:String(r)}`,code:D.Code.NetworkError})}}var Psl=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],qyi=class e{environment;sentryClient;posthogManager;automationTelemetryManager;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Gn.Info;isLocal;stdoutRedirector=new _yi;jsonMode=!1;static async create(t,r,{isLocal:n}){let i=await hVt();return new e(t,r,{isLocal:n,posthogManager:i})}constructor(t,r,{isLocal:n,posthogManager:i}){this.ttyAwareLogger=new V3t(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 Uyi({release:`cli@${this.environment.packageVersion}`,telemetry:{cliName:this.environment.cliName,packageVersion:this.environment.packageVersion,isLocal:this.isLocal}}),this.automationTelemetryManager=new Myi(this)}getPackageName(){return"fern-api"}getPackageVersion(){return"5.44.6"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${Ae.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),new fu}failWithoutThrowing(t,r,n){this.didSucceed=!1,!(r instanceof fu)&&(S3t({message:t,error:r,logger:this.logger}),Lyi(this,r,{...n,message:t}))}enableJsonMode(){this.jsonMode||(this.jsonMode=!0,this.stdoutRedirector.redirect())}get isJsonMode(){return this.jsonMode}writeJsonToStdout(t){this.stdoutRedirector.restore(),process.stdout.write(JSON.stringify(t,null,2)+`
|
|
5036
5036
|
`),this.jsonMode&&this.stdoutRedirector.redirect()}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish();try{await this.posthogManager.flush()}catch{}await this.sentryClient.flush(),await this.automationTelemetryManager.flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await Tsl({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
5037
5037
|
`)||(r+=`
|
|
5038
5038
|
`),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=cPi(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 OXt(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){throw n.failWithoutThrowing(void 0,o),new fu}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=VI((t,...r)=>this.log(t,...r));stderr=VI((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=t.type==="docs"?"docs":t.workspaceName??"api",n=Dsl(r),i=1+(this.longestWorkspaceName!=null?Dsl(this.longestWorkspaceName):n).length,o=n.padEnd(i),s=Psl[this.numTasks++%Psl.length],a=Ae.hex(s)(o);return{...this.constructTaskInit(),logPrefix:a,title:Ae.hex(s).bold(r)}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===Uf.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=>kx.indexOf(i.level)>=kx.indexOf(this.logLevel));this.ttyAwareLogger.log(n,{includeDebugInfo:this.logLevel===Gn.Debug,stderr:r||this.jsonMode})}_suppressUpgradeMessage=!1;suppressUpgradeMessage(){this._suppressUpgradeMessage=!0}_isUpgradeAvailable;async isUpgradeAvailable({includePreReleases:t=!1}={}){if(this._isUpgradeAvailable==null){this.logger.debug(`Checking if ${this.environment.packageName} upgrade is available...`);let r=await $he({cliEnvironment:this.environment,includePreReleases:t}),n=qQ(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(n?"Upgrade available.":"No upgrade available."));let i={isUpgradeAvailable:n,latestVersion:r},o=await Vyi({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:i,generatorUpgradeInfo:o}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){try{return await bvs({message:t,choices:[{name:"No",value:!1},{name:"Yes",value:!0}],default:r,theme:{prefix:Ae.yellow("?"),style:{answer:i=>Ae.cyan(i),message:i=>Ae.bold(i),highlight:i=>Ae.cyan(i)}}})}catch(n){throw n?.name==="ExitPromptError"?(this.logger.info(`
|