@mongodb-js/compass-web 0.31.1 → 0.32.0

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.
@@ -1,2 +0,0 @@
1
- /*! For license information please see 887.a7a72716c079e9aa117e.mjs.LICENSE.txt */
2
- export const __webpack_esm_id__=887;export const __webpack_esm_ids__=[887];export const __webpack_esm_modules__={415:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(77693),i=n(67767),o=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,c[r]=t,u[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),f("FULL",`^${c[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),f("LOOSE",`^${c[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),f("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${c[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[p.COERCEPLAIN]+`(?:${c[p.PRERELEASE]})?`+`(?:${c[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[p.COERCE],!0),f("COERCERTLFULL",c[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},540:(e,t,n)=>{const a=n(50066),r=n(72857);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},1025:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},1276:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},3012:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},3449:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)<0},3794:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},4292:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},4496:(e,t,n)=>{const a=n(50066);e.exports=(e,t)=>new a(e,t).minor},5081:(e,t,n)=>{const a=n(66283),r=n(38366);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},5286:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},5698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},5992:(e,t,n)=>{const a=n(99385);e.exports=(e,t,n)=>a(e,t,"<",n)},8117:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(51699),r=n(3012),s=n(91871),i=n(77973),o=n(80003),l=n(30797),c=n(17497),u=n(60679),p=n(99625),d=n(71174);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...c.JSON_SCHEMA,...u.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},8573:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},8999:(e,t,n)=>{const a=n(48381),r=n(20332);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},9331:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},9350:(e,t,n)=>{const a=n(52378),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(28892),{safeRe:i,t:o}=n(68752),l=n(34773),{compareIdentifiers:c}=n(80661);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},9418:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)<=0},9480:(e,t,n)=>{const a=n(71333);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},9703:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,c=!!o.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"}},9895:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(62280),t),r(n(63547),t),r(n(85665),t),r(n(48543),t),r(n(97008),t),r(n(58313),t),r(n(13821),t),r(n(59588),t),r(n(46699),t),r(n(71925),t),r(n(3794),t),r(n(95831),t);var s=n(44601);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(10111),t),r(n(64757),t)},10017:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},10036:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(41738)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},10094:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},10111:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},10282:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},10760:(e,t,n)=>{const a=n(85216);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},10933:(e,t,n)=>{const a=n(48381),r=n(20332);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},11420:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},11742:(e,t,n)=>{const a=n(72857);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},12815:(e,t,n)=>{const a=n(50066);e.exports=(e,t)=>new a(e,t).major},12876:(e,t,n)=>{const a=n(72857);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},13008:(e,t,n)=>{n.d(t,{DG:()=>v,E6:()=>E,J:()=>b,J_:()=>c,Jk:()=>u,KH:()=>p,Kk:()=>m,NI:()=>g,QP:()=>i,RM:()=>h,Tt:()=>$,Yk:()=>d,kH:()=>y,ql:()=>f,sm:()=>l,v$:()=>_});var a=n(36710),r=n(53266),s=n(87257);const i=a.xI("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),o={number:"number",bigint:"bigint",object:"date"},l=a.xI("$ZodCheckLessThan",((e,t)=>{i.init(e,t);const n=o[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,a=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),c=a.xI("$ZodCheckGreaterThan",((e,t)=>{i.init(e,t);const n=o[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,a=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),u=a.xI("$ZodCheckMultipleOf",((e,t)=>{i.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===s.LG(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),p=a.xI("$ZodCheckNumberFormat",((e,t)=>{i.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[o,l]=s.zH[t.format];e._zod.onattach.push((e=>{const a=e._zod.bag;a.format=t.format,a.minimum=o,a.maximum=l,n&&(a.pattern=r.nd)})),e._zod.check=r=>{const s=r.value;if(n){if(!Number.isInteger(s))return void r.issues.push({expected:a,format:t.format,code:"invalid_type",input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?r.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}):r.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}))}s<o&&r.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>l&&r.issues.push({origin:"number",input:s,code:"too_big",maximum:l,inst:e})}})),d=a.xI("$ZodCheckMaxLength",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const r=s.Rc(a);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}})),m=a.xI("$ZodCheckMinLength",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const r=s.Rc(a);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}})),h=a.xI("$ZodCheckLengthEquals",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const a=n.value,r=a.length;if(r===t.length)return;const i=s.Rc(a),o=r>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),f=a.xI("$ZodCheckStringFormat",((e,t)=>{var n,a;i.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})})),v=a.xI("$ZodCheckRegex",((e,t)=>{f.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),g=a.xI("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=r.AC),f.init(e,t)})),y=a.xI("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=r.Zv),f.init(e,t)})),$=a.xI("$ZodCheckIncludes",((e,t)=>{i.init(e,t);const n=s.$f(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),b=a.xI("$ZodCheckStartsWith",((e,t)=>{i.init(e,t);const n=new RegExp(`^${s.$f(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),E=a.xI("$ZodCheckEndsWith",((e,t)=>{i.init(e,t);const n=new RegExp(`.*${s.$f(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),_=a.xI("$ZodCheckOverwrite",((e,t)=>{i.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}))},13012:(e,t,n)=>{const a=n(99597);e.exports=(e,t,n)=>a(e,t,"<",n)},13016:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},13559:(e,t,n)=>{const a=n(48381),r=n(34219),{safeRe:s,t:i}=n(92625);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",c=n[4]||"0",u=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${c}${u}${p}`,t)}},13821:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},15011:(e,t,n)=>{const a=n(20332);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},15144:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},15160:(e,t,n)=>{const a=n(9350),r=n(33629);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},15580:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},15844:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)>=0},17497:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},17555:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},17620:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(t,e,n)},17624:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},17807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},17914:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},17941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},18104:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(4292),i=n(72082),o=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,c[r]=t,u[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),f("FULL",`^${c[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),f("LOOSE",`^${c[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),f("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${c[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[p.COERCEPLAIN]+`(?:${c[p.PRERELEASE]})?`+`(?:${c[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[p.COERCE],!0),f("COERCERTLFULL",c[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},18106:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)>0},18157:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},18894:(e,t,n)=>{const a=n(43301),r=n(77203);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const c=[];for(const[e,t]of s)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},19133:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(99352),r=n(37724),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const c=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=c},19789:(e,t,n)=>{const a=n(99597);e.exports=(e,t,n)=>a(e,t,">",n)},19896:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(t,e,n)},20038:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)<0},20242:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},20332:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(u[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(u[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>T(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE]))))),l("range list",i);const c=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const $=[...c.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(92721)),i=n(83214),o=n(55141),l=n(29385),c=n(48381),{safeRe:u,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(92625),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(24159),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=x(e,t),l("caret",e),e=_(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=N(e,t),l("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),E(n)?i="":E(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),E(n)?o="":E(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:E(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const c=E(r),u=c||E(s),p=u||E(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(u&&(s=0),i=0,">"===a?(a=">=",u?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",u?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):u?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,c,u,p,d)=>`${n=E(a)?"":E(r)?`>=${a}.0.0${e?"-0":""}`:E(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${p}-${d}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},20474:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},20903:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},20930:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},21148:(e,t,n)=>{const a=n(50363),r=n(60501);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const c=[];for(const[e,t]of s)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},21212:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},21482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},22156:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},22849:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},23253:(e,t,n)=>{n.d(t,{qg:()=>l,EJ:()=>c,xL:()=>u,bp:()=>p});var a=n(27750),r=n(77926),s=n(36710);const i=(e,t)=>{r.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>r.Wk(e,t)},flatten:{value:t=>r.JM(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},o=(s.xI("ZodError",i),s.xI("ZodError",i,{Parent:Error})),l=a.Tj(o),c=a.Rb(o),u=a.Od(o),p=a.wG(o)},24078:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)<=0},24159:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},24320:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},24472:(e,t,n)=>{const a=n(66283),r=n(58387),{ANY:s}=r,i=n(38366),o=n(50363),l=n(61607),c=n(91152),u=n(80829),p=n(15844);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=u,f=c,v=">",g=">=";break;case"<":m=c,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},24482:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},25157:(e,t,n)=>{var a,r=n(98437),s=n(17642);function i(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),-1===e.indexOf("-")&&-1===e.indexOf("_"))return e;{let t="",n=!1;const a=e.match(/^-+/);for(let r=a?a[0].length:0;r<e.length;r++){let a=e.charAt(r);n&&(n=!1,a=a.toUpperCase()),0===r||"-"!==a&&"_"!==a?"-"!==a&&"_"!==a&&(t+=a):n=!0}return t}}function o(e,t){const n=e.toLowerCase();t=t||"-";let a="";for(let r=0;r<e.length;r++){const s=n.charAt(r),i=e.charAt(r);a+=s!==i&&r>0?`${t}${n.charAt(r)}`:i}return a}function l(e){return null!=e&&("number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||!/^0[^.]/.test(e)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e))}let c;function u(e){return void 0!==e?e+1:1}function p(e){return"__proto__"===e?"___proto___":e}!function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"}(a||(a={}));var d,m,h,f=n(36374),v=n(65994).e;const g=v&&v.env&&v.env.YARGS_MIN_NODE_VERSION?Number(v.env.YARGS_MIN_NODE_VERSION):12,y=null!==(m=null===(d=null==v?void 0:v.versions)||void 0===d?void 0:d.node)&&void 0!==m?m:null===(h=null==v?void 0:v.version)||void 0===h?void 0:h.slice(1);if(y&&Number(y.match(/^([^.]+)/)[1])<g)throw Error(`yargs parser supports a minimum Node.js version of ${g}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const $=v?v.env:{},b=new class{constructor(e){c=e}parse(e,t){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),r=function(e){if(Array.isArray(e))return e.map((e=>"string"!=typeof e?e+"":e));e=e.trim();let t=0,n=null,a=null,r=null;const s=[];for(let i=0;i<e.length;i++)n=a,a=e.charAt(i)," "!==a||r?(a===r?r=null:"'"!==a&&'"'!==a||r||(r=a),s[t]||(s[t]=""),s[t]+=a):" "!==n&&t++;return s}(e),s="string"==typeof e,d=function(e){const t=[],n=Object.create(null);let a=!0;for(Object.keys(e).forEach((function(n){t.push([].concat(e[n],n))}));a;){a=!1;for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(t[e].filter((function(e){return-1!==t[n].indexOf(e)})).length){t[e]=t[e].concat(t[n]),t.splice(n,1),a=!0;break}}return t.forEach((function(e){const t=(e=e.filter((function(e,t,n){return n.indexOf(e)===t}))).pop();void 0!==t&&"string"==typeof t&&(n[t]=e)})),n}(Object.assign(Object.create(null),n.alias)),m=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),h=Object.assign(Object.create(null),n.default),f=n.configObjects||[],v=n.envPrefix,g=m["populate--"],y=g?"--":"_",$=Object.create(null),b=Object.create(null),E=n.__||c.format,_={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,x=new RegExp("^--"+m["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(e){const t="object"==typeof e?e.key:e,n=Object.keys(e).map((function(e){return{boolean:"bools",string:"strings",number:"numbers"}[e]})).filter(Boolean).pop();n&&(_[n][t]=!0),_.arrays[t]=!0,_.keys.push(t)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(e){_.bools[e]=!0,_.keys.push(e)})),[].concat(n.string||[]).filter(Boolean).forEach((function(e){_.strings[e]=!0,_.keys.push(e)})),[].concat(n.number||[]).filter(Boolean).forEach((function(e){_.numbers[e]=!0,_.keys.push(e)})),[].concat(n.count||[]).filter(Boolean).forEach((function(e){_.counts[e]=!0,_.keys.push(e)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(e){_.normalize[e]=!0,_.keys.push(e)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([e,t])=>{"number"==typeof t&&(_.nargs[e]=t,_.keys.push(e))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([e,t])=>{"function"==typeof t&&(_.coercions[e]=t,_.keys.push(e))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(e){_.configs[e]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([e,t])=>{"boolean"!=typeof t&&"function"!=typeof t||(_.configs[e]=t)}))),function(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){_.aliases[e]||(_.aliases[e]=[].concat(d[e]||[]),_.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&m["camel-case-expansion"]){const n=i(t);n!==e&&-1===_.aliases[e].indexOf(n)&&(_.aliases[e].push(n),$[n]=!0)}})),_.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&m["camel-case-expansion"]){const n=o(t,"-");n!==e&&-1===_.aliases[e].indexOf(n)&&(_.aliases[e].push(n),$[n]=!0)}})),_.aliases[e].forEach((function(t){_.aliases[t]=[e].concat(_.aliases[e].filter((function(e){return t!==e})))})))}))}))}(n.key,d,n.default,_.arrays),Object.keys(h).forEach((function(e){(_.aliases[e]||[]).forEach((function(t){h[t]=h[e]}))}));let A=null;Object.keys(_.counts).find((e=>V(e,_.arrays)?(A=Error(E("Invalid configuration: %s, opts.count excludes opts.array.",e)),!0):!!V(e,_.nargs)&&(A=Error(E("Invalid configuration: %s, opts.count excludes opts.narg.",e)),!0)));let I=[];const w=Object.assign(Object.create(null),{_:[]}),N={};for(let e=0;e<r.length;e++){const t=r[e],n=t.replace(/^-{3,}/,"---");let a,s,i,o,l,c;if("--"!==t&&/^-/.test(t)&&q(t))T(t);else{if(n.match(/^---+(=|$)/)){T(t);continue}if(t.match(/^--.+=/)||!m["short-option-groups"]&&t.match(/^-.+=/))o=t.match(/^--?([^=]+)=([\s\S]*)$/),null!==o&&Array.isArray(o)&&o.length>=3&&(V(o[1],_.arrays)?e=k(e,o[1],r,o[2]):!1!==V(o[1],_.nargs)?e=O(e,o[1],r,o[2]):R(o[1],o[2],!0));else if(t.match(x)&&m["boolean-negation"])o=t.match(x),null!==o&&Array.isArray(o)&&o.length>=2&&(s=o[1],R(s,!!V(s,_.arrays)&&[!1]));else if(t.match(/^--.+/)||!m["short-option-groups"]&&t.match(/^-[^-]+/))o=t.match(/^--?(.+)/),null!==o&&Array.isArray(o)&&o.length>=2&&(s=o[1],V(s,_.arrays)?e=k(e,s,r):!1!==V(s,_.nargs)?e=O(e,s,r):(l=r[e+1],void 0===l||l.match(/^-/)&&!l.match(S)||V(s,_.bools)||V(s,_.counts)?/^(true|false)$/.test(l)?(R(s,l),e++):R(s,B(s)):(R(s,l),e++)));else if(t.match(/^-.\..+=/))o=t.match(/^-([^=]+)=([\s\S]*)$/),null!==o&&Array.isArray(o)&&o.length>=3&&R(o[1],o[2]);else if(t.match(/^-.\..+/)&&!t.match(S))l=r[e+1],o=t.match(/^-(.\..+)/),null!==o&&Array.isArray(o)&&o.length>=2&&(s=o[1],void 0===l||l.match(/^-/)||V(s,_.bools)||V(s,_.counts)?R(s,B(s)):(R(s,l),e++));else if(t.match(/^-[^-]+/)&&!t.match(S)){i=t.slice(1,-1).split(""),a=!1;for(let n=0;n<i.length;n++){if(l=t.slice(n+2),i[n+1]&&"="===i[n+1]){c=t.slice(n+3),s=i[n],V(s,_.arrays)?e=k(e,s,r,c):!1!==V(s,_.nargs)?e=O(e,s,r,c):R(s,c),a=!0;break}if("-"!==l){if(/[A-Za-z]/.test(i[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===V(l,_.bools)){R(i[n],l),a=!0;break}if(i[n+1]&&i[n+1].match(/\W/)){R(i[n],l),a=!0;break}R(i[n],B(i[n]))}else R(i[n],l)}s=t.slice(-1)[0],a||"-"===s||(V(s,_.arrays)?e=k(e,s,r):!1!==V(s,_.nargs)?e=O(e,s,r):(l=r[e+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(S)||V(s,_.bools)||V(s,_.counts)?/^(true|false)$/.test(l)?(R(s,l),e++):R(s,B(s)):(R(s,l),e++)))}else if(t.match(/^-[0-9]$/)&&t.match(S)&&V(t.slice(1),_.bools))s=t.slice(1),R(s,B(s));else{if("--"===t){I=r.slice(e+1);break}if(m["halt-at-non-option"]){I=r.slice(e);break}T(t)}}}function T(e){const t=P("_",e);"string"!=typeof t&&"number"!=typeof t||w._.push(t)}function O(e,t,n,a){let r,s=V(t,_.nargs);if(s="number"!=typeof s||isNaN(s)?1:s,0===s)return z(a)||(A=Error(E("Argument unexpected for: %s",t))),R(t,B(t)),e;let i=z(a)?0:1;if(m["nargs-eats-options"])n.length-(e+1)+i<s&&(A=Error(E("Not enough arguments following: %s",t))),i=s;else{for(r=e+1;r<n.length&&(!n[r].match(/^-[^0-9]/)||n[r].match(S)||q(n[r]));r++)i++;i<s&&(A=Error(E("Not enough arguments following: %s",t)))}let o=Math.min(i,s);for(!z(a)&&o>0&&(R(t,a),o--),r=e+1;r<o+e+1;r++)R(t,n[r]);return e+o}function k(e,t,n,a){let r=[],i=a||n[e+1];const o=V(t,_.nargs);if(V(t,_.bools)&&!/^(true|false)$/.test(i))r.push(!0);else if(z(i)||z(a)&&/^-/.test(i)&&!S.test(i)&&!q(i)){if(void 0!==h[t]){const e=h[t];r=Array.isArray(e)?e:[e]}}else{z(a)||r.push(L(t,a,!0));for(let a=e+1;a<n.length&&!(!m["greedy-arrays"]&&r.length>0||o&&"number"==typeof o&&r.length>=o)&&(i=n[a],!/^-/.test(i)||S.test(i)||q(i));a++)e=a,r.push(L(t,i,s))}return"number"==typeof o&&(o&&r.length<o||isNaN(o)&&0===r.length)&&(A=Error(E("Not enough arguments following: %s",t))),R(t,r),e}function R(e,t,n=s){if(/-/.test(e)&&m["camel-case-expansion"]){const t=e.split(".").map((function(e){return i(e)})).join(".");C(e,t)}const a=L(e,t,n),r=e.split(".");Y(w,r,a),_.aliases[e]&&_.aliases[e].forEach((function(e){const t=e.split(".");Y(w,t,a)})),r.length>1&&m["dot-notation"]&&(_.aliases[r[0]]||[]).forEach((function(t){let n=t.split(".");const s=[].concat(r);s.shift(),n=n.concat(s),(_.aliases[e]||[]).includes(n.join("."))||Y(w,n,a)})),V(e,_.normalize)&&!V(e,_.arrays)&&[e].concat(_.aliases[e]||[]).forEach((function(e){Object.defineProperty(N,e,{enumerable:!0,get:()=>t,set(e){t="string"==typeof e?c.normalize(e):e}})}))}function C(e,t){_.aliases[e]&&_.aliases[e].length||(_.aliases[e]=[t],$[t]=!0),_.aliases[t]&&_.aliases[t].length||C(t,e)}function L(e,t,n){n&&(t=function(e){return"string"!=typeof e||"'"!==e[0]&&'"'!==e[0]||e[e.length-1]!==e[0]?e:e.substring(1,e.length-1)}(t)),(V(e,_.bools)||V(e,_.counts))&&"string"==typeof t&&(t="true"===t);let a=Array.isArray(t)?t.map((function(t){return P(e,t)})):P(e,t);return V(e,_.counts)&&(z(a)||"boolean"==typeof a)&&(a=u()),V(e,_.normalize)&&V(e,_.arrays)&&(a=Array.isArray(t)?t.map((e=>c.normalize(e))):c.normalize(t)),a}function P(e,t){return m["parse-positional-numbers"]||"_"!==e?(V(e,_.strings)||V(e,_.bools)||Array.isArray(t)||(l(t)&&m["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!z(t)&&V(e,_.numbers))&&(t=Number(t)),t):t}function M(e,t){Object.keys(e).forEach((function(n){const a=e[n],r=t?t+"."+n:n;"object"==typeof a&&null!==a&&!Array.isArray(a)&&m["dot-notation"]?M(a,r):(!F(w,r.split("."))||V(r,_.arrays)&&m["combine-arrays"])&&R(r,a)}))}function j(e,t){if(void 0===v)return;const n="string"==typeof v?v:"",a=c.env();Object.keys(a).forEach((function(r){if(""===n||0===r.lastIndexOf(n,0)){const s=r.split("__").map((function(e,t){return 0===t&&(e=e.substring(n.length)),i(e)}));(t&&_.configs[s.join(".")]||!t)&&!F(e,s)&&R(s.join("."),a[r])}}))}function D(e,t,n,a=!1){Object.keys(n).forEach((function(r){F(e,r.split("."))||(Y(e,r.split("."),n[r]),a&&(b[r]=!0),(t[r]||[]).forEach((function(t){F(e,t.split("."))||Y(e,t.split("."),n[r])})))}))}function F(e,t){let n=e;m["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){n=n[e]||{}}));const a=t[t.length-1];return"object"==typeof n&&a in n}function Y(e,t,n){let a=e;m["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){e=p(e),"object"==typeof a&&void 0===a[e]&&(a[e]={}),"object"!=typeof a[e]||Array.isArray(a[e])?(Array.isArray(a[e])?a[e].push({}):a[e]=[a[e],{}],a=a[e][a[e].length-1]):a=a[e]}));const r=p(t[t.length-1]),s=V(t.join("."),_.arrays),i=Array.isArray(n);let o=m["duplicate-arguments-array"];!o&&V(r,_.nargs)&&(o=!0,(!z(a[r])&&1===_.nargs[r]||Array.isArray(a[r])&&a[r].length===_.nargs[r])&&(a[r]=void 0)),n===u()?a[r]=u(a[r]):Array.isArray(a[r])?o&&s&&i?a[r]=m["flatten-duplicate-arrays"]?a[r].concat(n):(Array.isArray(a[r][0])?a[r]:[a[r]]).concat([n]):o||Boolean(s)!==Boolean(i)?a[r]=a[r].concat([n]):a[r]=n:void 0===a[r]&&s?a[r]=i?n:[n]:!o||void 0===a[r]||V(r,_.counts)||V(r,_.bools)?a[r]=n:a[r]=[a[r],n]}function V(e,t){const n=[].concat(_.aliases[e]||[],e),a=Object.keys(t),r=n.find((e=>a.includes(e)));return!!r&&t[r]}function U(e){const t=Object.keys(_);return[].concat(t.map((e=>_[e]))).some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function q(e){return m["unknown-options-as-args"]&&function(e){return!(e=e.replace(/^-{3,}/,"--")).match(S)&&(!function(e){if(e.match(S)||!e.match(/^-[^-]+/))return!1;let t,n=!0;const a=e.slice(1).split("");for(let r=0;r<a.length;r++){if(t=e.slice(r+2),!U(a[r])){n=!1;break}if(a[r+1]&&"="===a[r+1]||"-"===t||/[A-Za-z]/.test(a[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(t)||a[r+1]&&a[r+1].match(/\W/))break}return n}(e)&&!function(e,...t){return[].concat(...t).some((function(t){const n=e.match(t);return n&&U(n[1])}))}(e,/^-+([^=]+?)=[\s\S]*$/,x,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/))}(e)}function B(e){return V(e,_.bools)||V(e,_.counts)||!(`${e}`in h)?(t=function(e){let t=a.BOOLEAN;return V(e,_.strings)?t=a.STRING:V(e,_.numbers)?t=a.NUMBER:V(e,_.bools)?t=a.BOOLEAN:V(e,_.arrays)&&(t=a.ARRAY),t}(e),{[a.BOOLEAN]:!0,[a.STRING]:"",[a.NUMBER]:void 0,[a.ARRAY]:[]}[t]):h[e];var t}function z(e){return void 0===e}return j(w,!0),j(w,!1),function(e){const t=Object.create(null);D(t,_.aliases,h),Object.keys(_.configs).forEach((function(n){const a=e[n]||t[n];if(a)try{let e=null;const t=c.resolve(c.cwd(),a),r=_.configs[n];if("function"==typeof r){try{e=r(t)}catch(t){e=t}if(e instanceof Error)return void(A=e)}else e=c.require(t);M(e)}catch(t){"PermissionDenied"===t.name?A=t:e[n]&&(A=Error(E("Invalid JSON config file: %s",a)))}}))}(w),void 0!==f&&f.forEach((function(e){M(e)})),D(w,_.aliases,h,!0),function(e){let t;const n=new Set;Object.keys(e).forEach((function(a){if(!n.has(a)&&(t=V(a,_.coercions),"function"==typeof t))try{const r=P(a,t(e[a]));[].concat(_.aliases[a]||[],a).forEach((t=>{n.add(t),e[t]=r}))}catch(e){A=e}}))}(w),m["set-placeholder-key"]&&function(e){_.keys.forEach((t=>{~t.indexOf(".")||void 0===e[t]&&(e[t]=void 0)}))}(w),Object.keys(_.counts).forEach((function(e){F(w,e.split("."))||R(e,0)})),g&&I.length&&(w[y]=[]),I.forEach((function(e){w[y].push(e)})),m["camel-case-expansion"]&&m["strip-dashed"]&&Object.keys(w).filter((e=>"--"!==e&&e.includes("-"))).forEach((e=>{delete w[e]})),m["strip-aliased"]&&[].concat(...Object.keys(d).map((e=>d[e]))).forEach((e=>{m["camel-case-expansion"]&&e.includes("-")&&delete w[e.split(".").map((e=>i(e))).join(".")],delete w[e]})),{aliases:Object.assign({},_.aliases),argv:Object.assign(N,w),configuration:m,defaulted:Object.assign({},b),error:A,newAliases:Object.assign({},$)}}}({cwd:v.cwd,env:()=>$,format:r.format,normalize:s.normalize,resolve:s.resolve,require:e=>{if("undefined"!=typeof require)return require(e);if(e.match(/\.json$/))return JSON.parse((0,f.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),E=function(e,t){return b.parse(e.slice(),t).argv};E.detailed=function(e,t){return b.parse(e.slice(),t)},E.camelCase=i,E.decamelize=o,E.looksLikeNumber=l},25530:(e,t,n)=>{n.d(t,{MU:()=>s,Nw:()=>r,rd:()=>i});var a=n(84591);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS;const r=a.ATLAS_SEARCH_TEMPLATES,s=a.ATLAS_VECTOR_SEARCH_TEMPLATE,i=(a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS);a.getFilteredCompletions,a.wrapField},25546:(e,t,n)=>{const a=n(66283),r=n(38366),s=n(61607);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},25812:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>0!==a(e,t,n)},26518:(e,t,n)=>{n.d(t,{fd:()=>s,rs:()=>a}),Symbol("ZodOutput"),Symbol("ZodInput");class a{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function r(){return new a}const s=r()},26633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},27225:(e,t,n)=>{const a=n(44455);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},27750:(e,t,n)=>{n.d(t,{Od:()=>l,Rb:()=>o,Tj:()=>i,bp:()=>p,wG:()=>u,xL:()=>c});var a=n(36710),r=n(77926),s=n(87257);const i=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new a.GT;if(l.issues.length){const t=new(i?.Err??e)(l.issues.map((e=>s.iR(e,o,a.$W()))));throw s.gx(t,i?.callee),t}return l.value},o=(r.Kd,e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const t=new(i?.Err??e)(l.issues.map((e=>s.iR(e,o,a.$W()))));throw s.gx(t,i?.callee),t}return l.value}),l=(r.Kd,e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new a.GT;return l.issues.length?{success:!1,error:new(e??r.a$)(l.issues.map((e=>s.iR(e,o,a.$W()))))}:{success:!0,data:l.value}}),c=l(r.Kd),u=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map((e=>s.iR(e,i,a.$W()))))}:{success:!0,data:o.value}},p=u(r.Kd)},28131:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},28141:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)<0},28742:e=>{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},28892:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},28968:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},29087:(e,t,n)=>{const a=n(50066),r=n(72857),s=n(18106);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},29299:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(3012),t),r(n(91871),t),r(n(77973),t),r(n(80003),t),r(n(1276),t),r(n(30797),t),r(n(17497),t),r(n(39560),t),r(n(60679),t),r(n(99625),t),r(n(71174),t),r(n(17555),t);var s=n(8117);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(33907),t),r(n(95153),t)},29385:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},30044:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},30403:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},30452:(e,t,n)=>{const a=n(9350);e.exports=(e,t)=>new a(e,t).minor},30629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},30797:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},31145:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},32654:(e,t,n)=>{const a=n(38366);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},32674:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},32910:(e,t,n)=>{const a=n(48381),r=n(55141),{ANY:s}=r,i=n(20332),o=n(43301),l=n(58809),c=n(20038),u=n(66239),p=n(54506);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=u,f=c,v=">",g=">=";break;case"<":m=c,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},32924:(e,t,n)=>{const a=n(41694);e.exports=(e,t)=>new a(e,t).minor},32939:(e,t,n)=>{const a=n(66283);e.exports=(e,t)=>new a(e,t).minor},33629:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(u[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(u[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>T(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE]))))),l("range list",i);const c=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const $=[...c.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(92660)),i=n(34773),o=n(96506),l=n(52378),c=n(9350),{safeRe:u,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(68752),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(28892),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=x(e,t),l("caret",e),e=_(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=N(e,t),l("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),E(n)?i="":E(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),E(n)?o="":E(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:E(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const c=E(r),u=c||E(s),p=u||E(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(u&&(s=0),i=0,">"===a?(a=">=",u?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",u?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):u?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,c,u,p,d)=>`${n=E(a)?"":E(r)?`>=${a}.0.0${e?"-0":""}`:E(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${p}-${d}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},33907:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},34218:(e,t,n)=>{const a=n(41694),r=n(71333);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},34219:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},34335:(e,t,n)=>{const a=n(20332),r=n(55141),{ANY:s}=r,i=n(43301),o=n(77203),l=[new r(">=0.0.0-0")],c=[new r(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=c}const a=new Set;let r,u,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?u=d(u,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&u){if(m=o(r.semver,u.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==u.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(u&&!i(e,String(u),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(u)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(u,e,n),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),n))return!1;if(!e.operator&&(u||r)&&0!==m)return!1}return!(r&&v&&!u&&0!==m||u&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=u(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},34773:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},34889:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},35647:(e,t,n)=>{const a=n(68752),r=n(28892),s=n(9350),i=n(80661),o=n(17914),l=n(40447),c=n(24320),u=n(1025),p=n(82214),d=n(90216),m=n(30452),h=n(58395),f=n(94715),v=n(99430),g=n(51456),y=n(62525),$=n(44455),b=n(27225),E=n(85623),_=n(42734),S=n(63825),x=n(53831),A=n(42997),I=n(66135),w=n(90898),N=n(39149),T=n(84112),O=n(96506),k=n(33629),R=n(52992),C=n(52189),L=n(60098),P=n(15160),M=n(88099),j=n(44948),D=n(57681),F=n(62921),Y=n(69904),V=n(89834),U=n(59263),q=n(45006);e.exports={parse:o,valid:l,clean:c,inc:u,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:E,gt:_,lt:S,eq:x,neq:A,gte:I,lte:w,cmp:N,coerce:T,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:L,minSatisfying:P,minVersion:M,validRange:j,outside:D,gtr:F,ltr:Y,intersects:V,simplifyRange:U,subset:q,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},35735:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},36059:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(t,e,n)},36582:(e,t,n)=>{const a=n(71333),r=n(96082),{ANY:s}=r,i=n(9480),o=n(40289),l=[new r(">=0.0.0-0")],c=[new r(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=c}const a=new Set;let r,u,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?u=d(u,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&u){if(m=o(r.semver,u.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==u.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(u&&!i(e,String(u),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(u)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(u,e,n),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),n))return!1;if(!e.operator&&(u||r)&&0!==m)return!1}return!(r&&v&&!u&&0!==m||u&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=u(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},36710:(e,t,n)=>{function a(e,t,n){function a(n,a){var r;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(r=n._zod).traits??(r.traits=new Set),n._zod.traits.add(e),t(n,a);for(const e in i.prototype)e in n||Object.defineProperty(n,e,{value:i.prototype[e].bind(n)});n._zod.constr=i,n._zod.def=a}const r=n?.Parent??Object;class s extends r{}function i(e){var t;const r=n?.Parent?new s:this;a(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:a}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}n.d(t,{$W:()=>i,GT:()=>r,cr:()=>s,xI:()=>a}),Object.freeze({status:"aborted"}),Symbol("zod_brand");class r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const s={};function i(e){return e&&Object.assign(s,e),s}},36719:(e,t,n)=>{const a=n(66283);e.exports=(e,t)=>new a(e,t).major},36744:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},36749:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>0!==a(e,t,n)},37276:(e,t,n)=>{const a=n(71333);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},37359:(e,t,n)=>{const a=n(87391);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},37385:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},37724:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},38358:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},38366:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(u[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(u[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>T(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE]))))),l("range list",i);const c=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const $=[...c.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(43287)),i=n(69348),o=n(58387),l=n(67767),c=n(66283),{safeRe:u,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(415),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(77693),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=x(e,t),l("caret",e),e=_(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=N(e,t),l("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),E(n)?i="":E(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),E(n)?o="":E(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:E(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const c=E(r),u=c||E(s),p=u||E(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(u&&(s=0),i=0,">"===a?(a=">=",u?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",u?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):u?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,c,u,p,d)=>`${n=E(a)?"":E(r)?`>=${a}.0.0${e?"-0":""}`:E(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${p}-${d}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},38506:(e,t,n)=>{const a=n(47538);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},39044:(e,t,n)=>{const a=n(20332);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},39149:(e,t,n)=>{const a=n(53831),r=n(42997),s=n(42734),i=n(66135),o=n(63825),l=n(90898);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,c);case"!=":return r(e,n,c);case">":return s(e,n,c);case">=":return i(e,n,c);case"<":return o(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},39560:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},40030:(e,t,n)=>{var a=n(65994).e;Object.defineProperty(t,"__esModule",{value:!0}),t.signals=void 0,t.signals=[],t.signals.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==a.platform&&t.signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===a.platform&&t.signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")},40194:(e,t,n)=>{const a=n(72857),r=n(67094),{ANY:s}=r,i=n(12876),o=n(32674),l=[new r(">=0.0.0-0")],c=[new r(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=c}const a=new Set;let r,u,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?u=d(u,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&u){if(m=o(r.semver,u.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==u.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(u&&!i(e,String(u),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(u)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(u,e,n),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),n))return!1;if(!e.operator&&(u||r)&&0!==m)return!1}return!(r&&v&&!u&&0!==m||u&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=u(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},40289:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},40447:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},40957:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(59591)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},41163:(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.unload=t.load=t.onExit=t.signals=void 0;const r=n(40030);Object.defineProperty(t,"signals",{enumerable:!0,get:function(){return r.signals}});const s=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,i=Symbol.for("signal-exit emitter"),o=globalThis,l=Object.defineProperty.bind(Object);class c{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o[i])return o[i];l(o,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],a=n.indexOf(t);-1!==a&&(0===a&&1===n.length?n.length=0:n.splice(a,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let a=!1;for(const r of this.listeners[e])a=!0===r(t,n)||a;return"exit"===e&&(a=this.emit("afterExit",t,n)||a),a}}class u{}const p=globalThis.process;var d;d=s(p)?new class extends u{#e="win32"===p.platform?"SIGINT":"SIGHUP";#t=new c;#n;#a;#r;#s={};#i=!1;constructor(e){super(),this.#n=e,this.#s={};for(const t of r.signals)this.#s[t]=()=>{const n=this.#n.listeners(t);let{count:a}=this.#t;const r=e;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(a+=r.__signal_exit_emitter__.count),n.length===a){this.unload();const n=this.#t.emit("exit",null,t),a="SIGHUP"===t?this.#e:t;n||e.kill(e.pid,a)}};this.#r=e.reallyExit,this.#a=e.emit}onExit(e,t){if(!s(this.#n))return()=>{};!1===this.#i&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#t.count+=1;for(const e of r.signals)try{const t=this.#s[e];t&&this.#n.on(e,t)}catch(e){}this.#n.emit=(e,...t)=>this.#o(e,...t),this.#n.reallyExit=e=>this.#l(e)}}unload(){this.#i&&(this.#i=!1,r.signals.forEach((e=>{const t=this.#s[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,t)}catch(e){}})),this.#n.emit=this.#a,this.#n.reallyExit=this.#r,this.#t.count-=1)}#l(e){return s(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#r.call(this.#n,this.#n.exitCode)):0}#o(e,...t){const n=this.#a;if("exit"===e&&s(this.#n)){"number"==typeof t[0]&&(this.#n.exitCode=t[0]);const a=n.call(this.#n,e,...t);return this.#t.emit("exit",this.#n.exitCode,null),a}return n.call(this.#n,e,...t)}}(p):new class extends u{onExit(){return()=>{}}load(){}unload(){}},a={onExit:(e,t)=>d.onExit(e,t),load:()=>d.load(),unload:()=>d.unload()},t.onExit=a.onExit,t.load=a.load,t.unload=a.unload},41694:(e,t,n)=>{const a=n(72082),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(4292),{safeRe:i,t:o}=n(18104),l=n(8573),{compareIdentifiers:c}=n(90733);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},41738:(e,t,n)=>{const a=n(92625),r=n(24159),s=n(48381),i=n(5286),o=n(34219),l=n(24482),c=n(10017),u=n(11420),p=n(77277),d=n(78853),m=n(74145),h=n(86506),f=n(30044),v=n(77203),g=n(36059),y=n(68716),$=n(47538),b=n(88770),E=n(38506),_=n(58809),S=n(20038),x=n(45160),A=n(25812),I=n(54506),w=n(66239),N=n(88108),T=n(13559),O=n(55141),k=n(20332),R=n(43301),C=n(39044),L=n(8999),P=n(10933),M=n(98696),j=n(15011),D=n(32910),F=n(76130),Y=n(89975),V=n(78519),U=n(18894),q=n(34335);e.exports={parse:o,valid:l,clean:c,inc:u,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:E,gt:_,lt:S,eq:x,neq:A,gte:I,lte:w,cmp:N,coerce:T,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:L,minSatisfying:P,minVersion:M,validRange:j,outside:D,gtr:F,ltr:Y,intersects:V,simplifyRange:U,subset:q,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},41755:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>0===a(e,t,n)},42734:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)>0},42937:(e,t,n)=>{n.d(t,{$O:()=>E,$S:()=>J,Au:()=>Y,Be:()=>l,Bj:()=>v,Ct:()=>g,Dl:()=>h,ER:()=>Q,Eb:()=>z,F7:()=>R,FO:()=>ie,Fk:()=>W,Fn:()=>d,G1:()=>N,G8:()=>F,Hi:()=>B,Il:()=>ae,KA:()=>j,KB:()=>I,Kn:()=>O,LK:()=>L,Mu:()=>i,Ny:()=>b,Pw:()=>y,Rl:()=>s,Tx:()=>U,Uy:()=>_,WN:()=>ne,YA:()=>G,Zm:()=>V,_L:()=>P,_z:()=>$,aC:()=>m,bS:()=>ee,cU:()=>A,dR:()=>X,dZ:()=>se,db:()=>T,em:()=>D,f2:()=>k,fU:()=>oe,fs:()=>f,gP:()=>S,hH:()=>H,jw:()=>M,lo:()=>te,m9:()=>Z,nA:()=>c,pY:()=>u,qF:()=>K,qG:()=>C,qm:()=>q,rk:()=>w,rt:()=>x,tB:()=>o,wA:()=>p,xY:()=>re});var a=n(13008),r=n(87257);function s(e,t){return new e({type:"string",...r.A2(t)})}function i(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...r.A2(t)})}function o(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...r.A2(t)})}function l(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...r.A2(t)})}function c(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...r.A2(t)})}function u(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...r.A2(t)})}function p(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...r.A2(t)})}function d(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...r.A2(t)})}function m(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...r.A2(t)})}function h(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...r.A2(t)})}function f(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...r.A2(t)})}function v(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...r.A2(t)})}function g(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...r.A2(t)})}function y(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...r.A2(t)})}function $(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...r.A2(t)})}function b(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...r.A2(t)})}function E(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...r.A2(t)})}function _(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...r.A2(t)})}function S(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...r.A2(t)})}function x(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...r.A2(t)})}function A(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...r.A2(t)})}function I(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...r.A2(t)})}function w(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...r.A2(t)})}function N(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...r.A2(t)})}function T(e,t){return new e({type:"string",format:"date",check:"string_format",...r.A2(t)})}function O(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...r.A2(t)})}function k(e,t){return new e({type:"string",format:"duration",check:"string_format",...r.A2(t)})}function R(e,t){return new e({type:"number",checks:[],...r.A2(t)})}function C(e,t){return new e({type:"number",coerce:!0,checks:[],...r.A2(t)})}function L(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...r.A2(t)})}function P(e,t){return new e({type:"boolean",...r.A2(t)})}function M(e,t){return new e({type:"null",...r.A2(t)})}function j(e){return new e({type:"any"})}function D(e){return new e({type:"unknown"})}function F(e,t){return new e({type:"never",...r.A2(t)})}function Y(e,t){return new a.sm({check:"less_than",...r.A2(t),value:e,inclusive:!1})}function V(e,t){return new a.sm({check:"less_than",...r.A2(t),value:e,inclusive:!0})}function U(e,t){return new a.J_({check:"greater_than",...r.A2(t),value:e,inclusive:!1})}function q(e,t){return new a.J_({check:"greater_than",...r.A2(t),value:e,inclusive:!0})}function B(e,t){return new a.Jk({check:"multiple_of",...r.A2(t),value:e})}function z(e,t){return new a.Yk({check:"max_length",...r.A2(t),maximum:e})}function Z(e,t){return new a.Kk({check:"min_length",...r.A2(t),minimum:e})}function G(e,t){return new a.RM({check:"length_equals",...r.A2(t),length:e})}function W(e,t){return new a.DG({check:"string_format",format:"regex",...r.A2(t),pattern:e})}function H(e){return new a.NI({check:"string_format",format:"lowercase",...r.A2(e)})}function K(e){return new a.kH({check:"string_format",format:"uppercase",...r.A2(e)})}function X(e,t){return new a.Tt({check:"string_format",format:"includes",...r.A2(t),includes:e})}function J(e,t){return new a.J({check:"string_format",format:"starts_with",...r.A2(t),prefix:e})}function Q(e,t){return new a.E6({check:"string_format",format:"ends_with",...r.A2(t),suffix:e})}function ee(e){return new a.v$({check:"overwrite",tx:e})}function te(e){return ee((t=>t.normalize(e)))}function ne(){return ee((e=>e.trim()))}function ae(){return ee((e=>e.toLowerCase()))}function re(){return ee((e=>e.toUpperCase()))}function se(e,t,n){return new e({type:"array",element:t,...r.A2(n)})}function ie(e,t,n){const a=r.A2(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function oe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...r.A2(n)})}},42945:(e,t,n)=>{const a=n(87391);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},42997:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>0!==a(e,t,n)},43287:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},43301:(e,t,n)=>{const a=n(20332);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},43334:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)>0},44016:(e,t,n)=>{const a=n(41694),r=n(71333);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},44455:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},44601:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(35647),r=n(62280),s=n(63547),i=n(85665),o=n(48543),l=n(58313),c=n(13821),u=n(46699),p=n(71925),d=n(3794);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...c.JSON_SCHEMA,...u.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},44719:(e,t,n)=>{n.d(t,{Tf:()=>r,Zt:()=>i,zM:()=>s});var a=n(49976);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS;const r=a.STAGE_OPERATOR_NAMES,s=(a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions),i=a.wrapField},44948:(e,t,n)=>{const a=n(33629);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},45006:(e,t,n)=>{const a=n(33629),r=n(96506),{ANY:s}=r,i=n(52992),o=n(99430),l=[new r(">=0.0.0-0")],c=[new r(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=c}const a=new Set;let r,u,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?u=d(u,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&u){if(m=o(r.semver,u.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==u.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(u&&!i(e,String(u),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(u)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(u,e,n),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),n))return!1;if(!e.operator&&(u||r)&&0!==m)return!1}return!(r&&v&&!u&&0!==m||u&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=u(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},45160:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>0===a(e,t,n)},45890:(e,t,n)=>{n.d(t,{e1:()=>v,mD:()=>he,m2:()=>d,Z9:()=>Me,ej:()=>De,n_:()=>je,HD:()=>Ce,Ds:()=>ke,hK:()=>y,sl:()=>Oe,cV:()=>Re,wA:()=>Ne,CR:()=>m,cb:()=>h,o8:()=>Ye,$C:()=>$,u1:()=>b,$b:()=>T,G1:()=>x,zf:()=>E,R:()=>O,v0:()=>Ee,qs:()=>k,ID:()=>de,WL:()=>R,x3:()=>C,HQ:()=>L,qx:()=>A,_Z:()=>_e,xI:()=>Se,S:()=>Ie,GU:()=>Ae,hd:()=>Te,N8:()=>be,ZZ:()=>$e,k5:()=>ye,WZ:()=>I,ae:()=>Fe,jN:()=>ge});var a=n(12240),r=n(26518),s=n(87257);class i{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??r.fd,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;const a=e._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i)return i.count++,t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema;const l={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const n={...t,schemaPath:[...t.schemaPath,e],path:t.path},i=e._zod.parent;if(i)l.ref=i,this.process(i,n),this.seen.get(i).isParent=!0;else{const t=l.schema;switch(a.type){case"string":{const n=t;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=r[i]??i,""===n.format&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(l.schema.allOf=[...e.map((e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source})))])}break}case"number":{const n=t,{minimum:a,maximum:r,format:s,multipleOf:i,exclusiveMaximum:o,exclusiveMinimum:l}=e._zod.bag;"string"==typeof s&&s.includes("int")?n.type="integer":n.type="number","number"==typeof l&&(n.exclusiveMinimum=l),"number"==typeof a&&(n.minimum=a,"number"==typeof l&&(l>=a?delete n.minimum:delete n.exclusiveMinimum)),"number"==typeof o&&(n.exclusiveMaximum=o),"number"==typeof r&&(n.maximum=r,"number"==typeof o&&(o<=r?delete n.maximum:delete n.exclusiveMaximum)),"number"==typeof i&&(n.multipleOf=i);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const r=t,{minimum:s,maximum:i}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof i&&(r.maxItems=i),r.type="array",r.items=this.process(a.element,{...n,path:[...n.path,"items"]});break}case"object":{const e=t;e.type="object",e.properties={};const r=a.shape;for(const t in r)e.properties[t]=this.process(r[t],{...n,path:[...n.path,"properties",t]});const s=new Set(Object.keys(r)),i=new Set([...s].filter((e=>{const t=a.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout})));i.size>0&&(e.required=Array.from(i)),"never"===a.catchall?._zod.def.type?e.additionalProperties=!1:a.catchall?a.catchall&&(e.additionalProperties=this.process(a.catchall,{...n,path:[...n.path,"additionalProperties"]})):"output"===this.io&&(e.additionalProperties=!1);break}case"union":t.anyOf=a.options.map(((e,t)=>this.process(e,{...n,path:[...n.path,"anyOf",t]})));break;case"intersection":{const e=t,r=this.process(a.left,{...n,path:[...n.path,"allOf",0]}),s=this.process(a.right,{...n,path:[...n.path,"allOf",1]}),i=e=>"allOf"in e&&1===Object.keys(e).length,o=[...i(r)?r.allOf:[r],...i(s)?s.allOf:[s]];e.allOf=o;break}case"tuple":{const r=t;r.type="array";const s=a.items.map(((e,t)=>this.process(e,{...n,path:[...n.path,"prefixItems",t]})));if("draft-2020-12"===this.target?r.prefixItems=s:r.items=s,a.rest){const e=this.process(a.rest,{...n,path:[...n.path,"items"]});"draft-2020-12"===this.target?r.items=e:r.additionalItems=e}a.rest&&(r.items=this.process(a.rest,{...n,path:[...n.path,"items"]}));const{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof o&&(r.maxItems=o);break}case"record":{const e=t;e.type="object",e.propertyNames=this.process(a.keyType,{...n,path:[...n.path,"propertyNames"]}),e.additionalProperties=this.process(a.valueType,{...n,path:[...n.path,"additionalProperties"]});break}case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":{const e=t,n=(0,s.w5)(a.entries);n.every((e=>"number"==typeof e))&&(e.type="number"),n.every((e=>"string"==typeof e))&&(e.type="string"),e.enum=n;break}case"literal":{const e=t,n=[];for(const e of a.values)if(void 0===e){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(e))}else n.push(e);if(0===n.length);else if(1===n.length){const t=n[0];e.type=null===t?"null":typeof t,e.const=t}else n.every((e=>"number"==typeof e))&&(e.type="number"),n.every((e=>"string"==typeof e))&&(e.type="string"),n.every((e=>"boolean"==typeof e))&&(e.type="string"),n.every((e=>null===e))&&(e.type="null"),e.enum=n;break}case"file":{const n=t,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:s,mime:i}=e._zod.bag;void 0!==r&&(a.minLength=r),void 0!==s&&(a.maxLength=s),i?1===i.length?(a.contentMediaType=i[0],Object.assign(n,a)):n.anyOf=i.map((e=>({...a,contentMediaType:e}))):Object.assign(n,a);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const e=this.process(a.innerType,n);t.anyOf=[e,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(a.innerType,n),l.ref=a.innerType;break;case"default":this.process(a.innerType,n),l.ref=a.innerType,t.default=JSON.parse(JSON.stringify(a.defaultValue));break;case"prefault":this.process(a.innerType,n),l.ref=a.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break;case"catch":{let e;this.process(a.innerType,n),l.ref=a.innerType;try{e=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const n=t,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=a.source;break}case"pipe":{const e="input"===this.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;this.process(e,n),l.ref=e;break}case"readonly":this.process(a.innerType,n),l.ref=a.innerType,t.readOnly=!0;break;case"lazy":{const t=e._zod.innerType;this.process(t,n),l.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const u=this.metadataRegistry.get(e);return u&&Object.assign(l.schema,u),"input"===this.io&&o(e)&&(delete l.schema.examples,delete l.schema.default),"input"===this.io&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,t){const n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},a=this.seen.get(e);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=e=>{const t="draft-2020-12"===this.target?"$defs":"definitions";if(n.external){const a=n.external.registry.get(e[0])?.id,r=n.external.uri??(e=>e);if(a)return{ref:r(a)};const s=e[1].defId??e[1].schema.id??"schema"+this.counter++;return e[1].defId=s,{defId:s,ref:`${r("__shared")}#/${t}/${s}`}}if(e[1]===a)return{ref:"#"};const r=`#/${t}/`,s=e[1].schema.id??"__schema"+this.counter++;return{defId:s,ref:r+s}},s=e=>{if(e[1].schema.$ref)return;const t=e[1],{ref:n,defId:a}=r(e);t.def={...t.schema},a&&(t.defId=a);const s=t.schema;for(const e in s)delete s[e];s.$ref=n};if("throw"===n.cycles)for(const e of this.seen.entries()){const t=e[1];if(t.cycle)throw new Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const t of this.seen.entries()){const a=t[1];if(e===t[0]){s(t);continue}if(n.external){const a=n.external.registry.get(t[0])?.id;if(e!==t[0]&&a){s(t);continue}}const r=this.metadataRegistry.get(t[0])?.id;(r||a.cycle||a.count>1&&"ref"===n.reused)&&s(t)}const i=(e,t)=>{const n=this.seen.get(e),a=n.def??n.schema,r={...a};if(null===n.ref)return;const s=n.ref;if(n.ref=null,s){i(s,t);const e=this.seen.get(s).schema;e.$ref&&"draft-7"===t.target?(a.allOf=a.allOf??[],a.allOf.push(e)):(Object.assign(a,e),Object.assign(a,r))}n.isParent||this.override({zodSchema:e,jsonSchema:a,path:n.path??[]})};for(const e of[...this.seen.entries()].reverse())i(e[0],{target:this.target});const o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){const t=n.external.registry.get(e)?.id;if(!t)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(t)}Object.assign(o,a.def);const l=n.external?.defs??{};for(const e of this.seen.entries()){const t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}n.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw new Error("Error converting schema to JSON.")}}}function o(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;switch(a.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return o(a.element,n);case"object":for(const e in a.shape)if(o(a.shape[e],n))return!0;return!1;case"union":for(const e of a.options)if(o(e,n))return!0;return!1;case"intersection":return o(a.left,n)||o(a.right,n);case"tuple":for(const e of a.items)if(o(e,n))return!0;return!(!a.rest||!o(a.rest,n));case"record":case"map":return o(a.keyType,n)||o(a.valueType,n);case"set":return o(a.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return o(a.innerType,n);case"lazy":return o(a.getter(),n);case"transform":return!0;case"pipe":return o(a.in,n)||o(a.out,n)}throw new Error(`Unknown schema type: ${a.type}`)}var l=n(23253),c=n(91989),u=n(29744),p=n(65994).e;function d(...e){return e.reduce(((e,t)=>({...e,...null!=t?t:{}})),{})}function m({tools:e=[],providerToolNames:t}){const n={},a={};for(const r of e)if("provider"===r.type&&r.id in t){const e=t[r.id];n[r.name]=e,a[e]=r.name}return{toProviderToolName:e=>{var t;return null!=(t=n[e])?t:e},toCustomToolName:e=>{var t;return null!=(t=a[e])?t:e}}}async function h(e,t){if(null==e)return Promise.resolve();const n=null==t?void 0:t.abortSignal;return new Promise(((t,a)=>{if(null==n?void 0:n.aborted)return void a(f());const r=setTimeout((()=>{s(),t()}),e),s=()=>{clearTimeout(r),null==n||n.removeEventListener("abort",i)},i=()=>{s(),a(f())};null==n||n.addEventListener("abort",i)}))}function f(){return new DOMException("Delay was aborted","AbortError")}var v=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise||(this._promise=new Promise(((e,t)=>{"resolved"===this.status.type?e(this.status.value):"rejected"===this.status.type&&t(this.status.error),this._resolve=e,this._reject=t}))),this._promise}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&(null==(t=this._resolve)||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&(null==(t=this._reject)||t.call(this,e))}isResolved(){return"resolved"===this.status.type}isRejected(){return"rejected"===this.status.type}isPending(){return"pending"===this.status.type}};function g(e){return Object.fromEntries([...e.headers])}var y=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const e=n.length,a=new Array(t);for(let r=0;r<t;r++)a[r]=n[Math.random()*e|0];return a.join("")};if(null==e)return s;if(n.includes(r))throw new a.Di({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${s()}`},$=y();function b(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}function E(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var _=["fetch failed","failed to fetch"];function S({error:e,url:t,requestBodyValues:n}){if(E(e))return e;if(e instanceof TypeError&&_.includes(e.message.toLowerCase())){const r=e.cause;if(null!=r)return new a.hL({message:`Cannot connect to API: ${r.message}`,cause:r,url:t,requestBodyValues:n,isRetryable:!0})}return e}function x(e=globalThis){var t,n,a;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(a=null==(n=e.process)?void 0:n.versions)?void 0:a.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function A(e){if(null==e)return{};const t={};if(e instanceof Headers)e.forEach(((e,n)=>{t[n.toLowerCase()]=e}));else{Array.isArray(e)||(e=Object.entries(e));for(const[n,a]of e)null!=a&&(t[n.toLowerCase()]=a)}return t}function I(e,...t){const n=new Headers(A(e)),a=n.get("user-agent")||"";return n.set("user-agent",[a,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var w="4.0.0-beta.47",N=()=>globalThis.fetch,T=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:r,abortSignal:s,fetch:i=N()})=>{try{const o=await i(e,{method:"GET",headers:I(t,`ai-sdk/provider-utils/${w}`,x()),signal:s}),l=g(o);if(!o.ok){let t;try{t=await r({response:o,url:e,requestBodyValues:{}})}catch(t){if(E(t)||a.hL.isInstance(t))throw t;throw new a.hL({message:"Failed to process error response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:{}})}throw t.value}try{return await n({response:o,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(E(t)||a.hL.isInstance(t)))throw t;throw new a.hL({message:"Failed to process successful response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:{}})}}catch(t){throw S({error:t,url:e,requestBodyValues:{}})}};function O(e){return null!=e}function k({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map((([e,t])=>{const n=e.toLowerCase();return"*"===n||"*/*"===n?{mediaTypePrefix:"",regexes:t}:{mediaTypePrefix:n.replace(/\*/,""),regexes:t}})).filter((({mediaTypePrefix:t})=>e.startsWith(t))).flatMap((({regexes:e})=>e)).some((e=>e.test(t)))}function R({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:r}){if("string"==typeof e)return e;if(null!=e)throw new a.Kq({message:`${r} API key must be a string.`});if(void 0===p)throw new a.Kq({message:`${r} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(null==(e=p.env[t]))throw new a.Kq({message:`${r} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new a.Kq({message:`${r} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function C({settingValue:e,environmentVariableName:t}){return"string"==typeof e||null==e&&void 0!==p&&null!=(e=p.env[t])&&"string"==typeof e?e:void 0}function L(e){var t;const[n,a=""]=e.toLowerCase().split("/");return null!=(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[a])?t:a}var P=/"__proto__"\s*:/,M=/"constructor"\s*:/;function j(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===P.test(e)&&!1===M.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const n of e){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in n){const a=n[e];a&&"object"==typeof a&&t.push(a)}}}return e}(t)}function D(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return j(e)}try{return j(e)}finally{Error.stackTraceLimit=t}}function F(e){if("object"===e.type){e.additionalProperties=!1;const t=e.properties;if(null!=t)for(const e in t)t[e]=F(t[e])}return"array"===e.type&&null!=e.items&&(Array.isArray(e.items)?e.items=e.items.map((e=>F(e))):e.items=F(e.items)),e}var Y=e=>()=>e.toJsonSchema(),V=e=>async()=>{try{const{JSONSchema:t}=await Promise.resolve().then((function(){var e=new Error("Cannot find module 'effect'");throw e.code="MODULE_NOT_FOUND",e}));return t.make(e)}catch(e){throw new Error("Failed to import module 'effect'")}},U=e=>async()=>{try{const{toJsonSchema:t}=await Promise.resolve().then((function(){var e=new Error("Cannot find module '@valibot/to-json-schema'");throw e.code="MODULE_NOT_FOUND",e}));return t(e)}catch(e){throw new Error("Failed to import module '@valibot/to-json-schema'")}},q=Symbol("Let zodToJsonSchema decide on which parser to use"),B={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function z(e,t){return oe(e.type._def,t)}function Z(e,t,n){const a=null!=n?n:t.dateStrategy;if(Array.isArray(a))return{anyOf:a.map(((n,a)=>Z(e,t,n)))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return G(e)}}var G=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value}return t},W=void 0,H={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===W&&(W=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),W),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function K(e,t){const n={type:"string"};if(e.checks)for(const a of e.checks)switch(a.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"email":switch(t.emailStrategy){case"format:email":Q(n,"email",a.message,t);break;case"format:idn-email":Q(n,"idn-email",a.message,t);break;case"pattern:zod":ee(n,H.email,a.message,t)}break;case"url":Q(n,"uri",a.message,t);break;case"uuid":Q(n,"uuid",a.message,t);break;case"regex":ee(n,a.regex,a.message,t);break;case"cuid":ee(n,H.cuid,a.message,t);break;case"cuid2":ee(n,H.cuid2,a.message,t);break;case"startsWith":ee(n,RegExp(`^${X(a.value,t)}`),a.message,t);break;case"endsWith":ee(n,RegExp(`${X(a.value,t)}$`),a.message,t);break;case"datetime":Q(n,"date-time",a.message,t);break;case"date":Q(n,"date",a.message,t);break;case"time":Q(n,"time",a.message,t);break;case"duration":Q(n,"duration",a.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"includes":ee(n,RegExp(X(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&Q(n,"ipv4",a.message,t),"v4"!==a.version&&Q(n,"ipv6",a.message,t);break;case"base64url":ee(n,H.base64url,a.message,t);break;case"jwt":ee(n,H.jwt,a.message,t);break;case"cidr":"v6"!==a.version&&ee(n,H.ipv4Cidr,a.message,t),"v4"!==a.version&&ee(n,H.ipv6Cidr,a.message,t);break;case"emoji":ee(n,H.emoji(),a.message,t);break;case"ulid":ee(n,H.ulid,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Q(n,"binary",a.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":ee(n,H.base64,a.message,t)}break;case"nanoid":ee(n,H.nanoid,a.message,t)}return n}function X(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)J.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var J=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Q(e,t,n,a){var r;e.format||(null==(r=e.anyOf)?void 0:r.some((e=>e.format)))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&a.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function ee(e,t,n,a){var r;e.pattern||(null==(r=e.allOf)?void 0:r.some((e=>e.pattern)))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:te(t,a),...n&&a.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=te(t,a)}function te(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const a=e.flags.includes("i"),r=e.flags.includes("m"),s=e.flags.includes("s"),i=a?e.source.toLowerCase():e.source;let o="",l=!1,c=!1,u=!1;for(let e=0;e<i.length;e++)if(l)o+=i[e],l=!1;else{if(a)if(c){if(i[e].match(/[a-z]/)){u?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),u=!1):"-"===i[e+1]&&(null==(n=i[e+2])?void 0:n.match(/[a-z]/))?(o+=i[e],u=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(r){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}s&&"."===i[e]?o+=c?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?l=!0:c&&"]"===i[e]?c=!1:c||"["!==i[e]||(c=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function ne(e,t){var n,a,r,s,i,o;const l={type:"object",additionalProperties:null!=(n=oe(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(a=e.keyType)?void 0:a._def.typeName)===c.kY.ZodString&&(null==(r=e.keyType._def.checks)?void 0:r.length)){const{type:n,...a}=K(e.keyType._def,t);return{...l,propertyNames:a}}if((null==(s=e.keyType)?void 0:s._def.typeName)===c.kY.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(i=e.keyType)?void 0:i._def.typeName)===c.kY.ZodBranded&&e.keyType._def.type._def.typeName===c.kY.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){const{type:n,...a}=z(e.keyType._def,t);return{...l,propertyNames:a}}return l}var ae={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function re(e){try{return e.isOptional()}catch(e){return!0}}var se=(e,t,n)=>{switch(t){case c.kY.ZodString:return K(e,n);case c.kY.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case c.kY.ZodObject:return function(e,t){const n={type:"object",properties:{}},a=[],r=e.shape();for(const e in r){let s=r[e];if(void 0===s||void 0===s._def)continue;const i=re(s),o=oe(s._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,i||a.push(e))}a.length&&(n.required=a);const s=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return oe(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==s&&(n.additionalProperties=s),n}(e,n);case c.kY.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case c.kY.ZodBoolean:return{type:"boolean"};case c.kY.ZodDate:return Z(e,n);case c.kY.ZodUndefined:return{not:{}};case c.kY.ZodNull:return{type:"null"};case c.kY.ZodArray:return function(e,t){var n,a,r;const s={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(r=null==(a=e.type)?void 0:a._def)?void 0:r.typeName)!==c.kY.ZodAny&&(s.items=oe(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}(e,n);case c.kY.ZodUnion:case c.kY.ZodDiscriminatedUnion:return function(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every((e=>e._def.typeName in ae&&(!e._def.checks||!e._def.checks.length)))){const e=n.reduce(((e,t)=>{const n=ae[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e}),[]);return{type:e.length>1?e:e[0]}}if(n.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=n.reduce(((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===n.length){const t=e.filter(((e,t,n)=>n.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:n.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(n.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:n.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return((e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,n)=>oe(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return n.length?{anyOf:n}:void 0})(e,t)}(e,n);case c.kY.ZodIntersection:return function(e,t){const n=[oe(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),oe(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e)),a=[];return n.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...a}=e;t=a}a.push(t)}else a.push(...e.allOf);var t})),a.length?{allOf:a}:void 0}(e,n);case c.kY.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,n)=>oe(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:oe(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,n)=>oe(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}(e,n);case c.kY.ZodRecord:return ne(e,n);case c.kY.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case c.kY.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case c.kY.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),a=Array.from(new Set(n.map((e=>typeof e))));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:n}}(e);case c.kY.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ae[e.innerType._def.typeName],"null"]};const n=oe(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case c.kY.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return oe(e.innerType._def,t);const a=oe(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:{}},a]}:{}})(e,n);case c.kY.ZodMap:return function(e,t){return"record"===t.mapStrategy?ne(e,t):{type:"array",maxItems:125,items:{type:"array",items:[oe(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},oe(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case c.kY.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:oe(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case c.kY.ZodLazy:return()=>e.getter()._def;case c.kY.ZodPromise:return function(e,t){return oe(e.type._def,t)}(e,n);case c.kY.ZodNaN:case c.kY.ZodNever:return{not:{}};case c.kY.ZodEffects:return function(e,t){return"input"===t.effectStrategy?oe(e.schema._def,t):{}}(e,n);case c.kY.ZodAny:case c.kY.ZodUnknown:return{};case c.kY.ZodDefault:return function(e,t){return{...oe(e.innerType._def,t),default:e.defaultValue()}}(e,n);case c.kY.ZodBranded:return z(e,n);case c.kY.ZodReadonly:case c.kY.ZodCatch:return((e,t)=>oe(e.innerType._def,t))(e,n);case c.kY.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return oe(e.in._def,t);if("output"===t.pipeStrategy)return oe(e.out._def,t);const n=oe(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,oe(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter((e=>void 0!==e))}})(e,n);case c.kY.ZodFunction:case c.kY.ZodVoid:case c.kY.ZodSymbol:default:return}},ie=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function oe(e,t,n=!1){var a;const r=t.seen.get(e);if(t.override){const s=null==(a=t.override)?void 0:a.call(t,e,t,r,n);if(s!==q)return s}if(r&&!n){const e=le(r,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=se(e,e.typeName,t),o="function"==typeof i?oe(i(),t):i;if(o&&ce(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return s.jsonSchema=o,n}return s.jsonSchema=o,o}var le=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ie(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,n)=>t.currentPath[n]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},ce=(e,t,n)=>(e.description&&(n.description=e.description),n),ue=(e,t)=>{var n;const a=(e=>{const t=(e=>"string"==typeof e?{...B,name:e}:{...B,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}})(t);let r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,n])=>{var r;return{...e,[t]:null!=(r=oe(n._def,{...a,currentPath:[...a.basePath,a.definitionPath,t]},!0))?r:{}}}),{}):void 0;const s="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(n=oe(e._def,void 0===s?a:{...a,currentPath:[...a.basePath,a.definitionPath,s]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o);const l=void 0===s?r?{...i,[a.definitionPath]:r}:i:{$ref:[..."relative"===a.$refStrategy?[]:a.basePath,a.definitionPath,s].join("/"),[a.definitionPath]:{...r,[s]:i}};return l.$schema="http://json-schema.org/draft-07/schema#",l},pe=Symbol.for("vercel.ai.schema");function de(e){let t;return()=>(null==t&&(t=e()),t)}function me(e,{validate:t}={}){return{[pe]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function he(e){return null==e?me({properties:{},additionalProperties:!1}):"object"==typeof(t=e)&&null!==t&&pe in t&&!0===t[pe]&&"jsonSchema"in t&&"validate"in t?e:"~standard"in e?function(e){const t=e["~standard"].vendor;switch(t){case"zod":return ge(e);case"arktype":return fe(e,Y);case"effect":return fe(e,V);case"valibot":return fe(e,U);default:return fe(e,(()=>()=>{throw new Error(`Unsupported standard schema vendor: ${t}`)}))}}(e):e();var t}function fe(e,t){return me(t(e),{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new a.iM({value:t,cause:n.issues})}}})}function ve(e,t){var n;const a=null!=(n=null==t?void 0:t.useReferences)&&n;return me((()=>F(function(e,t){if(e instanceof r.rs){const n=new i(t),a={};for(const t of e._idmap.entries()){const[e,a]=t;n.process(a)}const r={},s={registry:e,uri:t?.uri,defs:a};for(const a of e._idmap.entries()){const[e,i]=a;r[e]=n.emit(i,{...t,external:s})}if(Object.keys(a).length>0){const e="draft-2020-12"===n.target?"$defs":"definitions";r.__shared={[e]:a}}return{schemas:r}}const n=new i(t);return n.process(e),n.emit(e,t)}(e,{target:"draft-7",io:"input",reused:a?"ref":"inline"}))),{validate:async t=>{const n=await l.bp(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function ge(e,t){return function(e){return"_zod"in e}(e)?ve(e,t):function(e,t){var n;const a=null!=(n=null==t?void 0:t.useReferences)&&n;return me((()=>ue(e,{$refStrategy:a?"root":"none"})),{validate:async t=>{const n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t)}async function ye({value:e,schema:t}){const n=await $e({value:e,schema:t});if(!n.success)throw a.iM.wrap({value:e,cause:n.error});return n.value}async function $e({value:e,schema:t}){const n=he(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};const t=await n.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:a.iM.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:a.iM.wrap({value:e,cause:t}),rawValue:e}}}async function be({text:e,schema:t}){try{const n=D(e);return null==t?{success:!0,value:n,rawValue:n}:await $e({value:n,schema:t})}catch(t){return{success:!1,error:a.u6.isInstance(t)?t:new a.u6({text:e,cause:t}),rawValue:void 0}}}function Ee(e){try{return D(e),!0}catch(e){return!1}}function _e({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new u.Z).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await be({text:e,schema:t}))}}))}async function Se({provider:e,providerOptions:t,schema:n}){if(null==(null==t?void 0:t[e]))return;const r=await $e({value:t[e],schema:n});if(!r.success)throw new a.Di({argument:"providerOptions",message:`invalid ${e} provider options`,cause:r.error});return r.value}var xe=()=>globalThis.fetch,Ae=async({url:e,headers:t,body:n,failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i})=>we({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i}),Ie=async({url:e,headers:t,formData:n,failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i})=>we({url:e,headers:t,body:{content:n,values:Object.fromEntries(n.entries())},failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i}),we=async({url:e,headers:t={},body:n,successfulResponseHandler:r,failedResponseHandler:s,abortSignal:i,fetch:o=xe()})=>{try{const l=await o(e,{method:"POST",headers:I(t,`ai-sdk/provider-utils/${w}`,x()),body:n.content,signal:i}),c=g(l);if(!l.ok){let t;try{t=await s({response:l,url:e,requestBodyValues:n.values})}catch(t){if(E(t)||a.hL.isInstance(t))throw t;throw new a.hL({message:"Failed to process error response",cause:t,statusCode:l.status,url:e,responseHeaders:c,requestBodyValues:n.values})}throw t.value}try{return await r({response:l,url:e,requestBodyValues:n.values})}catch(t){if(t instanceof Error&&(E(t)||a.hL.isInstance(t)))throw t;throw new a.hL({message:"Failed to process successful response",cause:t,statusCode:l.status,url:e,responseHeaders:c,requestBodyValues:n.values})}}catch(t){throw S({error:t,url:e,requestBodyValues:n.values})}};function Ne({id:e,inputSchema:t,outputSchema:n}){return({execute:a,needsApproval:r,toModelOutput:s,onInputStart:i,onInputDelta:o,onInputAvailable:l,...c})=>({type:"provider",id:e,args:c,inputSchema:t,outputSchema:n,execute:a,needsApproval:r,toModelOutput:s,onInputStart:i,onInputDelta:o,onInputAvailable:l})}async function Te(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var Oe=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:r,url:s,requestBodyValues:i})=>{const o=await r.text(),l=g(r);if(""===o.trim())return{responseHeaders:l,value:new a.hL({message:r.statusText,url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,isRetryable:null==n?void 0:n(r)})};try{const c=await async function({text:e,schema:t}){try{const n=D(e);return null==t?n:ye({value:n,schema:t})}catch(t){if(a.u6.isInstance(t)||a.iM.isInstance(t))throw t;throw new a.u6({text:e,cause:t})}}({text:o,schema:e});return{responseHeaders:l,value:new a.hL({message:t(c),url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,data:c,isRetryable:null==n?void 0:n(r,c)})}}catch(e){return{responseHeaders:l,value:new a.hL({message:r.statusText,url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,isRetryable:null==n?void 0:n(r)})}}},ke=e=>async({response:t})=>{const n=g(t);if(null==t.body)throw new a.Tt({});return{responseHeaders:n,value:_e({stream:t.body,schema:e})}},Re=e=>async({response:t,url:n,requestBodyValues:r})=>{const s=await t.text(),i=await be({text:s,schema:e}),o=g(t);if(!i.success)throw new a.hL({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:o,responseBody:s,url:n,requestBodyValues:r});return{responseHeaders:o,value:i.value,rawValue:i.rawValue}},Ce=()=>async({response:e,url:t,requestBodyValues:n})=>{const r=g(e);if(!e.body)throw new a.hL({message:"Response body is empty",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:r,responseBody:void 0});try{const t=await e.arrayBuffer();return{responseHeaders:r,value:new Uint8Array(t)}}catch(s){throw new a.hL({message:"Failed to read response as array buffer",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:r,responseBody:void 0,cause:s})}},{btoa:Le,atob:Pe}=globalThis;function Me(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=Pe(t);return Uint8Array.from(n,(e=>e.codePointAt(0)))}function je(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return Le(t)}function De(e){return e instanceof Uint8Array?je(e):e}function Fe(e){return null==e?void 0:e.replace(/\/$/,"")}async function*Ye({execute:e,input:t,options:n}){const a=e(t,n);if(null!=(r=a)&&"function"==typeof r[Symbol.asyncIterator]){let e;for await(const t of a)e=t,yield{type:"preliminary",output:t};yield{type:"final",output:e}}else yield{type:"final",output:await a};var r}},45962:(e,t,n)=>{var a,r;n.d(t,{BRAND:()=>Me,DIRTY:()=>$,EMPTY_PATH:()=>f,INVALID:()=>y,NEVER:()=>Tt,OK:()=>b,ParseStatus:()=>g,Schema:()=>O,ZodAny:()=>oe,ZodArray:()=>pe,ZodBigInt:()=>te,ZodBoolean:()=>ne,ZodBranded:()=>je,ZodCatch:()=>Le,ZodDate:()=>ae,ZodDefault:()=>Ce,ZodDiscriminatedUnion:()=>ve,ZodEffects:()=>Oe,ZodEnum:()=>we,ZodError:()=>c,ZodFirstPartyTypeKind:()=>qe,ZodFunction:()=>Se,ZodIntersection:()=>ye,ZodIssueCode:()=>o,ZodLazy:()=>xe,ZodLiteral:()=>Ae,ZodMap:()=>Ee,ZodNaN:()=>Pe,ZodNativeEnum:()=>Ne,ZodNever:()=>ce,ZodNull:()=>ie,ZodNullable:()=>Re,ZodNumber:()=>ee,ZodObject:()=>me,ZodOptional:()=>ke,ZodParsedType:()=>s,ZodPipeline:()=>De,ZodPromise:()=>Te,ZodReadonly:()=>Fe,ZodRecord:()=>be,ZodSchema:()=>O,ZodSet:()=>_e,ZodString:()=>J,ZodSymbol:()=>re,ZodTransformer:()=>Oe,ZodTuple:()=>$e,ZodType:()=>O,ZodUndefined:()=>se,ZodUnion:()=>he,ZodUnknown:()=>le,ZodVoid:()=>ue,addIssueToContext:()=>v,any:()=>et,array:()=>rt,bigint:()=>We,boolean:()=>He,coerce:()=>Nt,custom:()=>Ve,date:()=>Ke,datetimeRegex:()=>H,defaultErrorMap:()=>u,discriminatedUnion:()=>lt,effect:()=>bt,enum:()=>gt,function:()=>ht,getErrorMap:()=>m,getParsedType:()=>i,instanceof:()=>Be,intersection:()=>ct,isAborted:()=>E,isAsync:()=>x,isDirty:()=>_,isValid:()=>S,late:()=>Ue,lazy:()=>ft,literal:()=>vt,makeIssue:()=>h,map:()=>dt,nan:()=>Ge,nativeEnum:()=>yt,never:()=>nt,null:()=>Qe,nullable:()=>_t,number:()=>Ze,object:()=>st,objectUtil:()=>r,oboolean:()=>wt,onumber:()=>It,optional:()=>Et,ostring:()=>At,pipeline:()=>xt,preprocess:()=>St,promise:()=>$t,quotelessJson:()=>l,record:()=>pt,set:()=>mt,setErrorMap:()=>d,strictObject:()=>it,string:()=>ze,symbol:()=>Xe,transformer:()=>bt,tuple:()=>ut,undefined:()=>Je,union:()=>ot,unknown:()=>tt,util:()=>a,void:()=>at}),n.r(t),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of n)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a||(a={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const s=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),l=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class c extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(e){if(!(e instanceof c))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}c.create=e=>new c(e);const u=(e,t)=>{let n;switch(e.code){case o.invalid_type:n=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:n=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case o.invalid_union:n="Invalid input";break;case o.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case o.invalid_enum_value:n=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:n="Invalid function arguments";break;case o.invalid_return_type:n="Invalid function return type";break;case o.invalid_date:n="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:n="Invalid input";break;case o.invalid_intersection_types:n="Intersection results could not be merged";break;case o.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:n="Number must be finite";break;default:n=t.defaultError,a.assertNever(e)}return{message:n}};let p=u;function d(e){p=e}function m(){return p}const h=e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,s=[...n,...r.path||[]],i={...r,path:s};if(void 0!==r.message)return{...r,path:s,message:r.message};let o="";const l=a.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:o}},f=[];function v(e,t){const n=m(),a=h({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===u?void 0:u].filter((e=>!!e))});e.common.issues.push(a)}class g{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return y;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,a=await e.value;n.push({key:t,value:a})}return g.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return y;if("aborted"===r.status)return y;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),$=e=>({status:"dirty",value:e}),b=e=>({status:"valid",value:e}),E=e=>"aborted"===e.status,_=e=>"dirty"===e.status,S=e=>"valid"===e.status,x=e=>"undefined"!=typeof Promise&&e instanceof Promise;var A;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(A||(A={}));var I=n(9606).URL;class w{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const N=(e,t)=>{if(S(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new c(e.common.issues);return this._error=t,this._error}}};function T(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??r.defaultError}:void 0===r.data?{message:s??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:s??n??r.defaultError}},description:r}}class O{get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new g,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(x(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:n.path,parent:n});return N(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return S(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>S(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await(x(a)?a:Promise.resolve(a));return N(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const r=e(t),s=()=>a.addIssue({code:o.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(s(),!1))):!!r||(s(),!1)}))}refinement(e,t){return this._refinement(((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:qe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ke.create(this,this._def)}nullable(){return Re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pe.create(this)}promise(){return Te.create(this,this._def)}or(e){return he.create([this,e],this._def)}and(e){return ye.create(this,e,this._def)}transform(e){return new Oe({...T(this._def),schema:this,typeName:qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ce({...T(this._def),innerType:this,defaultValue:t,typeName:qe.ZodDefault})}brand(){return new je({typeName:qe.ZodBranded,type:this,...T(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Le({...T(this._def),innerType:this,catchValue:t,typeName:qe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return De.create(this,e)}readonly(){return Fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k=/^c[^\s-]{8,}$/i,R=/^[0-9a-z]+$/,C=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,P=/^[a-z0-9_-]{21}$/i,M=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,j=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,D=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let F;const Y=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,U=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,q=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Z="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",G=new RegExp(`^${Z}$`);function W(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function H(e){let t=`${Z}T${W(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function K(e,t){if(!M.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==r?.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function X(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!q.test(e))}class J extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),y}const t=new g;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const a=e.data.length>s.value,r=e.data.length<s.value;(a||r)&&(n=this._getOrReturnCtx(e,n),a?v(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&v(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)F||(F=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),F.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)P.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"nanoid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)k.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)C.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new I(e.data)}catch{n=this._getOrReturnCtx(e,n),v(n,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?H(s).test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?G.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${W(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?j.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"duration",code:o.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(i=s.version)&&i||!Y.test(r))&&("v6"!==i&&i||!U.test(r))&&(n=this._getOrReturnCtx(e,n),v(n,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):"jwt"===s.kind?K(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"jwt",code:o.invalid_string,message:s.message}),t.dirty()):"cidr"===s.kind?X(e.data,s.version)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"cidr",code:o.invalid_string,message:s.message}),t.dirty()):"base64"===s.kind?B.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"base64",code:o.invalid_string,message:s.message}),t.dirty()):"base64url"===s.kind?z.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"base64url",code:o.invalid_string,message:s.message}),t.dirty()):a.assertNever(s);var r,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...A.errToObj(n)})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...A.errToObj(e)})}url(e){return this._addCheck({kind:"url",...A.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...A.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...A.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...A.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...A.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...A.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...A.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...A.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...A.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...A.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...A.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...A.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...A.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...A.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...A.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...A.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...A.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...A.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...A.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...A.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...A.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...A.errToObj(t)})}nonempty(e){return this.min(1,A.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Q(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}J.create=e=>new J({checks:[],typeName:qe.ZodString,coerce:e?.coerce??!1,...T(e)});class ee extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),y}let t;const n=new g;for(const r of this._def.checks)"int"===r.kind?a.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:o.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==Q(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:o.not_finite,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,a){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(a)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:A.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:A.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ee.create=e=>new ee({checks:[],typeName:qe.ZodNumber,coerce:e?.coerce||!1,...T(e)});class te extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==s.bigint)return this._getInvalidInput(e);let t;const n=new g;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,a){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(a)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}te.create=e=>new te({checks:[],typeName:qe.ZodBigInt,coerce:e?.coerce??!1,...T(e)});class ne extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),y}return b(e.data)}}ne.create=e=>new ne({typeName:qe.ZodBoolean,coerce:e?.coerce||!1,...T(e)});class ae extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),y}if(Number.isNaN(e.data.getTime()))return v(this._getOrReturnCtx(e),{code:o.invalid_date}),y;const t=new g;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):a.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:A.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:A.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ae.create=e=>new ae({checks:[],coerce:e?.coerce||!1,typeName:qe.ZodDate,...T(e)});class re extends O{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),y}return b(e.data)}}re.create=e=>new re({typeName:qe.ZodSymbol,...T(e)});class se extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),y}return b(e.data)}}se.create=e=>new se({typeName:qe.ZodUndefined,...T(e)});class ie extends O{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),y}return b(e.data)}}ie.create=e=>new ie({typeName:qe.ZodNull,...T(e)});class oe extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}oe.create=e=>new oe({typeName:qe.ZodAny,...T(e)});class le extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}le.create=e=>new le({typeName:qe.ZodUnknown,...T(e)});class ce extends O{_parse(e){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),y}}ce.create=e=>new ce({typeName:qe.ZodNever,...T(e)});class ue extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),y}return b(e.data)}}ue.create=e=>new ue({typeName:qe.ZodVoid,...T(e)});class pe extends O{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==s.array)return v(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),y;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(v(t,{code:e?o.too_big:o.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(v(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(v(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new w(t,e,t.path,n))))).then((e=>g.mergeArray(n,e)));const r=[...t.data].map(((e,n)=>a.type._parseSync(new w(t,e,t.path,n))));return g.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new pe({...this._def,minLength:{value:e,message:A.toString(t)}})}max(e,t){return new pe({...this._def,maxLength:{value:e,message:A.toString(t)}})}length(e,t){return new pe({...this._def,exactLength:{value:e,message:A.toString(t)}})}nonempty(e){return this.min(1,e)}}function de(e){if(e instanceof me){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=ke.create(de(a))}return new me({...e._def,shape:()=>t})}return e instanceof pe?new pe({...e._def,type:de(e.element)}):e instanceof ke?ke.create(de(e.unwrap())):e instanceof Re?Re.create(de(e.unwrap())):e instanceof $e?$e.create(e.items.map((e=>de(e)))):e}pe.create=(e,t)=>new pe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qe.ZodArray,...T(t)});class me extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),y}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof ce&&"strip"===this._def.unknownKeys))for(const e in n.data)r.includes(e)||i.push(e);const l=[];for(const e of r){const t=a[e],r=n.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new w(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ce){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)l.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(v(n,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=n.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new w(n,a,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of l){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>g.mergeObjectSync(t,e))):g.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return A.errToObj,new me({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const a=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:A.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:qe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const t={};for(const n of a.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new me({...this._def,shape:()=>t})}omit(e){const t={};for(const n of a.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new me({...this._def,shape:()=>t})}deepPartial(){return de(this)}partial(e){const t={};for(const n of a.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new me({...this._def,shape:()=>t})}required(e){const t={};for(const n of a.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ke;)e=e._def.innerType;t[n]=e}return new me({...this._def,shape:()=>t})}keyof(){return Ie(a.objectKeys(this.shape))}}me.create=(e,t)=>new me({shape:()=>e,unknownKeys:"strip",catchall:ce.create(),typeName:qe.ZodObject,...T(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:"strict",catchall:ce.create(),typeName:qe.ZodObject,...T(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:"strip",catchall:ce.create(),typeName:qe.ZodObject,...T(t)});class he extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new c(e.ctx.common.issues)));return v(t,{code:o.invalid_union,unionErrors:n}),y}));{let e;const a=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map((e=>new c(e)));return v(t,{code:o.invalid_union,unionErrors:r}),y}}get options(){return this._def.options}}he.create=(e,t)=>new he({options:e,typeName:qe.ZodUnion,...T(t)});const fe=e=>e instanceof xe?fe(e.schema):e instanceof Oe?fe(e.innerType()):e instanceof Ae?[e.value]:e instanceof we?e.options:e instanceof Ne?a.objectValues(e.enum):e instanceof Ce?fe(e._def.innerType):e instanceof se?[void 0]:e instanceof ie?[null]:e instanceof ke?[void 0,...fe(e.unwrap())]:e instanceof Re?[null,...fe(e.unwrap())]:e instanceof je||e instanceof Fe?fe(e.unwrap()):e instanceof Le?fe(e._def.innerType):[];class ve extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return v(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),y;const n=this.discriminator,a=t.data[n],r=this.optionsMap.get(a);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const n of t){const t=fe(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(a.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);a.set(r,n)}}return new ve({typeName:qe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...T(n)})}}function ge(e,t){const n=i(e),r=i(t);if(e===t)return{valid:!0,data:e};if(n===s.object&&r===s.object){const n=a.objectKeys(t),r=a.objectKeys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const n of r){const a=ge(e[n],t[n]);if(!a.valid)return{valid:!1};s[n]=a.data}return{valid:!0,data:s}}if(n===s.array&&r===s.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=ge(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===s.date&&r===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ye extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(E(e)||E(a))return y;const r=ge(e.value,a.value);return r.valid?((_(e)||_(a))&&t.dirty(),{status:t.value,value:r.data}):(v(n,{code:o.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ye.create=(e,t,n)=>new ye({left:e,right:t,typeName:qe.ZodIntersection,...T(n)});class $e extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.array)return v(n,{code:o.invalid_type,expected:s.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return v(n,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new w(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>g.mergeArray(t,e))):g.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new $e({...this._def,rest:e})}}$e.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $e({items:e,typeName:qe.ZodTuple,rest:null,...T(t)})};class be extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.object)return v(n,{code:o.invalid_type,expected:s.object,received:n.parsedType}),y;const a=[],r=this._def.keyType,i=this._def.valueType;for(const e in n.data)a.push({key:r._parse(new w(n,e,n.path,e)),value:i._parse(new w(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?g.mergeObjectAsync(t,a):g.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return new be(t instanceof O?{keyType:e,valueType:t,typeName:qe.ZodRecord,...T(n)}:{keyType:J.create(),valueType:e,typeName:qe.ZodRecord,...T(t)})}}class Ee extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.map)return v(n,{code:o.invalid_type,expected:s.map,received:n.parsedType}),y;const a=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map((([e,t],s)=>({key:a._parse(new w(n,e,n.path,[s,"key"])),value:r._parse(new w(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return y;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return y;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}Ee.create=(e,t,n)=>new Ee({valueType:t,keyType:e,typeName:qe.ZodMap,...T(n)});class _e extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.set)return v(n,{code:o.invalid_type,expected:s.set,received:n.parsedType}),y;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(v(n,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(v(n,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const a of e){if("aborted"===a.status)return y;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const l=[...n.data.values()].map(((e,t)=>r._parse(new w(n,e,n.path,t))));return n.common.async?Promise.all(l).then((e=>i(e))):i(l)}min(e,t){return new _e({...this._def,minSize:{value:e,message:A.toString(t)}})}max(e,t){return new _e({...this._def,maxSize:{value:e,message:A.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_e.create=(e,t)=>new _e({valueType:e,minSize:null,maxSize:null,typeName:qe.ZodSet,...T(t)});class Se extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return v(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),y;function n(e,n){return h({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),u].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:n}})}function a(e,n){return h({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),u].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:n}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Te){const e=this;return b((async function(...t){const s=new c([]),o=await e._def.args.parseAsync(t,r).catch((e=>{throw s.addIssue(n(t,e)),s})),l=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(l,r).catch((e=>{throw s.addIssue(a(l,e)),s}))}))}{const e=this;return b((function(...t){const s=e._def.args.safeParse(t,r);if(!s.success)throw new c([n(t,s.error)]);const o=Reflect.apply(i,this,s.data),l=e._def.returns.safeParse(o,r);if(!l.success)throw new c([a(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Se({...this._def,args:$e.create(e).rest(le.create())})}returns(e){return new Se({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Se({args:e||$e.create([]).rest(le.create()),returns:t||le.create(),typeName:qe.ZodFunction,...T(n)})}}class xe extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}xe.create=(e,t)=>new xe({getter:e,typeName:qe.ZodLazy,...T(t)});class Ae extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new we({values:e,typeName:qe.ZodEnum,...T(t)})}Ae.create=(e,t)=>new Ae({value:e,typeName:qe.ZodLiteral,...T(t)});class we extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{expected:a.joinValues(n),received:t.parsedType,code:o.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{received:t.data,code:o.invalid_enum_value,options:n}),y}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return we.create(e,{...this._def,...t})}exclude(e,t=this._def){return we.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}we.create=Ie;class Ne extends O{_parse(e){const t=a.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==s.string&&n.parsedType!==s.number){const e=a.objectValues(t);return v(n,{expected:a.joinValues(e),received:n.parsedType,code:o.invalid_type}),y}if(this._cache||(this._cache=new Set(a.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=a.objectValues(t);return v(n,{received:n.data,code:o.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}}Ne.create=(e,t)=>new Ne({values:e,typeName:qe.ZodNativeEnum,...T(t)});class Te extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return v(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),y;const n=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return b(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Te.create=(e,t)=>new Te({type:e,typeName:qe.ZodPromise,...T(t)});class Oe extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{v(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return y;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?y:"dirty"===a.status||"dirty"===t.value?$(a.value):a}));{if("aborted"===t.value)return y;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?y:"dirty"===a.status||"dirty"===t.value?$(a.value):a}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?y:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?y:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!S(e))return y;const a=r.transform(e.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>S(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):y))}a.assertNever(r)}}Oe.create=(e,t,n)=>new Oe({schema:e,typeName:qe.ZodEffects,effect:t,...T(n)}),Oe.createWithPreprocess=(e,t,n)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:qe.ZodEffects,...T(n)});class ke extends O{_parse(e){return this._getType(e)===s.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ke.create=(e,t)=>new ke({innerType:e,typeName:qe.ZodOptional,...T(t)});class Re extends O{_parse(e){return this._getType(e)===s.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Re.create=(e,t)=>new Re({innerType:e,typeName:qe.ZodNullable,...T(t)});class Ce extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===s.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:qe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...T(t)});class Le extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return x(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new c(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new c(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Le.create=(e,t)=>new Le({innerType:e,typeName:qe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...T(t)});class Pe extends O{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),y}return{status:"valid",value:e.data}}}Pe.create=e=>new Pe({typeName:qe.ZodNaN,...T(e)});const Me=Symbol("zod_brand");class je extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class De extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),$(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new De({in:e,out:t,typeName:qe.ZodPipeline})}}class Fe extends O{_parse(e){const t=this._def.innerType._parse(e),n=e=>(S(e)&&(e.value=Object.freeze(e.value)),e);return x(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Ye(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Ve(e,t={},n){return e?oe.create().superRefine(((a,r)=>{const s=e(a);if(s instanceof Promise)return s.then((e=>{if(!e){const e=Ye(t,a),s=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:s})}}));if(!s){const e=Ye(t,a),s=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:s})}})):oe.create()}Fe.create=(e,t)=>new Fe({innerType:e,typeName:qe.ZodReadonly,...T(t)});const Ue={object:me.lazycreate};var qe;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(qe||(qe={}));const Be=(e,t={message:`Input not instance of ${e.name}`})=>Ve((t=>t instanceof e),t),ze=J.create,Ze=ee.create,Ge=Pe.create,We=te.create,He=ne.create,Ke=ae.create,Xe=re.create,Je=se.create,Qe=ie.create,et=oe.create,tt=le.create,nt=ce.create,at=ue.create,rt=pe.create,st=me.create,it=me.strictCreate,ot=he.create,lt=ve.create,ct=ye.create,ut=$e.create,pt=be.create,dt=Ee.create,mt=_e.create,ht=Se.create,ft=xe.create,vt=Ae.create,gt=we.create,yt=Ne.create,$t=Te.create,bt=Oe.create,Et=ke.create,_t=Re.create,St=Oe.createWithPreprocess,xt=De.create,At=()=>ze().optional(),It=()=>Ze().optional(),wt=()=>He().optional(),Nt={string:e=>J.create({...e,coerce:!0}),number:e=>ee.create({...e,coerce:!0}),boolean:e=>ne.create({...e,coerce:!0}),bigint:e=>te.create({...e,coerce:!0}),date:e=>ae.create({...e,coerce:!0})},Tt=y},46432:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},46699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},47530:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},47538:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},47755:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},47775:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)>=0},47969:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},48195:(e,t,n)=>{const a=n(12876),r=n(32674);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const c=[];for(const[e,t]of s)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},48381:(e,t,n)=>{const a=n(29385),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(24159),{safeRe:i,t:o}=n(92625),l=n(83214),{compareIdentifiers:c}=n(5286);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},48543:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},49976:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(22849),t),r(n(58516),t),r(n(77192),t),r(n(47530),t),r(n(63875),t),r(n(36744),t),r(n(91934),t),r(n(80417),t),r(n(28968),t),r(n(85426),t),r(n(86987),t),r(n(17624),t);var s=n(54316);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(69750),t),r(n(51778),t)},50066:(e,t,n)=>{const a=n(71598),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(47755),{safeRe:i,t:o}=n(65684),l=n(31145),{compareIdentifiers:c}=n(76393);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},50363:(e,t,n)=>{const a=n(38366);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},50678:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},51456:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(t,e,n)},51699:(e,t,n)=>{const a=n(65684),r=n(47755),s=n(50066),i=n(76393),o=n(38358),l=n(99451),c=n(97660),u=n(18157),p=n(59818),d=n(12815),m=n(4496),h=n(67223),f=n(86543),v=n(32674),g=n(17620),y=n(80321),$=n(9331),b=n(68821),E=n(71595),_=n(18106),S=n(28141),x=n(41755),A=n(97369),I=n(74227),w=n(24078),N=n(98249),T=n(67812),O=n(67094),k=n(72857),R=n(12876),C=n(70449),L=n(92222),P=n(540),M=n(29087),j=n(59984),D=n(99597),F=n(19789),Y=n(13012),V=n(11742),U=n(48195),q=n(40194);e.exports={parse:o,valid:l,clean:c,inc:u,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:E,gt:_,lt:S,eq:x,neq:A,gte:I,lte:w,cmp:N,coerce:T,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:L,minSatisfying:P,minVersion:M,validRange:j,outside:D,gtr:F,ltr:Y,intersects:V,simplifyRange:U,subset:q,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},51778:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(80184)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},52189:(e,t,n)=>{const a=n(33629);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},52378:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},52992:(e,t,n)=>{const a=n(33629);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},53266:(e,t,n)=>{n.d(t,{AC:()=>C,Ak:()=>l,Gl:()=>r,K3:()=>$,OI:()=>E,Os:()=>u,Rp:()=>d,Yj:()=>N,Z0:()=>s,Zg:()=>h,Zv:()=>L,ai:()=>O,ch:()=>R,fO:()=>o,gF:()=>a,hQ:()=>_,kB:()=>I,kM:()=>i,l7:()=>y,nd:()=>T,p0:()=>c,p6:()=>x,r0:()=>b,uR:()=>p,uX:()=>f,ug:()=>v,w$:()=>w,zM:()=>k,zr:()=>g});const a=/^[cC][^\s-]{8,}$/,r=/^[0-9a-z]+$/,s=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,i=/^[0-9a-vA-V]{20}$/,o=/^[A-Za-z0-9]{27}$/,l=/^[a-zA-Z0-9_-]{21}$/,c=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,p=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function h(){return new RegExp(m,"u")}const f=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,v=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,g=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b=/^[A-Za-z0-9_-]*$/,E=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,_=/^\+(?:[0-9]){6,14}[0-9]$/,S="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",x=new RegExp(`^${S}$`);function A(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I(e){return new RegExp(`^${A(e)}$`)}function w(e){const t=A({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${S}T(?:${a})$`)}const N=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),T=/^\d+$/,O=/^-?\d+(?:\.\d+)?/i,k=/true|false/i,R=/null/i,C=/^[^A-Z]*$/,L=/^[^a-z]*$/},53354:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(17807),t),r(n(5698),t),r(n(50678),t),r(n(66272),t),r(n(26633),t),r(n(20474),t),r(n(79188),t),r(n(93555),t),r(n(10094),t),r(n(86812),t),r(n(30629),t),r(n(21482),t);var s=n(69334);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(15580),t),r(n(10036),t)},53831:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>0===a(e,t,n)},54316:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(80184),r=n(22849),s=n(58516),i=n(77192),o=n(47530),l=n(36744),c=n(91934),u=n(28968),p=n(85426),d=n(86987);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...c.JSON_SCHEMA,...u.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},54506:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)>=0},54597:(e,t,n)=>{const a=n(40289);e.exports=(e,t)=>a(e,t,!0)},55069:(e,t,n)=>{n.d(t,{Zt:()=>r});var a=n(29299);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions;const r=a.wrapField},55141:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(83214),{safeRe:i,t:o}=n(92625),l=n(88108),c=n(29385),u=n(48381),p=n(20332)},56565:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t),t}},56741:(e,t,n)=>{const a=n(71333);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},56911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},57681:(e,t,n)=>{const a=n(9350),r=n(96506),{ANY:s}=r,i=n(33629),o=n(52992),l=n(42734),c=n(63825),u=n(90898),p=n(66135);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=u,f=c,v=">",g=">=";break;case"<":m=c,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},58313:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},58387:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(69348),{safeRe:i,t:o}=n(415),l=n(59382),c=n(67767),u=n(66283),p=n(38366)},58395:(e,t,n)=>{const a=n(9350);e.exports=(e,t)=>new a(e,t).patch},58516:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},58809:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)>0},59025:(e,t,n)=>{const a=n(99385);e.exports=(e,t,n)=>a(e,t,">",n)},59263:(e,t,n)=>{const a=n(52992),r=n(99430);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const c=[];for(const[e,t]of s)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},59382:(e,t,n)=>{const a=n(98746),r=n(78654),s=n(61607),i=n(15844),o=n(91152),l=n(80829);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,c);case"!=":return r(e,n,c);case">":return s(e,n,c);case">=":return i(e,n,c);case"<":return o(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},59441:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},59588:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},59591:(e,t,n)=>{const a=n(18104),r=n(4292),s=n(41694),i=n(90733),o=n(83586),l=n(20903),c=n(15144),u=n(89065),p=n(76654),d=n(86912),m=n(32924),h=n(65011),f=n(30403),v=n(40289),g=n(19896),y=n(54597),$=n(87391),b=n(42945),E=n(37359),_=n(43334),S=n(3449),x=n(94463),A=n(36749),I=n(47775),w=n(9418),N=n(94706),T=n(65816),O=n(96082),k=n(71333),R=n(9480),C=n(56741),L=n(34218),P=n(44016),M=n(77467),j=n(37276),D=n(99385),F=n(59025),Y=n(5992),V=n(73634),U=n(96775),q=n(36582);e.exports={parse:o,valid:l,clean:c,inc:u,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:E,gt:_,lt:S,eq:x,neq:A,gte:I,lte:w,cmp:N,coerce:T,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:L,minSatisfying:P,minVersion:M,validRange:j,outside:D,gtr:F,ltr:Y,intersects:V,simplifyRange:U,subset:q,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},59818:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,c=!!o.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"}},59984:(e,t,n)=>{const a=n(72857);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},60098:(e,t,n)=>{const a=n(9350),r=n(33629);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},60501:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},60679:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},61607:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)>0},62280:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},62525:(e,t,n)=>{const a=n(99430);e.exports=(e,t)=>a(e,t,!0)},62921:(e,t,n)=>{const a=n(57681);e.exports=(e,t,n)=>a(e,t,">",n)},63547:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},63825:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)<0},63875:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},63876:(e,t,n)=>{const a=n(24472);e.exports=(e,t,n)=>a(e,t,">",n)},64279:e=>{const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},64757:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(35647)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},65011:(e,t,n)=>{const a=n(41694);e.exports=(e,t)=>new a(e,t).patch},65684:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(47755),i=n(71598),o=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,c[r]=t,u[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),f("FULL",`^${c[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),f("LOOSE",`^${c[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),f("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${c[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[p.COERCEPLAIN]+`(?:${c[p.PRERELEASE]})?`+`(?:${c[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[p.COERCE],!0),f("COERCERTLFULL",c[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},65816:(e,t,n)=>{const a=n(41694),r=n(83586),{safeRe:s,t:i}=n(18104);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",c=n[4]||"0",u=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${c}${u}${p}`,t)}},66135:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)>=0},66239:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)<=0},66272:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},66283:(e,t,n)=>{const a=n(67767),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(77693),{safeRe:i,t:o}=n(415),l=n(69348),{compareIdentifiers:c}=n(78900);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return c(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},67094:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(31145),{safeRe:i,t:o}=n(65684),l=n(98249),c=n(71598),u=n(50066),p=n(72857)},67223:(e,t,n)=>{const a=n(50066);e.exports=(e,t)=>new a(e,t).patch},67360:(e,t,n)=>{const a=n(85216);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},67767:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},67812:(e,t,n)=>{const a=n(50066),r=n(38358),{safeRe:s,t:i}=n(65684);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",c=n[4]||"0",u=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${c}${u}${p}`,t)}},67994:(e,t,n)=>{const a=n(60501);e.exports=(e,t)=>a(e,t,!0)},68716:(e,t,n)=>{const a=n(77203);e.exports=(e,t)=>a(e,t,!0)},68752:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(28892),i=n(52378),o=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,c[r]=t,u[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),f("FULL",`^${c[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),f("LOOSE",`^${c[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),f("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${c[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[p.COERCEPLAIN]+`(?:${c[p.PRERELEASE]})?`+`(?:${c[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[p.COERCE],!0),f("COERCERTLFULL",c[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},68821:(e,t,n)=>{const a=n(9331);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},69334:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(41738),r=n(17807),s=n(5698),i=n(50678),o=n(66272),l=n(20474),c=n(79188),u=n(10094),p=n(86812),d=n(30629);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...c.JSON_SCHEMA,...u.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},69348:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},69750:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},69904:(e,t,n)=>{const a=n(57681);e.exports=(e,t,n)=>a(e,t,"<",n)},70449:(e,t,n)=>{const a=n(72857);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},70545:(e,t,n)=>{var a=n(65994).e;e.exports=async function(e,t,n,s){n instanceof Function&&(s=n,n={});const u=async function(e,t,n={}){let s,u;"string"==typeof n&&(n={encoding:n});const p=i(m((()=>u))),f=o.resolve(e);try{await function(e){return new Promise((t=>{c[e]||(c[e]=[]),c[e].push(t),1===c[e].length&&t()}))}(f);const i=await l(r.realpath)(e).catch((()=>e));if(u=d(i),!n.mode||!n.chown){const e=await l(r.stat)(i).catch((()=>{}));e&&(null==n.mode&&(n.mode=e.mode),null==n.chown&&a.getuid&&(n.chown={uid:e.uid,gid:e.gid}))}s=await l(r.open)(u,"w",n.mode),n.tmpfileCreated&&await n.tmpfileCreated(u),ArrayBuffer.isView(t)?await l(r.write)(s,t,0,t.length,0):null!=t&&await l(r.write)(s,String(t),0,String(n.encoding||"utf8")),!1!==n.fsync&&await l(r.fsync)(s),await l(r.close)(s),s=null,n.chown&&await l(r.chown)(u,n.chown.uid,n.chown.gid).catch((e=>{if(!h(e))throw e})),n.mode&&await l(r.chmod)(u,n.mode).catch((e=>{if(!h(e))throw e})),await l(r.rename)(u,i)}finally{s&&await l(r.close)(s).catch((()=>{})),p(),await l(r.unlink)(u).catch((()=>{})),c[f].shift(),c[f].length>0?c[f][0]():delete c[f]}}(e,t,n);if(s)try{return s(await u)}catch(e){return s(e)}return u},e.exports.sync=function(e,t,n){"string"==typeof n?n={encoding:n}:n||(n={});try{e=r.realpathSync(e)}catch(e){}const s=d(e);if(!n.mode||!n.chown)try{const t=r.statSync(e);(n=Object.assign({},n)).mode||(n.mode=t.mode),!n.chown&&a.getuid&&(n.chown={uid:t.uid,gid:t.gid})}catch(e){}let o;const l=m(s),c=i(l);let u=!0;try{if(o=r.openSync(s,"w",n.mode||438),n.tmpfileCreated&&n.tmpfileCreated(s),ArrayBuffer.isView(t)?r.writeSync(o,t,0,t.length,0):null!=t&&r.writeSync(o,String(t),0,String(n.encoding||"utf8")),!1!==n.fsync&&r.fsyncSync(o),r.closeSync(o),o=null,n.chown)try{r.chownSync(s,n.chown.uid,n.chown.gid)}catch(e){if(!h(e))throw e}if(n.mode)try{r.chmodSync(s,n.mode)}catch(e){if(!h(e))throw e}r.renameSync(s,e),u=!1}finally{if(o)try{r.closeSync(o)}catch(e){}c(),u&&l()}},e.exports._getTmpname=d,e.exports._cleanupOnExit=m;const r=n(36374),s=n(88906),{onExit:i}=n(41163),o=n(17642),{promisify:l}=n(98437),c={},u=function(){try{return n(86983).threadId}catch(e){return 0}}();let p=0;function d(e){return e+"."+s("/index.js").hash(String(a.pid)).hash(String(u)).hash(String(++p)).result()}function m(e){return()=>{try{r.unlinkSync("function"==typeof e?e():e)}catch{}}}function h(e){return"ENOSYS"===e.code||!(a.getuid&&0===a.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code)}},71174:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},71333:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(u[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(u[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>T(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE]))))),l("range list",i);const c=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const $=[...c.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(21212)),i=n(8573),o=n(96082),l=n(72082),c=n(41694),{safeRe:u,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(18104),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(4292),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=x(e,t),l("caret",e),e=_(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=N(e,t),l("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),E(n)?i="":E(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),E(n)?o="":E(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:E(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const c=E(r),u=c||E(s),p=u||E(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(u&&(s=0),i=0,">"===a?(a=">=",u?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",u?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):u?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,c,u,p,d)=>`${n=E(a)?"":E(r)?`>=${a}.0.0${e?"-0":""}`:E(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${p}-${d}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},71595:(e,t,n)=>{const a=n(9331);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},71598:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},71773:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(t,e,n)},71925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(97008),r=n(59588),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const c=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=c},72082:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},72857:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(u[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(u[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>T(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[p.COMPARATORLOOSE]))))),l("range list",i);const c=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const $=[...c.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(13016)),i=n(31145),o=n(67094),l=n(71598),c=n(50066),{safeRe:u,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(65684),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(47755),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=x(e,t),l("caret",e),e=_(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=N(e,t),l("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),E(n)?i="":E(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),E(n)?o="":E(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:E(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const c=E(r),u=c||E(s),p=u||E(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",c?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(u&&(s=0),i=0,">"===a?(a=">=",u?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",u?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):u?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),T=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,c,u,p,d)=>`${n=E(a)?"":E(r)?`>=${a}.0.0${e?"-0":""}`:E(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=E(c)?"":E(u)?`<${+c+1}.0.0-0`:E(p)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${p}-${d}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},73634:(e,t,n)=>{const a=n(71333);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},73746:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},74145:(e,t,n)=>{const a=n(48381);e.exports=(e,t)=>new a(e,t).minor},74227:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)>=0},75689:(e,t,n)=>{const a=n(66283),r=n(59441),{safeRe:s,t:i}=n(415);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",c=n[4]||"0",u=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${c}${u}${p}`,t)}},76130:(e,t,n)=>{const a=n(32910);e.exports=(e,t,n)=>a(e,t,">",n)},76393:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},76654:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,c=!!o.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"}},77192:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},77203:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},77277:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,c=!!o.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"}},77467:(e,t,n)=>{const a=n(41694),r=n(71333),s=n(43334);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},77693:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},77926:(e,t,n)=>{n.d(t,{JM:()=>l,Kd:()=>o,Wk:()=>c,a$:()=>i});var a=n(36710),r=n(87257);const s=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,r.k8,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},i=(0,a.xI)("$ZodError",s),o=(0,a.xI)("$ZodError",s,{Parent:Error});function l(e,t=e=>e.message){const n={},a=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:n}}function c(e,t){const n=t||function(e){return e.message},a={_errors:[]},r=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>r({issues:e})));else if("invalid_key"===t.code)r({issues:t.issues});else if("invalid_element"===t.code)r({issues:t.issues});else if(0===t.path.length)a._errors.push(n(t));else{let e=a,r=0;for(;r<t.path.length;){const a=t.path[r];r===t.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(n(t))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(e),a}},77973:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},78145:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(59591),r=n(46432),s=n(81379),i=n(34889),o=n(82663),l=n(47969),c=n(17941),u=n(28131),p=n(19133),d=n(10282);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...c.JSON_SCHEMA,...u.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},78519:(e,t,n)=>{const a=n(20332);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},78654:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>0!==a(e,t,n)},78853:(e,t,n)=>{const a=n(48381);e.exports=(e,t)=>new a(e,t).major},78900:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},79188:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},80003:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},80184:(e,t,n)=>{const a=n(415),r=n(77693),s=n(66283),i=n(78900),o=n(59441),l=n(22156),c=n(35735),u=n(73746),p=n(9703),d=n(36719),m=n(32939),h=n(91716),f=n(20242),v=n(60501),g=n(71773),y=n(67994),$=n(85216),b=n(67360),E=n(10760),_=n(61607),S=n(91152),x=n(98746),A=n(78654),I=n(15844),w=n(80829),N=n(59382),T=n(75689),O=n(58387),k=n(38366),R=n(50363),C=n(32654),L=n(5081),P=n(96675),M=n(25546),j=n(92945),D=n(24472),F=n(63876),Y=n(94045),V=n(88345),U=n(21148),q=n(82913);e.exports={parse:o,valid:l,clean:c,inc:u,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:E,gt:_,lt:S,eq:x,neq:A,gte:I,lte:w,cmp:N,coerce:T,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:L,minSatisfying:P,minVersion:M,validRange:j,outside:D,gtr:F,ltr:Y,intersects:V,simplifyRange:U,subset:q,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},80321:(e,t,n)=>{const a=n(32674);e.exports=(e,t)=>a(e,t,!0)},80417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},80661:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},80829:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)<=0},81379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},82214:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,c=!!o.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"}},82663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},82913:(e,t,n)=>{const a=n(38366),r=n(58387),{ANY:s}=r,i=n(50363),o=n(60501),l=[new r(">=0.0.0-0")],c=[new r(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=c}const a=new Set;let r,u,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?u=d(u,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&u){if(m=o(r.semver,u.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==u.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(u&&!i(e,String(u),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(u)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(u,e,n),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),n))return!1;if(!e.operator&&(u||r)&&0!==m)return!1}return!(r&&v&&!u&&0!==m||u&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=u(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},82981:(e,t,n)=>{n.d(t,{ry:()=>ke});var a=n(45890),r=n(12240),s=n(86224),i=n(42937),o=n(9606).URL,l=s.Ik({error:s.Ik({message:s.Yj(),type:s.Yj().nullish(),param:s.bz().nullish(),code:s.KC([s.Yj(),s.ai()]).nullish()})}),c=(0,a.sl)({errorSchema:l,errorToMessage:e=>e.error.message});function u(e){const t=e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),n=e.startsWith("gpt-4")||e.startsWith("gpt-5-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-nano")&&!e.startsWith("gpt-5-chat")||e.startsWith("o3")||e.startsWith("o4-mini"),a=!(e.startsWith("gpt-3")||e.startsWith("gpt-4")||e.startsWith("chatgpt-4o")||e.startsWith("gpt-5-chat"));return{supportsFlexProcessing:t,supportsPriorityProcessing:n,isReasoningModel:a,systemMessageMode:a?"developer":"system",supportsNonReasoningParameters:e.startsWith("gpt-5.1")}}function p(e){var t,n,a,r,s,i;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const o=null!=(t=e.prompt_tokens)?t:0,l=null!=(n=e.completion_tokens)?n:0,c=null!=(r=null==(a=e.prompt_tokens_details)?void 0:a.cached_tokens)?r:0,u=null!=(i=null==(s=e.completion_tokens_details)?void 0:s.reasoning_tokens)?i:0;return{inputTokens:{total:o,noCache:o-c,cacheRead:c,cacheWrite:void 0},outputTokens:{total:l,text:l-u,reasoning:u},raw:e}}function d({id:e,model:t,created:n}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:n?new Date(1e3*n):void 0}}function m(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var h=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({message:s.Ik({role:s.eu("assistant").nullish(),content:s.Yj().nullish(),tool_calls:s.YO(s.Ik({id:s.Yj().nullish(),type:s.eu("function"),function:s.Ik({name:s.Yj(),arguments:s.Yj()})})).nullish(),annotations:s.YO(s.Ik({type:s.eu("url_citation"),url_citation:s.Ik({start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()})})).nullish()}),index:s.ai(),logprobs:s.Ik({content:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}).nullish(),finish_reason:s.Yj().nullish()})),usage:s.Ik({prompt_tokens:s.ai().nullish(),completion_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),prompt_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),completion_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish(),accepted_prediction_tokens:s.ai().nullish(),rejected_prediction_tokens:s.ai().nullish()}).nullish()}).nullish()})))),f=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({delta:s.Ik({role:s.k5(["assistant"]).nullish(),content:s.Yj().nullish(),tool_calls:s.YO(s.Ik({index:s.ai(),id:s.Yj().nullish(),type:s.eu("function").nullish(),function:s.Ik({name:s.Yj().nullish(),arguments:s.Yj().nullish()})})).nullish(),annotations:s.YO(s.Ik({type:s.eu("url_citation"),url_citation:s.Ik({start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()})})).nullish()}).nullish(),logprobs:s.Ik({content:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}).nullish(),finish_reason:s.Yj().nullish(),index:s.ai()})),usage:s.Ik({prompt_tokens:s.ai().nullish(),completion_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),prompt_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),completion_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish(),accepted_prediction_tokens:s.ai().nullish(),rejected_prediction_tokens:s.ai().nullish()}).nullish()}).nullish()}),l])))),v=(0,a.ID)((()=>(0,a.jN)(s.Ik({logitBias:s.g1(i.qG(s.rS,undefined),s.ai()).optional(),logprobs:s.KC([s.zM(),s.ai()]).optional(),parallelToolCalls:s.zM().optional(),user:s.Yj().optional(),reasoningEffort:s.k5(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:s.ai().optional(),store:s.zM().optional(),metadata:s.g1(s.Yj().max(64),s.Yj().max(512)).optional(),prediction:s.g1(s.Yj(),s.bz()).optional(),serviceTier:s.k5(["auto","flex","priority","default"]).optional(),strictJsonSchema:s.zM().optional(),textVerbosity:s.k5(["low","medium","high"]).optional(),promptCacheKey:s.Yj().optional(),promptCacheRetention:s.k5(["in_memory","24h"]).optional(),safetyIdentifier:s.Yj().optional()})))),g=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:s,topK:i,frequencyPenalty:l,presencePenalty:c,stopSequences:p,responseFormat:d,seed:m,tools:h,toolChoice:f,providerOptions:g}){var y,$,b;const E=[],_=null!=(y=await(0,a.xI)({provider:"openai",providerOptions:g,schema:v}))?y:{},S=u(this.modelId);null!=i&&E.push({type:"unsupported",feature:"topK"});const{messages:x,warnings:A}=function({prompt:e,systemMessageMode:t="system"}){var n;const s=[],i=[];for(const{role:l,content:c}of e)switch(l){case"system":switch(t){case"system":s.push({role:"system",content:c});break;case"developer":s.push({role:"developer",content:c});break;case"remove":i.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${t}`)}break;case"user":if(1===c.length&&"text"===c[0].type){s.push({role:"user",content:c[0].text});break}s.push({role:"user",content:c.map(((e,t)=>{var n,s,i;switch(e.type){case"text":return{type:"text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"image_url",image_url:{url:e.data instanceof o?e.data.toString():`data:${t};base64,${(0,a.ej)(e.data)}`,detail:null==(s=null==(n=e.providerOptions)?void 0:n.openai)?void 0:s.imageDetail}}}if(!e.mediaType.startsWith("audio/")){if("application/pdf"===e.mediaType){if(e.data instanceof o)throw new r.b8({functionality:"PDF file parts with URLs"});return{type:"file",file:"string"==typeof e.data&&e.data.startsWith("file-")?{file_id:e.data}:{filename:null!=(i=e.filename)?i:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${(0,a.ej)(e.data)}`}}}throw new r.b8({functionality:`file part media type ${e.mediaType}`})}if(e.data instanceof o)throw new r.b8({functionality:"audio file parts with URLs"});switch(e.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:(0,a.ej)(e.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:(0,a.ej)(e.data),format:"mp3"}};default:throw new r.b8({functionality:`audio content parts with media type ${e.mediaType}`})}}}))});break;case"assistant":{let e="";const t=[];for(const n of c)switch(n.type){case"text":e+=n.text;break;case"tool-call":t.push({id:n.toolCallId,type:"function",function:{name:n.toolName,arguments:JSON.stringify(n.input)}})}s.push({role:"assistant",content:e,tool_calls:t.length>0?t:void 0});break}case"tool":for(const e of c){const t=e.output;let a;switch(t.type){case"text":case"error-text":a=t.value;break;case"execution-denied":a=null!=(n=t.reason)?n:"Tool execution denied.";break;case"content":case"json":case"error-json":a=JSON.stringify(t.value)}s.push({role:"tool",tool_call_id:e.toolCallId,content:a})}break;default:throw new Error(`Unsupported role: ${l}`)}return{messages:s,warnings:i}}({prompt:e,systemMessageMode:S.systemMessageMode});E.push(...A);const I=null==($=_.strictJsonSchema)||$,w={model:this.modelId,logit_bias:_.logitBias,logprobs:!0===_.logprobs||"number"==typeof _.logprobs||void 0,top_logprobs:"number"==typeof _.logprobs?_.logprobs:"boolean"==typeof _.logprobs&&_.logprobs?0:void 0,user:_.user,parallel_tool_calls:_.parallelToolCalls,max_tokens:t,temperature:n,top_p:s,frequency_penalty:l,presence_penalty:c,response_format:"json"===(null==d?void 0:d.type)?null!=d.schema?{type:"json_schema",json_schema:{schema:d.schema,strict:I,name:null!=(b=d.name)?b:"response",description:d.description}}:{type:"json_object"}:void 0,stop:p,seed:m,verbosity:_.textVerbosity,max_completion_tokens:_.maxCompletionTokens,store:_.store,metadata:_.metadata,prediction:_.prediction,reasoning_effort:_.reasoningEffort,service_tier:_.serviceTier,prompt_cache_key:_.promptCacheKey,prompt_cache_retention:_.promptCacheRetention,safety_identifier:_.safetyIdentifier,messages:x};S.isReasoningModel?("none"===_.reasoningEffort&&S.supportsNonReasoningParameters||(null!=w.temperature&&(w.temperature=void 0,E.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=w.top_p&&(w.top_p=void 0,E.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),null!=w.logprobs&&(w.logprobs=void 0,E.push({type:"other",message:"logprobs is not supported for reasoning models"}))),null!=w.frequency_penalty&&(w.frequency_penalty=void 0,E.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),null!=w.presence_penalty&&(w.presence_penalty=void 0,E.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),null!=w.logit_bias&&(w.logit_bias=void 0,E.push({type:"other",message:"logitBias is not supported for reasoning models"})),null!=w.top_logprobs&&(w.top_logprobs=void 0,E.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),null!=w.max_tokens&&(null==w.max_completion_tokens&&(w.max_completion_tokens=w.max_tokens),w.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&null!=w.temperature&&(w.temperature=void 0,E.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),"flex"!==_.serviceTier||S.supportsFlexProcessing||(E.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),w.service_tier=void 0),"priority"!==_.serviceTier||S.supportsPriorityProcessing||(E.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),w.service_tier=void 0);const{tools:N,toolChoice:T,toolWarnings:O}=function({tools:e,toolChoice:t}){const n=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:n};const a=[];for(const t of e)"function"===t.type?a.push({type:"function",function:{name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}}}):n.push({type:"unsupported",feature:`tool type: ${t.type}`});if(null==t)return{tools:a,toolChoice:void 0,toolWarnings:n};const s=t.type;switch(s){case"auto":case"none":case"required":return{tools:a,toolChoice:s,toolWarnings:n};case"tool":return{tools:a,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{const e=s;throw new r.b8({functionality:`tool choice type: ${e}`})}}}({tools:h,toolChoice:f});return{args:{...w,tools:N,tool_choice:T},warnings:[...E,...O]}}async doGenerate(e){var t,n,r,s,i,o;const{args:l,warnings:u}=await this.getArgs(e),{responseHeaders:f,value:v,rawValue:g}=await(0,a.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:l,failedResponseHandler:c,successfulResponseHandler:(0,a.cV)(h),abortSignal:e.abortSignal,fetch:this.config.fetch}),y=v.choices[0],$=[],b=y.message.content;null!=b&&b.length>0&&$.push({type:"text",text:b});for(const e of null!=(t=y.message.tool_calls)?t:[])$.push({type:"tool-call",toolCallId:null!=(n=e.id)?n:(0,a.$C)(),toolName:e.function.name,input:e.function.arguments});for(const e of null!=(r=y.message.annotations)?r:[])$.push({type:"source",sourceType:"url",id:(0,a.$C)(),url:e.url_citation.url,title:e.url_citation.title});const E=null==(s=v.usage)?void 0:s.completion_tokens_details,_=(null==(i=v.usage)||i.prompt_tokens_details,{openai:{}});return null!=(null==E?void 0:E.accepted_prediction_tokens)&&(_.openai.acceptedPredictionTokens=null==E?void 0:E.accepted_prediction_tokens),null!=(null==E?void 0:E.rejected_prediction_tokens)&&(_.openai.rejectedPredictionTokens=null==E?void 0:E.rejected_prediction_tokens),null!=(null==(o=y.logprobs)?void 0:o.content)&&(_.openai.logprobs=y.logprobs.content),{content:$,finishReason:m(y.finish_reason),usage:p(v.usage),request:{body:l},response:{...d(v),headers:f,body:g},warnings:u,providerMetadata:_}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),s={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:i,value:o}=await(0,a.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:s,failedResponseHandler:c,successfulResponseHandler:(0,a.Ds)(f),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=[];let u,h="unknown",v=!1,g=!1;const y={openai:{}};return{stream:o.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){var s,i,o,c,p,f,$,b,E,_,S,x,A,I,w,N,T;if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return h="error",void n.enqueue({type:"error",error:t.error});const O=t.value;if("error"in O)return h="error",void n.enqueue({type:"error",error:O.error});if(!v){const e=d(O);Object.values(e).some(Boolean)&&(v=!0,n.enqueue({type:"response-metadata",...d(O)}))}null!=O.usage&&(u=O.usage,null!=(null==(s=O.usage.completion_tokens_details)?void 0:s.accepted_prediction_tokens)&&(y.openai.acceptedPredictionTokens=null==(i=O.usage.completion_tokens_details)?void 0:i.accepted_prediction_tokens),null!=(null==(o=O.usage.completion_tokens_details)?void 0:o.rejected_prediction_tokens)&&(y.openai.rejectedPredictionTokens=null==(c=O.usage.completion_tokens_details)?void 0:c.rejected_prediction_tokens));const k=O.choices[0];if(null!=(null==k?void 0:k.finish_reason)&&(h=m(k.finish_reason)),null!=(null==(p=null==k?void 0:k.logprobs)?void 0:p.content)&&(y.openai.logprobs=k.logprobs.content),null==(null==k?void 0:k.delta))return;const R=k.delta;if(null!=R.content&&(g||(n.enqueue({type:"text-start",id:"0"}),g=!0),n.enqueue({type:"text-delta",id:"0",delta:R.content})),null!=R.tool_calls)for(const e of R.tool_calls){const t=e.index;if(null==l[t]){if("function"!==e.type)throw new r.xn({data:e,message:"Expected 'function' type."});if(null==e.id)throw new r.xn({data:e,message:"Expected 'id' to be a string."});if(null==(null==(f=e.function)?void 0:f.name))throw new r.xn({data:e,message:"Expected 'function.name' to be a string."});n.enqueue({type:"tool-input-start",id:e.id,toolName:e.function.name}),l[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=($=e.function.arguments)?$:""},hasFinished:!1};const s=l[t];null!=(null==(b=s.function)?void 0:b.name)&&null!=(null==(E=s.function)?void 0:E.arguments)&&(s.function.arguments.length>0&&n.enqueue({type:"tool-input-delta",id:s.id,delta:s.function.arguments}),(0,a.v0)(s.function.arguments)&&(n.enqueue({type:"tool-input-end",id:s.id}),n.enqueue({type:"tool-call",toolCallId:null!=(_=s.id)?_:(0,a.$C)(),toolName:s.function.name,input:s.function.arguments}),s.hasFinished=!0));continue}const s=l[t];s.hasFinished||(null!=(null==(S=e.function)?void 0:S.arguments)&&(s.function.arguments+=null!=(A=null==(x=e.function)?void 0:x.arguments)?A:""),n.enqueue({type:"tool-input-delta",id:s.id,delta:null!=(I=e.function.arguments)?I:""}),null!=(null==(w=s.function)?void 0:w.name)&&null!=(null==(N=s.function)?void 0:N.arguments)&&(0,a.v0)(s.function.arguments)&&(n.enqueue({type:"tool-input-end",id:s.id}),n.enqueue({type:"tool-call",toolCallId:null!=(T=s.id)?T:(0,a.$C)(),toolName:s.function.name,input:s.function.arguments}),s.hasFinished=!0))}if(null!=R.annotations)for(const e of R.annotations)n.enqueue({type:"source",sourceType:"url",id:(0,a.$C)(),url:e.url_citation.url,title:e.url_citation.title})},flush(e){g&&e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:h,usage:p(u),...null!=y?{providerMetadata:y}:{}})}})),request:{body:s},response:{headers:i}}}};function y(e){var t,n,a,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const s=null!=(t=e.prompt_tokens)?t:0,i=null!=(n=e.completion_tokens)?n:0;return{inputTokens:{total:null!=(a=e.prompt_tokens)?a:void 0,noCache:s,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:null!=(r=e.completion_tokens)?r:void 0,text:i,reasoning:void 0},raw:e}}function $({id:e,model:t,created:n}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=n?new Date(1e3*n):void 0}}function b(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var E=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({text:s.Yj(),finish_reason:s.Yj(),logprobs:s.Ik({tokens:s.YO(s.Yj()),token_logprobs:s.YO(s.ai()),top_logprobs:s.YO(s.g1(s.Yj(),s.ai())).nullish()}).nullish()})),usage:s.Ik({prompt_tokens:s.ai(),completion_tokens:s.ai(),total_tokens:s.ai()}).nullish()})))),_=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({text:s.Yj(),finish_reason:s.Yj().nullish(),index:s.ai(),logprobs:s.Ik({tokens:s.YO(s.Yj()),token_logprobs:s.YO(s.ai()),top_logprobs:s.YO(s.g1(s.Yj(),s.ai())).nullish()}).nullish()})),usage:s.Ik({prompt_tokens:s.ai(),completion_tokens:s.ai(),total_tokens:s.ai()}).nullish()}),l])))),S=(0,a.ID)((()=>(0,a.jN)(s.Ik({echo:s.zM().optional(),logitBias:s.g1(s.Yj(),s.ai()).optional(),suffix:s.Yj().optional(),user:s.Yj().optional(),logprobs:s.KC([s.zM(),s.ai()]).optional()})))),x=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={},this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:s,topK:i,frequencyPenalty:o,presencePenalty:l,stopSequences:c,responseFormat:u,tools:p,toolChoice:d,seed:m,providerOptions:h}){const f=[],v={...await(0,a.xI)({provider:"openai",providerOptions:h,schema:S}),...await(0,a.xI)({provider:this.providerOptionsName,providerOptions:h,schema:S})};null!=i&&f.push({type:"unsupported",feature:"topK"}),(null==p?void 0:p.length)&&f.push({type:"unsupported",feature:"tools"}),null!=d&&f.push({type:"unsupported",feature:"toolChoice"}),null!=u&&"text"!==u.type&&f.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});const{prompt:g,stopSequences:y}=function({prompt:e,user:t="user",assistant:n="assistant"}){let a="";"system"===e[0].role&&(a+=`${e[0].content}\n\n`,e=e.slice(1));for(const{role:s,content:i}of e)switch(s){case"system":throw new r.M3({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":a+=`${t}:\n${i.map((e=>{if("text"===e.type)return e.text})).filter(Boolean).join("")}\n\n`;break;case"assistant":a+=`${n}:\n${i.map((e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new r.b8({functionality:"tool-call messages"})}})).join("")}\n\n`;break;case"tool":throw new r.b8({functionality:"tool messages"});default:throw new Error(`Unsupported role: ${s}`)}return a+=`${n}:\n`,{prompt:a,stopSequences:[`\n${t}:`]}}({prompt:e}),$=[...null!=y?y:[],...null!=c?c:[]];return{args:{model:this.modelId,echo:v.echo,logit_bias:v.logitBias,logprobs:!0===(null==v?void 0:v.logprobs)?0:!1===(null==v?void 0:v.logprobs)||null==v?void 0:v.logprobs,suffix:v.suffix,user:v.user,max_tokens:t,temperature:n,top_p:s,frequency_penalty:o,presence_penalty:l,seed:m,prompt:g,stop:$.length>0?$:void 0},warnings:f}}async doGenerate(e){const{args:t,warnings:n}=await this.getArgs(e),{responseHeaders:r,value:s,rawValue:i}=await(0,a.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:t,failedResponseHandler:c,successfulResponseHandler:(0,a.cV)(E),abortSignal:e.abortSignal,fetch:this.config.fetch}),o=s.choices[0],l={openai:{}};return null!=o.logprobs&&(l.openai.logprobs=o.logprobs),{content:[{type:"text",text:o.text}],usage:y(s.usage),finishReason:b(o.finish_reason),request:{body:t},response:{...$(s),headers:r,body:i},providerMetadata:l,warnings:n}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),r={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:s,value:i}=await(0,a.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:r,failedResponseHandler:c,successfulResponseHandler:(0,a.Ds)(_),abortSignal:e.abortSignal,fetch:this.config.fetch});let o="unknown";const l={openai:{}};let u,p=!0;return{stream:i.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return o="error",void n.enqueue({type:"error",error:t.error});const a=t.value;if("error"in a)return o="error",void n.enqueue({type:"error",error:a.error});p&&(p=!1,n.enqueue({type:"response-metadata",...$(a)}),n.enqueue({type:"text-start",id:"0"})),null!=a.usage&&(u=a.usage);const r=a.choices[0];null!=(null==r?void 0:r.finish_reason)&&(o=b(r.finish_reason)),null!=(null==r?void 0:r.logprobs)&&(l.openai.logprobs=r.logprobs),null!=(null==r?void 0:r.text)&&r.text.length>0&&n.enqueue({type:"text-delta",id:"0",delta:r.text})},flush(e){p||e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:o,providerMetadata:l,usage:y(u)})}})),request:{body:r},response:{headers:s}}}},A=(0,a.ID)((()=>(0,a.jN)(s.Ik({dimensions:s.ai().optional(),user:s.Yj().optional()})))),I=(0,a.ID)((()=>(0,a.jN)(s.Ik({data:s.YO(s.Ik({embedding:s.YO(s.ai())})),usage:s.Ik({prompt_tokens:s.ai()}).nullish()})))),w=class{constructor(e,t){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:s}){var i;if(e.length>this.maxEmbeddingsPerCall)throw new r.Ch({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});const o=null!=(i=await(0,a.xI)({provider:"openai",providerOptions:s,schema:A}))?i:{},{responseHeaders:l,value:u,rawValue:p}=await(0,a.GU)({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:o.dimensions,user:o.user},failedResponseHandler:c,successfulResponseHandler:(0,a.cV)(I),abortSignal:n,fetch:this.config.fetch});return{warnings:[],embeddings:u.data.map((e=>e.embedding)),usage:u.usage?{tokens:u.usage.prompt_tokens}:void 0,response:{headers:l,body:p}}}},N=(0,a.ID)((()=>(0,a.jN)(s.Ik({created:s.ai().nullish(),data:s.YO(s.Ik({b64_json:s.Yj(),revised_prompt:s.Yj().nullish()})),background:s.Yj().nullish(),output_format:s.Yj().nullish(),size:s.Yj().nullish(),quality:s.Yj().nullish(),usage:s.Ik({input_tokens:s.ai().nullish(),output_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),input_tokens_details:s.Ik({image_tokens:s.ai().nullish(),text_tokens:s.ai().nullish()}).nullish()}).nullish()})))),T={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10},O=new Set(["gpt-image-1","gpt-image-1-mini"]),k=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get maxImagesPerCall(){var e;return null!=(e=T[this.modelId])?e:1}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:r,seed:s,providerOptions:i,headers:o,abortSignal:l}){var u,p,d,m,h,f,v;const g=[];null!=r&&g.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),null!=s&&g.push({type:"unsupported",feature:"seed"});const y=null!=(d=null==(p=null==(u=this.config._internal)?void 0:u.currentDate)?void 0:p.call(u))?d:new Date,{value:$,responseHeaders:b}=await(0,a.GU)({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),o),body:{model:this.modelId,prompt:e,n:t,size:n,...null!=(m=i.openai)?m:{},...O.has(this.modelId)?{}:{response_format:"b64_json"}},failedResponseHandler:c,successfulResponseHandler:(0,a.cV)(N),abortSignal:l,fetch:this.config.fetch});return{images:$.data.map((e=>e.b64_json)),warnings:g,usage:null!=$.usage?{inputTokens:null!=(h=$.usage.input_tokens)?h:void 0,outputTokens:null!=(f=$.usage.output_tokens)?f:void 0,totalTokens:null!=(v=$.usage.total_tokens)?v:void 0}:void 0,response:{timestamp:y,modelId:this.modelId,headers:b},providerMetadata:{openai:{images:$.data.map((e=>{var t,n,a,r,s;return{...e.revised_prompt?{revisedPrompt:e.revised_prompt}:{},created:null!=(t=$.created)?t:void 0,size:null!=(n=$.size)?n:void 0,quality:null!=(a=$.quality)?a:void 0,background:null!=(r=$.background)?r:void 0,outputFormat:null!=(s=$.output_format)?s:void 0}}))}}}}},R=(0,a.ID)((()=>(0,a.jN)(s.Ik({callId:s.Yj(),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])})))),C=(0,a.ID)((()=>(0,a.jN)(s.Ik({status:s.k5(["completed","failed"]),output:s.Yj().optional()})))),L=((0,a.ID)((()=>(0,a.jN)(s.Ik({})))),(0,a.wA)({id:"openai.apply_patch",inputSchema:R,outputSchema:C})),P=(0,a.ID)((()=>(0,a.jN)(s.Ik({code:s.Yj().nullish(),containerId:s.Yj()})))),M=(0,a.ID)((()=>(0,a.jN)(s.Ik({outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullish()})))),j=(0,a.ID)((()=>(0,a.jN)(s.Ik({container:s.KC([s.Yj(),s.Ik({fileIds:s.YO(s.Yj()).optional()})]).optional()})))),D=(0,a.wA)({id:"openai.code_interpreter",inputSchema:P,outputSchema:M}),F=s.Ik({key:s.Yj(),type:s.k5(["eq","ne","gt","gte","lt","lte","in","nin"]),value:s.KC([s.Yj(),s.ai(),s.zM(),s.YO(s.Yj())])}),Y=s.Ik({type:s.k5(["and","or"]),filters:s.YO(s.KC([F,s.RZ((()=>Y))]))}),V=(0,a.ID)((()=>(0,a.jN)(s.Ik({vectorStoreIds:s.YO(s.Yj()),maxNumResults:s.ai().optional(),ranking:s.Ik({ranker:s.Yj().optional(),scoreThreshold:s.ai().optional()}).optional(),filters:s.KC([F,Y]).optional()})))),U=(0,a.ID)((()=>(0,a.jN)(s.Ik({queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.L5()),fileId:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullable()})))),q=(0,a.wA)({id:"openai.file_search",inputSchema:s.Ik({}),outputSchema:U}),B=(0,a.ID)((()=>(0,a.jN)(s.Ik({background:s.k5(["auto","opaque","transparent"]).optional(),inputFidelity:s.k5(["low","high"]).optional(),inputImageMask:s.Ik({fileId:s.Yj().optional(),imageUrl:s.Yj().optional()}).optional(),model:s.Yj().optional(),moderation:s.k5(["auto"]).optional(),outputCompression:s.ai().int().min(0).max(100).optional(),outputFormat:s.k5(["png","jpeg","webp"]).optional(),partialImages:s.ai().int().min(0).max(3).optional(),quality:s.k5(["auto","low","medium","high"]).optional(),size:s.k5(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict()))),z=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),Z=(0,a.ID)((()=>(0,a.jN)(s.Ik({result:s.Yj()})))),G=(0,a.wA)({id:"openai.image_generation",inputSchema:z,outputSchema:Z}),W=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeoutMs:s.ai().optional(),user:s.Yj().optional(),workingDirectory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})})))),H=(0,a.ID)((()=>(0,a.jN)(s.Ik({output:s.Yj()})))),K=(0,a.wA)({id:"openai.local_shell",inputSchema:W,outputSchema:H}),X=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.Ik({commands:s.YO(s.Yj()),timeoutMs:s.ai().optional(),maxOutputLength:s.ai().optional()})})))),J=(0,a.ID)((()=>(0,a.jN)(s.Ik({output:s.YO(s.Ik({stdout:s.Yj(),stderr:s.Yj(),outcome:s.gM("type",[s.Ik({type:s.eu("timeout")}),s.Ik({type:s.eu("exit"),exitCode:s.ai()})])}))})))),Q=(0,a.wA)({id:"openai.shell",inputSchema:X,outputSchema:J}),ee=(0,a.ID)((()=>(0,a.jN)(s.Ik({externalWebAccess:s.zM().optional(),filters:s.Ik({allowedDomains:s.YO(s.Yj()).optional()}).optional(),searchContextSize:s.k5(["low","medium","high"]).optional(),userLocation:s.Ik({type:s.eu("approximate"),country:s.Yj().optional(),city:s.Yj().optional(),region:s.Yj().optional(),timezone:s.Yj().optional()}).optional()})))),te=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),ne=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().optional()}),s.Ik({type:s.eu("openPage"),url:s.Yj().nullish()}),s.Ik({type:s.eu("findInPage"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})]),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).optional()})))),ae=(0,a.wA)({id:"openai.web_search",inputSchema:te,outputSchema:ne}),re=(0,a.ID)((()=>(0,a.jN)(s.Ik({searchContextSize:s.k5(["low","medium","high"]).optional(),userLocation:s.Ik({type:s.eu("approximate"),country:s.Yj().optional(),city:s.Yj().optional(),region:s.Yj().optional(),timezone:s.Yj().optional()}).optional()})))),se=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),ie=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().optional()}),s.Ik({type:s.eu("openPage"),url:s.Yj().nullish()}),s.Ik({type:s.eu("findInPage"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])})))),oe=(0,a.wA)({id:"openai.web_search_preview",inputSchema:se,outputSchema:ie}),le=s.RZ((()=>s.KC([s.Yj(),s.ai(),s.zM(),s.ch(),s.YO(le),s.g1(s.Yj(),le)]))),ce=(0,a.ID)((()=>(0,a.jN)(s.Ik({serverLabel:s.Yj(),allowedTools:s.KC([s.YO(s.Yj()),s.Ik({readOnly:s.zM().optional(),toolNames:s.YO(s.Yj()).optional()})]).optional(),authorization:s.Yj().optional(),connectorId:s.Yj().optional(),headers:s.g1(s.Yj(),s.Yj()).optional(),serverDescription:s.Yj().optional(),serverUrl:s.Yj().optional()}).refine((e=>null!=e.serverUrl||null!=e.connectorId),"One of serverUrl or connectorId must be provided.")))),ue=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),pe=(0,a.ID)((()=>(0,a.jN)(s.gM("type",[s.Ik({type:s.eu("call"),serverLabel:s.Yj(),name:s.Yj(),arguments:s.Yj(),output:s.Yj().nullable().optional(),error:s.KC([s.Yj(),le]).optional()}),s.Ik({type:s.eu("listTools"),serverLabel:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),inputSchema:le,annotations:s.g1(s.Yj(),le).optional()})),error:s.KC([s.Yj(),le]).optional()}),s.Ik({type:s.eu("approvalRequest"),serverLabel:s.Yj(),name:s.Yj(),arguments:s.Yj(),approvalRequestId:s.Yj()})])))),de=(0,a.wA)({id:"openai.mcp",inputSchema:ue,outputSchema:pe}),me={applyPatch:L,codeInterpreter:(e={})=>D(e),fileSearch:q,imageGeneration:(e={})=>G(e),localShell:K,shell:Q,webSearchPreview:oe,webSearch:(e={})=>ae(e),mcp:e=>de(e)};function he(e){var t,n,a,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const s=e.input_tokens,i=e.output_tokens,o=null!=(n=null==(t=e.input_tokens_details)?void 0:t.cached_tokens)?n:0,l=null!=(r=null==(a=e.output_tokens_details)?void 0:a.reasoning_tokens)?r:0;return{inputTokens:{total:s,noCache:s-o,cacheRead:o,cacheWrite:void 0},outputTokens:{total:i,text:i-l,reasoning:l},raw:e}}function fe(e,t){return!!t&&t.some((t=>e.startsWith(t)))}var ve=s.Ik({itemId:s.Yj().nullish(),reasoningEncryptedContent:s.Yj().nullish()});function ge({finishReason:e,hasFunctionCall:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"unknown"}}var ye=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({type:s.eu("response.output_text.delta"),item_id:s.Yj(),delta:s.Yj(),logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}),s.Ik({type:s.k5(["response.completed","response.incomplete"]),response:s.Ik({incomplete_details:s.Ik({reason:s.Yj()}).nullish(),usage:s.Ik({input_tokens:s.ai(),input_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),output_tokens:s.ai(),output_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish()}).nullish()}),service_tier:s.Yj().nullish()})}),s.Ik({type:s.eu("response.created"),response:s.Ik({id:s.Yj(),created_at:s.ai(),model:s.Yj(),service_tier:s.Yj().nullish()})}),s.Ik({type:s.eu("response.output_item.added"),output_index:s.ai(),item:s.gM("type",[s.Ik({type:s.eu("message"),id:s.Yj()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish()}),s.Ik({type:s.eu("function_call"),id:s.Yj(),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj()}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("file_search_call"),id:s.Yj()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj()}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),container_id:s.Yj(),code:s.Yj().nullable(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable(),status:s.Yj()}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])}),s.Ik({type:s.eu("response.output_item.done"),output_index:s.ai(),item:s.gM("type",[s.Ik({type:s.eu("message"),id:s.Yj()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish()}),s.Ik({type:s.eu("function_call"),id:s.Yj(),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj(),status:s.eu("completed")}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),code:s.Yj().nullable(),container_id:s.Yj(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj(),result:s.Yj()}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj(),action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().nullish(),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).nullish()}),s.Ik({type:s.eu("open_page"),url:s.Yj().nullish()}),s.Ik({type:s.eu("find_in_page"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])}),s.Ik({type:s.eu("file_search_call"),id:s.Yj(),queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.KC([s.Yj(),s.ai(),s.zM()])),file_id:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullish()}),s.Ik({type:s.eu("local_shell_call"),id:s.Yj(),call_id:s.Yj(),action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeout_ms:s.ai().optional(),user:s.Yj().optional(),working_directory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.eu("completed")}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj(),arguments:s.Yj(),name:s.Yj(),server_label:s.Yj(),output:s.Yj().nullish(),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).nullish()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj(),server_label:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),input_schema:s.bz(),annotations:s.g1(s.Yj(),s.L5()).optional()})),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).optional()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj(),server_label:s.Yj(),name:s.Yj(),arguments:s.Yj(),approval_request_id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])}),s.Ik({type:s.eu("response.function_call_arguments.delta"),item_id:s.Yj(),output_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.image_generation_call.partial_image"),item_id:s.Yj(),output_index:s.ai(),partial_image_b64:s.Yj()}),s.Ik({type:s.eu("response.code_interpreter_call_code.delta"),item_id:s.Yj(),output_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.code_interpreter_call_code.done"),item_id:s.Yj(),output_index:s.ai(),code:s.Yj()}),s.Ik({type:s.eu("response.output_text.annotation.added"),annotation:s.gM("type",[s.Ik({type:s.eu("url_citation"),start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()}),s.Ik({type:s.eu("file_citation"),file_id:s.Yj(),filename:s.Yj().nullish(),index:s.ai().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),quote:s.Yj().nullish()}),s.Ik({type:s.eu("container_file_citation"),container_id:s.Yj(),file_id:s.Yj(),filename:s.Yj().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),index:s.ai().nullish()}),s.Ik({type:s.eu("file_path"),file_id:s.Yj(),index:s.ai().nullish()})])}),s.Ik({type:s.eu("response.reasoning_summary_part.added"),item_id:s.Yj(),summary_index:s.ai()}),s.Ik({type:s.eu("response.reasoning_summary_text.delta"),item_id:s.Yj(),summary_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.reasoning_summary_part.done"),item_id:s.Yj(),summary_index:s.ai()}),s.Ik({type:s.eu("error"),sequence_number:s.ai(),error:s.Ik({type:s.Yj(),code:s.Yj(),message:s.Yj(),param:s.Yj().nullish()})}),s.Ik({type:s.Yj()}).loose().transform((e=>({type:"unknown_chunk",message:e.type})))])))),$e=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().optional(),created_at:s.ai().optional(),error:s.Ik({message:s.Yj(),type:s.Yj(),param:s.Yj().nullish(),code:s.Yj()}).nullish(),model:s.Yj().optional(),output:s.YO(s.gM("type",[s.Ik({type:s.eu("message"),role:s.eu("assistant"),id:s.Yj(),content:s.YO(s.Ik({type:s.eu("output_text"),text:s.Yj(),logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish(),annotations:s.YO(s.gM("type",[s.Ik({type:s.eu("url_citation"),start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()}),s.Ik({type:s.eu("file_citation"),file_id:s.Yj(),filename:s.Yj().nullish(),index:s.ai().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),quote:s.Yj().nullish()}),s.Ik({type:s.eu("container_file_citation"),container_id:s.Yj(),file_id:s.Yj(),filename:s.Yj().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),index:s.ai().nullish()}),s.Ik({type:s.eu("file_path"),file_id:s.Yj(),index:s.ai().nullish()})]))}))}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj(),action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().nullish(),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).nullish()}),s.Ik({type:s.eu("open_page"),url:s.Yj().nullish()}),s.Ik({type:s.eu("find_in_page"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])}),s.Ik({type:s.eu("file_search_call"),id:s.Yj(),queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.KC([s.Yj(),s.ai(),s.zM()])),file_id:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullish()}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),code:s.Yj().nullable(),container_id:s.Yj(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj(),result:s.Yj()}),s.Ik({type:s.eu("local_shell_call"),id:s.Yj(),call_id:s.Yj(),action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeout_ms:s.ai().optional(),user:s.Yj().optional(),working_directory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})}),s.Ik({type:s.eu("function_call"),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj(),id:s.Yj()}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.Yj().optional()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish(),summary:s.YO(s.Ik({type:s.eu("summary_text"),text:s.Yj()}))}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj(),arguments:s.Yj(),name:s.Yj(),server_label:s.Yj(),output:s.Yj().nullish(),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).nullish()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj(),server_label:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),input_schema:s.bz(),annotations:s.g1(s.Yj(),s.L5()).optional()})),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).optional()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj(),server_label:s.Yj(),name:s.Yj(),arguments:s.Yj(),approval_request_id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])).optional(),service_tier:s.Yj().nullish(),incomplete_details:s.Ik({reason:s.Yj()}).nullish(),usage:s.Ik({input_tokens:s.ai(),input_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),output_tokens:s.ai(),output_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish()}).nullish()}).optional()})))),be=(0,a.ID)((()=>(0,a.jN)(s.Ik({conversation:s.Yj().nullish(),include:s.YO(s.k5(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:s.Yj().nullish(),logprobs:s.KC([s.zM(),s.ai().min(1).max(20)]).optional(),maxToolCalls:s.ai().nullish(),metadata:s.bz().nullish(),parallelToolCalls:s.zM().nullish(),previousResponseId:s.Yj().nullish(),promptCacheKey:s.Yj().nullish(),promptCacheRetention:s.k5(["in_memory","24h"]).nullish(),reasoningEffort:s.Yj().nullish(),reasoningSummary:s.Yj().nullish(),safetyIdentifier:s.Yj().nullish(),serviceTier:s.k5(["auto","flex","priority","default"]).nullish(),store:s.zM().nullish(),strictJsonSchema:s.zM().nullish(),textVerbosity:s.k5(["low","medium","high"]).nullish(),truncation:s.k5(["auto","disabled"]).nullish(),user:s.Yj().nullish()})))),Ee=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({maxOutputTokens:e,temperature:t,stopSequences:n,topP:s,topK:i,presencePenalty:l,frequencyPenalty:c,seed:p,prompt:d,providerOptions:m,tools:h,toolChoice:f,responseFormat:v}){var g,y,$,b;const E=[],_=u(this.modelId);null!=i&&E.push({type:"unsupported",feature:"topK"}),null!=p&&E.push({type:"unsupported",feature:"seed"}),null!=l&&E.push({type:"unsupported",feature:"presencePenalty"}),null!=c&&E.push({type:"unsupported",feature:"frequencyPenalty"}),null!=n&&E.push({type:"unsupported",feature:"stopSequences"});const S=await(0,a.xI)({provider:"openai",providerOptions:m,schema:be});(null==S?void 0:S.conversation)&&(null==S?void 0:S.previousResponseId)&&E.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});const x=(0,a.CR)({tools:h,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch"}}),{input:A,warnings:I}=await async function({prompt:e,toolNameMapping:t,systemMessageMode:n,fileIdPrefixes:s,store:i,hasLocalShellTool:l=!1,hasShellTool:c=!1,hasApplyPatchTool:u=!1}){var p,d,m,h,f;const v=[],g=[];for(const{role:y,content:$}of e)switch(y){case"system":switch(n){case"system":v.push({role:"system",content:$});break;case"developer":v.push({role:"developer",content:$});break;case"remove":g.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${n}`)}break;case"user":v.push({role:"user",content:$.map(((e,t)=>{var n,i,l;switch(e.type){case"text":return{type:"input_text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"input_image",...e.data instanceof o?{image_url:e.data.toString()}:"string"==typeof e.data&&fe(e.data,s)?{file_id:e.data}:{image_url:`data:${t};base64,${(0,a.ej)(e.data)}`},detail:null==(i=null==(n=e.providerOptions)?void 0:n.openai)?void 0:i.imageDetail}}if("application/pdf"===e.mediaType)return e.data instanceof o?{type:"input_file",file_url:e.data.toString()}:{type:"input_file",..."string"==typeof e.data&&fe(e.data,s)?{file_id:e.data}:{filename:null!=(l=e.filename)?l:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${(0,a.ej)(e.data)}`}};throw new r.b8({functionality:`file part media type ${e.mediaType}`})}}))});break;case"assistant":{const e={};for(const n of $)switch(n.type){case"text":{const e=null==(d=null==(p=n.providerOptions)?void 0:p.openai)?void 0:d.itemId;if(i&&null!=e){v.push({type:"item_reference",id:e});break}v.push({role:"assistant",content:[{type:"output_text",text:n.text}],id:e});break}case"tool-call":{if(n.providerExecuted)break;const e=null==(h=null==(m=n.providerOptions)?void 0:m.openai)?void 0:h.itemId;if(i&&null!=e){v.push({type:"item_reference",id:e});break}const r=t.toProviderToolName(n.toolName);if(l&&"local_shell"===r){const t=await(0,a.k5)({value:n.input,schema:W});v.push({type:"local_shell_call",call_id:n.toolCallId,id:e,action:{type:"exec",command:t.action.command,timeout_ms:t.action.timeoutMs,user:t.action.user,working_directory:t.action.workingDirectory,env:t.action.env}});break}if(c&&"shell"===r){const t=await(0,a.k5)({value:n.input,schema:X});v.push({type:"shell_call",call_id:n.toolCallId,id:e,status:"completed",action:{commands:t.action.commands,timeout_ms:t.action.timeoutMs,max_output_length:t.action.maxOutputLength}});break}v.push({type:"function_call",call_id:n.toolCallId,name:r,arguments:JSON.stringify(n.input),id:e});break}case"tool-result":i?v.push({type:"item_reference",id:n.toolCallId}):g.push({type:"other",message:`Results for OpenAI tool ${n.toolName} are not sent to the API when store is false`});break;case"reasoning":{const t=await(0,a.xI)({provider:"openai",providerOptions:n.providerOptions,schema:ve}),r=null==t?void 0:t.itemId;if(null!=r){const a=e[r];if(i)void 0===a&&(v.push({type:"item_reference",id:r}),e[r]={type:"reasoning",id:r,summary:[]});else{const s=[];n.text.length>0?s.push({type:"summary_text",text:n.text}):void 0!==a&&g.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(n)}.`}),void 0===a?(e[r]={type:"reasoning",id:r,encrypted_content:null==t?void 0:t.reasoningEncryptedContent,summary:s},v.push(e[r])):(a.summary.push(...s),null!=(null==t?void 0:t.reasoningEncryptedContent)&&(a.encrypted_content=t.reasoningEncryptedContent))}}else g.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(n)}.`});break}}break}case"tool":for(const e of $){const n=e.output,r=t.toProviderToolName(e.toolName);if(l&&"local_shell"===r&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:H});v.push({type:"local_shell_call_output",call_id:e.toolCallId,output:t.output});break}if(c&&"shell"===r&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:J});v.push({type:"shell_call_output",call_id:e.toolCallId,output:t.output.map((e=>({stdout:e.stdout,stderr:e.stderr,outcome:"timeout"===e.outcome.type?{type:"timeout"}:{type:"exit",exit_code:e.outcome.exitCode}})))});break}if(u&&"apply_patch"===e.toolName&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:C});v.push({type:"apply_patch_call_output",call_id:e.toolCallId,status:t.status,output:t.output});break}let s;switch(n.type){case"text":case"error-text":s=n.value;break;case"execution-denied":s=null!=(f=n.reason)?f:"Tool execution denied.";break;case"json":case"error-json":s=JSON.stringify(n.value);break;case"content":s=n.value.map((e=>{var t;switch(e.type){case"text":return{type:"input_text",text:e.text};case"image-data":return{type:"input_image",image_url:`data:${e.mediaType};base64,${e.data}`};case"file-data":return{type:"input_file",filename:null!=(t=e.filename)?t:"data",file_data:`data:${e.mediaType};base64,${e.data}`};default:return void g.push({type:"other",message:`unsupported tool content part type: ${e.type}`})}})).filter(a.R)}v.push({type:"function_call_output",call_id:e.toolCallId,output:s})}break;default:throw new Error(`Unsupported role: ${y}`)}return{input:v,warnings:g}}({prompt:d,toolNameMapping:x,systemMessageMode:_.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:null==(g=null==S?void 0:S.store)||g,hasLocalShellTool:O("openai.local_shell"),hasShellTool:O("openai.shell"),hasApplyPatchTool:O("openai.apply_patch")});E.push(...I);const w=null==(y=null==S?void 0:S.strictJsonSchema)||y;let N=null==S?void 0:S.include;function T(e){null==N?N=[e]:N.includes(e)||(N=[...N,e])}function O(e){return null!=(null==h?void 0:h.find((t=>"provider"===t.type&&t.id===e)))}const k="number"==typeof(null==S?void 0:S.logprobs)?null==S?void 0:S.logprobs:!0===(null==S?void 0:S.logprobs)?20:void 0;k&&T("message.output_text.logprobs");const R=null==($=null==h?void 0:h.find((e=>"provider"===e.type&&("openai.web_search"===e.id||"openai.web_search_preview"===e.id))))?void 0:$.name;R&&T("web_search_call.action.sources"),O("openai.code_interpreter")&&T("code_interpreter_call.outputs");const L=null==S?void 0:S.store;!1===L&&_.isReasoningModel&&T("reasoning.encrypted_content");const P={model:this.modelId,input:A,temperature:t,top_p:s,max_output_tokens:e,...("json"===(null==v?void 0:v.type)||(null==S?void 0:S.textVerbosity))&&{text:{..."json"===(null==v?void 0:v.type)&&{format:null!=v.schema?{type:"json_schema",strict:w,name:null!=(b=v.name)?b:"response",description:v.description,schema:v.schema}:{type:"json_object"}},...(null==S?void 0:S.textVerbosity)&&{verbosity:S.textVerbosity}}},conversation:null==S?void 0:S.conversation,max_tool_calls:null==S?void 0:S.maxToolCalls,metadata:null==S?void 0:S.metadata,parallel_tool_calls:null==S?void 0:S.parallelToolCalls,previous_response_id:null==S?void 0:S.previousResponseId,store:L,user:null==S?void 0:S.user,instructions:null==S?void 0:S.instructions,service_tier:null==S?void 0:S.serviceTier,include:N,prompt_cache_key:null==S?void 0:S.promptCacheKey,prompt_cache_retention:null==S?void 0:S.promptCacheRetention,safety_identifier:null==S?void 0:S.safetyIdentifier,top_logprobs:k,truncation:null==S?void 0:S.truncation,..._.isReasoningModel&&(null!=(null==S?void 0:S.reasoningEffort)||null!=(null==S?void 0:S.reasoningSummary))&&{reasoning:{...null!=(null==S?void 0:S.reasoningEffort)&&{effort:S.reasoningEffort},...null!=(null==S?void 0:S.reasoningSummary)&&{summary:S.reasoningSummary}}}};_.isReasoningModel?"none"===(null==S?void 0:S.reasoningEffort)&&_.supportsNonReasoningParameters||(null!=P.temperature&&(P.temperature=void 0,E.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=P.top_p&&(P.top_p=void 0,E.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(null!=(null==S?void 0:S.reasoningEffort)&&E.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),null!=(null==S?void 0:S.reasoningSummary)&&E.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})),"flex"!==(null==S?void 0:S.serviceTier)||_.supportsFlexProcessing||(E.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete P.service_tier),"priority"!==(null==S?void 0:S.serviceTier)||_.supportsPriorityProcessing||(E.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete P.service_tier);const{tools:M,toolChoice:D,toolWarnings:F}=await async function({tools:e,toolChoice:t}){const n=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:n};const s=[];for(const t of e)switch(t.type){case"function":s.push({type:"function",name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":switch(t.id){case"openai.file_search":{const e=await(0,a.k5)({value:t.args,schema:V});s.push({type:"file_search",vector_store_ids:e.vectorStoreIds,max_num_results:e.maxNumResults,ranking_options:e.ranking?{ranker:e.ranking.ranker,score_threshold:e.ranking.scoreThreshold}:void 0,filters:e.filters});break}case"openai.local_shell":s.push({type:"local_shell"});break;case"openai.shell":s.push({type:"shell"});break;case"openai.apply_patch":s.push({type:"apply_patch"});break;case"openai.web_search_preview":{const e=await(0,a.k5)({value:t.args,schema:re});s.push({type:"web_search_preview",search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.web_search":{const e=await(0,a.k5)({value:t.args,schema:ee});s.push({type:"web_search",filters:null!=e.filters?{allowed_domains:e.filters.allowedDomains}:void 0,external_web_access:e.externalWebAccess,search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.code_interpreter":{const e=await(0,a.k5)({value:t.args,schema:j});s.push({type:"code_interpreter",container:null==e.container?{type:"auto",file_ids:void 0}:"string"==typeof e.container?e.container:{type:"auto",file_ids:e.container.fileIds}});break}case"openai.image_generation":{const e=await(0,a.k5)({value:t.args,schema:B});s.push({type:"image_generation",background:e.background,input_fidelity:e.inputFidelity,input_image_mask:e.inputImageMask?{file_id:e.inputImageMask.fileId,image_url:e.inputImageMask.imageUrl}:void 0,model:e.model,moderation:e.moderation,partial_images:e.partialImages,quality:e.quality,output_compression:e.outputCompression,output_format:e.outputFormat,size:e.size});break}case"openai.mcp":{const e=await(0,a.k5)({value:t.args,schema:ce});s.push({type:"mcp",server_label:e.serverLabel,allowed_tools:Array.isArray(e.allowedTools)?e.allowedTools:e.allowedTools?{read_only:e.allowedTools.readOnly,tool_names:e.allowedTools.toolNames}:void 0,authorization:e.authorization,connector_id:e.connectorId,headers:e.headers,require_approval:"never",server_description:e.serverDescription,server_url:e.serverUrl});break}}break;default:n.push({type:"unsupported",feature:`function tool ${t}`})}if(null==t)return{tools:s,toolChoice:void 0,toolWarnings:n};const i=t.type;switch(i){case"auto":case"none":case"required":return{tools:s,toolChoice:i,toolWarnings:n};case"tool":return{tools:s,toolChoice:"code_interpreter"===t.toolName||"file_search"===t.toolName||"image_generation"===t.toolName||"web_search_preview"===t.toolName||"web_search"===t.toolName||"mcp"===t.toolName||"apply_patch"===t.toolName?{type:t.toolName}:{type:"function",name:t.toolName},toolWarnings:n};default:{const e=i;throw new r.b8({functionality:`tool choice type: ${e}`})}}}({tools:h,toolChoice:f});return{webSearchToolName:R,args:{...P,tools:M,tool_choice:D},warnings:[...E,...F],store:L,toolNameMapping:x}}async doGenerate(e){var t,n,s,i,o,l,u,p,d,m,h,f,v,g,y,$,b,E,_,S,x,A,I,w;const{args:N,warnings:T,webSearchToolName:O,toolNameMapping:k}=await this.getArgs(e),R=this.config.url({path:"/responses",modelId:this.modelId}),C=this.config.provider.replace(".responses",""),{responseHeaders:L,value:P,rawValue:M}=await(0,a.GU)({url:R,headers:(0,a.m2)(this.config.headers(),e.headers),body:N,failedResponseHandler:c,successfulResponseHandler:(0,a.cV)($e),abortSignal:e.abortSignal,fetch:this.config.fetch});if(P.error)throw new r.hL({message:P.error.message,url:R,requestBodyValues:N,statusCode:400,responseHeaders:L,responseBody:M,isRetryable:!1});const j=[],D=[];let F=!1;for(const r of P.output)switch(r.type){case"reasoning":0===r.summary.length&&r.summary.push({type:"summary_text",text:""});for(const e of r.summary)j.push({type:"reasoning",text:e.text,providerMetadata:{[C]:{itemId:r.id,reasoningEncryptedContent:null!=(t=r.encrypted_content)?t:null}}});break;case"image_generation_call":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("image_generation"),result:{result:r.result}});break;case"local_shell_call":j.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("local_shell"),input:JSON.stringify({action:r.action}),providerMetadata:{[C]:{itemId:r.id}}});break;case"shell_call":j.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("shell"),input:JSON.stringify({action:{commands:r.action.commands}}),providerMetadata:{[C]:{itemId:r.id}}});break;case"message":for(const t of r.content){(null==(s=null==(n=e.providerOptions)?void 0:n.openai)?void 0:s.logprobs)&&t.logprobs&&D.push(t.logprobs);const c={itemId:r.id,...t.annotations.length>0&&{annotations:t.annotations}};j.push({type:"text",text:t.text,providerMetadata:{[C]:c}});for(const e of t.annotations)"url_citation"===e.type?j.push({type:"source",sourceType:"url",id:null!=(l=null==(o=(i=this.config).generateId)?void 0:o.call(i))?l:(0,a.$C)(),url:e.url,title:e.title}):"file_citation"===e.type?j.push({type:"source",sourceType:"document",id:null!=(d=null==(p=(u=this.config).generateId)?void 0:p.call(u))?d:(0,a.$C)(),mediaType:"text/plain",title:null!=(h=null!=(m=e.quote)?m:e.filename)?h:"Document",filename:null!=(f=e.filename)?f:e.file_id,...e.file_id?{providerMetadata:{[C]:{fileId:e.file_id}}}:{}}):"container_file_citation"===e.type?j.push({type:"source",sourceType:"document",id:null!=(y=null==(g=(v=this.config).generateId)?void 0:g.call(v))?y:(0,a.$C)(),mediaType:"text/plain",title:null!=(b=null!=($=e.filename)?$:e.file_id)?b:"Document",filename:null!=(E=e.filename)?E:e.file_id,providerMetadata:{[C]:{fileId:e.file_id,containerId:e.container_id,...null!=e.index?{index:e.index}:{}}}}):"file_path"===e.type&&j.push({type:"source",sourceType:"document",id:null!=(x=null==(S=(_=this.config).generateId)?void 0:S.call(_))?x:(0,a.$C)(),mediaType:"application/octet-stream",title:e.file_id,filename:e.file_id,providerMetadata:{[C]:{fileId:e.file_id,...null!=e.index?{index:e.index}:{}}}})}break;case"function_call":F=!0,j.push({type:"tool-call",toolCallId:r.call_id,toolName:r.name,input:r.arguments,providerMetadata:{[C]:{itemId:r.id}}});break;case"web_search_call":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName(null!=O?O:"web_search"),input:JSON.stringify({}),providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName(null!=O?O:"web_search"),result:Se(r.action)});break;case"mcp_call":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"call",serverLabel:r.server_label,name:r.name,arguments:r.arguments,...null!=r.output?{output:r.output}:{},...null!=r.error?{error:r.error}:{}}});break;case"mcp_list_tools":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"listTools",serverLabel:r.server_label,tools:r.tools.map((e=>{var t,n;return{name:e.name,description:null!=(t=e.description)?t:void 0,inputSchema:e.input_schema,annotations:null!=(n=e.annotations)?n:void 0}})),...null!=r.error?{error:r.error}:{}}});break;case"mcp_approval_request":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"approvalRequest",serverLabel:r.server_label,name:r.name,arguments:r.arguments,approvalRequestId:r.approval_request_id}});break;case"computer_call":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:r.status||"completed"}});break;case"file_search_call":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("file_search"),result:{queries:r.queries,results:null!=(I=null==(A=r.results)?void 0:A.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?I:null}});break;case"code_interpreter_call":j.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("code_interpreter"),input:JSON.stringify({code:r.code,containerId:r.container_id}),providerExecuted:!0}),j.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("code_interpreter"),result:{outputs:r.outputs}});break;case"apply_patch_call":j.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("apply_patch"),input:JSON.stringify({callId:r.call_id,operation:r.operation}),providerMetadata:{[C]:{itemId:r.id}}})}const Y={[C]:{responseId:P.id}};D.length>0&&(Y[C].logprobs=D),"string"==typeof P.service_tier&&(Y[C].serviceTier=P.service_tier);const V=P.usage;return{content:j,finishReason:ge({finishReason:null==(w=P.incomplete_details)?void 0:w.reason,hasFunctionCall:F}),usage:he(V),request:{body:N},response:{id:P.id,timestamp:new Date(1e3*P.created_at),modelId:P.model,headers:L,body:M},providerMetadata:Y,warnings:T}}async doStream(e){const{args:t,warnings:n,webSearchToolName:r,toolNameMapping:s,store:i}=await this.getArgs(e),{responseHeaders:o,value:l}=await(0,a.GU)({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:c,successfulResponseHandler:(0,a.Ds)(ye),abortSignal:e.abortSignal,fetch:this.config.fetch}),u=this,p=this.config.provider.replace(".responses","");let d,m="unknown";const h=[];let f=null;const v={},g=[];let y=!1;const $={};let b;return{stream:l.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){var o,l,c,E,_,S,x,A,I,w,N,T,O,k,R,C,L,P,M,j,D,F,Y,V,U,q,B;if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return m="error",void n.enqueue({type:"error",error:t.error});const z=t.value;if(_e(z))"function_call"===z.item.type?(v[z.output_index]={toolName:z.item.name,toolCallId:z.item.call_id},n.enqueue({type:"tool-input-start",id:z.item.call_id,toolName:z.item.name})):"web_search_call"===z.item.type?(v[z.output_index]={toolName:s.toCustomToolName(null!=r?r:"web_search"),toolCallId:z.item.id},n.enqueue({type:"tool-input-start",id:z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),providerExecuted:!0}),n.enqueue({type:"tool-input-end",id:z.item.id}),n.enqueue({type:"tool-call",toolCallId:z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),input:JSON.stringify({}),providerExecuted:!0})):"computer_call"===z.item.type?(v[z.output_index]={toolName:s.toCustomToolName("computer_use"),toolCallId:z.item.id},n.enqueue({type:"tool-input-start",id:z.item.id,toolName:s.toCustomToolName("computer_use"),providerExecuted:!0})):"code_interpreter_call"===z.item.type?(v[z.output_index]={toolName:s.toCustomToolName("code_interpreter"),toolCallId:z.item.id,codeInterpreter:{containerId:z.item.container_id}},n.enqueue({type:"tool-input-start",id:z.item.id,toolName:s.toCustomToolName("code_interpreter"),providerExecuted:!0}),n.enqueue({type:"tool-input-delta",id:z.item.id,delta:`{"containerId":"${z.item.container_id}","code":"`})):"file_search_call"===z.item.type?n.enqueue({type:"tool-call",toolCallId:z.item.id,toolName:s.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}):"image_generation_call"===z.item.type?n.enqueue({type:"tool-call",toolCallId:z.item.id,toolName:s.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}):"mcp_call"===z.item.type||"mcp_list_tools"===z.item.type||"mcp_approval_request"===z.item.type?n.enqueue({type:"tool-call",toolCallId:z.item.id,toolName:s.toCustomToolName("mcp"),input:"{}",providerExecuted:!0}):"apply_patch_call"===z.item.type?(v[z.output_index]={toolName:s.toCustomToolName("apply_patch"),toolCallId:z.item.call_id},"completed"===z.item.status&&n.enqueue({type:"tool-call",toolCallId:z.item.call_id,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:z.item.call_id,operation:z.item.operation}),providerMetadata:{[p]:{itemId:z.item.id}}})):"shell_call"===z.item.type?v[z.output_index]={toolName:s.toCustomToolName("shell"),toolCallId:z.item.call_id}:"message"===z.item.type?(g.splice(0,g.length),n.enqueue({type:"text-start",id:z.item.id,providerMetadata:{[p]:{itemId:z.item.id}}})):_e(z)&&"reasoning"===z.item.type&&($[z.item.id]={encryptedContent:z.item.encrypted_content,summaryParts:{0:"active"}},n.enqueue({type:"reasoning-start",id:`${z.item.id}:0`,providerMetadata:{[p]:{itemId:z.item.id,reasoningEncryptedContent:null!=(o=z.item.encrypted_content)?o:null}}}));else if(function(e){return"response.output_item.done"===e.type}(z)){if("message"===z.item.type)n.enqueue({type:"text-end",id:z.item.id,providerMetadata:{[p]:{itemId:z.item.id,...g.length>0&&{annotations:g}}}});else if("function_call"===z.item.type)v[z.output_index]=void 0,y=!0,n.enqueue({type:"tool-input-end",id:z.item.call_id}),n.enqueue({type:"tool-call",toolCallId:z.item.call_id,toolName:z.item.name,input:z.item.arguments,providerMetadata:{[p]:{itemId:z.item.id}}});else if("web_search_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),result:Se(z.item.action)});else if("computer_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-input-end",id:z.item.id}),n.enqueue({type:"tool-call",toolCallId:z.item.id,toolName:s.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:z.item.status||"completed"}});else if("file_search_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("file_search"),result:{queries:z.item.queries,results:null!=(c=null==(l=z.item.results)?void 0:l.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?c:null}});else if("code_interpreter_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("code_interpreter"),result:{outputs:z.item.outputs}});else if("image_generation_call"===z.item.type)n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("image_generation"),result:{result:z.item.result}});else if("mcp_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"call",serverLabel:z.item.server_label,name:z.item.name,arguments:z.item.arguments,...null!=z.item.output?{output:z.item.output}:{},...null!=z.item.error?{error:z.item.error}:{}}});else if("mcp_list_tools"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"listTools",serverLabel:z.item.server_label,tools:z.item.tools.map((e=>{var t,n;return{name:e.name,description:null!=(t=e.description)?t:void 0,inputSchema:e.input_schema,annotations:null!=(n=e.annotations)?n:void 0}})),...null!=z.item.error?{error:z.item.error}:{}}});else if("apply_patch_call"===z.item.type)v[z.output_index]=void 0,"completed"===z.item.status&&n.enqueue({type:"tool-call",toolCallId:z.item.call_id,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:z.item.call_id,operation:z.item.operation}),providerMetadata:{[p]:{itemId:z.item.id}}});else if("mcp_approval_request"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"approvalRequest",serverLabel:z.item.server_label,name:z.item.name,arguments:z.item.arguments,approvalRequestId:z.item.approval_request_id}});else if("local_shell_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-call",toolCallId:z.item.call_id,toolName:s.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:z.item.action.command,timeoutMs:z.item.action.timeout_ms,user:z.item.action.user,workingDirectory:z.item.action.working_directory,env:z.item.action.env}}),providerMetadata:{[p]:{itemId:z.item.id}}});else if("shell_call"===z.item.type)v[z.output_index]=void 0,n.enqueue({type:"tool-call",toolCallId:z.item.call_id,toolName:s.toCustomToolName("shell"),input:JSON.stringify({action:{commands:z.item.action.commands}}),providerMetadata:{[p]:{itemId:z.item.id}}});else if("reasoning"===z.item.type){const e=$[z.item.id],t=Object.entries(e.summaryParts).filter((([e,t])=>"active"===t||"can-conclude"===t)).map((([e])=>e));for(const e of t)n.enqueue({type:"reasoning-end",id:`${z.item.id}:${e}`,providerMetadata:{[p]:{itemId:z.item.id,reasoningEncryptedContent:null!=(E=z.item.encrypted_content)?E:null}}});delete $[z.item.id]}}else if(function(e){return"response.function_call_arguments.delta"===e.type}(z)){const e=v[z.output_index];null!=e&&n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:z.delta})}else if(function(e){return"response.image_generation_call.partial_image"===e.type}(z))n.enqueue({type:"tool-result",toolCallId:z.item_id,toolName:s.toCustomToolName("image_generation"),result:{result:z.partial_image_b64},preliminary:!0});else if(function(e){return"response.code_interpreter_call_code.delta"===e.type}(z)){const e=v[z.output_index];null!=e&&n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:JSON.stringify(z.delta).slice(1,-1)})}else if(function(e){return"response.code_interpreter_call_code.done"===e.type}(z)){const e=v[z.output_index];null!=e&&(n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:'"}'}),n.enqueue({type:"tool-input-end",id:e.toolCallId}),n.enqueue({type:"tool-call",toolCallId:e.toolCallId,toolName:s.toCustomToolName("code_interpreter"),input:JSON.stringify({code:z.code,containerId:e.codeInterpreter.containerId}),providerExecuted:!0}))}else if(function(e){return"response.created"===e.type}(z))f=z.response.id,n.enqueue({type:"response-metadata",id:z.response.id,timestamp:new Date(1e3*z.response.created_at),modelId:z.response.model});else if(function(e){return"response.output_text.delta"===e.type}(z))n.enqueue({type:"text-delta",id:z.item_id,delta:z.delta}),(null==(S=null==(_=e.providerOptions)?void 0:_.openai)?void 0:S.logprobs)&&z.logprobs&&h.push(z.logprobs);else if("response.reasoning_summary_part.added"===z.type){if(z.summary_index>0){const e=$[z.item_id];e.summaryParts[z.summary_index]="active";for(const t of Object.keys(e.summaryParts))"can-conclude"===e.summaryParts[t]&&(n.enqueue({type:"reasoning-end",id:`${z.item_id}:${t}`,providerMetadata:{[p]:{itemId:z.item_id}}}),e.summaryParts[t]="concluded");n.enqueue({type:"reasoning-start",id:`${z.item_id}:${z.summary_index}`,providerMetadata:{[p]:{itemId:z.item_id,reasoningEncryptedContent:null!=(A=null==(x=$[z.item_id])?void 0:x.encryptedContent)?A:null}}})}}else"response.reasoning_summary_text.delta"===z.type?n.enqueue({type:"reasoning-delta",id:`${z.item_id}:${z.summary_index}`,delta:z.delta,providerMetadata:{[p]:{itemId:z.item_id}}}):"response.reasoning_summary_part.done"===z.type?i?(n.enqueue({type:"reasoning-end",id:`${z.item_id}:${z.summary_index}`,providerMetadata:{[p]:{itemId:z.item_id}}}),$[z.item_id].summaryParts[z.summary_index]="concluded"):$[z.item_id].summaryParts[z.summary_index]="can-conclude":function(e){return"response.completed"===e.type||"response.incomplete"===e.type}(z)?(m=ge({finishReason:null==(I=z.response.incomplete_details)?void 0:I.reason,hasFunctionCall:y}),d=z.response.usage,"string"==typeof z.response.service_tier&&(b=z.response.service_tier)):function(e){return"response.output_text.annotation.added"===e.type}(z)?(g.push(z.annotation),"url_citation"===z.annotation.type?n.enqueue({type:"source",sourceType:"url",id:null!=(T=null==(N=(w=u.config).generateId)?void 0:N.call(w))?T:(0,a.$C)(),url:z.annotation.url,title:z.annotation.title}):"file_citation"===z.annotation.type?n.enqueue({type:"source",sourceType:"document",id:null!=(R=null==(k=(O=u.config).generateId)?void 0:k.call(O))?R:(0,a.$C)(),mediaType:"text/plain",title:null!=(L=null!=(C=z.annotation.quote)?C:z.annotation.filename)?L:"Document",filename:null!=(P=z.annotation.filename)?P:z.annotation.file_id,...z.annotation.file_id?{providerMetadata:{[p]:{fileId:z.annotation.file_id}}}:{}}):"container_file_citation"===z.annotation.type?n.enqueue({type:"source",sourceType:"document",id:null!=(D=null==(j=(M=u.config).generateId)?void 0:j.call(M))?D:(0,a.$C)(),mediaType:"text/plain",title:null!=(Y=null!=(F=z.annotation.filename)?F:z.annotation.file_id)?Y:"Document",filename:null!=(V=z.annotation.filename)?V:z.annotation.file_id,providerMetadata:{[p]:{fileId:z.annotation.file_id,containerId:z.annotation.container_id,...null!=z.annotation.index?{index:z.annotation.index}:{}}}}):"file_path"===z.annotation.type&&n.enqueue({type:"source",sourceType:"document",id:null!=(B=null==(q=(U=u.config).generateId)?void 0:q.call(U))?B:(0,a.$C)(),mediaType:"application/octet-stream",title:z.annotation.file_id,filename:z.annotation.file_id,providerMetadata:{[p]:{fileId:z.annotation.file_id,...null!=z.annotation.index?{index:z.annotation.index}:{}}}})):function(e){return"error"===e.type}(z)&&n.enqueue({type:"error",error:z})},flush(e){const t={[p]:{responseId:f}};h.length>0&&(t[p].logprobs=h),void 0!==b&&(t[p].serviceTier=b),e.enqueue({type:"finish",finishReason:m,usage:he(d),providerMetadata:t})}})),request:{body:t},response:{headers:o}}}};function _e(e){return"response.output_item.added"===e.type}function Se(e){var t;switch(e.type){case"search":return{action:{type:"search",query:null!=(t=e.query)?t:void 0},...null!=e.sources&&{sources:e.sources}};case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}var xe=(0,a.ID)((()=>(0,a.jN)(s.Ik({instructions:s.Yj().nullish(),speed:s.ai().min(.25).max(4).default(1).nullish()})))),Ae=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({text:e,voice:t="alloy",outputFormat:n="mp3",speed:r,instructions:s,language:i,providerOptions:o}){const l=[],c=await(0,a.xI)({provider:"openai",providerOptions:o,schema:xe}),u={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:r,instructions:s};if(n&&(["mp3","opus","aac","flac","wav","pcm"].includes(n)?u.response_format=n:l.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${n}. Using mp3 instead.`})),c){const e={};for(const t in e){const n=e[t];void 0!==n&&(u[t]=n)}}return i&&l.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${i}" was ignored.`}),{requestBody:u,warnings:l}}async doGenerate(e){var t,n,r;const s=null!=(r=null==(n=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:n.call(t))?r:new Date,{requestBody:i,warnings:o}=await this.getArgs(e),{value:l,responseHeaders:u,rawValue:p}=await(0,a.GU)({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:i,failedResponseHandler:c,successfulResponseHandler:(0,a.HD)(),abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:l,warnings:o,request:{body:JSON.stringify(i)},response:{timestamp:s,modelId:this.modelId,headers:u,body:p}}}},Ie=(0,a.ID)((()=>(0,a.jN)(s.Ik({text:s.Yj(),language:s.Yj().nullish(),duration:s.ai().nullish(),words:s.YO(s.Ik({word:s.Yj(),start:s.ai(),end:s.ai()})).nullish(),segments:s.YO(s.Ik({id:s.ai(),seek:s.ai(),start:s.ai(),end:s.ai(),text:s.Yj(),tokens:s.YO(s.ai()),temperature:s.ai(),avg_logprob:s.ai(),compression_ratio:s.ai(),no_speech_prob:s.ai()})).nullish()})))),we=(0,a.ID)((()=>(0,a.jN)(s.Ik({include:s.YO(s.Yj()).optional(),language:s.Yj().optional(),prompt:s.Yj().optional(),temperature:s.ai().min(0).max(1).default(0).optional(),timestampGranularities:s.YO(s.k5(["word","segment"])).default(["segment"]).optional()})))),Ne={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},Te=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:e,mediaType:t,providerOptions:n}){const r=await(0,a.xI)({provider:"openai",providerOptions:n,schema:we}),s=new FormData,i=e instanceof Uint8Array?new Blob([e]):new Blob([(0,a.Z9)(e)]);s.append("model",this.modelId);const o=(0,a.HQ)(t);if(s.append("file",new File([i],"audio",{type:t}),`audio.${o}`),r){const e={include:r.include,language:r.language,prompt:r.prompt,response_format:["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId)?"json":"verbose_json",temperature:r.temperature,timestamp_granularities:r.timestampGranularities};for(const[t,n]of Object.entries(e))if(null!=n)if(Array.isArray(n))for(const e of n)s.append(`${t}[]`,String(e));else s.append(t,String(n))}return{formData:s,warnings:[]}}async doGenerate(e){var t,n,r,s,i,o,l,u;const p=null!=(r=null==(n=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:n.call(t))?r:new Date,{formData:d,warnings:m}=await this.getArgs(e),{value:h,responseHeaders:f,rawValue:v}=await(0,a.S)({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),formData:d,failedResponseHandler:c,successfulResponseHandler:(0,a.cV)(Ie),abortSignal:e.abortSignal,fetch:this.config.fetch}),g=null!=h.language&&h.language in Ne?Ne[h.language]:void 0;return{text:h.text,segments:null!=(l=null!=(o=null==(s=h.segments)?void 0:s.map((e=>({text:e.text,startSecond:e.start,endSecond:e.end}))))?o:null==(i=h.words)?void 0:i.map((e=>({text:e.word,startSecond:e.start,endSecond:e.end}))))?l:[],language:g,durationInSeconds:null!=(u=h.duration)?u:void 0,warnings:m,response:{timestamp:p,modelId:this.modelId,headers:f,body:v}}}},Oe="3.0.0-beta.96";function ke(e={}){var t,n;const r=null!=(t=(0,a.ae)((0,a.x3)({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"})))?t:"https://api.openai.com/v1",s=null!=(n=e.name)?n:"openai",i=()=>(0,a.WZ)({Authorization:`Bearer ${(0,a.WL)({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers},`ai-sdk/openai/${Oe}`),o=t=>new w(t,{provider:`${s}.embedding`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),l=t=>new k(t,{provider:`${s}.image`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),c=t=>new Te(t,{provider:`${s}.transcription`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),u=t=>new Ae(t,{provider:`${s}.speech`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),p=e=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return d(e)},d=t=>new Ee(t,{provider:`${s}.responses`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch,fileIdPrefixes:["file-"]}),m=function(e){return p(e)};return m.specificationVersion="v3",m.languageModel=p,m.chat=t=>new g(t,{provider:`${s}.chat`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),m.completion=t=>new x(t,{provider:`${s}.completion`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),m.responses=d,m.embedding=o,m.embeddingModel=o,m.image=l,m.imageModel=l,m.transcription=c,m.transcriptionModel=c,m.speech=u,m.speechModel=u,m.tools=me,m}ke()},83214:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},83586:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},84112:(e,t,n)=>{const a=n(9350),r=n(17914),{safeRe:s,t:i}=n(68752);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",c=n[4]||"0",u=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${c}${u}${p}`,t)}},84537:function(e,t){!function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",r={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},s="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",i={5:s,"5module":s+" export import",6:s+" const class extends export import super"},o=/^in(stanceof)?$/,l=new RegExp("["+a+"]"),c=new RegExp("["+a+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function u(e,t){for(var n=65536,a=0;a<t.length;a+=2){if((n+=t[a])>e)return!1;if((n+=t[a+1])>=e)return!0}return!1}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&u(e,n)))}function d(e,a){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&c.test(String.fromCharCode(e)):!1!==a&&(u(e,n)||u(e,t)))))}var m=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var f={beforeExpr:!0},v={startsExpr:!0},g={};function y(e,t){return void 0===t&&(t={}),t.keyword=e,g[e]=new m(e,t)}var $={num:new m("num",v),regexp:new m("regexp",v),string:new m("string",v),name:new m("name",v),privateId:new m("privateId",v),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",f),semi:new m(";",f),colon:new m(":",f),dot:new m("."),question:new m("?",f),questionDot:new m("?."),arrow:new m("=>",f),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",f),backQuote:new m("`",v),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h("||",1),logicalAND:h("&&",2),bitwiseOR:h("|",3),bitwiseXOR:h("^",4),bitwiseAND:h("&",5),equality:h("==/!=/===/!==",6),relational:h("</>/<=/>=",7),bitShift:h("<</>>/>>>",8),plusMin:new m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h("%",10),star:h("*",10),slash:h("/",10),starstar:new m("**",{beforeExpr:!0}),coalesce:h("??",1),_break:y("break"),_case:y("case",f),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",f),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",f),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",v),_if:y("if"),_return:y("return",f),_switch:y("switch"),_throw:y("throw",f),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",v),_super:y("super",v),_class:y("class",v),_extends:y("extends",f),_export:y("export"),_import:y("import",v),_null:y("null",v),_true:y("true",v),_false:y("false",v),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,E=new RegExp(b.source,"g");function _(e){return 10===e||13===e||8232===e||8233===e}function S(e,t,n){void 0===n&&(n=e.length);for(var a=t;a<n;a++){var r=e.charCodeAt(a);if(_(r))return a<n-1&&13===r&&10===e.charCodeAt(a+1)?a+2:a+1}return-1}var x=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,A=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=Object.prototype,w=I.hasOwnProperty,N=I.toString,T=Object.hasOwn||function(e,t){return w.call(e,t)},O=Array.isArray||function(e){return"[object Array]"===N.call(e)},k=Object.create(null);function R(e){return k[e]||(k[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function C(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var L=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,P=function(e,t){this.line=e,this.column=t};P.prototype.offset=function(e){return new P(this.line,this.column+e)};var M=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function j(e,t){for(var n=1,a=0;;){var r=S(e,a,t);if(r<0)return new P(n,t-a);++n,a=r}}var D={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},F=!1;function Y(e){var t={};for(var n in D)t[n]=e&&T(e,n)?e[n]:D[n];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!F&&"object"==typeof console&&console.warn&&(F=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),O(t.onToken)){var a=t.onToken;t.onToken=function(e){return a.push(e)}}return O(t.onComment)&&(t.onComment=function(e,t){return function(n,a,r,s,i,o){var l={type:n?"Block":"Line",value:a,start:r,end:s};e.locations&&(l.loc=new M(this,i,o)),e.ranges&&(l.range=[r,s]),t.push(l)}}(t,t.onComment)),t}var V=256,U=259;function q(e,t){return 2|(e?4:0)|(t?8:0)}var B=function(e,t,n){this.options=e=Y(e),this.sourceFile=e.sourceFile,this.keywords=R(i[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var a="";!0!==e.allowReserved&&(a=r[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(a+=" await")),this.reservedWords=R(a);var s=(a?a+" ":"")+r.strict;this.reservedWordsStrict=R(s),this.reservedWordsStrictBind=R(s+" "+r.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=$.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},z={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};B.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},z.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},z.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},z.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},z.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},z.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},z.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},z.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},z.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},z.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&V)>0},B.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,a=0;a<e.length;a++)n=e[a](n);return n},B.parse=function(e,t){return new this(t,e).parse()},B.parseExpressionAt=function(e,t,n){var a=new this(n,e,t);return a.nextToken(),a.parseExpression()},B.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(B.prototype,z);var Z=B.prototype,G=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Z.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){A.lastIndex=e,e+=A.exec(this.input)[0].length;var t=G.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){A.lastIndex=e+t[0].length;var n=A.exec(this.input),a=n.index+n[0].length,r=this.input.charAt(a);return";"===r||"}"===r||b.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(a+1))}e+=t[0].length,A.lastIndex=e,e+=A.exec(this.input)[0].length,";"===this.input[e]&&e++}},Z.eat=function(e){return this.type===e&&(this.next(),!0)},Z.isContextual=function(e){return this.type===$.name&&this.value===e&&!this.containsEsc},Z.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},Z.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Z.canInsertSemicolon=function(){return this.type===$.eof||this.type===$.braceR||b.test(this.input.slice(this.lastTokEnd,this.start))},Z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Z.semicolon=function(){this.eat($.semi)||this.insertSemicolon()||this.unexpected()},Z.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Z.expect=function(e){this.eat(e)||this.unexpected()},Z.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var W=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Z.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}},Z.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,a=e.doubleProto;if(!t)return n>=0||a>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")},Z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Z.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var H=B.prototype;H.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==$.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var a=0,r=Object.keys(this.undefinedExports);a<r.length;a+=1){var s=r[a];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var K={kind:"loop"},X={kind:"switch"};H.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;A.lastIndex=this.pos;var t=A.exec(this.input),n=this.pos+t[0].length,a=this.input.charCodeAt(n);if(91===a||92===a)return!0;if(e)return!1;if(123===a||a>55295&&a<56320)return!0;if(p(a,!0)){for(var r=n+1;d(a=this.input.charCodeAt(r),!0);)++r;if(92===a||a>55295&&a<56320)return!0;var s=this.input.slice(n,r);if(!o.test(s))return!0}return!1},H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;A.lastIndex=this.pos;var e,t=A.exec(this.input),n=this.pos+t[0].length;return!(b.test(this.input.slice(this.pos,n))||"function"!==this.input.slice(n,n+8)||n+8!==this.input.length&&(d(e=this.input.charCodeAt(n+8))||e>55295&&e<56320))},H.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;A.lastIndex=this.pos;var n=A.exec(this.input),a=this.pos+n[0].length;if(b.test(this.input.slice(this.pos,a)))return!1;if(e){var r,s=a+5;if("using"!==this.input.slice(a,s)||s===this.input.length||d(r=this.input.charCodeAt(s))||r>55295&&r<56320)return!1;A.lastIndex=s;var i=A.exec(this.input);if(i&&b.test(this.input.slice(s,s+i[0].length)))return!1}if(t){var o,l=a+2;if(!("of"!==this.input.slice(a,l)||l!==this.input.length&&(d(o=this.input.charCodeAt(l))||o>55295&&o<56320)))return!1}var c=this.input.charCodeAt(a);return p(c,!0)||92===c},H.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},H.isUsing=function(e){return this.isUsingKeyword(!1,e)},H.parseStatement=function(e,t,n){var a,r=this.type,s=this.startNode();switch(this.isLet(e)&&(r=$._var,a="let"),r){case $._break:case $._continue:return this.parseBreakContinueStatement(s,r.keyword);case $._debugger:return this.parseDebuggerStatement(s);case $._do:return this.parseDoStatement(s);case $._for:return this.parseForStatement(s);case $._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case $._class:return e&&this.unexpected(),this.parseClass(s,!0);case $._if:return this.parseIfStatement(s);case $._return:return this.parseReturnStatement(s);case $._switch:return this.parseSwitchStatement(s);case $._throw:return this.parseThrowStatement(s);case $._try:return this.parseTryStatement(s);case $._const:case $._var:return a=a||this.value,e&&"var"!==a&&this.unexpected(),this.parseVarStatement(s,a);case $._while:return this.parseWhileStatement(s);case $._with:return this.parseWithStatement(s);case $.braceL:return this.parseBlock(!0,s);case $.semi:return this.parseEmptyStatement(s);case $._export:case $._import:if(this.options.ecmaVersion>10&&r===$._import){A.lastIndex=this.pos;var i=A.exec(this.input),o=this.pos+i[0].length,l=this.input.charCodeAt(o);if(40===l||46===l)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===$._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return t&&"script"===this.options.sourceType&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),"await using"===c&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,!1,c),this.semicolon(),this.finishNode(s,"VariableDeclaration");var u=this.value,p=this.parseExpression();return r===$.name&&"Identifier"===p.type&&this.eat($.colon)?this.parseLabeledStatement(s,u,p,e):this.parseExpressionStatement(s,p)}},H.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat($.semi)||this.insertSemicolon()?e.label=null:this.type!==$.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a<this.labels.length;++a){var r=this.labels[a];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(n||"loop"===r.kind))break;if(e.label&&n)break}}return a===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"BreakStatement":"ContinueStatement")},H.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},H.parseDoStatement=function(e){return this.next(),this.labels.push(K),e.body=this.parseStatement("do"),this.labels.pop(),this.expect($._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat($.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},H.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(K),this.enterScope(0),this.expect($.parenL),this.type===$.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===$._var||this.type===$._const||n){var a=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(a,!0,r),this.finishNode(a,"VariableDeclaration"),this.parseForAfterInit(e,a,t)}var s=this.isContextual("let"),i=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var l=this.startNode();return this.next(),"await using"===o&&this.next(),this.parseVar(l,!0,o),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,t)}var c=this.containsEsc,u=new W,p=this.start,d=t>-1?this.parseExprSubscripts(u,"await"):this.parseExpression(!0,u);return this.type===$._in||(i=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===$._in&&this.unexpected(t),e.await=!0):i&&this.options.ecmaVersion>=8&&(d.start!==p||c||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),s&&i&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,u),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},H.parseForAfterInit=function(e,t,n){return(this.type===$._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===$._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},H.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Q|(n?0:ee),!1,t)},H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat($._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},H.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat($.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},H.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect($.braceL),this.labels.push(X),this.enterScope(0);for(var n=!1;this.type!==$.braceR;)if(this.type===$._case||this.type===$._default){var a=this.type===$._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),a?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect($.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},H.parseThrowStatement=function(e){return this.next(),b.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var J=[];H.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect($.parenR),e},H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===$._catch){var t=this.startNode();this.next(),this.eat($.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat($._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},H.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")},H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(K),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},H.parseLabeledStatement=function(e,t,n,a){for(var r=0,s=this.labels;r<s.length;r+=1)s[r].name===t&&this.raise(n.start,"Label '"+t+"' is already declared");for(var i=this.type.isLoop?"loop":this.type===$._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var l=this.labels[o];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=i}return this.labels.push({name:t,kind:i,statementStart:this.start}),e.body=this.parseStatement(a?-1===a.indexOf("label")?a+"label":a:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},H.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect($.braceL),e&&this.enterScope(0);this.type!==$.braceR;){var a=this.parseStatement(null);t.body.push(a)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},H.parseFor=function(e,t){return e.init=t,this.expect($.semi),e.test=this.type===$.semi?null:this.parseExpression(),this.expect($.semi),e.update=this.type===$.parenR?null:this.parseExpression(),this.expect($.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},H.parseForIn=function(e,t){var n=this.type===$._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect($.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},H.parseVar=function(e,t,n,a){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat($.eq)?r.init=this.parseMaybeAssign(t):a||"const"!==n||this.type===$._in||this.options.ecmaVersion>=6&&this.isContextual("of")?a||"using"!==n&&"await using"!==n||!(this.options.ecmaVersion>=17)||this.type===$._in||this.isContextual("of")?a||"Identifier"===r.id.type||t&&(this.type===$._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat($.comma))break}return e},H.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var Q=1,ee=2;function te(e,t){var n=t.key.name,a=e[n],r="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(r=(t.static?"s":"i")+t.kind),"iget"===a&&"iset"===r||"iset"===a&&"iget"===r||"sget"===a&&"sset"===r||"sset"===a&&"sget"===r?(e[n]="true",!1):!!a||(e[n]=r,!1)}function ne(e,t){var n=e.computed,a=e.key;return!n&&("Identifier"===a.type&&a.name===t||"Literal"===a.type&&a.value===t)}H.parseFunction=function(e,t,n,a,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===$.star&&t&ee&&this.unexpected(),e.generator=this.eat($.star)),this.options.ecmaVersion>=8&&(e.async=!!a),t&Q&&(e.id=4&t&&this.type!==$.name?null:this.parseIdent(),!e.id||t&ee||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var s=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(q(e.async,e.generator)),t&Q||(e.id=this.type===$.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,r),this.yieldPos=s,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(e,t&Q?"FunctionDeclaration":"FunctionExpression")},H.parseFunctionParams=function(e){this.expect($.parenL),e.params=this.parseBindingList($.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var a=this.enterClassBody(),r=this.startNode(),s=!1;for(r.body=[],this.expect($.braceL);this.type!==$.braceR;){var i=this.parseClassElement(null!==e.superClass);i&&(r.body.push(i),"MethodDefinition"===i.type&&"constructor"===i.kind?(s&&this.raiseRecoverable(i.start,"Duplicate constructor in the same class"),s=!0):i.key&&"PrivateIdentifier"===i.key.type&&te(a,i)&&this.raiseRecoverable(i.key.start,"Identifier '#"+i.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},H.parseClassElement=function(e){if(this.eat($.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),a="",r=!1,s=!1,i="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat($.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===$.star?o=!0:a="static"}if(n.static=o,!a&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==$.star||this.canInsertSemicolon()?a="async":s=!0),!a&&(t>=9||!s)&&this.eat($.star)&&(r=!0),!a&&!s&&!r){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?i=l:a=l)}if(a?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=a,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===$.parenL||"method"!==i||r||s){var c=!n.static&&ne(n,"constructor"),u=c&&e;c&&"method"!==i&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=c?"constructor":i,this.parseClassMethod(n,r,s,u)}else this.parseClassField(n);return n},H.isClassElementNameStart=function(){return this.type===$.name||this.type===$.privateId||this.type===$.num||this.type===$.string||this.type===$.bracketL||this.type.keyword},H.parseClassElementName=function(e){this.type===$.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},H.parseClassMethod=function(e,t,n,a){var r=e.key;"constructor"===e.kind?(t&&this.raise(r.start,"Constructor can't be a generator"),n&&this.raise(r.start,"Constructor can't be an async method")):e.static&&ne(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,a);return"get"===e.kind&&0!==s.params.length&&this.raiseRecoverable(s.start,"getter should have no params"),"set"===e.kind&&1!==s.params.length&&this.raiseRecoverable(s.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===s.params[0].type&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},H.parseClassField=function(e){return ne(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ne(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat($.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},H.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==$.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},H.parseClassId=function(e,t){this.type===$.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},H.parseClassSuper=function(e){e.superClass=this.eat($._extends)?this.parseExprSubscripts(null,!1):null},H.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},H.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var a=this.privateNameStack.length,r=0===a?null:this.privateNameStack[a-1],s=0;s<n.length;++s){var i=n[s];T(t,i.name)||(r?r.used.push(i):this.raiseRecoverable(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class"))}},H.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==$.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},H.parseExport=function(e,t){if(this.next(),this.eat($.star))return this.parseExportAllDeclaration(e,t);if(this.eat($._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==$.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var r=a[n];this.checkUnreserved(r.local),this.checkLocalExport(r.local),"Literal"===r.local.type&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},H.parseExportDeclaration=function(e){return this.parseStatement(null)},H.parseExportDefaultDeclaration=function(){var e;if(this.type===$._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|Q,!1,e)}if(this.type===$._class){var n=this.startNode();return this.parseClass(n,"nullableID")}var a=this.parseMaybeAssign();return this.semicolon(),a},H.checkExport=function(e,t,n){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),T(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},H.checkPatternExport=function(e,t){var n=t.type;if("Identifier"===n)this.checkExport(e,t,t.start);else if("ObjectPattern"===n)for(var a=0,r=t.properties;a<r.length;a+=1){var s=r[a];this.checkPatternExport(e,s)}else if("ArrayPattern"===n)for(var i=0,o=t.elements;i<o.length;i+=1){var l=o[i];l&&this.checkPatternExport(e,l)}else"Property"===n?this.checkPatternExport(e,t.value):"AssignmentPattern"===n?this.checkPatternExport(e,t.left):"RestElement"===n&&this.checkPatternExport(e,t.argument)},H.checkVariableExport=function(e,t){if(e)for(var n=0,a=t;n<a.length;n+=1){var r=a[n];this.checkPatternExport(e,r.id)}},H.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},H.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},H.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect($.braceL);!this.eat($.braceR);){if(n)n=!1;else if(this.expect($.comma),this.afterTrailingComma($.braceR))break;t.push(this.parseExportSpecifier(e))}return t},H.parseImport=function(e){return this.next(),this.type===$.string?(e.specifiers=J,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===$.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},H.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},H.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},H.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},H.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===$.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat($.comma)))return e;if(this.type===$.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect($.braceL);!this.eat($.braceR);){if(t)t=!1;else if(this.expect($.comma),this.afterTrailingComma($.braceR))break;e.push(this.parseImportSpecifier())}return e},H.parseWithClause=function(){var e=[];if(!this.eat($._with))return e;this.expect($.braceL);for(var t={},n=!0;!this.eat($.braceR);){if(n)n=!1;else if(this.expect($.comma),this.afterTrailingComma($.braceR))break;var a=this.parseImportAttribute(),r="Identifier"===a.key.type?a.key.name:a.key.value;T(t,r)&&this.raiseRecoverable(a.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(a)}return e},H.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===$.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect($.colon),this.type!==$.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},H.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===$.string){var e=this.parseLiteral(this.value);return L.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},H.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},H.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var ae=B.prototype;ae.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var a=0,r=e.properties;a<r.length;a+=1){var s=r[a];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return e},ae.toAssignableList=function(e,t){for(var n=e.length,a=0;a<n;a++){var r=e[a];r&&this.toAssignable(r,t)}if(n){var s=e[n-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},ae.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ae.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==$.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},ae.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case $.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList($.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case $.braceL:return this.parseObj(!0)}return this.parseIdent()},ae.parseBindingList=function(e,t,n,a){for(var r=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect($.comma),t&&this.type===$.comma)r.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===$.ellipsis){var i=this.parseRestBinding();this.parseBindingListItem(i),r.push(i),this.type===$.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}r.push(this.parseAssignableListItem(a))}return r},ae.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ae.parseBindingListItem=function(e){return e},ae.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat($.eq))return n;var a=this.startNodeAt(e,t);return a.left=n,a.right=this.parseMaybeAssign(),this.finishNode(a,"AssignmentPattern")},ae.checkLValSimple=function(e,t,n){void 0===t&&(t=0);var a=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(a?"Binding ":"Assigning to ")+e.name+" in strict mode"),a&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(T(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":a&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return a&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(a?"Binding":"Assigning to")+" rvalue")}},ae.checkLValPattern=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var a=0,r=e.properties;a<r.length;a+=1){var s=r[a];this.checkLValInnerPattern(s,t,n)}break;case"ArrayPattern":for(var i=0,o=e.elements;i<o.length;i+=1){var l=o[i];l&&this.checkLValInnerPattern(l,t,n)}break;default:this.checkLValSimple(e,t,n)}},ae.checkLValInnerPattern=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var re=function(e,t,n,a,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=a,this.generator=!!r},se={b_stat:new re("{",!1),b_expr:new re("{",!0),b_tmpl:new re("${",!1),p_stat:new re("(",!1),p_expr:new re("(",!0),q_tmpl:new re("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new re("function",!1),f_expr:new re("function",!0),f_expr_gen:new re("function",!0,!1,null,!0),f_gen:new re("function",!1,!1,null,!0)},ie=B.prototype;ie.initialContext=function(){return[se.b_stat]},ie.curContext=function(){return this.context[this.context.length-1]},ie.braceIsBlock=function(e){var t=this.curContext();return t===se.f_expr||t===se.f_stat||(e!==$.colon||t!==se.b_stat&&t!==se.b_expr?e===$._return||e===$.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):e===$._else||e===$.semi||e===$.eof||e===$.parenR||e===$.arrow||(e===$.braceL?t===se.b_stat:e!==$._var&&e!==$._const&&e!==$.name&&!this.exprAllowed):!t.isExpr)},ie.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},ie.updateContext=function(e){var t,n=this.type;n.keyword&&e===$.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},ie.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},$.parenR.updateContext=$.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===se.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},$.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?se.b_stat:se.b_expr),this.exprAllowed=!0},$.dollarBraceL.updateContext=function(){this.context.push(se.b_tmpl),this.exprAllowed=!0},$.parenL.updateContext=function(e){var t=e===$._if||e===$._for||e===$._with||e===$._while;this.context.push(t?se.p_stat:se.p_expr),this.exprAllowed=!0},$.incDec.updateContext=function(){},$._function.updateContext=$._class.updateContext=function(e){!e.beforeExpr||e===$._else||e===$.semi&&this.curContext()!==se.p_stat||e===$._return&&b.test(this.input.slice(this.lastTokEnd,this.start))||(e===$.colon||e===$.braceL)&&this.curContext()===se.b_stat?this.context.push(se.f_stat):this.context.push(se.f_expr),this.exprAllowed=!1},$.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},$.backQuote.updateContext=function(){this.curContext()===se.q_tmpl?this.context.pop():this.context.push(se.q_tmpl),this.exprAllowed=!1},$.star.updateContext=function(e){if(e===$._function){var t=this.context.length-1;this.context[t]===se.f_expr?this.context[t]=se.f_expr_gen:this.context[t]=se.f_gen}this.exprAllowed=!0},$.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==$.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var oe=B.prototype;function le(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&le(e.expression)}function ce(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&ce(e.expression)||"ParenthesizedExpression"===e.type&&ce(e.expression)}oe.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var a,r=e.key;switch(r.type){case"Identifier":a=r.name;break;case"Literal":a=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===a&&"init"===s&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var i=t[a="$"+a];i?("init"===s?this.strict&&i.init||i.get||i.set:i.init||i[s])&&this.raiseRecoverable(r.start,"Redefinition of property"):i=t[a]={init:!1,get:!1,set:!1},i[s]=!0}}},oe.parseExpression=function(e,t){var n=this.start,a=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===$.comma){var s=this.startNodeAt(n,a);for(s.expressions=[r];this.eat($.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return r},oe.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var a=!1,r=-1,s=-1,i=-1;t?(r=t.parenthesizedAssign,s=t.trailingComma,i=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new W,a=!0);var o=this.start,l=this.startLoc;this.type!==$.parenL&&this.type!==$.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var c=this.parseMaybeConditional(e,t);if(n&&(c=n.call(this,c,o,l)),this.type.isAssign){var u=this.startNodeAt(o,l);return u.operator=this.value,this.type===$.eq&&(c=this.toAssignable(c,!1,t)),a||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===$.eq?this.checkLValPattern(c):this.checkLValSimple(c),u.left=c,this.next(),u.right=this.parseMaybeAssign(e),i>-1&&(t.doubleProto=i),this.finishNode(u,"AssignmentExpression")}return a&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),s>-1&&(t.trailingComma=s),c},oe.parseMaybeConditional=function(e,t){var n=this.start,a=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat($.question)){var s=this.startNodeAt(n,a);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect($.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r},oe.parseExprOps=function(e,t){var n=this.start,a=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===n&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,n,a,-1,e)},oe.parseExprOp=function(e,t,n,a,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==$._in)&&s>a){var i=this.type===$.logicalOR||this.type===$.logicalAND,o=this.type===$.coalesce;o&&(s=$.logicalAND.binop);var l=this.value;this.next();var c=this.start,u=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),c,u,s,r),d=this.buildBinary(t,n,e,p,l,i||o);return(i&&this.type===$.coalesce||o&&(this.type===$.logicalOR||this.type===$.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,n,a,r)}return e},oe.buildBinary=function(e,t,n,a,r,s){"PrivateIdentifier"===a.type&&this.raise(a.start,"Private identifier can only be left side of binary expression");var i=this.startNodeAt(e,t);return i.left=n,i.operator=r,i.right=a,this.finishNode(i,s?"LogicalExpression":"BinaryExpression")},oe.parseMaybeUnary=function(e,t,n,a){var r,s=this.start,i=this.startLoc;if(this.isContextual("await")&&this.canAwait)r=this.parseAwait(a),t=!0;else if(this.type.prefix){var o=this.startNode(),l=this.type===$.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,l,a),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(o.argument):this.strict&&"delete"===o.operator&&le(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):"delete"===o.operator&&ce(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,r=this.finishNode(o,l?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==$.privateId){if(r=this.parseExprSubscripts(e,a),this.checkExpressionErrors(e))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(s,i);c.operator=this.value,c.prefix=!1,c.argument=r,this.checkLValSimple(r),this.next(),r=this.finishNode(c,"UpdateExpression")}}else(a||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),r=this.parsePrivateIdent(),this.type!==$._in&&this.unexpected();return n||!this.eat($.starstar)?r:t?void this.unexpected(this.lastTokStart):this.buildBinary(s,i,r,this.parseMaybeUnary(null,!1,!1,a),"**",!1)},oe.parseExprSubscripts=function(e,t){var n=this.start,a=this.startLoc,r=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return r;var s=this.parseSubscripts(r,n,a,!1,t);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s},oe.parseSubscripts=function(e,t,n,a,r){for(var s=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,i=!1;;){var o=this.parseSubscript(e,t,n,a,s,i,r);if(o.optional&&(i=!0),o===e||"ArrowFunctionExpression"===o.type){if(i){var l=this.startNodeAt(t,n);l.expression=o,o=this.finishNode(l,"ChainExpression")}return o}e=o}},oe.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat($.arrow)},oe.parseSubscriptAsyncArrow=function(e,t,n,a){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,a)},oe.parseSubscript=function(e,t,n,a,r,s,i){var o=this.options.ecmaVersion>=11,l=o&&this.eat($.questionDot);a&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat($.bracketL);if(c||l&&this.type!==$.parenL&&this.type!==$.backQuote||this.eat($.dot)){var u=this.startNodeAt(t,n);u.object=e,c?(u.property=this.parseExpression(),this.expect($.bracketR)):this.type===$.privateId&&"Super"!==e.type?u.property=this.parsePrivateIdent():u.property=this.parseIdent("never"!==this.options.allowReserved),u.computed=!!c,o&&(u.optional=l),e=this.finishNode(u,"MemberExpression")}else if(!a&&this.eat($.parenL)){var p=new W,d=this.yieldPos,m=this.awaitPos,h=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList($.parenR,this.options.ecmaVersion>=8,!1,p);if(r&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=m,this.awaitIdentPos=h,this.parseSubscriptAsyncArrow(t,n,f,i);this.checkExpressionErrors(p,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=h||this.awaitIdentPos;var v=this.startNodeAt(t,n);v.callee=e,v.arguments=f,o&&(v.optional=l),e=this.finishNode(v,"CallExpression")}else if(this.type===$.backQuote){(l||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,n);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e},oe.parseExprAtom=function(e,t,n){this.type===$.slash&&this.readRegexp();var a,r=this.potentialArrowAt===this.start;switch(this.type){case $._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),a=this.startNode(),this.next(),this.type!==$.parenL||this.allowDirectSuper||this.raise(a.start,"super() call outside constructor of a subclass"),this.type!==$.dot&&this.type!==$.bracketL&&this.type!==$.parenL&&this.unexpected(),this.finishNode(a,"Super");case $._this:return a=this.startNode(),this.next(),this.finishNode(a,"ThisExpression");case $.name:var s=this.start,i=this.startLoc,o=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat($._function))return this.overrideContext(se.f_expr),this.parseFunction(this.startNodeAt(s,i),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat($.arrow))return this.parseArrowExpression(this.startNodeAt(s,i),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===$.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat($.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,i),[l],!0,t)}return l;case $.regexp:var c=this.value;return(a=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},a;case $.num:case $.string:return this.parseLiteral(this.value);case $._null:case $._true:case $._false:return(a=this.startNode()).value=this.type===$._null?null:this.type===$._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case $.parenL:var u=this.start,p=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),p;case $.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList($.bracketR,!0,!0,e),this.finishNode(a,"ArrayExpression");case $.braceL:return this.overrideContext(se.b_expr),this.parseObj(!1,e);case $._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case $._class:return this.parseClass(this.startNode(),!1);case $._new:return this.parseNew();case $.backQuote:return this.parseTemplate();case $._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},oe.parseExprAtomDefault=function(){this.unexpected()},oe.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===$.parenL&&!e)return this.parseDynamicImport(t);if(this.type===$.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}this.unexpected()},oe.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat($.parenR)?e.options=null:(this.expect($.comma),this.afterTrailingComma($.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat($.parenR)||(this.expect($.comma),this.afterTrailingComma($.parenR)||this.unexpected())));else if(!this.eat($.parenR)){var t=this.start;this.eat($.comma)&&this.eat($.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},oe.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},oe.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},oe.parseParenExpression=function(){this.expect($.parenL);var e=this.parseExpression();return this.expect($.parenR),e},oe.shouldParseArrow=function(e){return!this.canInsertSemicolon()},oe.parseParenAndDistinguishExpression=function(e,t){var n,a=this.start,r=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var i,o=this.start,l=this.startLoc,c=[],u=!0,p=!1,d=new W,m=this.yieldPos,h=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==$.parenR;){if(u?u=!1:this.expect($.comma),s&&this.afterTrailingComma($.parenR,!0)){p=!0;break}if(this.type===$.ellipsis){i=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===$.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var f=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect($.parenR),e&&this.shouldParseArrow(c)&&this.eat($.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=h,this.parseParenArrowList(a,r,c,t);c.length&&!p||this.unexpected(this.lastTokStart),i&&this.unexpected(i),this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=h||this.awaitPos,c.length>1?((n=this.startNodeAt(o,l)).expressions=c,this.finishNodeAt(n,"SequenceExpression",f,v)):n=c[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(a,r);return g.expression=n,this.finishNode(g,"ParenthesizedExpression")}return n},oe.parseParenItem=function(e){return e},oe.parseParenArrowList=function(e,t,n,a){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,a)};var ue=[];oe.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===$.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var a=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),a,r,!0,!1),this.eat($.parenL)?e.arguments=this.parseExprList($.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ue,this.finishNode(e,"NewExpression")},oe.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===$.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===$.backQuote,this.finishNode(n,"TemplateElement")},oe.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var a=this.parseTemplateElement({isTagged:t});for(n.quasis=[a];!a.tail;)this.type===$.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect($.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect($.braceR),n.quasis.push(a=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},oe.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===$.name||this.type===$.num||this.type===$.string||this.type===$.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===$.star)&&!b.test(this.input.slice(this.lastTokEnd,this.start))},oe.parseObj=function(e,t){var n=this.startNode(),a=!0,r={};for(n.properties=[],this.next();!this.eat($.braceR);){if(a)a=!1;else if(this.expect($.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma($.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},oe.parseProperty=function(e,t){var n,a,r,s,i=this.startNode();if(this.options.ecmaVersion>=9&&this.eat($.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===$.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===$.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(r=this.start,s=this.startLoc),e||(n=this.eat($.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(i)?(a=!0,n=this.options.ecmaVersion>=9&&this.eat($.star),this.parsePropertyName(i)):a=!1,this.parsePropertyValue(i,e,n,a,r,s,t,o),this.finishNode(i,"Property")},oe.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n="get"===e.kind?0:1;if(e.value.params.length!==n){var a=e.value.start;"get"===e.kind?this.raiseRecoverable(a,"getter should have no params"):this.raiseRecoverable(a,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},oe.parsePropertyValue=function(e,t,n,a,r,s,i,o){(n||a)&&this.type===$.colon&&this.unexpected(),this.eat($.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,i),e.kind="init"):this.options.ecmaVersion>=6&&this.type===$.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,a),e.kind="init"):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===$.comma||this.type===$.braceR||this.type===$.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||a)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key)):this.type===$.eq&&i?(i.shorthandAssign<0&&(i.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((n||a)&&this.unexpected(),this.parseGetterSetter(e))},oe.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat($.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect($.bracketR),e.key;e.computed=!1}return e.key=this.type===$.num||this.type===$.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},oe.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},oe.parseMethod=function(e,t,n){var a=this.startNode(),r=this.yieldPos,s=this.awaitPos,i=this.awaitIdentPos;return this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=e),this.options.ecmaVersion>=8&&(a.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|q(t,a.generator)|(n?128:0)),this.expect($.parenL),a.params=this.parseBindingList($.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=i,this.finishNode(a,"FunctionExpression")},oe.parseArrowExpression=function(e,t,n,a){var r=this.yieldPos,s=this.awaitPos,i=this.awaitIdentPos;return this.enterScope(16|q(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,a),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=i,this.finishNode(e,"ArrowFunctionExpression")},oe.parseFunctionBody=function(e,t,n,a){var r=t&&this.type!==$.braceL,s=this.strict,i=!1;if(r)e.body=this.parseMaybeAssign(a),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);s&&!o||(i=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(e,!s&&!i&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,i&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},oe.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if("Identifier"!==n[t].type)return!1;return!0},oe.checkParams=function(e,t){for(var n=Object.create(null),a=0,r=e.params;a<r.length;a+=1){var s=r[a];this.checkLValInnerPattern(s,1,t?null:n)}},oe.parseExprList=function(e,t,n,a){for(var r=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect($.comma),t&&this.afterTrailingComma(e))break;var i=void 0;n&&this.type===$.comma?i=null:this.type===$.ellipsis?(i=this.parseSpread(a),a&&this.type===$.comma&&a.trailingComma<0&&(a.trailingComma=this.start)):i=this.parseMaybeAssign(!1,a),r.push(i)}return r},oe.checkUnreserved=function(e){var t=e.start,n=e.end,a=e.name;this.inGenerator&&"yield"===a&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===a&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&U||"arguments"!==a||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==a&&"await"!==a||this.raise(t,"Cannot use "+a+" in class static initialization block"),this.keywords.test(a)&&this.raise(t,"Unexpected keyword '"+a+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,n).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(a)&&(this.inAsync||"await"!==a||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+a+"' is reserved"))},oe.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},oe.parseIdentNode=function(){var e=this.startNode();return this.type===$.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=$.name):this.unexpected(),e},oe.parsePrivateIdent=function(){var e=this.startNode();return this.type===$.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},oe.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===$.semi||this.canInsertSemicolon()||this.type!==$.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat($.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},oe.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var pe=B.prototype;pe.raise=function(e,t){var n=j(this.input,e);t+=" ("+n.line+":"+n.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var a=new SyntaxError(t);throw a.pos=e,a.loc=n,a.raisedAt=this.pos,a},pe.raiseRecoverable=pe.raise,pe.curPosition=function(){if(this.options.locations)return new P(this.curLine,this.pos-this.lineStart)};var de=B.prototype,me=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};de.enterScope=function(e){this.scopeStack.push(new me(e))},de.exitScope=function(){this.scopeStack.pop()},de.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},de.declareName=function(e,t,n){var a=!1;if(2===t){var r=this.currentScope();a=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var s=this.currentScope();a=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var i=this.scopeStack.length-1;i>=0;--i){var o=this.scopeStack[i];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){a=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],o.flags&U)break}a&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},de.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},de.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},de.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},de.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var he=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new M(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},fe=B.prototype;function ve(e,t,n,a){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=a),this.options.ranges&&(e.range[1]=n),e}fe.startNode=function(){return new he(this,this.start,this.startLoc)},fe.startNodeAt=function(e,t){return new he(this,e,t)},fe.finishNode=function(e,t){return ve.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},fe.finishNodeAt=function(e,t,n,a){return ve.call(this,e,t,n,a)},fe.copyNode=function(e){var t=new he(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var ge,ye,$e="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",be=$e+" Extended_Pictographic",Ee=be+" EBase EComp EMod EPres ExtPict",_e={9:$e,10:be,11:be,12:Ee,13:Ee,14:Ee},Se={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},xe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ae="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ie=Ae+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",we=Ie+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ne=we+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Te=Ne+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Oe={9:Ae,10:Ie,11:we,12:Ne,13:Te,14:Te+" Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz"},ke={};for(var Re=0,Ce=[9,10,11,12,13,14];Re<Ce.length;Re+=1)ye=void 0,(ye=ke[ge=Ce[Re]]={binary:R(_e[ge]+" "+xe),binaryOfStrings:R(Se[ge]),nonBinary:{General_Category:R(xe),Script:R(Oe[ge])}}).nonBinary.Script_Extensions=ye.nonBinary.Script,ye.nonBinary.gc=ye.nonBinary.General_Category,ye.nonBinary.sc=ye.nonBinary.Script,ye.nonBinary.scx=ye.nonBinary.Script_Extensions;var Le=B.prototype,Pe=function(e,t){this.parent=e,this.base=t||this};Pe.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},Pe.prototype.sibling=function(){return new Pe(this.parent,this.base)};var Me=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ke[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function je(e){return 105===e||109===e||115===e}function De(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Fe(e){return e>=65&&e<=90||e>=97&&e<=122}Me.prototype.reset=function(e,t,n){var a=-1!==n.indexOf("v"),r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,a&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)},Me.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Me.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,a=n.length;if(e>=a)return-1;var r=n.charCodeAt(e);if(!t&&!this.switchU||r<=55295||r>=57344||e+1>=a)return r;var s=n.charCodeAt(e+1);return s>=56320&&s<=57343?(r<<10)+s-56613888:r},Me.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,a=n.length;if(e>=a)return a;var r,s=n.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=a||(r=n.charCodeAt(e+1))<56320||r>57343?e+1:e+2},Me.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Me.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Me.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Me.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Me.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var n=this.pos,a=0,r=e;a<r.length;a+=1){var s=r[a],i=this.at(n,t);if(-1===i||i!==s)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Le.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,a=!1,r=!1,s=0;s<n.length;s++){var i=n.charAt(s);-1===t.indexOf(i)&&this.raise(e.start,"Invalid regular expression flag"),n.indexOf(i,s+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===i&&(a=!0),"v"===i&&(r=!0)}this.options.ecmaVersion>=15&&a&&r&&this.raise(e.start,"Invalid regular expression flag")},Le.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Le.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var a=n[t];e.groupNames[a]||e.raise("Invalid named capture referenced")}},Le.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Pe(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Le.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Le.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Le.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Le.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Le.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Le.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var a=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<a&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=n}return!1},Le.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Le.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Le.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),a=e.eat(45);if(n||a){for(var r=0;r<n.length;r++){var s=n.charAt(r);n.indexOf(s,r+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(a){var i=this.regexp_eatModifiers(e);n||i||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var o=0;o<i.length;o++){var l=i.charAt(o);(i.indexOf(l,o+1)>-1||n.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Le.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Le.regexp_eatModifiers=function(e){for(var t="",n=0;-1!==(n=e.current())&&je(n);)t+=C(n),e.advance();return t},Le.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Le.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Le.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!De(t)&&(e.lastIntValue=t,e.advance(),!0)},Le.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!De(n);)e.advance();return e.pos!==t},Le.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Le.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var a=0,r=n;a<r.length;a+=1)r[a].separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Le.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Le.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=C(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=C(e.lastIntValue);return!0}return!1},Le.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,a=e.current(n);return e.advance(n),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(a=e.lastIntValue),function(e){return p(e,!0)||36===e||95===e}(a)?(e.lastIntValue=a,!0):(e.pos=t,!1)},Le.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,a=e.current(n);return e.advance(n),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(a=e.lastIntValue),function(e){return d(e,!0)||36===e||95===e||8204===e||8205===e}(a)?(e.lastIntValue=a,!0):(e.pos=t,!1)},Le.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Le.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Le.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Le.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Le.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Le.regexp_eatZero=function(e){return 48===e.current()&&!Ue(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Le.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Le.regexp_eatControlLetter=function(e){var t=e.current();return!!Fe(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Le.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n,a=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(s-55296)+(o-56320)+65536,!0}e.pos=i,e.lastIntValue=s}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((n=e.lastIntValue)>=0&&n<=1114111))return!0;r&&e.raise("Invalid unicode escape"),e.pos=a}return!1},Le.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Le.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function Ye(e){return Fe(e)||95===e}function Ve(e){return Ye(e)||Ue(e)}function Ue(e){return e>=48&&e<=57}function qe(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Be(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function ze(e){return e>=48&&e<=55}Le.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=80===t)||112===t)){var a;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(a=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&2===a&&e.raise("Invalid property name"),a;e.raise("Invalid property name")}return 0},Le.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,a),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return 0},Le.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){T(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},Le.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Le.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ye(t=e.current());)e.lastStringValue+=C(t),e.advance();return""!==e.lastStringValue},Le.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ve(t=e.current());)e.lastStringValue+=C(t),e.advance();return""!==e.lastStringValue},Le.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Le.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===n&&e.raise("Negated character class may contain strings"),!0}return!1},Le.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Le.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},Le.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||ze(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var a=e.current();return 93!==a&&(e.lastIntValue=a,e.advance(),!0)},Le.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Le.regexp_classSetExpression=function(e){var t,n=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(n=2);for(var a=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(n=1):e.raise("Invalid character in character class");if(a!==e.pos)return n;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(a!==e.pos)return n}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return n;2===t&&(n=2)}},Le.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;return-1!==n&&-1!==a&&n>a&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Le.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Le.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),a=this.regexp_classContents(e);if(e.eat(93))return n&&2===a&&e.raise("Negated character class may contain strings"),a;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null},Le.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null},Le.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Le.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Le.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e)&&(e.eat(98)?(e.lastIntValue=8,0):(e.pos=t,1)));var n=e.current();return!(n<0||n===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(n)||function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(n)||(e.advance(),e.lastIntValue=n,0))},Le.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Le.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ue(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Le.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Le.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ue(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},Le.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;qe(n=e.current());)e.lastIntValue=16*e.lastIntValue+Be(n),e.advance();return e.pos!==t},Le.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},Le.regexp_eatOctalDigit=function(e){var t=e.current();return ze(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Le.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var a=0;a<t;++a){var r=e.current();if(!qe(r))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Be(r),e.advance()}return!0};var Ze=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new M(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Ge=B.prototype;function We(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}Ge.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ze(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ge.getToken=function(){return this.next(),new Ze(this)},"undefined"!=typeof Symbol&&(Ge[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===$.eof,value:t}}}}),Ge.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken($.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ge.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Ge.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Ge.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var a=void 0,r=t;(a=S(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=a;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Ge.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),a=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!_(a);)a=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Ge.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&x.test(String.fromCharCode(e))))break e;++this.pos}}},Ge.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Ge.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken($.ellipsis)):(++this.pos,this.finishToken($.dot))},Ge.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp($.assign,2):this.finishOp($.slash,1)},Ge.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,a=42===e?$.star:$.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,a=$.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp($.assign,n+1):this.finishOp(a,n)},Ge.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp($.assign,3):this.finishOp(124===e?$.logicalOR:$.logicalAND,2):61===t?this.finishOp($.assign,2):this.finishOp(124===e?$.bitwiseOR:$.bitwiseAND,1)},Ge.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp($.assign,2):this.finishOp($.bitwiseXOR,1)},Ge.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!b.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp($.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp($.assign,2):this.finishOp($.plusMin,1)},Ge.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp($.assign,n+1):this.finishOp($.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp($.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Ge.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp($.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken($.arrow)):this.finishOp(61===e?$.eq:$.prefix,1)},Ge.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp($.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp($.assign,3):this.finishOp($.coalesce,2)}return this.finishOp($.question,1)},Ge.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,p(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken($.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+C(e)+"'")},Ge.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken($.parenL);case 41:return++this.pos,this.finishToken($.parenR);case 59:return++this.pos,this.finishToken($.semi);case 44:return++this.pos,this.finishToken($.comma);case 91:return++this.pos,this.finishToken($.bracketL);case 93:return++this.pos,this.finishToken($.bracketR);case 123:return++this.pos,this.finishToken($.braceL);case 125:return++this.pos,this.finishToken($.braceR);case 58:return++this.pos,this.finishToken($.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken($.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp($.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+C(e)+"'")},Ge.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Ge.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var a=this.input.charAt(this.pos);if(b.test(a)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===a)t=!0;else if("]"===a&&t)t=!1;else if("/"===a&&!t)break;e="\\"===a}++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var s=this.pos,i=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new Me(this));o.reset(n,r,i),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(r,i)}catch(e){}return this.finishToken($.regexp,{pattern:r,flags:i,value:l})},Ge.readInt=function(e,t,n){for(var a=this.options.ecmaVersion>=12&&void 0===t,r=n&&48===this.input.charCodeAt(this.pos),s=this.pos,i=0,o=0,l=0,c=null==t?1/0:t;l<c;++l,++this.pos){var u=this.input.charCodeAt(this.pos),p=void 0;if(a&&95===u)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=u;else{if((p=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0)>=e)break;o=u,i=i*e+p}}return a&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:i},Ge.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n=We(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken($.num,n)},Ge.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var a=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===a){var r=We(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken($.num,r)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==a||n||(++this.pos,this.readInt(10),a=this.input.charCodeAt(this.pos)),69!==a&&101!==a||n||(43!==(a=this.input.charCodeAt(++this.pos))&&45!==a||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,i=(s=this.input.slice(t,this.pos),n?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken($.num,i)},Ge.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Ge.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===e)break;92===a?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):8232===a||8233===a?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(_(a)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken($.string,t)};var He={};Ge.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==He)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ge.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw He;this.raise(e,t)},Ge.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==$.template&&this.type!==$.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken($.template,e)):36===n?(this.pos+=2,this.finishToken($.dollarBraceL)):(++this.pos,this.finishToken($.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(_(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Ge.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken($.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},Ge.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return C(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),this.pos+=a.length-1,t=this.input.charCodeAt(this.pos),"0"===a&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-a.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return _(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},Ge.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Ge.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,a=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(d(r,a))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var i=this.readCodePoint();(t?p:d)(i,a)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=C(i),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},Ge.readWord=function(){var e=this.readWord1(),t=$.name;return this.keywords.test(e)&&(t=g[e]),this.finishToken(t,e)};var Ke="8.15.0";B.acorn={Parser:B,version:Ke,defaultOptions:D,Position:P,SourceLocation:M,getLineInfo:j,Node:he,TokenType:m,tokTypes:$,keywordTypes:g,TokContext:re,tokContexts:se,isIdentifierChar:d,isIdentifierStart:p,Token:Ze,isNewLine:_,lineBreak:b,lineBreakG:E,nonASCIIwhitespace:x},e.Node=he,e.Parser=B,e.Position=P,e.SourceLocation=M,e.TokContext=re,e.Token=Ze,e.TokenType=m,e.defaultOptions=D,e.getLineInfo=j,e.isIdentifierChar=d,e.isIdentifierStart=p,e.isNewLine=_,e.keywordTypes=g,e.lineBreak=b,e.lineBreakG=E,e.nonASCIIwhitespace=x,e.parse=function(e,t){return B.parse(e,t)},e.parseExpressionAt=function(e,t,n){return B.parseExpressionAt(e,t,n)},e.tokContexts=se,e.tokTypes=$,e.tokenizer=function(e,t){return B.tokenizer(e,t)},e.version=Ke}(t)},84591:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(46432),t),r(n(81379),t),r(n(34889),t),r(n(82663),t),r(n(99352),t),r(n(47969),t),r(n(17941),t),r(n(37724),t),r(n(28131),t),r(n(19133),t),r(n(10282),t),r(n(56911),t);var s=n(78145);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(96807),t),r(n(40957),t)},85216:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},85426:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(63875),r=n(80417),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const c=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=c},85623:(e,t,n)=>{const a=n(44455);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},85665:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},86224:(e,t,n)=>{n.d(t,{rS:()=>Je,EB:()=>Re,bz:()=>ot,YO:()=>mt,zM:()=>at,Ie:()=>qt,gM:()=>bt,k5:()=>At,Nl:()=>Bt,RZ:()=>Vt,eu:()=>wt,Zm:()=>pt,ch:()=>st,ai:()=>Qe,Ik:()=>ft,g1:()=>St,re:()=>vt,Yj:()=>ke,KC:()=>yt,L5:()=>ct});var a=n(36710),r=n(13008);class s{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),a=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of a)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}var i=n(27750),o=n(53266),l=n(87257);const c={major:4,minor:0,patch:0};var u=n(9606).URL;const p=a.xI("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=c;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,s=l.QH(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new a.GT;if(r||o instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await o,e.issues.length!==t&&(s||(s=l.QH(e,t)))}));else{if(e.issues.length===t)continue;s||(s=l.QH(e,t))}}return r?r.then((()=>e)):e};e._zod.run=(n,s)=>{const i=e._zod.parse(n,s);if(i instanceof Promise){if(!1===s.async)throw new a.GT;return i.then((e=>t(e,r,s)))}return t(i,r,s)}}e["~standard"]={validate:t=>{try{const n=(0,i.xL)(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return(0,i.bp)(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),d=a.xI("$ZodString",((e,t)=>{p.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o.Yj(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch(a){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),m=a.xI("$ZodStringFormat",((e,t)=>{r.ql.init(e,t),d.init(e,t)})),h=a.xI("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=o.Os),m.init(e,t)})),f=a.xI("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=o.uR(e))}else t.pattern??(t.pattern=o.uR());m.init(e,t)})),v=a.xI("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=o.Rp),m.init(e,t)})),g=a.xI("$ZodURL",((e,t)=>{m.init(e,t),e._zod.check=n=>{try{const a=n.value,r=new u(a),s=r.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.OI.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(!a.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s)}catch(a){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),y=a.xI("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=o.Zg()),m.init(e,t)})),$=a.xI("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=o.Ak),m.init(e,t)})),b=a.xI("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=o.gF),m.init(e,t)})),E=a.xI("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=o.Gl),m.init(e,t)})),_=a.xI("$ZodULID",((e,t)=>{t.pattern??(t.pattern=o.Z0),m.init(e,t)})),S=a.xI("$ZodXID",((e,t)=>{t.pattern??(t.pattern=o.kM),m.init(e,t)})),x=a.xI("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=o.fO),m.init(e,t)})),A=a.xI("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=o.w$(t)),m.init(e,t)})),I=a.xI("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=o.p6),m.init(e,t)})),w=a.xI("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=o.kB(t)),m.init(e,t)})),N=a.xI("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=o.p0),m.init(e,t)})),T=a.xI("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=o.uX),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),O=a.xI("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=o.ug),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new u(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),k=a.xI("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=o.zr),m.init(e,t)})),R=a.xI("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=o.l7),m.init(e,t),e._zod.check=n=>{const[a,r]=n.value.split("/");try{if(!r)throw new Error;const e=Number(r);if(`${e}`!==r)throw new Error;if(e<0||e>128)throw new Error;new u(`http://[${a}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function C(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const L=a.xI("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=o.K3),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{C(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),P=a.xI("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=o.r0),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!o.r0.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return C(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),M=a.xI("$ZodE164",((e,t)=>{t.pattern??(t.pattern=o.hQ),m.init(e,t)})),j=a.xI("$ZodJWT",((e,t)=>{m.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[a]=n;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),D=a.xI("$ZodNumber",((e,t)=>{p.init(e,t),e._zod.pattern=e._zod.bag.pattern??o.ai,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const r=n.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return n;const s="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),n}})),F=a.xI("$ZodNumber",((e,t)=>{r.KH.init(e,t),D.init(e,t)})),Y=a.xI("$ZodBoolean",((e,t)=>{p.init(e,t),e._zod.pattern=o.zM,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const r=n.value;return"boolean"==typeof r||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}})),V=a.xI("$ZodNull",((e,t)=>{p.init(e,t),e._zod.pattern=o.ch,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const a=t.value;return null===a||t.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),t}})),U=a.xI("$ZodAny",((e,t)=>{p.init(e,t),e._zod.parse=e=>e})),q=a.xI("$ZodUnknown",((e,t)=>{p.init(e,t),e._zod.parse=e=>e})),B=a.xI("$ZodNever",((e,t)=>{p.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function z(e,t,n){e.issues.length&&t.issues.push(...l.lQ(n,e.issues)),t.value[n]=e.value}const Z=a.xI("$ZodArray",((e,t)=>{p.init(e,t),e._zod.parse=(n,a)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let e=0;e<r.length;e++){const i=r[e],o=t.element._zod.run({value:i,issues:[]},a);o instanceof Promise?s.push(o.then((t=>z(t,n,e)))):z(o,n,e)}return s.length?Promise.all(s).then((()=>n)):n}}));function G(e,t,n){e.issues.length&&t.issues.push(...l.lQ(n,e.issues)),t.value[n]=e.value}function W(e,t,n,a){e.issues.length?void 0===a[n]?t.value[n]=n in a?void 0:e.value:t.issues.push(...l.lQ(n,e.issues)):void 0===e.value?n in a&&(t.value[n]=void 0):t.value[n]=e.value}const H=a.xI("$ZodObject",((e,t)=>{p.init(e,t);const n=l.PO((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof p))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=l.NM(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));let r;l.gJ(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const a=e[t]._zod;if(a.values){n[t]??(n[t]=new Set);for(const e of a.values)n[t].add(e)}}return n}));const i=l.Gv,o=!a.cr.jitless,c=l.hI,u=o&&c.value,d=t.catchall;let m;e._zod.parse=(a,c)=>{m??(m=n.value);const p=a.value;if(!i(p))return a.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),a;const h=[];if(o&&u&&!1===c?.async&&!0!==c.jitless)r||(r=(e=>{const t=new s(["shape","payload","ctx"]),a=n.value,r=e=>{const t=l.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of a.keys)i[e]="key_"+o++;t.write("const newResult = {}");for(const e of a.keys)if(a.optionalKeys.has(e)){const n=i[e];t.write(`const ${n} = ${r(e)};`);const a=l.UQ(e);t.write(`\n if (${n}.issues.length) {\n if (input[${a}] === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${a} in input) newResult[${a}] = undefined;\n } else {\n newResult[${a}] = ${n}.value;\n }\n `)}else{const n=i[e];t.write(`const ${n} = ${r(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${l.UQ(e)}, ...iss.path] : [${l.UQ(e)}]\n })));`),t.write(`newResult[${l.UQ(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const c=t.compile();return(t,n)=>c(e,t,n)})(t.shape)),a=r(a,c);else{a.value={};const e=m.shape;for(const t of m.keys){const n=e[t],r=n._zod.run({value:p[t],issues:[]},c),s="optional"===n._zod.optin&&"optional"===n._zod.optout;r instanceof Promise?h.push(r.then((e=>s?W(e,a,t,p):G(e,a,t)))):s?W(r,a,t,p):G(r,a,t)}}if(!d)return h.length?Promise.all(h).then((()=>a)):a;const f=[],v=m.keySet,g=d._zod,y=g.def.type;for(const e of Object.keys(p)){if(v.has(e))continue;if("never"===y){f.push(e);continue}const t=g.run({value:p[e],issues:[]},c);t instanceof Promise?h.push(t.then((t=>G(t,a,e)))):G(t,a,e)}return f.length&&a.issues.push({code:"unrecognized_keys",keys:f,input:p,inst:e}),h.length?Promise.all(h).then((()=>a)):a}}));function K(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>l.iR(e,r,a.$W())))))}),t}const X=a.xI("$ZodUnion",((e,t)=>{p.init(e,t),l.gJ(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),l.gJ(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),l.gJ(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),l.gJ(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>l.p6(e.source))).join("|")})$`)}})),e._zod.parse=(n,a)=>{let r=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},a);if(t instanceof Promise)s.push(t),r=!0;else{if(0===t.issues.length)return t;s.push(t)}}return r?Promise.all(s).then((t=>K(t,n,e,a))):K(s,n,e,a)}})),J=a.xI("$ZodDiscriminatedUnion",((e,t)=>{X.init(e,t);const n=e._zod.parse;l.gJ(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const a=n._zod.propValues;if(!a||0===Object.keys(a).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(a)){e[t]||(e[t]=new Set);for(const a of n)e[t].add(a)}}return e}));const a=l.PO((()=>{const e=t.options,n=new Map;for(const a of e){const e=a._zod.propValues[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,a)}}return n}));e._zod.parse=(r,s)=>{const i=r.value;if(!l.Gv(i))return r.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),r;const o=a.value.get(i?.[t.discriminator]);return o?o._zod.run(r,s):t.unionFallback?n(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),r)}})),Q=a.xI("$ZodIntersection",((e,t)=>{p.init(e,t),e._zod.parse=(e,n)=>{const a=e.value,r=t.left._zod.run({value:a,issues:[]},n),s=t.right._zod.run({value:a,issues:[]},n);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then((([t,n])=>te(e,t,n))):te(e,r,s)}}));function ee(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(l.Qd(e)&&l.Qd(t)){const n=Object.keys(t),a=Object.keys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of a){const a=ee(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r[n]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const r=ee(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function te(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),l.QH(e))return e;const a=ee(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const ne=a.xI("$ZodRecord",((e,t)=>{p.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!l.Qd(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;n.value={};for(const e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const a=t.valueType._zod.run({value:s[e],issues:[]},r);a instanceof Promise?i.push(a.then((t=>{t.issues.length&&n.issues.push(...l.lQ(e,t.issues)),n.value[e]=t.value}))):(a.issues.length&&n.issues.push(...l.lQ(e,a.issues)),n.value[e]=a.value)}let o;for(const e in s)a.has(e)||(o=o??[],o.push(e));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:o})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const c=t.keyType._zod.run({value:o,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:c.issues.map((e=>l.iR(e,r,a.$W()))),input:o,path:[o],inst:e}),n.value[c.value]=c.value;continue}const u=t.valueType._zod.run({value:s[o],issues:[]},r);u instanceof Promise?i.push(u.then((e=>{e.issues.length&&n.issues.push(...l.lQ(o,e.issues)),n.value[c.value]=e.value}))):(u.issues.length&&n.issues.push(...l.lQ(o,u.issues)),n.value[c.value]=u.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),ae=a.xI("$ZodEnum",((e,t)=>{p.init(e,t);const n=l.w5(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>l.qQ.has(typeof e))).map((e=>"string"==typeof e?l.$f(e):e.toString())).join("|")})$`),e._zod.parse=(t,a)=>{const r=t.value;return e._zod.values.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),re=a.xI("$ZodLiteral",((e,t)=>{p.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?l.$f(e):e?e.toString():String(e))).join("|")})$`),e._zod.parse=(n,a)=>{const r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}})),se=a.xI("$ZodTransform",((e,t)=>{p.init(e,t),e._zod.parse=(e,n)=>{const r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then((t=>(e.value=t,e)));if(r instanceof Promise)throw new a.GT;return e.value=r,e}})),ie=a.xI("$ZodOptional",((e,t)=>{p.init(e,t),e._zod.optin="optional",e._zod.optout="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),l.gJ(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l.p6(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)})),oe=a.xI("$ZodNullable",((e,t)=>{p.init(e,t),l.gJ(e._zod,"optin",(()=>t.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),l.gJ(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l.p6(e.source)}|null)$`):void 0})),l.gJ(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),le=a.xI("$ZodDefault",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then((e=>ce(e,t))):ce(a,t)}}));function ce(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ue=a.xI("$ZodPrefault",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),pe=a.xI("$ZodNonOptional",((e,t)=>{p.init(e,t),l.gJ(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,a)=>{const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then((t=>de(t,e))):de(r,e)}}));function de(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const me=a.xI("$ZodCatch",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>l.iR(e,n,a.$W())))},input:e.value}),e.issues=[]),e))):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>l.iR(e,n,a.$W())))},input:e.value}),e.issues=[]),e)}})),he=a.xI("$ZodPipe",((e,t)=>{p.init(e,t),l.gJ(e._zod,"values",(()=>t.in._zod.values)),l.gJ(e._zod,"optin",(()=>t.in._zod.optin)),l.gJ(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const a=t.in._zod.run(e,n);return a instanceof Promise?a.then((e=>fe(e,t,n))):fe(a,t,n)}}));function fe(e,t,n){return l.QH(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const ve=a.xI("$ZodReadonly",((e,t)=>{p.init(e,t),l.gJ(e._zod,"propValues",(()=>t.innerType._zod.propValues)),l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),l.gJ(e._zod,"optin",(()=>t.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(ge):ge(a)}}));function ge(e){return e.value=Object.freeze(e.value),e}const ye=a.xI("$ZodLazy",((e,t)=>{p.init(e,t),l.gJ(e._zod,"innerType",(()=>t.getter())),l.gJ(e._zod,"pattern",(()=>e._zod.innerType._zod.pattern)),l.gJ(e._zod,"propValues",(()=>e._zod.innerType._zod.propValues)),l.gJ(e._zod,"optin",(()=>e._zod.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>e._zod.innerType._zod.optout)),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)})),$e=a.xI("$ZodCustom",((e,t)=>{r.QP.init(e,t),p.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const a=n.value,r=t.fn(a);if(r instanceof Promise)return r.then((t=>be(t,n,a,e)));be(r,n,a,e)}}));function be(e,t,n,a){if(!e){const e={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(l.sn(e))}}var Ee=n(26518),_e=n(42937);const Se=a.xI("ZodISODateTime",((e,t)=>{A.init(e,t),Re.init(e,t)})),xe=a.xI("ZodISODate",((e,t)=>{I.init(e,t),Re.init(e,t)})),Ae=a.xI("ZodISOTime",((e,t)=>{w.init(e,t),Re.init(e,t)})),Ie=a.xI("ZodISODuration",((e,t)=>{N.init(e,t),Re.init(e,t)}));var we=n(23253);const Ne=a.xI("ZodType",((e,t)=>(p.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>l.o8(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>we.qg(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>we.xL(e,t,n),e.parseAsync=async(t,n)=>we.EJ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>we.bp(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return _e.fU(Ut,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new r.QP({check:"custom"});return t._zod.check=e,t}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(l.sn(e,n.value,t._zod.def));else{const a=e;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),n.issues.push(l.sn(a))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(_e.bS(t)),e.optional=()=>Ot(e),e.nullable=()=>Rt(e),e.nullish=()=>Ot(Rt(e)),e.nonoptional=t=>function(e,t){return new Pt({type:"nonoptional",innerType:e,...l.A2(t)})}(e,t),e.array=()=>mt(e),e.or=t=>yt([e,t]),e.and=t=>new Et({type:"intersection",left:e,right:t}),e.transform=t=>Dt(e,new Nt({type:"transform",transform:t})),e.default=t=>{return n=t,new Ct({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Lt({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new Mt({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Dt(e,t),e.readonly=()=>new Ft({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Ee.fd.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Ee.fd.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Ee.fd.get(e);const n=e.clone();return Ee.fd.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Te=a.xI("_ZodString",((e,t)=>{d.init(e,t),Ne.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(_e.Fk(...t)),e.includes=(...t)=>e.check(_e.dR(...t)),e.startsWith=(...t)=>e.check(_e.$S(...t)),e.endsWith=(...t)=>e.check(_e.ER(...t)),e.min=(...t)=>e.check(_e.m9(...t)),e.max=(...t)=>e.check(_e.Eb(...t)),e.length=(...t)=>e.check(_e.YA(...t)),e.nonempty=(...t)=>e.check(_e.m9(1,...t)),e.lowercase=t=>e.check(_e.hH(t)),e.uppercase=t=>e.check(_e.qF(t)),e.trim=()=>e.check(_e.WN()),e.normalize=(...t)=>e.check(_e.lo(...t)),e.toLowerCase=()=>e.check(_e.Il()),e.toUpperCase=()=>e.check(_e.xY())})),Oe=a.xI("ZodString",((e,t)=>{d.init(e,t),Te.init(e,t),e.email=t=>e.check(_e.Mu(Ce,t)),e.url=t=>e.check(_e.Fn(Me,t)),e.jwt=t=>e.check(_e.rk(Xe,t)),e.emoji=t=>e.check(_e.aC(je,t)),e.guid=t=>e.check(_e.tB(Le,t)),e.uuid=t=>e.check(_e.Be(Pe,t)),e.uuidv4=t=>e.check(_e.nA(Pe,t)),e.uuidv6=t=>e.check(_e.pY(Pe,t)),e.uuidv7=t=>e.check(_e.wA(Pe,t)),e.nanoid=t=>e.check(_e.Dl(De,t)),e.guid=t=>e.check(_e.tB(Le,t)),e.cuid=t=>e.check(_e.fs(Fe,t)),e.cuid2=t=>e.check(_e.Bj(Ye,t)),e.ulid=t=>e.check(_e.Ct(Ve,t)),e.base64=t=>e.check(_e.rt(We,t)),e.base64url=t=>e.check(_e.cU(He,t)),e.xid=t=>e.check(_e.Pw(Ue,t)),e.ksuid=t=>e.check(_e._z(qe,t)),e.ipv4=t=>e.check(_e.Ny(Be,t)),e.ipv6=t=>e.check(_e.$O(ze,t)),e.cidrv4=t=>e.check(_e.Uy(Ze,t)),e.cidrv6=t=>e.check(_e.gP(Ge,t)),e.e164=t=>e.check(_e.KB(Ke,t)),e.datetime=t=>e.check(function(e){return _e.G1(Se,e)}(t)),e.date=t=>e.check(function(e){return _e.db(xe,e)}(t)),e.time=t=>e.check(function(e){return _e.Kn(Ae,e)}(t)),e.duration=t=>e.check(function(e){return _e.f2(Ie,e)}(t))}));function ke(e){return _e.Rl(Oe,e)}const Re=a.xI("ZodStringFormat",((e,t)=>{m.init(e,t),Te.init(e,t)})),Ce=a.xI("ZodEmail",((e,t)=>{v.init(e,t),Re.init(e,t)})),Le=a.xI("ZodGUID",((e,t)=>{h.init(e,t),Re.init(e,t)})),Pe=a.xI("ZodUUID",((e,t)=>{f.init(e,t),Re.init(e,t)})),Me=a.xI("ZodURL",((e,t)=>{g.init(e,t),Re.init(e,t)})),je=a.xI("ZodEmoji",((e,t)=>{y.init(e,t),Re.init(e,t)})),De=a.xI("ZodNanoID",((e,t)=>{$.init(e,t),Re.init(e,t)})),Fe=a.xI("ZodCUID",((e,t)=>{b.init(e,t),Re.init(e,t)})),Ye=a.xI("ZodCUID2",((e,t)=>{E.init(e,t),Re.init(e,t)})),Ve=a.xI("ZodULID",((e,t)=>{_.init(e,t),Re.init(e,t)})),Ue=a.xI("ZodXID",((e,t)=>{S.init(e,t),Re.init(e,t)})),qe=a.xI("ZodKSUID",((e,t)=>{x.init(e,t),Re.init(e,t)})),Be=a.xI("ZodIPv4",((e,t)=>{T.init(e,t),Re.init(e,t)})),ze=a.xI("ZodIPv6",((e,t)=>{O.init(e,t),Re.init(e,t)})),Ze=a.xI("ZodCIDRv4",((e,t)=>{k.init(e,t),Re.init(e,t)})),Ge=a.xI("ZodCIDRv6",((e,t)=>{R.init(e,t),Re.init(e,t)})),We=a.xI("ZodBase64",((e,t)=>{L.init(e,t),Re.init(e,t)})),He=a.xI("ZodBase64URL",((e,t)=>{P.init(e,t),Re.init(e,t)})),Ke=a.xI("ZodE164",((e,t)=>{M.init(e,t),Re.init(e,t)})),Xe=a.xI("ZodJWT",((e,t)=>{j.init(e,t),Re.init(e,t)})),Je=a.xI("ZodNumber",((e,t)=>{D.init(e,t),Ne.init(e,t),e.gt=(t,n)=>e.check(_e.Tx(t,n)),e.gte=(t,n)=>e.check(_e.qm(t,n)),e.min=(t,n)=>e.check(_e.qm(t,n)),e.lt=(t,n)=>e.check(_e.Au(t,n)),e.lte=(t,n)=>e.check(_e.Zm(t,n)),e.max=(t,n)=>e.check(_e.Zm(t,n)),e.int=t=>e.check(tt(t)),e.safe=t=>e.check(tt(t)),e.positive=t=>e.check(_e.Tx(0,t)),e.nonnegative=t=>e.check(_e.qm(0,t)),e.negative=t=>e.check(_e.Au(0,t)),e.nonpositive=t=>e.check(_e.Zm(0,t)),e.multipleOf=(t,n)=>e.check(_e.Hi(t,n)),e.step=(t,n)=>e.check(_e.Hi(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Qe(e){return _e.F7(Je,e)}const et=a.xI("ZodNumberFormat",((e,t)=>{F.init(e,t),Je.init(e,t)}));function tt(e){return _e.LK(et,e)}const nt=a.xI("ZodBoolean",((e,t)=>{Y.init(e,t),Ne.init(e,t)}));function at(e){return _e._L(nt,e)}const rt=a.xI("ZodNull",((e,t)=>{V.init(e,t),Ne.init(e,t)}));function st(e){return _e.jw(rt,e)}const it=a.xI("ZodAny",((e,t)=>{U.init(e,t),Ne.init(e,t)}));function ot(){return _e.KA(it)}const lt=a.xI("ZodUnknown",((e,t)=>{q.init(e,t),Ne.init(e,t)}));function ct(){return _e.em(lt)}const ut=a.xI("ZodNever",((e,t)=>{B.init(e,t),Ne.init(e,t)}));function pt(e){return _e.G8(ut,e)}const dt=a.xI("ZodArray",((e,t)=>{Z.init(e,t),Ne.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(_e.m9(t,n)),e.nonempty=t=>e.check(_e.m9(1,t)),e.max=(t,n)=>e.check(_e.Eb(t,n)),e.length=(t,n)=>e.check(_e.YA(t,n)),e.unwrap=()=>e.element}));function mt(e,t){return _e.dZ(dt,e,t)}const ht=a.xI("ZodObject",((e,t)=>{H.init(e,t),Ne.init(e,t),l.gJ(e,"shape",(()=>t.shape)),e.keyof=()=>At(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ct()}),e.loose=()=>e.clone({...e._zod.def,catchall:ct()}),e.strict=()=>e.clone({...e._zod.def,catchall:pt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>l.X$(e,t),e.merge=t=>l.h1(e,t),e.pick=t=>l.Up(e,t),e.omit=t=>l.cJ(e,t),e.partial=(...t)=>l.OH(Tt,e,t[0]),e.required=(...t)=>l.mw(Pt,e,t[0])}));function ft(e,t){const n={type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},...l.A2(t)};return new ht(n)}function vt(e,t){return new ht({type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},catchall:pt(),...l.A2(t)})}const gt=a.xI("ZodUnion",((e,t)=>{X.init(e,t),Ne.init(e,t),e.options=t.options}));function yt(e,t){return new gt({type:"union",options:e,...l.A2(t)})}const $t=a.xI("ZodDiscriminatedUnion",((e,t)=>{gt.init(e,t),J.init(e,t)}));function bt(e,t,n){return new $t({type:"union",options:t,discriminator:e,...l.A2(n)})}const Et=a.xI("ZodIntersection",((e,t)=>{Q.init(e,t),Ne.init(e,t)})),_t=a.xI("ZodRecord",((e,t)=>{ne.init(e,t),Ne.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}));function St(e,t,n){return new _t({type:"record",keyType:e,valueType:t,...l.A2(n)})}const xt=a.xI("ZodEnum",((e,t)=>{ae.init(e,t),Ne.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,a)=>{const r={};for(const a of e){if(!n.has(a))throw new Error(`Key ${a} not found in enum`);r[a]=t.entries[a]}return new xt({...t,checks:[],...l.A2(a),entries:r})},e.exclude=(e,a)=>{const r={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new xt({...t,checks:[],...l.A2(a),entries:r})}}));function At(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new xt({type:"enum",entries:n,...l.A2(t)})}const It=a.xI("ZodLiteral",((e,t)=>{re.init(e,t),Ne.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function wt(e,t){return new It({type:"literal",values:Array.isArray(e)?e:[e],...l.A2(t)})}const Nt=a.xI("ZodTransform",((e,t)=>{se.init(e,t),Ne.init(e,t),e._zod.parse=(n,a)=>{n.addIssue=a=>{if("string"==typeof a)n.issues.push(l.sn(a,n.value,t));else{const t=a;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),n.issues.push(l.sn(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then((e=>(n.value=e,n))):(n.value=r,n)}}));const Tt=a.xI("ZodOptional",((e,t)=>{ie.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ot(e){return new Tt({type:"optional",innerType:e})}const kt=a.xI("ZodNullable",((e,t)=>{oe.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Rt(e){return new kt({type:"nullable",innerType:e})}const Ct=a.xI("ZodDefault",((e,t)=>{le.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Lt=a.xI("ZodPrefault",((e,t)=>{ue.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Pt=a.xI("ZodNonOptional",((e,t)=>{pe.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Mt=a.xI("ZodCatch",((e,t)=>{me.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),jt=a.xI("ZodPipe",((e,t)=>{he.init(e,t),Ne.init(e,t),e.in=t.in,e.out=t.out}));function Dt(e,t){return new jt({type:"pipe",in:e,out:t})}const Ft=a.xI("ZodReadonly",((e,t)=>{ve.init(e,t),Ne.init(e,t)})),Yt=a.xI("ZodLazy",((e,t)=>{ye.init(e,t),Ne.init(e,t),e.unwrap=()=>e._zod.def.getter()}));function Vt(e){return new Yt({type:"lazy",getter:e})}const Ut=a.xI("ZodCustom",((e,t)=>{$e.init(e,t),Ne.init(e,t)}));function qt(e,t){return _e.FO(Ut,e??(()=>!0),t)}function Bt(e,t={error:`Input not instance of ${e.name}`}){const n=new Ut({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...l.A2(t)});return n._zod.bag.Class=e,n}},86506:(e,t,n)=>{const a=n(48381);e.exports=(e,t)=>new a(e,t).patch},86543:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},86812:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(26633),r=n(93555),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const c=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=c},86912:(e,t,n)=>{const a=n(41694);e.exports=(e,t)=>new a(e,t).major},86987:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},87257:(e,t,n)=>{function a(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function r(e,t){return"bigint"==typeof t?t.toString():t}function s(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function i(e){return null==e}function o(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function l(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}function c(e,t,n){Object.defineProperty(e,t,{get(){{const a=n();return e[t]=a,a}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function u(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function p(e){return JSON.stringify(e)}n.d(t,{$f:()=>g,A2:()=>$,Gv:()=>m,LG:()=>l,NM:()=>b,OH:()=>I,PO:()=>s,QH:()=>N,Qd:()=>f,Rc:()=>R,UQ:()=>p,Up:()=>_,Vy:()=>u,X$:()=>x,cJ:()=>S,cl:()=>i,gJ:()=>c,gx:()=>d,h1:()=>A,hI:()=>h,iR:()=>k,k8:()=>r,lQ:()=>T,mw:()=>w,o8:()=>y,p6:()=>o,qQ:()=>v,sn:()=>C,w5:()=>a,zH:()=>E});const d=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function m(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const h=s((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function f(e){if(!1===m(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==m(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const v=new Set(["string","number","symbol"]);function g(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(e,t,n){const a=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(a._zod.parent=e),a}function $(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function b(e){return Object.keys(e).filter((t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout))}new Set(["string","number","bigint","boolean","symbol","undefined"]);const E={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function _(e,t){const n={},a=e._zod.def;for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=a.shape[e])}return y(e,{...e._zod.def,shape:n,checks:[]})}function S(e,t){const n={...e._zod.def.shape},a=e._zod.def;for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return y(e,{...e._zod.def,shape:n,checks:[]})}function x(e,t){if(!f(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return u(this,"shape",n),n},checks:[]};return y(e,n)}function A(e,t){return y(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return u(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function I(e,t,n){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(const t in a)r[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return y(t,{...t._zod.def,shape:r,checks:[]})}function w(e,t,n){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(const t in a)r[t]=new e({type:"nonoptional",innerType:a[t]});return y(t,{...t._zod.def,shape:r,checks:[]})}function N(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function T(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function O(e){return"string"==typeof e?e:e?.message}function k(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const r=O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function R(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function C(...e){const[t,n,a]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:a}:{...t}}},87391:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},88099:(e,t,n)=>{const a=n(9350),r=n(33629),s=n(42734);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},88108:(e,t,n)=>{const a=n(45160),r=n(25812),s=n(58809),i=n(54506),o=n(20038),l=n(66239);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,c);case"!=":return r(e,n,c);case">":return s(e,n,c);case">=":return i(e,n,c);case"<":return o(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},88345:(e,t,n)=>{const a=n(38366);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},88770:(e,t,n)=>{const a=n(47538);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},89065:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},89247:(e,t,n)=>{n.d(t,{nF:()=>r});var a=n(53354);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES;const r=a.VALIDATION_TEMPLATE;a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions,a.wrapField},89834:(e,t,n)=>{const a=n(33629);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},89975:(e,t,n)=>{const a=n(32910);e.exports=(e,t,n)=>a(e,t,"<",n)},90216:(e,t,n)=>{const a=n(9350);e.exports=(e,t)=>new a(e,t).major},90733:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},90898:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)<=0},91152:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)<0},91716:(e,t,n)=>{const a=n(66283);e.exports=(e,t)=>new a(e,t).patch},91871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},91934:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},91989:(e,t,n)=>{var a,r;n.d(t,{kY:()=>Oe,YO:()=>Le,zM:()=>Ce,ai:()=>Re,Ik:()=>Pe,Yj:()=>ke,KC:()=>Me}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of n)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a||(a={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const s=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class l extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(e){if(!(e instanceof l))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}l.create=e=>new l(e);const c=(e,t)=>{let n;switch(e.code){case o.invalid_type:n=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:n=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case o.invalid_union:n="Invalid input";break;case o.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case o.invalid_enum_value:n=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:n="Invalid function arguments";break;case o.invalid_return_type:n="Invalid function return type";break;case o.invalid_date:n="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:n="Invalid input";break;case o.invalid_intersection_types:n="Intersection results could not be merged";break;case o.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:n="Number must be finite";break;default:n=t.defaultError,a.assertNever(e)}return{message:n}};let u=c;var p;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(p||(p={}));function d(e,t){const n=u,a=(e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,s=[...n,...r.path||[]],i={...r,path:s};if(void 0!==r.message)return{...r,path:s,message:r.message};let o="";const l=a.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===c?void 0:c].filter((e=>!!e))});e.common.issues.push(a)}class m{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return h;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,a=await e.value;n.push({key:t,value:a})}return m.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return h;if("aborted"===r.status)return h;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const h=Object.freeze({status:"aborted"}),f=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),g=e=>"aborted"===e.status,y=e=>"dirty"===e.status,$=e=>"valid"===e.status,b=e=>"undefined"!=typeof Promise&&e instanceof Promise;var E=n(9606).URL;class _{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const S=(e,t)=>{if($(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new l(e.common.issues);return this._error=t,this._error}}};function x(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??r.defaultError}:void 0===r.data?{message:s??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:s??n??r.defaultError}},description:r}}class A{get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new m,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(b(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:n.path,parent:n});return S(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return $(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>$(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await(b(a)?a:Promise.resolve(a));return S(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const r=e(t),s=()=>a.addIssue({code:o.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(s(),!1))):!!r||(s(),!1)}))}refinement(e,t){return this._refinement(((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1)))}_refinement(e){return new Ee({schema:this,typeName:Oe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return _e.create(this,this._def)}nullable(){return Se.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ie.create(this)}promise(){return be.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return pe.create(this,e,this._def)}transform(e){return new Ee({...x(this._def),schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new xe({...x(this._def),innerType:this,defaultValue:t,typeName:Oe.ZodDefault})}brand(){return new we({typeName:Oe.ZodBranded,type:this,...x(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ae({...x(this._def),innerType:this,catchValue:t,typeName:Oe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ne.create(this,e)}readonly(){return Te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const I=/^c[^\s-]{8,}$/i,w=/^[0-9a-z]+$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/i,T=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,O=/^[a-z0-9_-]{21}$/i,k=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,R=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,C=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let L;const P=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,M=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,D=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Y=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",U=new RegExp(`^${V}$`);function q(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function B(e){let t=`${V}T${q(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function z(e,t){if(!k.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==r?.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function Z(e,t){return!("v4"!==t&&t||!M.test(e))||!("v6"!==t&&t||!D.test(e))}class G extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),h}const t=new m;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const a=e.data.length>s.value,r=e.data.length<s.value;(a||r)&&(n=this._getOrReturnCtx(e,n),a?d(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&d(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)C.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)L||(L=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),L.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)T.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)O.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)I.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)w.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)N.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new E(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?B(s).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?U.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:o.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${q(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:o.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?R.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:o.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(i=s.version)&&i||!P.test(r))&&("v6"!==i&&i||!j.test(r))&&(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):"jwt"===s.kind?z(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:o.invalid_string,message:s.message}),t.dirty()):"cidr"===s.kind?Z(e.data,s.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:o.invalid_string,message:s.message}),t.dirty()):"base64"===s.kind?F.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:o.invalid_string,message:s.message}),t.dirty()):"base64url"===s.kind?Y.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:o.invalid_string,message:s.message}),t.dirty()):a.assertNever(s);var r,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...p.errToObj(n)})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...p.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...p.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...p.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...p.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...p.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...p.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...p.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...p.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...p.errToObj(t)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function W(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}G.create=e=>new G({checks:[],typeName:Oe.ZodString,coerce:e?.coerce??!1,...x(e)});class H extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),h}let t;const n=new m;for(const r of this._def.checks)"int"===r.kind?a.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),d(t,{code:o.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:o.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:o.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==W(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),d(t,{code:o.not_finite,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,n,a){return new H({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:p.toString(a)}]})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}H.create=e=>new H({checks:[],typeName:Oe.ZodNumber,coerce:e?.coerce||!1,...x(e)});class K extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==s.bigint)return this._getInvalidInput(e);let t;const n=new m;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:o.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:o.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),d(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),h}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,n,a){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:p.toString(a)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}K.create=e=>new K({checks:[],typeName:Oe.ZodBigInt,coerce:e?.coerce??!1,...x(e)});class X extends A{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),h}return v(e.data)}}X.create=e=>new X({typeName:Oe.ZodBoolean,coerce:e?.coerce||!1,...x(e)});class J extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),h}if(Number.isNaN(e.data.getTime()))return d(this._getOrReturnCtx(e),{code:o.invalid_date}),h;const t=new m;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:o.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:o.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):a.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}J.create=e=>new J({checks:[],coerce:e?.coerce||!1,typeName:Oe.ZodDate,...x(e)});class Q extends A{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),h}return v(e.data)}}Q.create=e=>new Q({typeName:Oe.ZodSymbol,...x(e)});class ee extends A{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),h}return v(e.data)}}ee.create=e=>new ee({typeName:Oe.ZodUndefined,...x(e)});class te extends A{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),h}return v(e.data)}}te.create=e=>new te({typeName:Oe.ZodNull,...x(e)});class ne extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}ne.create=e=>new ne({typeName:Oe.ZodAny,...x(e)});class ae extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}ae.create=e=>new ae({typeName:Oe.ZodUnknown,...x(e)});class re extends A{_parse(e){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),h}}re.create=e=>new re({typeName:Oe.ZodNever,...x(e)});class se extends A{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),h}return v(e.data)}}se.create=e=>new se({typeName:Oe.ZodVoid,...x(e)});class ie extends A{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==s.array)return d(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),h;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(d(t,{code:e?o.too_big:o.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(d(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(d(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new _(t,e,t.path,n))))).then((e=>m.mergeArray(n,e)));const r=[...t.data].map(((e,n)=>a.type._parseSync(new _(t,e,t.path,n))));return m.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new ie({...this._def,minLength:{value:e,message:p.toString(t)}})}max(e,t){return new ie({...this._def,maxLength:{value:e,message:p.toString(t)}})}length(e,t){return new ie({...this._def,exactLength:{value:e,message:p.toString(t)}})}nonempty(e){return this.min(1,e)}}function oe(e){if(e instanceof le){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=_e.create(oe(a))}return new le({...e._def,shape:()=>t})}return e instanceof ie?new ie({...e._def,type:oe(e.element)}):e instanceof _e?_e.create(oe(e.unwrap())):e instanceof Se?Se.create(oe(e.unwrap())):e instanceof de?de.create(e.items.map((e=>oe(e)))):e}ie.create=(e,t)=>new ie({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Oe.ZodArray,...x(t)});class le extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),h}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof re&&"strip"===this._def.unknownKeys))for(const e in n.data)r.includes(e)||i.push(e);const l=[];for(const e of r){const t=a[e],r=n.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new _(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof re){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)l.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(d(n,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=n.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new _(n,a,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of l){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>m.mergeObjectSync(t,e))):m.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new le({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const a=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:p.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new le({...this._def,unknownKeys:"strip"})}passthrough(){return new le({...this._def,unknownKeys:"passthrough"})}extend(e){return new le({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new le({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Oe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new le({...this._def,catchall:e})}pick(e){const t={};for(const n of a.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new le({...this._def,shape:()=>t})}omit(e){const t={};for(const n of a.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new le({...this._def,shape:()=>t})}deepPartial(){return oe(this)}partial(e){const t={};for(const n of a.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new le({...this._def,shape:()=>t})}required(e){const t={};for(const n of a.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof _e;)e=e._def.innerType;t[n]=e}return new le({...this._def,shape:()=>t})}keyof(){return ge(a.objectKeys(this.shape))}}le.create=(e,t)=>new le({shape:()=>e,unknownKeys:"strip",catchall:re.create(),typeName:Oe.ZodObject,...x(t)}),le.strictCreate=(e,t)=>new le({shape:()=>e,unknownKeys:"strict",catchall:re.create(),typeName:Oe.ZodObject,...x(t)}),le.lazycreate=(e,t)=>new le({shape:e,unknownKeys:"strip",catchall:re.create(),typeName:Oe.ZodObject,...x(t)});class ce extends A{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new l(e.ctx.common.issues)));return d(t,{code:o.invalid_union,unionErrors:n}),h}));{let e;const a=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map((e=>new l(e)));return d(t,{code:o.invalid_union,unionErrors:r}),h}}get options(){return this._def.options}}function ue(e,t){const n=i(e),r=i(t);if(e===t)return{valid:!0,data:e};if(n===s.object&&r===s.object){const n=a.objectKeys(t),r=a.objectKeys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const n of r){const a=ue(e[n],t[n]);if(!a.valid)return{valid:!1};s[n]=a.data}return{valid:!0,data:s}}if(n===s.array&&r===s.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=ue(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===s.date&&r===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}ce.create=(e,t)=>new ce({options:e,typeName:Oe.ZodUnion,...x(t)});class pe extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(g(e)||g(a))return h;const r=ue(e.value,a.value);return r.valid?((y(e)||y(a))&&t.dirty(),{status:t.value,value:r.data}):(d(n,{code:o.invalid_intersection_types}),h)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}pe.create=(e,t,n)=>new pe({left:e,right:t,typeName:Oe.ZodIntersection,...x(n)});class de extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.array)return d(n,{code:o.invalid_type,expected:s.array,received:n.parsedType}),h;if(n.data.length<this._def.items.length)return d(n,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h;!this._def.rest&&n.data.length>this._def.items.length&&(d(n,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new _(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>m.mergeArray(t,e))):m.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new de({...this._def,rest:e})}}de.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new de({items:e,typeName:Oe.ZodTuple,rest:null,...x(t)})};class me extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.map)return d(n,{code:o.invalid_type,expected:s.map,received:n.parsedType}),h;const a=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map((([e,t],s)=>({key:a._parse(new _(n,e,n.path,[s,"key"])),value:r._parse(new _(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return h;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return h;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}me.create=(e,t,n)=>new me({valueType:t,keyType:e,typeName:Oe.ZodMap,...x(n)});class he extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.set)return d(n,{code:o.invalid_type,expected:s.set,received:n.parsedType}),h;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(d(n,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(d(n,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const a of e){if("aborted"===a.status)return h;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const l=[...n.data.values()].map(((e,t)=>r._parse(new _(n,e,n.path,t))));return n.common.async?Promise.all(l).then((e=>i(e))):i(l)}min(e,t){return new he({...this._def,minSize:{value:e,message:p.toString(t)}})}max(e,t){return new he({...this._def,maxSize:{value:e,message:p.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}he.create=(e,t)=>new he({valueType:e,minSize:null,maxSize:null,typeName:Oe.ZodSet,...x(t)});class fe extends A{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}fe.create=(e,t)=>new fe({getter:e,typeName:Oe.ZodLazy,...x(t)});class ve extends A{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),h}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ge(e,t){return new ye({values:e,typeName:Oe.ZodEnum,...x(t)})}ve.create=(e,t)=>new ve({value:e,typeName:Oe.ZodLiteral,...x(t)});class ye extends A{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{expected:a.joinValues(n),received:t.parsedType,code:o.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{received:t.data,code:o.invalid_enum_value,options:n}),h}return v(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ye.create(e,{...this._def,...t})}exclude(e,t=this._def){return ye.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}ye.create=ge;class $e extends A{_parse(e){const t=a.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==s.string&&n.parsedType!==s.number){const e=a.objectValues(t);return d(n,{expected:a.joinValues(e),received:n.parsedType,code:o.invalid_type}),h}if(this._cache||(this._cache=new Set(a.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=a.objectValues(t);return d(n,{received:n.data,code:o.invalid_enum_value,options:e}),h}return v(e.data)}get enum(){return this._def.values}}$e.create=(e,t)=>new $e({values:e,typeName:Oe.ZodNativeEnum,...x(t)});class be extends A{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return d(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),h;const n=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return v(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}be.create=(e,t)=>new be({type:e,typeName:Oe.ZodPromise,...x(t)});class Ee extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{d(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return h;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?h:"dirty"===a.status||"dirty"===t.value?f(a.value):a}));{if("aborted"===t.value)return h;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?h:"dirty"===a.status||"dirty"===t.value?f(a.value):a}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?h:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?h:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$(e))return h;const a=r.transform(e.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>$(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):h))}a.assertNever(r)}}Ee.create=(e,t,n)=>new Ee({schema:e,typeName:Oe.ZodEffects,effect:t,...x(n)}),Ee.createWithPreprocess=(e,t,n)=>new Ee({schema:t,effect:{type:"preprocess",transform:e},typeName:Oe.ZodEffects,...x(n)});class _e extends A{_parse(e){return this._getType(e)===s.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Oe.ZodOptional,...x(t)});class Se extends A{_parse(e){return this._getType(e)===s.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Se.create=(e,t)=>new Se({innerType:e,typeName:Oe.ZodNullable,...x(t)});class xe extends A{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===s.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}xe.create=(e,t)=>new xe({innerType:e,typeName:Oe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...x(t)});class Ae extends A{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return b(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:Oe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...x(t)});class Ie extends A{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return d(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),h}return{status:"valid",value:e.data}}}Ie.create=e=>new Ie({typeName:Oe.ZodNaN,...x(e)}),Symbol("zod_brand");class we extends A{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ne extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?h:"dirty"===e.status?(t.dirty(),f(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?h:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Ne({in:e,out:t,typeName:Oe.ZodPipeline})}}class Te extends A{_parse(e){const t=this._def.innerType._parse(e),n=e=>($(e)&&(e.value=Object.freeze(e.value)),e);return b(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}var Oe;Te.create=(e,t)=>new Te({innerType:e,typeName:Oe.ZodReadonly,...x(t)}),le.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Oe||(Oe={}));const ke=G.create,Re=H.create,Ce=(Ie.create,K.create,X.create),Le=(J.create,Q.create,ee.create,te.create,ne.create,ae.create,re.create,se.create,ie.create),Pe=le.create,Me=(le.strictCreate,ce.create);pe.create,de.create,me.create,he.create,fe.create,ve.create,ye.create,$e.create,be.create,Ee.create,_e.create,Se.create,Ee.createWithPreprocess,Ne.create},92222:(e,t,n)=>{const a=n(50066),r=n(72857);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},92625:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(24159),i=n(29385),o=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,c[r]=t,u[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),f("FULL",`^${c[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),f("LOOSE",`^${c[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),f("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${c[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[p.COERCEPLAIN]+`(?:${c[p.PRERELEASE]})?`+`(?:${c[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[p.COERCE],!0),f("COERCERTLFULL",c[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},92660:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},92721:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},92926:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a=n.css,r=n.media,s=n.sourceMap;r?e.setAttribute("media",r):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(a,e)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},92945:(e,t,n)=>{const a=n(38366);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},93555:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},94045:(e,t,n)=>{const a=n(24472);e.exports=(e,t,n)=>a(e,t,"<",n)},94463:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>0===a(e,t,n)},94706:(e,t,n)=>{const a=n(94463),r=n(36749),s=n(43334),i=n(47775),o=n(3449),l=n(9418);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,c);case"!=":return r(e,n,c);case">":return s(e,n,c);case">=":return i(e,n,c);case"<":return o(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},94715:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},95153:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(51699)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},95593:e=>{var t=[];function n(e){for(var n=-1,a=0;a<t.length;a++)if(t[a].identifier===e){n=a;break}return n}function a(e,a){for(var s={},i=[],o=0;o<e.length;o++){var l=e[o],c=a.base?l[0]+a.base:l[0],u=s[c]||0,p="".concat(c," ").concat(u);s[c]=u+1;var d=n(p),m={css:l[1],media:l[2],sourceMap:l[3]};-1!==d?(t[d].references++,t[d].updater(m)):t.push({identifier:p,updater:r(m,a),references:1}),i.push(p)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=a(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var o=n(s[i]);t[o].references--}for(var l=a(e,r),c=0;c<s.length;c++){var u=n(s[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}s=l}}},95831:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},96082:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(8573),{safeRe:i,t:o}=n(18104),l=n(94706),c=n(72082),u=n(41694),p=n(71333)},96506:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(34773),{safeRe:i,t:o}=n(68752),l=n(39149),c=n(52378),u=n(9350),p=n(33629)},96675:(e,t,n)=>{const a=n(66283),r=n(38366);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},96775:(e,t,n)=>{const a=n(9480),r=n(40289);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const c=[];for(const[e,t]of s)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},96807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},97008:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},97369:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>0!==a(e,t,n)},97660:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},98010:(e,t,n)=>{n.d(t,{rv:()=>r});var a=n(9895);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES;const r=a.QUERY_OPERATORS;a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions,a.wrapField},98249:(e,t,n)=>{const a=n(41755),r=n(97369),s=n(18106),i=n(74227),o=n(28141),l=n(24078);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,c);case"!=":return r(e,n,c);case">":return s(e,n,c);case">=":return i(e,n,c);case"<":return o(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},98696:(e,t,n)=>{const a=n(48381),r=n(20332),s=n(58809);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},98746:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>0===a(e,t,n)},99352:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},99385:(e,t,n)=>{const a=n(41694),r=n(96082),{ANY:s}=r,i=n(71333),o=n(9480),l=n(43334),c=n(3449),u=n(9418),p=n(47775);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=u,f=c,v=">",g=">=";break;case"<":m=c,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},99430:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},99451:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},99514:(e,t,n)=>{n.d(t,{gM:()=>Ln});var a,r,s,i,o,l,c,u,p,d,m,h,f,v,g=n(45890),y=n(12240),$=n(86224),b=n(39889),E=n(9606).URL,_=n(67787).Buffer,S=Symbol.for("vercel.ai.gateway.error"),x=class e extends(r=Error,a=S,r){constructor({message:e,statusCode:t=500,cause:n}){super(e),this[a]=!0,this.statusCode=t,this.cause=n}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&S in e&&!0===e[S]}},A="GatewayAuthenticationError",I=`vercel.ai.gateway.error.${A}`,w=Symbol.for(I),N=class e extends(i=x,s=w,i){constructor({message:e="Authentication failed",statusCode:t=401,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[s]=!0,this.name=A,this.type="authentication_error"}static isInstance(e){return x.hasMarker(e)&&w in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:a="Authentication failed",statusCode:r=401,cause:s}){let i;return i=t?"AI Gateway authentication failed: Invalid API key.\n\nCreate a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\n\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.":n?"AI Gateway authentication failed: Invalid OIDC token.\n\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.\n\nAlternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys":"AI Gateway authentication failed: No authentication provided.\n\nOption 1 - API key:\nCreate an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.\n\nOption 2 - OIDC token:\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.",new e({message:i,statusCode:r,cause:s})}},T="GatewayInvalidRequestError",O=`vercel.ai.gateway.error.${T}`,k=Symbol.for(O),R=class extends(l=x,o=k,l){constructor({message:e="Invalid request",statusCode:t=400,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[o]=!0,this.name=T,this.type="invalid_request_error"}static isInstance(e){return x.hasMarker(e)&&k in e}},C="GatewayRateLimitError",L=`vercel.ai.gateway.error.${C}`,P=Symbol.for(L),M=class extends(u=x,c=P,u){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[c]=!0,this.name=C,this.type="rate_limit_exceeded"}static isInstance(e){return x.hasMarker(e)&&P in e}},j="GatewayModelNotFoundError",D=`vercel.ai.gateway.error.${j}`,F=Symbol.for(D),Y=(0,g.ID)((()=>(0,g.jN)($.Ik({modelId:$.Yj()})))),V=class extends(d=x,p=F,d){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:a}={}){super({message:e,statusCode:t,cause:a}),this[p]=!0,this.name=j,this.type="model_not_found",this.modelId=n}static isInstance(e){return x.hasMarker(e)&&F in e}},U="GatewayInternalServerError",q=`vercel.ai.gateway.error.${U}`,B=Symbol.for(q),z=class extends(h=x,m=B,h){constructor({message:e="Internal server error",statusCode:t=500,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[m]=!0,this.name=U,this.type="internal_server_error"}static isInstance(e){return x.hasMarker(e)&&B in e}},Z="GatewayResponseError",G=`vercel.ai.gateway.error.${Z}`,W=Symbol.for(G),H=class extends(v=x,f=W,v){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:a,cause:r}={}){super({message:e,statusCode:t,cause:r}),this[f]=!0,this.name=Z,this.type="response_error",this.response=n,this.validationError=a}static isInstance(e){return x.hasMarker(e)&&W in e}};async function K({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:a,authMethod:r}){const s=await(0,g.ZZ)({value:e,schema:X});if(!s.success)return new H({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:s.error,cause:a});const i=s.value,o=i.error.type,l=i.error.message;switch(o){case"authentication_error":return N.createContextualError({apiKeyProvided:"api-key"===r,oidcTokenProvided:"oidc"===r,statusCode:t,cause:a});case"invalid_request_error":return new R({message:l,statusCode:t,cause:a});case"rate_limit_exceeded":return new M({message:l,statusCode:t,cause:a});case"model_not_found":{const e=await(0,g.ZZ)({value:i.error.param,schema:Y});return new V({message:l,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:a})}default:return new z({message:l,statusCode:t,cause:a})}}var X=(0,g.ID)((()=>(0,g.jN)($.Ik({error:$.Ik({message:$.Yj(),type:$.Yj().nullish(),param:$.L5().nullish(),code:$.KC([$.Yj(),$.ai()]).nullish()})}))));function J(e,t){var n;return x.isInstance(e)?e:y.hL.isInstance(e)?K({response:Q(e),statusCode:null!=(n=e.statusCode)?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):K({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function Q(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return JSON.parse(e.responseBody)}catch(t){return e.responseBody}return{}}var ee="ai-gateway-auth-method";async function te(e){const t=await(0,g.ZZ)({value:e[ee],schema:ne});return t.success?t.value:void 0}var ne=(0,g.ID)((()=>(0,g.jN)($.KC([$.eu("api-key"),$.eu("oidc")])))),ae=class{constructor(e){this.config=e}async getAvailableModels(){try{const{value:e}=await(0,g.$b)({url:`${this.config.baseURL}/config`,headers:await(0,g.hd)(this.config.headers()),successfulResponseHandler:(0,g.cV)(re),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return e}catch(e){throw await J(e)}}async getCredits(){try{const e=new E(this.config.baseURL),{value:t}=await(0,g.$b)({url:`${e.origin}/v1/credits`,headers:await(0,g.hd)(this.config.headers()),successfulResponseHandler:(0,g.cV)(se),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return t}catch(e){throw await J(e)}}},re=(0,g.ID)((()=>(0,g.jN)($.Ik({models:$.YO($.Ik({id:$.Yj(),name:$.Yj(),description:$.Yj().nullish(),pricing:$.Ik({input:$.Yj(),output:$.Yj(),input_cache_read:$.Yj().nullish(),input_cache_write:$.Yj().nullish()}).transform((({input:e,output:t,input_cache_read:n,input_cache_write:a})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...a?{cacheCreationInputTokens:a}:{}}))).nullish(),specification:$.Ik({specificationVersion:$.eu("v3"),provider:$.Yj(),modelId:$.Yj()}),modelType:$.k5(["language","embedding","image"]).nullish()}))})))),se=(0,g.ID)((()=>(0,g.jN)($.Ik({balance:$.Yj(),total_used:$.Yj()}).transform((({balance:e,total_used:t})=>({balance:e,totalUsed:t})))))),ie=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){const{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){const{args:t,warnings:n}=await this.getArgs(e),{abortSignal:a}=e,r=await(0,g.hd)(this.config.headers());try{const{responseHeaders:s,value:i,rawValue:o}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await(0,g.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,g.cV)($.bz()),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...a&&{abortSignal:a},fetch:this.config.fetch});return{...i,request:{body:t},response:{headers:s,body:o},warnings:n}}catch(e){throw await J(e,await te(r))}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),{abortSignal:a}=e,r=await(0,g.hd)(this.config.headers());try{const{value:s,responseHeaders:i}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await(0,g.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,g.Ds)($.bz()),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...a&&{abortSignal:a},fetch:this.config.fetch});return{stream:s.pipeThrough(new TransformStream({start(e){n.length>0&&e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(t.success){const a=t.value;if("raw"===a.type&&!e.includeRawChunks)return;"response-metadata"===a.type&&a.timestamp&&"string"==typeof a.timestamp&&(a.timestamp=new Date(a.timestamp)),n.enqueue(a)}else n.error(t.error)}})),request:{body:t},response:{headers:i}}}catch(e){throw await J(e,await te(r))}}isFilePart(e){return e&&"object"==typeof e&&"type"in e&&"file"===e.type}maybeEncodeFileParts(e){for(const t of e.prompt)for(const e of t.content)if(this.isFilePart(e)){const t=e;if(t.data instanceof Uint8Array){const e=Uint8Array.from(t.data),n=_.from(e).toString("base64");t.data=new E(`data:${t.mediaType||"application/octet-stream"};base64,${n}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"2","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},oe=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:a}){var r;const s=await(0,g.hd)(this.config.headers());try{const{responseHeaders:i,value:o,rawValue:l}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(s,null!=t?t:{},this.getModelConfigHeaders(),await(0,g.hd)(this.config.o11yHeaders)),body:{input:1===e.length?e[0]:e,...a?{providerOptions:a}:{}},successfulResponseHandler:(0,g.cV)(le),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:o.embeddings,usage:null!=(r=o.usage)?r:void 0,providerMetadata:o.providerMetadata,response:{headers:i,body:l},warnings:[]}}catch(e){throw await J(e,await te(s))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},le=(0,g.ID)((()=>(0,g.jN)($.Ik({embeddings:$.YO($.YO($.ai())),usage:$.Ik({tokens:$.ai()}).nullish(),providerMetadata:$.g1($.Yj(),$.g1($.Yj(),$.L5())).optional()})))),ce=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:a,seed:r,providerOptions:s,headers:i,abortSignal:o}){var l;const c=await(0,g.hd)(this.config.headers());try{const{responseHeaders:u,value:p,rawValue:d}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(c,null!=i?i:{},this.getModelConfigHeaders(),await(0,g.hd)(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...a&&{aspectRatio:a},...r&&{seed:r},...s&&{providerOptions:s}},successfulResponseHandler:(0,g.cV)(pe),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...o&&{abortSignal:o},fetch:this.config.fetch});return{images:p.images,warnings:null!=(l=p.warnings)?l:[],providerMetadata:p.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:u}}}catch(e){throw J(e,await te(c))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"2","ai-model-id":this.modelId}}},ue=$.Ik({images:$.YO($.L5()).optional()}).catchall($.L5()),pe=$.Ik({images:$.YO($.Yj()),warnings:$.YO($.Ik({type:$.eu("other"),message:$.Yj()})).optional(),providerMetadata:$.g1($.Yj(),ue).optional()}),de=function(e={}){var t,n;let a=null,r=null;const s=null!=(t=e.metadataCacheRefreshMillis)?t:3e5;let i=0;const o=null!=(n=(0,g.ae)(e.baseURL))?n:"https://ai-gateway.vercel.sh/v1/ai",l=async()=>{const t=await async function(e){const t=(0,g.x3)({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await(0,b.getVercelOidcToken)(),authMethod:"oidc"}}catch(e){return null}}(e);if(t)return(0,g.WZ)({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[ee]:t.authMethod,...e.headers},"ai-sdk/gateway/2.0.0-beta.78");throw N.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},c=()=>{const e=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),n=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{const a=await async function(){var e;return null==(e=(0,b.getContext)().headers)?void 0:e["x-vercel-id"]}();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...n&&{"ai-o11y-region":n},...a&&{"ai-o11y-request-id":a}}}},u=t=>new ie(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:c()}),p=function(e){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return u(e)};return p.specificationVersion="v3",p.getAvailableModels=async()=>{var t,n,c;const u=null!=(c=null==(n=null==(t=e._internal)?void 0:t.currentDate)?void 0:n.call(t).getTime())?c:Date.now();return(!a||u-i>s)&&(i=u,a=new ae({baseURL:o,headers:l,fetch:e.fetch}).getAvailableModels().then((e=>(r=e,e))).catch((async e=>{throw await J(e,await te(await l()))}))),r?Promise.resolve(r):a},p.getCredits=async()=>new ae({baseURL:o,headers:l,fetch:e.fetch}).getCredits().catch((async e=>{throw await J(e,await te(await l()))})),p.imageModel=t=>new ce(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:c()}),p.languageModel=u,p.embeddingModel=t=>new oe(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:c()}),p}(),me=n(26767),he=n(19917),fe=n(9606).URL,ve=n(65994).e,ge=Object.defineProperty;function ye({warning:e,provider:t,model:n}){const a=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let t=`${a} The feature "${e.feature}" is not supported.`;return e.details&&(t+=` ${e.details}`),t}case"compatibility":{let t=`${a} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(t+=` ${e.details}`),t}case"other":return`${a} ${e.message}`;default:return`${a} ${JSON.stringify(e,null,2)}`}}var $e,be=!1,Ee=e=>{if(0===e.warnings.length)return;const t=globalThis.AI_SDK_LOG_WARNINGS;if(!1!==t)if("function"!=typeof t){be||(be=!0,console.info("AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false."));for(const t of e.warnings)console.warn(ye({warning:t,provider:e.provider,model:e.model}))}else t(e)},_e="AI_InvalidArgumentError",Se=`vercel.ai.error.${_e}`,xe=Symbol.for(Se),Ae=class extends y.bD{constructor({parameter:e,value:t,message:n}){super({name:_e,message:`Invalid argument for parameter ${e}: ${n}`}),this[$e]=!0,this.parameter=e,this.value=t}static isInstance(e){return y.bD.hasMarker(e,Se)}};$e=xe;var Ie=Symbol.for("vercel.ai.error.AI_InvalidStreamPartError");y.bD;var we,Ne="AI_InvalidToolInputError",Te=`vercel.ai.error.${Ne}`,Oe=Symbol.for(Te),ke=class extends y.bD{constructor({toolInput:e,toolName:t,cause:n,message:a=`Invalid input for tool ${t}: ${(0,y.u1)(n)}`}){super({name:Ne,message:a,cause:n}),this[we]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return y.bD.hasMarker(e,Te)}};we=Oe;var Re=Symbol.for("vercel.ai.error.AI_NoImageGeneratedError");y.bD;var Ce,Le="AI_NoObjectGeneratedError",Pe=`vercel.ai.error.${Le}`,Me=Symbol.for(Pe),je=class extends y.bD{constructor({message:e="No object generated.",cause:t,text:n,response:a,usage:r,finishReason:s}){super({name:Le,message:e,cause:t}),this[Ce]=!0,this.text=n,this.response=a,this.usage=r,this.finishReason=s}static isInstance(e){return y.bD.hasMarker(e,Pe)}};Ce=Me;var De,Fe="AI_NoOutputGeneratedError",Ye=`vercel.ai.error.${Fe}`,Ve=Symbol.for(Ye),Ue=class extends y.bD{constructor({message:e="No output generated.",cause:t}={}){super({name:Fe,message:e,cause:t}),this[De]=!0}static isInstance(e){return y.bD.hasMarker(e,Ye)}};De=Ve,y.bD;var qe,Be="AI_NoSuchToolError",ze=`vercel.ai.error.${Be}`,Ze=Symbol.for(ze),Ge=class extends y.bD{constructor({toolName:e,availableTools:t,message:n=`Model tried to call unavailable tool '${e}'. ${void 0===t?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:Be,message:n}),this[qe]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return y.bD.hasMarker(e,ze)}};qe=Ze;var We,He="AI_ToolCallRepairError",Ke=`vercel.ai.error.${He}`,Xe=Symbol.for(Ke),Je=class extends y.bD{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${(0,y.u1)(e)}`}){super({name:He,message:n,cause:e}),this[We]=!0,this.originalError=t}static isInstance(e){return y.bD.hasMarker(e,Ke)}};We=Xe;var Qe=class extends y.bD{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},et=Symbol.for("vercel.ai.error.AI_InvalidDataContentError");y.bD;var tt,nt="AI_InvalidMessageRoleError",at=`vercel.ai.error.${nt}`,rt=Symbol.for(at),st=class extends y.bD{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:nt,message:t}),this[tt]=!0,this.role=e}static isInstance(e){return y.bD.hasMarker(e,at)}};tt=rt;var it=Symbol.for("vercel.ai.error.AI_MessageConversionError");y.bD;var ot,lt="AI_DownloadError",ct=`vercel.ai.error.${lt}`,ut=Symbol.for(ct),pt=class extends y.bD{constructor({url:e,statusCode:t,statusText:n,cause:a,message:r=(null==a?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${a}`)}){super({name:lt,message:r,cause:a}),this[ot]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return y.bD.hasMarker(e,ct)}};ot=ut;var dt,mt="AI_RetryError",ht=`vercel.ai.error.${mt}`,ft=Symbol.for(ht),vt=class extends y.bD{constructor({message:e,reason:t,errors:n}){super({name:mt,message:e}),this[dt]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return y.bD.hasMarker(e,ht)}};function gt(e){return"v3"===e.specificationVersion?e:(function({provider:e,modelId:t}){Ee({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get(e,t){switch(t){case"specificationVersion":return"v3";case"doGenerate":return async(...t)=>{const n=await e.doGenerate(...t);return{...n,usage:yt(n.usage)}};case"doStream":return async(...t)=>{const n=await e.doStream(...t);return{...n,stream:(a=n.stream,a.pipeThrough(new TransformStream({transform(e,t){"finish"===e.type?t.enqueue({...e,usage:yt(e.usage)}):t.enqueue(e)}})))};var a};default:return e[t]}}}))}function yt(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function $t(e){if("string"!=typeof e){if("v3"!==e.specificationVersion&&"v2"!==e.specificationVersion){const t=e;throw new Qe({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return gt(e)}return(null!=(t=globalThis.AI_SDK_DEFAULT_PROVIDER)?t:de).languageModel(e);var t}dt=ft;var bt=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],Et=e=>{const t="string"==typeof e?(0,g.Z9)(e):e,n=(127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9];return t.slice(n+10)};var _t=async({url:e})=>{var t;const n=e.toString();try{const e=await fetch(n,{headers:(0,g.WZ)({},"ai-sdk/6.0.0-beta.151",(0,g.G1)())});if(!e.ok)throw new pt({url:n,statusCode:e.status,statusText:e.statusText});return{data:new Uint8Array(await e.arrayBuffer()),mediaType:null!=(t=e.headers.get("content-type"))?t:void 0}}catch(e){if(pt.isInstance(e))throw e;throw new pt({url:n,cause:e})}},St=(e=_t)=>t=>Promise.all(t.map((async t=>t.isUrlSupportedByModel?null:e(t)))),xt=$.KC([$.Yj(),$.Nl(Uint8Array),$.Nl(ArrayBuffer),$.Ie((e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n}),{message:"Must be a Buffer"})]);function At(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if("string"==typeof e)try{e=new fe(e)}catch(e){}if(e instanceof fe&&"data:"===e.protocol){const{mediaType:t,base64Content:n}=function(e){try{const[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch(e){return{mediaType:void 0,base64Content:void 0}}}(e.toString());if(null==t||null==n)throw new y.bD({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function It(e){return void 0===e?[]:Array.isArray(e)?e:[e]}async function wt({prompt:e,supportedUrls:t,download:n=St()}){const a=await async function(e,t,n){const a=e.filter((e=>"user"===e.role)).map((e=>e.content)).filter((e=>Array.isArray(e))).flat().filter((e=>"image"===e.type||"file"===e.type)).map((e=>{var t;const n=null!=(t=e.mediaType)?t:"image"===e.type?"image/*":void 0;let a="image"===e.type?e.image:e.data;if("string"==typeof a)try{a=new fe(a)}catch(e){}return{mediaType:n,data:a}})).filter((e=>e.data instanceof fe)).map((e=>({url:e.data,isUrlSupportedByModel:null!=e.mediaType&&(0,g.qs)({url:e.data.toString(),mediaType:e.mediaType,supportedUrls:n})}))),r=await t(a);return Object.fromEntries(r.map(((e,t)=>null==e?null:[a[t].url.toString(),{data:e.data,mediaType:e.mediaType}])).filter((e=>null!=e)))}(e.messages,n,t),r=[...null!=e.system?"string"==typeof e.system?[{role:"system",content:e.system}]:It(e.system).map((e=>({role:"system",content:e.content,providerOptions:e.providerOptions}))):[],...e.messages.map((e=>function({message:e,downloadedAssets:t}){const n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return"string"==typeof e.content?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map((e=>function(e,t){var n;if("text"===e.type)return{type:"text",text:e.text,providerOptions:e.providerOptions};let a;const r=e.type;switch(r){case"image":a=e.image;break;case"file":a=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}const{data:s,mediaType:i}=At(a);let o=null!=i?i:e.mediaType,l=s;if(l instanceof fe){const e=t[l.toString()];e&&(l=e.data,null!=o||(o=e.mediaType))}switch(r){case"image":return(l instanceof Uint8Array||"string"==typeof l)&&(o=null!=(n=function({data:e,signatures:t}){const n=function(e){return"string"==typeof e&&e.startsWith("SUQz")||"string"!=typeof e&&e.length>10&&73===e[0]&&68===e[1]&&51===e[2]?Et(e):e}(e),a="string"==typeof n?(0,g.Z9)(n.substring(0,Math.min(n.length,24))):n;for(const e of t)if(a.length>=e.bytesPrefix.length&&e.bytesPrefix.every(((e,t)=>null===e||a[t]===e)))return e.mediaType}({data:l,signatures:bt}))?n:o),{type:"file",mediaType:null!=o?o:"image/*",filename:void 0,data:l,providerOptions:e.providerOptions};case"file":if(null==o)throw new Error("Media type is missing for file part");return{type:"file",mediaType:o,filename:e.filename,data:l,providerOptions:e.providerOptions}}}(e,t))).filter((e=>"text"!==e.type||""!==e.text)),providerOptions:e.providerOptions};case"assistant":return"string"==typeof e.content?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter((e=>"text"!==e.type||""!==e.text||null!=e.providerOptions)).filter((e=>"tool-approval-request"!==e.type)).map((e=>{const t=e.providerOptions;switch(e.type){case"file":{const{data:n,mediaType:a}=At(e.data);return{type:"file",data:n,filename:e.filename,mediaType:null!=a?a:e.mediaType,providerOptions:t}}case"reasoning":return{type:"reasoning",text:e.text,providerOptions:t};case"text":return{type:"text",text:e.text,providerOptions:t};case"tool-call":return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:t};case"tool-result":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Nt(e.output),providerOptions:t}}})),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.filter((e=>"tool-approval-response"!==e.type)).map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Nt(e.output),providerOptions:e.providerOptions}))),providerOptions:e.providerOptions};default:throw new st({role:n})}}({message:e,downloadedAssets:a})))],s=[];for(const e of r){if("tool"!==e.role){s.push(e);continue}const t=s.at(-1);"tool"===(null==t?void 0:t.role)?t.content.push(...e.content):s.push(e)}return s}function Nt(e){return"content"!==e.type?e:{type:"content",value:e.value.map((e=>"media"!==e.type?e:e.mediaType.startsWith("image/")?{type:"image-data",data:e.data,mediaType:e.mediaType}:{type:"file-data",data:e.data,mediaType:e.mediaType}))}}function Tt({output:e,tool:t,errorMode:n}){return"text"===n?{type:"error-text",value:(0,y.u1)(e)}:"json"===n?{type:"error-json",value:Ot(e)}:(null==t?void 0:t.toModelOutput)?t.toModelOutput(e):"string"==typeof e?{type:"text",value:e}:{type:"json",value:Ot(e)}}function Ot(e){return void 0===e?null:e}var kt=$.RZ((()=>$.KC([$.ch(),$.Yj(),$.ai(),$.zM(),$.g1($.Yj(),kt.optional()),$.YO(kt)]))),Rt=$.g1($.Yj(),$.g1($.Yj(),kt.optional())),Ct=$.Ik({type:$.eu("text"),text:$.Yj(),providerOptions:Rt.optional()}),Lt=$.Ik({type:$.eu("image"),image:$.KC([xt,$.Nl(fe)]),mediaType:$.Yj().optional(),providerOptions:Rt.optional()}),Pt=$.Ik({type:$.eu("file"),data:$.KC([xt,$.Nl(fe)]),filename:$.Yj().optional(),mediaType:$.Yj(),providerOptions:Rt.optional()}),Mt=$.Ik({type:$.eu("reasoning"),text:$.Yj(),providerOptions:Rt.optional()}),jt=$.Ik({type:$.eu("tool-call"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerOptions:Rt.optional(),providerExecuted:$.zM().optional()}),Dt=$.gM("type",[$.Ik({type:$.eu("text"),value:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("json"),value:kt,providerOptions:Rt.optional()}),$.Ik({type:$.eu("execution-denied"),reason:$.Yj().optional(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("error-text"),value:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("error-json"),value:kt,providerOptions:Rt.optional()}),$.Ik({type:$.eu("content"),value:$.YO($.KC([$.Ik({type:$.eu("text"),text:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("media"),data:$.Yj(),mediaType:$.Yj()}),$.Ik({type:$.eu("file-data"),data:$.Yj(),mediaType:$.Yj(),filename:$.Yj().optional(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("file-url"),url:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("file-id"),fileId:$.KC([$.Yj(),$.g1($.Yj(),$.Yj())]),providerOptions:Rt.optional()}),$.Ik({type:$.eu("image-data"),data:$.Yj(),mediaType:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("image-url"),url:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("image-file-id"),fileId:$.KC([$.Yj(),$.g1($.Yj(),$.Yj())]),providerOptions:Rt.optional()}),$.Ik({type:$.eu("custom"),providerOptions:Rt.optional()})]))})]),Ft=$.Ik({type:$.eu("tool-result"),toolCallId:$.Yj(),toolName:$.Yj(),output:Dt,providerOptions:Rt.optional()}),Yt=$.Ik({type:$.eu("tool-approval-request"),approvalId:$.Yj(),toolCallId:$.Yj()}),Vt=$.Ik({type:$.eu("tool-approval-response"),approvalId:$.Yj(),approved:$.zM(),reason:$.Yj().optional()}),Ut=$.Ik({role:$.eu("system"),content:$.Yj(),providerOptions:Rt.optional()}),qt=$.Ik({role:$.eu("user"),content:$.KC([$.Yj(),$.YO($.KC([Ct,Lt,Pt]))]),providerOptions:Rt.optional()}),Bt=$.Ik({role:$.eu("assistant"),content:$.KC([$.Yj(),$.YO($.KC([Ct,Pt,Mt,jt,Ft,Yt]))]),providerOptions:Rt.optional()}),zt=$.Ik({role:$.eu("tool"),content:$.YO($.KC([Ft,Vt])),providerOptions:Rt.optional()}),Zt=$.KC([Ut,qt,Bt,zt]);function Gt(e){if(!N.isInstance(e))return e;const t="https://v6.ai-sdk.dev/unauthenticated-ai-gateway";return"production"===(null==ve?void 0:"production")?new y.bD({name:"GatewayError",message:`Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${t}`}):Object.assign(new Error(`Unauthenticated request to AI Gateway.\n\nTo authenticate, set the AI_GATEWAY_API_KEY environment variable with your API key.\n\nAlternatively, you can use a provider module instead of the AI Gateway.\n\nLearn more: ${t}\n\n`),{name:"GatewayAuthenticationError"})}function Wt({operationId:e,telemetry:t}){return{"operation.name":`${e}${null!=(null==t?void 0:t.functionId)?` ${t.functionId}`:""}`,"resource.name":null==t?void 0:t.functionId,"ai.operationId":e,"ai.telemetry.functionId":null==t?void 0:t.functionId}}var Ht={startSpan:()=>Kt,startActiveSpan:(e,t,n,a)=>"function"==typeof t?t(Kt):"function"==typeof n?n(Kt):"function"==typeof a?a(Kt):void 0},Kt={spanContext:()=>Xt,setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording:()=>!1,recordException(){return this}},Xt={traceId:"",spanId:"",traceFlags:0};async function Jt({name:e,tracer:t,attributes:n,fn:a,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:await n},(async e=>{try{const t=await a(e);return r&&e.end(),t}catch(t){try{Qt(e,t)}finally{e.end()}throw t}}))}function Qt(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:he.s.ERROR,message:t.message})):e.setStatus({code:he.s.ERROR})}async function en({telemetry:e,attributes:t}){if(!0!==(null==e?void 0:e.isEnabled))return{};const n={};for(const[a,r]of Object.entries(t))if(null!=r)if("object"==typeof r&&"input"in r&&"function"==typeof r.input){if(!1===(null==e?void 0:e.recordInputs))continue;const t=await r.input();null!=t&&(n[a]=t)}else if("object"==typeof r&&"output"in r&&"function"==typeof r.output){if(!1===(null==e?void 0:e.recordOutputs))continue;const t=await r.output();null!=t&&(n[a]=t)}else n[a]=r;return n}function tn(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:nn(e.inputTokens.total,e.outputTokens.total),raw:e.raw,reasoningTokens:e.outputTokens.reasoning,cachedInputTokens:e.inputTokens.cacheRead}}function nn(e,t){return null==e&&null==t?void 0:(null!=e?e:0)+(null!=t?t:0)}var an=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:a}={})=>async r=>rn(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:a});async function rn(e,{maxRetries:t,delayInMs:n,backoffFactor:a,abortSignal:r},s=[]){try{return await e()}catch(i){if((0,g.zf)(i))throw i;if(0===t)throw i;const o=(0,g.u1)(i),l=[...s,i],c=l.length;if(c>t)throw new vt({message:`Failed after ${c} attempts. Last error: ${o}`,reason:"maxRetriesExceeded",errors:l});if(i instanceof Error&&y.hL.isInstance(i)&&!0===i.isRetryable&&c<=t)return await(0,g.cb)(function({error:e,exponentialBackoffDelay:t}){const n=e.responseHeaders;if(!n)return t;let a;const r=n["retry-after-ms"];if(r){const e=parseFloat(r);Number.isNaN(e)||(a=e)}const s=n["retry-after"];if(s&&void 0===a){const e=parseFloat(s);a=Number.isNaN(e)?Date.parse(s)-Date.now():1e3*e}return null!=a&&!Number.isNaN(a)&&0<=a&&(a<6e4||a<t)?a:t}({error:i,exponentialBackoffDelay:n}),{abortSignal:r}),rn(e,{maxRetries:t,delayInMs:a*n,backoffFactor:a,abortSignal:r},l);if(1===c)throw i;throw new vt({message:`Failed after ${c} attempts with non-retryable error: '${o}'`,reason:"errorNotRetryable",errors:l})}}async function sn({toolCall:e,tools:t,tracer:n,telemetry:a,messages:r,abortSignal:s,experimental_context:i,onPreliminaryToolResult:o}){const{toolName:l,toolCallId:c,input:u}=e,p=null==t?void 0:t[l];if(null!=(null==p?void 0:p.execute))return Jt({name:"ai.toolCall",attributes:en({telemetry:a,attributes:{...Wt({operationId:"ai.toolCall",telemetry:a}),"ai.toolCall.name":l,"ai.toolCall.id":c,"ai.toolCall.args":{output:()=>JSON.stringify(u)}}}),tracer:n,fn:async t=>{let n;try{const t=(0,g.o8)({execute:p.execute.bind(p),input:u,options:{toolCallId:c,messages:r,abortSignal:s,experimental_context:i}});for await(const a of t)"preliminary"===a.type?null==o||o({...e,type:"tool-result",output:a.output,preliminary:!0}):n=a.output}catch(n){return Qt(t,n),{type:"tool-error",toolCallId:c,toolName:l,input:u,error:n,dynamic:"dynamic"===p.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}try{t.setAttributes(await en({telemetry:a,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(n)}}}))}catch(e){}return{type:"tool-result",toolCallId:c,toolName:l,input:u,output:n,dynamic:"dynamic"===p.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}})}var on=class{constructor({data:e,mediaType:t}){const n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return null==this.base64Data&&(this.base64Data=(0,g.n_)(this.uint8ArrayData)),this.base64Data}get uint8Array(){return null==this.uint8ArrayData&&(this.uint8ArrayData=(0,g.Z9)(this.base64Data)),this.uint8ArrayData}},ln=class extends on{constructor(e){super(e),this.type="file"}};function cn(e){const t=["ROOT"];let n=-1,a=null;function r(e,r,s){switch(e){case'"':n=r,t.pop(),t.push(s),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=r,a=r,t.pop(),t.push(s),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(s),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=r,t.pop(),t.push(s),t.push("INSIDE_NUMBER");break;case"{":n=r,t.pop(),t.push(s),t.push("INSIDE_OBJECT_START");break;case"[":n=r,t.pop(),t.push(s),t.push("INSIDE_ARRAY_START")}}function s(e,a){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=a,t.pop()}}function i(e,a){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=a,t.pop()}}for(let o=0;o<e.length;o++){const l=e[o];switch(t[t.length-1]){case"ROOT":r(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":r(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":s(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===l?(n=o,t.pop()):(n=o,r(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":r(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{const r=e.substring(a,o+1);"false".startsWith(r)||"true".startsWith(r)||"null".startsWith(r)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?s(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o));break}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{const t=e.substring(a,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}async function un(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await(0,g.N8)({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await(0,g.N8)({text:cn(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}((e,t)=>{for(var n in t)ge(e,n,{get:t[n],enumerable:!0})})({},{array:()=>mn,choice:()=>hn,json:()=>fn,object:()=>dn,text:()=>pn});var pn=()=>({responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e})}),dn=({schema:e,name:t,description:n})=>{const a=(0,g.mD)(e);return{responseFormat:(0,g.hd)(a.jsonSchema).then((e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}}))),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new je({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const r=await(0,g.ZZ)({value:n.value,schema:a});if(!r.success)throw new je({message:"No object generated: response did not match schema.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return r.value},async parsePartialOutput({text:e}){const t=await un(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}}}},mn=({element:e,name:t,description:n})=>{const a=(0,g.mD)(e);return{responseFormat:(0,g.hd)(a.jsonSchema).then((e=>{const{$schema:a,...r}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:r}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}})),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new je({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const r=n.value;if(null==r||"object"!=typeof r||!("elements"in r)||!Array.isArray(r.elements))throw new je({message:"No object generated: response did not match schema.",cause:new y.iM({value:r,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(const n of r.elements){const r=await(0,g.ZZ)({value:n,schema:a});if(!r.success)throw new je({message:"No object generated: response did not match schema.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return r.elements},async parsePartialOutput({text:e}){const t=await un(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;const n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,r=[];for(const e of n){const t=await(0,g.ZZ)({value:e,schema:a});t.success&&r.push(t.value)}return{partial:r}}}}}},hn=({options:e,name:t,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){const a=await(0,g.N8)({text:t});if(!a.success)throw new je({message:"No object generated: could not parse the response.",cause:a.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});const r=a.value;if(null==r||"object"!=typeof r||!("result"in r)||"string"!=typeof r.result||!e.includes(r.result))throw new je({message:"No object generated: response did not match schema.",cause:new y.iM({value:r,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.result},async parsePartialOutput({text:t}){const n=await un(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;const a=e.filter((e=>e.startsWith(t.result)));return"successful-parse"===n.state?a.includes(t.result)?{partial:t.result}:void 0:1===a.length?{partial:a[0]}:void 0}}}}),fn=({name:e,description:t}={})=>({responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new je({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){const t=await un(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}}});async function vn(e){const t=""===e.input.trim()?{success:!0,value:{}}:await(0,g.N8)({text:e.input});if(!1===t.success)throw new ke({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function gn({toolCall:e,tools:t}){const n=e.toolName,a=t[n];if(null==a){if(e.providerExecuted&&e.dynamic)return await vn(e);throw new Ge({toolName:e.toolName,availableTools:Object.keys(t)})}const r=(0,g.mD)(a.inputSchema),s=""===e.input.trim()?await(0,g.ZZ)({value:{},schema:r}):await(0,g.N8)({text:e.input,schema:r});if(!1===s.success)throw new ke({toolName:n,toolInput:e.input,cause:s.error});return"dynamic"===a.type?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:s.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0,title:a.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:s.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:a.title}}var yn=class{constructor({content:e,finishReason:t,usage:n,warnings:a,request:r,response:s,providerMetadata:i}){this.content=e,this.finishReason=t,this.usage=n,this.warnings=a,this.request=r,this.response=s,this.providerMetadata=i}get text(){return this.content.filter((e=>"text"===e.type)).map((e=>e.text)).join("")}get reasoning(){return this.content.filter((e=>"reasoning"===e.type))}get reasoningText(){return 0===this.reasoning.length?void 0:this.reasoning.map((e=>e.text)).join("")}get files(){return this.content.filter((e=>"file"===e.type)).map((e=>e.file))}get sources(){return this.content.filter((e=>"source"===e.type))}get toolCalls(){return this.content.filter((e=>"tool-call"===e.type))}get staticToolCalls(){return this.toolCalls.filter((e=>!0!==e.dynamic))}get dynamicToolCalls(){return this.toolCalls.filter((e=>!0===e.dynamic))}get toolResults(){return this.content.filter((e=>"tool-result"===e.type))}get staticToolResults(){return this.toolResults.filter((e=>!0!==e.dynamic))}get dynamicToolResults(){return this.toolResults.filter((e=>!0===e.dynamic))}};function $n(e){return({steps:t})=>t.length===e}function bn({content:e,tools:t}){const n=[],a=e.filter((e=>"source"!==e.type)).filter((e=>("tool-result"!==e.type||e.providerExecuted)&&("tool-error"!==e.type||e.providerExecuted))).filter((e=>"text"!==e.type||e.text.length>0)).map((e=>{switch(e.type){case"text":return{type:"text",text:e.text,providerOptions:e.providerMetadata};case"reasoning":return{type:"reasoning",text:e.text,providerOptions:e.providerMetadata};case"file":return{type:"file",data:e.file.base64,mediaType:e.file.mediaType,providerOptions:e.providerMetadata};case"tool-call":return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:e.providerMetadata};case"tool-result":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Tt({tool:null==t?void 0:t[e.toolName],output:e.output,errorMode:"none"}),providerExecuted:!0,providerOptions:e.providerMetadata};case"tool-error":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Tt({tool:null==t?void 0:t[e.toolName],output:e.error,errorMode:"json"}),providerOptions:e.providerMetadata};case"tool-approval-request":return{type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId}}}));a.length>0&&n.push({role:"assistant",content:a});const r=e.filter((e=>"tool-result"===e.type||"tool-error"===e.type)).filter((e=>!e.providerExecuted)).map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Tt({tool:null==t?void 0:t[e.toolName],output:"tool-result"===e.type?e.output:e.error,errorMode:"tool-error"===e.type?"text":"none"}),...null!=e.providerMetadata?{providerOptions:e.providerMetadata}:{}})));return r.length>0&&n.push({role:"tool",content:r}),n}function En(e,t){const n=new Headers(null!=e?e:{});for(const[e,a]of Object.entries(t))n.has(e)||n.set(e,a);return n}function _n({response:e,status:t,statusText:n,headers:a,stream:r}){e.writeHead(null!=t?t:200,n,a);const s=r.getReader();(async()=>{try{for(;;){const{done:t,value:n}=await s.read();if(t)break;e.write(n)||await new Promise((t=>{e.once("drain",t)}))}}catch(e){throw e}finally{e.end()}})()}(0,g.hK)({prefix:"aitxt",size:24});var Sn=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}\n\n`)},flush(e){e.enqueue("data: [DONE]\n\n")}})}},xn={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function An(e,t){if(void 0===e&&void 0===t)return;if(void 0===e)return t;if(void 0===t)return e;const n={...e};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const r=t[a];if(void 0===r)continue;const s=a in e?e[a]:void 0,i=!(null===r||"object"!=typeof r||Array.isArray(r)||r instanceof Date||r instanceof RegExp),o=!(null==s||"object"!=typeof s||Array.isArray(s)||s instanceof Date||s instanceof RegExp);n[a]=i&&o?An(s,r):r}return n}function In(e){return e.type.startsWith("tool-")}function wn(e){return In(e)||function(e){return"dynamic-tool"===e.type}(e)}function Nn(e){return e.type.split("-").slice(1).join("-")}function Tn({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:a,onError:r,onToolCall:s,onData:i}){return e.pipeThrough(new TransformStream({async transform(e,o){await a((async({state:a,write:l})=>{var c,u,p,d;function m(e){const t=a.message.parts.filter(wn).find((t=>t.toolCallId===e));if(null==t)throw new Error(`no tool invocation found for tool call ${e}`);return t}function h(e){var t;const n=a.message.parts.find((t=>In(t)&&t.toolCallId===e.toolCallId)),r=e,s=n;null!=n?(n.state=e.state,s.input=r.input,s.output=r.output,s.errorText=r.errorText,s.rawInput=r.rawInput,s.preliminary=r.preliminary,void 0!==e.title&&(s.title=e.title),s.providerExecuted=null!=(t=r.providerExecuted)?t:n.providerExecuted,null!=r.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=r.providerMetadata)):a.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:r.input,output:r.output,rawInput:r.rawInput,errorText:r.errorText,providerExecuted:r.providerExecuted,preliminary:r.preliminary,...null!=r.providerMetadata?{callProviderMetadata:r.providerMetadata}:{}})}function f(e){var t,n;const r=a.message.parts.find((t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId)),s=e,i=r;null!=r?(r.state=e.state,i.toolName=e.toolName,i.input=s.input,i.output=s.output,i.errorText=s.errorText,i.rawInput=null!=(t=s.rawInput)?t:i.rawInput,i.preliminary=s.preliminary,void 0!==e.title&&(i.title=e.title),i.providerExecuted=null!=(n=s.providerExecuted)?n:r.providerExecuted,null!=s.providerMetadata&&"input-available"===r.state&&(r.callProviderMetadata=s.providerMetadata)):a.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:s.input,output:s.output,errorText:s.errorText,preliminary:s.preliminary,providerExecuted:s.providerExecuted,title:e.title,...null!=s.providerMetadata?{callProviderMetadata:s.providerMetadata}:{}})}async function v(e){if(null!=e){const n=null!=a.message.metadata?An(a.message.metadata,e):e;null!=t&&await(0,g.k5)({value:n,schema:t}),a.message.metadata=n}}switch(e.type){case"text-start":{const t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeTextParts[e.id]=t,a.message.parts.push(t),l();break}case"text-delta":{const t=a.activeTextParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,l();break}case"text-end":{const t=a.activeTextParts[e.id];t.state="done",t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,delete a.activeTextParts[e.id],l();break}case"reasoning-start":{const t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeReasoningParts[e.id]=t,a.message.parts.push(t),l();break}case"reasoning-delta":{const t=a.activeReasoningParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,l();break}case"reasoning-end":{const t=a.activeReasoningParts[e.id];t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,t.state="done",delete a.activeReasoningParts[e.id],l();break}case"file":a.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),l();break;case"source-url":a.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":a.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{const t=a.message.parts.filter(In);a.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title}),l();break}case"tool-input-delta":{const t=a.partialToolCalls[e.toolCallId];t.text+=e.inputTextDelta;const{value:n}=await un(t.text);t.dynamic?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}):h({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}),l();break}case"tool-input-available":e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),l(),s&&!e.providerExecuted&&await s({toolCall:e});break;case"tool-input-error":e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),l();break;case"tool-approval-request":{const t=m(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId},l();break}case"tool-output-denied":m(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{const t=m(e.toolCallId);"dynamic-tool"===t.type?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:t.title}):h({toolCallId:e.toolCallId,toolName:Nn(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,title:t.title}),l();break}case"tool-output-error":{const t=m(e.toolCallId);"dynamic-tool"===t.type?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}):h({toolCallId:e.toolCallId,toolName:Nn(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}),l();break}case"start-step":a.message.parts.push({type:"step-start"});break;case"finish-step":a.activeTextParts={},a.activeReasoningParts={};break;case"start":null!=e.messageId&&(a.message.id=e.messageId),await v(e.messageMetadata),null==e.messageId&&null==e.messageMetadata||l();break;case"finish":null!=e.finishReason&&(a.finishReason=e.finishReason),await v(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await v(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==r||r(new Error(e.errorText));break;default:if(function(e){return e.type.startsWith("data-")}(e)){null!=(null==n?void 0:n[e.type])&&await(0,g.k5)({value:e.data,schema:n[e.type]});const t=e;if(t.transient){null==i||i(t);break}const r=null!=t.id?a.message.parts.find((e=>t.type===e.type&&t.id===e.id)):void 0;null!=r?r.data=t.data:a.message.parts.push(t),null==i||i(t),l()}}o.enqueue(e)}))}}))}function On(e){const t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){const e=this.getReader();let t=!1;async function n(n){var a;t=!0;try{n&&await(null==(a=e.cancel)?void 0:a.call(e))}finally{try{e.releaseLock()}catch(e){}}}return{async next(){if(t)return{done:!0,value:void 0};const{done:a,value:r}=await e.read();return a?(await n(!0),{done:!0,value:void 0}):{done:!1,value:r}},return:async()=>(await n(!0),{done:!0,value:void 0}),async throw(e){throw await n(!0),e}}},t}function kn(){let e,t;return{promise:new Promise(((n,a)=>{e=n,t=a})),resolve:e,reject:t}}function Rn(){var e,t;return null!=(t=null==(e=null==globalThis?void 0:globalThis.performance)?void 0:e.now())?t:Date.now()}(0,g.ID)((()=>(0,g.jN)($.KC([$.re({type:$.eu("text-start"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("text-delta"),id:$.Yj(),delta:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("text-end"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("error"),errorText:$.Yj()}),$.re({type:$.eu("tool-input-start"),toolCallId:$.Yj(),toolName:$.Yj(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional(),title:$.Yj().optional()}),$.re({type:$.eu("tool-input-delta"),toolCallId:$.Yj(),inputTextDelta:$.Yj()}),$.re({type:$.eu("tool-input-available"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerExecuted:$.zM().optional(),providerMetadata:Rt.optional(),dynamic:$.zM().optional(),title:$.Yj().optional()}),$.re({type:$.eu("tool-input-error"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerExecuted:$.zM().optional(),providerMetadata:Rt.optional(),dynamic:$.zM().optional(),errorText:$.Yj(),title:$.Yj().optional()}),$.re({type:$.eu("tool-approval-request"),approvalId:$.Yj(),toolCallId:$.Yj()}),$.re({type:$.eu("tool-output-available"),toolCallId:$.Yj(),output:$.L5(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional(),preliminary:$.zM().optional()}),$.re({type:$.eu("tool-output-error"),toolCallId:$.Yj(),errorText:$.Yj(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional()}),$.re({type:$.eu("tool-output-denied"),toolCallId:$.Yj()}),$.re({type:$.eu("reasoning-start"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("reasoning-delta"),id:$.Yj(),delta:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("reasoning-end"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("source-url"),sourceId:$.Yj(),url:$.Yj(),title:$.Yj().optional(),providerMetadata:Rt.optional()}),$.re({type:$.eu("source-document"),sourceId:$.Yj(),mediaType:$.Yj(),title:$.Yj(),filename:$.Yj().optional(),providerMetadata:Rt.optional()}),$.re({type:$.eu("file"),url:$.Yj(),mediaType:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.Ie((e=>"string"==typeof e&&e.startsWith("data-")),{message:'Type must start with "data-"'}),id:$.Yj().optional(),data:$.L5(),transient:$.zM().optional()}),$.re({type:$.eu("start-step")}),$.re({type:$.eu("finish-step")}),$.re({type:$.eu("start"),messageId:$.Yj().optional(),messageMetadata:$.L5().optional()}),$.re({type:$.eu("finish"),finishReason:$.k5(["stop","length","content-filter","tool-calls","error","other","unknown"]).optional(),messageMetadata:$.L5().optional()}),$.re({type:$.eu("abort")}),$.re({type:$.eu("message-metadata"),messageMetadata:$.L5()})]))));var Cn=(0,g.hK)({prefix:"aitxt",size:24});function Ln({model:e,tools:t,toolChoice:n,system:a,prompt:r,messages:s,maxRetries:i,abortSignal:o,headers:l,stopWhen:c=$n(1),experimental_output:u,output:p=u,experimental_telemetry:d,prepareStep:m,providerOptions:h,experimental_activeTools:f,activeTools:v=f,experimental_repairToolCall:g,experimental_transform:y,experimental_download:$,includeRawChunks:b=!1,onChunk:E,onError:_=({error:e})=>{console.error(e)},onFinish:S,onAbort:x,onStepFinish:A,experimental_context:I,_internal:{now:w=Rn,generateId:N=Cn,currentDate:T=()=>new Date}={},...O}){return new Pn({model:$t(e),telemetry:d,headers:l,settings:O,maxRetries:i,abortSignal:o,system:a,prompt:r,messages:s,tools:t,toolChoice:n,transforms:It(y),activeTools:v,repairToolCall:g,stopConditions:It(c),output:p,providerOptions:h,prepareStep:m,includeRawChunks:b,onChunk:E,onError:_,onFinish:S,onAbort:x,onStepFinish:A,now:w,currentDate:T,generateId:N,experimental_context:I,download:$})}var Pn=class{constructor({model:e,telemetry:t,headers:n,settings:a,maxRetries:r,abortSignal:s,system:i,prompt:o,messages:l,tools:c,toolChoice:u,transforms:p,activeTools:d,repairToolCall:m,stopConditions:h,output:f,providerOptions:v,prepareStep:b,includeRawChunks:E,now:_,currentDate:S,generateId:x,onChunk:A,onError:I,onFinish:w,onAbort:N,onStepFinish:T,experimental_context:O,download:k}){let R;this._totalUsage=new g.e1,this._finishReason=new g.e1,this._steps=new g.e1,this.outputSpecification=f,this.includeRawChunks=E,this.tools=c;let C=[];const L=[];let P,M,j={},D=[];const F=[];let Y,V={},U={};const q=new TransformStream({async transform(t,n){var a,r,s,i;n.enqueue(t);const{part:o}=t;if("text-delta"!==o.type&&"reasoning-delta"!==o.type&&"source"!==o.type&&"tool-call"!==o.type&&"tool-result"!==o.type&&"tool-input-start"!==o.type&&"tool-input-delta"!==o.type&&"raw"!==o.type||await(null==A?void 0:A({chunk:o})),"error"===o.type&&await I({error:Gt(o.error)}),"text-start"===o.type&&(V[o.id]={type:"text",text:"",providerMetadata:o.providerMetadata},C.push(V[o.id])),"text-delta"===o.type){const e=V[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`text part ${o.id} not found`},partialOutput:void 0});e.text+=o.text,e.providerMetadata=null!=(a=o.providerMetadata)?a:e.providerMetadata}if("text-end"===o.type){const e=V[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`text part ${o.id} not found`},partialOutput:void 0});e.providerMetadata=null!=(r=o.providerMetadata)?r:e.providerMetadata,delete V[o.id]}if("reasoning-start"===o.type&&(U[o.id]={type:"reasoning",text:"",providerMetadata:o.providerMetadata},C.push(U[o.id])),"reasoning-delta"===o.type){const e=U[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`reasoning part ${o.id} not found`},partialOutput:void 0});e.text+=o.text,e.providerMetadata=null!=(s=o.providerMetadata)?s:e.providerMetadata}if("reasoning-end"===o.type){const e=U[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`reasoning part ${o.id} not found`},partialOutput:void 0});e.providerMetadata=null!=(i=o.providerMetadata)?i:e.providerMetadata,delete U[o.id]}if("file"===o.type&&C.push({type:"file",file:o.file}),"source"===o.type&&C.push(o),"tool-call"===o.type&&C.push(o),"tool-result"!==o.type||o.preliminary||C.push(o),"tool-approval-request"===o.type&&C.push(o),"tool-error"===o.type&&C.push(o),"start-step"===o.type&&(C=[],U={},V={},j=o.request,D=o.warnings),"finish-step"===o.type){const t=bn({content:C,tools:c}),n=new yn({content:C,finishReason:o.finishReason,usage:o.usage,warnings:D,request:j,response:{...o.response,messages:[...L,...t]},providerMetadata:o.providerMetadata});await(null==T?void 0:T(n)),Ee({warnings:D,provider:e.provider,model:e.modelId}),F.push(n),L.push(...t),R.resolve()}"finish"===o.type&&(M=o.totalUsage,P=o.finishReason)},async flush(e){try{if(0===F.length){const e=new Ue({message:"No output generated. Check the stream for errors."});return J._finishReason.reject(e),J._totalUsage.reject(e),void J._steps.reject(e)}const e=null!=P?P:"unknown",n=null!=M?M:{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0};J._finishReason.resolve(e),J._totalUsage.resolve(n),J._steps.resolve(F);const a=F[F.length-1];await(null==w?void 0:w({finishReason:e,totalUsage:n,usage:a.usage,content:a.content,text:a.text,reasoningText:a.reasoningText,reasoning:a.reasoning,files:a.files,sources:a.sources,toolCalls:a.toolCalls,staticToolCalls:a.staticToolCalls,dynamicToolCalls:a.dynamicToolCalls,toolResults:a.toolResults,staticToolResults:a.staticToolResults,dynamicToolResults:a.dynamicToolResults,request:a.request,response:a.response,warnings:a.warnings,providerMetadata:a.providerMetadata,steps:F,experimental_context:O})),Y.setAttributes(await en({telemetry:t,attributes:{"ai.response.finishReason":e,"ai.response.text":{output:()=>a.text},"ai.response.toolCalls":{output:()=>{var e;return(null==(e=a.toolCalls)?void 0:e.length)?JSON.stringify(a.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(a.providerMetadata),"ai.usage.inputTokens":n.inputTokens,"ai.usage.outputTokens":n.outputTokens,"ai.usage.totalTokens":n.totalTokens,"ai.usage.reasoningTokens":n.reasoningTokens,"ai.usage.cachedInputTokens":n.cachedInputTokens}}))}catch(t){e.error(t)}finally{Y.end()}}}),B=function(){let e=[],t=null,n=!1,a=kn();const r=()=>{n=!0,a.resolve(),e.forEach((e=>e.cancel())),e=[],null==t||t.close()},s=async()=>{if(n&&0===e.length)null==t||t.close();else{if(0===e.length)return a=kn(),await a.promise,s();try{const{value:a,done:r}=await e[0].read();r?(e.shift(),0===e.length&&n?null==t||t.close():await s()):null==t||t.enqueue(a)}catch(n){null==t||t.error(n),e.shift(),r()}}};return{stream:new ReadableStream({start(e){t=e},pull:s,async cancel(){for(const t of e)await t.cancel();e=[],n=!0}}),addStream:t=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(t.getReader()),a.resolve()},close:()=>{n=!0,a.resolve(),0===e.length&&(null==t||t.close())},terminate:r}}();this.addStream=B.addStream,this.closeStream=B.close;const z=B.stream.getReader();let Z=new ReadableStream({async start(e){e.enqueue({type:"start"})},async pull(e){function t(){null==N||N({steps:F}),e.enqueue({type:"abort"}),e.close()}try{const{done:n,value:a}=await z.read();if(n)return void e.close();if(null==s?void 0:s.aborted)return void t();e.enqueue(a)}catch(n){(0,g.zf)(n)&&(null==s?void 0:s.aborted)?t():e.error(n)}},cancel:e=>B.stream.cancel(e)});for(const e of p)Z=Z.pipeThrough(e({tools:c,stopStream(){B.terminate()}}));this.baseStream=Z.pipeThrough(function(e){let t,n,a="",r="",s="";function i({controller:e,partialOutput:a}){e.enqueue({part:{type:"text-delta",id:t,text:r,providerMetadata:n},partialOutput:a}),r=""}return new TransformStream({async transform(o,l){var c;if("finish-step"===o.type&&r.length>0&&i({controller:l}),"text-delta"!==o.type&&"text-start"!==o.type&&"text-end"!==o.type)return void l.enqueue({part:o,partialOutput:void 0});if(null==t)t=o.id;else if(o.id!==t)return void l.enqueue({part:o,partialOutput:void 0});if("text-start"===o.type)return void l.enqueue({part:o,partialOutput:void 0});if("text-end"===o.type)return r.length>0&&i({controller:l}),void l.enqueue({part:o,partialOutput:void 0});a+=o.text,r+=o.text,n=null!=(c=o.providerMetadata)?c:n;const u=await e.parsePartialOutput({text:a});if(void 0!==u){const e=JSON.stringify(u.partial);e!==s&&(i({controller:l,partialOutput:u.partial}),s=e)}}})}(null!=f?f:pn())).pipeThrough(q);const{maxRetries:G,retry:W}=function({maxRetries:e,abortSignal:t}){if(null!=e){if(!Number.isInteger(e))throw new Ae({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new Ae({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}const n=null!=e?e:2;return{maxRetries:n,retry:an({maxRetries:n,abortSignal:t})}}({maxRetries:r,abortSignal:s}),H=function({isEnabled:e=!1,tracer:t}={}){return e?t||me.u.getTracer("ai"):Ht}(t),K=function({maxOutputTokens:e,temperature:t,topP:n,topK:a,presencePenalty:r,frequencyPenalty:s,seed:i,stopSequences:o}){if(null!=e){if(!Number.isInteger(e))throw new Ae({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new Ae({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(null!=t&&"number"!=typeof t)throw new Ae({parameter:"temperature",value:t,message:"temperature must be a number"});if(null!=n&&"number"!=typeof n)throw new Ae({parameter:"topP",value:n,message:"topP must be a number"});if(null!=a&&"number"!=typeof a)throw new Ae({parameter:"topK",value:a,message:"topK must be a number"});if(null!=r&&"number"!=typeof r)throw new Ae({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(null!=s&&"number"!=typeof s)throw new Ae({parameter:"frequencyPenalty",value:s,message:"frequencyPenalty must be a number"});if(null!=i&&!Number.isInteger(i))throw new Ae({parameter:"seed",value:i,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:a,presencePenalty:r,frequencyPenalty:s,stopSequences:o,seed:i}}(a),X=function({model:e,settings:t,telemetry:n,headers:a}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce(((e,[t,n])=>(e[`ai.settings.${t}`]=n,e)),{}),...Object.entries(null!=(r=null==n?void 0:n.metadata)?r:{}).reduce(((e,[t,n])=>(e[`ai.telemetry.metadata.${t}`]=n,e)),{}),...Object.entries(null!=a?a:{}).reduce(((e,[t,n])=>(void 0!==n&&(e[`ai.request.headers.${t}`]=n),e)),{})}}({model:e,telemetry:t,headers:n,settings:{...K,maxRetries:G}}),J=this;Jt({name:"ai.streamText",attributes:en({telemetry:t,attributes:{...Wt({operationId:"ai.streamText",telemetry:t}),...X,"ai.prompt":{input:()=>JSON.stringify({system:i,prompt:o,messages:l})}}}),tracer:H,endWhenDone:!1,fn:async a=>{Y=a;const r=await async function(e){if(null==e.prompt&&null==e.messages)throw new y.M3({prompt:e,message:"prompt or messages must be defined"});if(null!=e.prompt&&null!=e.messages)throw new y.M3({prompt:e,message:"prompt and messages cannot be defined at the same time"});if(null!=e.system&&"string"!=typeof e.system&&!It(e.system).every((e=>"object"==typeof e&&null!==e&&"role"in e&&"system"===e.role)))throw new y.M3({prompt:e,message:"system must be a string, SystemModelMessage, or array of SystemModelMessage"});let t;if(null!=e.prompt&&"string"==typeof e.prompt)t=[{role:"user",content:e.prompt}];else if(null!=e.prompt&&Array.isArray(e.prompt))t=e.prompt;else{if(null==e.messages)throw new y.M3({prompt:e,message:"prompt or messages must be defined"});t=e.messages}if(0===t.length)throw new y.M3({prompt:e,message:"messages must not be empty"});const n=await(0,g.ZZ)({value:t,schema:$.YO(Zt)});if(!n.success)throw new y.M3({prompt:e,message:"The messages do not match the ModelMessage[] schema.",cause:n.error});return{messages:t,system:e.system}}({system:i,prompt:o,messages:l}),p=r.messages,E=[],{approvedToolApprovals:A,deniedToolApprovals:I}=function({messages:e}){const t=e.at(-1);if("tool"!=(null==t?void 0:t.role))return{approvedToolApprovals:[],deniedToolApprovals:[]};const n={};for(const t of e)if("assistant"===t.role&&"string"!=typeof t.content){const e=t.content;for(const t of e)"tool-call"===t.type&&(n[t.toolCallId]=t)}const a={};for(const t of e)if("assistant"===t.role&&"string"!=typeof t.content){const e=t.content;for(const t of e)"tool-approval-request"===t.type&&(a[t.approvalId]=t)}const r={};for(const e of t.content)"tool-result"===e.type&&(r[e.toolCallId]=e);const s=[],i=[],o=t.content.filter((e=>"tool-approval-response"===e.type));for(const e of o){const t=a[e.approvalId];if(null!=r[t.toolCallId])continue;const o={approvalRequest:t,approvalResponse:e,toolCall:n[t.toolCallId]};e.approved?s.push(o):i.push(o)}return{approvedToolApprovals:s,deniedToolApprovals:i}}({messages:p});if(I.length>0||A.length>0){let e;const n=new ReadableStream({start(t){e=t}});J.addStream(n);try{for(const t of I)null==e||e.enqueue({type:"tool-output-denied",toolCallId:t.toolCall.toolCallId,toolName:t.toolCall.toolName});const n=[];await Promise.all(A.map((async a=>{const r=await sn({toolCall:a.toolCall,tools:c,tracer:H,telemetry:t,messages:p,abortSignal:s,experimental_context:O,onPreliminaryToolResult:t=>{null==e||e.enqueue(t)}});null!=r&&(null==e||e.enqueue(r),n.push(r))}))),E.push({role:"tool",content:[...n.map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Tt({tool:null==c?void 0:c[e.toolName],output:"tool-result"===e.type?e.output:e.error,errorMode:"tool-error"===e.type?"json":"none"})}))),...I.map((e=>({type:"tool-result",toolCallId:e.toolCall.toolCallId,toolName:e.toolCall.toolName,output:{type:"execution-denied",reason:e.approvalResponse.reason}})))]})}finally{null==e||e.close()}}L.push(...E),await async function a({currentStep:o,responseMessages:l,usage:y}){var $,E,A,I,w,N;const T=J.includeRawChunks;R=new g.e1;const C=[...p,...l],L=await(null==b?void 0:b({model:e,steps:F,stepNumber:F.length,messages:C,experimental_context:O})),P=$t(null!=($=null==L?void 0:L.model)?$:e),M=await wt({prompt:{system:null!=(E=null==L?void 0:L.system)?E:r.system,messages:null!=(A=null==L?void 0:L.messages)?A:C},supportedUrls:await P.supportedUrls,download:k}),{toolChoice:j,tools:D}=await async function({tools:e,toolChoice:t,activeTools:n}){if(!(null!=(a=e)&&Object.keys(a).length>0))return{tools:void 0,toolChoice:void 0};var a;const r=null!=n?Object.entries(e).filter((([e])=>n.includes(e))):Object.entries(e),s=[];for(const[e,t]of r){const n=t.type;switch(n){case void 0:case"dynamic":case"function":s.push({type:"function",name:e,description:t.description,inputSchema:await(0,g.mD)(t.inputSchema).jsonSchema,...null!=t.inputExamples?{inputExamples:t.inputExamples}:{},providerOptions:t.providerOptions,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":s.push({type:"provider",name:e,id:t.id,args:t.args});break;default:throw new Error(`Unsupported tool type: ${n}`)}}return{tools:s,toolChoice:null==t?{type:"auto"}:"string"==typeof t?{type:t}:{type:"tool",toolName:t.toolName}}}({tools:c,toolChoice:null!=(I=null==L?void 0:L.toolChoice)?I:u,activeTools:null!=(w=null==L?void 0:L.activeTools)?w:d});O=null!=(N=null==L?void 0:L.experimental_context)?N:O;const{result:{stream:Y,response:V,request:U},doStreamSpan:q,startTimestampMs:B}=await W((()=>Jt({name:"ai.streamText.doStream",attributes:en({telemetry:t,attributes:{...Wt({operationId:"ai.streamText.doStream",telemetry:t}),...X,"ai.model.provider":P.provider,"ai.model.id":P.modelId,"ai.prompt.messages":{input:()=>function(e){return JSON.stringify(e.map((e=>({...e,content:"string"==typeof e.content?e.content:e.content.map((e=>{return"file"===e.type?{...e,data:e.data instanceof Uint8Array?(t=e.data,"string"==typeof t?t:t instanceof ArrayBuffer?(0,g.n_)(new Uint8Array(t)):(0,g.n_)(t)):e.data}:e;var t}))}))))}(M)},"ai.prompt.tools":{input:()=>null==D?void 0:D.map((e=>JSON.stringify(e)))},"ai.prompt.toolChoice":{input:()=>null!=j?JSON.stringify(j):void 0},"gen_ai.system":P.provider,"gen_ai.request.model":P.modelId,"gen_ai.request.frequency_penalty":K.frequencyPenalty,"gen_ai.request.max_tokens":K.maxOutputTokens,"gen_ai.request.presence_penalty":K.presencePenalty,"gen_ai.request.stop_sequences":K.stopSequences,"gen_ai.request.temperature":K.temperature,"gen_ai.request.top_k":K.topK,"gen_ai.request.top_p":K.topP}}),tracer:H,endWhenDone:!1,fn:async e=>({startTimestampMs:_(),doStreamSpan:e,result:await P.doStream({...K,tools:D,toolChoice:j,responseFormat:await(null==f?void 0:f.responseFormat),prompt:M,providerOptions:v,abortSignal:s,headers:n,includeRawChunks:T})})}))),z=function({tools:e,generatorStream:t,tracer:n,telemetry:a,system:r,messages:s,abortSignal:i,repairToolCall:o,experimental_context:l,generateId:c}){let u=null;const p=new ReadableStream({start(e){u=e}}),d=new Set,m=new Map;let h,f=!1;function v(){f&&0===d.size&&(null!=h&&u.enqueue(h),u.close())}const y=new TransformStream({async transform(t,p){const f=t.type;switch(f){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":p.enqueue(t);break;case"file":p.enqueue({type:"file",file:new ln({data:t.data,mediaType:t.mediaType})});break;case"finish":h={type:"finish",finishReason:t.finishReason,usage:tn(t.usage),providerMetadata:t.providerMetadata};break;case"tool-call":try{const h=await async function({toolCall:e,tools:t,repairToolCall:n,system:a,messages:r}){var s;try{if(null==t){if(e.providerExecuted&&e.dynamic)return await vn(e);throw new Ge({toolName:e.toolName})}try{return await gn({toolCall:e,tools:t})}catch(s){if(null==n||!Ge.isInstance(s)&&!ke.isInstance(s))throw s;let i=null;try{i=await n({toolCall:e,tools:t,inputSchema:async({toolName:e})=>{const{inputSchema:n}=t[e];return await(0,g.mD)(n).jsonSchema},system:a,messages:r,error:s})}catch(e){throw new Je({cause:e,originalError:s})}if(null==i)throw s;return await gn({toolCall:i,tools:t})}}catch(n){const a=await(0,g.N8)({text:e.input}),r=a.success?a.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:r,dynamic:!0,invalid:!0,error:n,title:null==(s=null==t?void 0:t[e.toolName])?void 0:s.title,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}}}({toolCall:t,tools:e,repairToolCall:o,system:r,messages:s});if(p.enqueue(h),h.invalid){u.enqueue({type:"tool-error",toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,error:(0,g.u1)(h.error),dynamic:!0,title:h.title});break}const f=null==e?void 0:e[h.toolName];if(null==f)break;if(null!=f.onInputAvailable&&await f.onInputAvailable({input:h.input,toolCallId:h.toolCallId,messages:s,abortSignal:i,experimental_context:l}),await async function({tool:e,toolCall:t,messages:n,experimental_context:a}){return null!=e.needsApproval&&("boolean"==typeof e.needsApproval?e.needsApproval:await e.needsApproval(t.input,{toolCallId:t.toolCallId,messages:n,experimental_context:a}))}({tool:f,toolCall:h,messages:s,experimental_context:l})){u.enqueue({type:"tool-approval-request",approvalId:c(),toolCall:h});break}if(m.set(h.toolCallId,h.input),null!=f.execute&&!0!==h.providerExecuted){const t=c();d.add(t),sn({toolCall:h,tools:e,tracer:n,telemetry:a,messages:s,abortSignal:i,experimental_context:l,onPreliminaryToolResult:e=>{u.enqueue(e)}}).then((e=>{u.enqueue(e),d.delete(t),v()}))}}catch(e){u.enqueue({type:"error",error:e})}break;case"tool-result":{const e=t.toolName;t.isError?u.enqueue({type:"tool-error",toolCallId:t.toolCallId,toolName:e,input:m.get(t.toolCallId),providerExecuted:!0,error:t.result,dynamic:t.dynamic}):p.enqueue({type:"tool-result",toolCallId:t.toolCallId,toolName:e,input:m.get(t.toolCallId),output:t.result,providerExecuted:!0,dynamic:t.dynamic});break}default:throw new Error(`Unhandled chunk type: ${f}`)}},flush(){f=!0,v()}});return new ReadableStream({start:async e=>Promise.all([t.pipeThrough(y).pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){}})),p.pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){e.close()}}))])})}({tools:c,generatorStream:Y,tracer:H,telemetry:t,system:i,messages:C,repairToolCall:m,abortSignal:s,experimental_context:O,generateId:x}),Z=null!=U?U:{},G=[],Q=[];let ee;const te={};let ne,ae="unknown",re={inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0},se=!0,ie={id:x(),timestamp:S(),modelId:e.modelId},oe="";J.addStream(z.pipeThrough(new TransformStream({async transform(e,t){var n,a,r,i,o;if("stream-start"===e.type)return void(ee=e.warnings);if(se){const e=_()-B;se=!1,q.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":e}),q.setAttributes({"ai.response.msToFirstChunk":e}),t.enqueue({type:"start-step",request:Z,warnings:null!=ee?ee:[]})}const l=e.type;switch(l){case"tool-approval-request":case"text-start":case"text-end":case"reasoning-start":case"reasoning-end":case"file":case"source":t.enqueue(e);break;case"text-delta":e.delta.length>0&&(t.enqueue({type:"text-delta",id:e.id,text:e.delta,providerMetadata:e.providerMetadata}),oe+=e.delta);break;case"reasoning-delta":t.enqueue({type:"reasoning-delta",id:e.id,text:e.delta,providerMetadata:e.providerMetadata});break;case"tool-call":t.enqueue(e),G.push(e);break;case"tool-result":t.enqueue(e),e.preliminary||Q.push(e);break;case"tool-error":t.enqueue(e),Q.push(e);break;case"response-metadata":ie={id:null!=(n=e.id)?n:ie.id,timestamp:null!=(a=e.timestamp)?a:ie.timestamp,modelId:null!=(r=e.modelId)?r:ie.modelId};break;case"finish":{re=e.usage,ae=e.finishReason,ne=e.providerMetadata;const t=_()-B;q.addEvent("ai.stream.finish"),q.setAttributes({"ai.response.msToFinish":t,"ai.response.avgOutputTokensPerSecond":1e3*(null!=(i=re.outputTokens)?i:0)/t});break}case"tool-input-start":{te[e.id]=e.toolName;const n=null==c?void 0:c[e.toolName];null!=(null==n?void 0:n.onInputStart)&&await n.onInputStart({toolCallId:e.id,messages:C,abortSignal:s,experimental_context:O}),t.enqueue({...e,dynamic:null!=(o=e.dynamic)?o:"dynamic"===(null==n?void 0:n.type),title:null==n?void 0:n.title});break}case"tool-input-end":delete te[e.id],t.enqueue(e);break;case"tool-input-delta":{const n=te[e.id],a=null==c?void 0:c[n];null!=(null==a?void 0:a.onInputDelta)&&await a.onInputDelta({inputTextDelta:e.delta,toolCallId:e.id,messages:C,abortSignal:s,experimental_context:O}),t.enqueue(e);break}case"error":t.enqueue(e),ae="error";break;case"raw":T&&t.enqueue(e);break;default:throw new Error(`Unknown chunk type: ${l}`)}},async flush(e){const n=G.length>0?JSON.stringify(G):void 0;try{q.setAttributes(await en({telemetry:t,attributes:{"ai.response.finishReason":ae,"ai.response.text":{output:()=>oe},"ai.response.toolCalls":{output:()=>n},"ai.response.id":ie.id,"ai.response.model":ie.modelId,"ai.response.timestamp":ie.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(ne),"ai.usage.inputTokens":re.inputTokens,"ai.usage.outputTokens":re.outputTokens,"ai.usage.totalTokens":re.totalTokens,"ai.usage.reasoningTokens":re.reasoningTokens,"ai.usage.cachedInputTokens":re.cachedInputTokens,"gen_ai.response.finish_reasons":[ae],"gen_ai.response.id":ie.id,"gen_ai.response.model":ie.modelId,"gen_ai.usage.input_tokens":re.inputTokens,"gen_ai.usage.output_tokens":re.outputTokens}}))}catch(e){}finally{q.end()}e.enqueue({type:"finish-step",finishReason:ae,usage:re,providerMetadata:ne,response:{...ie,headers:null==V?void 0:V.headers}});const r=function(e,t){var n,a,r,s,i,o,l,c,u,p;return{inputTokens:nn(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:nn(null==(n=e.inputTokenDetails)?void 0:n.noCacheTokens,null==(a=t.inputTokenDetails)?void 0:a.noCacheTokens),cacheReadTokens:nn(null==(r=e.inputTokenDetails)?void 0:r.cacheReadTokens,null==(s=t.inputTokenDetails)?void 0:s.cacheReadTokens),cacheWriteTokens:nn(null==(i=e.inputTokenDetails)?void 0:i.cacheWriteTokens,null==(o=t.inputTokenDetails)?void 0:o.cacheWriteTokens)},outputTokens:nn(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:nn(null==(l=e.outputTokenDetails)?void 0:l.textTokens,null==(c=t.outputTokenDetails)?void 0:c.textTokens),reasoningTokens:nn(null==(u=e.outputTokenDetails)?void 0:u.reasoningTokens,null==(p=t.outputTokenDetails)?void 0:p.reasoningTokens)},totalTokens:nn(e.totalTokens,t.totalTokens),reasoningTokens:nn(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:nn(e.cachedInputTokens,t.cachedInputTokens)}}(y,re);await R.promise;const s=G.filter((e=>!0!==e.providerExecuted)),i=Q.filter((e=>!0!==e.providerExecuted));if(s.length>0&&i.length===s.length&&!await async function({stopConditions:e,steps:t}){return(await Promise.all(e.map((e=>e({steps:t}))))).some((e=>e))}({stopConditions:h,steps:F})){l.push(...bn({content:F[F.length-1].content,tools:c}));try{await a({currentStep:o+1,responseMessages:l,usage:r})}catch(t){e.enqueue({type:"error",error:t}),J.closeStream()}}else e.enqueue({type:"finish",finishReason:ae,totalUsage:r}),J.closeStream()}})))}({currentStep:0,responseMessages:E,usage:{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}})}}).catch((e=>{J.addStream(new ReadableStream({start(t){t.enqueue({type:"error",error:e}),t.close()}})),J.closeStream()}))}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then((e=>e[e.length-1]))}get content(){return this.finalStep.then((e=>e.content))}get warnings(){return this.finalStep.then((e=>e.warnings))}get providerMetadata(){return this.finalStep.then((e=>e.providerMetadata))}get text(){return this.finalStep.then((e=>e.text))}get reasoningText(){return this.finalStep.then((e=>e.reasoningText))}get reasoning(){return this.finalStep.then((e=>e.reasoning))}get sources(){return this.finalStep.then((e=>e.sources))}get files(){return this.finalStep.then((e=>e.files))}get toolCalls(){return this.finalStep.then((e=>e.toolCalls))}get staticToolCalls(){return this.finalStep.then((e=>e.staticToolCalls))}get dynamicToolCalls(){return this.finalStep.then((e=>e.dynamicToolCalls))}get toolResults(){return this.finalStep.then((e=>e.toolResults))}get staticToolResults(){return this.finalStep.then((e=>e.staticToolResults))}get dynamicToolResults(){return this.finalStep.then((e=>e.dynamicToolResults))}get usage(){return this.finalStep.then((e=>e.usage))}get request(){return this.finalStep.then((e=>e.request))}get response(){return this.finalStep.then((e=>e.response))}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}teeStream(){const[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return On(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){"text-delta"===e.type&&t.enqueue(e.text)}})))}get fullStream(){return On(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await async function({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}({stream:this.fullStream,onError:null==e?void 0:e.onError})}catch(n){null==(t=null==e?void 0:e.onError)||t.call(e,n)}}get experimental_partialOutputStream(){return this.partialOutputStream}get partialOutputStream(){return On(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){null!=e&&t.enqueue(e)}})))}get output(){return this.finalStep.then((e=>{var t;return(null!=(t=this.outputSpecification)?t:pn()).parseCompleteOutput({text:e.text},{response:e.response,usage:e.usage,finishReason:e.finishReason})}))}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r=!0,sendSources:s=!1,sendStart:i=!0,sendFinish:o=!0,onError:l=y.u1}={}){const c=null!=t?function({originalMessages:e,responseMessageId:t}){if(null==e)return;const n=e[e.length-1];return"assistant"===(null==n?void 0:n.role)?n.id:"function"==typeof t?t():t}({originalMessages:e,responseMessageId:t}):void 0,u=e=>{var t;const n=null==(t=this.tools)?void 0:t[e.toolName];return null==n?e.dynamic:"dynamic"===(null==n?void 0:n.type)||void 0};return On(function({messageId:e,originalMessages:t=[],onFinish:n,onError:a,stream:r}){let s=null==t?void 0:t[t.length-1];"assistant"!==(null==s?void 0:s.role)?s=void 0:e=s.id;let i=!1;const o=r.pipeThrough(new TransformStream({transform(t,n){if("start"===t.type){const n=t;null==n.messageId&&null!=e&&(n.messageId=e)}"abort"===t.type&&(i=!0),n.enqueue(t)}}));if(null==n)return o;const l=function({lastMessage:e,messageId:t}){return{message:"assistant"===(null==e?void 0:e.role)?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}({lastMessage:s?structuredClone(s):void 0,messageId:null!=e?e:""});let c=!1;const u=async()=>{if(c||!n)return;c=!0;const e=l.message.id===(null==s?void 0:s.id);await n({isAborted:i,isContinuation:e,responseMessage:l.message,messages:[...e?t.slice(0,-1):t,l.message],finishReason:l.finishReason})};return Tn({stream:o,runUpdateMessageJob:async e=>{await e({state:l,write:()=>{}})},onError:a}).pipeThrough(new TransformStream({transform(e,t){t.enqueue(e)},async cancel(){await u()},async flush(){await u()}}))}({stream:this.fullStream.pipeThrough(new TransformStream({transform:async(e,t)=>{const n=null==a?void 0:a({part:e}),p=e.type;switch(p){case"text-start":t.enqueue({type:"text-start",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"text-delta":t.enqueue({type:"text-delta",id:e.id,delta:e.text,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"text-end":t.enqueue({type:"text-end",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-start":t.enqueue({type:"reasoning-start",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-delta":r&&t.enqueue({type:"reasoning-delta",id:e.id,delta:e.text,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-end":t.enqueue({type:"reasoning-end",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"file":t.enqueue({type:"file",mediaType:e.file.mediaType,url:`data:${e.file.mediaType};base64,${e.file.base64}`});break;case"source":s&&"url"===e.sourceType&&t.enqueue({type:"source-url",sourceId:e.id,url:e.url,title:e.title,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),s&&"document"===e.sourceType&&t.enqueue({type:"source-document",sourceId:e.id,mediaType:e.mediaType,title:e.title,filename:e.filename,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"tool-input-start":{const n=u(e);t.enqueue({type:"tool-input-start",toolCallId:e.id,toolName:e.toolName,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=n?{dynamic:n}:{},...null!=e.title?{title:e.title}:{}});break}case"tool-input-delta":t.enqueue({type:"tool-input-delta",toolCallId:e.id,inputTextDelta:e.delta});break;case"tool-call":{const n=u(e);e.invalid?t.enqueue({type:"tool-input-error",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{},...null!=n?{dynamic:n}:{},errorText:l(e.error),...null!=e.title?{title:e.title}:{}}):t.enqueue({type:"tool-input-available",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{},...null!=n?{dynamic:n}:{},...null!=e.title?{title:e.title}:{}});break}case"tool-approval-request":t.enqueue({type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId});break;case"tool-result":{const n=u(e);t.enqueue({type:"tool-output-available",toolCallId:e.toolCallId,output:e.output,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.preliminary?{preliminary:e.preliminary}:{},...null!=n?{dynamic:n}:{}});break}case"tool-error":{const n=u(e);t.enqueue({type:"tool-output-error",toolCallId:e.toolCallId,errorText:l(e.error),...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=n?{dynamic:n}:{}});break}case"tool-output-denied":t.enqueue({type:"tool-output-denied",toolCallId:e.toolCallId});break;case"error":t.enqueue({type:"error",errorText:l(e.error)});break;case"start-step":t.enqueue({type:"start-step"});break;case"finish-step":t.enqueue({type:"finish-step"});break;case"start":i&&t.enqueue({type:"start",...null!=n?{messageMetadata:n}:{},...null!=c?{messageId:c}:{}});break;case"finish":o&&t.enqueue({type:"finish",finishReason:e.finishReason,...null!=n?{messageMetadata:n}:{}});break;case"abort":t.enqueue(e);break;case"tool-input-end":case"raw":break;default:throw new Error(`Unknown chunk type: ${p}`)}null!=n&&"start"!==p&&"finish"!==p&&t.enqueue({type:"message-metadata",messageMetadata:n})}})),messageId:null!=c?c:null==t?void 0:t(),originalMessages:e,onFinish:n,onError:l}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:a,messageMetadata:r,sendReasoning:s,sendSources:i,sendFinish:o,sendStart:l,onError:c,...u}={}){!function({response:e,status:t,statusText:n,headers:a,stream:r,consumeSseStream:s}){let i=r.pipeThrough(new Sn);if(s){const[e,t]=i.tee();i=e,s({stream:t})}_n({response:e,status:t,statusText:n,headers:Object.fromEntries(En(a,xn).entries()),stream:i.pipeThrough(new TextEncoderStream)})}({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:a,messageMetadata:r,sendReasoning:s,sendSources:i,sendFinish:o,sendStart:l,onError:c}),...u})}pipeTextStreamToResponse(e,t){!function({response:e,status:t,statusText:n,headers:a,textStream:r}){_n({response:e,status:t,statusText:n,headers:Object.fromEntries(En(a,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r,sendSources:s,sendFinish:i,sendStart:o,onError:l,...c}={}){return function({status:e,statusText:t,headers:n,stream:a,consumeSseStream:r}){let s=a.pipeThrough(new Sn);if(r){const[e,t]=s.tee();s=e,r({stream:t})}return new Response(s.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:En(n,xn)})}({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r,sendSources:s,sendFinish:i,sendStart:o,onError:l}),...c})}toTextStreamResponse(e){return function({status:e,statusText:t,headers:n,textStream:a}){return new Response(a.pipeThrough(new TextEncoderStream),{status:null!=e?e:200,statusText:t,headers:En(n,{"content-type":"text/plain; charset=utf-8"})})}({textStream:this.textStream,...e})}};(0,g.ID)((()=>(0,g.jN)($.YO($.Ik({id:$.Yj(),role:$.k5(["system","user","assistant"]),metadata:$.L5().optional(),parts:$.YO($.KC([$.Ik({type:$.eu("text"),text:$.Yj(),state:$.k5(["streaming","done"]).optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("reasoning"),text:$.Yj(),state:$.k5(["streaming","done"]).optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("source-url"),sourceId:$.Yj(),url:$.Yj(),title:$.Yj().optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("source-document"),sourceId:$.Yj(),mediaType:$.Yj(),title:$.Yj(),filename:$.Yj().optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("file"),mediaType:$.Yj(),filename:$.Yj().optional(),url:$.Yj(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("step-start")}),$.Ik({type:$.Yj().startsWith("data-"),id:$.Yj().optional(),data:$.L5()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("input-streaming"),input:$.L5().optional(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),approval:$.Zm().optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("input-available"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Zm().optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("approval-requested"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.Zm().optional(),reason:$.Zm().optional()})}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("approval-responded"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.zM(),reason:$.Yj().optional()})}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-available"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.L5(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),preliminary:$.zM().optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-error"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Yj(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-denied"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!1),reason:$.Yj().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("input-streaming"),providerExecuted:$.zM().optional(),input:$.L5().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),approval:$.Zm().optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("input-available"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Zm().optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("approval-requested"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.Zm().optional(),reason:$.Zm().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("approval-responded"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.zM(),reason:$.Yj().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-available"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.L5(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),preliminary:$.zM().optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-error"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Yj(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-denied"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!1),reason:$.Yj().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")))),(0,g.hK)({prefix:"aiobj",size:24}),(0,g.hK)({prefix:"aiobj",size:24});var Mn=Symbol.for("vercel.ai.error.AI_NoSuchProviderError");y.eM,y.bD},99597:(e,t,n)=>{const a=n(50066),r=n(67094),{ANY:s}=r,i=n(72857),o=n(12876),l=n(18106),c=n(28141),u=n(24078),p=n(74227);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=u,f=c,v=">",g=">=";break;case"<":m=c,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},99625:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(1276),r=n(39560),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const c=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=c}};