@truebit/cli 1.120.0-beta.233 → 1.120.0-beta.234

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.mjs +2 -2
  2. package/package.json +2 -2
package/build/index.mjs CHANGED
@@ -104,7 +104,7 @@ Use mongoose.model(name, schema)`;super(n)}};Object.defineProperty(fC.prototype,
104
104
  Use Model.updateOne() to update these arrays instead. See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information.`;super(n)}};Object.defineProperty(lC.prototype,"name",{value:"DivergentArrayError"});Uve.exports=lC});var Xp=y((Con,jve)=>{"use strict";var zMt=on(),dC=class extends zMt{constructor(e,n,r){n=n||"Field `"+e+"` is not in schema and strict mode is set to throw.",super(n),this.isImmutableError=!!r,this.path=e}};Object.defineProperty(dC.prototype,"name",{value:"StrictModeError"});jve.exports=dC});var oG=y((Oon,Vve)=>{"use strict";var HMt=on(),pC=class extends HMt{constructor(e,n){n=n||"Cannot populate path `"+e+"` because it is not in your schema. Set the `strictPopulate` option to false to override.",super(n),this.path=e}};Object.defineProperty(pC.prototype,"name",{value:"StrictPopulateError"});Vve.exports=pC});var i0=y((zve,Hve)=>{"use strict";var Na=on();Hve.exports=zve=Na;Na.messages=mve();Na.Messages=Na.messages;Na.CastError=fs();Na.DocumentNotFoundError=iC();Na.ValidationError=Jh();Na.ValidatorError=eG();Na.VersionError=tG();Na.ParallelSaveError=nG();Na.OverwriteModelError=rG();Na.MissingSchemaError=Rve();Na.MongooseBulkSaveIncompleteError=iG();Na.MongooseServerSelectionError=aG();Na.DivergentArrayError=sG();Na.StrictModeError=Xp();Na.StrictPopulateError=oG()});var a0=y((Ion,Wve)=>{"use strict";Wve.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})});var bo=y((Mon,Gve)=>{"use strict";var WMt=Qr(),$a=class{constructor(e){if(e==null)return this;Object.assign(this,WMt(e))}},yo=a0();Object.defineProperty($a.prototype,"type",yo);Object.defineProperty($a.prototype,"validate",yo);Object.defineProperty($a.prototype,"cast",yo);Object.defineProperty($a.prototype,"required",yo);Object.defineProperty($a.prototype,"default",yo);Object.defineProperty($a.prototype,"ref",yo);Object.defineProperty($a.prototype,"refPath",yo);Object.defineProperty($a.prototype,"select",yo);Object.defineProperty($a.prototype,"index",yo);Object.defineProperty($a.prototype,"unique",yo);Object.defineProperty($a.prototype,"immutable",yo);Object.defineProperty($a.prototype,"sparse",yo);Object.defineProperty($a.prototype,"text",yo);Object.defineProperty($a.prototype,"transform",yo);Gve.exports=$a});var hC=y((Pon,Cy)=>{"use strict";var GMt=fs();Cy.exports=function(e,n){if(Cy.exports.convertToTrue.has(e))return!0;if(Cy.exports.convertToFalse.has(e))return!1;if(e==null)return e;throw new GMt("boolean",e,n)};Cy.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]);Cy.exports.convertToFalse=new Set([!1,"false",0,"0","no"])});var mC=y((Ron,Kve)=>{"use strict";var KMt=hC();Kve.exports=function(t){let e=this!=null?this.path:null;return KMt(t,e)}});var fG=y((kon,Yve)=>{"use strict";Yve.exports=function(t){if(Array.isArray(t)){if(!t.every(e=>typeof e=="number"||typeof e=="string"))throw new Error("$type array values must be strings or numbers");return t}if(typeof t!="number"&&typeof t!="string")throw new Error("$type parameter must be number, string, or array of numbers and strings");return t}});var Xve=y((Don,Zve)=>{"use strict";var YMt=Xp();Zve.exports=function(t){t.$immutable?(t.$immutableSetter=ZMt(t.path,t.options.immutable),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter(e=>e!==t.$immutableSetter),delete t.$immutableSetter)};function ZMt(t,e){return function(r,i,a,s){if(this==null||this.$__==null||this.isNew||s&&s.overwriteImmutable||!(typeof e=="function"?e.call(this,this):e))return r;let f=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(t):this.$__getValue(t);if(this.$__.strictMode==="throw"&&r!==f)throw new YMt(t,"Path `"+t+"` is immutable and strict mode is set to throw.",!0);return f}}});var Qve=y((Non,Jve)=>{"use strict";Jve.exports=function(e){return typeof e=="function"&&e.constructor&&e.constructor.name==="AsyncFunction"}});var t_e=y(($on,e_e)=>{"use strict";e_e.exports=function(e){let n=Object.keys(e),r=!0;for(let i=0,a=n.length;i<a;++i)if(typeof e[n[i]]=="object"&&e[n[i]]!==null){r=!1;break}return r}});var r_e=y((Bon,n_e)=>{"use strict";n_e.exports=function(e){let n=[],r="",i="DEFAULT";for(let a=0;a<e.length;++a)i==="IN_SQUARE_BRACKETS"&&!/\d/.test(e[a])&&e[a]!=="]"&&(i="DEFAULT",r=n[n.length-1]+"["+r,n.splice(n.length-1,1)),e[a]==="["?(i!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS"&&(n.push(r),r=""),i="IN_SQUARE_BRACKETS"):e[a]==="]"?i==="IN_SQUARE_BRACKETS"?(i="IMMEDIATELY_AFTER_SQUARE_BRACKETS",n.push(r),r=""):(i="DEFAULT",r+=e[a]):e[a]==="."?(i!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS"&&(n.push(r),r=""),i="DEFAULT"):r+=e[a];return i!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS"&&n.push(r),n}});var o_e=y(p1=>{var Y9=r_e(),i_e=["__proto__","constructor","prototype"];p1.get=function(t,e,n,r){var i;typeof n=="function"&&(n.length<2?(r=n,n=void 0):(i=n,n=void 0)),r||(r=s_e);var a=typeof t=="string"?Y9(t):t;if(!Array.isArray(a))throw new TypeError("Invalid `path`. Must be either string or array");for(var s=e,o,f=0;f<a.length;++f){if(o=a[f],typeof a[f]!="string"&&typeof a[f]!="number")throw new TypeError("Each segment of path to `get()` must be a string or number, got "+typeof a[f]);if(Array.isArray(s)&&!/^\d+$/.test(o)){var u=a.slice(f);return[].concat(s).map(function(d){return d?p1.get(u,d,n||i,r):r(void 0)})}if(i)s=i(s,o);else{var c=n&&s[n]?s[n]:s;s=c instanceof Map?c.get(o):c[o]}if(!s)return r(s)}return r(s)};p1.has=function(t,e){var n=typeof t=="string"?Y9(t):t;if(!Array.isArray(n))throw new TypeError("Invalid `path`. Must be either string or array");for(var r=n.length,i=e,a=0;a<r;++a){if(typeof n[a]!="string"&&typeof n[a]!="number")throw new TypeError("Each segment of path to `has()` must be a string or number, got "+typeof n[a]);if(i==null||typeof i!="object"||!(n[a]in i))return!1;i=i[n[a]]}return!0};p1.unset=function(t,e){var n=typeof t=="string"?Y9(t):t;if(!Array.isArray(n))throw new TypeError("Invalid `path`. Must be either string or array");for(var r=n.length,i=e,a=0;a<r;++a){if(i==null||typeof i!="object"||!(n[a]in i))return!1;if(typeof n[a]!="string"&&typeof n[a]!="number")throw new TypeError("Each segment of path to `unset()` must be a string or number, got "+typeof n[a]);if(i_e.indexOf(n[a])!==-1)return!1;if(a===r-1)return delete i[n[a]],!0;i=i instanceof Map?i.get(n[a]):i[n[a]]}return!0};p1.set=function(t,e,n,r,i,a){var s;typeof r=="function"&&(r.length<2?(i=r,r=void 0):(s=r,r=void 0)),i||(i=s_e);var o=typeof t=="string"?Y9(t):t;if(!Array.isArray(o))throw new TypeError("Invalid `path`. Must be either string or array");if(n!=null){for(var f=0;f<o.length;++f){if(typeof o[f]!="string"&&typeof o[f]!="number")throw new TypeError("Each segment of path to `set()` must be a string or number, got "+typeof o[f]);if(i_e.indexOf(o[f])!==-1)return}for(var u=a||/\$/.test(t)&&a!==!1,c=n,d,f=0,l=o.length-1;f<l;++f){if(d=o[f],d=="$"){if(f==l-1)break;continue}if(Array.isArray(c)&&!/^\d+$/.test(d)){var p=o.slice(f);if(!u&&Array.isArray(e))for(var h=0;h<c.length&&h<e.length;++h)p1.set(p,e[h],c[h],r||s,i,u);else for(var h=0;h<c.length;++h)p1.set(p,e,c[h],r||s,i,u);return}if(s)c=s(c,d);else{var v=r&&c[r]?c[r]:c;c=v instanceof Map?v.get(d):v[d]}if(!c)return}if(d=o[l],r&&c[r]&&(c=c[r]),Array.isArray(c)&&!/^\d+$/.test(d))if(!u&&Array.isArray(e))a_e(c,e,d,s,r,i);else for(var h=0;h<c.length;++h){var E=c[h];E&&(s?s(E,d,i(e)):(E[r]&&(E=E[r]),E[d]=i(e)))}else s?s(c,d,i(e)):c instanceof Map?c.set(d,i(e)):c[d]=i(e)}};p1.stringToParts=Y9;function a_e(t,e,n,r,i,a){for(var s,o=0;o<t.length&&o<e.length;++o)s=t[o],Array.isArray(s)&&Array.isArray(e[o])?a_e(s,e[o],n,r,i,a):s&&(r?r(s,n,a(e[o])):(s[i]&&(s=s[i]),s[n]=a(e[o])))}function s_e(t){return t}});var s0=y((f_e,u_e)=>{"use strict";u_e.exports=f_e=o_e()});var cG=y((Lon,c_e)=>{"use strict";var XMt=Qr(),uG=class{constructor(e){if(this._docs={},this._childDocs=[],e!=null&&(e=XMt(e),Object.assign(this,e),typeof e.subPopulate=="object"&&(this.populate=e.subPopulate),e.perDocumentLimit!=null&&e.limit!=null))throw new Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")}};c_e.exports=uG});var d_e=y(l_e=>{"use strict";l_e.isMongooseDocumentArray=function(t){return Array.isArray(t)&&t.isMongooseDocumentArray}});var yC=y((Uon,p_e)=>{"use strict";p_e.exports=function(e,n,r){let i=Object.keys(n.tree),a={};for(let s of i)r&&(e.paths[s]||e.nested[s]||e.singleNestedPaths[s])||(a[s]=n.tree[s]);e.options._isMerging=!0,e.add(a,null),delete e.options._isMerging,e.callQueue=e.callQueue.concat(n.callQueue),e.method(n.methods),e.static(n.statics);for(let[s,o]of Object.entries(n._userProvidedOptions))s in e._userProvidedOptions||e.set(s,o);for(let s in n.query)e.query[s]=n.query[s];for(let s in n.virtuals)e.virtuals[s]=n.virtuals[s].clone();e._indexes=e._indexes.concat(n._indexes||[]),e.s.hooks.merge(n.s.hooks,!1)}});var y_e=y((h_e,m_e)=>{"use strict";var jon=Vt(),z0=m_e.exports=h_e=function(){};z0.ctor=function(){let t=[...arguments],e=function(){z0.apply(this,arguments),this.paths={},this.states={}};return e.prototype=new z0,e.prototype.constructor=e,e.prototype.stateNames=t,t.forEach(function(n){e.prototype[n]=function(r){this._changeState(r,n)}}),e};z0.prototype._changeState=function(e,n){let r=this.paths[e];if(r===n)return;let i=this.states[r];i&&delete i[e],this.paths[e]=n,this.states[n]=this.states[n]||{},this.states[n][e]=!0};z0.prototype.clear=function(e){if(this.states[e]==null)return;let n=Object.keys(this.states[e]),r=n.length,i;for(;r--;)i=n[r],delete this.states[e][i],delete this.paths[i]};z0.prototype.clearPath=function(e){let n=this.paths[e];n&&(delete this.paths[e],delete this.states[n][e])};z0.prototype.getStatePaths=function(e){return this.states[e]!=null?this.states[e]:{}};z0.prototype.some=function(){let e=this,n=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(n,function(r){return e.states[r]==null?!1:Object.keys(e.states[r]).length})};z0.prototype._iter=function(e){return function(){let n=[...arguments],r=n.pop();n.length||(n=this.stateNames);let i=this;return n.reduce(function(s,o){return i.states[o]==null?s:s.concat(Object.keys(i.states[o]))},[])[e](function(s,o,f){return r(s,o,f)})}};z0.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)};z0.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)};z0.prototype.clone=function(){let e=new this.constructor;e.paths={...this.paths};for(let n of this.stateNames)n in this.states&&(e.states[n]=this.states[n]==null?this.states[n]:{...this.states[n]});return e}});var v_e=y((b_e,g_e)=>{"use strict";var JMt=y_e(),QMt=JMt.ctor("require","modify","init","default","ignore");g_e.exports=b_e=ci;function ci(){this.activePaths=new QMt}ci.prototype.strictMode=!0;ci.prototype.fullPath=void 0;ci.prototype.selected=void 0;ci.prototype.shardval=void 0;ci.prototype.saveError=void 0;ci.prototype.validationError=void 0;ci.prototype.adhocPaths=void 0;ci.prototype.removing=void 0;ci.prototype.inserting=void 0;ci.prototype.saving=void 0;ci.prototype.version=void 0;ci.prototype._id=void 0;ci.prototype.ownerDocument=void 0;ci.prototype.populate=void 0;ci.prototype.populated=void 0;ci.prototype.primitiveAtomics=void 0;ci.prototype.wasPopulated=!1;ci.prototype.scope=void 0;ci.prototype.session=null;ci.prototype.pathsToScopes=null;ci.prototype.cachedRequired=null});var bC=y((Von,w_e)=>{"use strict";var lG=jt().Binary,ePt=jt().UUID,__e=Vt();function Ns(t,e,n){let r=t;t==null&&(r=0);let i,a,s;Array.isArray(e)?(a=e[0],s=e[1]):i=e;let o;return typeof r=="number"||r instanceof Number?o=Buffer.alloc(r):o=Buffer.from(r,i,n),__e.decorate(o,Ns.mixin),o.isMongooseBuffer=!0,o[Ns.pathSymbol]=a,o[A_e]=s,o._subtype=0,o}var tPt=Symbol.for("mongoose#Buffer#_path"),A_e=Symbol.for("mongoose#Buffer#_parent");Ns.pathSymbol=tPt;Ns.mixin={_subtype:void 0,_markModified:function(){let t=this[A_e];return t&&t.markModified(this[Ns.pathSymbol]),this},write:function(){let t=Buffer.prototype.write.apply(this,arguments);return t>0&&this._markModified(),t},copy:function(t){let e=Buffer.prototype.copy.apply(this,arguments);return t&&t.isMongooseBuffer&&t._markModified(),e}};__e.each(["writeUInt8","writeUInt16","writeUInt32","writeInt8","writeInt16","writeInt32","writeFloat","writeDouble","fill","utf8Write","binaryWrite","asciiWrite","set","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE"],function(t){Buffer.prototype[t]&&(Ns.mixin[t]=function(){let e=Buffer.prototype[t].apply(this,arguments);return this._markModified(),e})});Ns.mixin.toObject=function(t){let e=typeof t=="number"?t:this._subtype||0;return new lG(Buffer.from(this),e)};Ns.mixin.$toObject=Ns.mixin.toObject;Ns.mixin.toBSON=function(){return new lG(this,this._subtype||0)};Ns.mixin.toUUID=function(){if(this._subtype!==4)throw new Error("Cannot convert a Buffer with subtype "+this._subtype+" to a UUID");return new ePt(this)};Ns.mixin.equals=function(t){if(!Buffer.isBuffer(t)||this.length!==t.length)return!1;for(let e=0;e<this.length;++e)if(this[e]!==t[e])return!1;return!0};Ns.mixin.subtype=function(t){if(typeof t!="number")throw new TypeError("Invalid subtype. Expected a number");this._subtype!==t&&this._markModified(),this._subtype=t};Ns.Binary=lG;w_e.exports=Ns});var Qh=y(dG=>{"use strict";dG.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed");dG.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")});var Oy=y((Hon,E_e)=>{"use strict";var gC=li(),nPt=Qh(),rPt=Yh(),iPt=Vt();function H0(t,e,n,r){if(e&&e.default){let i=e.default;Array.isArray(i)&&i.length===0?e.default=Array:!e.shared&&rPt(i)&&Object.keys(i).length===0&&(e.default=function(){return{}})}gC.call(this,t,e,"Mixed",r),this[nPt.schemaMixedSymbol]=!0}H0.schemaName="Mixed";H0.defaultOptions={};H0.prototype=Object.create(gC.prototype);H0.prototype.constructor=H0;H0.get=gC.get;H0.set=gC.set;H0.setters=[];H0.prototype.cast=function(t){return t instanceof Error?iPt.errorToPOJO(t):t};H0.prototype.castForQuery=function(t,e){return e};H0.prototype.toJSONSchema=function(e){return{}};E_e.exports=H0});var x_e=y((Gon,S_e)=>{"use strict";S_e.exports=class{constructor(e,n,r){this.subdocSnapshot=e,this.activePaths=n,this.version=r}}});var _C=y((Kon,T_e)=>{"use strict";var aPt=on(),vC=class extends aPt{constructor(e,n){let r=Array.isArray(n)?"array":"primitive value";super("Tried to set nested object field `"+e+`\` to ${r} \``+n+"`"),this.path=e}};Object.defineProperty(vC.prototype,"name",{value:"ObjectExpectedError"});T_e.exports=vC});var wC=y((Yon,C_e)=>{"use strict";var sPt=on(),AC=class extends sPt{constructor(e,n,r){super('Parameter "'+n+'" to '+r+'() must be an object, got "'+(e==null?e:e.toString())+'" (type '+typeof e+")")}};Object.defineProperty(AC.prototype,"name",{value:"ObjectParameterError"});C_e.exports=AC});var I_e=y((Zon,O_e)=>{"use strict";var oPt=on(),EC=class extends oPt{constructor(e){super("Can't validate() the same doc multiple times in parallel. Document: "+e._doc._id)}};Object.defineProperty(EC.prototype,"name",{value:"ParallelValidateError"});O_e.exports=EC});var pG=y((Xon,M_e)=>{"use strict";M_e.exports=function(e){let n={},r=Object.keys(e);for(let i of r){if(i.indexOf(".")===-1){n[i]=1;continue}let a=i.split("."),s=a[0];for(let o=0;o<a.length;++o)n[s]=1,o+1<a.length&&(s=s+"."+a[o+1])}return n}});var R_e=y((Jon,P_e)=>{"use strict";P_e.exports=function(e){return e==null||typeof e!="object"?!1:e.$slice==null&&e.$elemMatch==null&&e.$meta==null&&e.$==null}});var SC=y((Qon,k_e)=>{"use strict";var fPt=R_e();k_e.exports=function(e,n,r,i,a,s,o){let f=Object.keys(e.$__schema.paths),u=f.length,c=o&&o.skipParentChangeTracking;for(let d=0;d<u;++d){let l,p="",h=f[d];if(h==="_id"&&e.$__.skipId)continue;let v=e.$__schema.paths[h],E=v.splitPath(),M=E.length;if(E[M-1]==="$*")continue;let D=!1,$=e._doc;for(let N=0;N<M&&$!=null;++N){let V=E[N];if(p+=(p.length?".":"")+V,r===!0){if(p in n)break}else if(r===!1&&n&&!D){let j=v.$isSingleNested||v.$isMongooseDocumentArray;if(p in n&&!fPt(n[p])||N===M-1&&j&&i!=null&&i[p])D=!0;else if(i!=null&&!i[p])break}if(N===M-1){if($[V]!==void 0)break;if(a!=null){if(typeof v.defaultValue=="function"){if(!v.defaultValue.$runBeforeSetters&&a||v.defaultValue.$runBeforeSetters&&!a)break}else if(!a)continue}if(s&&s[p])break;if(n&&r!==null){if(r===!0){if(h in n)continue;try{l=v.getDefault(e,!1)}catch(j){e.invalidate(h,j);break}typeof l<"u"&&($[V]=l,hG(e,h,c))}else if(D){try{l=v.getDefault(e,!1)}catch(j){e.invalidate(h,j);break}typeof l<"u"&&($[V]=l,hG(e,h,c))}}else{try{l=v.getDefault(e,!1)}catch(j){e.invalidate(h,j);break}typeof l<"u"&&($[V]=l,hG(e,h,c))}}else $=$[V]}}};function hG(t,e,n){t.$__.activePaths.default(e),!n&&t.$isSubdocument&&t.$isSingleNested&&t.$parent()!=null&&t.$parent().$__.activePaths.default(t.$__pathRelativeToParent(e))}});var xC=y((e0n,N_e)=>{"use strict";N_e.exports=function(e,n,r){r=r||{};let i=r.skipDocArrays,a=0;if(!e)return a;for(let s of Object.keys(e.$__.activePaths.getStatePaths("modify"))){if(i){let o=e.$__schema.path(s);if(o&&o.$isMongooseDocumentArray)continue}s.startsWith(n+".")&&(e.$__.activePaths.clearPath(s),++a,e.$isSubdocument&&D_e(e,s))}return a};function D_e(t,e,n=new Set){if(n.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");let r=t.$parent(),i=t.$__pathRelativeToParent(void 0,!1)+"."+e;r.$__.activePaths.clearPath(i),r.$isSubdocument&&D_e(r,i,n)}});var CC=y(mG=>{"use strict";var uPt=Qr(),cPt=ct().documentSchemaSymbol,lPt=oc().internalToObjectOptions,dPt=Vt(),Iy,pPt=ct().getSymbol,TC=ct().scopeSymbol,$_e=dPt.isPOJO;mG.compile=B_e;mG.defineKey=F_e;var hPt=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),mPt=Object.freeze({noDottedPath:!0});function B_e(t,e,n,r){Iy=Iy||El();let i=r.typeKey;for(let a of Object.keys(t)){let s=t[a],f=$_e(s)&&Object.keys(s).length>0&&(!s[i]||i==="type"&&$_e(s.type)&&s.type.type)?s:null;F_e({prop:a,subprops:f,prototype:e,prefix:n,options:r})}}function F_e({prop:t,subprops:e,prototype:n,prefix:r,options:i}){Iy=Iy||El();let a=(r?r+".":"")+t;r=r||"";let s=r?Object.freeze({}):mPt;e?Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:function(){let o=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[a]){let f=Object.create(Iy.prototype,yPt(this));r||(f.$__[TC]=this),f.$__.nestedPath=a,Object.defineProperty(f,"schema",{enumerable:!1,configurable:!0,writable:!1,value:n.schema}),Object.defineProperty(f,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:n.schema}),Object.defineProperty(f,cPt,{enumerable:!1,configurable:!0,writable:!1,value:n.schema}),Object.defineProperty(f,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return uPt(o.get(a,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(f,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.get(a,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty(f,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.get(a,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty(f,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(f,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Object.keys(this.get(a,null,hPt)||{}).length===0}}),Object.defineProperty(f,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),B_e(e,f,a,i),this.$__.getters[a]=f}return this.$__.getters[a]},set:function(o){o!=null&&o.$__isNested?o=o.$__get():o instanceof Iy&&!o.$__isNested&&(o=o.$toObject(lPt)),(this.$__[TC]||this).$set(a,o)}}):Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:function(){return this[pPt].call(this.$__[TC]||this,a,null,s)},set:function(o){this.$set.call(this.$__[TC]||this,a,o)}})}function yPt(t){let e={};return Object.getOwnPropertyNames(t).forEach(function(n){["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(n)!==-1&&(e[n]=Object.getOwnPropertyDescriptor(t,n),e[n].enumerable=!1)}),e}});var q_e=y((n0n,L_e)=>{"use strict";L_e.exports=function(e){return e==null?null:Object.keys(e)[0]}});var OC=y(yG=>{"use strict";var bPt=jt().Binary,U_e=Da(),j_e=W9(),gPt=i0(),vPt=Q("util");yG.flatten=V_e;yG.modifiedPaths=z_e;function V_e(t,e,n,r){let i;t&&j_e(t)&&!Buffer.isBuffer(t)?i=Object.keys(t.toObject({transform:!1,virtuals:!1})||{}):i=Object.keys(t||{});let a=i.length,s={};e=e?e+".":"";for(let o=0;o<a;++o){let f=i[o],u=t[f];s[e+f]=u;let c=r&&r.path&&r.path(e+f),d=r&&r.nested&&r.nested[e+f];if(!(c&&c.instance==="Mixed")){if(H_e(u)){if(n&&n.skipArrays&&Array.isArray(u))continue;let l=V_e(u,e+f,n,r);for(let p in l)s[p]=l[p];Array.isArray(u)&&(s[e+f]=u)}if(d){let l=Object.keys(r.paths);for(let p of l)p.startsWith(e+f+".")&&!s.hasOwnProperty(p)&&(s[p]=void 0)}}}return s}function z_e(t,e,n,r=null){if(t==null||typeof t!="object")return;if(r==null&&(r={raw:{update:t,path:e},trace:new WeakSet}),r.trace.has(t))throw new gPt(`a circular reference in the update value, updateValue:
105
105
  ${vPt.inspect(r.raw.update,{showHidden:!1,depth:1})}
106
106
  updatePath: '${r.raw.path}'`);r.trace.add(t);let i=Object.keys(t||{}),a=i.length;n=n||{},e=e?e+".":"";for(let s=0;s<a;++s){let o=i[s],f=t[o],u=e+o;n[u]=!0,!Buffer.isBuffer(f)&&j_e(f)&&(f=f.toObject({transform:!1,virtuals:!1})),H_e(f)&&z_e(f,e+o,n,r)}return r.trace.delete(t),n}function H_e(t){return t&&typeof t=="object"&&!(t instanceof Date)&&!U_e(t,"ObjectId")&&(!Array.isArray(t)||t.length!==0)&&!(t instanceof Buffer)&&!U_e(t,"Decimal128")&&!(t instanceof bPt)}});var di=y((i0n,W_e)=>{"use strict";W_e.exports=function(e,n,r){let i,a=!1;if(typeof n=="string"){if(n.indexOf(".")===-1){let f=bG(e,n);return f??r}i=n.split(".")}else if(a=!0,i=n,i.length===1){let f=bG(e,i[0]);return f??r}let s=n,o=e;for(let f of i){if(o==null)return r;if(!a&&o[s]!=null)return o[s];o=bG(o,f),a||(s=s.substr(f.length+1))}return o??r};function bG(t,e){return t==null?t:t instanceof Map?t.get(e):t[e]}});var gG=y((a0n,K_e)=>{"use strict";var G_e=Da();K_e.exports=function(e,n){return typeof e=="string"&&typeof n=="string"||typeof e=="number"&&typeof n=="number"?e===n:G_e(e,"ObjectId")&&G_e(n,"ObjectId")?e.toString()===n.toString():!1}});var IC=y((s0n,Y_e)=>{"use strict";var _Pt=gG();Y_e.exports=function(e,n){if(e==null||e.discriminators==null)return null;for(let r of Object.keys(e.discriminators)){let i=e.discriminators[r];if(i.discriminatorMapping!=null&&_Pt(i.discriminatorMapping.value,n))return i}return null}});var X_e=y((o0n,Z_e)=>{"use strict";var APt=di(),wPt=IC();Z_e.exports=function t(e,n,r){r=r||{};let i=r.typeOnly,a=Array.isArray(n)?n:n.indexOf(".")===-1?[n]:n.split("."),s=null,o="adhocOrUndefined",f=wPt(e.schema,e.get(e.schema.options.discriminatorKey))||e.schema;for(let u=0;u<a.length;++u){let c=a.slice(0,u+1).join(".");if(s=f.path(c),s==null){o="adhocOrUndefined";continue}if(s.instance==="Mixed")return i?"real":s;if(o=f.pathType(c),(s.$isSingleNested||s.$isMongooseDocumentArrayElement)&&s.schema.discriminators!=null){let d=s.schema.discriminators,l=e.get(c+"."+APt(s,"schema.options.discriminatorKey"));if(l==null||d[l]==null)continue;let p=a.slice(u+1).join(".");return t(e.get(c),p,r)}}return i?o:s}});var Q_e=y((f0n,J_e)=>{"use strict";var EPt=di();J_e.exports=function(e,n,r){let i=r!=null?Object.keys(EPt(e.tree,r,{})):Object.keys(e.tree),a=new Set(Object.keys(n)),s;if(a.size>1){s=new Set;for(let o of i)a.has(o)&&s.add(o);for(let o of a)s.has(o)||s.add(o);s=Array.from(s)}else s=Array.from(a);return s}});var tAe=y((u0n,eAe)=>{"use strict";eAe.exports=function(e,n){if(n.length===1)return;let r=n[0],i;for(let a=0;a<n.length-1;++a){let s=e.path(r);s&&s.schema?(i=s.schema.options.strict,e=s.schema,r=s.$isMongooseDocumentArray&&!isNaN(n[a+1])?"":n[a+1]):r+=r.length?"."+n[a+1]:n[a+1]}return i}});var MC=y((c0n,nAe)=>{"use strict";var SPt=Vt(),xPt=new Set(["__index","__parentArray","_doc"]);nAe.exports=function(e,n){if(SPt.isPOJO(e)&&e.$__!=null&&e._doc!=null){if(n){let r={};for(let i of Object.keys(e))typeof i!="symbol"&&i[0]!=="$"&&(xPt.has(i)||(r[i]=e[i]));return{...e._doc,...r}}return e._doc}return e}});var My=y((l0n,rAe)=>{"use strict";rAe.exports=function(e){return e==null?!0:typeof e=="object"?!("$meta"in e)&&!("$slice"in e):!0}});var Py=y((d0n,iAe)=>{"use strict";var TPt=My(),CPt=Ey();iAe.exports=function t(e){if(e==null)return null;let n=Object.keys(e),r=null;if(n.length===1&&n[0]==="_id")r=!e._id;else for(let i=0;i<n.length;++i){let a=n[i];if(a!=="_id"&&TPt(e[a])&&(r=CPt(e[a])?t(e[a])??r:!e[a],r!=null))break}return r}});var vG=y((p0n,aAe)=>{"use strict";var OPt=My();aAe.exports=function(e,n){if(e==null)return!1;if(n==="_id")return e._id===0;let r=Object.keys(e),i=null;for(let a of r)if(OPt(e[a])){i=e[n]===1?"inclusive":"exclusive";break}return i==="inclusive"?e[n]!==1:i==="exclusive"?e[n]===0:!1}});var _G=y((h0n,sAe)=>{"use strict";var IPt=Vt();sAe.exports=function(e,n){if(e._doc._id==null||n==null||n.length===0)return;let r=String(e._doc._id);for(let i of n){if(i.isVirtual)continue;let s=i.path.split(".");for(let o=0;o<s.length-1;++o){let f=s.slice(0,o+1).join("."),u=s.slice(o+1).join("."),c=e.get(f);if(c!=null&&IPt.isMongooseDocumentArray(c)){for(let d=0;d<c.length;++d)c[d]&&c[d].populated(u,i._docs[r]==null?void 0:i._docs[r][d],i);break}}}}});var AG=y((m0n,fAe)=>{"use strict";var{isPOJO:MPt}=Vt();fAe.exports=oAe;function oAe(t){let e=Object.keys(t),n=e.length,r,i,a;for(;n--;){if(i=e[n],a=t[i],MPt(a)&&(t[i]=oAe(a)),t[i]===void 0){delete t[i];continue}r=!0}return r?t:void 0}});var wG=y((y0n,uAe)=>{"use strict";var PPt=/\./g;uAe.exports=function(e){if(e.indexOf(".")===-1)return[e];let n=e.split(PPt),r=n.length,i=new Array(r),a="";for(let s=0;s<r;++s)a+=a.length!==0?"."+n[s]:n[s],i[s]=a;return i}});var lAe=y((b0n,cAe)=>{"use strict";cAe.exports=function(e,n,r,i,a){let s=Object.keys(e).reduce((f,u)=>f||u.startsWith(n+"."),!1),o=n+"."+r.options.discriminatorKey;!s&&a.length===1&&a[0]===o&&i.splice(i.indexOf(o),1)}});var W0=y((g0n,dAe)=>{"use strict";var RPt=gG();dAe.exports=function(e,n){if(e==null)return null;for(let r of Object.keys(e)){let i=e[r];if(i.schema&&i.schema.discriminatorMapping&&RPt(i.schema.discriminatorMapping.value,n))return i}return null}});var PC=y((v0n,pAe)=>{"use strict";pAe.exports=function(e,n){let r=n.split("."),i="",a,s,o;for(let f=0;f<r.length;++f)if(i+=i.length?".":""+r[f],e[i]){for(s=Object.keys(e),o=s.length,a=0;a<o;++a)s[f].indexOf(i+".")===0&&s[f].indexOf(n);return!0}return!1}});var Z9=y(em=>{"use strict";var hAe=cG(),kPt=lAe(),mAe=di(),DPt=W0(),NPt=My(),$Pt=Qr(),BPt=PC();em.preparePopulationOptionsMQ=function(e,n){let r=e._mongooseOptions.populate,i=Object.keys(r).reduce((o,f)=>o.concat([r[f]]),[]);n.lean!=null&&i.filter(o=>(o&&o.options&&o.options.lean)==null).forEach(FPt(n.lean));let a=e&&e.options&&e.options.session||null;a!=null&&i.forEach(o=>{if(o.options==null){o.options={session:a};return}"session"in o.options||(o.options.session=a)});let s=e._fieldsForExec();for(let o=0;o<i.length;++o)i[o]instanceof hAe?i[o]=new hAe({...i[o],_queryProjection:s,_localModel:e.model}):(i[o]._queryProjection=s,i[o]._localModel=e.model);return i};em.createModel=function(e,n,r,i,a){e.hooks.execPreSync("createModel",n);let s=e.schema?e.schema.discriminatorMapping:null,o=s&&s.isRoot?s.key:null,f=n[o];if(o&&f&&e.discriminators){let c=e.discriminators[f]||DPt(e.discriminators,f);if(c){let d=$Pt(i);return em.applyPaths(d,c.schema),new c(void 0,d,{skipId:!0})}}let u={skipId:!0,isNew:!1,willInit:!0};return a!=null&&"defaults"in a&&(u.defaults=a.defaults),new e(void 0,r,u)};em.createModelAndInit=function(e,n,r,i,a,s,o){let f=s?{populated:s}:void 0,u=em.createModel(e,n,r,i,a);try{u.$init(n,f,o)}catch(c){o(c,u)}};em.applyPaths=function(e,n,r){let i,a,s=new Set;if(e){a=Object.keys(e);let l=[];for(let p=0;p<a.length;++p){let h=a[p];a[p][0]==="-"&&(delete e[h],h==="-_id"?e._id=0:l.push(h.slice(1)))}a=Object.keys(e);for(let p=0;p<a.length;++p){if(a[p][0]==="+")continue;let h=e[a[p]];if(NPt(h)&&!(a[p]==="_id"&&a.length>1)&&!(a[p]===n.options.discriminatorKey&&a.length>1&&h!=null&&!h)){i=!h;break}}for(let p of l){let h=n.path(p);!h||!h.selected||i!==!1?(e[p]=0,i=!0):h&&h.selected&&i===!1&&s.add(p)}}let o=[],f=[],u=[];switch(c(n),i){case!0:for(let l of f)e[l]=0;break;case!1:n&&n.paths._id&&n.paths._id.options&&n.paths._id.options.select===!1&&(e._id=0);for(let l of o)s.has(l)||BPt(e,l)||(e[l]=e[l]||1);break;case void 0:if(e==null)break;for(let l of Object.keys(e||{}))l.startsWith("+")&&delete e[l];for(let l of f)e[l]==null&&(e[l]=0);break}function c(l,p){if(p||(p=""),u.indexOf(l)!==-1)return[];u.push(l);let h=[];return l.eachPath(function(v,E){if(p&&(v=p+"."+v),E.$isSchemaMap||v.endsWith(".$*")){let D="+"+v,$=e&&D in e;E.options&&E.options.select===!1&&!$&&f.push(v);return}let M=d(v,E);if(M==null&&!Array.isArray(E)&&E.$isMongooseArray&&!E.$isMongooseDocumentArray&&(M=d(v,E.embeddedSchemaType)),M!=null&&h.push(M),E.schema){let D=c(E.schema,v);i===!1&&kPt(e,v,E.schema,o,D)}}),u.pop(),h}function d(l,p){if(e==null||typeof p.selected!="boolean")return;if(p.selected===!1&&e[l]){r&&(e[l]=0);return}if(!i&&p.selected&&l===n.options.discriminatorKey&&e[l]!=null&&!e[l]){delete e[l];return}if(i===!1&&p.selected&&e[l]!=null&&!e[l]){delete e[l];return}let h="+"+l;if(e&&h in e){delete e[h],i===!1&&a.length>1&&!~a.indexOf(l)&&!r?e[l]=1:i==null&&r&&p.selected===!1&&(e[l]=0);return}let E=l.split("."),M="";for(let D=0;D<E.length;++D)if(M+=M.length?"."+E[D]:E[D],f.indexOf(M)!==-1)return;if(!i&&(p&&p.options&&p.options.$skipDiscriminatorCheck)){let D="";for(let $=0;$<E.length;++$){D+=(D.length===0?"":".")+E[$];let N=mAe(e,D,!1)||mAe(e,D+".$",!1);if(N&&typeof N!="object")return}}return(p.selected?o:f).push(l),l}};function FPt(t){return function(e){e.options||(e.options={}),t!=null&&Array.isArray(t.virtuals)&&(t=Object.assign({},t),t.virtuals=t.virtuals.filter(n=>typeof n=="string"&&n.startsWith(e.path+".")).map(n=>n.slice(e.path.length+1))),e.options.lean=t}}});var EG=y((A0n,yAe)=>{"use strict";function LPt(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}yAe.exports=LPt});var gAe=y((w0n,bAe)=>{"use strict";bAe.exports=function(e,n,r){let i=n[0],a=r,s=e;for(let o=0;o<n.length-1;++o){let f=a.path(i);if(f&&f.schema){let u=s.get(i);if(a=f.schema,i=n[o+1],Array.isArray(u)&&!isNaN(i)&&(u=u[i],i=""),u==null)break;s=u}else i+=i.length?"."+n[o+1]:n[o+1]}return s}});var RC=y((E0n,_Ae)=>{"use strict";var h1=El(),qPt=oc().internalToObjectOptions,vAe=Q("util"),UPt=Vt();_Ae.exports=vr;function vr(t,e,n,r){if(n!=null){let a={isNew:n.isNew};"defaults"in n.$__&&(a.defaults=n.$__.defaults),r=Object.assign(a,r)}r!=null&&r.path!=null&&(this.$basePath=r.path),r!=null&&r.pathRelativeToParent!=null&&(this.$pathRelativeToParent=r.pathRelativeToParent);let i=r;r!=null&&r.path!=null&&(i=Object.assign({},r),delete i.path),h1.call(this,t,e,i),delete this.$__.priorDoc}vr.prototype=Object.create(h1.prototype);Object.defineProperty(vr.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0});Object.defineProperty(vr.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0});vr.prototype.toBSON=function(){return this.toObject(qPt)};vr.prototype.save=async function(e){return e=e||{},e.suppressWarning||UPt.warn("mongoose: calling `save()` on a subdoc does **not** save the document to MongoDB, it only runs save middleware. Use `subdoc.save({ suppressWarning: true })` to hide this warning if you're sure this behavior is right for your app."),await this.$__save()};vr.prototype.$__fullPath=function(t){return this.$__.fullPath||this.ownerDocument(),t?this.$__.fullPath+"."+t:this.$__.fullPath};vr.prototype.$__pathRelativeToParent=function(t){return this.$pathRelativeToParent!=null?t==null?this.$pathRelativeToParent:this.$pathRelativeToParent+"."+t:t==null?this.$basePath:this.$basePath?[this.$basePath,t].join("."):t};vr.prototype.$__save=async function(){try{await this._execDocumentPreHooks("save")}catch(e){await this._execDocumentPostHooks("save",e);return}await this._execDocumentPostHooks("save")};vr.prototype.$isValid=function(t){let e=this.$parent(),n=this.$__pathRelativeToParent(t);return e!=null&&n!=null?e.$isValid(n):h1.prototype.$isValid.call(this,t)};vr.prototype.markModified=function(t){h1.prototype.markModified.call(this,t);let e=this.$parent();if(e==null)return;let n=this.$__pathRelativeToParent(t);if(n==null)return;let r=this.$__pathRelativeToParent().replace(/\.$/,"");e.isDirectModified(r)||this.isNew||this.$__parent.markModified(n,this)};vr.prototype.isModified=function(t,e,n){let r=this.$parent();return r!=null?(Array.isArray(t)||typeof t=="string"?(t=Array.isArray(t)?t:t.split(" "),t=t.map(i=>this.$__pathRelativeToParent(i)).filter(i=>i!=null)):t||(t=this.$__pathRelativeToParent()),r.$isModified(t,e,n)):h1.prototype.isModified.call(this,t,e,n)};vr.prototype.$markValid=function(t){h1.prototype.$markValid.call(this,t);let e=this.$parent(),n=this.$__pathRelativeToParent(t);e!=null&&n!=null&&e.$markValid(n)};vr.prototype.invalidate=function(t,e,n){h1.prototype.invalidate.call(this,t,e,n);let r=this.$parent(),i=this.$__pathRelativeToParent(t);if(r!=null&&i!=null)r.invalidate(i,e,n);else if(e.kind==="cast"||e.name==="CastError"||i==null)throw e;return this.ownerDocument().$__.validationError};vr.prototype.$ignore=function(t){h1.prototype.$ignore.call(this,t);let e=this.$parent(),n=this.$__pathRelativeToParent(t);e!=null&&n!=null&&e.$ignore(n)};vr.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;let t=this,e=[],n=new Set([t]);for(;typeof t.$__pathRelativeToParent=="function";){e.unshift(t.$__pathRelativeToParent(void 0,!0));let r=t.$parent();if(r==null)break;if(t=r,n.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");n.add(t)}return this.$__.fullPath=e.join("."),this.$__.ownerDocument=t,this.$__.ownerDocument};vr.prototype.$__fullPathWithIndexes=function(){let t=this,e=[],n=new Set([t]);for(;typeof t.$__pathRelativeToParent=="function";){e.unshift(t.$__pathRelativeToParent(void 0,!1));let r=t.$parent();if(r==null)break;if(t=r,n.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");n.add(t)}return e.join(".")};vr.prototype.parent=function(){return this.$__parent};vr.prototype.$parent=vr.prototype.parent;vr.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)};vr.prototype.deleteOne=function(e){if(jPt(this),!e||!e.noop){this.$__removeFromParent();let n=this.ownerDocument();n.$__.removedSubdocs=n.$__.removedSubdocs||[],n.$__.removedSubdocs.push(this)}};vr.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')};vr.prototype.inspect=function(){return this.toObject()};vAe.inspect.custom&&(vr.prototype[vAe.inspect.custom]=vr.prototype.inspect);vr.prototype.$toObject=function(e,n){let r=h1.prototype.$toObject.call(this,e,n);if(!(Object.keys(r).length===0&&e?._calledWithOptions!=null&&(e._calledWithOptions?.minimize??this?.$__schemaTypeOptions?.minimize??e.minimize)&&!this.constructor.$__required))return r};function jPt(t){let e=t.ownerDocument();function n(){e.$removeListener("save",n),e.$removeListener("deleteOne",n),t.emit("deleteOne",t),t.constructor.emit("deleteOne",t)}e.$on("save",n),e.$on("deleteOne",n)}});var Ry=y((S0n,EAe)=>{"use strict";var AAe=Q("events").EventEmitter,wAe=RC(),VPt=Vt(),X9=ct().documentArrayParent;function go(t,e,n,r,i){VPt.isMongooseDocumentArray(e)?(this.__parentArray=e,this[X9]=e.$parent()):(this.__parentArray=void 0,this[X9]=void 0),this.$setIndex(i),this.$__parent=this[X9];let a;typeof n=="object"&&n!=null?(a={isNew:!0,...n},n=void 0):a={isNew:!0},wAe.call(this,t,r,this[X9],a)}go.prototype=Object.create(wAe.prototype);go.prototype.constructor=go;Object.defineProperty(go.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1});Object.defineProperty(go.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0});for(let t in AAe.prototype)go[t]=AAe.prototype[t];go.prototype.$setIndex=function(t){if(this.__index=t,this.$__!=null&&this.$__.validationError!=null){let e=Object.keys(this.$__.validationError.errors);for(let n of e)this.invalidate(n,this.$__.validationError.errors[n])}};go.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')};go.prototype.$__removeFromParent=function(){let t=this._doc._id;if(!t)throw new Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:t})};go.prototype.$__fullPath=function(t,e){return this.__index==null?null:(this.$__.fullPath||this.ownerDocument(),e?t?this.$__.fullPath+"."+t:this.$__.fullPath:t?this.$__.fullPath+"."+this.__index+"."+t:this.$__.fullPath+"."+this.__index)};go.prototype.$__pathRelativeToParent=function(t,e){return this.__index==null||!this.__parentArray||!this.__parentArray.$path?null:e?t==null?this.__parentArray.$path():this.__parentArray.$path()+"."+t:t==null?this.__parentArray.$path()+"."+this.__index:this.__parentArray.$path()+"."+this.__index+"."+t};go.prototype.$parent=function(){return this[X9]};go.prototype.parentArray=function(){return this.__parentArray};EAe.exports=go});var NC=y((x0n,PAe)=>{"use strict";var TG=El(),SG=Ry(),zPt=on(),SAe=xC(),HPt=Qr(),xAe=oc().internalToObjectOptions,OAe=s0(),us=Vt(),xG=Da(),m1=ct().arrayAtomicsSymbol,Jp=ct().arrayParentSymbol,Qp=ct().arrayPathSymbol,y1=ct().arraySchemaSymbol,IAe=ct().populateModelSymbol,WPt=Symbol("mongoose#Array#sliced"),TAe=Array.prototype.push;var DC={$__getAtomics(){let t=[],e=Object.keys(this[m1]||{}),n=e.length,r=Object.assign({},xAe,{_isNested:!0});if(n===0)return t[0]=["$set",this.toObject(r)],t;for(;n--;){let i=e[n],a=this[m1][i];us.isMongooseObject(a)?a=a.toObject(r):Array.isArray(a)?a=this.toObject.call(a,r):a!=null&&Array.isArray(a.$each)?a.$each=this.toObject.call(a.$each,r):a!=null&&typeof a.valueOf=="function"&&(a=a.valueOf()),i==="$addToSet"&&(a={$each:a}),t.push([i,a])}return t},$atomics(){return this[m1]},$parent(){return this[Jp]},$path(){return this[Qp]},$schemaType(){return this[y1]},$shift(){this._registerAtomic("$pop",-1),this._markModified();let t=this.__array;if(!t._shifted)return t._shifted=!0,[].shift.call(t)},$pop(){if(this._registerAtomic("$pop",1),this._markModified(),!this._popped)return this._popped=!0,[].pop.call(this)},$schema(){return this[y1]},_cast(t){let e=!1,n,r=this[Jp];if(r&&(e=r.$populated(this[Qp],!0)),e&&t!==null&&t!==void 0){if(n=e.options[IAe],n==null)throw new zPt("No populated model found for path `"+this[Qp]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");return(Buffer.isBuffer(t)||xG(t,"ObjectId")||!us.isObject(t))&&(t={_id:t}),t.schema&&t.schema.discriminatorMapping&&t.schema.discriminatorMapping.key!==void 0||(t=new n(t)),this[y1].embeddedSchemaType.applySetters(t,r,!0)}return this[y1].embeddedSchemaType.applySetters(t,r,!1)},_mapCast(t,e){return this._cast(t,this.length+e)},_markModified(t){let e=this[Jp],n;if(e){if(n=this[Qp],arguments.length&&(n=n+"."+t),n!=null&&n.endsWith(".$"))return this;e.markModified(n,arguments.length!==0?t:e)}return this},_registerAtomic(t,e){if(this[WPt])return;if(t==="$set")return this[m1]={$set:e},SAe(this[Jp],this[Qp]),this._markModified(),this;let n=this[m1];if(t==="$pop"&&!("$pop"in n)){let i=this;this[Jp].once("save",function(){i._popped=i._shifted=null})}if(n.$set||Object.keys(n).length&&!(t in n))return this[m1]={$set:this},this;let r;if(t==="$pullAll"||t==="$addToSet")n[t]||(n[t]=[]),n[t]=n[t].concat(e);else if(t==="$pullDocs"){let i=n.$pull||(n.$pull={});e[0]instanceof SG?(r=i.$or||(i.$or=[]),Array.prototype.push.apply(r,e.map(a=>a.toObject({transform:(s,o)=>(a==null||a.$__==null||Object.keys(a.$__.activePaths.getStatePaths("default")).forEach(f=>{OAe.unset(f,o),MAe(o,f)}),o),virtuals:!1})))):(r=i._id||(i._id={$in:[]}),r.$in=r.$in.concat(e))}else if(t==="$push")if(n.$push=n.$push||{$each:[]},e!=null&&us.hasUserDefinedProperty(e,"$each"))n.$push=e;else if(e.length===1)n.$push.$each.push(e[0]);else if(e.length<1e4)n.$push.$each.push(...e);else for(let i of e)n.$push.$each.push(i);else n[t]=e;return this},addToSet(){kC(this,arguments),CAe(this,arguments);let t=[].map.call(arguments,this._mapCast,this),e=[],n="";t[0]instanceof SG?n="doc":t[0]instanceof Date?n="date":xG(t[0],"ObjectId")&&(n="ObjectId");let r=us.isMongooseArray(t)?t.__array:t,i=us.isMongooseArray(this)?this.__array:this;return r.forEach(function(a){let s,o=+a;switch(n){case"doc":s=this.some(function(f){return f.equals(a)});break;case"date":s=this.some(function(f){return+f===o});break;case"ObjectId":s=this.find(f=>f.toString()===a.toString());break;default:s=~this.indexOf(a);break}s||(this._markModified(),i.push(a),this._registerAtomic("$addToSet",a),[].push.call(e,a))},this),e},hasAtomics(){return us.isPOJO(this[m1])?Object.keys(this[m1]).length:0},includes(t,e){return this.indexOf(t,e)!==-1},indexOf(t,e){xG(t,"ObjectId")&&(t=t.toString()),e=e??0;let n=this.length;for(let r=e;r<n;++r)if(t==this[r])return r;return-1},inspect(){return JSON.stringify(this)},nonAtomicPush(){let t=[].map.call(arguments,this._mapCast,this);this._markModified();let e=[].push.apply(this,t);return this._registerAtomic("$set",this),e},pop(){this._markModified();let t=[].pop.call(this);return this._registerAtomic("$set",this),t},pull(){let t=[].map.call(arguments,(i,a)=>this._cast(i,a,{defaults:!1}),this),e=this;us.isMongooseArray(e)&&(e=e.__array);let n=e.length,r;for(this._markModified();n--;)r=e[n],r instanceof TG?t.some(function(a){return r.equals(a)})&&e.splice(n,1):~this.indexOf.call(t,r)&&e.splice(n,1);return t[0]instanceof SG?this._registerAtomic("$pullDocs",t.map(function(i){let a=i.$__getValue("_id");return a===void 0||i.$isDefault("_id")?i:a})):this._registerAtomic("$pullAll",t),SAe(this[Jp],this[Qp])>0&&this._registerAtomic("$set",this),this},push(){let t=arguments,e=t,n=t[0]!=null&&us.hasUserDefinedProperty(t[0],"$each"),r=us.isMongooseArray(this)?this.__array:this;if(n&&(e=t[0],t=t[0].$each),this[y1]==null)return TAe.apply(this,t);kC(this,t),CAe(this,t),t=[].map.call(t,this._mapCast,this);let i,a=this[m1];return this._markModified(),n?(e.$each=t,(a.$push&&a.$push.$each&&a.$push.$each.length||0)!==0&&a.$push.$position!=e.$position?(e.$position!=null?([].splice.apply(r,[e.$position,0].concat(t)),i=r.length):i=[].push.apply(r,t),this._registerAtomic("$set",this)):e.$position!=null?([].splice.apply(r,[e.$position,0].concat(t)),i=this.length):i=[].push.apply(r,t)):(e=t,i=TAe.apply(r,t)),this._registerAtomic("$push",e),i},remove(){return this.pull.apply(this,arguments)},set(t,e,n){let r=this.__array;if(n)return r[t]=e,this;let i=DC._cast.call(this,e,t);return DC._markModified.call(this,t),r[t]=i,this},shift(){let t=us.isMongooseArray(this)?this.__array:this;this._markModified();let e=[].shift.call(t);return this._registerAtomic("$set",this),e},sort(){let t=us.isMongooseArray(this)?this.__array:this,e=[].sort.apply(t,arguments);return this._registerAtomic("$set",this),e},splice(){let t,e=us.isMongooseArray(this)?this.__array:this;if(this._markModified(),kC(this,Array.prototype.slice.call(arguments,2)),arguments.length){let n;if(this[y1]==null)n=arguments;else{n=[];for(let r=0;r<arguments.length;++r)n[r]=r<2?arguments[r]:this._cast(arguments[r],arguments[0]+(r-2))}t=[].splice.apply(e,n),this._registerAtomic("$set",this)}return t},toBSON(){return this.toObject(xAe)},toObject(t){let e=us.isMongooseArray(this)?this.__array:this;return t&&t.depopulate?(t=HPt(t),t._isNested=!0,[].concat(e).map(function(n){return n instanceof TG?n.toObject(t):n})):[].concat(e)},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift(){kC(this,arguments);let t;this[y1]==null?t=arguments:t=[].map.call(arguments,this._cast,this);let e=us.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(e,t),this._registerAtomic("$set",this),this.length}};function GPt(t,e){if(!e)return!1;for(let n of t){if(n==null)return!1;let r=n.constructor;if(!(n instanceof TG)||r.modelName!==e&&r.baseModelName!==e)return!1}return!0}function MAe(t,e,n){if(typeof e=="string"){if(e.indexOf(".")===-1)return;e=OAe.stringToParts(e)}n=n||0,!(n>=e.length)&&(t==null||typeof t!="object"||(MAe(t[e[0]],e,n+1),t[e[0]]!=null&&typeof t[e[0]]=="object"&&Object.keys(t[e[0]]).length===0&&delete t[e[0]]))}function kC(t,e){let n=t==null?null:t[y1]?.embeddedSchemaType?.options?.ref||null;t.length===0&&e.length!==0&&GPt(e,n)&&t[Jp].$populated(t[Qp],[],{[IAe]:e[0].constructor})}function CAe(t,e){let n=t==null?null:t[y1]?.embeddedSchemaType?.options?.ref||null,r=t[Jp],i=t[Qp];if(!(!n||!r.populated(i))){for(let a of e)if(a!=null&&(typeof a!="object"||a instanceof String||a instanceof Number||a instanceof Buffer||us.isMongooseType(a))){r.depopulate(i);break}}}var KPt=["filter","flat","flatMap","map","slice"];for(let t of KPt)Array.prototype[t]!=null&&(DC[t]=function(){let e=us.isMongooseArray(this)?this.__array:this,n=[].concat(e);return n[t].apply(n,arguments)});PAe.exports=DC});var OG=y(($Ae,BAe)=>{"use strict";var CG=NC(),$C=ct().arrayAtomicsSymbol,YPt=ct().arrayAtomicsBackupSymbol,RAe=ct().arrayParentSymbol,ZPt=ct().arrayPathSymbol,kAe=ct().arraySchemaSymbol,DAe=Array.prototype.push,NAe=/^\d+$/;function XPt(t,e,n,r){let i;if(Array.isArray(t)){let o=t.length;if(o===0)i=new Array;else if(o===1)i=new Array(1),i[0]=t[0];else if(o<1e4)i=new Array,DAe.apply(i,t);else{i=new Array;for(let f=0;f<o;++f)DAe.call(i,t[f])}}else i=[];let a={[$C]:{},[YPt]:void 0,[ZPt]:e,[kAe]:r,[RAe]:void 0,isMongooseArray:!0,isMongooseArrayProxy:!0,__array:i};t&&t[$C]!=null&&(a[$C]=t[$C]),n!=null&&n.$__&&(a[RAe]=n,a[kAe]=r||n.schema.path(e));let s=new Proxy(i,{get:function(o,f){return a.hasOwnProperty(f)?a[f]:CG.hasOwnProperty(f)?CG[f]:r&&r.virtuals&&r.virtuals.hasOwnProperty(f)?r.virtuals[f].applyGetters(void 0,o):typeof f=="string"&&NAe.test(f)&&r?.embeddedSchemaType!=null?r.embeddedSchemaType.applyGetters(i[f],n):i[f]},set:function(o,f,u){return typeof f=="string"&&NAe.test(f)?CG.set.call(s,f,u,!1):a.hasOwnProperty(f)?a[f]=u:r&&r.virtuals&&r.virtuals.hasOwnProperty(f)?r.virtuals[f].applySetters(u,o):i[f]=u,!0}});return s}BAe.exports=$Ae=XPt});var UAe=y((T0n,qAe)=>{"use strict";var BC=NC(),JPt=El(),FAe=W0(),QPt=oc().internalToObjectOptions,tm=Vt(),eRt=Da(),LC=ct().arrayParentSymbol,IG=ct().arrayPathSymbol,J9=ct().arraySchemaSymbol,LAe=ct().documentArrayParent,tRt=Array.prototype.toString,MG={toBSON(){return this.toObject(QPt)},toString(){return tRt.call(this.__array.map(t=>t!=null&&t.$__!=null?t.toString():t))},getArrayParent(){return this[LC]},$schemaType(){return this[J9]},_cast(t,e,n){if(this[J9]==null)return t;let r=this[J9].Constructor;if((r.$isMongooseDocumentArray?tm.isMongooseDocumentArray(t):t instanceof r)||t&&t.constructor&&t.constructor.baseCasterConstructor===r)return t[LAe]&&t.__parentArray||(t[LAe]=this[LC],t.__parentArray=this),t.$setIndex(e),t;if(t==null)return null;if((Buffer.isBuffer(t)||eRt(t,"ObjectId")||!tm.isObject(t))&&(t={_id:t}),t&&r.discriminators&&r.schema&&r.schema.options&&r.schema.options.discriminatorKey)if(typeof t[r.schema.options.discriminatorKey]=="string"&&r.discriminators[t[r.schema.options.discriminatorKey]])r=r.discriminators[t[r.schema.options.discriminatorKey]];else{let s=FAe(r.discriminators,t[r.schema.options.discriminatorKey]);s&&(r=s)}if(r.$isMongooseDocumentArray)return r.cast(t,this,void 0,void 0,e);let a=new r(t,this,n,void 0,e);return a.isNew=!0,a},id(t){if(t==null)return null;let e=this[J9],n=null;e&&e.schema?n=e.schema.path("_id"):e&&e.casterConstructor&&e.casterConstructor.schema&&(n=e.casterConstructor.schema.path("_id"));let r=null;if(n)try{r=n.cast(t)}catch{}let i;for(let a of this)if(a&&(i=a.get("_id"),i!=null))if(i instanceof JPt){if(i=i.get("_id"),r!=null&&tm.deepEqual(r,i))return a;if(r==null&&(t==i||tm.deepEqual(t,i)))return a}else{if(r!=null&&tm.deepEqual(r,i))return a;if(r==null&&(i==t||tm.deepEqual(t,i)))return a}return null},toObject(t){return[].concat(this.map(function(e){return e==null?null:typeof e.toObject!="function"?e:e.toObject(t)}))},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},push(){let t=BC.push.apply(this,arguments);return FC(this),t},pull(){let t=BC.pull.apply(this,arguments);return FC(this),t},shift(){let t=BC.shift.apply(this,arguments);return FC(this),t},splice(){let t=BC.splice.apply(this,arguments);return FC(this),t},inspect(){return this.toObject()},create(t){let e=this[J9].Constructor;if(t&&e.discriminators&&e.schema&&e.schema.options&&e.schema.options.discriminatorKey)if(typeof t[e.schema.options.discriminatorKey]=="string"&&e.discriminators[t[e.schema.options.discriminatorKey]])e=e.discriminators[t[e.schema.options.discriminatorKey]];else{let n=FAe(e.discriminators,t[e.schema.options.discriminatorKey]);n&&(e=n)}return new e(t,this)},notify(t){let e=this;return function n(r,i){i=i||e;let a=i.length;for(;a--;)if(i[a]!=null){switch(t){case"save":r=e[a];break;default:break}tm.isMongooseArray(i[a])?n(r,i[a]):i[a]&&i[a].emit(t,r)}}},set(t,e,n){let r=this.__array;if(n)return r[t]=e,this;let i=MG._cast.call(this,e,t);return MG._markModified.call(this,t),r[t]=i,this},_markModified(t,e){let n=this[LC],r;if(n){if(r=this[IG],arguments.length)if(e!=null){let i=t.__index;r=r+"."+i+"."+e}else r=r+"."+t;if(r!=null&&r.endsWith(".$"))return this;n.markModified(r,arguments.length!==0?t:n)}return this}};qAe.exports=MG;function FC(t){let e=t[LC];if(!e||e.$__.populated==null)return;let n=Object.keys(e.$__.populated).filter(r=>r.startsWith(t[IG]+"."));for(let r of n){let i=r.slice((t[IG]+".").length);Array.isArray(e.$__.populated[r].value)&&(e.$__.populated[r].value=t.map(a=>a.$populated(i)))}}});var rm=y((C0n,VAe)=>{"use strict";var jAe=NC(),PG=UAe(),RG=ct().arrayAtomicsSymbol,nRt=ct().arrayAtomicsBackupSymbol,kG=ct().arrayParentSymbol,DG=ct().arrayPathSymbol,nm=ct().arraySchemaSymbol,rRt=Array.prototype.push,iRt=/^\d+$/;function aRt(t,e,n,r){let i=[],a={[RG]:{},[nRt]:void 0,[DG]:e,[nm]:void 0,[kG]:void 0};if(Array.isArray(t)&&(t[DG]===e&&t[kG]===n&&(a[RG]=Object.assign({},t[RG])),t.forEach(o=>{rRt.call(i,o)})),a[DG]=e,a.__array=i,n&&n.$__)for(a[kG]=n,a[nm]=n.$__schema.path(e);a[nm]!=null&&a[nm].$isMongooseArray&&!a[nm].$isMongooseDocumentArray;)a[nm]=a[nm].embeddedSchemaType;let s=new Proxy(i,{get:function(o,f){return f==="isMongooseArray"||f==="isMongooseArrayProxy"||f==="isMongooseDocumentArray"||f==="isMongooseDocumentArrayProxy"?!0:a.hasOwnProperty(f)?a[f]:PG.hasOwnProperty(f)?PG[f]:r&&r.virtuals&&r.virtuals.hasOwnProperty(f)?r.virtuals[f].applyGetters(void 0,o):jAe.hasOwnProperty(f)?jAe[f]:i[f]},set:function(o,f,u){return typeof f=="string"&&iRt.test(f)?PG.set.call(s,f,u,!1):a.hasOwnProperty(f)?a[f]=u:r&&r.virtuals&&r.virtuals.hasOwnProperty(f)?r.virtuals[f].applySetters(u,o):i[f]=u,!0}});return s}VAe.exports=aRt});var El=y((owe,fwe)=>{"use strict";var sRt=sG(),$G=Q("events").EventEmitter,oRt=v_e(),fRt=bC(),vo=i0(),zAe=Oy(),uRt=x_e(),XAe=_C(),cRt=wC(),lRt=I_e(),dRt=im(),BG=Xp(),zC=Jh(),JAe=eG(),QAe=pG(),FG=SC(),qC=xC(),uc=Qr(),pRt=CC().compile,hRt=CC().defineKey,mRt=q_e(),yRt=OC().flatten,NG=X_e(),HAe=Q_e(),bRt=tAe(),gRt=MC(),WAe=Da(),ewe=My(),vRt=Py(),GAe=vG(),LG=Q("util").inspect,twe=oc().internalToObjectOptions,_Rt=_G(),ARt=AG(),wRt=s0(),qG=wG(),ERt=Z9(),Jt=Vt(),SRt=EG(),jC=Jt.deepEqual,xRt=Jt.isMongooseObject,e7=ct().arrayAtomicsBackupSymbol,$s=ct().arrayAtomicsSymbol,TRt=ct().documentArrayParent,CRt=ct().documentIsModified,nwe=ct().documentModifiedPaths,ORt=ct().documentSchemaSymbol,IRt=ct().getSymbol,MRt=ct().modelSymbol,KAe=ct().populateModelSymbol,PRt=ct().scopeSymbol,RRt=Qh().schemaMixedSymbol,kRt=gAe(),UC=ct().sessionNewDocuments,VC,YAe,Q9,rwe=Jt.specialProperties,t7=1,UG=2,b1=t7|UG;function ue(t,e,n){if(typeof n=="boolean")throw new Error("The skipId parameter has been removed. Use { skipId: true } in the options parameter instead.");n=Object.assign({},n);let r=n.skipId;if(this.$__=new oRt,this.$__schema==null){let u=Jt.isObject(e)&&!e.instanceOfSchema?new dRt(e):e;this.$__setSchema(u),e=n,r=n.skipId}if(n.isNew!=null&&n.isNew!==!0&&(this.$isNew=n.isNew),n.priorDoc!=null&&(this.$__.priorDoc=n.priorDoc),r&&(this.$__.skipId=r),t!=null&&typeof t!="object")throw new cRt(t,"obj","Document");let i=!0;n.defaults!==void 0&&(this.$__.defaults=n.defaults,i=n.defaults);let a=this.$__schema;typeof e=="boolean"||e==="throw"?(e!==!0&&(this.$__.strictMode=e),e=void 0):a.options.strict!==!0&&(this.$__.strictMode=a.options.strict);let s=a.requiredPaths(!0);for(let u of s)this.$__.activePaths.require(u);let o=null;Jt.isPOJO(e)&&Object.keys(e).length>0&&(o=vRt(e),this.$__.selected=e,this.$__.exclude=o);let f=o===!1&&e?QAe(e):null;if(this._doc==null&&(this.$__buildDoc(t,e,r,o,f,!1),i&&FG(this,e,o,f,!0,null,{skipParentChangeTracking:!0})),t&&(this.$__original_set?this.$__original_set(t,void 0,!0,n):this.$set(t,void 0,!0,n),t instanceof ue&&(this.$isNew=t.$isNew)),n.willInit&&i?n.skipDefaults&&(this.$__.skipDefaults=n.skipDefaults):i&&FG(this,e,o,f,!1,n.skipDefaults),!this.$__.strictMode&&t){let u=this;Object.keys(this._doc).forEach(function(d){!(d in a.tree)&&!(d in a.methods)&&!(d in a.virtuals)&&!d.startsWith("$")&&hRt({prop:d,subprops:null,prototype:u})})}jRt(this)}ue.prototype.$isMongooseDocumentPrototype=!0;Object.defineProperty(ue.prototype,"isNew",{get:function(){return this.$isNew},set:function(t){this.$isNew=t}});Object.defineProperty(ue.prototype,"errors",{get:function(){return this.$errors},set:function(t){this.$errors=t}});ue.prototype.$isNew=!0;Jt.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(t){ue.prototype[t]=function(){if(!this.$__.emitter){if(t==="emit")return;this.$__.emitter=new $G,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[t].apply(this.$__.emitter,arguments)},ue.prototype[`$${t}`]=ue.prototype[t]});ue.prototype.constructor=ue;for(let t in $G.prototype)ue[t]=$G.prototype[t];ue.prototype.$__schema;ue.prototype.schema;Object.defineProperty(ue.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){return this.$__.locals==null&&(this.$__.locals={}),this.$__.locals},set:function(t){this.$__.locals=t}});ue.prototype.isNew;Object.defineProperty(ue.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0});ue.prototype.id;ue.prototype.$errors;Object.defineProperty(ue.prototype,"$op",{get:function(){return this.$__.op||null},set:function(t){this.$__.op=t}});function DRt(t,e,n){if(t==null)return;let r=Object.keys(n.$__schema.paths),i=r.length,a=e.indexOf(".")===-1?[e]:e.split(".");for(let s=0;s<i;++s){let o="",f=r[s];if(!f.startsWith(e+"."))continue;let u=n.$__schema.paths[f],c=u.splitPath().slice(a.length),d=c.length;if(u.defaultValue===void 0)continue;let l=t;for(let p=0;p<d&&l!=null;++p){let h=c[p];if(p===d-1){if(l[h]!==void 0)break;try{let v=u.getDefault(n,!1);v!==void 0&&(l[h]=v)}catch(v){n.invalidate(e+"."+o,v);break}break}o+=(o.length?".":"")+h,l[h]=l[h]||{},l=l[h]}}}ue.prototype.$__buildDoc=function(t,e,n,r,i){let a={},s=Object.keys(this.$__schema.paths).filter(u=>!u.includes("$*")),o=s.length,f=0;for(;f<o;++f){let u=s[f];if(u==="_id"&&(n||t&&"_id"in t))continue;let c=this.$__schema.paths[u].splitPath(),d=c.length,l=d-1,p="",h=a,v=!1;for(let E=0;E<d;++E){let M=c[E];if(p.length?p+="."+M:p=M,r===!0){if(p in e)break}else if(r===!1&&e&&!v){if(p in e)v=!0;else if(!i[p])break}E<l&&(h=h[M]||(h[M]={}))}}this._doc=a};ue.prototype.toBSON=function(){return this.toObject(twe)};ue.prototype.init=function(t,e,n){return typeof e=="function"&&(n=e,e=null),this.$__init(t,e),n&&n(null,this),this};ue.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)};ue.prototype.$__init=function(t,e){if(this.$isNew=!1,e=e||{},t._id!=null&&e.populated&&e.populated.length){let r=String(t._id);for(let i of e.populated)if(i.isVirtual?this.$populated(i.path,Jt.getValue(i.path,t),i):this.$populated(i.path,i._docs[r],i),i._childDocs!=null){for(let a of i._childDocs)a==null||a.$__==null||(a.$__.parent=this);i._childDocs=[]}}iwe(this,t,this._doc,e),_Rt(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this);let n=this.$__.exclude===!1&&this.$__.selected?QAe(this.$__.selected):null;return FG(this,this.$__.selected,this.$__.exclude,n,!1,this.$__.skipDefaults),this};function iwe(t,e,n,r,i){if(i=i||"",typeof e!="object"||Array.isArray(e))throw new XAe(t.$basePath,e);e.$__!=null&&(e=e._doc);let a=Object.keys(e),s=a.length,o,f,u,c=t.$__.strictMode,d=t.$__schema;for(let l=0;l<s;++l){if(u=a[l],rwe.has(u)||(f=i?i+u:u,o=d.path(f),d.$isRootDiscriminator&&!t.$__isSelected(f)))continue;let p=e[u];if(!o&&Jt.isPOJO(p))n[u]||(n[u]={},(!c&&!(u in d.tree)&&!(u in d.methods)&&!(u in d.virtuals)||r?.virtuals&&u in d.virtuals)&&(t[u]=n[u])),iwe(t,p,n[u],r,f+".");else if(!o)n[u]=p,(!c&&!i||r?.virtuals&&u in d.virtuals)&&(t[u]=p);else{if(n.hasOwnProperty(u)&&p!==void 0&&!r.hydratedPopulatedDocs&&delete n[u],p===null)n[u]=o._castNullish(null);else if(p!==void 0){let h=p.$__==null?null:p.$__.wasPopulated;if(o&&!h&&!r.hydratedPopulatedDocs)try{r&&r.setters?n[u]=o.applySetters(p,t,!1,null,r):n[u]=o.cast(p,t,!0,void 0,r)}catch(v){t.invalidate(v.path,new JAe({path:v.path,message:v.message,type:"cast",value:v.value,reason:v}))}else o&&r.hydratedPopulatedDocs?(n[u]=o.cast(p,t,!0,void 0,{hydratedPopulatedDocs:!0}),n[u]&&n[u].$__&&n[u].$__.wasPopulated?t.$populated(f,n[u].$__.wasPopulated.value,n[u].$__.wasPopulated.options):Array.isArray(n[u])&&n[u].length&&n[u][0]?.$__?.wasPopulated&&t.$populated(f,n[u].map(v=>v?.$__?.wasPopulated?.value).filter(v=>v!=null),n[u][0].$__.wasPopulated.options)):n[u]=p}t.$isModified(f)||t.$__.activePaths.init(f)}}}ue.prototype.updateOne=function(e,n){let r=this.constructor.updateOne({_id:this._doc._id},e,n),i=this;return r.pre(async function(){let s=await i._execDocumentPreHooks("updateOne",i);if(s?.length!==1||s[0]!==i)throw new Error("Document updateOne pre hooks cannot overwrite arguments");return i.$where!=null&&this.where(i.$where),s}),r.post(function(){return i._execDocumentPostHooks("updateOne")}),this.$session()!=null&&("session"in r.options||(r.options.session=this.$session())),r};ue.prototype.replaceOne=function(){let e=[...arguments];return e.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,e)};ue.prototype.$session=function(e){if(arguments.length===0)return this.$__.session!=null&&this.$__.session.hasEnded?(this.$__.session=null,null):this.$__.session;if(e!=null&&e.hasEnded)throw new vo("Cannot set a document's session to a session that has ended. Make sure you haven't called `endSession()` on the session you are passing to `$session()`.");if(!(e==null&&this.$__.session==null)){if(this.$__.session=e,!this.$isSubdocument){let n=this.$getAllSubdocs();for(let r of n)r.$session(e)}return e}};ue.prototype.$timestamps=function(e){if(arguments.length===0)return this.$__.timestamps!=null?this.$__.timestamps:this.$__schema?this.$__schema.options.timestamps:void 0;let n=this.$timestamps();return e!==n&&(this.$__.timestamps=e),this};ue.prototype.overwrite=function(e){let n=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(e))));for(let r of n)r!=="_id"&&(this.$__schema.options.versionKey&&r===this.$__schema.options.versionKey||this.$__schema.options.discriminatorKey&&r===this.$__schema.options.discriminatorKey||this.$set(r,e[r]));return this};ue.prototype.$set=function(e,n,r,i){Jt.isPOJO(r)&&(i=r,r=void 0);let a=i&&i.merge,s=r&&r!==!0,o=r===!0,f,u,c=0,d,l,p,h=i&&"strict"in i,v=h?i.strict:this.$__.strictMode;if(s&&(f=this.$__.adhocPaths||(this.$__.adhocPaths={}),f[e]=this.$__schema.interpretAsType(e,r,this.$__schema.options)),e==null)[e,n]=[n,e];else if(typeof e!="string"){e instanceof ue&&(e.$__isNested?e=e.toObject():e=e.$__schema===this.$__schema?jG(e,{...e._doc}):e._doc),e==null&&([e,n]=[n,e]),p=n?n+".":"",u=HAe(this.$__schema,e);let Y=u.length,W=i&&i._skipMinimizeTopLevel||!1;if(Y===0&&W)return delete i._skipMinimizeTopLevel,n&&this.$set(n,{}),this;i=Object.assign({},i,{_skipMinimizeTopLevel:!1});for(let C=0;C<Y;++C){l=u[C];let x=p?p+l:l;d=this.$__schema.pathType(x);let b=e[l];if(r===!0&&!p&&b!=null&&d==="nested"&&this._doc[l]!=null&&delete this._doc[l],Jt.isNonBuiltinObject(b)&&d==="nested"){this.$set(x,b,o,i),DRt(this.$get(x),x,this);continue}else if(v){if(o&&b===void 0&&this.$get(x)!==void 0)continue;if(d==="adhocOrUndefined"&&(d=NG(this,x,{typeOnly:!0})),d==="real"||d==="virtual")this.$set(x,b,o,i);else if(d==="nested"&&b instanceof ue)this.$set(x,b.toObject({transform:!1}),o,i);else{if(v==="throw")throw d==="nested"?new XAe(l,b):new BG(l);d==="nested"&&b==null&&this.$set(x,b,o,i)}}else this.$set(x,b,o,i)}let B={},_=Object.keys(this.$__schema.tree);for(let C=0,x=_.length;C<x;++C)(l=_[C])&&this._doc.hasOwnProperty(l)&&(B[l]=void 0);return this._doc=Object.assign(B,this._doc),this}let E=this.$__schema.pathType(e),M=null;if(E==="adhocOrUndefined"&&(M=e.indexOf(".")===-1?[e]:e.split("."),E=NG(this,M,{typeOnly:!0})),E==="adhocOrUndefined"&&!h){M==null&&(M=e.indexOf(".")===-1?[e]:e.split("."));let Y=bRt(this.$__schema,M);Y!==void 0&&(v=Y)}n=gRt(n,!0);let D=(()=>{if(this.$__.priorDoc!=null)return this.$__.priorDoc.$__getValue(e);if(!o)return this.$__getValue(e)})();if(E==="nested"&&n){if(typeof n=="object"&&n!=null){if(n.$__!=null&&(n=n.toObject(twe)),n==null)return this.invalidate(e,new vo.CastError("Object",n,e)),this;let Y=this.$isModified(e),W=this.$__.savedState!=null&&this.$__.savedState.hasOwnProperty(e);if(this.$__.savedState!=null&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(e)){let _=this.$__getValue(e);this.$__.savedState[e]=_;let C=Object.keys(_||{});for(let x of C)this.$__.savedState[e+"."+x]=_[x]}if(!a)this.$__setValue(e,null),qC(this,e);else return this.$set(n,e,o,i);let B=HAe(this.$__schema,n,e);this.$__setValue(e,{});for(let _ of B)this.$set(e+"."+_,n[_],o,{...i,_skipMarkModified:!0});return D!=null&&(!Y||W)&&Jt.deepEqual(W?this.$__.savedState[e]:D,n)?this.unmarkModified(e):this.markModified(e),this}return this.invalidate(e,new vo.CastError("Object",n,e)),this}let $;if(M==null&&(M=e.indexOf(".")===-1?[e]:e.split(".")),typeof this.$__schema.aliases[M[0]]=="string"&&(M[0]=this.$__schema.aliases[M[0]]),E==="adhocOrUndefined"&&v){let Y;for(c=0;c<M.length;++c){let W=M.slice(0,c+1).join(".");if(c+1<M.length&&this.$__schema.pathType(W)==="virtual")return wRt.set(e,n,this),this;if($=this.$__schema.path(W),$!=null){if($ instanceof zAe){Y=!0;break}else if($.$isSchemaMap&&$.$__schemaType instanceof zAe&&c<M.length-1){Y=!0,$=$.$__schemaType;break}}}if($==null&&($=NG(this,e)),!Y&&!$){if(v==="throw")throw new BG(e);return this}}else{if(E==="virtual")return $=this.$__schema.virtualpath(e),$.applySetters(n,this),this;$=this.$__path(e)}let N=this._doc,V="";for(c=0;c<M.length-1;++c)N=N instanceof Map?N.get(M[c]):N[M[c]],V+=(V.length!==0?".":"")+M[c],N||(this.$set(V,{}),this.$__isSelected(V)||this.unmarkModified(V),N=this.$__getValue(V));let j;if(M.length<=1)j=e;else{let Y=M.length;for(c=0;c<Y;++c){let W=M.slice(0,c+1).join(".");if(this.$get(W,null,{getters:!1})===null){j=W;break}}j||(j=e)}if(!$)return this.$__set(j,e,i,o,M,$,n,D),E==="nested"&&n==null&&qC(this,e),this;if(($.$isSingleNested||$.$isMongooseArray)&&qRt(this,e),n!=null&&a&&$.$isSingleNested){n instanceof ue&&(n=n.toObject({virtuals:!1,transform:!1}));let Y=Object.keys(n);for(let W of Y)this.$set(e+"."+W,n[W],o,i);return this}let K=!0;try{let Y=(()=>{if($.options==null||!(n instanceof ue))return!1;let C=n.constructor,x=typeof $.options.ref=="function"&&!$.options.ref[MRt]?$.options.ref.call(this,this):$.options.ref,b=x?.modelName||x;if(b!=null&&(b===C.modelName||b===C.baseModelName))return!0;let w=$.options.refPath;if(w==null)return!1;let S=n.get(w);return S===C.modelName||S===C.baseModelName})(),W=!1;if(Y&&n instanceof ue&&(!n.$__.wasPopulated||Jt.deepEqual(n.$__.wasPopulated.value,n._doc._id))){let C=$&&$.$isSingleNested?$.cast(n,this):n._doc._id;this.$populated(e,C,{[KAe]:n.constructor}),n.$__.wasPopulated={value:C},W=!0}let B,_=this.$__schema.options.typeKey;if($.options&&Array.isArray($.options[_])&&$.options[_].length&&$.options[_][0]&&$.options[_][0].ref&&NRt(n,$.options[_][0].ref)){B={[KAe]:n[0].constructor},this.$populated(e,n.map(function(C){return C._doc._id}),B);for(let C of n)C.$__.wasPopulated={value:C._doc._id};W=!0}if(!Y||!$.$isSingleNested||!n.$__){let C=this;this.$__schema.singleNestedPaths[e]!=null&&M.length>1&&(C=kRt(this,M,this.schema)),i!=null&&i.overwriteImmutable?n=$.applySetters(n,C,!1,D,{path:e,overwriteImmutable:!0}):n=$.applySetters(n,C,!1,D,{path:e})}if(Array.isArray(n)&&!Array.isArray($)&&$.$isMongooseDocumentArray&&n.length!==0&&n[0]!=null&&n[0].$__!=null&&n[0].$__.populated!=null){let C=Object.keys(n[0].$__.populated);for(let x of C)this.$populated(e+"."+x,n.map(b=>b.$populated(x)),n[0].$__.populated[x].options);W=!0}if(!W&&this.$__.populated){if(Array.isArray(n)&&this.$__.populated[e])for(let C=0;C<n.length;++C)n[C]instanceof ue&&n.set(C,n[C]._doc._id,!0);delete this.$__.populated[e]}n!=null&&$.$isSingleNested&&URt(n,$,D),this.$markValid(e)}catch(Y){Y instanceof vo.StrictModeError&&Y.isImmutableError?this.invalidate(e,Y):Y instanceof vo.CastError?(this.invalidate(Y.path,Y),Y.$originalErrorPath&&this.invalidate(e,new vo.CastError($.instance,n,e,Y.$originalErrorPath))):this.invalidate(e,new vo.CastError($.instance,n,e,Y)),K=!1}if(K){let Y=null,W=null;if(!o){let C=this.$isSubdocument?this.ownerDocument():this;Y=C.$__.savedState,W=this.$isSubdocument?this.$__.fullPath+"."+e:e,C.$__saveInitialState(W)}this.$__set(j,e,i,o,M,$,n,D);let B=!!this.$__.session?.transaction,_=this.$__.session&&this.$__.session[UC]&&this.$__.session[UC].has(this)&&this.$__.session[UC].get(this).modifiedPaths&&!this.$__.session[UC].get(this).modifiedPaths.has(W);Y!=null&&Y.hasOwnProperty(W)&&(!B||_)&&Jt.deepEqual(n,Y[W])&&this.unmarkModified(e)}return $.$isSingleNested&&(this.isDirectModified(e)||n==null)?qC(this,e):$.$isSchemaMap&&n==null&&qC(this,e),this};function NRt(t,e){if(!Array.isArray(t)||t.length===0)return!1;for(let n of t)if(!(n instanceof ue)||n.constructor.modelName==null||n.constructor.modelName!=e&&n.constructor.baseModelName!=e)return!1;return!0}ue.prototype.set=ue.prototype.$set;ue.prototype.$__shouldModify=function(t,e,n,r,i,a,s,o){return n&&n._skipMarkModified?!1:this.$isNew||e in this.$__.activePaths.getStatePaths("modify")||s===void 0&&!this.$__isSelected(e)?!0:s===void 0&&e in this.$__.activePaths.getStatePaths("default")||this.$populated(e)&&s instanceof ue&&jC(s._doc._id,o)?!1:!!(!jC(s,o!==void 0?o:Jt.getValue(e,this))||!r&&s!==null&&s!==void 0&&e in this.$__.activePaths.getStatePaths("default")&&jC(s,a.getDefault(this,r)))};ue.prototype.$__set=function(t,e,n,r,i,a,s,o){Q9=Q9||Ry();let f=this.$__shouldModify(t,e,n,r,i,a,s,o);f?(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[e]&&(delete this.$__.primitiveAtomics[e],Object.keys(this.$__.primitiveAtomics).length===0&&delete this.$__.primitiveAtomics),this.markModified(t),YAe||(YAe=OG()),s&&Jt.isMongooseArray(s)&&(s._registerAtomic("$set",s),Jt.isMongooseDocumentArray(s)&&s.forEach(function(p){p&&p.__parentArray&&(p.__parentArray=s)}))):Array.isArray(s)&&Array.isArray(o)&&Jt.isMongooseArray(s)&&Jt.isMongooseArray(o)&&(s[$s]=o[$s],s[e7]=o[e7],Jt.isMongooseDocumentArray(s)&&s.forEach(p=>{p!=null&&(p.$isNew=!1)}));let u=this._doc,c=0,d=i.length,l="";for(;c<d;c++){let h=c+1===d;if(l+=l?"."+i[c]:i[c],!rwe.has(i[c]))if(h)u instanceof Map?u.set(i[c],s):u.$isSingleNested?(i[c]in u||(u[i[c]]=s),u._doc[i[c]]=s,f&&u.markModified(i[c])):u[i[c]]=s;else{let v=u instanceof Map,E=v?u.get(i[c]):u[i[c]];Jt.isPOJO(E)||E&&E instanceof Q9||E&&!Array.isArray(E)&&E.$isSingleNested||E&&Array.isArray(E)||E==null&&(E={},v?u.set(i[c],E):u[i[c]]=E),u=E}}};ue.prototype.$__getValue=function(t){if(typeof t!="string"&&!Array.isArray(t))throw new TypeError(`Invalid \`path\`. Must be either string or array. Got "${t}" (type ${typeof t})`);return Jt.getValue(t,this._doc)};ue.prototype.$inc=function(e,n){if(n==null&&(n=1),Array.isArray(e))return e.forEach(f=>this.$inc(f,n)),this;let r=this.$__path(e);if(r==null){if(this.$__.strictMode==="throw")throw new BG(e);if(this.$__.strictMode===!0)return this}else if(r.instance!=="Number")return this.invalidate(e,new vo.CastError(r.instance,n,e)),this;let i=this.$__getValue(e)||0,a=!1,s=null,o=n;try{n=r.cast(n),s=r.applySetters(i+n,this),o=s-i,a=!0}catch(f){this.invalidate(e,new vo.CastError("number",n,e,f))}return a&&(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},this.$__.primitiveAtomics[e]==null?this.$__.primitiveAtomics[e]={$inc:o}:this.$__.primitiveAtomics[e].$inc+=o,this.markModified(e),this.$__setValue(e,s)),this};ue.prototype.$__setValue=function(t,e){return Jt.setValue(t,e,this._doc),this};ue.prototype.get=function(t,e,n){let r;n==null&&(n={}),e&&(r=this.$__schema.interpretAsType(t,e,this.$__schema.options));let i=n.noDottedPath,a=i?this.$__schema.paths[t]:this.$__path(t);if(a==null&&(a=this.$__schema.virtualpath(t),a!=null))return a.applyGetters(void 0,this);if(i){let u=this._doc[t];return r&&(u=r.cast(u)),a!=null&&n.getters!==!1?a.applyGetters(u,this):u}if(a!=null&&a.instance==="Mixed"){let u=this.$__schema.virtualpath(t);u!=null&&(a=u)}let s=t.indexOf(".")!==-1,o=this._doc,f=s?t.split("."):[t];typeof this.$__schema.aliases[f[0]]=="string"&&(f[0]=this.$__schema.aliases[f[0]]);for(let u=0,c=f.length;u<c;u++)o&&o._doc&&(o=o._doc),o==null?o=void 0:o instanceof Map?o=o.get(f[u],{getters:!1}):u===c-1?o=Jt.getValue(f[u],o):o=o[f[u]];if(r&&(o=r.cast(o)),a!=null&&n.getters!==!1)o=a.applyGetters(o,this);else if(this.$__schema.nested[t]&&n.virtuals)return jG(this,uc(o)||{},{path:t});return o};ue.prototype[IRt]=ue.prototype.get;ue.prototype.$get=ue.prototype.get;ue.prototype.$__path=function(t){let e=this.$__.adhocPaths,n=e&&e.hasOwnProperty(t)?e[t]:null;return n||this.$__schema.path(t)};ue.prototype.markModified=function(t,e){this.$__saveInitialState(t),this.$__.activePaths.modify(t),e!=null&&!this.$isSubdocument&&(this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[t]=e)};ue.prototype.$__saveInitialState=function(e){let n=this.$__.savedState,r=e;if(n!=null){let i=r.indexOf("."),a=i===-1?r:r.slice(0,i);n.hasOwnProperty(a)||(n[a]=uc(this.$__getValue(a)))}};ue.prototype.unmarkModified=function(t){this.$__.activePaths.init(t),this.$__.pathsToScopes!=null&&delete this.$__.pathsToScopes[t]};ue.prototype.$ignore=function(t){this.$__.activePaths.ignore(t)};ue.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))};ue.prototype.$isEmpty=function(t){let e={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(arguments.length!==0){let n=this.$get(t);return n==null?!0:typeof n!="object"?!1:Jt.isPOJO(n)?awe(n):Object.keys(n.toObject(e)).length===0}return Object.keys(this.toObject(e)).length===0};function awe(t){if(t==null)return!0;if(typeof t!="object"||Array.isArray(t))return!1;for(let e of Object.keys(t))if(!awe(t[e]))return!1;return!0}ue.prototype.modifiedPaths=function(t){t=t||{};let e=Object.keys(this.$__.activePaths.getStatePaths("modify")),n=new Set,r=0,i=0,a=e.length;for(r=0;r<a;++r){let s=e[r],o=qG(s),f=o.length;for(i=0;i<f;++i)n.add(o[i]);if(!t.includeChildren)continue;let u=0,c=this.$get(s);if(typeof c=="object"&&c!==null){c._doc&&(c=c._doc);let d=c.length;if(Array.isArray(c))for(u=0;u<d;++u){let l=s+"."+u;if(!n.has(l)&&(n.add(l),c[u]!=null&&c[u].$__)){let p=c[u].modifiedPaths(),h=0,v=p.length;for(h=0;h<v;++h)n.add(l+"."+p[h])}}else{let l=Object.keys(c),p=0,h=l.length;for(p=0;p<h;++p)n.add(s+"."+l[p])}}}return Array.from(n)};ue.prototype[nwe]=ue.prototype.modifiedPaths;ue.prototype.isModified=function(t,e,n){if(t){let r=e&&e.ignoreAtomics,i=this.$__.activePaths.states.modify;if(i==null)return!1;typeof t=="string"&&(t=t.indexOf(" ")===-1?[t]:t.split(" "));for(let f of t)if(i[f]!=null)return!0;let a=n||this[nwe](),s=t.some(function(f){return!!~a.indexOf(f)}),o=Object.keys(i);return r&&(o=o.filter(f=>{let u=this.$__getValue(f);return!(u!=null&&u[$s]!=null&&u[$s].$set===void 0)})),s||t.some(function(f){return o.some(function(u){return u===f||f.startsWith(u+".")})})}return this.$__.activePaths.some("modify")};ue.prototype.$isModified=ue.prototype.isModified;ue.prototype[CRt]=ue.prototype.isModified;ue.prototype.$isDefault=function(t){if(t==null)return this.$__.activePaths.some("default");if(typeof t=="string"&&t.indexOf(" ")===-1)return this.$__.activePaths.getStatePaths("default").hasOwnProperty(t);let e=t;return Array.isArray(e)||(e=e.split(" ")),e.some(n=>this.$__.activePaths.getStatePaths("default").hasOwnProperty(n))};ue.prototype.$isDeleted=function(t){return arguments.length===0?!!this.$__.isDeleted:(this.$__.isDeleted=!!t,this)};ue.prototype.isDirectModified=function(t){if(t==null)return this.$__.activePaths.some("modify");if(typeof t=="string"&&t.indexOf(" ")===-1){let n=this.$__.activePaths.getStatePaths("modify").hasOwnProperty(t);if(n||t.indexOf(".")===-1)return n;let r=t.split(".");for(let i=0;i<r.length-1;++i){let a=r.slice(0,i+1).join("."),s=this.$get(a);if(s!=null&&s.$__!=null&&s.isDirectModified(r.slice(i+1).join(".")))return!0}return!1}let e=t;return typeof e=="string"&&(e=e.split(" ")),e.some(n=>this.isDirectModified(n))};ue.prototype.isInit=function(t){if(t==null)return this.$__.activePaths.some("init");if(typeof t=="string"&&t.indexOf(" ")===-1)return this.$__.activePaths.getStatePaths("init").hasOwnProperty(t);let e=t;return Array.isArray(e)||(e=e.split(" ")),e.some(n=>this.$__.activePaths.getStatePaths("init").hasOwnProperty(n))};ue.prototype.isSelected=function(e){if(this.$__.selected==null)return!0;if(!e)return!1;if(e==="_id")return this.$__.selected._id!==0;if(e.indexOf(" ")!==-1&&(e=e.split(" ")),Array.isArray(e))return e.some(a=>this.$__isSelected(a));let n=Object.keys(this.$__.selected),r=null;if(n.length===1&&n[0]==="_id")return this.$__.selected._id===0;for(let a of n)if(a!=="_id"&&ewe(this.$__.selected[a])){r=!!this.$__.selected[a];break}if(r===null)return!0;if(e in this.$__.selected)return r;let i=e+".";for(let a of n)if(a!=="_id"){if(a.startsWith(i))return r||a!==i;if(i.startsWith(a+"."))return r}return!r};ue.prototype.$__isSelected=ue.prototype.isSelected;ue.prototype.isDirectSelected=function(e){if(this.$__.selected==null)return!0;if(e==="_id")return this.$__.selected._id!==0;if(e.indexOf(" ")!==-1&&(e=e.split(" ")),Array.isArray(e))return e.some(i=>this.isDirectSelected(i));let n=Object.keys(this.$__.selected),r=null;if(n.length===1&&n[0]==="_id")return this.$__.selected._id===0;for(let i of n)if(i!=="_id"&&ewe(this.$__.selected[i])){r=!!this.$__.selected[i];break}return r===null?!0:this.$__.selected.hasOwnProperty(e)?r:!r};ue.prototype.validate=async function(e,n){if(typeof e=="function"||typeof n=="function"||typeof arguments[2]=="function")throw new vo("Document.prototype.validate() no longer accepts a callback");if(this.$op="validate",arguments.length===1&&typeof arguments[0]=="object"&&!Array.isArray(arguments[0])&&(n=arguments[0],e=null),n&&typeof n.pathsToSkip=="string"){let i=n.pathsToSkip.indexOf(" ")===-1;n.pathsToSkip=i?[n.pathsToSkip]:n.pathsToSkip.split(" ")}let r=n&&n._skipParallelValidateCheck;if(this.$isSubdocument==null){if(this.$__.validating&&!r)throw new lRt(this);r||(this.$__.validating=!0)}try{await this.$__validate(e,n)}finally{this.$op=null,this.$__.validating=null}};ue.prototype.$validate=ue.prototype.validate;function $Rt(t){let e=Object.keys(t.$__.activePaths.getStatePaths("require")),n=0,r=e.length;for(n=0;n<r;++n){let i=e[n],a=t.$__schema.path(i);if(a!=null&&typeof a.originalRequiredValue=="function"){t.$__.cachedRequired=t.$__.cachedRequired||{};try{t.$__.cachedRequired[i]=a.originalRequiredValue.call(t,t)}catch(s){t.invalidate(i,s)}}}}function swe(t,e,n,r){let i={};$Rt(t);let a=new Set(Object.keys(t.$__.activePaths.getStatePaths("require")).filter(function(f){return!t.$__isSelected(f)&&!t.$isModified(f)||f.endsWith(".$*")?!1:t.$__.cachedRequired!=null&&f in t.$__.cachedRequired?t.$__.cachedRequired[f]:!0}));Object.keys(t.$__.activePaths.getStatePaths("init")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("modify")).forEach(s),Object.keys(t.$__.activePaths.getStatePaths("default")).forEach(s);function s(f){f.endsWith(".$*")||a.add(f)}if(!r){let f=[];for(let c of Object.keys(t.$__schema.paths)){let d=t.$__schema.path(c);if(d.$isSingleNested){let l=t.$get(c);l&&f.push(l)}else if(d.$isMongooseDocumentArray){let l=t.$get(c);if(l&&l.length)for(let p of l)p&&f.push(p)}}let u=t.modifiedPaths();for(let c of f)if(c.$basePath){let d=c.$__pathRelativeToParent();for(let p of c.modifiedPaths())a.delete(d+"."+p);let l=c.$parent();if(l==null)throw new Error("Cannot validate subdocument that does not have a parent");t.$isModified(d,null,u)&&!l.$__.activePaths.getStatePaths("modify").hasOwnProperty(d)&&!l.$isDefault(d)&&(a.add(d),t.$__.pathsToScopes==null&&(t.$__.pathsToScopes={}),t.$__.pathsToScopes[d]=c.$isDocumentArrayElement?c.__parentArray:c.$parent(),i[d]={skipSchemaValidators:!0},c.$isDocumentArrayElement&&c.__index!=null&&(i[d].index=c.__index))}}for(let f of a){let u=t.$__schema.path(f);if(u){if(u.$isMongooseDocumentArray)for(let c of a)(c==null||c.startsWith(u.path+"."))&&a.delete(c);(!u.schema&&!u.embeddedSchemaType&&u.validators.length===0&&!u.$parentSchemaDocArray||u.$isMongooseArray&&!u.$isMongooseDocumentArray&&!u.embeddedSchemaType.$isMongooseArray&&u.validators.length===0&&u.embeddedSchemaType.validators.length===0)&&a.delete(f)}}Array.isArray(e)?a=FRt(a,e):Array.isArray(n)&&(a=LRt(a,n)),BRt(t,a);let o={skipArrays:!0};for(let f of a)if(t.$__schema.nested[f]){let u=t.$__getValue(f);xRt(u)&&(u=u.toObject({transform:!1}));let c=yRt(u,f,o,t.$__schema);Object.keys(c).filter(d=>!t.$__schema.singleNestedPaths.hasOwnProperty(d)).forEach(s)}for(let f of a){let u=t.$__schema.path(f);if(!u||(u.$parentSchemaDocArray&&typeof u.$parentSchemaDocArray.path=="string"&&a.add(u.$parentSchemaDocArray.path),!u.$isSchemaMap))continue;let c=t.$__getValue(f);if(c!=null)for(let d of c.keys())a.add(f+"."+d)}return a=Array.from(a),[a,i]}function BRt(t,e){for(let n of e){let r=t.$__schema.path(n);if(!r||!r.$isMongooseArray||!Array.isArray(r)&&r.$isMongooseDocumentArray&&!(r&&r.schemaOptions&&r.schemaOptions.required)||r.$isMongooseArray&&!r.$isMongooseDocumentArray&&!r.embeddedSchemaType.$isMongooseArray&&r.embeddedSchemaType.validators.length===0)continue;let i=t.$__getValue(n);HC(i,e,n)}}function HC(t,e,n){if(t!=null){let r=t.length;for(let i=0;i<r;++i)Array.isArray(t[i])?HC(t[i],e,n+"."+i):e.add(n+"."+i)}}ue.prototype._execDocumentPreHooks=async function(e,...n){return this.$__middleware.execPre(e,this,[...n])};ue.prototype._execDocumentPostHooks=async function(e,n){return this.$__middleware.execPost(e,this,[this],{error:n})};ue.prototype.$__validate=async function(e,n){try{[n]=await this._execDocumentPreHooks("validate",n)}catch(E){await this._execDocumentPostHooks("validate",E);return}this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!e&&(e=[...this.$__.saveOptions.pathsToSave]);let r=n&&typeof n=="object"&&"validateModifiedOnly"in n,i=n&&n.pathsToSkip||null,a;r?a=!!n.validateModifiedOnly:a=this.$__schema.options.validateModifiedOnly;let s=n&&n.validateAllPaths;if(s){if(i)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(e)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(r&&a)throw new TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}let o=this,f=()=>{let E=this.$__.validationError;if(this.$__.validationError=null,this.$__.validating=null,a&&E!=null){let M=Object.keys(E.errors);for(let D of M)this.$isModified(D)||delete E.errors[D];Object.keys(E.errors).length===0&&(E=void 0)}if(this.$__.cachedRequired={},this.$emit("validate",o),this.constructor.emit("validate",o),E){for(let M in E.errors)!this[TRt]&&E.errors[M]instanceof vo.CastError&&this.invalidate(M,E.errors[M]);return E}},u,c;if(s){u=new Set(Object.keys(this.$__schema.paths));for(let E of u){let M=this.$__schema.path(E);if(!M||!M.$isMongooseArray)continue;let D=this.$__getValue(E);D&&HC(D,u,E)}u=[...u],c={}}else{let E=swe(this,e,i,n&&n._nestedValidate);u=a?E[0].filter(M=>this.$isModified(M)):E[0],c=E[1]}if(typeof e=="string"&&(e=e.split(" ")),u.length===0){let E=f();await this._execDocumentPostHooks("validate",E);return}let d={},l=this.$__.saveOptions?.pathsToSave,p=[];if(Array.isArray(l)){l=new Set(l);for(let E of u)l.has(E)&&p.push(v(E))}else for(let E of u)p.push(v(E));await Promise.all(p);let h=f();await this._execDocumentPostHooks("validate",h);async function v(E){if(E==null||d[E])return;d[E]=!0;let M=o.$__schema.path(E);if(!M||!o.$isValid(E)||M[RRt]!=null&&E!==M.path)return;let D=o.$__getValue(E),$;($=o.$populated(E))?D=$:D!=null&&D.$__!=null&&D.$__.wasPopulated&&(D=D._doc._id);let N=o.$__.pathsToScopes!=null&&E in o.$__.pathsToScopes?o.$__.pathsToScopes[E]:o,V={...c[E],path:E,validateAllPaths:s,_nestedValidate:!0};try{await M.doValidate(D,N,V)}catch(j){if((M.$isSingleNested||M.$isArraySubdocument||M.$isMongooseDocumentArray)&&j instanceof zC)return;o.invalidate(E,j,void 0,!0)}}};function FRt(t,e){let n=new Set(e),r=new Map([]);for(let a of e){if(a.indexOf(".")===-1)continue;let s=a.split("."),o=s[0];for(let f=1;f<s.length;++f)r.set(o,a),o=o+"."+s[f]}let i=new Set;for(let a of t)n.has(a)?i.add(a):r.has(a)&&i.add(r.get(a));return i}function LRt(t,e){return e=new Set(e),t=Array.from(t).filter(n=>!e.has(n)),new Set(t)}ue.prototype.validateSync=function(t,e){let n=this;arguments.length===1&&typeof arguments[0]=="object"&&!Array.isArray(arguments[0])&&(e=arguments[0],t=null);let r=e&&typeof e=="object"&&"validateModifiedOnly"in e,i;r?i=!!e.validateModifiedOnly:i=this.$__schema.options.validateModifiedOnly;let a=e&&e.pathsToSkip,s=e&&e.validateAllPaths;if(s){if(a)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}typeof t=="string"?t=t.indexOf(" ")===-1?[t]:t.split(" "):typeof a=="string"&&a.indexOf(" ")!==-1&&(a=a.split(" "));let o,f;if(s){o=new Set(Object.keys(this.$__schema.paths));for(let d of o){let l=this.$__schema.path(d);if(!l||!l.$isMongooseArray)continue;let p=this.$__getValue(d);p&&HC(p,o,d)}o=[...o],f={}}else{let d=swe(this,t,a);o=i?d[0].filter(l=>this.$isModified(l)):d[0],f=d[1]}let u={};for(let d=0,l=o.length;d<l;++d){let p=o[d];if(u[p])continue;u[p]=!0;let h=n.$__schema.path(p);if(!h||!n.$isValid(p))continue;let v=n.$__getValue(p),E=h.doValidateSync(v,n,{skipSchemaValidators:f[p],path:p,validateModifiedOnly:i,validateAllPaths:s});if(E){if((h.$isSingleNested||h.$isArraySubdocument||h.$isMongooseDocumentArray)&&E instanceof zC)continue;n.invalidate(p,E,void 0,!0)}}let c=n.$__.validationError;if(n.$__.validationError=void 0,n.$emit("validate",n),n.constructor.emit("validate",n),c)for(let d in c.errors)c.errors[d]instanceof vo.CastError&&n.invalidate(d,c.errors[d]);return c};ue.prototype.invalidate=function(t,e,n,r){if(this.$__.validationError||(this.$__.validationError=new zC(this)),!this.$__.validationError.errors[t])return(!e||typeof e=="string")&&(e=new JAe({path:t,message:e,type:r||"user defined",value:n})),this.$__.validationError===e?this.$__.validationError:(this.$__.validationError.addError(t,e),this.$__.validationError)};ue.prototype.$markValid=function(t){!this.$__.validationError||!this.$__.validationError.errors[t]||(delete this.$__.validationError.errors[t],Object.keys(this.$__.validationError.errors).length===0&&(this.$__.validationError=null))};function qRt(t,e){if(!t.$__.validationError)return;let n=Object.keys(t.$__.validationError.errors);for(let r of n)r.startsWith(e+".")&&delete t.$__.validationError.errors[r];Object.keys(t.$__.validationError.errors).length===0&&(t.$__.validationError=null)}function URt(t,e,n){let r=e.schema;if(r!=null)for(let i of Object.keys(r.paths)){let a=r.paths[i];if(a.$immutableSetter==null)continue;let s=n?.$__getValue(i);a.$immutableSetter.call(t,s)}}ue.prototype.$isValid=function(t){return this.$__.validationError==null||Object.keys(this.$__.validationError.errors).length===0?!0:t==null?!1:(t.indexOf(" ")!==-1&&(t=t.split(" ")),Array.isArray(t)?t.some(e=>this.$__.validationError.errors[e]==null):this.$__.validationError.errors[t]==null)};ue.prototype.$__reset=function(){let e=this,n=this.$isSubdocument?null:this.$getAllSubdocs({useCache:!0});if(n&&n.length>0)for(let r of n)r.$__reset();return this.$__dirty().forEach(function(r){let i=r.value;i&&i[$s]&&(i[e7]=i[$s],i[$s]={})}),this.$__.backup={},this.$__.backup.activePaths={modify:Object.assign({},this.$__.activePaths.getStatePaths("modify")),default:Object.assign({},this.$__.activePaths.getStatePaths("default"))},this.$__.backup.validationError=this.$__.validationError,this.$__.backup.errors=this.$errors,this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("default"),this.$__.validationError=void 0,this.$errors=void 0,e=this,this.$__schema.requiredPaths().forEach(function(r){e.$__.activePaths.require(r)}),this};ue.prototype.$__undoReset=function(){if(!(this.$__.backup==null||this.$__.backup.activePaths==null)){this.$__.activePaths.states.modify=this.$__.backup.activePaths.modify,this.$__.activePaths.states.default=this.$__.backup.activePaths.default,this.$__.validationError=this.$__.backup.validationError,this.$errors=this.$__.backup.errors;for(let e of this.$__dirty()){let n=e.value;n&&n[$s]&&n[e7]&&(n[$s]=n[e7])}if(!this.$isSubdocument)for(let e of this.$getAllSubdocs())e.$__undoReset()}};ue.prototype.$__dirty=function(){let t=this,e=this.$__.activePaths.map("modify",function(i){return{path:i,value:t.$__getValue(i),schema:t.$__path(i)}});e=e.concat(this.$__.activePaths.map("default",function(i){if(!(i==="_id"||t.$__getValue(i)==null))return{path:i,value:t.$__getValue(i),schema:t.$__path(i)}}));let n=new Map(e.filter(i=>i!=null).map(i=>[i.path,i.value])),r=[];return e.forEach(function(i){if(!i)return;let a=null,s=qG(i.path);for(let o=0;o<s.length-1;o++)if(n.has(s[o])){a=n.get(s[o]);break}a==null?r.push(i):a!=null&&a[$s]!=null&&a.hasAtomics()&&(a[$s]={},a[$s].$set=a)}),r};ue.prototype.$__setSchema=function(t){pRt(t.tree,this,void 0,t.options);for(let e of Object.keys(t.virtuals))t.virtuals[e]._applyDefaultGetters();t.path("schema")==null&&(this.schema=t),this.$__schema=t,this.$__middleware=t._getDocumentMiddleware(),this[ORt]=t};ue.prototype.$__getArrayPathsToValidate=function(){return VC||(VC=rm()),this.$__.activePaths.map("init","modify",function(t){return this.$__getValue(t)}.bind(this)).filter(function(t){return t&&Array.isArray(t)&&Jt.isMongooseDocumentArray(t)&&t.length}).reduce(function(t,e){return t.concat(e)},[]).filter(function(t){return t})};ue.prototype.$getAllSubdocs=function(t){if(t?.useCache&&this.$__.saveOptions?.__subdocs)return this.$__.saveOptions.__subdocs;VC||(VC=rm()),Q9=Q9||Ry();let e=[];function n(r){let i=[];for(let{model:a}of r.$__schema.childSchemas){let s=r.$__getValue(a.path);if(s!=null){if(s.$__&&i.push(s),Array.isArray(s))for(let o of s)o!=null&&o.$__&&i.push(o);if(s instanceof Map)for(let o of s.values())o!=null&&o.$__&&i.push(o)}}for(let a of i)n(a);e.push(...i)}return n(this),this.$__.saveOptions&&(this.$__.saveOptions.__subdocs=e),e};function jRt(t){let e=t.$__schema&&t.$__schema.callQueue;if(e.length)for(let n of e)n[0]!=="pre"&&n[0]!=="post"&&n[0]!=="on"&&t[n[0]].apply(t,n[1])}ue.prototype.$__handleReject=function(e){this.$listeners("error").length?this.$emit("error",e):this.constructor.listeners&&this.constructor.listeners("error").length&&this.constructor.emit("error",e)};ue.prototype.$toObject=function(t,e){let n=this.$__schema._defaultToObjectOptions(e),r=this.$__hasOnlyPrimitiveValues();t=Jt.isPOJO(t)?{...t}:{},t._calledWithOptions=t._calledWithOptions||{...t};let i;t._calledWithOptions.minimize!=null?i=t.minimize:this.$__schemaTypeOptions?.minimize!=null?i=this.$__schemaTypeOptions.minimize:n!=null&&n.minimize!=null?i=n.minimize:i=this.$__schema.options.minimize,t.minimize=i,r||(t._seen=t._seen||new Map);let a=t._calledWithOptions.depopulate??n?.depopulate??t.depopulate??!1;if(a&&t._isNested&&this.$__.wasPopulated)return uc(this.$__.wasPopulated.value||this._doc._id,t);if(a&&(t.depopulate=!0),n!=null)for(let p of Object.keys(n))t[p]==null&&(t[p]=n[p]);t._isNested=!0,t.json=e,t.minimize=i;let s=t._parentOptions;t._parentOptions=this.$isSubdocument?t:null;let o=t._calledWithOptions.schemaFieldsOnly??t.schemaFieldsOnly??n.schemaFieldsOnly??!1,f;if(r&&!t.flattenObjectIds)f=this.$__toObjectShallow(o);else if(o){f={};for(let p of Object.keys(this.$__schema.paths)){let h=this.$__getValue(p);if(h===void 0)continue;let v=p,E=f;if(p.indexOf(".")!==-1){let M=p.split(".");v=M[M.length-1];for(let D=0;D<M.length-1;++D)E[M[D]]=E[M[D]]??{},E=E[M[D]]}if(h===null){E[v]=null;continue}E[v]=uc(h,t)}}else f=uc(this._doc,t)||{};let u=t._calledWithOptions.getters??t.getters??n.getters??!1;u&&(VRt(this,f),t.minimize&&(f=ARt(f)||{}));let c=t._calledWithOptions.virtuals??n.virtuals??s?.virtuals??void 0;(c||u&&c!==!1)&&jG(this,f,t,t),t.versionKey===!1&&this.$__schema.options.versionKey&&delete f[this.$__schema.options.versionKey];let d=t._calledWithOptions.transform??!0,l;if(d===!0?l=n.transform:typeof d=="function"&&(l=d),d&&zRt(this,f),t.useProjection&&HRt(this,f),typeof l=="function"){let p=l(this,f,t);typeof p<"u"&&(f=p)}return f};ue.prototype.$__toObjectShallow=function(e){let n={};if(this._doc!=null){let r=Object.keys(e?this.$__schema.paths:this._doc);for(let i of r){let a=this._doc[i];a instanceof Date?n[i]=new Date(a):a!==void 0&&(n[i]=a)}}return n};ue.prototype.toObject=function(t){return this.$toObject(t)};function jG(t,e,n,r){let i=t.$__schema,a=i.virtuals,s=Object.keys(a),o=s.length,f=o,u,c,d=t._doc,l,p=typeof(r&&r.aliases)=="boolean"?r.aliases:!0;n=n||{};let h=null;if(Array.isArray(n.virtuals))h=new Set(n.virtuals);else if(n.virtuals&&n.virtuals.pathsToSkip){h=new Set(s);for(let v=0;v<n.virtuals.pathsToSkip.length;v++)h.has(n.virtuals.pathsToSkip[v])&&h.delete(n.virtuals.pathsToSkip[v])}if(!d)return e;for(o=0;o<f;++o){if(u=s[o],h!=null&&!h.has(u)||!p&&i.aliases.hasOwnProperty(u))continue;if(c=u,n.path!=null){if(!u.startsWith(n.path+"."))continue;c=u.substring(n.path.length+1)}if(c.indexOf(".")===-1&&c===u){if(l=a[u].applyGetters(void 0,t),l===void 0)continue;l=uc(l,n),e[c]=l;continue}let v=c.split(".");if(l=uc(t.get(u),n),l===void 0)continue;let E=v.length;d=e;for(let M=0;M<E-1;++M)d[v[M]]=d[v[M]]||{},d=d[v[M]];d[v[E-1]]=l}return e}function VRt(t,e){let n=t.$__schema,r=Object.keys(n.paths),i=r.length,a,s=t._doc,o;if(!s)return e;for(;i--;){a=r[i];let f=a.split("."),u=f.length,c=u-1,d=e,l;if(s=t._doc,!!t.$__isSelected(a))for(let p=0;p<u&&(l=f[p],o=s[l],!(d!=null&&typeof d!="object"));++p){if(p===c){if(d[l]=n.paths[a].applyGetters(d[l],t),Array.isArray(d[l])&&n.paths[a].embeddedSchemaType)for(let h=0;h<d[l].length;++h)d[l][h]=n.paths[a].embeddedSchemaType.applyGetters(d[l][h],t)}else if(o==null){l in s&&(d[l]=o);break}else d=d[l]||(d[l]={});s=o}}return e}function zRt(t,e){let n=t.$__schema,r=Object.keys(n.paths||{});if(!t._doc)return e;for(let a of r){let s=n.paths[a],o=s.options.transform??s.constructor?.defaultOptions?.transform,f=s.embeddedSchemaType?.options?.transform??s.embeddedSchemaType?.constructor?.defaultOptions?.transform;if(typeof o=="function"){let u=t.$get(a);if(u===void 0)continue;let c=o.call(t,u);ZAe(a,c),Jt.setValue(a,c,e)}else if(typeof f=="function"){let u=t.$get(a);if(u===void 0)continue;let c=[].concat(u);for(let d=0;d<c.length;++d){let l=f.call(t,c[d]);c[d]=l,ZAe(a,l)}e[a]=c}}return e}function ZAe(t,e){if(SRt(e))throw new Error("`transform` function must be synchronous, but the transform on path `"+t+"` returned a promise.")}function HRt(t,e){let n=t.$__schema,r=Object.keys(n.paths||{});if(!t._doc)return e;let a=t.$__.selected;if(a===void 0&&(a={},ERt.applyPaths(a,n)),a==null||Object.keys(a).length===0)return e;for(let s of r)a[s]!=null&&!a[s]&&delete e[s];return e}ue.prototype.toJSON=function(t){return this.$toObject(t,!0)};ue.prototype.ownerDocument=function(){return this};ue.prototype.parent=function(){return this.$isSubdocument||this.$__.wasPopulated?this.$__.parent:this};ue.prototype.$parent=ue.prototype.parent;ue.prototype.inspect=function(t){let e=Jt.isPOJO(t),n;e&&(n=t,n.minimize=!1);let r=arguments.length>0?this.toObject(n):this.toObject();return r??"MongooseDocument { "+r+" }"};LG.custom&&(ue.prototype[LG.custom]=ue.prototype.inspect);ue.prototype.toString=function(){let t=this.inspect();return typeof t=="string"?t:LG(t)};ue.prototype.equals=function(t){if(!t)return!1;let e=this.$__getValue("_id"),n=t.$__!=null?t.$__getValue("_id"):t;return!e&&!n?jC(this,t):e&&e.equals?e.equals(n):e===n};ue.prototype.populate=async function(){let e={},n=[...arguments];if(typeof n[n.length-1]=="function")throw new vo("Document.prototype.populate() no longer accepts a callback");if(n.length!==0){let a=Jt.populate.apply(null,n);for(let s of a)e[s.path]=s}let r=Jt.object.vals(e),i=this.constructor;if(this.$__isNested){i=this.$__[PRt].constructor;let a=this.$__.nestedPath;r.forEach(function(s){s.path=a+"."+s.path})}if(this.$session()!=null){let a=this.$session();r.forEach(s=>{if(s.options==null){s.options={session:a};return}"session"in s.options||(s.options.session=a)})}return r.forEach(a=>{a._localModel=i}),i.populate(this,r)};ue.prototype.$getPopulatedDocs=function(){let e=[];this.$__.populated!=null&&(e=e.concat(Object.keys(this.$__.populated)));let n=[];for(let r of e){let i=this.$get(r);Array.isArray(i)?n=n.concat(i):i instanceof ue&&n.push(i)}return n};ue.prototype.populated=function(t,e,n){if(e==null||e===!0){if(!this.$__.populated||typeof t!="string")return;let i=t.endsWith(".$*")?t.replace(/\.\$\*$/,""):t,a=this.$__.populated[i];return a?e===!0?a:a.value:void 0}this.$__.populated||(this.$__.populated={}),this.$__.populated[t]={value:e,options:n};let r=t.split(".");for(let i=0;i<r.length-1;++i){let a=r.slice(0,i+1).join("."),s=this.$get(a);if(s!=null&&s.$__!=null&&this.$populated(a)){let o=r.slice(i+1).join(".");s.$populated(o,e,n);break}}return e};ue.prototype.$populated=ue.prototype.populated;ue.prototype.$assertPopulated=function(e,n){if(Array.isArray(e))return e.forEach(r=>this.$assertPopulated(r,n)),this;if(arguments.length>1&&this.$set(n),!this.$populated(e))throw new vo(`Expected path "${e}" to be populated`);return this};ue.prototype.depopulate=function(t){typeof t=="string"&&(t=t.indexOf(" ")===-1?[t]:t.split(" "));let e,n=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],r=this.$__&&this.$__.populated||{};if(arguments.length===0){for(let a of n)delete this.$$populatedVirtuals[a],delete this._doc[a],delete r[a];let i=Object.keys(r);for(let a of i)if(e=this.$populated(a),!!e)if(delete r[a],Array.isArray(e)){let s=Jt.getValue(a,this._doc);if(s.isMongooseArray){let o=s.__array;for(let f=0;f<o.length;++f){let u=o[f];u!=null&&(o[f]=u instanceof ue?u._doc._id:u._id)}}else Jt.setValue(a,e,this._doc)}else Jt.setValue(a,e,this._doc);return this}for(let i of t)if(e=this.$populated(i),delete r[i],n.indexOf(i)!==-1)delete this.$$populatedVirtuals[i],delete this._doc[i];else if(e)if(Array.isArray(e)){let a=Jt.getValue(i,this._doc);if(a.isMongooseArray){let s=a.__array;for(let o=0;o<s.length;++o){let f=s[o];f!=null&&(s[o]=f instanceof ue?f._doc._id:f._id)}}else Jt.setValue(i,e,this._doc)}else Jt.setValue(i,e,this._doc);return this};ue.prototype.$__fullPath=function(t){return t||""};ue.prototype.getChanges=function(){let t=this.$__delta();return t?t[1]:{}};ue.prototype.$__delta=function(){let e=this.$__dirty(),n=this.$__schema.options.optimisticConcurrency;if(n)if(Array.isArray(n)){let f=new Set(n);this.modifiedPaths().find(c=>f.has(c))&&(this.$__.version=e.length?b1:t7)}else this.$__.version=e.length?b1:t7;if(!e.length&&b1!==this.$__.version)return;let r={},i={},a=e.length,s=[],o=0;for(r._id=this._doc._id,(r&&r._id&&r._id.$__||null)!=null&&(r._id=r._id.toObject({transform:!1,depopulate:!0}));o<a;++o){let f=e[o],u=f.value,c=WRt(this,f.path,u);if(c){s.push(c);continue}if(!this.$populated(f.path,!0)&&this.$__.selected){let l=f.path.split("."),p=l[0];if(this.$__.selected[p]&&this.$__.selected[p].$elemMatch)if(l.length>1&&l[1]==0&&typeof r[p]>"u")r[p]=this.$__.selected[p],l[1]="$",f.path=l.join(".");else{s.push(f.path);continue}}if(!(this.$isDefault(f.path)&&this.$__.selected&&(f.path.indexOf(".")===-1&&GAe(this.$__.selected,f.path)||qG(f.path).find(p=>GAe(this.$__.isSelected,p))))&&!s.length)if(u===void 0)e6(this,r,i,f,1,"$unset");else if(u===null)e6(this,r,i,f,null);else if(Jt.isMongooseArray(u)&&u.$path()&&u[$s])GRt(this,r,i,f,u);else if(u[fRt.pathSymbol]&&Buffer.isBuffer(u))u=u.toObject(),e6(this,r,i,f,u);else if(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[f.path]!=null){let l=this.$__.primitiveAtomics[f.path],p=mRt(l);e6(this,r,i,f,l[p],p)}else u=uc(u,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}),e6(this,r,i,f,u)}if(s.length)throw new sRt(s);return this.$__.version&&this.$__version(r,i),Object.keys(i).length===0?[r,null]:[r,i]};function WRt(t,e,n){let r=t.$populated(e,!0);if(!r&&t.$__.selected){let a=e.split(".")[0];if(t.$__.selected[a+".$"])return a}if(!(r&&Jt.isMongooseArray(n)))return;if(r.options.match||r.options.options&&Jt.object.hasOwnProperty(r.options.options,"limit")||r.options.options&&r.options.options.skip||r.options.select&&(r.options.select._id===0||/\s?-_id\s?/.test(r.options.select))){let a=n[$s];if(Object.keys(a).length===0||a.$set||a.$pop)return e}}function e6(t,e,n,r,i,a){if(a||(a="$set"),n[a]||(n[a]={}),n[a][r.path]=i,t.$__schema.options.versionKey!==!1&&!KRt(t,r.path)&&b1!==(b1&t.$__.version)&&!t.$__schema.options.optimisticConcurrency){switch(a){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}a==="$push"||a==="$addToSet"||a==="$pullAll"||a==="$pull"?/\.\d+\.|\.\d+$/.test(r.path)?t.$__.version=b1:t.$__.version=UG:/^\$p/.test(a)||Array.isArray(i)?t.$__.version=b1:/\.\d+\.|\.\d+$/.test(r.path)&&(t.$__.version=t7)}}function GRt(t,e,n,r,i){if(n.$set&&n.$set[r.path])return;if(typeof i.$__getAtomics=="function"){i.$__getAtomics().forEach(function(d){let l=d[0],p=d[1];e6(t,e,n,r,p,l)});return}let a=i[$s],s=Object.keys(a),o=s.length,f,u;if(o===0)return Jt.isMongooseObject(i)?i=i.toObject({depopulate:1,_isNested:!0}):i.valueOf&&(i=i.valueOf()),e6(t,e,n,r,i);function c(d){return Jt.isMongooseObject(d)?d.toObject({depopulate:1,_isNested:!0}):d}for(;o--;)u=s[o],f=a[u],Jt.isMongooseObject(f)?f=f.toObject({depopulate:!0,transform:!1,_isNested:!0}):Array.isArray(f)?f=f.map(c):f.valueOf&&(f=f.valueOf()),u==="$addToSet"&&(f={$each:f}),e6(t,e,n,r,f,u)}function KRt(t,e){let n=t.$__schema.options.skipVersioning;return n?(e=e.replace(/\.\d+\./,"."),n[e]):!1}ue.prototype.$clone=function(){let t=this.constructor,e=new t;if(e.$isNew=this.$isNew,this._doc&&(e._doc=uc(this._doc,{retainDocuments:!0})),this.$__){let n=this.$__.constructor,r=new n;for(let i of Object.getOwnPropertyNames(this.$__))i!=="activePaths"&&(r[i]=uc(this.$__[i]));Object.assign(r.activePaths,uc({...this.$__.activePaths})),e.$__=r}return e};ue.prototype.$createModifiedPathsSnapshot=function(){let e=new WeakMap;if(!this.$isSubdocument){let n=this.$getAllSubdocs();for(let r of n)e.set(r,r.$__.activePaths.clone())}return new uRt(e,this.$__.activePaths.clone(),this.$__.version)};ue.prototype.$restoreModifiedPathsSnapshot=function(e){if(this.$__.activePaths=e.activePaths.clone(),this.$__.version=e.version,!this.$isSubdocument){let n=this.$getAllSubdocs();for(let r of n)e.subdocSnapshot.has(r)&&(r.$__.activePaths=e.subdocSnapshot.get(r))}return this};ue.prototype.$clearModifiedPaths=function(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){let e=this.$getAllSubdocs();for(let n of e)n.$clearModifiedPaths()}return this};ue.prototype.$__hasOnlyPrimitiveValues=function(){return!this.$__.populated&&!this.$__.wasPopulated&&(this._doc==null||Object.values(this._doc).every(e=>e==null||typeof e!="object"||Jt.isNativeObject(e)&&!Array.isArray(e)||WAe(e,"ObjectId")||WAe(e,"Decimal128")))};ue.VERSION_WHERE=t7;ue.VERSION_INC=UG;ue.VERSION_ALL=b1;ue.ValidationError=zC;fwe.exports=owe=ue});var Vt=y(He=>{"use strict";var YRt=jt().UUID,ZRt=qv(),cwe=s0(),XRt=Zp(),lwe=cG(),zG=Qr(),JRt=xp(),QRt=Yh(),dwe=eC(),pwe=d_e(),t6=Da(),ekt=Ey(),tkt=FW(),n7=W9(),nkt=yC(),r7=Kh(),{trustedSymbol:ky}=Sy(),VG;He.specialProperties=r7;He.isMongooseArray=dwe.isMongooseArray;He.isMongooseDocumentArray=pwe.isMongooseDocumentArray;He.registerMongooseArray=dwe.registerMongooseArray;He.registerMongooseDocumentArray=pwe.registerMongooseDocumentArray;var HG=/\s/,WG=/\s+/;He.toCollectionName=function(t,e){if(t==="system.profile"||t==="system.indexes")return t;if(typeof e=="function"){if(typeof t!="string")throw new TypeError("Collection name must be a string");if(t.length===0)throw new TypeError("Collection name cannot be empty");return e(t)}return t};He.deepEqual=function t(e,n){if(e===n)return!0;if(typeof e!="object"||typeof n!="object")return e===n;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(t6(e,"ObjectId")&&t6(n,"ObjectId")||t6(e,"Decimal128")&&t6(n,"Decimal128"))return e.toString()===n.toString();if(e instanceof RegExp&&n instanceof RegExp)return e.source===n.source&&e.ignoreCase===n.ignoreCase&&e.multiline===n.multiline&&e.global===n.global&&e.dotAll===n.dotAll&&e.unicode===n.unicode&&e.sticky===n.sticky&&e.hasIndices===n.hasIndices;if(e==null||n==null||e.prototype!==n.prototype)return!1;if(e instanceof Map||n instanceof Map)return!(e instanceof Map)||!(n instanceof Map)?!1:t(Array.from(e.keys()),Array.from(n.keys()))&&t(Array.from(e.values()),Array.from(n.values()));if(e instanceof Number&&n instanceof Number)return e.valueOf()===n.valueOf();if(Buffer.isBuffer(e))return He.buffer.areEqual(e,n);if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n))return!1;let s=e.length;if(s!==n.length)return!1;for(let o=0;o<s;++o)if(!t(e[o],n[o]))return!1;return!0}e.$__!=null?e=e._doc:n7(e)&&(e=e.toObject()),n.$__!=null?n=n._doc:n7(n)&&(n=n.toObject());let r=Object.keys(e),i=Object.keys(n),a=r.length;if(a!==i.length)return!1;for(let s=a-1;s>=0;s--)if(r[s]!==i[s])return!1;for(let s of r)if(!t(e[s],n[s]))return!1;return!0};He.last=function(t){if(t.length>0)return t[t.length-1]};He.cloneArrays=function(e){return Array.isArray(e)?e.map(n=>He.cloneArrays(n)):e};He.omit=function(e,n){if(n==null)return Object.assign({},e);Array.isArray(n)||(n=[n]);let r=Object.assign({},e);for(let i of n)delete r[i];return r};He.clonePOJOsAndArrays=function(e){if(e==null||e.$__!=null)return e;if(ekt(e)){e={...e};for(let n of Object.keys(e))e[n]=He.clonePOJOsAndArrays(e[n]);return e}if(Array.isArray(e)){e=[...e];for(let n=0;n<e.length;++n)e[n]=He.clonePOJOsAndArrays(e[n]);return e}return e};He.merge=function t(e,n,r,i){r=r||{};let a=Object.keys(n),s=0,o=a.length,f;n[ky]&&(e[ky]=n[ky]),i=i||"";let u=r.omitNested||{};for(;s<o;)if(f=a[s++],!(r.omit&&r.omit[f])&&!u[i]&&!r7.has(f))if(e[f]==null)e[f]=He.clonePOJOsAndArrays(n[f]);else if(He.isObject(n[f])){if(He.isObject(e[f])||(e[f]={}),n[f]!=null){if(r.isDiscriminatorSchemaMerge&&n[f].$isSingleNested&&e[f].$isMongooseDocumentArray||n[f].$isMongooseDocumentArray&&e[f].$isSingleNested)continue;if(n[f].instanceOfSchema){e[f].instanceOfSchema?nkt(e[f],n[f].clone(),r.isDiscriminatorSchemaMerge):e[f]=n[f].clone();continue}else if(t6(n[f],"ObjectId")){e[f]=new XRt(n[f]);continue}}t(e[f],n[f],r,i?i+"."+f:f)}else r.overwrite&&(e[f]=n[f]);return e};He.toObject=function t(e){VG||(VG=El());let n;if(e==null)return e;if(e instanceof VG)return e.toObject();if(Array.isArray(e)){n=[];for(let r of e)n.push(t(r));return n}if(He.isPOJO(e)){n={},e[ky]&&(n[ky]=e[ky]);for(let r of Object.keys(e))r7.has(r)||(n[r]=t(e[r]));return n}return e};He.isObject=QRt;He.isPOJO=Ey();He.isNonBuiltinObject=function(e){return typeof e=="object"&&!He.isNativeObject(e)&&!He.isMongooseType(e)&&!(e instanceof YRt)&&e!=null};He.isNativeObject=function(t){return Array.isArray(t)||t instanceof Date||t instanceof Boolean||t instanceof Number||t instanceof String};He.isEmptyObject=function(t){return t!=null&&typeof t=="object"&&Object.keys(t).length===0};He.hasKey=function(e,n){let r=Object.keys(e);for(let i of r)if(i===n||He.isPOJO(e[i])&&He.hasKey(e[i],n))return!0;return!1};He.tick=function(e){if(typeof e=="function")return function(){try{e.apply(this,arguments)}catch(n){JRt(function(){throw n})}}};He.isMongooseType=function(t){return t6(t,"ObjectId")||t6(t,"Decimal128")||t instanceof Buffer};He.isMongooseObject=n7;He.expires=function(e){e&&e.constructor.name==="Object"&&"expires"in e&&(e.expireAfterSeconds=typeof e.expires!="string"?e.expires:Math.round(ZRt(e.expires)/1e3),delete e.expires)};He.populate=function(e,n,r,i,a,s,o,f){let u=null;if(arguments.length===1){if(e instanceof lwe)return e._docs={},e._childDocs=[],[e];if(Array.isArray(e))return c(e).map(l=>He.populate(l)[0]);He.isObject(e)?u=Object.assign({},e):u={path:e}}else typeof r=="object"?u={path:e,select:n,match:r,options:i}:u={path:e,select:n,model:r,match:i,options:a,populate:s,justOne:o,count:f};if(typeof u.path!="string"&&!(Array.isArray(u.path)&&u.path.every(d=>typeof d=="string")))throw new TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+typeof e+"`");return rkt(u);function c(d){let l=[];return d.forEach(function(p){HG.test(p.path)?p.path.split(WG).forEach(function(v){let E=Object.assign({},p);E.path=v,l.push(E)}):l.push(p)}),l}};function rkt(t){if(Array.isArray(t.populate)){let r=[];t.populate.forEach(function(i){if(HG.test(i.path)){let a=Object.assign({},i);a.path.split(WG).forEach(function(o){a.path=o,r.push(He.populate(a)[0])})}else r.push(He.populate(i)[0])}),t.populate=He.populate(r)}else t.populate!=null&&typeof t.populate=="object"&&(t.populate=He.populate(t.populate));let e=[],n=HG.test(t.path)?t.path.split(WG):Array.isArray(t.path)?t.path:[t.path];t.options!=null&&(t.options=zG(t.options));for(let r of n)e.push(new lwe(Object.assign({},t,{path:r})));return e}He.getValue=function(t,e,n){return cwe.get(t,e,akt,n)};var ikt=Object.freeze({getters:!1});function akt(t,e){if(e==="$*"&&t instanceof Map)return t;let n=t?._doc||t;return n!=null&&n.isMongooseArrayProxy&&(n=n.__array),n instanceof Map?n.get(e,ikt):n[e]}He.setValue=function(t,e,n,r,i){cwe.set(t,e,n,"_doc",r,i)};He.object={};He.object.vals=function(e){let n=Object.keys(e),r=n.length,i=[];for(;r--;)i.push(e[n[r]]);return i};var skt=Object.prototype.hasOwnProperty;He.object.hasOwnProperty=function(t,e){return skt.call(t,e)};He.isNullOrUndefined=function(t){return t==null};He.array={};He.array.flatten=function t(e,n,r){return r||(r=[]),e.forEach(function(i){Array.isArray(i)?t(i,n,r):(!n||n(i))&&r.push(i)}),r};var okt=Object.prototype.hasOwnProperty;He.hasUserDefinedProperty=function(t,e){if(t==null)return!1;if(Array.isArray(e)){for(let n of e)if(He.hasUserDefinedProperty(t,n))return!0;return!1}if(okt.call(t,e))return!0;if(typeof t=="object"&&e in t){let n=t[e];return n!==Object.prototype[e]&&n!==Array.prototype[e]}return!1};var uwe=Math.pow(2,32)-1;He.isArrayIndex=function(t){return typeof t=="number"?t>=0&&t<=uwe:typeof t=="string"&&/^\d+$/.test(t)?(t=+t,t>=0&&t<=uwe):!1};He.array.unique=function(t){let e=new Set,n=new Set,r=[];for(let i of t)if(typeof i=="number"||typeof i=="string"||i==null){if(e.has(i))continue;r.push(i),e.add(i)}else if(t6(i,"ObjectId")){if(n.has(i.toString()))continue;r.push(i),n.add(i.toString())}else r.push(i);return r};He.buffer={};He.buffer.areEqual=function(t,e){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;++n)if(t[n]!==e[n])return!1;return!0};He.getFunctionName=tkt;He.decorate=function(t,e){for(let n in e)r7.has(n)||(t[n]=e[n])};He.mergeClone=function(t,e){n7(e)&&(e=e.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1}));let n=Object.keys(e),r=n.length,i=0,a;for(;i<r;)if(a=n[i++],!r7.has(a))if(typeof t[a]>"u")t[a]=zG(e[a],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{let s=e[a];if(s!=null&&s.valueOf&&!(s instanceof Date)&&(s=s.valueOf()),He.isObject(s)){let o=s;n7(s)&&!s.isMongooseBuffer&&(o=o.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1})),s.isMongooseBuffer&&(o=Buffer.from(o)),He.mergeClone(t[a],o)}else t[a]=zG(s,{flattenDecimals:!1})}};He.each=function(t,e){for(let n of t)e(n)};He.renameObjKey=function(t,e,n){return Object.keys(t).reduce((i,a)=>(a===e?i[n]=t[e]:i[a]=t[a],i),{})};He.getOption=function(t){let e=Array.prototype.slice.call(arguments,1);for(let n of e)if(n!=null&&n[t]!=null)return n[t];return null};He.noop=function(){};He.errorToPOJO=function(e){if(!(e instanceof Error))throw new Error("`error` must be `instanceof Error`.");let r={};for(let i of Object.getOwnPropertyNames(e))r[i]=e[i];return r};He.warn=function(e){return process.emitWarning(e,{code:"MONGOOSE"})};He.injectTimestampsOption=function(e,n){n!=null&&(e.timestamps=n)}});var li=y((GC,vwe)=>{"use strict";var a7=i0(),gwe=bo(),fkt=mC(),ukt=fG(),WC=Qr(),GG=Xve(),ckt=Qve(),KG=t_e(),lkt=ct().schemaTypeSymbol,am=Vt(),i7=ct().validatorErrorSymbol,dkt=ct().documentIsModified,hwe=ct().populateModelSymbol,YG=a7.CastError,Dy=a7.ValidatorError,pkt={_skipMarkModified:!0};function Kt(t,e,n,r){this[lkt]=!0,this.path=t,this.instance=n,this.schemaName=this.constructor.schemaName,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=this.constructor.hasOwnProperty("setters")?this.constructor.setters.slice():[],this.splitPath(),e=e||{};let i=this.constructor.defaultOptions||{},a=Object.keys(i);for(let f of a)f==="validate"?this.validate(i.validate):i.hasOwnProperty(f)&&!Object.prototype.hasOwnProperty.call(e,f)&&(e[f]=i[f]);e.select==null&&delete e.select;let s=this.OptionsConstructor||gwe;this.options=new s(e),this.parentSchema=r,this._index=null,am.hasUserDefinedProperty(this.options,"immutable")&&(this.$immutable=this.options.immutable,GG(this));let o=Object.keys(this.options);for(let f of o){if(f==="cast"){Array.isArray(this.options[f])?this.castFunction.apply(this,this.options[f]):this.castFunction(this.options[f]);continue}if(am.hasUserDefinedProperty(this.options,f)&&typeof this[f]=="function"){if(f==="index"&&this._index){if(e.index===!1){let d=this._index;if(typeof d=="object"&&d!=null){if(d.unique)throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(d.sparse)throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}let u=e[f];if(f==="default"){this.default(u);continue}let c=Array.isArray(u)?u:[u];this[f].apply(this,c)}}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}Kt.prototype.OptionsConstructor=gwe;Kt.prototype.path;Kt.prototype.toJSON=function(){let e={...this};return delete e.parentSchema,e};Kt.prototype.validators;Kt.prototype.isRequired;Kt.prototype.splitPath=function(){if(this._presplitPath!=null)return this._presplitPath;if(this.path!=null)return this._presplitPath=this.path.indexOf(".")===-1?[this.path]:this.path.split("."),this._presplitPath};Kt.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=n=>n),this._cast=e,this._cast)};Kt.prototype.castFunction=function(e,n){return arguments.length===0?this._castFunction:(e===!1&&(e=this.constructor._defaultCaster||(r=>r)),typeof e=="string"?(this._castErrorMessage=e,this._castFunction):(e!=null&&(this._castFunction=e),n!=null&&(this._castErrorMessage=n),this._castFunction))};Kt.prototype.cast=function(){throw new Error("Base SchemaType class does not implement a `cast()` function")};Kt.set=function(e,n){this.hasOwnProperty("defaultOptions")||(this.defaultOptions=Object.assign({},this.defaultOptions)),this.defaultOptions[e]=n};Kt.get=function(t){this.getters=this.hasOwnProperty("getters")?this.getters:[],this.getters.push(t)};Kt.prototype.default=function(t){if(arguments.length===1){if(t===void 0){this.defaultValue=void 0;return}if(t!=null&&t.instanceOfSchema)throw new a7("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=t,this.defaultValue}else arguments.length>1&&(this.defaultValue=[...arguments]);return this.defaultValue};Kt.prototype.index=function(t){return this._index=t,am.expires(this._index),this};Kt.prototype.unique=function(e,n){if(this._index===!1){if(!e)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}return!this.options.hasOwnProperty("index")&&e===!1?this:(this._index==null||this._index===!0?this._index={}:typeof this._index=="string"&&(this._index={type:this._index}),this._index.unique=!!e,typeof n=="string"&&(this._duplicateKeyErrorMessage=n),this)};Kt.prototype.text=function(t){if(this._index===!1){if(!t)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}return!this.options.hasOwnProperty("index")&&t===!1?this:(this._index===null||this._index===void 0||typeof this._index=="boolean"?this._index={}:typeof this._index=="string"&&(this._index={type:this._index}),this._index.text=t,this)};Kt.prototype.sparse=function(t){if(this._index===!1){if(!t)return this;throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}return!this.options.hasOwnProperty("index")&&t===!1?this:(this._index==null||typeof this._index=="boolean"?this._index={}:typeof this._index=="string"&&(this._index={type:this._index}),this._index.sparse=t,this)};Kt.prototype.immutable=function(t){return this.$immutable=t,GG(this),this};Kt.prototype.transform=function(t){return this.options.transform=t,this};Kt.prototype.set=function(t){if(typeof t!="function")throw new TypeError("A setter must be a function.");return this.setters.push(t),this};Kt.prototype.get=function(t){if(typeof t!="function")throw new TypeError("A getter must be a function.");return this.getters.push(t),this};Kt.prototype.validateAll=function(t){for(let e=0;e<t.length;e++)this.validate(t[e]);return this};Kt.prototype.validate=function(t,e,n){if(typeof t=="function"||t&&am.getFunctionName(t.constructor)==="RegExp"){let s;return typeof e=="function"?(s={validator:t,message:e},s.type=n||"user defined"):e instanceof Object&&!n?(s=KG(e)?Object.assign({},e):WC(e),s.message||(s.message=s.msg),s.validator=t,s.type=s.type||"user defined"):(e==null&&(e=a7.messages.general.default),n||(n="user defined"),s={message:e,type:n,validator:t}),this.validators.push(s),this}let r,i,a;for(r=0,i=arguments.length;r<i;r++){if(a=arguments[r],!am.isPOJO(a)){let s="Invalid validator. Received ("+typeof a+") "+a+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new Error(s)}this.validate(a.validator,a)}return this};Kt.prototype.required=function(t,e){let n={};if(arguments.length>0&&t==null)return this.validators=this.validators.filter(function(a){return a.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if(typeof t=="object"&&(n=t,e=n.message||e,t=t.isRequired),t===!1)return this.validators=this.validators.filter(function(a){return a.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;let r=this;this.isRequired=!0,this.requiredValidator=function(a){let s=this&&this.$__&&this.$__.cachedRequired;if(s!=null&&!this.$__isSelected(r.path)&&!this[dkt](r.path))return!0;if(s!=null&&r.path in s){let o=s[r.path]?r.checkRequired(a,this):!0;return delete s[r.path],o}else if(typeof t=="function")return t.apply(this)?r.checkRequired(a,this):!0;return r.checkRequired(a,this)},this.originalRequiredValue=t,typeof t=="string"&&(e=t,t=void 0);let i=e||a7.messages.general.required;return this.validators.unshift(Object.assign({},n,{validator:this.requiredValidator,message:i,type:"required"})),this};Kt.prototype.ref=function(t){return this.options.ref=t,this};Kt.prototype.getDefault=function(t,e,n){let r;if(this.defaultValue==null)return this.defaultValue;if(typeof this.defaultValue=="function"?this.defaultValue===Date.now||this.defaultValue===Array||this.defaultValue.name.toLowerCase()==="objectid"?r=this.defaultValue.call(t):r=this.defaultValue.call(t,t):r=this.defaultValue,r!=null){if(typeof r=="object"&&(!this.options||!this.options.shared)&&(r=WC(r)),n&&n.skipCast)return this._applySetters(r,t);let i=this.applySetters(r,t,e,void 0,pkt);return i&&!Array.isArray(i)&&i.$isSingleNested&&(i.$__parent=t),i}return r};Kt.prototype._applySetters=function(t,e,n,r,i){let a=t;if(n)return a;let s=this.setters;for(let o=s.length-1;o>=0;o--)a=s[o].call(e,a,r,this,i);return a};Kt.prototype._castNullish=function(e){return e};Kt.prototype.applySetters=function(t,e,n,r,i){let a=this._applySetters(t,e,n,r,i);return a==null?this._castNullish(a):(a=this.cast(a,e,n,r,i),a)};Kt.prototype.applyGetters=function(t,e){let n=t,r=this.getters,i=r.length;if(i===0)return n;for(let a=0;a<i;++a)n=r[a].call(e,n,this);return n};Kt.prototype.select=function(e){return this.selected=!!e,this};Kt.prototype.doValidate=async function(e,n,r){let i=!1,a=this.path,s=this.validators.filter(f=>typeof f=="object"&&f!==null);if(!s.length)return;let o=[];for(let f=0,u=s.length;f<u;++f){let c=s[f],d=c.validator,l,p=KG(c)?Object.assign({},c):WC(c);if(p.path=r&&r.path?r.path:a,p.fullPath=this.$fullPath,p.value=e,typeof e=="string"&&(p.length=e.length,p.value.length>30&&(p.value=p.value.slice(0,30)+"...")),!(e===void 0&&d!==this.requiredValidator)){if(d instanceof RegExp){if(l=d.test(e),l===!1){let h=p.ErrorConstructor||Dy;throw i=new h(p,n),i[i7]=!0,i}continue}else if(typeof d!="function")continue;try{p.propsParameter?l=d.call(n,e,p):l=d.call(n,e)}catch(h){l=!1,p.reason=h,h.message&&(p.message=h.message)}if(l!=null&&typeof l.then=="function")o.push(l.then(function(h){if(h===!1){let v=p.ErrorConstructor||Dy;throw i=new v(p,n),i[i7]=!0,i}},function(h){p.reason=h,p.message=h.message,l=!1;let v=p.ErrorConstructor||Dy;throw i=new v(p,n),i[i7]=!0,i}));else if(l!==void 0&&!l){let h=p.ErrorConstructor||Dy;throw i=new h(p,n),i[i7]=!0,i}}}await Promise.all(o)};function mwe(t,e){if(t!==void 0&&!t){let n=e.ErrorConstructor||Dy,r=new n(e);return r[i7]=!0,r}}Kt.prototype.doValidateSync=function(t,e,n){let r=this.path;if(!this.validators.length)return null;let a=this.validators;if(t===void 0)if(this.validators.length!==0&&this.validators[0].type==="required")a=[this.validators[0]];else return null;let s=null,o=0,f=a.length;for(o=0;o<f;++o){let u=a[o];if(u===null||typeof u!="object")continue;let c=u.validator,d=KG(u)?Object.assign({},u):WC(u);d.path=n&&n.path?n.path:r,d.fullPath=this.$fullPath,d.value=t,typeof t=="string"&&(d.length=t.length,d.value.length>30&&(d.value=d.value.slice(0,30)+"..."));let l=!1;if(!ckt(c)){if(c instanceof RegExp){s=mwe(c.test(t),d);continue}if(typeof c=="function"){try{d.propsParameter?l=c.call(e,t,d):l=c.call(e,t)}catch(p){l=!1,d.reason=p}if(!(l!=null&&typeof l.then=="function")&&(s=mwe(l,d),s))break}}}return s};Kt._isRef=function(t,e,n,r){let i=r&&t.options&&(t.options.ref||t.options.refPath);if(!i&&n&&n.$__!=null){let a=n.$__fullPath(t.path,!0),s=n.ownerDocument();i=a!=null&&s.$populated(a)||n.$populated(t.path)}return i?e==null||!Buffer.isBuffer(e)&&e._bsontype!=="Binary"&&am.isObject(e)?!0:r:!1};Kt.prototype._castRef=function(e,n,r,i){if(e==null)return e;if(e.$__!=null)return e.$__.wasPopulated=e.$__.wasPopulated||{value:e._doc._id},e;if(Buffer.isBuffer(e)||!am.isObject(e)){if(r)return e;throw new YG(this.instance,e,this.path,null,this)}let a=n.$__fullPath(this.path,!0),o=n.ownerDocument().$populated(a,!0),f=e;if(!n.$__.populated||!n.$__.populated[a]||!n.$__.populated[a].options||!n.$__.populated[a].options.options||!n.$__.populated[a].options.options.lean){let u=o?o.options[hwe]:n.constructor.db.model(this.options.ref);f=u.hydrate(e,null,i),f.$__.wasPopulated={value:f._doc._id,options:{[hwe]:u}}}return f};function ywe(t,e){return this.castForQuery(null,t,e)}function hkt(t,e){let n=this;return Array.isArray(t)?t.map(function(r){return n.castForQuery(null,r,e)}):[this.castForQuery(null,t,e)]}function bwe(t,e){let n=this;return Array.isArray(t)?t.map(function(r){return Array.isArray(r)&&r.length===0?r:n.castForQuery(null,r,e)}):[this.castForQuery(null,t,e)]}Kt.prototype.$conditionalHandlers={$all:hkt,$eq:ywe,$in:bwe,$ne:ywe,$nin:bwe,$exists:fkt,$type:ukt};Kt.prototype.castForQuery=function(t,e,n){let r;if(t!=null){if(r=this.$conditionalHandlers[t],!r)throw new Error("Can't use "+t);return r.call(this,e,n)}try{return this.applySetters(e,n)}catch(i){throw i instanceof YG&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};Kt.checkRequired=function(t){return arguments.length!==0&&(this._checkRequired=t),this._checkRequired};Kt.prototype.checkRequired=function(t){return t!=null};Kt.prototype.clone=function(){let t=Object.assign({},this.options),e=new this.constructor(this.path,t,this.instance,this.parentSchema);return e.validators=this.validators.slice(),this.requiredValidator!==void 0&&(e.requiredValidator=this.requiredValidator),this.defaultValue!==void 0&&(e.defaultValue=this.defaultValue),this.$immutable!==void 0&&this.options.immutable===void 0&&(e.$immutable=this.$immutable,GG(e)),this._index!==void 0&&(e._index=this._index),this.selected!==void 0&&(e.selected=this.selected),this.isRequired!==void 0&&(e.isRequired=this.isRequired),this.originalRequiredValue!==void 0&&(e.originalRequiredValue=this.originalRequiredValue),e.getters=this.getters.slice(),e.setters=this.setters.slice(),e};Kt.prototype.getEmbeddedSchemaType=function(){return this.embeddedSchemaType};Kt.prototype._duplicateKeyErrorMessage=null;Kt.prototype.toJSONSchema=function(e){throw new Error(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`)};Kt.prototype.autoEncryptionType=function(){return null};vwe.exports=GC=Kt;GC.CastError=YG;GC.ValidatorError=Dy});var ZG=y((I0n,_we)=>{"use strict";var cc=a0(),_o=class{constructor(e){Object.assign(this,e),e!=null&&e.options!=null&&(this.options=Object.assign({},e.options))}};Object.defineProperty(_o.prototype,"ref",cc);Object.defineProperty(_o.prototype,"refPath",cc);Object.defineProperty(_o.prototype,"localField",cc);Object.defineProperty(_o.prototype,"foreignField",cc);Object.defineProperty(_o.prototype,"justOne",cc);Object.defineProperty(_o.prototype,"count",cc);Object.defineProperty(_o.prototype,"match",cc);Object.defineProperty(_o.prototype,"options",cc);Object.defineProperty(_o.prototype,"skip",cc);Object.defineProperty(_o.prototype,"limit",cc);Object.defineProperty(_o.prototype,"perDocumentLimit",cc);_we.exports=_o});var KC=y((M0n,Awe)=>{"use strict";Awe.exports=function(e,n,r){return e==null?e:(e._doc!=null&&(e=e._doc),arguments.length>=3?typeof e!="object"||r===void 0?void 0:(e instanceof Map?e.set(n,r):e[n]=r,r):n==="$*"?e instanceof Map?Array.from(e.values()):Object.keys(e).map(i=>e[i]):e instanceof Map?e.get(n):e[n])}});var XG=y((P0n,xwe)=>{"use strict";var mkt=on(),ykt=vG(),wwe=KC(),Ewe=s0(),bkt=Q("util"),gkt=Vt(),Swe=/(\.\d+$|\.\d+\.)/g;xwe.exports=function(e,n,r,i,a){if(e==null)return[];if(typeof e=="string"&&a!=null&&ykt(a,e))throw new mkt("refPath `"+e+"` must not be excluded in projection, got "+bkt.inspect(a));if(Swe.test(r)){let f=r.split(Swe);if(f[f.length-1]==="")throw new Error("Can't populate individual element in an array");let u="",c=e;for(let p=0;p<f.length;p+=2){let h=f[p];if(c.startsWith(h+"."))u+=c.substring(0,h.length)+f[p+1],c=c.substring(h.length+1);else if(p===f.length-1){u+=c,c="";break}else throw new Error("Could not normalize ref path, chunk "+h+" not in populated path")}let d=Ewe.get(u,n,wwe),l=Array.isArray(d)?d:[d];return l=gkt.array.flatten(l),l}let s=Ewe.get(e,n,wwe),o;return i!=null&&i.virtuals.hasOwnProperty(e)?o=[i.virtuals[e].applyGetters(void 0,n)]:o=Array.isArray(s)?s:[s],o}});var YC=y((R0n,Twe)=>{"use strict";var vkt=XG(),_kt=Vt(),Akt=ct().modelSymbol;function g1(t,e){this.path=e,this.getters=[],this.setters=[],this.options=Object.assign({},t)}g1.prototype._applyDefaultGetters=function(){if(this.getters.length>0||this.setters.length>0)return;let e="$"+this.path;this.getters.push(function(){return this.$locals[e]}),this.setters.push(function(n){this.$locals[e]=n})};g1.prototype.clone=function(){let t=new g1(this.options,this.path);return t.getters=[].concat(this.getters),t.setters=[].concat(this.setters),t};g1.prototype.get=function(t){return this.getters.push(t),this};g1.prototype.set=function(t){return this.setters.push(t),this};g1.prototype.applyGetters=function(t,e){_kt.hasUserDefinedProperty(this.options,["ref","refPath"])&&e.$$populatedVirtuals&&e.$$populatedVirtuals.hasOwnProperty(this.path)&&(t=e.$$populatedVirtuals[this.path]);let n=t;for(let r of this.getters)n=r.call(e,n,this,e);return n};g1.prototype.applySetters=function(t,e){let n=t;for(let r of this.setters)n=r.call(e,n,this,e);return n};g1.prototype._getModelNamesForPopulate=function(e){if(this.options.refPath)return vkt(this.options.refPath,e,this.path);let n=null;return typeof this.options.ref=="function"&&!this.options.ref[Akt]?n=this.options.ref.call(e,e):n=this.options.ref,n!=null&&!Array.isArray(n)?[n]:n};Twe.exports=g1});var JG=y((k0n,Cwe)=>{"use strict";Cwe.exports=function(e){let n={_id:{auto:!0}};n._id[e.options.typeKey]="ObjectId",e.add(n)}});var QG=y((D0n,Owe)=>{"use strict";Owe.exports=function(e,n){let r=e.discriminatorMapping&&e.discriminatorMapping.value;if(r&&!("sparse"in n)){let i=e.options.discriminatorKey;n.partialFilterExpression=n.partialFilterExpression||{},n.partialFilterExpression[i]=r}return n}});var Mwe=y((N0n,Iwe)=>{"use strict";var eK=di(),wkt=Yh(),Ekt=QG();Iwe.exports=function(e){let n=[],r=new WeakMap,i=e.constructor.indexTypes,a=new Map;return s(e),n;function s(f,u,c){if(r.has(f))return;r.set(f,!0),u=u||"";let d=Object.keys(f.paths);for(let l of d){let p=f.paths[l];if(c!=null&&c.paths[l])continue;if(p._duplicateKeyErrorMessage!=null&&(f._duplicateKeyErrorMessagesByPath=f._duplicateKeyErrorMessagesByPath||{},f._duplicateKeyErrorMessagesByPath[l]=p._duplicateKeyErrorMessage),p.$isMongooseDocumentArray||p.$isSingleNested){if(eK(p,"options.excludeIndexes")!==!0&&eK(p,"schemaOptions.excludeIndexes")!==!0&&eK(p,"schema.options.excludeIndexes")!==!0&&s(p.schema,u+l+"."),p.schema.discriminators!=null){let v=p.schema.discriminators,E=Object.keys(v);for(let M of E)s(v[M],u+l+".",p.schema)}if(p.$isMongooseDocumentArray)continue}let h=p._index||p.embeddedSchemaType&&p.embeddedSchemaType._index;if(h!==!1&&h!==null&&h!==void 0){let v={},E=wkt(h),M=E?{...h}:{},D=typeof h=="string"?h:E?h.type:!1;if(D&&i.indexOf(D)!==-1)v[u+l]=D;else if(M.text)v[u+l]="text",delete M.text;else{let N=!1;h==="descending"||h==="desc"?N=!0:h==="ascending"||h==="asc"?N=!1:N=Number(h)===-1,v[u+l]=N?-1:1}delete M.type,f.options.autoIndex!=null&&(M._autoIndex=f.options.autoIndex);let $=M&&M.name;typeof $=="string"?a.has($)?Object.assign(a.get($),v):(n.push([v,M]),a.set($,v)):(n.push([v,M]),a.set($,v))}}r.delete(f),u?o(f,u):(f._indexes.forEach(function(l){let p=l[1];Ekt(f,p)}),n=n.concat(f._indexes))}function o(f,u){let c=f._indexes,d=c.length;for(let l=0;l<d;++l){let p=c[l][0],h=c[l][1],v=Object.keys(p),E=v.length,M={};for(let $=0;$<E;++$){let N=v[$];M[u+N]=p[N]}let D=Object.assign({},h);if(h!=null&&h.partialFilterExpression!=null){D.partialFilterExpression={};let $=h.partialFilterExpression;for(let N of Object.keys($))D.partialFilterExpression[u+N]=$[N]}n.push([M,D])}}}});var tK=y(($0n,Pwe)=>{"use strict";Pwe.exports=function(e){switch(e){case"p":e="primary";break;case"pp":e="primaryPreferred";break;case"s":e="secondary";break;case"sp":e="secondaryPreferred";break;case"n":e="nearest";break}return e}});var kwe=y((B0n,Rwe)=>{"use strict";Rwe.exports=function(e){return!(!e.paths.id&&e.paths._id&&e.options.id)||e.aliases&&e.aliases.id||e.virtual("id").get(Skt),e};function Skt(){return this._id!=null?this._id.toString():null}});var Nwe=y((F0n,Dwe)=>{"use strict";Dwe.exports=function(e,n){let r=Object.keys(e),i=Object.keys(n);if(r.length!==i.length)return!1;for(let a=0;a<r.length;a++){let s=r[a];if(s!==i[a]||e[s]!==n[s])return!1}return!0}});var Bwe=y((L0n,$we)=>{"use strict";$we.exports=function(e,n,r,i){return i.justOne||i.count?(e[n]=Array.isArray(r)?r[0]:r,typeof e[n]!="object"&&(e[n]=i.count?r:null)):(e[n]=Array.isArray(r)?r:r==null?[]:[r],e[n]=e[n].filter(function(a){return a&&typeof a=="object"})),e[n]}});var s7=y((q0n,Fwe)=>{"use strict";Fwe.exports=function(e){return e.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}});var ZC=y((U0n,Lwe)=>{"use strict";Lwe.exports=xkt;function xkt(t,e){return t==null?null:typeof t=="boolean"?e:typeof t[e]=="boolean"?t[e]?e:null:e in t?t[e]:e}});var rK=y((j0n,qwe)=>{"use strict";var Tkt=s7(),v1=ZC();qwe.exports=sm;function sm(t,e,n){if(e==null)return;if(Object.keys(e).some(o=>o[0]==="$")){if(e.$push&&s(e.$push),e.$addToSet&&s(e.$addToSet),e.$set!=null){let o=Object.keys(e.$set);for(let f of o)nK(n,f,e.$set,t)}if(e.$setOnInsert!=null){let o=Object.keys(e.$setOnInsert);for(let f of o)nK(n,f,e.$setOnInsert,t)}}let a=Object.keys(e).filter(o=>o[0]!=="$");for(let o of a)nK(n,o,e,t);function s(o){for(let f of Object.keys(o)){let u=n.path(f.replace(/\.\$\./i,".").replace(/.\$$/,""));if(o[f]&&u&&u.$isMongooseDocumentArray&&u.schema.options.timestamps){let c=u.schema.options.timestamps,d=v1(c,"createdAt"),l=v1(c,"updatedAt");o[f].$each?o[f].$each.forEach(function(p){l!=null&&(p[l]=t),d!=null&&(p[d]=t),sm(t,p,u.schema)}):(l!=null&&(o[f][l]=t),d!=null&&(o[f][d]=t),sm(t,o[f],u.schema))}}}}function Ckt(t,e,n){let r=e.schema.options.timestamps,i=t.length;if(!r){for(let o=0;o<i;++o)sm(n,t[o],e.schema);return}let a=v1(r,"createdAt"),s=v1(r,"updatedAt");for(let o=0;o<i;++o)s!=null&&(t[o][s]=n),a!=null&&(t[o][a]=n),sm(n,t[o],e.schema)}function Okt(t,e,n){let r=e.schema.options.timestamps;if(!r){sm(n,t,e.schema);return}let i=v1(r,"createdAt"),a=v1(r,"updatedAt");a!=null&&(t[a]=n),i!=null&&(t[i]=n),sm(n,t,e.schema)}function nK(t,e,n,r){let i=Tkt(e),a=t.path(i);if(!a)return;let s=[],o=i.split(".");for(let f=o.length-1;f>0;--f){let u=t.path(o.slice(0,f).join("."));u!=null&&(u.$isMongooseDocumentArray||u.$isSingleNested)&&s.push({parentPath:e.split(".").slice(0,f).join("."),parentSchemaType:u})}if(Array.isArray(n[e])&&a.$isMongooseDocumentArray)Ckt(n[e],a,r);else if(n[e]&&a.$isSingleNested)Okt(n[e],a,r);else if(s.length>0)for(let f of s){let u=f.parentPath,c=f.parentSchemaType,d=c.schema.options.timestamps,l=v1(d,"updatedAt");if(!(!d||l==null)){if(c.$isSingleNested)n[u+"."+l]=r;else if(c.$isMongooseDocumentArray){let p=e.substring(u.length+1);if(/^\d+$/.test(p)){n[u+"."+p][l]=r;continue}let h=p.indexOf(".");p=h!==-1?p.substring(0,h):p,n[u+"."+p+"."+l]=r}}}else if(a.schema!=null&&a.schema!=t&&n[e]){let f=a.schema.options.timestamps,u=v1(f,"createdAt"),c=v1(f,"updatedAt");if(!f)return;c!=null&&(n[e][c]=r),u!=null&&(n[e][u]=r)}}});var iK=y((V0n,Uwe)=>{"use strict";var Ikt=di();Uwe.exports=Mkt;function Mkt(t,e,n,r,i,a){let s=r,o=s,f=Ikt(i,"timestamps",!0);if(!f||s==null)return r;let u=f!=null&&f.createdAt===!1,c=f!=null&&f.updatedAt===!1;if(a)return r&&r.$set&&(r=r.$set,s.$set={},o=s.$set),!c&&n&&!r[n]&&(o[n]=t),!u&&e&&!r[e]&&(o[e]=t),s;if(r=r||{},Array.isArray(s))return n==null||s.push({$set:{[n]:t}}),s;if(s.$set=s.$set||{},!c&&n&&(!r.$currentDate||!r.$currentDate[n])){let d=!1;if(n.indexOf(".")!==-1){let l=n.split(".");for(let p=1;p<l.length;++p){let h=l.slice(-p).join("."),v=l.slice(0,-p).join(".");if(r[v]!=null){r[v][h]=t,d=!0;break}else if(r.$set&&r.$set[v]){r.$set[v][h]=t,d=!0;break}}}d||(s.$set[n]=t),s.hasOwnProperty(n)&&delete s[n]}if(!u&&e){r[e]&&delete r[e],r.$set&&r.$set[e]&&delete r.$set[e];let d=!1;if(e.indexOf(".")!==-1){let l=e.split(".");for(let p=1;p<l.length;++p){let h=l.slice(-p).join("."),v=l.slice(0,-p).join(".");if(r[v]!=null){r[v][h]=t,d=!0;break}else if(r.$set&&r.$set[v]){r.$set[v][h]=t,d=!0;break}}}d||(s.$setOnInsert=s.$setOnInsert||{},s.$setOnInsert[e]=t)}return Object.keys(s.$set).length===0&&delete s.$set,s}});var Vwe=y((z0n,jwe)=>{"use strict";jwe.exports=function(e,n,r,i,a){let s=n!=null&&n.updatedAt===!1,o=n!=null&&n.createdAt===!1,f=r!=null?r():e.ownerDocument().constructor.base.now();if(!o&&(e.isNew||e.$isSubdocument)&&i&&!e.$__getValue(i)&&e.$__isSelected(i)&&e.$set(i,f,void 0,{overwriteImmutable:!0}),!s&&a&&(e.isNew||e.$isModified())){let u=f;e.isNew&&i!=null&&(u=e.$__getValue(i)),e.$set(a,u)}}});var Gwe=y((H0n,Wwe)=>{"use strict";var Pkt=rK(),Rkt=iK(),kkt=di(),zwe=ZC(),Dkt=Vwe(),Nkt=Qh(),Hwe=new Set(["replaceOne","findOneAndReplace"]);Wwe.exports=function(e,n){let r=e.childSchemas.find(i);function i(d){return!!d.schema.options.timestamps}if(!n&&!r)return;let a=zwe(n,"createdAt"),s=zwe(n,"updatedAt"),o=n!=null&&n.hasOwnProperty("currentTime")?n.currentTime:null,f={};if(e.$timestamps={createdAt:a,updatedAt:s},a&&!e.paths[a]){let d=e.base!=null?e.base.get("timestamps.createdAt.immutable"):null,l=d??!0;f[a]={[e.options.typeKey||"type"]:Date,immutable:l}}s&&!e.paths[s]&&(f[s]=Date),e.add(f),e.pre("save",function(){let l=kkt(this,"$__.saveOptions.timestamps");l!==!1&&Dkt(this,l,o,a,s)}),e.methods.initializeTimestamps=function(){let d=o!=null?o():this.constructor.base.now();if(a&&!this.get(a)&&this.$set(a,d),s&&!this.get(s)&&this.$set(s,d),this.$isSubdocument)return this;let l=this.$getAllSubdocs();for(let p of l)p.initializeTimestamps&&p.initializeTimestamps();return this},c[Nkt.builtInMiddleware]=!0;let u={query:!0,model:!1};e.pre("findOneAndReplace",u,c),e.pre("findOneAndUpdate",u,c),e.pre("replaceOne",u,c),e.pre("update",u,c),e.pre("updateOne",u,c),e.pre("updateMany",u,c);function c(){let d=o!=null?o():this.model.base.now();Hwe.has(this.op)&&this.getUpdate()==null&&this.setUpdate({}),Rkt(d,a,s,this.getUpdate(),this._mongooseOptions,Hwe.has(this.op)),Pkt(d,this.getUpdate(),this.model.schema)}}});var Ywe=y((W0n,Kwe)=>{"use strict";var $kt=on(),Bkt=Q("util");Kwe.exports=Fkt;function Fkt(t,e){if(typeof t!="string"&&typeof t!="function")throw new $kt('Invalid ref at path "'+e+'". Got '+Bkt.inspect(t,{depth:0}))}});var o7=y(Ny=>{"use strict";var Zwe=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]);Ny.queryOperations=Zwe;var Lkt=Zwe.concat(["validate"]);Ny.queryMiddlewareFunctions=Lkt;var qkt=["aggregate"];Ny.aggregateMiddlewareFunctions=qkt;var Ukt=["bulkWrite","createCollection","insertMany"];Ny.modelMiddlewareFunctions=Ukt;var jkt=["validate","save","remove","updateOne","deleteOne","init"];Ny.documentMiddlewareFunctions=jkt});var Jwe=y((K0n,Xwe)=>{"use strict";Xwe.exports=jt().Double});var XC=y((Y0n,rEe)=>{"use strict";var Vkt=on(),Qwe=Qr(),zkt=Vt().deepEqual,Hkt=Ds(),Wkt=MC(),eEe=Q("util"),Gkt=Kh(),aK=Da(),Kkt=xC(),tEe=ct().populateModelSymbol;var lc=class extends Map{constructor(e,n,r,i,a){Hkt(e)==="Object"&&(e=Object.keys(e).reduce((s,o)=>s.concat([[o,e[o]]]),[])),super(e),this.$__parent=r!=null&&r.$__!=null?r:null,this.$__parent?.$isSingleNested&&this.$__parent.$basePath?(this.$__path=this.$__parent.$basePath+"."+n,this.$__pathRelativeToParent=n):a?.path?(this.$__path=a.path,this.$__pathRelativeToParent=null):(this.$__path=n,this.$__pathRelativeToParent=null),this.$__schemaType=i,this.$__runDeferred()}$init(e,n){nEe(e),super.set(e,n),n!=null&&n.$isSingleNested&&(n.$basePath=this.$__path+"."+e,this.$__pathRelativeToParent!=null?n.$pathRelativeToParent=this.$__pathRelativeToParent+"."+e:n.$pathRelativeToParent=this.$__path+"."+e)}$__set(e,n){super.set(e,n)}get(e,n){return aK(e,"ObjectId")&&(e=e.toString()),n=n||{},n.getters===!1?super.get(e):this.$__schemaType.applyGetters(super.get(e),this.$__parent)}set(e,n){if(aK(e,"ObjectId")&&(e=e.toString()),nEe(e),n=Wkt(n),this.$__schemaType==null){this.$__deferred=this.$__deferred||[],this.$__deferred.push({key:e,value:n});return}let r,i=this.$__parent,a=i!=null&&i.$__&&i.$__.populated?i.$populated(o.call(this),!0)||i.$populated(this.$__path,!0):null,s=this.get(e);if(a!=null){if(this.$__schemaType.$isSingleNested)throw new Vkt(`Cannot manually populate single nested subdoc underneath Map at path "${this.$__path}". Try using an array instead of a Map.`);Array.isArray(n)&&this.$__schemaType.$isMongooseArray?n=n.map(f=>(f.$__==null&&(f=new a.options[tEe](f)),f.$__.wasPopulated={value:f._doc._id},f)):n!=null&&(n.$__==null&&(n=new a.options[tEe](n)),n.$__.wasPopulated={value:n._doc._id})}else try{let f=null;(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested||this.$__schemaType.$isMongooseArray||this.$__schemaType.$isSchemaMap)&&(f={path:o.call(this)},this.$__schemaType.$isSingleNested&&(f.pathRelativeToParent=this.$__pathRelativeToParent!=null?this.$__pathRelativeToParent+"."+e:this.$__path+"."+e)),n=this.$__schemaType.applySetters(n,this.$__parent,!1,this.get(e),f)}catch(f){if(this.$__parent!=null&&this.$__parent.$__!=null){this.$__parent.invalidate(o.call(this),f);return}throw f}if(super.set(e,n),n!=null&&n.$isSingleNested&&(this.$__pathRelativeToParent!=null?n.$pathRelativeToParent=this.$__pathRelativeToParent+"."+e:n.$pathRelativeToParent=this.$__path+"."+e),i!=null&&i.$__!=null&&!zkt(n,s)){let f;this.$__pathRelativeToParent!=null?f=this.$__pathRelativeToParent+"."+e:f=o.call(this),i.markModified(f),(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)&&Kkt(i,f)}function o(){return r||(r=this.$__path+"."+e,r)}}clear(){super.clear();let e=this.$__parent;e?.markModified(this.$__path)}delete(e){return aK(e,"ObjectId")&&(e=e.toString()),this.set(e,void 0),super.delete(e)}toBSON(){return new Map(this)}toObject(e){if(e&&e.flattenMaps){let n={},r=this.keys();for(let i of r)n[i]=Qwe(this.get(i),e);return n}return new Map(this)}$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)}toJSON(e){if(typeof(e&&e.flattenMaps)!="boolean"||e.flattenMaps){let n={},r=this.keys();for(let i of r)n[i]=Qwe(this.get(i),e);return n}return new Map(this)}inspect(){return new Map(this)}$__runDeferred(){if(this.$__deferred){for(let e of this.$__deferred)this.set(e.key,e.value);this.$__deferred=null}}};eEe.inspect.custom&&Object.defineProperty(lc.prototype,eEe.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:lc.prototype.inspect});Object.defineProperty(lc.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(lc.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(lc.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(lc.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(lc.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0});Object.defineProperty(lc.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0});function nEe(t){let e=typeof t;if(e!=="string")throw new TypeError(`Mongoose maps only support string keys, got ${e}`);if(t.startsWith("$"))throw new Error(`Mongoose maps do not support keys that start with "$", got "${t}"`);if(t.includes("."))throw new Error(`Mongoose maps do not support keys that contain ".", got "${t}"`);if(Gkt.has(t))throw new Error(`Mongoose maps do not support reserved key name "${t}"`)}rEe.exports=lc});var aEe=y((Z0n,iEe)=>{"use strict";iEe.exports=jt().UUID});var $y=y(G0=>{"use strict";G0.Array=OG();G0.Buffer=bC();G0.Document=G0.Embedded=Ry();G0.DocumentArray=rm();G0.Double=Jwe();G0.Decimal128=QT();G0.ObjectId=Zp();G0.Map=XC();G0.Subdocument=RC();G0.UUID=aEe()});var oEe=y((J0n,sEe)=>{"use strict";var Ykt=bo(),By=class extends Ykt{},sK=a0();Object.defineProperty(By.prototype,"enum",sK);Object.defineProperty(By.prototype,"of",sK);Object.defineProperty(By.prototype,"castNonArrays",sK);sEe.exports=By});var uEe=y((Q0n,fEe)=>{"use strict";fEe.exports=oK;function oK(t){if(!Array.isArray(t))return{min:0,max:0,containsNonArrayItem:!0};if(t.length===0)return{min:1,max:1,containsNonArrayItem:!1};if(t.length===1&&!Array.isArray(t[0]))return{min:1,max:1,containsNonArrayItem:!1};let e=oK(t[0]);for(let n=1;n<t.length;++n){let r=oK(t[n]);r.min<e.min&&(e.min=r.min),r.max>e.max&&(e.max=r.max),e.containsNonArrayItem=e.containsNonArrayItem||r.containsNonArrayItem}return e.min=e.min+1,e.max=e.max+1,e}});var f7=y((efn,lEe)=>{"use strict";var cEe=Q("assert");lEe.exports=function(e){if(e==null)return e;if(e==="")return null;if((typeof e=="string"||typeof e=="boolean")&&(e=Number(e)),cEe.ok(!isNaN(e)),e instanceof Number)return e.valueOf();if(typeof e=="number")return e;if(!Array.isArray(e)&&typeof e.valueOf=="function")return Number(e.valueOf());if(e.toString&&!Array.isArray(e)&&e.toString()==Number(e))return Number(e);cEe.ok(!1)}});var fK=y((tfn,dEe)=>{"use strict";dEe.exports=function(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))for(let n=e.length-1;n>=0;--n)e[n]===void 0&&e.splice(n,1);for(let n of Object.keys(e))e[n]===void 0&&delete e[n];return e}});var mEe=y((nfn,hEe)=>{"use strict";var Fy=fs(),pEe=Xp(),JC=f7(),Zkt=fK(),Xkt=new Set(["$and","$or"]),Jkt=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),Qkt=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),eDt=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),tDt=new Set(["$arrayElemAt","$first","$last"]),nDt=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),rDt=new Set(["$not"]);hEe.exports=function(e,n,r){if(typeof e=="boolean")return e;if(typeof e!="object"||e===null)throw new Error("`$expr` must be an object or boolean literal");return K0(e,n,r)};function K0(t,e,n){if(u7(t)||t===null)return t;t.$cond!=null?Array.isArray(t.$cond)?t.$cond=t.$cond.map(i=>K0(i,e,n)):(t.$cond.if=K0(t.$cond.if,e,n),t.$cond.then=K0(t.$cond.then,e,n),t.$cond.else=K0(t.$cond.else,e,n)):t.$ifNull!=null?t.$ifNull.map(i=>K0(i,e,n)):t.$switch!=null&&(Array.isArray(t.$switch.branches)&&(t.$switch.branches=t.$switch.branches.map(i=>K0(i,e,n))),"default"in t.$switch&&(t.$switch.default=K0(t.$switch.default,e,n)));let r=Object.keys(t);for(let i of r)Xkt.has(i)?t[i]=t[i].map(a=>K0(a,e,n)):Jkt.has(i)?t[i]=sDt(t[i],e,n):Qkt.has(i)?t[i]=aDt(t[i],e,n):eDt.has(i)?t[i]=uK(t[i],e,n):rDt.has(i)&&(t[i]=K0(t[i],e,n));if(t.$in&&(t.$in=iDt(t.$in,e,n)),t.$size&&(t.$size=uK(t.$size,e,n)),t.$round){let i=t.$round;if(!Array.isArray(i)||i.length<1||i.length>2)throw new Fy("Array",i,"$round");t.$round=i.map(a=>uK(a,e,n))}return Zkt(t),t}function uK(t){if(!QC(t))return t;try{return JC(t)}catch{throw new Fy("Number",t)}}function iDt(t,e,n){let r=t[1];if(!u7(r))return t;let i=t[0],a=e.path(r.slice(1));if(a===null){if(n===!1)return t;if(n==="throw")throw new pEe("$in");return}if(!a.$isMongooseArray)throw new Error("Path must be an array for $in");return[a.embeddedSchemaType.cast(i),r]}function aDt(t){if(!Array.isArray(t)){if(!QC(t))return t;try{return JC(t)}catch{throw new Fy("Number",t)}}return t.map(e=>{if(!QC(e))return e;try{return JC(e)}catch{throw new Fy("Number",e)}})}function sDt(t,e,n){if(!Array.isArray(t)||t.length!==2)throw new Error("Comparison operator must be an array of length 2");t[0]=K0(t[0],e,n);let r=t[0];if(QC(t[1])){let i=null,a=null,s=null;if(u7(r))i=r.slice(1),a=e.path(i);else if(typeof r=="object"&&r!=null)for(let f of Object.keys(r))nDt.has(f)&&u7(r[f])?(i=r[f].slice(1)+"."+f,s=JC):tDt.has(f)&&u7(r[f])&&(i=r[f].slice(1)+"."+f,a=e.path(r[f].slice(1)),a!=null&&a.$isMongooseArray&&(a=a.embeddedSchemaType));let o=typeof t[1]=="object"&&t[1]!=null&&t[1].$literal!=null;if(a!=null)o?t[1]={$literal:a.cast(t[1].$literal)}:t[1]=a.cast(t[1]);else if(s!=null)if(o)try{t[1]={$literal:s(t[1].$literal)}}catch{throw new Fy(s.name.replace(/^cast/,""),t[1],i+".$literal")}else try{t[1]=s(t[1])}catch{throw new Fy(s.name.replace(/^cast/,""),t[1],i)}else{if(i!=null&&n===!0)return;if(i!=null&&n==="throw")throw new pEe(i)}}else t[1]=K0(t[1]);return t}function u7(t){return typeof t=="string"&&t[0]==="$"}function QC(t){return typeof t=="string"&&t[0]==="$"?!1:typeof t=="object"&&t!==null&&Object.keys(t).find(e=>e[0]==="$")?t.$literal!=null:!0}});var eO=y((rfn,yEe)=>{"use strict";var oDt=fs();yEe.exports=function(e,n){if(e==null)return e;if(e._id&&typeof e._id=="string")return e._id;if(e.toString&&e.toString!==Object.prototype.toString&&!Array.isArray(e))return e.toString();throw new oDt("string",e,n)}});var _Ee=y((ifn,vEe)=>{"use strict";var fDt=fs(),bEe=hC(),gEe=eO();vEe.exports=function(e,n){if(e==null||typeof e!="object")throw new fDt("$text",e,n);return e.$search!=null&&(e.$search=gEe(e.$search,n+".$search")),e.$language!=null&&(e.$language=gEe(e.$language,n+".$language")),e.$caseSensitive!=null&&(e.$caseSensitive=bEe(e.$caseSensitive,n+".$castSensitive")),e.$diacriticSensitive!=null&&(e.$diacriticSensitive=bEe(e.$diacriticSensitive,n+".$diacriticSensitive")),e}});var c7=y((afn,AEe)=>{"use strict";var uDt=new Set(["$ref","$id","$db"]);AEe.exports=function(e){return e[0]==="$"&&!uDt.has(e)}});var om=y((sfn,TEe)=>{"use strict";var wEe=fs(),cK=Xp(),cDt=l7(),lDt=mEe(),dDt=eO(),pDt=_Ee(),hDt=di(),EEe=IC(),SEe=c7(),mDt=Q("util"),dK=Yh(),lK=W9(),xEe=Vt(),yDt=["Polygon","MultiPolygon"];TEe.exports=function t(e,n,r,i){if(Array.isArray(n))throw new Error("Query filter must be an object, got an array ",mDt.inspect(n));if(n==null)return n;e!=null&&e.discriminators!=null&&n[e.options.discriminatorKey]!=null&&(e=EEe(e,n[e.options.discriminatorKey])||e);let a=Object.keys(n),s=a.length,o,f,u,c,d,l,p;for(r=r||{};s--;)if(d=a[s],p=n[d],d==="$or"||d==="$nor"||d==="$and"){if(!Array.isArray(p))throw new wEe("Array",p,d);for(let h=p.length-1;h>=0;h--){if(p[h]==null||typeof p[h]!="object")throw new wEe("Object",p[h],d+"."+h);let v=Object.keys(p[h]).length,E=p[h][e.options.discriminatorKey];if(E==null)p[h]=t(e,p[h],r,i);else{let M=EEe(i.schema,E);p[h]=t(M||e,p[h],r,i)}Object.keys(p[h]).length===0&&v!==0&&p.splice(h,1)}p.length===0&&delete n[d]}else if(d==="$where"){if(l=typeof p,l!=="string"&&l!=="function")throw new Error("Must have a string or function for $where");l==="function"&&(n[d]=p.toString());continue}else if(d==="$expr"){p=lDt(p,e);continue}else if(d==="$elemMatch")p=t(e,p,r,i);else if(d==="$text")p=pDt(p,d);else if(d==="$comment"&&!e.paths.hasOwnProperty("$comment"))p=dDt(p,d),n[d]=p;else{if(!e)continue;if(u=e.path(d),!u){let h=d.split("."),v=h.length;for(;v--;){let E=h.slice(0,v).join("."),M=h.slice(v).join("."),D=e.path(E),$=D&&D.schema&&D.schema.options&&D.schema.options.discriminatorKey;if(D!=null&&(D.schema&&D.schema.discriminators)!=null&&$!=null&&M!==$){let N=hDt(n,E+"."+$),V=D.schema.discriminators;typeof N=="string"&&V[N]!=null?u=V[N].path(M):N!=null&&Object.keys(N).length===1&&Array.isArray(N.$in)&&N.$in.length===1&&typeof N.$in[0]=="string"&&V[N.$in[0]]!=null&&(u=V[N.$in[0]].path(M))}}}if(u){if(p==null)continue;if(xEe.isPOJO(p))if(f=Object.keys(p).some(SEe),!f)n[d]=u.castForQuery(null,p,i);else{let h=Object.keys(p),v,E=h.length;for(;E--;)if(v=h[E],c=p[v],v==="$elemMatch")c&&u!=null&&u.schema!=null?t(u.schema,c,r,i):c&&u!=null&&u.$isMongooseArray&&(xEe.isPOJO(c)&&c.$not!=null?t(e,c,r,i):p[v]=u.castForQuery(v,c,i));else if(v==="$not"){if(c&&u){if(o=Object.keys(c),o.length&&SEe(o[0]))for(let M in c)c[M]=u.castForQuery(M,c[M],i);else p[v]=u.castForQuery(v,c,i);continue}}else p[v]=u.castForQuery(v,c,i)}else if(Array.isArray(p)&&["Buffer","Array"].indexOf(u.instance)===-1&&!r.sanitizeFilter){let h=[],v=p;for(let E of v)h.push(u.castForQuery(null,E,i));n[d]={$in:h}}else n[d]=u.castForQuery(null,p,i)}else{let h=d.split("."),v=h.length,E,M,D;for(;v--&&(E=h.slice(0,v).join("."),u=e.path(E),!u););if(u){if(u.schema){D={},M=h.slice(v).join("."),D[M]=p;let V=t(u.schema,D,r,i)[M];V===void 0?delete n[d]:n[d]=V}else n[d]=p;continue}if(dK(p)){let V="";if(p.$near?V="$near":p.$nearSphere?V="$nearSphere":p.$within?V="$within":p.$geoIntersects?V="$geoIntersects":p.$geoWithin&&(V="$geoWithin"),V){let j=new cDt.Number("__QueryCasting__",null,null,e),K=p[V];if(p.$maxDistance!=null&&(p.$maxDistance=j.castForQuery(null,p.$maxDistance,i)),p.$minDistance!=null&&(p.$minDistance=j.castForQuery(null,p.$minDistance,i)),V==="$within"){let Y=K.$center||K.$centerSphere||K.$box||K.$polygon;if(!Y)throw new Error("Bad $within parameter: "+JSON.stringify(p));K=Y}else if(V==="$near"&&typeof K.type=="string"&&Array.isArray(K.coordinates))K=K.coordinates;else if((V==="$near"||V==="$nearSphere"||V==="$geoIntersects")&&K.$geometry&&typeof K.$geometry.type=="string"&&Array.isArray(K.$geometry.coordinates))K.$maxDistance!=null&&(K.$maxDistance=j.castForQuery(null,K.$maxDistance,i)),K.$minDistance!=null&&(K.$minDistance=j.castForQuery(null,K.$minDistance,i)),lK(K.$geometry)&&(K.$geometry=K.$geometry.toObject({transform:!1,virtuals:!1})),K=K.$geometry.coordinates;else if(V==="$geoWithin")if(K.$geometry){lK(K.$geometry)&&(K.$geometry=K.$geometry.toObject({virtuals:!1}));let Y=K.$geometry.type;if(yDt.indexOf(Y)===-1)throw new Error('Invalid geoJSON type for $geoWithin "'+Y+'", must be "Polygon" or "MultiPolygon"');K=K.$geometry.coordinates}else K=K.$box||K.$polygon||K.$center||K.$centerSphere,lK(K)&&(K=K.toObject({virtuals:!1}));pK(K,j,i);continue}}if(e.nested[d])continue;let $="strict"in r?r.strict:e.options.strict,N=bDt(r,e._userProvidedOptions,e.options,i);if(r.upsert&&$)throw $==="throw"?new cK(d):new cK(d,'Path "'+d+'" is not in schema, strict mode is `true`, and upsert is `true`.');if(N==="throw")throw new cK(d,'Path "'+d+`" is not in schema and strictQuery is 'throw'.`);N&&delete n[d]}}return n};function pK(t,e,n){if(Array.isArray(t))t.forEach(function(r,i){if(Array.isArray(r)||dK(r))return pK(r,e,n);t[i]=e.castForQuery(null,r,n)});else{let r=Object.keys(t),i=r.length;for(;i--;){let a=r[i],s=t[a];Array.isArray(s)||dK(s)?(pK(s,e,n),t[a]=s):t[a]=e.castForQuery({val:s,context:n})}}}function bDt(t,e,n,r){if("strictQuery"in t)return t.strictQuery;if("strictQuery"in e)return e.strictQuery;let i=r&&r.mongooseCollection&&r.mongooseCollection.conn&&r.mongooseCollection.conn.base&&r.mongooseCollection.conn.base.options;return i&&"strictQuery"in i?i.strictQuery:n.strictQuery}});var OEe=y((ofn,CEe)=>{"use strict";var gDt=bo(),fm=class extends gDt{},tO=a0();Object.defineProperty(fm.prototype,"min",tO);Object.defineProperty(fm.prototype,"max",tO);Object.defineProperty(fm.prototype,"enum",tO);Object.defineProperty(fm.prototype,"populate",tO);CEe.exports=fm});var cs=y((ffn,IEe)=>{"use strict";IEe.exports=function(e,n,r,i){return r?i?{bsonType:n}:{bsonType:[n,"null"]}:i?{type:e}:{type:[e,"null"]}}});var d7=y((ufn,PEe)=>{"use strict";var vDt=fs();function _Dt(t){let e=this;return Array.isArray(t)?t.map(function(n){return MEe(e.path,n)}):Buffer.isBuffer(t)?t:MEe(e.path,t)}function MEe(t,e){let n=Number(e);if(isNaN(n))throw new vDt("number",e,t);return n}PEe.exports=_Dt});var yK=y((cfn,REe)=>{"use strict";var iO=i0(),ADt=OEe(),_1=li(),wDt=f7(),EDt=cs(),nO=d7(),hK=Vt(),mK=_1.CastError;function $r(t,e,n,r){_1.call(this,t,e,"Number",r)}$r.get=_1.get;$r.set=_1.set;$r.setters=[];$r._cast=wDt;$r.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};$r._defaultCaster=t=>{if(typeof t!="number")throw new Error;return t};$r.schemaName="Number";$r.defaultOptions={};$r.prototype=Object.create(_1.prototype);$r.prototype.constructor=$r;$r.prototype.OptionsConstructor=ADt;$r._checkRequired=t=>typeof t=="number"||t instanceof Number;$r.checkRequired=_1.checkRequired;$r.prototype.checkRequired=function(e,n){return typeof e=="object"&&_1._isRef(this,e,n,!0)?e!=null:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():$r.checkRequired())(e)};$r.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.minValidator},this)),t!=null){let n=e||iO.messages.Number.min;n=n.replace(/{MIN}/,t),this.validators.push({validator:this.minValidator=function(r){return r==null||r>=t},message:n,type:"min",min:t})}return this};$r.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.maxValidator},this)),t!=null){let n=e||iO.messages.Number.max;n=n.replace(/{MAX}/,t),this.validators.push({validator:this.maxValidator=function(r){return r==null||r<=t},message:n,type:"max",max:t})}return this};$r.prototype.enum=function(t,e){return this.enumValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this)),Array.isArray(t)||(hK.isPOJO(t)&&t.values!=null?(e=t.message,t=t.values):typeof t=="number"&&(t=Array.prototype.slice.call(arguments),e=null),hK.isPOJO(t)&&(t=Object.values(t)),e=e||iO.messages.Number.enum),e=e??iO.messages.Number.enum,this.enumValidator=n=>n==null||t.indexOf(n)!==-1,this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:t}),this};$r.prototype.cast=function(t,e,n,r,i){if(typeof t!="number"&&_1._isRef(this,t,e,n)&&(t==null||hK.isNonBuiltinObject(t)))return this._castRef(t,e,n,i);let a=t&&typeof t._id<"u"?t._id:t,s;typeof this._castFunction=="function"?s=this._castFunction:typeof this.constructor.cast=="function"?s=this.constructor.cast():s=$r.cast();try{return s(a)}catch(o){throw new mK("Number",a,this.path,o,this)}};function rO(t){return this.cast(t)}function SDt(t){let e=this;return Array.isArray(t)?t.map(function(n){return e.cast(n)}):[this.cast(t)]}var xDt={..._1.prototype.$conditionalHandlers,$bitsAllClear:nO,$bitsAnyClear:nO,$bitsAllSet:nO,$bitsAnySet:nO,$gt:rO,$gte:rO,$lt:rO,$lte:rO,$mod:SDt};Object.defineProperty($r.prototype,"$conditionalHandlers",{enumerable:!1,value:xDt});$r.prototype.castForQuery=function(t,e,n){let r;if(t!=null){if(r=this.$conditionalHandlers[t],!r)throw new mK("number",e,this.path,null,this);return r.call(this,e,n)}try{e=this.applySetters(e,n)}catch(i){throw i instanceof mK&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}return e};$r.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function"||this.path==="_id";return EDt("number","number",e?.useBsonType,n)};REe.exports=$r});var p7=y(bK=>{"use strict";var TDt=yK();bK.castToNumber=kEe;bK.castArraysOfNumbers=DEe;function kEe(t){return TDt.cast()(t)}function DEe(t,e){t.forEach(function(n,r){Array.isArray(n)?DEe(n,e):t[r]=kEe.call(e,n)})}});var _K=y(aO=>{"use strict";var NEe=p7().castArraysOfNumbers,h7=p7().castToNumber;aO.cast$geoIntersects=IDt;aO.cast$near=CDt;aO.cast$within=ODt;function CDt(t){let e=sO();if(Array.isArray(t))return NEe(t,this),t;if(vK(this,t),t&&t.$geometry)return gK(t,this);if(!Array.isArray(t))throw new TypeError("$near must be either an array or an object with a $geometry property");return e.prototype.castForQuery.call(this,null,t)}function gK(t,e){switch(t.$geometry.type){case"Polygon":case"LineString":case"Point":NEe(t.$geometry.coordinates,e);break;default:break}return vK(e,t),t}function ODt(t){if(vK(this,t),t.$box||t.$polygon){let e=t.$box?"$box":"$polygon";t[e].forEach(n=>{if(!Array.isArray(n)){let r="Invalid $within $box argument. Expected an array, received "+n;throw new TypeError(r)}n.forEach((r,i)=>{n[i]=h7.call(this,r)})})}else if(t.$center||t.$centerSphere){let e=t.$center?"$center":"$centerSphere";t[e].forEach((n,r)=>{Array.isArray(n)?n.forEach((i,a)=>{n[a]=h7.call(this,i)}):t[e][r]=h7.call(this,n)})}else t.$geometry&&gK(t,this);return t}function IDt(t){if(t.$geometry)return gK(t,this),t}function vK(t,e){e.$maxDistance&&(e.$maxDistance=h7.call(t,e.$maxDistance)),e.$minDistance&&(e.$minDistance=h7.call(t,e.$minDistance))}});var sO=y((pfn,FEe)=>{"use strict";var MDt=mC(),PDt=fG(),BEe=on(),RDt=oEe(),o0=li(),oO=o0.CastError,fO=Oy(),kDt=ZG(),$Ee=YC(),DDt=uEe(),wK=om(),NDt=Qr(),$Dt=Ds(),BDt=c7(),uO=Q("util"),n6=Vt(),FDt=p7().castToNumber,LDt=cs(),EK=_K(),qDt=W0(),m7,AK,UDt=Object.freeze({});function On(t,e,n,r,i){AK||(AK=$y().Embedded);let a="type";if(r&&r.typeKey&&(a=r.typeKey),this.schemaOptions=r,e){let f={};n6.isPOJO(e)&&(e[a]?(f=NDt(e),delete f[a],e=e[a]):e=fO),n!=null&&n.ref!=null&&f.ref==null&&(f.ref=n.ref),e===Object&&(e=fO);let u=typeof e=="string"?e:n6.getFunctionName(e),c=l7(),d=c.hasOwnProperty(u)?c[u]:e;typeof d=="function"?d===On?this.embeddedSchemaType=new d(t,f,r,null,i):this.embeddedSchemaType=new d(t,f,r,i):d instanceof o0&&(this.embeddedSchemaType=d,this.embeddedSchemaType instanceof AK||(this.embeddedSchemaType.path=t))}this.$isMongooseArray=!0,o0.call(this,t,n,"Array",i);let s,o;if(this.defaultValue!=null&&(s=this.defaultValue,o=typeof s=="function"),!("defaultValue"in this)||this.defaultValue!=null){let f=function(){return o?s.call(this):s!=null?[].concat(s):[]};f.$runBeforeSetters=!o,this.default(f)}}On.schemaName="Array";On.options={castNonArrays:!0};On.defaultOptions={};On.set=o0.set;On.setters=[];On.get=o0.get;On.prototype=Object.create(o0.prototype);On.prototype.constructor=On;On.prototype.OptionsConstructor=RDt;On._checkRequired=o0.prototype.checkRequired;On.checkRequired=o0.checkRequired;On.prototype.virtuals=null;On.prototype.checkRequired=function(e,n){return typeof e=="object"&&o0._isRef(this,e,n,!0)?!!e:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():On.checkRequired())(e)};On.prototype.enum=function(){let t=this;for(;;){let n=t&&t.embeddedSchemaType&&t.embeddedSchemaType.instance;if(n==="Array"){t=t.embeddedSchemaType;continue}if(n!=="String"&&n!=="Number")throw new Error("`enum` can only be set on an array of strings or numbers , not "+n);break}let e=arguments;return!Array.isArray(arguments)&&n6.isObject(arguments)&&(e=n6.object.vals(e)),t.embeddedSchemaType.enum.apply(t.embeddedSchemaType,e),this};On.prototype.applyGetters=function(t,e){return e!=null&&e.$__!=null&&e.$populated(this.path)?t:o0.prototype.applyGetters.call(this,t,e)};On.prototype._applySetters=function(t,e,n,r){if(this.embeddedSchemaType.$isMongooseArray&&On.options.castNonArrays){let i=0,a=this;for(;a!=null&&a.$isMongooseArray&&!a.$isMongooseDocumentArray;)++i,a=a.embeddedSchemaType;if(t!=null&&t.length!==0){let s=DDt(t);if(s.min===s.max&&s.max<i&&s.containsNonArrayItem)for(let o=s.max;o<i;++o)t=[t]}}return o0.prototype._applySetters.call(this,t,e,n,r)};On.prototype.cast=function(t,e,n,r,i){m7||(m7=$y().Array);let a,s;if(Array.isArray(t)){if(!t.length&&e){let p=e.schema.indexedPaths(),h=this.path;for(a=0,s=p.length;a<s;++a){let E=p[a][0][h];if(E==="2dsphere"||E==="2d")return}let v=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(v!=null){for(a=0,s=p.length;a<s;++a)if(p[a][0][v]==="2dsphere")return}}i=i||UDt;let u=n6.isMongooseArray(t)?t.__array:t,c=i.path||this.path;if(i.arrayPathIndex!=null&&(c+="."+i.arrayPathIndex),t=m7(u,c,e,this),u=t.__array,n&&e!=null&&e.$__!=null&&e.$populated(this.path))return t;let d=this.embeddedSchemaType,l=d.$isMongooseArray;if(d&&this.embeddedSchemaType.constructor!==fO)try{let p=u.length;for(a=0;a<p;a++){let h={};l&&(i.arrayPath!=null||d._arrayParentPath!=null)&&(h.arrayPathIndex=a),i.hydratedPopulatedDocs&&(h.hydratedPopulatedDocs=i.hydratedPopulatedDocs),u[a]=d.applySetters(u[a],e,n,void 0,h)}}catch(p){throw new oO("["+p.kind+"]",uO.inspect(t),this.path+"."+a,p,this)}return t}let o=this.options.castNonArrays!=null?this.options.castNonArrays:On.options.castNonArrays;if(n||o)return e&&n&&e.markModified(this.path),this.cast([t],e,n);throw new oO("Array",uO.inspect(t),this.path,null,this)};On.prototype._castForPopulate=function(e,n){if(m7||(m7=$y().Array),Array.isArray(e)){let r,i=e.__array?e.__array:e,a=i.length;if(this.embeddedSchemaType&&this.embeddedSchemaType.constructor!==fO)try{for(r=0;r<a;r++){let s={};this.embeddedSchemaType.$isMongooseArray&&this.embeddedSchemaType._arrayParentPath!=null&&(s.arrayPathIndex=r),i[r]=this.embeddedSchemaType.cast(i[r],n,!1,void 0,s)}}catch(s){throw new oO("["+s.kind+"]",uO.inspect(e),this.path+"."+r,s,this)}return e}throw new oO("Array",uO.inspect(e),this.path,null,this)};On.prototype.$toObject=On.prototype.toObject;On.prototype.discriminator=function(...t){let e=this;for(;e.$isMongooseArray&&!e.$isMongooseDocumentArray;)e=e.embeddedSchemaType;if(!e.$isMongooseDocumentArray)throw new BEe("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return e.discriminator(...t)};On.prototype.clone=function(){let t=Object.assign({},this.options),e=new this.constructor(this.path,this.embeddedSchemaType,t,this.schemaOptions,this.parentSchema);return e.validators=this.validators.slice(),this.requiredValidator!==void 0&&(e.requiredValidator=this.requiredValidator),e};On.prototype._castForQuery=function(t,e){let n=this.embeddedSchemaType,r=n?.schema?.options?.discriminatorKey,i=n?.discriminators;if(t&&i&&typeof r=="string")if(i[t[r]])n=i[t[r]];else{let a=qDt(i,t[r]);a&&(n=a)}return Array.isArray(t)?(this.setters.reverse().forEach(a=>{t=a.call(this,t,this)}),t=t.map(function(a){return n6.isObject(a)&&a.$elemMatch?a:n.castForQuery(null,a,e)})):t=n.castForQuery(null,t,e),t};On.prototype.castForQuery=function(t,e,n){let r;if(t!=null){if(r=this.$conditionalHandlers[t],!r)throw new Error("Can't use "+t+" with Array.");return r.call(this,e,n)}else return this._castForQuery(e,n)};On.prototype.virtual=function(e,n){if(e instanceof $Ee||$Dt(e)==="VirtualType")return this.virtual(e.path,e.options);if(n=new kDt(n),n6.hasUserDefinedProperty(n,["ref","refPath"]))throw new BEe("Cannot set populate virtual as a property of an array");let r=new $Ee(n,e);return this.virtuals===null&&(this.virtuals={}),this.virtuals[e]=r,r};function jDt(t,e){return Array.isArray(t)||(t=[t]),t=t.map(n=>{if(!n6.isObject(n))return n;if(n.$elemMatch!=null)return{$elemMatch:wK(this.embeddedSchemaType.schema,n.$elemMatch,null,this&&this.$$context)};let r={};return r[this.path]=n,wK(this.embeddedSchemaType.schema,r,null,this&&this.$$context)[this.path]},this),this.castForQuery(null,t,e)}function VDt(t,e){let n=Object.keys(t),r=n.length;for(let i=0;i<r;++i){let a=n[i],s=t[a];BDt(a)&&s!=null&&(t[a]=this.castForQuery(a,s,e))}return t}var Ir=On.prototype.$conditionalHandlers={};Ir.$all=jDt;Ir.$options=String;Ir.$elemMatch=VDt;Ir.$geoIntersects=EK.cast$geoIntersects;Ir.$or=SK("$or");Ir.$and=SK("$and");Ir.$nor=SK("$nor");function SK(t){return function(n,r){if(!Array.isArray(n))throw new TypeError("conditional "+t+" requires an array");let i=[];for(let a of n)i.push(wK(this.embeddedSchemaType.schema??r.schema,a,null,this&&this.$$context));return i}}Ir.$near=Ir.$nearSphere=EK.cast$near;Ir.$within=Ir.$geoWithin=EK.cast$within;Ir.$size=Ir.$minDistance=Ir.$maxDistance=FDt;Ir.$exists=MDt;Ir.$type=PDt;Ir.$eq=Ir.$gt=Ir.$gte=Ir.$lt=Ir.$lte=Ir.$not=Ir.$regex=Ir.$ne=On.prototype._castForQuery;Ir.$nin=o0.prototype.$conditionalHandlers.$nin;Ir.$in=o0.prototype.$conditionalHandlers.$in;On.prototype.toJSONSchema=function(e){let n=this.getEmbeddedSchemaType(),r=this.options.required&&typeof this.options.required!="function";return{...LDt("array","array",e?.useBsonType,r),items:n.toJSONSchema(e)}};On.prototype.autoEncryptionType=function(){return"array"};FEe.exports=On});var UEe=y((hfn,qEe)=>{"use strict";var{Long:zDt}=jt(),xK=9223372036854775807n,TK=-9223372036854775808n,LEe=`Mongoose only supports BigInts between ${TK} and ${xK} because MongoDB does not support arbitrary precision integers`;qEe.exports=function(e){if(e==null)return e;if(e==="")return null;if(typeof e=="bigint"){if(e>xK||e<TK)throw new Error(LEe);return e}if(e instanceof zDt)return e.toBigInt();if(typeof e=="string"||typeof e=="number"){if(e=BigInt(e),e>xK||e<TK)throw new Error(LEe);return e}throw new Error(`Cannot convert value to BigInt: "${e}"`)}});var zEe=y((mfn,VEe)=>{"use strict";var jEe=fs(),Ly=li(),HDt=UEe(),WDt=cs();function pi(t,e,n,r){Ly.call(this,t,e,"BigInt",r)}pi.schemaName="BigInt";pi.defaultOptions={};pi.prototype=Object.create(Ly.prototype);pi.prototype.constructor=pi;pi._cast=HDt;pi.set=Ly.set;pi.setters=[];pi.get=Ly.get;pi.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};pi._checkRequired=t=>t!=null;pi.checkRequired=Ly.checkRequired;pi.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};pi.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=pi.cast();try{return e(t)}catch(n){throw new jEe("BigInt",t,this.path,n,this)}};var GDt={...Ly.prototype.$conditionalHandlers,$gt:cO,$gte:cO,$lt:cO,$lte:cO};Object.defineProperty(pi.prototype,"$conditionalHandlers",{enumerable:!1,value:GDt});function cO(t,e){return this.castForQuery(null,t,e)}pi.prototype.castForQuery=function(t,e,n){let r;if(t!=null)return r=this.$conditionalHandlers[t],r?r.call(this,e):this.applySetters(e,n);try{return this.applySetters(e,n)}catch(i){throw i instanceof jEe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};pi.prototype._castNullish=function(e){return typeof e>"u"||(typeof this.constructor.cast=="function"?this.constructor.cast():pi.cast())==null,e};pi.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return WDt("string","long",e?.useBsonType,n)};pi.prototype.autoEncryptionType=function(){return"long"};VEe.exports=pi});var GEe=y((yfn,WEe)=>{"use strict";var HEe=fs(),qy=li(),y7=hC(),KDt=cs();function Br(t,e,n,r){qy.call(this,t,e,"Boolean",r)}Br.schemaName="Boolean";Br.defaultOptions={};Br.prototype=Object.create(qy.prototype);Br.prototype.constructor=Br;Br._cast=y7;Br.set=qy.set;Br.setters=[];Br.get=qy.get;Br.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Br._defaultCaster=t=>{if(t!=null&&typeof t!="boolean")throw new Error;return t};Br._checkRequired=t=>t===!0||t===!1;Br.checkRequired=qy.checkRequired;Br.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};Object.defineProperty(Br,"convertToTrue",{get:()=>y7.convertToTrue,set:t=>{y7.convertToTrue=t}});Object.defineProperty(Br,"convertToFalse",{get:()=>y7.convertToFalse,set:t=>{y7.convertToFalse=t}});Br.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Br.cast();try{return e(t)}catch(n){throw new HEe("Boolean",t,this.path,n,this)}};var YDt={...qy.prototype.$conditionalHandlers};Object.defineProperty(Br.prototype,"$conditionalHandlers",{enumerable:!1,value:YDt});Br.prototype.castForQuery=function(t,e,n){let r;if(t!=null)return r=this.$conditionalHandlers[t],r?r.call(this,e):this.applySetters(e,n);try{return this.applySetters(e,n)}catch(i){throw i instanceof HEe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};Br.prototype._castNullish=function(e){if(typeof e>"u")return e;let n=typeof this.constructor.cast=="function"?this.constructor.cast():Br.cast();return n==null?e:n.convertToFalse instanceof Set&&n.convertToFalse.has(e)?!1:n.convertToTrue instanceof Set&&n.convertToTrue.has(e)?!0:e};Br.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return KDt("boolean","bool",e?.useBsonType,n)};Br.prototype.autoEncryptionType=function(){return"bool"};WEe.exports=Br});var YEe=y((bfn,KEe)=>{"use strict";var ZDt=bo(),lO=class extends ZDt{},XDt=a0();Object.defineProperty(lO.prototype,"subtype",XDt);KEe.exports=lO});var JEe=y((gfn,XEe)=>{"use strict";var Uy=bC(),JDt=YEe(),A1=li(),QDt=cs(),dO=d7(),ZEe=Vt(),CK=Uy.Binary,hO=A1.CastError;function ra(t,e,n,r){A1.call(this,t,e,"Buffer",r)}ra.schemaName="Buffer";ra.defaultOptions={};ra.prototype=Object.create(A1.prototype);ra.prototype.constructor=ra;ra.prototype.OptionsConstructor=JDt;ra._checkRequired=t=>!!(t&&t.length);ra.set=A1.set;ra.setters=[];ra.get=A1.get;ra.checkRequired=A1.checkRequired;ra.prototype.checkRequired=function(t,e){return A1._isRef(this,t,e,!0)?!!t:this.constructor._checkRequired(t)};ra.prototype.cast=function(t,e,n,r,i){let a;if(A1._isRef(this,t,e,n)){if(t&&t.isMongooseBuffer)return t;if(Buffer.isBuffer(t))return(!t||!t.isMongooseBuffer)&&(t=new Uy(t,[this.path,e]),this.options.subtype!=null&&(t._subtype=this.options.subtype)),t;if(t instanceof CK){if(a=new Uy(t.value(!0),[this.path,e]),typeof t.sub_type!="number")throw new hO("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(t==null||ZEe.isNonBuiltinObject(t))return this._castRef(t,e,n,i)}if(t&&t._id&&(t=t._id),t&&t.isMongooseBuffer)return t;if(Buffer.isBuffer(t))return(!t||!t.isMongooseBuffer)&&(t=new Uy(t,[this.path,e]),this.options.subtype!=null&&(t._subtype=this.options.subtype)),t;if(t instanceof CK){if(a=new Uy(t.value(!0),[this.path,e]),typeof t.sub_type!="number")throw new hO("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(t===null)return t;let s=typeof t;if(s==="string"||s==="number"||Array.isArray(t)||s==="object"&&t.type==="Buffer"&&Array.isArray(t.data))return s==="number"&&(t=[t]),a=new Uy(t,[this.path,e]),this.options.subtype!=null&&(a._subtype=this.options.subtype),a;if(ZEe.isPOJO(t)&&(t.$binary instanceof CK||typeof t.$binary=="string")){let o=this.cast(Buffer.from(t.$binary,"base64"));if(t.$type!=null)return o._subtype=t.$type,o}throw new hO("Buffer",t,this.path,null,this)};ra.prototype.subtype=function(t){return this.options.subtype=t,this};function pO(t,e){return this.castForQuery(null,t,e)}var eNt={...A1.prototype.$conditionalHandlers,$bitsAllClear:dO,$bitsAnyClear:dO,$bitsAllSet:dO,$bitsAnySet:dO,$gt:pO,$gte:pO,$lt:pO,$lte:pO};Object.defineProperty(ra.prototype,"$conditionalHandlers",{enumerable:!1,value:eNt});ra.prototype.castForQuery=function(t,e,n){let r;if(t!=null){if(r=this.$conditionalHandlers[t],!r)throw new Error("Can't use "+t+" with Buffer.");return r.call(this,e)}let i;try{i=this.applySetters(e,n)}catch(a){throw a instanceof hO&&a.path===this.path&&this.$fullPath!=null&&(a.path=this.$fullPath),a}return i&&i.toObject({transform:!1,virtuals:!1})};ra.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return QDt("string","binData",e?.useBsonType,n)};ra.prototype.autoEncryptionType=function(){return"binData"};XEe.exports=ra});var eSe=y((vfn,QEe)=>{"use strict";var tNt=bo(),jy=class extends tNt{},OK=a0();Object.defineProperty(jy.prototype,"min",OK);Object.defineProperty(jy.prototype,"max",OK);Object.defineProperty(jy.prototype,"expires",OK);QEe.exports=jy});var nSe=y((_fn,tSe)=>{"use strict";var IK=Q("assert");tSe.exports=function(e){if(e==null||e==="")return null;if(e instanceof Date)return IK.ok(!isNaN(e.valueOf())),e;let n;if(IK.ok(typeof e!="boolean"),e instanceof Number||typeof e=="number"?n=new Date(e):typeof e=="string"&&!isNaN(Number(e))&&(Number(e)>=275761||Number(e)<-271820)?n=new Date(Number(e)):typeof e.valueOf=="function"?n=new Date(e.valueOf()):n=new Date(e),!isNaN(n.valueOf()))return n;IK.ok(!1)}});var sSe=y((Afn,aSe)=>{"use strict";var rSe=i0(),nNt=eSe(),r6=li(),rNt=nSe(),iNt=cs(),aNt=Ds(),sNt=Vt(),iSe=r6.CastError;function Mr(t,e,n,r){r6.call(this,t,e,"Date",r)}Mr.schemaName="Date";Mr.defaultOptions={};Mr.prototype=Object.create(r6.prototype);Mr.prototype.constructor=Mr;Mr.prototype.OptionsConstructor=nNt;Mr._cast=rNt;Mr.set=r6.set;Mr.setters=[];Mr.get=r6.get;Mr.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Mr._defaultCaster=t=>{if(t!=null&&!(t instanceof Date))throw new Error;return t};Mr.prototype.expires=function(t){return aNt(this._index)!=="Object"&&(this._index={}),this._index.expires=t,sNt.expires(this._index),this};Mr._checkRequired=t=>t instanceof Date;Mr.checkRequired=r6.checkRequired;Mr.prototype.checkRequired=function(t,e){return typeof t=="object"&&r6._isRef(this,t,e,!0)?t!=null:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():Mr.checkRequired())(t)};Mr.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.minValidator},this)),t){let n=e||rSe.messages.Date.min;typeof n=="string"&&(n=n.replace(/{MIN}/,t===Date.now?"Date.now()":t.toString()));let r=this;this.validators.push({validator:this.minValidator=function(i){let a=t;typeof t=="function"&&t!==Date.now&&(a=a.call(this));let s=a===Date.now?a():r.cast(a);return i===null||i.valueOf()>=s.valueOf()},message:n,type:"min",min:t})}return this};Mr.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.maxValidator},this)),t){let n=e||rSe.messages.Date.max;typeof n=="string"&&(n=n.replace(/{MAX}/,t===Date.now?"Date.now()":t.toString()));let r=this;this.validators.push({validator:this.maxValidator=function(i){let a=t;typeof a=="function"&&a!==Date.now&&(a=a.call(this));let s=a===Date.now?a():r.cast(a);return i===null||i.valueOf()<=s.valueOf()},message:n,type:"max",max:t})}return this};Mr.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Mr.cast();try{return e(t)}catch(n){throw new iSe("date",t,this.path,n,this)}};function mO(t){return this.cast(t)}var oNt={...r6.prototype.$conditionalHandlers,$gt:mO,$gte:mO,$lt:mO,$lte:mO};Object.defineProperty(Mr.prototype,"$conditionalHandlers",{enumerable:!1,value:oNt});Mr.prototype.castForQuery=function(t,e,n){if(t==null)try{return this.applySetters(e,n)}catch(i){throw i instanceof iSe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}let r=this.$conditionalHandlers[t];if(!r)throw new Error("Can't use "+t+" with Date.");return r.call(this,e)};Mr.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return iNt("string","date",e?.useBsonType,n)};Mr.prototype.autoEncryptionType=function(){return"date"};aSe.exports=Mr});var fSe=y((wfn,oSe)=>{"use strict";var um=QT(),fNt=Q("assert");oSe.exports=function(e){if(e==null)return e;if(typeof e=="object"&&typeof e.$numberDecimal=="string")return um.fromString(e.$numberDecimal);if(e instanceof um)return e;if(typeof e=="string")return um.fromString(e);if(typeof Buffer=="function"&&Buffer.isBuffer(e))return new um(e);if(typeof Uint8Array=="function"&&e instanceof Uint8Array)return new um(e);if(typeof e=="number")return um.fromString(String(e));if(typeof e.valueOf=="function"&&typeof e.valueOf()=="string")return um.fromString(e.valueOf());fNt.ok(!1)}});var cSe=y((Efn,uSe)=>{"use strict";var w1=li(),uNt=w1.CastError,cNt=fSe(),lNt=cs(),MK=Da();function Ci(t,e,n,r){w1.call(this,t,e,"Decimal128",r)}Ci.schemaName="Decimal128";Ci.defaultOptions={};Ci.prototype=Object.create(w1.prototype);Ci.prototype.constructor=Ci;Ci._cast=cNt;Ci.set=w1.set;Ci.setters=[];Ci.get=w1.get;Ci.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Ci._defaultCaster=t=>{if(t!=null&&!MK(t,"Decimal128"))throw new Error;return t};Ci._checkRequired=t=>MK(t,"Decimal128");Ci.checkRequired=w1.checkRequired;Ci.prototype.checkRequired=function(e,n){return w1._isRef(this,e,n,!0)?!!e:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():Ci.checkRequired())(e)};Ci.prototype.cast=function(t,e,n,r,i){if(w1._isRef(this,t,e,n))return MK(t,"Decimal128")?t:this._castRef(t,e,n,i);let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=Ci.cast();try{return a(t)}catch(s){throw new uNt("Decimal128",t,this.path,s,this)}};function yO(t){return this.cast(t)}var dNt={...w1.prototype.$conditionalHandlers,$gt:yO,$gte:yO,$lt:yO,$lte:yO};Object.defineProperty(Ci.prototype,"$conditionalHandlers",{enumerable:!1,value:dNt});Ci.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return lNt("string","decimal",e?.useBsonType,n)};Ci.prototype.autoEncryptionType=function(){return"decimal"};uSe.exports=Ci});var pSe=y((Sfn,dSe)=>{"use strict";var pNt=bo(),b7=class extends pNt{},lSe=a0();Object.defineProperty(b7.prototype,"_id",lSe);Object.defineProperty(b7.prototype,"minimize",lSe);dSe.exports=b7});var mSe=y((xfn,hSe)=>{"use strict";hSe.exports=function(e){e.s.hooks.pre("save",!1,async function(){if(this.$isSubdocument)return;let i=this.$getAllSubdocs({useCache:!0});i.length&&(await Promise.all(i.map(a=>a._execDocumentPreHooks("save"))),this.$__.saveOptions&&(this.$__.saveOptions.__subdocs=null))},null,!0),e.s.hooks.pre("save",async function(){let i=this.$__.removedSubdocs;if(!i||!i.length)return;let a=[];for(let s of i)a.push(s._execDocumentPreHooks("deleteOne"));await Promise.all(a)}),e.s.hooks.post("save",async function(){let i=this.$__.removedSubdocs;if(!i||!i.length)return;let a=[];for(let s of i)a.push(s._execDocumentPostHooks("deleteOne"));this.$__.removedSubdocs=null,await Promise.all(a)}),e.s.hooks.post("save",async function(){if(this.$isSubdocument)return;let i=this.$getAllSubdocs({useCache:!0});if(!i.length)return;let a=[];for(let s of i)a.push(s._execDocumentPostHooks("save"));await Promise.all(a)},null,!0)}});var bSe=y((Tfn,kK)=>{"use strict";var hNt=ct().objectIdSymbol,ySe=Vt();kK.exports=function(e){e.post("init",function(){return RK.call(this),this}),e.pre("save",function(){PK.call(this)}),e.pre("deleteOne",{document:!0,query:!1},function(){PK.call(this)}),e.pre("updateOne",{document:!0,query:!1},function(){PK.call(this)}),e.post("save",function(){RK.call(this)})};function PK(){let t,e;if(this.$__.shardval){t=Object.keys(this.$__.shardval),e=t.length,this.$where=this.$where||{};for(let n=0;n<e;++n)this.$where[t[n]]=this.$__.shardval[t[n]]}}kK.exports.storeShard=RK;function RK(){let t=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(!ySe.isPOJO(t))return;let e=this.$__.shardval={},n=Object.keys(t),r=n.length,i;for(let a=0;a<r;++a)i=this.$__getValue(n[a]),i==null?e[n[a]]=i:ySe.isMongooseObject(i)?e[n[a]]=i.toObject({depopulate:!0,_isNested:!0}):i instanceof Date||i[hNt]?e[n[a]]=i:typeof i.valueOf=="function"?e[n[a]]=i.valueOf():e[n[a]]=i}});var _Se=y((Cfn,vSe)=>{"use strict";var Vy=ct().arrayAtomicsSymbol,DK=ct().sessionNewDocuments,mNt=Vt();vSe.exports=function(e){e.pre("save",function(){let r=this.$session();if(r!=null&&!(r.transaction==null||r[DK]==null)&&!r[DK].has(this)){let i={};this.isNew&&(i.isNew=!0),this.$__schema.options.versionKey&&(i.versionKey=this.get(this.$__schema.options.versionKey)),i.modifiedPaths=new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))),i.atomics=yNt(this),r[DK].set(this,i)}})};function yNt(t,e){let n=new Map;e=e||new Map;let r=Object.keys(t.$__.activePaths.init).concat(Object.keys(t.$__.activePaths.modify));for(let a of r){let s=t.$__getValue(a);if(s!=null&&Array.isArray(s)&&mNt.isMongooseDocumentArray(s)&&s.length&&s[Vy]!=null&&Object.keys(s[Vy]).length!==0){let o=e.get(a)||{};n.set(a,gSe(o,s[Vy]))}}let i=t.$__dirty();for(let a of i){let s=a.path,o=a.value;if(o!=null&&o[Vy]!=null&&Object.keys(o[Vy]).length!==0){let f=e.get(s)||{};n.set(s,gSe(f,o[Vy]))}}return n}function gSe(t,e){return t=t||{},e.$pullAll!=null&&(t.$pullAll=(t.$pullAll||[]).concat(e.$pullAll)),e.$push!=null&&(t.$push=t.$push||{},t.$push.$each=(t.$push.$each||[]).concat(e.$push.$each)),e.$addToSet!=null&&(t.$addToSet=(t.$addToSet||[]).concat(e.$addToSet)),e.$set!=null&&(t.$set=Array.isArray(e.$set)?[...e.$set]:Object.assign({},e.$set)),t}});var wSe=y((Ofn,ASe)=>{"use strict";ASe.exports=function(e){e.pre("save",!1,async function(i){if(this.$isSubdocument)return;let a=i&&typeof i=="object"&&"validateBeforeSave"in i,s;if(a?s=!!i.validateBeforeSave:s=this.$__schema.options.validateBeforeSave,s){let f=i&&typeof i=="object"&&"validateModifiedOnly"in i?{validateModifiedOnly:i.validateModifiedOnly}:null;await this.$validate(f).then(()=>{this.$op="save"})}},null,!0)}});var NK=y(g7=>{"use strict";g7.saveSubdocs=mSe();g7.sharding=bSe();g7.trackTransaction=_Se();g7.validateBeforeSave=wSe()});var xSe=y((Mfn,SSe)=>{"use strict";var ESe=NK();SSe.exports=function(e){for(let n of Object.values(ESe))n(e,{deduplicate:!0});e.plugins=Object.values(ESe).map(n=>({fn:n,opts:{deduplicate:!0}})).concat(e.plugins)}});var OSe=y((Pfn,CSe)=>{"use strict";var bNt=yC(),gNt=Kh(),vNt=Da(),_Nt=Zp(),ANt=li(),TSe=Yh();CSe.exports=function t(e,n,r,i){let a=Object.keys(n),s=0,o=a.length,f;if(r=r||"",i=i||new WeakSet,!i.has(n)){for(i.add(n);s<o;)if(f=a[s++],!(!r&&(f==="discriminators"||f==="base"||f==="_applyDiscriminators"||f==="_userProvidedOptions"||f==="options"||f==="tree"))&&!(r==="tree"&&n!=null&&n.instanceOfSchema)&&!gNt.has(f)){if(e[f]==null)e[f]=n[f];else if(TSe(n[f])){if(TSe(e[f])||(e[f]={}),n[f]!=null){if(n[f].$isSingleNested&&e[f].$isMongooseDocumentArray||n[f].$isMongooseDocumentArray&&e[f].$isSingleNested||n[f].$isMongooseDocumentArrayElement&&e[f].$isMongooseDocumentArrayElement)continue;if(n[f].instanceOfSchema){e[f].instanceOfSchema?bNt(e[f],n[f].clone(),!0):e[f]=n[f].clone();continue}else if(vNt(n[f],"ObjectId")){e[f]=new _Nt(n[f]);continue}else if(n[f]instanceof ANt&&(e[f]==null&&(e[f]=n[f].clone()),!n[f].$isMongooseDocumentArray&&!n[f].$isSingleNested))continue}t(e[f],n[f],r?r+"."+f:f,i)}}n!=null&&n.instanceOfSchema&&(e.tree=Object.assign({},n.tree,e.tree))}}});var bO=y((Rfn,PSe)=>{"use strict";var ISe=Oy(),wNt=xSe(),ENt=Qr(),SNt=CC().defineKey,xNt=di(),$K=Vt(),TNt=OSe(),MSe={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0,statics:!0};function CNt(t,e){if(t.encryptionType()==null&&e.encryptionType()==null)return;let n=i(r(t),r(e));for(let a of n){if(t._hasEncryptedField(a)&&e._hasEncryptedField(a))throw new Error(`encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=${a}`);if(t._hasEncryptedField(a)||e._hasEncryptedField(a))throw new Error(`encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=${a}`)}function r(a){return[...Object.keys(a.paths),...Object.keys(a.singleNestedPaths)]}function*i(a,s){let o=new Set(a);for(let f of s)o.has(f)&&(yield f)}}PSe.exports=function(e,n,r,i,a,s,o){if(!(r&&r.instanceOfSchema))throw new Error("You must pass a valid discriminator Schema");if(s=s??!0,e.schema.discriminatorMapping&&!e.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+n+'" can only be a discriminator of the root model');if(a){let l=xNt(e.base,"options.applyPluginsToDiscriminators",!1)||!s;e.base._applyPlugins(r,{skipTopLevel:!l})}else s||wNt(r);let f=e.schema.options.discriminatorKey,u=e.schema.path(f);if(u!=null)$K.hasUserDefinedProperty(u.options,"select")||(u.options.select=!0),u.options.$skipDiscriminatorCheck=!0;else{let l={};l[f]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},l[f][e.schema.options.typeKey]=String,e.schema.add(l),SNt({prop:f,prototype:e.prototype,options:e.schema.options})}if(r.path(f)&&r.path(f).options.$skipDiscriminatorCheck!==!0)throw new Error('Discriminator "'+n+'" cannot have field with name "'+f+'"');let c=n;(typeof i=="string"&&i.length||i!=null)&&(c=i),CNt(e.schema,r);function d(l,p){l._baseSchema=p,p.paths._id&&p.paths._id.options&&!p.paths._id.options.auto&&l.remove("_id");let h=Object.keys(p.paths),v=[];for(let K of h){if(l.nested[K]){v.push(K);continue}if(K.indexOf(".")===-1)continue;let Y=K.split(".").slice(0,-1),W="";for(let B of Y)W+=(W.length?".":"")+B,(l.paths[W]instanceof ISe||l.singleNestedPaths[W]instanceof ISe)&&v.push(K)}l.obj={...l.obj},TNt(l,p),l._gatherChildSchemas();for(let K of v)delete l.paths[K];l.childSchemas.forEach(K=>{K.model.prototype.$__setSchema(K.schema)});let E={};E[f]={default:c,select:!0,set:function(K){if(K===c||Array.isArray(c)&&$K.deepEqual(K,c))return c;throw new Error(`Can't set discriminator key "`+f+'"')},$skipDiscriminatorCheck:!0},E[f][l.options.typeKey]=u?u.options[l.options.typeKey]:String,l.add(E),l.discriminatorMapping={key:f,value:c,isRoot:!1},p.options.collection&&(l.options.collection=p.options.collection);let M=l.options.toJSON,D=l.options.toObject,$=l.options._id,N=l.options.id,V=Object.keys(l.options);l.options.discriminatorKey=p.options.discriminatorKey;let j=l._userProvidedOptions;for(let K of V)if(!MSe[K]&&K in j&&!$K.deepEqual(l.options[K],p.options[K]))throw new Error("Can't customize discriminator option "+K+" (can only modify "+Object.keys(MSe).join(", ")+")");l.options=ENt(p.options);for(let K of Object.keys(j))l.options[K]=j[K];M&&(l.options.toJSON=M),D&&(l.options.toObject=D),typeof $<"u"&&(l.options._id=$),l.options.id=N,s&&(l.s.hooks=e.schema.s.hooks.merge(l.s.hooks)),a&&(l.plugins=Array.prototype.slice.call(p.plugins)),l.callQueue=p.callQueue.concat(l.callQueue),delete l._requiredpaths}if(d(r,e.schema),e.discriminators||(e.discriminators={}),e.schema.discriminatorMapping||(e.schema.discriminatorMapping={key:f,value:null,isRoot:!0}),e.schema.discriminators||(e.schema.discriminators={}),e.schema.discriminators[n]=r,e.discriminators[n]&&!r.options.overwriteModels&&!o)throw new Error('Discriminator with name "'+n+'" already exists');return r}});var gO=y((kfn,RSe)=>{"use strict";var ONt=W0();RSe.exports=function(e,n,r){let i=e.schema.options.discriminatorKey,a=n!=null&&n[i];if(a==null&&(a=r),e.discriminators&&a!=null)if(e.discriminators[a])e=e.discriminators[a];else{let s=ONt(e.discriminators,a);s&&(e=s)}return e}});var BK=y((Dfn,kSe)=>{"use strict";var INt=JG();kSe.exports=function(e,n){return n==null||n._id==null||(e=e.clone(),n._id?e.paths._id||(INt(e),e.options._id=!0):(e.remove("_id"),e.options._id=!1)),e}});var FK=y((Nfn,DSe)=>{"use strict";var MNt=on(),vO=class extends MNt{constructor(e,n){let r=`Cannot create use schema for property "${e}" because the schema has the ${n} option enabled.`;super(r)}};Object.defineProperty(vO.prototype,"name",{value:"InvalidSchemaOptionError"});DSe.exports=vO});var jK=y(($fn,FSe)=>{"use strict";var NSe=fs(),LK=Q("events").EventEmitter,PNt=_C(),RNt=pSe(),cm=li(),kNt=SC(),DNt=mC(),$Se=p7().castToNumber,NNt=cs(),$Nt=bO(),qK=_K(),UK=gO(),BNt=BK(),FNt=oc().internalToObjectOptions,LNt=Py(),qNt=Vt(),UNt=FK(),_O;FSe.exports=ji;function ji(t,e,n,r){if(t.options.timeseries)throw new UNt(e,"timeseries");let i=ji.defaultOptions&&ji.defaultOptions._id;i!=null&&(n=n||{},n._id=i),t=BNt(t,n),this.Constructor=BSe(t,null,n),this.Constructor.path=e,this.Constructor.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,this.base=t.base,cm.call(this,e,n,"Embedded",r)}ji.prototype=Object.create(cm.prototype);ji.prototype.constructor=ji;ji.prototype.OptionsConstructor=RNt;function BSe(t,e,n){_O||(_O=RC());let r=function(s,o,f){this.$__parent=f,_O.apply(this,arguments),f!=null&&this.$session(f.$session())};t._preCompile();let i=e!=null?e.prototype:_O.prototype;r.prototype=Object.create(i),r.prototype.$__setSchema(t),r.prototype.constructor=r,r.prototype.$__schemaTypeOptions=n,r.$__required=n?.required,r.base=t.base,r.schema=t,r.$isSingleNested=!0,r.events=new LK,r.prototype.toBSON=function(){return this.toObject(FNt)};for(let a in t.methods)r.prototype[a]=t.methods[a];for(let a in t.statics)r[a]=t.statics[a];for(let a in LK.prototype)r[a]=LK.prototype[a];return r}var Sl={...cm.prototype.$conditionalHandlers};Sl.$geoWithin=function(e,n){return{$geometry:this.castForQuery(null,e.$geometry,n)}};Sl.$near=Sl.$nearSphere=qK.cast$near;Sl.$within=Sl.$geoWithin=qK.cast$within;Sl.$geoIntersects=qK.cast$geoIntersects;Sl.$minDistance=$Se;Sl.$maxDistance=$Se;Sl.$exists=DNt;Object.defineProperty(ji.prototype,"$conditionalHandlers",{enumerable:!1,value:Sl});ji.prototype.cast=function(t,e,n,r,i){if(t&&t.$isSingleNested&&t.parent===e)return t;if(!n&&t!=null&&(typeof t!="object"||Array.isArray(t)))throw new PNt(this.path,t);let a=this.schema.path(this.schema.options.discriminatorKey),s=a==null?null:a.getDefault(e),o=UK(this.Constructor,t,s),f,u=e&&e.$__&&e.$__.selected,c=this.path,d=u==null?null:Object.keys(u).reduce((l,p)=>(p.startsWith(c+".")&&(l=l||{},l[p.substring(c.length+1)]=u[p]),l),null);if(n){f=new o(void 0,d,e,{defaults:!1}),delete f.$__.defaults,i.path!=null&&(i={...i},delete i.path),f.$init(t,i);let l=LNt(d);kNt(f,d,l)}else return i=Object.assign({},i,{priorDoc:r}),Object.keys(t).length===0?new o({},d,e,i):new o(t,d,e,i);return f};ji.prototype.castForQuery=function(t,e,n,r){let i;if(t!=null){if(i=this.$conditionalHandlers[t],!i)throw new Error("Can't use "+t);return i.call(this,e)}if(e==null)return e;let a=UK(this.Constructor,e);if(e instanceof a)return e;this.options.runSetters&&(e=this._applySetters(e,n));let s=r!=null&&r.strict!=null?r.strict:void 0;try{e=new a(e,s)}catch(o){throw o instanceof NSe?o:new NSe("Embedded",e,this.path,o,this)}return e};ji.prototype.doValidate=async function(e,n,r){let i=UK(this.Constructor,e);if(e&&!(e instanceof i)&&(e=new i(e,null,n!=null&&n.$__!=null?n:null)),r&&r.skipSchemaValidators)return e?e.validate():void 0;await cm.prototype.doValidate.call(this,e,n,r),e!=null&&await e.validate()};ji.prototype.doValidateSync=function(t,e,n){if(!n||!n.skipSchemaValidators){let r=cm.prototype.doValidateSync.call(this,t,e);if(r)return r}if(t)return t.validateSync()};ji.prototype.discriminator=function(t,e,n){n=n||{};let r=qNt.isPOJO(n)?n.value:n,i=typeof n.clone=="boolean"?n.clone:!0;return e.instanceOfSchema&&i&&(e=e.clone()),e=$Nt(this.Constructor,t,e,r,null,null,n.overwriteExisting),this.Constructor.discriminators[t]=BSe(e,this.Constructor),this.Constructor.discriminators[t]};ji.defaultOptions={};ji.set=cm.set;ji.setters=[];ji.get=cm.get;ji.prototype.toJSON=function(){return{path:this.path,options:this.options}};ji.prototype.clone=function(){let t=new this.constructor(this.schema,this.path,{...this.options,_skipApplyDiscriminators:!0},this.parentSchema);return t.validators=this.validators.slice(),this.requiredValidator!==void 0&&(t.requiredValidator=this.requiredValidator),t.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),t._appliedDiscriminators=this._appliedDiscriminators,t};ji.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return{...this.schema.toJSONSchema(e),...NNt("object","object",e?.useBsonType,n)}}});var qSe=y((Bfn,LSe)=>{"use strict";var jNt=on(),VK=li(),VNt=jK(),zNt=gO();function E1(t,e,n,r){if(this.$parentSchemaType=n&&n.$parentSchemaType,!this.$parentSchemaType)throw new jNt("Cannot create DocumentArrayElement schematype without a parent");delete n.$parentSchemaType,VK.call(this,t,n,"DocumentArrayElement",r),this.$isMongooseDocumentArrayElement=!0,this.Constructor=n&&n.Constructor,this.schema=e}E1.schemaName="DocumentArrayElement";E1.defaultOptions={};E1.prototype=Object.create(VK.prototype);E1.prototype.constructor=E1;E1.prototype.cast=function(...t){return this.$parentSchemaType.cast(...t)[0]};E1.prototype.doValidate=async function(e,n,r){let i=zNt(this.Constructor,e);return e&&!(e instanceof i)&&(e=new i(e,n,null,null,r&&r.index!=null?r.index:null)),VNt.prototype.doValidate.call(this,e,n,r)};E1.prototype.clone=function(){this.options.$parentSchemaType=this.$parentSchemaType;let t=VK.prototype.clone.apply(this,arguments);return delete this.options.$parentSchemaType,t.Constructor=this.Constructor,t.schema=this.schema,t};LSe.exports=E1});var VSe=y((Ffn,jSe)=>{"use strict";var HNt=bo(),v7=class extends HNt{},USe=a0();Object.defineProperty(v7.prototype,"excludeIndexes",USe);Object.defineProperty(v7.prototype,"_id",USe);jSe.exports=v7});var JSe=y((Lfn,XSe)=>{"use strict";var zSe=fs(),WNt=qSe(),zK=Q("events").EventEmitter,WK=sO(),GNt=VSe(),_7=li(),HSe=om(),WSe=cs(),KNt=bO(),GSe=BK(),YNt=MC(),ZNt=c7(),zy=Vt(),AO=gO(),XNt=FK(),KSe=ct().arrayAtomicsSymbol,HK=ct().arrayPathSymbol,JNt=ct().documentArrayParent,S1,lm;function zr(t,e,n,r,i){if(e.options&&e.options.timeseries)throw new XNt(t,"timeseries");let a=zr.defaultOptions&&zr.defaultOptions._id;a!=null&&(r=r||{},r._id=a),r!=null&&r._id!=null?e=GSe(e,r):n!=null&&n._id!=null&&(e=GSe(e,n));let s=ZSe(e,n);s.prototype.$basePath=t,s.path=t;let o=this,f=new WNt(t+".$",e,{...r||{},$parentSchemaType:o,Constructor:s});WK.call(this,t,f,n,null,i),this.schema=e,this.schemaOptions=r||{},this.$isMongooseDocumentArray=!0,this.Constructor=s,s.base=e.base;let u=this.defaultValue;(!("defaultValue"in this)||u!=null)&&this.default(function(){let c=u.call(this);return c!=null&&!Array.isArray(c)&&(c=[c]),c})}zr.schemaName="DocumentArray";zr.options={castNonArrays:!0};zr.prototype=Object.create(WK.prototype);zr.prototype.constructor=zr;zr.prototype.OptionsConstructor=GNt;Object.defineProperty(zr.prototype,"$conditionalHandlers",{enumerable:!1,value:{...WK.prototype.$conditionalHandlers}});function ZSe(t,e,n){lm||(lm=Ry());function r(){lm.apply(this,arguments),!(this.__parentArray==null||this.__parentArray.getArrayParent()==null)&&this.$session(this.__parentArray.getArrayParent().$session())}t._preCompile();let i=n!=null?n.prototype:lm.prototype;r.prototype=Object.create(i),r.prototype.$__setSchema(t),r.schema=t,r.prototype.constructor=r,r.$isArraySubdocument=!0,r.events=new zK,r.base=t.base;for(let a in t.methods)r.prototype[a]=t.methods[a];for(let a in t.statics)r[a]=t.statics[a];for(let a in zK.prototype)r[a]=zK.prototype[a];return r.options=e,r}zr.prototype.discriminator=function(t,e,n){typeof t=="function"&&(t=zy.getFunctionName(t)),n=n||{};let r=zy.isPOJO(n)?n.value:n,i=typeof n.clone=="boolean"?n.clone:!0;e.instanceOfSchema&&i&&(e=e.clone()),e=KNt(this.Constructor,t,e,r,null,null,n?.overwriteExisting);let a=ZSe(e,null,this.Constructor);return a.baseCasterConstructor=this.Constructor,Object.defineProperty(a,"name",{value:t}),this.Constructor.discriminators[t]=a,this.Constructor.discriminators[t]};zr.prototype.doValidate=async function(e,n,r){if(S1||(S1=rm()),await _7.prototype.doValidate.call(this,e,n),r?.updateValidator)return;zy.isMongooseDocumentArray(e)||(e=new S1(e,this.path,n));let i=[];for(let a=0;a<e.length;++a){let s=e[a];if(s!=null){if(!(s instanceof lm)){let o=AO(this.Constructor,e[a]);s=e[a]=new o(s,e,void 0,void 0,a)}r!=null&&r.validateModifiedOnly&&!s.$isModified()||i.push(s.$__validate(null,r))}}await Promise.all(i)};zr.prototype.doValidateSync=function(t,e,n){let r=_7.prototype.doValidateSync.call(this,t,e);if(r!=null)return r;let i=t&&t.length,a=null;if(i){for(let s=0,o=i;s<o;++s){let f=t[s];if(!f)continue;if(!(f instanceof lm)){let c=AO(this.Constructor,t[s]);f=t[s]=new c(f,t,void 0,void 0,s)}if(n!=null&&n.validateModifiedOnly&&!f.$isModified())continue;let u=f.validateSync(n);u&&a==null&&(a=u)}return a}};zr.prototype.getDefault=function(t,e,n){let r=typeof this.defaultValue=="function"?this.defaultValue.call(t):this.defaultValue;if(r==null||n&&n.skipCast)return r;S1||(S1=rm()),Array.isArray(r)||(r=[r]),r=new S1(r,this.path,t);for(let i=0;i<r.length;++i){let a=AO(this.Constructor,r[i]),s=new a({},r,void 0,void 0,i);s.$init(r[i]),s.isNew=!0,Object.assign(s.$__.activePaths.default,s.$__.activePaths.init),s.$__.activePaths.init={},r[i]=s}return r};var QNt=Object.freeze({transform:!1,virtuals:!1}),YSe=Object.freeze({skipId:!1,willInit:!0});zr.prototype.cast=function(t,e,n,r,i){if(S1||(S1=rm()),t!=null&&t[HK]!=null&&t===r)return t;let a,s;i=i||{};let o=i.path||this.path;if(!Array.isArray(t)){if(!n&&!zr.options.castNonArrays)throw new zSe("DocumentArray",t,this.path,null,this);return e&&n&&e.markModified(o),this.cast([t],e,n,r,i)}(!i.skipDocumentArrayCast||zy.isMongooseDocumentArray(t))&&(t=new S1(t,o,e,this)),r!=null&&(t[KSe]=r[KSe]||{}),i.arrayPathIndex!=null&&(t[HK]=o+"."+i.arrayPathIndex);let f=zy.isMongooseDocumentArray(t)?t.__array:t,u=f.length;for(let c=0;c<u;++c){if(!f[c])continue;let d=AO(this.Constructor,f[c]),l=YNt(f[c],!0);if(f[c]!==l&&(f[c]=l),f[c]instanceof lm){if(f[c][JNt]!==e)if(n){let p=new d(null,t,YSe,a,c);f[c]=p.$init(f[c])}else{let p=new d(f[c],t,void 0,void 0,c);f[c]=p}f[c].__index==null&&f[c].$setIndex(c)}else if(f[c]!=null)if(n)e?a||(a=e$t(this,e.$__.selected,n)):a=!0,s=new d(null,t,YSe,a,c),f[c]=s.$init(f[c],i);else if(r&&typeof r.id=="function"&&(s=r.id(f[c]._id)),r&&s&&zy.deepEqual(s.toObject(QNt),f[c]))s.set(f[c]),f[c]=s;else try{s=new d(f[c],t,void 0,void 0,c),f[c]=s}catch(p){throw new zSe("embedded",f[c],t[HK],p,this)}}return t};zr.prototype.clone=function(){let t=Object.assign({},this.options),e=new this.constructor(this.path,this.schema,t,this.schemaOptions,this.parentSchema);return e.validators=this.validators.slice(),this.requiredValidator!==void 0&&(e.requiredValidator=this.requiredValidator),e.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),e._appliedDiscriminators=this._appliedDiscriminators,e};zr.prototype.applyGetters=function(t,e){return _7.prototype.applyGetters.call(this,t,e)};function e$t(t,e,n){if(!(n&&e))return;let r=t.path+".",i=Object.keys(e),a=i.length,s={},o,f,u;for(;a--;)if(f=i[a],f.startsWith(r)){if(u=f.substring(r.length),u==="$")continue;u.startsWith("$.")&&(u=u.substring(2)),o||(o=!0),s[u]=e[f]}return o&&s||void 0}zr.defaultOptions={};zr.set=_7.set;zr.setters=[];zr.get=_7.get;zr.prototype.$conditionalHandlers.$elemMatch=t$t;function t$t(t,e){let n=Object.keys(t),r=n.length;for(let o=0;o<r;++o){let f=n[o],u=t[f];ZNt(f)&&u!=null&&(t[f]=this.castForQuery(f,u,e))}let i=this&&this.Constructor&&this.Constructor.schema&&this.Constructor.schema.options&&this.Constructor.schema.options.discriminatorKey,a=this&&this.Constructor&&this.Constructor.schema&&this.Constructor.schema.discriminators||{};if(i!=null&&t[i]!=null&&a[t[i]]!=null)return HSe(a[t[i]],t,null,this&&this.$$context);let s=this.Constructor.schema??e.schema;return HSe(s,t,null,this&&this.$$context)}zr.prototype.toJSONSchema=function(e){let n=WSe("object","object",e?.useBsonType,!1),r=this.options.required&&typeof this.options.required!="function";return{...WSe("array","array",e?.useBsonType,r),items:{...n,...this.schema.toJSONSchema(e)}}};XSe.exports=zr});var txe=y((qfn,exe)=>{"use strict";var QSe=Q("assert"),GK=jt(),n$t=Da();exe.exports=function(e){if(e==null||e==="")return null;let n;if(n$t(e,"Long"))n=e.toNumber();else if(typeof e=="string")try{return n=GK.Double.fromString(e),n}catch{QSe.ok(!1)}else if(typeof e=="object"){let r=e.valueOf()??e.toString();if(typeof r=="string")try{return n=GK.Double.fromString(e),n}catch{QSe.ok(!1)}else n=Number(r)}else n=Number(e);return new GK.Double(n)}});var rxe=y((Ufn,nxe)=>{"use strict";var r$t=fs(),Hy=li(),i$t=txe(),a$t=cs();function Vi(t,e,n,r){Hy.call(this,t,e,"Double",r)}Vi.schemaName="Double";Vi.defaultOptions={};Vi.prototype=Object.create(Hy.prototype);Vi.prototype.constructor=Vi;Vi._cast=i$t;Vi.set=Hy.set;Vi.setters=[];Vi.get=Hy.get;Vi._defaultCaster=t=>{if(t!=null&&t._bsontype!=="Double")throw new Error;return t};Vi.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Vi._checkRequired=t=>t!=null;Vi.checkRequired=Hy.checkRequired;Vi.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};Vi.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Vi.cast();try{return e(t)}catch(n){throw new r$t("Double",t,this.path,n,this)}};function wO(t){return this.cast(t)}var s$t={...Hy.prototype.$conditionalHandlers,$gt:wO,$gte:wO,$lt:wO,$lte:wO};Object.defineProperty(Vi.prototype,"$conditionalHandlers",{enumerable:!1,value:s$t});Vi.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return a$t("number","double",e?.useBsonType,n)};Vi.prototype.autoEncryptionType=function(){return"double"};nxe.exports=Vi});var axe=y((jfn,ixe)=>{"use strict";var o$t=Da(),f$t=Q("assert");ixe.exports=function(e){if(e==null)return e;if(e==="")return null;let n=o$t(e,"Long")?e.toNumber():Number(e);if(n===(n|0)&&n>=-2147483648&&n<=2147483647)return n;f$t.ok(!1)}});var fxe=y((Vfn,oxe)=>{"use strict";var sxe=fs(),Wy=li(),u$t=axe(),c$t=cs(),EO=d7();function Oi(t,e,n,r){Wy.call(this,t,e,"Int32",r)}Oi.schemaName="Int32";Oi.defaultOptions={};Oi.prototype=Object.create(Wy.prototype);Oi.prototype.constructor=Oi;Oi._cast=u$t;Oi.set=Wy.set;Oi.setters=[];Oi.get=Wy.get;Oi._defaultCaster=t=>{if(t!=null&&(typeof t!="number"||t!==(t|0)||t<-2147483648||t>2147483647))throw new Error;return t};Oi.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Oi._checkRequired=t=>t!=null;Oi.checkRequired=Wy.checkRequired;Oi.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)};Oi.prototype.cast=function(t){let e;typeof this._castFunction=="function"?e=this._castFunction:typeof this.constructor.cast=="function"?e=this.constructor.cast():e=Oi.cast();try{return e(t)}catch(n){throw new sxe("Int32",t,this.path,n,this)}};var l$t={...Wy.prototype.$conditionalHandlers,$gt:SO,$gte:SO,$lt:SO,$lte:SO,$bitsAllClear:EO,$bitsAnyClear:EO,$bitsAllSet:EO,$bitsAnySet:EO};Object.defineProperty(Oi.prototype,"$conditionalHandlers",{enumerable:!1,value:l$t});function SO(t,e){return this.castForQuery(null,t,e)}Oi.prototype.castForQuery=function(t,e,n){let r;if(t!=null)return r=this.$conditionalHandlers[t],r?r.call(this,e):this.applySetters(e,n);try{return this.applySetters(e,n)}catch(i){throw i instanceof sxe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};Oi.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return c$t("number","int",e?.useBsonType,n)};Oi.prototype.autoEncryptionType=function(){return"int"};oxe.exports=Oi});var cxe=y((zfn,uxe)=>{"use strict";var d$t=bo(),xO=class extends d$t{},p$t=a0();Object.defineProperty(xO.prototype,"of",p$t);uxe.exports=xO});var pxe=y((Hfn,dxe)=>{"use strict";var KK=XC(),h$t=cxe(),lxe=li(),m$t=cs(),y$t=on(),b$t=im(),A7=Vt(),dm=class extends lxe{constructor(e,n,r,i){super(e,n,"Map",i),this.$isSchemaMap=!0,this._createNestedSchemaType(i,e,n,r)}set(e,n){return lxe.set(e,n)}cast(e,n,r,i,a){if(e instanceof KK)return e;let s=this.path;if(r){let o=new KK({},s,n,this.$__schemaType,a),f=o.$__pathRelativeToParent!=null?o.$__pathRelativeToParent:o.$__path;if(e instanceof global.Map)for(let u of e.keys()){let c=e.get(u);c==null?c=o.$__schemaType._castNullish(c):c=o.$__schemaType.cast(c,n,!0,null,{...a,path:f+"."+u}),o.$init(u,c)}else for(let u of Object.keys(e)){let c=e[u];c==null?c=o.$__schemaType._castNullish(c):c=o.$__schemaType.cast(c,n,!0,null,{...a,path:f+"."+u}),o.$init(u,c)}return o}return new KK(e,s,n,this.$__schemaType,a)}clone(){let e=super.clone();return this.$__schemaType!=null&&(e.$__schemaType=this.$__schemaType.clone()),e}getEmbeddedSchemaType(){return this.$__schemaType}toJSONSchema(e){let n=e?.useBsonType,r=this.getEmbeddedSchemaType(),i=this.options.required&&typeof this.options.required!="function",a=m$t("object","object",n,i);return a.additionalProperties=r.toJSONSchema(e),a}autoEncryptionType(){return"object"}};dm.schemaName="Map";dm.prototype.OptionsConstructor=h$t;dm.defaultOptions={};dm.prototype._createNestedSchemaType=function(e,n,r,i){let a=n+".$*",s={type:{}};A7.hasUserDefinedProperty(r,"of")&&(A7.isPOJO(r.of)&&Object.keys(r.of).length>0&&!A7.hasUserDefinedProperty(r.of,e.options.typeKey)?s={[e.options.typeKey]:new b$t(r.of)}:A7.isPOJO(r.of)?s=Object.assign({},r.of):s={[e.options.typeKey]:r.of},s[e.options.typeKey]&&s[e.options.typeKey].instanceOfSchema&&s[e.options.typeKey].eachPath((u,c)=>{if(c.options.select===!0||c.options.select===!1)throw new y$t('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+n+"."+u+'"')}),A7.hasUserDefinedProperty(r,"ref")&&(s.ref=r.ref)),this.$__schemaType=e.interpretAsType(a,s,i)};dxe.exports=dm});var yxe=y((Wfn,mxe)=>{"use strict";var g$t=bo(),w7=class extends g$t{},hxe=a0();Object.defineProperty(w7.prototype,"auto",hxe);Object.defineProperty(w7.prototype,"populate",hxe);mxe.exports=w7});var vxe=y((Gfn,gxe)=>{"use strict";var bxe=Da(),YK=Zp();gxe.exports=function(e){if(e==null||bxe(e,"ObjectId"))return e;if(e._id){if(bxe(e._id,"ObjectId"))return e._id;if(e._id.toString instanceof Function)return new YK(e._id.toString())}return e.toString instanceof Function?new YK(e.toString()):new YK(e)}});var Exe=y((Kfn,wxe)=>{"use strict";var v$t=yxe(),x1=li(),_$t=vxe(),A$t=cs(),w$t=Ds(),XK=Zp(),JK=Da(),_xe=Vt(),E$t=x1.CastError,ZK;function ei(t,e,n,r){let i=typeof t=="string"&&t.length===24&&/^[a-f0-9]+$/i.test(t),a=e&&e.suppressWarning;(i||typeof t>"u")&&!a&&_xe.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),x1.call(this,t,e,"ObjectId",r)}ei.schemaName="ObjectId";ei.defaultOptions={};ei.prototype=Object.create(x1.prototype);ei.prototype.constructor=ei;ei.prototype.OptionsConstructor=v$t;ei.get=x1.get;ei.set=x1.set;ei.setters=[];ei.prototype.auto=function(t){return t&&(this.default(Axe),this.set(x$t)),this};ei._checkRequired=t=>JK(t,"ObjectId");ei._cast=_$t;ei.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};ei._defaultCaster=t=>{if(!JK(t,"ObjectId"))throw new Error(t+" is not an instance of ObjectId");return t};ei.checkRequired=x1.checkRequired;ei.prototype.checkRequired=function(e,n){return x1._isRef(this,e,n,!0)?!!e:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():ei.checkRequired())(e)};ei.prototype.cast=function(t,e,n,r,i){if(!JK(t,"ObjectId")&&x1._isRef(this,t,e,n)){if((w$t(t)||"").toLowerCase()==="objectid")return new XK(t.toHexString());if(t==null||_xe.isNonBuiltinObject(t))return this._castRef(t,e,n,i)}let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=ei.cast();try{return a(t)}catch(s){throw new E$t("ObjectId",t,this.path,s,this)}};function TO(t){return this.cast(t)}var S$t={...x1.prototype.$conditionalHandlers,$gt:TO,$gte:TO,$lt:TO,$lte:TO};Object.defineProperty(ei.prototype,"$conditionalHandlers",{enumerable:!1,value:S$t});function Axe(){return new XK}Axe.$runBeforeSetters=!0;function x$t(t){return ZK||(ZK=El()),this instanceof ZK&&t===void 0?new XK:t}ei.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function"||this.path==="_id";return A$t("string","objectId",e?.useBsonType,n)};ei.prototype.autoEncryptionType=function(){return"objectId"};wxe.exports=ei});var xxe=y((Yfn,Sxe)=>{"use strict";var T$t=bo(),f0=class extends T$t{},xl=a0();Object.defineProperty(f0.prototype,"enum",xl);Object.defineProperty(f0.prototype,"match",xl);Object.defineProperty(f0.prototype,"lowercase",xl);Object.defineProperty(f0.prototype,"trim",xl);Object.defineProperty(f0.prototype,"uppercase",xl);Object.defineProperty(f0.prototype,"minLength",xl);Object.defineProperty(f0.prototype,"minlength",xl);Object.defineProperty(f0.prototype,"maxLength",xl);Object.defineProperty(f0.prototype,"maxlength",xl);Object.defineProperty(f0.prototype,"populate",xl);Sxe.exports=f0});var QK=y((Zfn,Ixe)=>{"use strict";var T1=li(),S7=i0(),C$t=xxe(),O$t=eO(),I$t=cs(),Txe=Vt(),M$t=Da(),Oxe=T1.CastError;function Dn(t,e,n,r){this.enumValues=[],this.regExp=null,T1.call(this,t,e,"String",r)}Dn.schemaName="String";Dn.defaultOptions={};Dn.prototype=Object.create(T1.prototype);Dn.prototype.constructor=Dn;Object.defineProperty(Dn.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:C$t});Dn._cast=O$t;Dn.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Dn._defaultCaster=t=>{if(t!=null&&typeof t!="string")throw new Error;return t};Dn.get=T1.get;Dn.set=T1.set;Dn.setters=[];Dn._checkRequired=t=>(t instanceof String||typeof t=="string")&&t.length;Dn.checkRequired=T1.checkRequired;Dn.prototype.enum=function(){if(this.enumValidator&&(this.validators=this.validators.filter(function(r){return r.validator!==this.enumValidator},this),this.enumValidator=!1),arguments[0]===void 0||arguments[0]===!1)return this;let t,e;Txe.isObject(arguments[0])?Array.isArray(arguments[0].values)?(t=arguments[0].values,e=arguments[0].message):(t=Txe.object.vals(arguments[0]),e=S7.messages.String.enum):(t=arguments,e=S7.messages.String.enum);for(let r of t)r!==void 0&&this.enumValues.push(this.cast(r));let n=this.enumValues;return this.enumValidator=function(r){return r==null||~n.indexOf(r)},this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:n}),this};Dn.prototype.lowercase=function(t){return arguments.length>0&&!t?this:this.set(e=>(typeof e!="string"&&(e=this.cast(e)),e&&e.toLowerCase()))};Dn.prototype.uppercase=function(t){return arguments.length>0&&!t?this:this.set(e=>(typeof e!="string"&&(e=this.cast(e)),e&&e.toUpperCase()))};Dn.prototype.trim=function(t){return arguments.length>0&&!t?this:this.set(e=>(typeof e!="string"&&(e=this.cast(e)),e&&e.trim()))};Dn.prototype.minlength=function(t,e){if(this.minlengthValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.minlengthValidator},this)),t!=null){let n=e||S7.messages.String.minlength;n=n.replace(/{MINLENGTH}/,t),this.validators.push({validator:this.minlengthValidator=function(r){return r===null||r.length>=t},message:n,type:"minlength",minlength:t})}return this};Dn.prototype.minLength=Dn.prototype.minlength;Dn.prototype.maxlength=function(t,e){if(this.maxlengthValidator&&(this.validators=this.validators.filter(function(n){return n.validator!==this.maxlengthValidator},this)),t!=null){let n=e||S7.messages.String.maxlength;n=n.replace(/{MAXLENGTH}/,t),this.validators.push({validator:this.maxlengthValidator=function(r){return r===null||r.length<=t},message:n,type:"maxlength",maxlength:t})}return this};Dn.prototype.maxLength=Dn.prototype.maxlength;Dn.prototype.match=function(e,n){let r=n||S7.messages.String.match,i=function(a){return e?(e.lastIndex=0,a!=null&&a!==""?e.test(a):!0):!1};return this.validators.push({validator:i,message:r,type:"regexp",regexp:e}),this};Dn.prototype.checkRequired=function(e,n){return typeof e=="object"&&T1._isRef(this,e,n,!0)?e!=null:(typeof this.constructor.checkRequired=="function"?this.constructor.checkRequired():Dn.checkRequired())(e)};Dn.prototype.cast=function(t,e,n,r,i){if(typeof t!="string"&&T1._isRef(this,t,e,n))return this._castRef(t,e,n,i);let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=Dn.cast();try{return a(t)}catch{throw new Oxe("string",t,this.path,null,this)}};function E7(t,e){return this.castForQuery(null,t,e)}function P$t(t,e){let n=this;return Array.isArray(t)?t.map(function(r){return n.castForQuery(null,r,e)}):[this.castForQuery(null,t,e)]}function Cxe(t){return t==null?this._castNullish(t):this.cast(t,this)}var R$t={...T1.prototype.$conditionalHandlers,$all:P$t,$gt:E7,$gte:E7,$lt:E7,$lte:E7,$options:Cxe,$regex:function(e){return Object.prototype.toString.call(e)==="[object RegExp]"?e:Cxe.call(this,e)},$not:E7};Object.defineProperty(Dn.prototype,"$conditionalHandlers",{enumerable:!1,value:R$t});Dn.prototype.castForQuery=function(t,e,n){let r;if(t!=null){if(r=this.$conditionalHandlers[t],!r)throw new Error("Can't use "+t+" with String.");return r.call(this,e,n)}if(Object.prototype.toString.call(e)==="[object RegExp]"||M$t(e,"BSONRegExp"))return e;try{return this.applySetters(e,n)}catch(i){throw i instanceof Oxe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};Dn.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return I$t("string","string",e?.useBsonType,n)};Dn.prototype.autoEncryptionType=function(){return"string"};Ixe.exports=Dn});var Mxe=y((Xfn,nY)=>{"use strict";var eY=jt().UUID,tY=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i;nY.exports=function(e){if(e==null||e instanceof eY)return e;if(typeof e=="string"){if(tY.test(e))return new eY(e);throw new Error(`"${e}" is not a valid UUID string`)}if(e.toString&&e.toString!==Object.prototype.toString&&tY.test(e.toString()))return new eY(e.toString());throw new Error(`"${e}" cannot be casted to a UUID`)};nY.exports.UUID_FORMAT=tY});var Dxe=y((Jfn,kxe)=>{"use strict";var i6=li(),Pxe=i6.CastError,Rxe=Mxe(),k$t=cs(),D$t=Vt(),CO=d7(),N$t=Rxe.UUID_FORMAT;function $$t(t){let e;return typeof t!="string"&&t!=null?(e=t.toString("hex"),e.substring(0,8)+"-"+e.substring(8,12)+"-"+e.substring(12,16)+"-"+e.substring(16,20)+"-"+e.substring(20,32)):t}function Ii(t,e,n,r){i6.call(this,t,e,"UUID",r)}Ii.schemaName="UUID";Ii.defaultOptions={};Ii.prototype=Object.create(i6.prototype);Ii.prototype.constructor=Ii;Ii._cast=Rxe;Ii.get=i6.get;Ii.set=i6.set;Ii.setters=[];Ii.cast=function(e){return arguments.length===0?this._cast:(e===!1&&(e=this._defaultCaster),this._cast=e,this._cast)};Ii._checkRequired=t=>t!=null;Ii.checkRequired=i6.checkRequired;Ii.prototype.checkRequired=function(e){return Buffer.isBuffer(e)&&(e=$$t(e)),e!=null&&N$t.test(e)};Ii.prototype.cast=function(t,e,n,r,i){if(D$t.isNonBuiltinObject(t)&&i6._isRef(this,t,e,n))return this._castRef(t,e,n,i);let a;typeof this._castFunction=="function"?a=this._castFunction:typeof this.constructor.cast=="function"?a=this.constructor.cast():a=Ii.cast();try{return a(t)}catch(s){throw new Pxe(Ii.schemaName,t,this.path,s,this)}};function B$t(t){return this.cast(t)}function rY(t){return t.map(e=>this.cast(e))}var F$t={...i6.prototype.$conditionalHandlers,$bitsAllClear:CO,$bitsAnyClear:CO,$bitsAllSet:CO,$bitsAnySet:CO,$all:rY,$in:rY,$ne:B$t,$nin:rY};Object.defineProperty(Ii.prototype,"$conditionalHandlers",{enumerable:!1,value:F$t});Ii.prototype.castForQuery=function(t,e,n){let r;if(t!=null){if(r=this.$conditionalHandlers[t],!r)throw new Error("Can't use "+t+" with UUID.");return r.call(this,e,n)}try{return this.applySetters(e,n)}catch(i){throw i instanceof Pxe&&i.path===this.path&&this.$fullPath!=null&&(i.path=this.$fullPath),i}};Ii.prototype.toJSONSchema=function(e){let n=this.options.required&&typeof this.options.required!="function";return k$t("string","binData",e?.useBsonType,n)};Ii.prototype.autoEncryptionType=function(){return"binData"};kxe.exports=Ii});var $xe=y((Qfn,Nxe)=>{"use strict";var L$t=bo(),OO=class extends L$t{},q$t=a0();Object.defineProperty(OO.prototype,"of",q$t);Nxe.exports=OO});var Fxe=y((eun,Bxe)=>{"use strict";var U$t=$xe(),j$t=li(),Gy=Symbol("firstValue");var Ky=class extends j$t{constructor(e,n,r,i){if(super(e,n,"Union",i),!n||!Array.isArray(n.of)||n.of.length===0)throw new Error("Union schema type requires an array of types");this.schemaTypes=n.of.map(a=>i.interpretAsType(e,a,r))}cast(e,n,r,i,a){let s=Gy,o;for(let f=0;f<this.schemaTypes.length;++f)try{let u=this.schemaTypes[f].cast(e,n,r,i,a);if(u===e)return u;s===Gy&&(s=u)}catch(u){o=u}if(s!==Gy)return s;throw o}applySetters(e,n,r,i,a){let s=Gy,o;for(let f=0;f<this.schemaTypes.length;++f)try{let u=this.schemaTypes[f]._applySetters(e,n,r,i,a);if(u==null?u=this.schemaTypes[f]._castNullish(u):u=this.schemaTypes[f].cast(u,n,r,i,a),u===e)return u;s===Gy&&(s=u)}catch(u){o=u}if(s!==Gy)return s;throw o}clone(){let e=super.clone();return e.schemaTypes=this.schemaTypes.map(n=>n.clone()),e}};Ky.schemaName="Union";Ky.defaultOptions={};Ky.prototype.OptionsConstructor=U$t;Bxe.exports=Ky});var l7=y(_r=>{"use strict";_r.Array=sO();_r.BigInt=zEe();_r.Boolean=GEe();_r.Buffer=JEe();_r.Date=sSe();_r.Decimal128=_r.Decimal=cSe();_r.DocumentArray=JSe();_r.Double=rxe();_r.Int32=fxe();_r.Map=pxe();_r.Mixed=Oy();_r.Number=yK();_r.ObjectId=Exe();_r.String=QK();_r.Subdocument=jK();_r.UUID=Dxe();_r.Union=Fxe();_r.Oid=_r.ObjectId;_r.Object=_r.Mixed;_r.Bool=_r.Boolean;_r.ObjectID=_r.ObjectId});var im=y((oY,Zxe)=>{"use strict";var V$t=Q("events").EventEmitter,z$t=Zh(),a6=on(),Lxe=li(),qxe=bo(),H$t=ZG(),sY=YC(),Uxe=JG(),Fa=Qr(),jxe=di(),W$t=Ds(),G$t=Mwe(),PO=tK(),K$t=kwe(),Vxe=Nwe(),Y$t=yC(),IO=s0(),Z$t=Bwe(),X$t=Gwe(),J$t=Qh(),hi=Vt(),Q$t=Ywe(),eBt=/\.\d+(\.|$)/,s6,tBt=o7().queryMiddlewareFunctions,nBt=o7().documentMiddlewareFunctions,zxe=tBt.concat(nBt).reduce((t,e)=>t.add(e),new Set),iY=hi.isPOJO,Hxe=0,rBt=/^\d+$/;function Be(t,e){if(!(this instanceof Be))return new Be(t,e);if(this.obj=t,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this._searchIndexes=[],this.methods=e&&e.methods||{},this.methodOptions={},this.statics=e&&e.statics||{},this.tree={},this.query=e&&e.query||{},this.childSchemas=[],this.plugins=[],this.$id=++Hxe,this.mapPaths=[],this.encryptedFields={},this.s={hooks:new z$t},this.options=this.defaultOptions(e),Array.isArray(t))for(let i of t)this.add(i);else t&&this.add(t);if(e&&e.virtuals){let i=e.virtuals,a=Object.keys(i);for(let s of a){let o=i[s].options?i[s].options:void 0,f=this.virtual(s,o);i[s].get&&f.get(i[s].get),i[s].set&&f.set(i[s].set)}}let n=t&&t._id&&hi.isObject(t._id);!this.paths._id&&this.options._id&&!n&&Uxe(this),this.setupTimestamp(this.options.timestamps)}function Wxe(t,e){for(let n of Object.keys(e)){let r=null;if(e[n]!=null)r=e[n];else{let a=jxe(t.paths[n],"options");if(a==null)continue;r=a.alias}if(!r)continue;let i=t.paths[n].path;if(Array.isArray(r)){for(let a of r){if(typeof a!="string")throw new Error("Invalid value for alias option on "+i+", got "+a);t.aliases[a]=i,t.virtual(a).get((function(s){return function(){return typeof this.get=="function"?this.get(s):this[s]}})(i)).set((function(s){return function(o){return this.$set(s,o)}})(i))}continue}if(typeof r!="string")throw new Error("Invalid value for alias option on "+i+", got "+r);t.aliases[r]=i,t.virtual(r).get((function(a){return function(){return typeof this.get=="function"?this.get(a):this[a]}})(i)).set((function(a){return function(s){return this.$set(a,s)}})(i))}}Be.prototype=Object.create(V$t.prototype);Be.prototype.constructor=Be;Be.prototype.instanceOfSchema=!0;Object.defineProperty(Be.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0});Object.defineProperty(Be.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(Be.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0});Be.prototype.obj;Be.prototype.paths;Be.prototype.tree;Be.create=function(e,n){return new Be(e,n)};Be.prototype.clone=function(){let t=this._clone();return t.on("init",e=>this.emit("init",e)),t};Be.prototype._clone=function(e){e=e||(this.base==null?Be:this.base.Schema);let n=new e({},this._userProvidedOptions);n.base=this.base,n.obj=this.obj,n.options=Fa(this.options),n.callQueue=this.callQueue.map(function(r){return r}),n.methods=Fa(this.methods),n.methodOptions=Fa(this.methodOptions),n.statics=Fa(this.statics),n.query=Fa(this.query),n.plugins=Array.prototype.slice.call(this.plugins),n._indexes=Fa(this._indexes),n._searchIndexes=Fa(this._searchIndexes),n.s.hooks=this.s.hooks.clone(),n.tree=Fa(this.tree),n.paths=Object.fromEntries(Object.entries(this.paths).map(([r,i])=>[r,i.clone()])),n.nested=Fa(this.nested),n.subpaths=Fa(this.subpaths);for(let r of Object.values(n.paths))if(r.$isSingleNested){let i=r.path;for(let a of Object.keys(r.schema.paths))n.singleNestedPaths[i+"."+a]=r.schema.paths[a];for(let a of Object.keys(r.schema.singleNestedPaths))n.singleNestedPaths[i+"."+a]=r.schema.singleNestedPaths[a];for(let a of Object.keys(r.schema.subpaths))n.singleNestedPaths[i+"."+a]=r.schema.subpaths[a];for(let a of Object.keys(r.schema.nested))n.singleNestedPaths[i+"."+a]="nested"}return n._gatherChildSchemas(),n.virtuals=Fa(this.virtuals),n.$globalPluginsApplied=this.$globalPluginsApplied,n.$isRootDiscriminator=this.$isRootDiscriminator,n.$implicitlyCreated=this.$implicitlyCreated,n.$id=++Hxe,n.$originalSchemaId=this.$id,n.mapPaths=[].concat(this.mapPaths),this.discriminatorMapping!=null&&(n.discriminatorMapping=Object.assign({},this.discriminatorMapping)),this.discriminators!=null&&(n.discriminators=Object.assign({},this.discriminators)),this._applyDiscriminators!=null&&(n._applyDiscriminators=new Map(this._applyDiscriminators)),n.aliases=Object.assign({},this.aliases),n.encryptedFields=Fa(this.encryptedFields),n};Be.prototype.pick=function(t,e){let n=new Be({},e||this.options);if(!Array.isArray(t))throw new a6('Schema#pick() only accepts an array argument, got "'+typeof t+'"');for(let r of t)if(this._hasEncryptedField(r)){let i=this.encryptedFields[r],a=this.path(r);n.add({[r]:{encrypt:i,[this.options.typeKey]:a}})}else if(this.nested[r])n.add({[r]:jxe(this.tree,r)});else{let i=this.path(r);if(i==null)throw new a6("Path `"+r+"` is not in the schema");n.add({[r]:i})}return this._hasEncryptedFields()||(n.options.encryptionType=null),n};Be.prototype.omit=function(t,e){let n=new Be(this,e||this.options);if(!Array.isArray(t))throw new a6('Schema#omit() only accepts an array argument, got "'+typeof t+'"');n.remove(t);for(let r in n.singleNestedPaths)t.includes(r)&&delete n.singleNestedPaths[r];return n};Be.prototype.defaultOptions=function(t){this._userProvidedOptions=t==null?{}:Fa(t);let e=this.base&&this.base.options||{},n="strict"in e?e.strict:!0,r="strictQuery"in e?e.strictQuery:!1,i="id"in e?e.id:!0;if(t={strict:n,strictQuery:r,bufferCommands:!0,capped:!1,versionKey:"__v",optimisticConcurrency:!1,minimize:!0,autoIndex:null,discriminatorKey:"__t",shardKey:null,read:null,validateBeforeSave:!0,validateModifiedOnly:!1,_id:!0,id:i,typeKey:"type",...t},t.versionKey&&typeof t.versionKey!="string")throw new a6("`versionKey` must be falsy or string, got `"+typeof t.versionKey+"`");if(typeof t.read=="string"?t.read=PO(t.read):Array.isArray(t.read)&&typeof t.read[0]=="string"&&(t.read={mode:PO(t.read[0]),tags:t.read[1]}),t.optimisticConcurrency&&!t.versionKey)throw new a6("Must set `versionKey` if using `optimisticConcurrency`");return t};Be.prototype.discriminator=function(t,e,n){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(t,{schema:e,options:n}),this};Be.prototype._getDocumentMiddleware=function(){return this.s.hooks.filter(e=>e.name==="updateOne"||e.name==="deleteOne"?!!e.document:e.name==="remove"||e.name==="init"?e.document==null||!!e.document:e.query!=null||e.document!=null?e.document!==!1:!0).filter(e=>this.methods[e.name]?!e.fn[J$t.builtInMiddleware]:!0)};Be.prototype._defaultToObjectOptions=function(t){let e=t?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&this._defaultToObjectOptionsMap[e])return this._defaultToObjectOptionsMap[e];let n=this.base&&this.base.options&&this.base.options[e]||{},r=this.options[e]||{},i=Object.assign({},n,r);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[e]=i,i};Be.prototype.encryptionType=function(t){if(arguments.length===0)return this.options.encryptionType;if(!(typeof t=="string"||t===null))throw new Error("invalid `encryptionType`: ${encryptionType}");this.options.encryptionType=t};Be.prototype.add=function(e,n){if(e instanceof Be||e!=null&&e.instanceOfSchema)return Y$t(this,e),this;if(e._id===!1&&n==null&&(this.options._id=!1),n=n||"",n==="__proto__."||n==="constructor."||n==="prototype.")return this;let r=Object.keys(e),i=this.options.typeKey;for(let s of r){if(hi.specialProperties.has(s))continue;let o=n+s,f=e[s];if(f==null)throw new TypeError("Invalid value for schema path `"+o+'`, got value "'+f+'"');if(s==="_id"&&f===!1)continue;let u=!1;if(typeof f=="string"){let c=this.base!=null?this.base.Schema.Types:Be.Types,d=f.charAt(0).toUpperCase()+f.substring(1);u=c[d]!=null}if(s!=="_id"&&(typeof f!="object"&&typeof f!="function"&&!u||f==null))throw new TypeError(`Invalid schema configuration: \`${f}\` is not a valid type at path \`${s}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(f instanceof sY||(f.constructor&&f.constructor.name||null)==="VirtualType"){this.virtual(f);continue}if(Array.isArray(f)&&f.length===1&&f[0]==null)throw new TypeError("Invalid value for schema Array path `"+o+'`, got value "'+f[0]+'"');if(iY(f)||f instanceof qxe)if(Object.keys(f).length<1)n&&(this.nested[n.substring(0,n.length-1)]=!0),this.path(o,f);else if(!f[i]||i==="type"&&iY(f.type)&&f.type.type)this.nested[o]=!0,this.add(f,o+".");else{let c=f[i];if(iY(c)&&Object.keys(c).length>0){n&&(this.nested[n.substring(0,n.length-1)]=!0);let d={};this._userProvidedOptions.typeKey&&(d.typeKey=this._userProvidedOptions.typeKey),this._userProvidedOptions.strict!=null&&(d.strict=this._userProvidedOptions.strict),this._userProvidedOptions.toObject!=null&&(d.toObject=hi.omit(this._userProvidedOptions.toObject,["transform"])),this._userProvidedOptions.toJSON!=null&&(d.toJSON=hi.omit(this._userProvidedOptions.toJSON,["transform"]));let l=new Be(c,d);l.$implicitlyCreated=!0;let p=Object.assign({},f,{[i]:l});this.path(n+s,p)}else if(n&&(this.nested[n.substring(0,n.length-1)]=!0),this.path(n+s,f),f!=null&&!f.instanceOfSchema&&hi.isPOJO(f.discriminators)){let d=this.path(n+s);for(let l in f.discriminators)d.discriminator(l,f.discriminators[l])}}else if(n&&(this.nested[n.substring(0,n.length-1)]=!0),this.path(n+s,f),f[0]!=null&&!f[0].instanceOfSchema&&hi.isPOJO(f[0].discriminators)){let c=this.path(n+s);for(let d in f[0].discriminators)c.discriminator(d,f[0].discriminators[d])}if(f.instanceOfSchema&&f.encryptionType()!=null){if(this.encryptionType()!=f.encryptionType())throw new Error("encryptionType of a nested schema must match the encryption type of the parent schema.");for(let[c,d]of Object.entries(f.encryptedFields)){let l=o+"."+c;this._addEncryptedField(l,d)}}else if(typeof f=="object"&&"encrypt"in f){let{encrypt:c}=f;if(this.encryptionType()==null)throw new Error("encryptionType must be provided");this._addEncryptedField(o,c)}else this._removeEncryptedField(o)}let a=Object.fromEntries(Object.entries(e).map(([s])=>[n+s,null]));return Wxe(this,a),this};Be.prototype._addEncryptedField=function(e,n){if(this.path(e).autoEncryptionType()==null)throw new Error(`Invalid BSON type for FLE field: '${e}'`);this.encryptedFields[e]=Fa(n)};Be.prototype._removeEncryptedField=function(e){delete this.encryptedFields[e]};Be.prototype._hasEncryptedFields=function(){return Object.keys(this.encryptedFields).length>0};Be.prototype._hasEncryptedField=function(e){return e in this.encryptedFields};Be.prototype._buildEncryptedFields=function(){return{fields:Object.entries(this.encryptedFields).map(([e,n])=>{let r=this.path(e).autoEncryptionType();return{path:e,bsonType:r,...n}})}};Be.prototype._buildSchemaMap=function(){function t(r,i,a){let s=0,o=r[s];for(;s<r.length-1;++s,o=r[s])i[o]=i[o]==null?{bsonType:"object",properties:{}}:i[o],i=i[o].properties;i[o]=a}let e=(r,[i,a])=>{let s=this.path(i).autoEncryptionType(),o=i.split("."),f={encrypt:{...a,bsonType:s}};return t(o,r,f),r};return{bsonType:"object",properties:Object.entries(this.encryptedFields).reduce(e,{})}};Be.prototype.alias=function(t,e){return Wxe(this,{[t]:e}),this};Be.prototype.removeIndex=function(e){if(arguments.length>1)throw new Error("removeIndex() takes only 1 argument");if(typeof e!="object"&&typeof e!="string")throw new Error("removeIndex() may only take either an object or a string as an argument");if(typeof e=="object")for(let n=this._indexes.length-1;n>=0;--n)Vxe(this._indexes[n][0],e)&&this._indexes.splice(n,1);else for(let n=this._indexes.length-1;n>=0;--n)this._indexes[n][1]!=null&&this._indexes[n][1].name===e&&this._indexes.splice(n,1);return this};Be.prototype.clearIndexes=function(){return this._indexes.length=0,this};Be.prototype.searchIndex=function(e){return this._searchIndexes.push(e),this};Be.reserved=Object.create(null);Be.prototype.reserved=Be.reserved;var Ba=Be.reserved;Ba.prototype=Ba.emit=Ba.listeners=Ba.removeListener=Ba.collection=Ba.errors=Ba.get=Ba.init=Ba.isModified=Ba.isNew=Ba.populated=Ba.remove=Ba.save=Ba.toObject=Ba.validate=1;Ba.collection=1;Be.prototype.path=function(t,e){if(e===void 0){if(this.paths[t]!=null)return this.paths[t];let f=Gxe(t),u=iBt(this,t,f);if(u!=null)return u;let c=Kxe(this,t);return c??(u=this.hasMixedParent(f),u??(eBt.test(t)?aBt(this,t,f):void 0))}let n=t.split(".")[0];if(Ba[n]&&!this.options.suppressReservedKeysWarning){let f=`\`${n}\` is a reserved schema pathname and may break some functionality. You are allowed to use it, but use at your own risk. To disable this warning pass \`suppressReservedKeysWarning\` as a schema option.`;hi.warn(f)}typeof e=="object"&&hi.hasUserDefinedProperty(e,"ref")&&Q$t(e.ref,t);let r=t.split(/\./),i=r.pop(),a=this.tree,s="";for(let f of r){if(hi.specialProperties.has(f))throw new Error("Cannot set special property `"+f+"` on a schema");if(s=s+=(s.length>0?".":"")+f,a[f]||(this.nested[s]=!0,a[f]={}),typeof a[f]!="object"){let u="Cannot set nested path `"+t+"`. Parent path `"+s+"` already set to type "+a[f].name+".";throw new Error(u)}a=a[f]}a[i]=Fa(e),this.paths[t]=this.interpretAsType(t,e,this.options);let o=this.paths[t];if(this.childSchemas=this.childSchemas.filter(f=>f.path!==t),o.$isSchemaMap){let f=t+".$*";this.paths[f]=o.$__schemaType,this.mapPaths.push(this.paths[f]),o.$__schemaType.$isSingleNested&&this.childSchemas.push({schema:o.$__schemaType.schema,model:o.$__schemaType.Constructor,path:t})}if(o.$isSingleNested){for(let f of Object.keys(o.schema.paths))this.singleNestedPaths[t+"."+f]=o.schema.paths[f];for(let f of Object.keys(o.schema.singleNestedPaths))this.singleNestedPaths[t+"."+f]=o.schema.singleNestedPaths[f];for(let f of Object.keys(o.schema.subpaths))this.singleNestedPaths[t+"."+f]=o.schema.subpaths[f];for(let f of Object.keys(o.schema.nested))this.singleNestedPaths[t+"."+f]="nested";Object.defineProperty(o.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),o.Constructor.base=this.base,this.childSchemas.push({schema:o.schema,model:o.Constructor,path:t})}else o.$isMongooseDocumentArray&&(Object.defineProperty(o.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),o.Constructor.base=this.base,this.childSchemas.push({schema:o.schema,model:o.Constructor,path:t}));if(o.$isMongooseArray&&!o.$isMongooseDocumentArray){let f=t,u=o,c=[];for(;u.$isMongooseArray;)f=f+".$",u.embeddedSchemaType._arrayPath=f,u.embeddedSchemaType._arrayParentPath=t,u=u.embeddedSchemaType,this.subpaths[f]=u;for(let d of c)this.subpaths[d.path]=d}if(o.$isMongooseDocumentArray){for(let f of Object.keys(o.schema.paths)){let u=o.schema.paths[f];this.subpaths[t+"."+f]=u,typeof u=="object"&&u!=null&&u.$parentSchemaDocArray==null&&(u.$parentSchemaDocArray=o)}for(let f of Object.keys(o.schema.subpaths)){let u=o.schema.subpaths[f];this.subpaths[t+"."+f]=u,typeof u=="object"&&u!=null&&u.$parentSchemaDocArray==null&&(u.$parentSchemaDocArray=o)}for(let f of Object.keys(o.schema.singleNestedPaths)){let u=o.schema.singleNestedPaths[f];this.subpaths[t+"."+f]=u,typeof u=="object"&&u!=null&&u.$parentSchemaDocArray==null&&(u.$parentSchemaDocArray=o)}}return this};Be.prototype._gatherChildSchemas=function(){let e=[];for(let n of Object.keys(this.paths)){if(typeof n!="string")continue;let r=this.paths[n];r.$isMongooseDocumentArray||r.$isSingleNested?e.push({schema:r.schema,model:r.Constructor,path:n}):r.$isSchemaMap&&r.$__schemaType.$isSingleNested&&e.push({schema:r.$__schemaType.schema,model:r.$__schemaType.Constructor,path:n})}return this.childSchemas=e,e};function iBt(t,e,n){if(t.paths.hasOwnProperty(e))return t.paths[e];if(t.subpaths.hasOwnProperty(n)){let r=t.subpaths[n];return r==="nested"?void 0:r}if(t.singleNestedPaths.hasOwnProperty(n)&&typeof t.singleNestedPaths[n]=="object"){let r=t.singleNestedPaths[n];return r==="nested"?void 0:r}return null}function Gxe(t){return/\.\d+/.test(t)?t.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):t}function Kxe(t,e){if(t.mapPaths.length===0)return null;for(let n of t.mapPaths){let r=n.path.replace(/\.\$\*/g,"");if(e===r||e.startsWith(r+".")&&e.slice(r.length+1).indexOf(".")===-1)return n;if(n.schema&&e.startsWith(r+".")){let i=e.slice(r.length+1);return i=i.slice(i.indexOf(".")+1),n.schema.paths[i]}else if(n.$isSchemaMap&&e.startsWith(r+".")){let i=e.slice(r.length+1);i=i.slice(i.indexOf(".")+1);let a=n.$__schemaType._presplitPath;if(i.indexOf(".")===-1&&a[a.length-1]==="$*")return n.$__schemaType;if(i.indexOf(".")!==-1&&n.$__schemaType.schema&&a[a.length-1]==="$*")return n.$__schemaType.schema.path(i.slice(i.indexOf(".")+1))}}return null}Object.defineProperty(Be.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null});Be.prototype.interpretAsType=function(t,e,n){if(e instanceof Lxe){if(e.path===t)return e;let f=e.clone();return f.path=t,f}let r=this.base!=null?this.base.Schema.Types:Be.Types,i=this.base!=null?this.base.Types:$y();if(!hi.isPOJO(e)&&!(e instanceof qxe)&&hi.getFunctionName(e.constructor)!=="Object"){let u=e;e={},e[n.typeKey]=u}let a=e[n.typeKey]&&(e[n.typeKey]instanceof Function||n.typeKey!=="type"||!e.type.type)?e[n.typeKey]:{};if(a instanceof Lxe){if(a.path===t)return a;let f=a.clone();return f.path=t,f}let s;if(hi.isPOJO(a)||a==="mixed")return new r.Mixed(t,e,null,this);if(Array.isArray(a)||a===Array||a==="array"||a===r.Array){let f=a===Array||a==="array"?e.cast||e.of:a[0];if(f&&f.instanceOfSchema){if(!(f instanceof Be))if(this.options._isMerging)f=new Be(f);else throw new TypeError("Schema for array path `"+t+`\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${t}: new Schema(...)`);return new r.DocumentArray(t,f,e,null,this)}if(f&&f[n.typeKey]&&f[n.typeKey].instanceOfSchema){if(!(f[n.typeKey]instanceof Be))if(this.options._isMerging)f[n.typeKey]=new Be(f[n.typeKey]);else throw new TypeError("Schema for array path `"+t+`\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${t}: new Schema(...)`);return new r.DocumentArray(t,f[n.typeKey],e,f,this)}if(typeof f<"u"&&(Array.isArray(f)||f.type===Array||f.type=="Array"))return f&&f.type=="Array"&&(f.type=Array),new r.Array(t,this.interpretAsType(t,f,n),e,null,this);let u=f!=null&&f[n.typeKey]&&(n.typeKey!=="type"||!f.type.type)?f[n.typeKey]:f;if(typeof f=="string")f=r[f.charAt(0).toUpperCase()+f.substring(1)];else if(hi.isPOJO(u))if(Object.keys(u).length){let c={minimize:n.minimize};n.typeKey&&(c.typeKey=n.typeKey),n.hasOwnProperty("strict")&&(c.strict=n.strict),n.hasOwnProperty("strictQuery")&&(c.strictQuery=n.strictQuery),n.hasOwnProperty("toObject")&&(c.toObject=hi.omit(n.toObject,["transform"])),n.hasOwnProperty("toJSON")&&(c.toJSON=hi.omit(n.toJSON,["transform"])),this._userProvidedOptions.hasOwnProperty("_id")?c._id=this._userProvidedOptions._id:Be.Types.DocumentArray.defaultOptions._id!=null&&(c._id=Be.Types.DocumentArray.defaultOptions._id);let d=new Be(u,c);return d.$implicitlyCreated=!0,new r.DocumentArray(t,d,e,null,this)}else return new r.Array(t,r.Mixed,e,null,this);if(f){if(a=f[n.typeKey]&&(n.typeKey!=="type"||!f.type.type)?f[n.typeKey]:f,Array.isArray(a))return new r.Array(t,this.interpretAsType(t,a,n),e,null,this);if(s=typeof a=="string"?a:a.schemaName||hi.getFunctionName(a),s==="ClockDate"&&(s="Date"),s===void 0)throw new TypeError(`Invalid schema configuration: Could not determine the embedded type for array \`${t}\`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(!r.hasOwnProperty(s))throw new TypeError(`Invalid schema configuration: \`${s}\` is not a valid type within the array \`${t}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);s==="Union"&&typeof f=="object"&&(f.parentSchema=this)}return new r.Array(t,f||r.Mixed,e,n,this)}if(a&&a.instanceOfSchema)return new r.Subdocument(a,t,e,this);if(Buffer.isBuffer(a)?s="Buffer":typeof a=="function"||typeof a=="object"?s=a.schemaName||hi.getFunctionName(a):a===i.ObjectId?s="ObjectId":a===i.Decimal128?s="Decimal128":s=a==null?""+a:a.toString(),s&&(s=s.charAt(0).toUpperCase()+s.substring(1)),s==="ObjectID"&&(s="ObjectId"),s==="ClockDate"&&(s="Date"),s===void 0)throw new TypeError(`Invalid schema configuration: \`${t}\` schematype definition is invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(r[s]==null)throw new TypeError(`Invalid schema configuration: \`${s}\` is not a valid type at path \`${t}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);return new r[s](t,e,n,this)};Be.prototype.eachPath=function(t){let e=Object.keys(this.paths),n=e.length;for(let r=0;r<n;++r)t(e[r],this.paths[e[r]]);return this};Be.prototype.requiredPaths=function(e){if(this._requiredpaths&&!e)return this._requiredpaths;let n=Object.keys(this.paths),r=n.length,i=[];for(;r--;){let a=n[r];this.paths[a].isRequired&&i.push(a)}return this._requiredpaths=i,this._requiredpaths};Be.prototype.indexedPaths=function(){return this._indexedpaths?this._indexedpaths:(this._indexedpaths=this.indexes(),this._indexedpaths)};Be.prototype.pathType=function(t){if(this.paths.hasOwnProperty(t))return"real";if(this.virtuals.hasOwnProperty(t))return"virtual";if(this.nested.hasOwnProperty(t))return"nested";let e=Gxe(t);if(this.subpaths.hasOwnProperty(e)||this.subpaths.hasOwnProperty(t))return"real";let n=this.singleNestedPaths.hasOwnProperty(e)||this.singleNestedPaths.hasOwnProperty(t);return n?n==="nested"?"nested":"real":Kxe(this,t)!=null?"real":/\.\d+\.|\.\d+$/.test(t)?Yxe(this,t,e):"adhocOrUndefined"};Be.prototype.hasMixedParent=function(t){let e=t.split(/\./g);t="";for(let n=0;n<e.length;++n)if(t=n>0?t+"."+e[n]:e[n],this.paths.hasOwnProperty(t)&&this.paths[t]instanceof s6.Mixed)return this.paths[t];return null};Be.prototype.setupTimestamp=function(t){return X$t(this,t)};function Yxe(t,e,n){let r=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:"adhocOrUndefined";let i=t.path(r[0]),a=!1;if(!i)return"adhocOrUndefined";let s=r.length-1;for(let o=1;o<r.length;++o){a=!1;let f=r[o];if(o===s&&i&&!/\D/.test(f)){i.$isMongooseDocumentArray||i instanceof s6.Array?i=i.embeddedSchemaType:i=void 0;break}if(!/\D/.test(f)){i instanceof s6.Array&&o!==s&&(i=i.embeddedSchemaType);continue}if(!(i&&i.schema)){i=void 0;break}a=i.schema.pathType(f)==="nested",i=i.schema.path(f)}return t.subpaths[n]=i,i?"real":a?"nested":"adhocOrUndefined"}function aBt(t,e,n){return Yxe(t,e,n),t.subpaths[n]}Be.prototype.queue=function(t,e){return this.callQueue.push([t,e]),this};Be.prototype.pre=function(t){if(t instanceof RegExp){let e=Array.prototype.slice.call(arguments,1);for(let n of zxe)t.test(n)&&this.pre.apply(this,[n].concat(e));return this}if(Array.isArray(t)){let e=Array.prototype.slice.call(arguments,1);for(let n of t)this.pre.apply(this,[n].concat(e));return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this};Be.prototype.post=function(t){if(t instanceof RegExp){let e=Array.prototype.slice.call(arguments,1);for(let n of zxe)t.test(n)&&this.post.apply(this,[n].concat(e));return this}if(Array.isArray(t)){let e=Array.prototype.slice.call(arguments,1);for(let n of t)this.post.apply(this,[n].concat(e));return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this};Be.prototype.plugin=function(t,e){if(typeof t!="function")throw new Error('First param to `schema.plugin()` must be a function, got "'+typeof t+'"');if(e&&e.deduplicate){for(let n of this.plugins)if(n.fn===t)return this}return this.plugins.push({fn:t,opts:e}),t(this,e),this};Be.prototype.method=function(t,e,n){if(typeof t!="string")for(let r in t)this.methods[r]=t[r],this.methodOptions[r]=Fa(n);else this.methods[t]=e,this.methodOptions[t]=Fa(n);return this};Be.prototype.static=function(t,e){if(typeof t!="string")for(let n in t)this.statics[n]=t[n];else this.statics[t]=e;return this};Be.prototype.index=function(t,e){t||(t={}),e||(e={}),e.expires&&hi.expires(e);for(let n in t)this.aliases[n]&&(t=hi.renameObjKey(t,n,this.aliases[n]));for(let n of Object.keys(t))t[n]==="ascending"||t[n]==="asc"?t[n]=1:(t[n]==="descending"||t[n]==="desc")&&(t[n]=-1);for(let n of this.indexes())e.name==null&&n[1].name==null&&Vxe(n[0],t)&&hi.warn(`Duplicate schema index on ${JSON.stringify(t)} found. This is often due to declaring an index using both "index: true" and "schema.index()". Please remove the duplicate index definition.`);return this._indexes.push([t,e]),this};Be.prototype.set=function(t,e,n){if(arguments.length===1)return this.options[t];switch(t){case"read":typeof e=="string"?this.options[t]={mode:PO(e),tags:n}:Array.isArray(e)&&typeof e[0]=="string"?this.options[t]={mode:PO(e[0]),tags:e[1]}:this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"timestamps":this.setupTimestamp(e),this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"_id":this.options[t]=e,this._userProvidedOptions[t]=this.options[t],e&&!this.paths._id?Uxe(this):!e&&this.paths._id!=null&&this.paths._id.auto&&this.remove("_id");break;default:this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break}return t==="strict"&&x7(this,{strict:e}),t==="strictQuery"&&x7(this,{strictQuery:e}),t==="toObject"&&(e={...e},delete e.transform,x7(this,{toObject:e})),t==="toJSON"&&(e={...e},delete e.transform,x7(this,{toJSON:e})),this};function x7(t,e){for(let{schema:n}of t.childSchemas)n.$implicitlyCreated&&(Object.assign(n.options,e),x7(n,e))}Be.prototype.get=function(t){return this.options[t]};var sBt="2d 2dsphere hashed text".split(" ");Object.defineProperty(Be,"indexTypes",{get:function(){return sBt},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}});Be.prototype.indexes=function(){return G$t(this)};Be.prototype.virtual=function(t,e){if(t instanceof sY||W$t(t)==="VirtualType")return this.virtual(t.path,t.options);if(e=new H$t(e),hi.hasUserDefinedProperty(e,["ref","refPath"])){if(e.localField==null)throw new Error("Reference virtuals require `localField` option");if(e.foreignField==null)throw new Error("Reference virtuals require `foreignField` option");let i=this.virtual(t);i.options=e,this.pre("init",function(f,u){if(IO.has(t,f)){let c=IO.get(t,f);if(this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?this.$$populatedVirtuals[t]=Array.isArray(c)?c[0]:c:this.$$populatedVirtuals[t]=Array.isArray(c)?c:c==null?[]:[c],u?.hydratedPopulatedDocs&&!e.count){let d=i._getModelNamesForPopulate(this),l=this.$$populatedVirtuals[t];if(!Array.isArray(l)&&!l.$__&&d?.length===1){let p=this.db.model(d[0]);this.$$populatedVirtuals[t]=p.hydrate(l)}else if(Array.isArray(l)&&d?.length===1){let p=this.db.model(d[0]);for(let v=0;v<l.length;++v)l[v].$__||(l[v]=p.hydrate(l[v],null,{hydratedPopulatedDocs:!0}));let h=e.foreignField;this.$populated(t,l.map(v=>v==null?v:v.get(typeof h=="function"?h.call(v,v):h)),{populateModelSymbol:p})}}IO.unset(t,f)}}),i.set(function(o){return this.$$populatedVirtuals||(this.$$populatedVirtuals={}),Z$t(this.$$populatedVirtuals,t,o,e)}),typeof e.get=="function"&&i.get(e.get);let a=t.split("."),s=a[0];for(let o=0;o<a.length-1;++o)if(this.paths[s]!=null){if(this.paths[s].$isMongooseDocumentArray||this.paths[s].$isSingleNested){let f=a.slice(o+1).join(".");this.paths[s].schema.virtual(f,e);break}else if(this.paths[s].$isSchemaMap){let f=a.slice(o+2).join(".");this.paths[s].$__schemaType.schema.virtual(f,e);break}s+="."+a[o+1]}return i}let n=this.virtuals,r=t.split(".");if(this.pathType(t)==="real")throw new Error('Virtual path "'+t+'" conflicts with a real path in the schema');if(n[t]=r.reduce(function(i,a,s){return i[a]||(i[a]=s===r.length-1?new sY(e,t):{}),i[a]},this.tree),e&&e.applyToArray&&r.length>1){let i=this.path(r.slice(0,-1).join("."));if(i&&i.$isMongooseArray)return i.virtual(r[r.length-1],e);throw new a6(`Path "${i}" is not an array`)}return n[t]};Be.prototype.virtualpath=function(t){return this.virtuals.hasOwnProperty(t)?this.virtuals[t]:null};Be.prototype.remove=function(t){return typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(function(e){if(!(this.path(e)==null&&!this.nested[e])){if(this.nested[e]){let n=Object.keys(this.paths).concat(Object.keys(this.nested));for(let r of n)r.startsWith(e+".")&&(delete this.paths[r],delete this.nested[r],aY(this,r));delete this.nested[e],aY(this,e);return}delete this.paths[e],aY(this,e),this._removeEncryptedField(e)}},this),this};function aY(t,e){let n=e.split("."),r=n.pop(),i=t.tree;for(let a of n)i=i[a];delete i[r]}Be.prototype.removeVirtual=function(t){if(typeof t=="string"&&(t=[t]),Array.isArray(t)){for(let e of t)if(this.virtuals[e]==null)throw new a6(`Attempting to remove virtual "${e}" that does not exist.`);for(let e of t)delete this.paths[e],delete this.virtuals[e],e.indexOf(".")!==-1?IO.unset(e,this.tree):delete this.tree[e]}return this};Be.prototype.loadClass=function(t,e){return t===Object.prototype||t===Function.prototype||t.prototype.hasOwnProperty("$isMongooseModelPrototype")||t.prototype.hasOwnProperty("$isMongooseDocumentPrototype")?this:(this.loadClass(Object.getPrototypeOf(t),e),e||Object.getOwnPropertyNames(t).forEach(function(n){if(n.match(/^(length|name|prototype|constructor|__proto__)$/))return;let r=Object.getOwnPropertyDescriptor(t,n);r.hasOwnProperty("value")&&this.static(n,r.value)},this),Object.getOwnPropertyNames(t.prototype).forEach(function(n){if(n.match(/^(constructor)$/))return;let r=Object.getOwnPropertyDescriptor(t.prototype,n);e||typeof r.value=="function"&&this.method(n,r.value),typeof r.get=="function"&&(this.virtuals[n]&&(this.virtuals[n].getters=[]),this.virtual(n).get(r.get)),typeof r.set=="function"&&(this.virtuals[n]&&(this.virtuals[n].setters=[]),this.virtual(n).set(r.set))},this),this)};Be.prototype._getSchema=function(t){let e=this,n=e.path(t),r=[];if(n)return n.$fullPath=t,n;function i(s,o){let f=s.length+1,u,c;for(;f--;)if(c=s.slice(0,f).join("."),u=o.path(c),u){if(r.push(c),u.embeddedSchemaType||u.Constructor){if(u.embeddedSchemaType instanceof s6.Mixed)return u.embeddedSchemaType.$fullPath=r.join("."),u.embeddedSchemaType;if(f!==s.length){if(f+1===s.length&&u.embeddedSchemaType&&(s[f]==="$"||MO(s[f])))return u.embeddedSchemaType;if(u.schema){let d;return s[f]==="$"||MO(s[f])?f+1===s.length?u.embeddedSchemaType:(d=i(s.slice(f+1),u.schema),d&&(d.$parentSchemaDocArray=d.$parentSchemaDocArray||(u.schema.$isSingleNested?null:u)),d):(d=i(s.slice(f),u.schema),d&&(d.$parentSchemaDocArray=d.$parentSchemaDocArray||(u.schema.$isSingleNested?null:u)),d)}}}else if(u.$isSchemaMap){if(f>=s.length)return u;if(f+1>=s.length||u.$__schemaType instanceof s6.Mixed)return u.$__schemaType;if(u.$__schemaType.schema!=null)return i(s.slice(f+1),u.$__schemaType.schema)}return u.$fullPath=r.join("."),u}}let a=t.split(".");for(let s=0;s<a.length;++s)(a[s]==="$"||MO(a[s]))&&(a[s]="0"),rBt.test(a[s])&&(a[s]="$");return i(a,e)};Be.prototype._getPathType=function(t){let e=this;if(e.path(t))return"real";function r(i,a){let s=i.length+1,o,f;for(;s--;){if(f=i.slice(0,s).join("."),o=a.path(f),o)return o.embeddedSchemaType||o.Constructor?o.embeddedSchemaType instanceof s6.Mixed?{schema:o,pathType:"mixed"}:s!==i.length&&o.schema?i[s]==="$"||MO(i[s])?s===i.length-1?{schema:o,pathType:"nested"}:r(i.slice(s+1),o.schema):r(i.slice(s),o.schema):{schema:o,pathType:o.$isSingleNested?"nested":"array"}:{schema:o,pathType:"real"};if(s===i.length&&a.nested[f])return{schema:a,pathType:"nested"}}return{schema:o||a,pathType:"undefined"}}return r(t.split("."),e)};Be.prototype._transformDuplicateKeyError=function(e){if(!this._duplicateKeyErrorMessagesByPath||e.code!==11e3&&e.code!==11001)return e;if(e.keyPattern!=null){let n=e.keyPattern,r=Object.keys(n);if(r.length!==1)return e;let i=r[0];return this._duplicateKeyErrorMessagesByPath.hasOwnProperty(i)?new a6(this._duplicateKeyErrorMessagesByPath[i],{cause:e}):e}return e};function MO(t){return t.startsWith("$[")&&t.endsWith("]")}Be.prototype._preCompile=function(){this.plugin(K$t,{deduplicate:!0})};Be.prototype.toJSONSchema=function(e){let n=e?.useBsonType??!1,r=n?{required:[],properties:{}}:{type:"object",required:[],properties:{}};for(let i of Object.keys(this.paths)){let a=this.paths[i];if(a._presplitPath.indexOf("$*")!==-1)continue;let s=a._presplitPath.length>1,o=r;if(s)for(let c=0;c<a._presplitPath.length-1;++c){let d=a._presplitPath[c];o.properties[d]==null&&(o.properties[d]=n?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}}),o=o.properties[d]}let f=a._presplitPath[a._presplitPath.length-1],u=!1;i==="_id"?(o.required||(o.required=[]),o.required.push("_id"),u=!0):a.options.required&&typeof a.options.required!="function"&&(o.required||(o.required=[]),o.required.push(f),u=!0),o.properties[f]=a.toJSONSchema(e),a.options.enum&&(o.properties[f].enum=u?a.options.enum:[...a.options.enum,null])}return r.required.length===0&&delete r.required,r};Zxe.exports=oY=Be;Be.Types=s6=l7();oY.ObjectId=s6.ObjectId});var fY=y((nun,Xxe)=>{"use strict";var oBt=i0(),RO=class extends oBt{constructor(e,n,r,i){let a=e.map(s=>s.message).join(", ");a.length>200&&(a=a.slice(0,200)+"..."),super(`${i} failed with ${e.length} Mongoose validation errors: ${a}`),this.validationErrors=e,this.results=n,this.rawResult=r,this.operation=i}};Object.defineProperty(RO.prototype,"name",{value:"MongooseBulkWriteError"});Xxe.exports=RO});var Qxe=y((run,Jxe)=>{"use strict";var fBt=on(),kO=class extends fBt{constructor(e,n){super(e),this.errors=n}};Object.defineProperty(kO.prototype,"name",{value:"SyncIndexesError"});Jxe.exports=kO});var uY=y((iun,eTe)=>{"use strict";eTe.exports=function t(e,n,r,i){if(e[i])return;if(e[i]=!0,!r||!r.skipTopLevel){let f=null;for(let u of n){let c=u[1]==null?null:u[1].tags;if(!Array.isArray(c)){e.plugin(u[0],u[1]);continue}f=f||new Set(e.options.pluginTags||[]),c.find(d=>f.has(d))&&e.plugin(u[0],u[1])}}if(r=Object.assign({},r),delete r.skipTopLevel,r.applyPluginsToChildSchemas!==!1)for(let f of Object.keys(e.paths)){let u=e.paths[f];u.schema!=null&&(t(u.schema,n,r,i),u.Constructor.prototype.$__setSchema(u.schema))}let a=e.discriminators;if(a==null)return;let s=r.applyPluginsToDiscriminators,o=Object.keys(a);for(let f of o){let u=a[f];t(u,n,{skipTopLevel:!s},i)}}});var DO=y((aun,cY)=>{"use strict";var tTe=null;cY.exports.get=function(){return tTe};cY.exports.set=function(t){tTe=t}});var lY=y((sun,nTe)=>{"use strict";function uBt(){return{ok:1,nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[],writeErrors:[],insertedIds:[],writeConcernErrors:[]}}nTe.exports=uBt});var iTe=y((oun,rTe)=>{"use strict";var cBt=on(),NO=class extends cBt{constructor(e,n){super(e),this.errors=n}};Object.defineProperty(NO.prototype,"name",{value:"CreateCollectionsError"});rTe.exports=NO});var oTe=y((fun,sTe)=>{"use strict";var aTe=OC().modifiedPaths;sTe.exports=function(e){let n=Object.keys(e),r={},i={};for(let a of n){if(a.startsWith("$")){aTe(e[a],"",r);continue}i[a]=e[a]}return aTe(i,"",r),r}});var dY=y((uun,fTe)=>{"use strict";var lBt=oTe();fTe.exports=function(e){if(e==null)return{};let n=lBt(e);return Object.keys(n).reduce((r,i)=>{let a=i.match(/\$\[[^\]]+\]/g);if(a==null)return r;for(let s of a){let o=i.indexOf(s);if(o!==i.lastIndexOf(s))throw new Error(`Path '${i}' contains the same array filter multiple times`);r[s.substring(2,s.length-1)]=i.substring(0,o-1).replace(/\$\[[^\]]+\]/g,"0")}return r},{})}});var lTe=y((cun,cTe)=>{"use strict";var dBt=s7(),uTe=di(),pBt=W0(),hBt=dY();cTe.exports=function(e,n,r,i,a){let s=i.indexOf(".")===-1?[i]:i.split("."),o=null,f="adhocOrUndefined";r=r||{},n=n||{};let u=a!=null&&Array.isArray(a.arrayFilters)?a.arrayFilters:[],c=hBt(n),d=0;for(let l=0;l<s.length;++l){let p=s.slice(d,l+1).join("."),h=dBt(p);if(o=e.path(h),o!=null&&(f=e.pathType(h),(o.$isSingleNested||o.$isMongooseDocumentArrayElement)&&o.schema.discriminators!=null)){let v=uTe(o,"schema.options.discriminatorKey"),E=h+"."+v,M=E.replace(/\.\d+\./,"."),D=null;E in r&&(D=r[E]),M in r&&(D=r[M]);let $=h.replace(/\.\d+$/,"");o.$isMongooseDocumentArrayElement&&uTe(r[$],"$elemMatch."+v)!=null&&(D=r[$].$elemMatch[v]);let N=p+"."+v;N in n&&(D=n[N]),E in n&&(D=n[E]);for(let Y of Object.keys(c)){let W=c[Y]+"."+v,B=Y+"."+v;if(W===M){let _=u.find(C=>C.hasOwnProperty(B));_!=null&&(D=_[B])}}if(D==null)continue;let V=pBt(o.Constructor.discriminators,D),j=V&&V.schema;if(j==null)continue;let K=s.slice(l+1).join(".");if(o=j.path(K),e=j,d=l+1,o!=null){f=j._getPathType(K);break}}}return{type:f,schematype:o}}});var pTe=y((lun,dTe)=>{"use strict";var mBt=Xp();dTe.exports=function(e,n,r,i,a,s,o){if(e==null||!e.options||!e.options.immutable)return!1;let f=e.options.immutable;if(typeof f=="function"&&(f=f.call(o,o)),!f||s&&s.overwriteImmutable||n===!1)return!1;if(n==="throw")throw new mBt(null,`Field ${a} is immutable and strict = 'throw'`);return delete r[i],!0}});var yTe=y((dun,mTe)=>{"use strict";var yBt=di();mTe.exports=function(e,n,r){if(n==null)return;let i=Object.keys(n);for(let a of i){let s=a.startsWith("$");if(a==="$set"){let o=Object.keys(n[a]);for(let f of o)hTe(e,n[a],f,n,r)}else s||hTe(e,n,a,n,r)}};function hTe(t,e,n,r,i){let a=t.path(n);if(a==null)return;let s=yBt(a,"options.immutable",null);s!=null&&(typeof s=="function"&&(s=s.call(i,i)),s&&(r.$setOnInsert=r.$setOnInsert||{},r.$setOnInsert[n]=e[n],delete e[n]))}});var hY=y((pun,bTe)=>{"use strict";var pY=Kh();bTe.exports=function(e,n,r){if(n.indexOf(".")===-1){if(pY.has(n))return;e[n]=r;return}let i=n.split("."),a=i.pop(),s=e;for(let o of i)pY.has(o)||(s[o]==null&&(s[o]={}),s=s[o]);pY.has(a)||(s[a]=r)}});var _Y=y((hun,xTe)=>{"use strict";var $O=fs(),Zy=on(),gTe=QK(),vTe=Xp(),bBt=Jh(),bY=f7(),gBt=om(),vBt=Ds(),mY=W0(),yY=lTe(),_Te=pTe(),_Bt=yTe(),ETe=Qh().schemaMixedSymbol,ABt=hY(),Xy=Vt(),{internalToObjectOptions:wBt}=oc(),gY=new Set(["$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$bit"]);xTe.exports=function(e,n,r,i,a){if(n==null)return;if(r=r||{},Array.isArray(n)){let d=n.length;for(let l=0;l<d;++l){let p=Object.keys(n[l]);for(let h of p)n[l][h]=EBt(h,n[l][h])}return n}if(e!=null&&a!=null&&Xy.hasUserDefinedProperty(a,e.options.discriminatorKey)&&typeof a[e.options.discriminatorKey]!="object"&&e.discriminators!=null){let d=a[e.options.discriminatorKey],l=mY(i.model.discriminators,d);e=e.discriminators[d]||l&&l.schema||e}else if(e!=null&&r.overwriteDiscriminatorKey&&Xy.hasUserDefinedProperty(n,e.options.discriminatorKey)&&e.discriminators!=null){let d=n[e.options.discriminatorKey],l=mY(i.model.discriminators,d);e=e.discriminators[d]||l&&l.schema||e}else if(e!=null&&r.overwriteDiscriminatorKey&&n.$set!=null&&Xy.hasUserDefinedProperty(n.$set,e.options.discriminatorKey)&&e.discriminators!=null){let d=n.$set[e.options.discriminatorKey],l=mY(i.model.discriminators,d);e=e.discriminators[d]||l&&l.schema||e}r.upsert&&_Bt(e,n,i);let s=Object.keys(n),o=s.length,f={},u,c=!1;for(a=a||{};o--;){let d=s[o];gY.has(d)?d==="$set"&&f.$set||(f[d]=n[d]):(f.$set||(n.$set?f.$set=n.$set:f.$set={}),f.$set[d]=n[d],s.splice(o,1),~s.indexOf("$set")||s.push("$set"))}for(o=s.length;o--;){let d=s[o];if(u=f[d],c=c||d.startsWith("$"),u!=null&&u.$__&&(u=u.toObject(wBt),f[d]=u),u&&typeof u=="object"&&!Buffer.isBuffer(u)&&gY.has(d))STe(e,u,d,r,i,a);else{let l="Invalid atomic update value for "+d+". Expected an object, received "+typeof u;throw new Error(l)}d.startsWith("$")&&Xy.isEmptyObject(u)&&delete f[d]}return Object.keys(f).length===0&&r.upsert&&Object.keys(a).length>0?{$setOnInsert:{...a}}:f};function EBt(t,e){if(t==="$unset"){if(typeof e!="string"&&(!Array.isArray(e)||e.find(n=>typeof n!="string")))throw new Zy("Invalid $unset in pipeline, must be a string or an array of strings");return e}if(t==="$project"){if(e==null||typeof e!="object")throw new Zy("Invalid $project in pipeline, must be an object");return e}if(t==="$addFields"||t==="$set"){if(e==null||typeof e!="object")throw new Zy("Invalid "+t+" in pipeline, must be an object");return e}else if(t==="$replaceRoot"||t==="$replaceWith"){if(e==null||typeof e!="object")throw new Zy("Invalid "+t+" in pipeline, must be an object");return e}throw new Zy('Invalid update pipeline operator: "'+t+'"')}function STe(t,e,n,r,i,a,s){let o=r.strict;s=s?s+".":"";let f=Object.keys(e),u=f.length,c=!1,d,l,p,h=null,v=o??t.options.strict;for(;u--;){if(l=f[u],p=e[l],n==="$pull"){if(d=t._getSchema(s+l),d==null){let M=yY(t,e,a,s+l,r);M.schematype!=null&&(d=M.schematype)}if(d!=null&&d.schema!=null){e[l]=gBt(d.schema,e[l],r,i),c=!0;continue}}let E=s?s+l:l;if(t.discriminatorMapping!=null&&E===t.options.discriminatorKey&&t.discriminatorMapping.value!==e[l]&&!r.overwriteDiscriminatorKey){if(v==="throw"){let M=new Error(`Can't modify discriminator key "`+E+'" on discriminator model');h=pm(M,i,E,h);continue}else if(v){delete e[l];continue}}if(vBt(p)==="Object"){if(d=t._getSchema(s+l),d==null){let M=yY(t,e,a,s+l,r);M.schematype!=null&&(d=M.schematype)}if(n!=="$setOnInsert"&&_Te(d,o,e,l,s+l,r,i))continue;if(d&&(d.embeddedSchemaType||d.Constructor)&&n in vY)if("$each"in p){c=!0;try{e[l]={$each:Yy(d,p.$each,n,l,i,s+l)}}catch(M){h=pm(M,i,l,h)}p.$slice!=null&&(e[l].$slice=p.$slice|0),p.$sort&&(e[l].$sort=p.$sort),p.$position!=null&&(e[l].$position=bY(p.$position))}else{if(d!=null&&d.$isSingleNested){let M=o??d.schema.options.strict;try{e[l]=d.castForQuery(null,p,i,{strict:M})}catch(D){h=pm(D,i,l,h)}}else try{e[l]=Yy(d,p,n,l,i,s+l)}catch(M){h=pm(M,i,l,h)}if(e[l]===void 0){delete e[l];continue}c=!0}else if(n==="$currentDate"||n in vY&&d){try{e[l]=Yy(d,p,n,l,i,s+l)}catch(M){h=pm(M,i,l,h)}if(e[l]===void 0){delete e[l];continue}c=!0}else if(n==="$rename"){let M=new gTe(`${s}${l}.$rename`);try{e[l]=Yy(M,p,n,l,i,s+l)}catch(D){h=pm(D,i,l,h)}if(e[l]===void 0){delete e[l];continue}c=!0}else{let M=s+l,D=t._getPathType(M),$=o;if(D&&D.schema&&$==null&&($=D.schema.options.strict),D.pathType==="undefined"){if($==="throw")throw new vTe(M);if($){delete e[l];continue}}c|=STe(t,p,n,r,i,a,s+l)||Xy.isObject(p)&&Object.keys(p).length===0}}else{let M=l==="$each"||l==="$or"||l==="$and"||l==="$in";if(M&&!s)throw new Zy('Invalid update: Unexpected modifier "'+l+'" as a key in operator. Did you mean something like { $addToSet: { fieldName: { $each: [...] } } }? Modifiers such as "$each", "$or", "$and", "$in" must appear under a valid field path.');let D=M?s:s+l;if(d=t._getSchema(D),n!=="$setOnInsert"&&_Te(d,o,e,l,s+l,r,i))continue;let $=t._getPathType(D);if(d==null){let j=yY(t,e,a,D,r);j.schematype!=null&&(d=j.schematype,$=j.type)}let N=o;if($&&$.schema&&o==null&&(N=$.schema.options.strict),N&&!d&&!/real|nested/.test($.pathType)){if(N==="throw"&&t.virtuals[D]==null)throw new vTe(s+l);delete e[l]}else{if(n==="$rename"){if(e[l]==null)throw new $O("String",e[l],`${s}${l}.$rename`);let j=new gTe(`${s}${l}.$rename`,null,null,t);e[l]=j.castForQuery(null,e[l],i);continue}try{s.length===0||l.indexOf(".")===-1?e[l]=Yy(d,p,n,l,i,s+l):(N!==!1||d!=null)&&(ABt(e,l,Yy(d,p,n,l,i,s+l)),delete e[l])}catch(j){h=pm(j,i,l,h)}if(Array.isArray(e[l])&&(n==="$addToSet"||n==="$push")&&l!=="$each"&&d&&d.embeddedSchemaType&&!d.embeddedSchemaType.$isMongooseArray&&!d.embeddedSchemaType[ETe]&&(e[l]={$each:e[l]}),e[l]===void 0){delete e[l];continue}c=!0}}}if(h!=null)throw h;return c}function pm(t,e,n,r){if(typeof e!="object"||!e.options.multipleCastError)throw t;return r=r||new bBt,r.addError(n,t),r}var ATe={$pop:1,$inc:1},SBt={$unset:1},vY={$push:1,$addToSet:1,$set:1,$setOnInsert:1};var wTe={$set:1,$setOnInsert:1};function Yy(t,e,n,r,i,a){if(!t){if(n in ATe)try{return bY(e)}catch{throw new $O("number",e,a)}return e}if(t.$isMongooseArray&&n in vY&&(Xy.isObject(e)||Array.isArray(e))&&!wTe[n]){let o=0,f=t;for(;f.$isMongooseArray;)++o,f=f.embeddedSchemaType;let u=0,c=e;for(;Array.isArray(c);)++u,c=c[0];let d=o-u;for(;u<o;)e=[e],++u;let l=t.applySetters(Array.isArray(e)?e:[e],i);for(let p=0;p<d;++p)l=l[0];return l}if(n in SBt)return e;if(n in ATe){if(e==null)throw new $O("number",e,t.path);if(n==="$inc")return t.castForQuery(null,e,i);try{return bY(e)}catch{throw new $O("number",e,t.path)}}if(n==="$currentDate")return typeof e=="object"?{$type:e.$type}:!!e;if(gY.has(r))return t.castForQuery(r,e,i);if(wTe[n]){let o=e!=null&&t.$isMongooseArray&&t.$fullPath!=null&&!t.$fullPath.match(/\d+$/),f=t[ETe]!=null;return o||f?t.applySetters(e,i):t.castForQuery(null,e,i)}return t.castForQuery(null,e,i)}});var AY=y((mun,TTe)=>{"use strict";TTe.exports=function(e,n,r){!r||!(n&&n.upsert)||(n.overwrite?T7(e,r)||(e[r]=0):!T7(e,r)&&!T7(e?.$set,r)&&!T7(e?.$inc,r)&&!T7(e?.$setOnInsert,r)&&(e.$setOnInsert||(e.$setOnInsert={}),e.$setOnInsert[r]=0))};function T7(t,e){return t==null||typeof t!="object"?!1:Object.prototype.hasOwnProperty.call(t,e)}});var wY=y((yun,OTe)=>{"use strict";var xBt=di();OTe.exports=function(t,e,n,r){r=r||{};let i=r.setDefaultsOnInsert!=null?r.setDefaultsOnInsert:e.base.options.setDefaultsOnInsert;if(!r.upsert||i===!1)return n;let a=Object.keys(n||{}),s={},o={},f=a.length,u=!1;for(let l=0;l<f;++l)if(a[l].charAt(0)==="$"){u=!0;break}let c=Object.keys(t),d=c.length;for(let l=0;l<d;++l){let p=c[l],h=t[p];if(h&&typeof h=="object"){let v=Object.keys(h),E=v.length,M=!1;for(let D=0;D<E;++D)if(v[D].charAt(0)==="$"){M=!0;break}if(M)continue}s[p]=!0}return r&&r.overwrite&&!u||e.eachPath(function(l,p){if(p.path==="_id"&&p.options.auto)return;let h=p.getDefault(null,!0);if(typeof h>"u")return;let v=p.splitPath();v.includes("$*")||TBt(n,s,l,v,u)||(n=n||{},n.$setOnInsert=n.$setOnInsert||{},xBt(n,l)==null&&(n.$setOnInsert[l]=h),o[l]=h)}),n};function TBt(t,e,n,r,i){if(e[n])return!0;let a=r[0];for(let s=1;s<r.length;++s){if(e[a])return!0;a+="."+r[s]}if(i){for(let s in t)if(s.charAt(0)==="$"&&CTe(t[s],n,r))return!0}else if(CTe(t,n,r))return!0;return!1}function CTe(t,e,n){if(t==null||typeof t!="object")return!1;if(t.hasOwnProperty(e))return!0;let r=n[0];for(let a=1;a<n.length;++a){if(t.hasOwnProperty(r))return!0;r+="."+n[a]}let i=e+".";for(let a in t)if(a.startsWith(i))return!0;return!1}});var EY=y((bun,Mi)=>{"use strict";var CBt=on(),OBt=W0(),ITe=rK(),MTe=iK(),C7=om(),PTe=_Y(),IBt=Qr(),RTe=AY(),{inspect:MBt}=Q("util"),kTe=wY();Mi.exports=function(e,n,r){let i=e.base.now();return n.insertOne?a=>Mi.exports.castInsertOne(e,n.insertOne,r).then(()=>a(null),s=>a(s)):n.updateOne?a=>{try{Mi.exports.castUpdateOne(e,n.updateOne,r,i),a(null)}catch(s){a(s)}}:n.updateMany?a=>{try{Mi.exports.castUpdateMany(e,n.updateMany,r,i),a(null)}catch(s){a(s)}}:n.replaceOne?a=>{Mi.exports.castReplaceOne(e,n.replaceOne,r).then(()=>a(null),s=>a(s))}:n.deleteOne?a=>{try{Mi.exports.castDeleteOne(e,n.deleteOne),a(null)}catch(s){a(s)}}:n.deleteMany?a=>{try{Mi.exports.castDeleteMany(e,n.deleteMany),a(null)}catch(s){a(s)}}:a=>{let s=new CBt(`Invalid op passed to \`bulkWrite()\`: ${MBt(n)}`);a(s,null)}};Mi.exports.castInsertOne=async function(e,n,r){let i=Jy(e,n.document),a=new i(n.document);i.schema.options.timestamps&&BO(n,r)&&a.initializeTimestamps(),r.session!=null&&a.$session(r.session);let s=i?.schema?.options?.versionKey;return s&&a[s]==null&&(a[s]=0),n.document=a,r.skipValidation||n.skipValidation||await n.document.$validate(),n};Mi.exports.castUpdateOne=function(e,n,r,i){if(!n.filter)throw new Error("Must provide a filter object.");if(!n.update)throw new Error("Must provide an update object.");let a=Jy(e,n.filter),s=a.schema,o=r.strict!=null?r.strict:a.schema.options.strict,f=IBt(n.update);O7(s,n.filter);let u=BO(n,r);if(a.schema.$timestamps!=null&&u){let l=a.schema.$timestamps.createdAt,p=a.schema.$timestamps.updatedAt;MTe(i,l,p,f,{})}u&&ITe(i,f,a.schema);let c=e.base.options.setDefaultsOnInsert;return(n.setDefaultsOnInsert==null?c:n.setDefaultsOnInsert)!==!1&&kTe(n.filter,a.schema,f,{setDefaultsOnInsert:!0,upsert:n.upsert}),RTe(f,n,a.schema.options.versionKey),n.filter=C7(a.schema,n.filter,{strict:o,upsert:n.upsert}),n.update=PTe(a.schema,f,{strict:o,upsert:n.upsert,arrayFilters:n.arrayFilters,overwriteDiscriminatorKey:n.overwriteDiscriminatorKey},a,n.filter),n};Mi.exports.castUpdateMany=function(e,n,r,i){if(!n.filter)throw new Error("Must provide a filter object.");if(!n.update)throw new Error("Must provide an update object.");let a=Jy(e,n.filter),s=a.schema,o=r.strict!=null?r.strict:a.schema.options.strict,f=e.base.options.setDefaultsOnInsert;(n.setDefaultsOnInsert==null?f:n.setDefaultsOnInsert)!==!1&&kTe(n.filter,a.schema,n.update,{setDefaultsOnInsert:!0,upsert:n.upsert});let c=BO(n,r);if(a.schema.$timestamps!=null&&c){let d=a.schema.$timestamps.createdAt,l=a.schema.$timestamps.updatedAt;MTe(i,d,l,n.update,{})}c&&ITe(i,n.update,a.schema),O7(s,n.filter),RTe(n.update,n,a.schema.options.versionKey),n.filter=C7(a.schema,n.filter,{strict:o,upsert:n.upsert}),n.update=PTe(a.schema,n.update,{strict:o,upsert:n.upsert,arrayFilters:n.arrayFilters,overwriteDiscriminatorKey:n.overwriteDiscriminatorKey},a,n.filter)};Mi.exports.castReplaceOne=async function(e,n,r){let i=Jy(e,n.filter),a=i.schema,s=r.strict!=null?r.strict:i.schema.options.strict;O7(a,n.filter),n.filter=C7(i.schema,n.filter,{strict:s,upsert:n.upsert});let o=new i(n.replacement,s,{skipId:!0});i.schema.options.timestamps&&BO(n,r)&&o.initializeTimestamps(),r.session!=null&&o.$session(r.session);let f=i?.schema?.options?.versionKey;if(f&&o[f]==null&&(o[f]=0),n.replacement=o,r.skipValidation||n.skipValidation){n.replacement=n.replacement.toBSON();return}await n.replacement.$validate(),n.replacement=n.replacement.toBSON()};Mi.exports.castDeleteOne=function(e,n){let r=Jy(e,n.filter),i=r.schema;O7(i,n.filter),n.filter=C7(r.schema,n.filter)};Mi.exports.castDeleteMany=function(e,n){let r=Jy(e,n.filter),i=r.schema;O7(i,n.filter),n.filter=C7(r.schema,n.filter)};Mi.exports.cast={insertOne:Mi.exports.castInsertOne,updateOne:Mi.exports.castUpdateOne,updateMany:Mi.exports.castUpdateMany,replaceOne:Mi.exports.castReplaceOne,deleteOne:Mi.exports.castDeleteOne,deleteMany:Mi.exports.castDeleteMany};function O7(t,e){t!=null&&t.discriminatorMapping&&!t.discriminatorMapping.isRoot&&(e[t.discriminatorMapping.key]=t.discriminatorMapping.value)}function Jy(t,e){let n=t.schema.options.discriminatorKey;return e!=null&&e.hasOwnProperty(n)&&(t=OBt(t.discriminators,e[n])||t),t}function BO(t,e){let n=t.timestamps,r=e.timestamps;return n??r??!0}});var SY=y((gun,DTe)=>{"use strict";DTe.exports=function(e,n,r){return e.mongoose=e.mongoose||{},e.mongoose.validationErrors=n,e.mongoose.results=r,e}});var OY=y((vun,FTe)=>{"use strict";var PBt=YW(),TY=Q("events").EventEmitter,RBt=im(),Pi=z4(),NTe=fY(),mi=i0(),kBt=aG(),DBt=Qxe(),NBt=uY(),$Bt=Qr(),BBt=DO(),FBt=di(),LBt=lY(),$Te=xp(),CY=Vt(),qBt=iTe(),FO=EY(),{modelSymbol:LO}=ct(),UBt=EG(),xY=SY(),jBt=ct().arrayAtomicsSymbol,I7=ct().sessionNewDocuments,VBt=globalThis.Date,zBt=["MONGODB-X509"];function At(t){this.base=t,this.collections={},this.models={},this.config={},this.replica=!1,this.options=null,this.otherDbs=[],this.relatedDbs={},this.states=Pi,this._readyState=Pi.disconnected,this._closeCalled=!1,this._hasOpened=!1,this.plugins=[],typeof t>"u"||!t.connections.length?this.id=0:this.id=t.nextConnectionId,this._queue=[]}Object.setPrototypeOf(At.prototype,TY.prototype);Object.defineProperty(At.prototype,"readyState",{get:function(){return this._readyState===Pi.connected&&this._lastHeartbeatAt!=null&&this.client?.topology?.s?.description?.type!=="LoadBalanced"&&typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS=="number"&&VBt.now()-this._lastHeartbeatAt>=this.client.topology.s.description.heartbeatFrequencyMS*2?Pi.disconnected:this._readyState},set:function(t){if(!(t in Pi))throw new Error("Invalid connection state: "+t);if(this._readyState!==t){this._readyState=t;for(let e of this.otherDbs)e.readyState=t;Pi.connected===t&&(this._hasOpened=!0),this.emit(Pi[t])}}});At.prototype.get=function(e){return this.config.hasOwnProperty(e)?this.config[e]:FBt(this.options,e)};At.prototype.set=function(e,n){return this.config.hasOwnProperty(e)?(this.config[e]=n,n):(this.options=this.options||{},this.options[e]=n,n)};At.prototype.collections;At.prototype.name;At.prototype.models;At.prototype.id;Object.defineProperty(At.prototype,"plugins",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(At.prototype,"host",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(At.prototype,"port",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(At.prototype,"user",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(At.prototype,"pass",{configurable:!0,enumerable:!0,writable:!0});At.prototype.db;At.prototype.client;At.prototype.config;At.prototype.createCollection=async function(e,n){if(typeof n=="function"||arguments.length>=3&&typeof arguments[2]=="function")throw new mi("Connection.prototype.createCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.createCollection(e,n)};At.prototype.bulkWrite=async function(e,n){await this._waitForConnect(),n=n||{};let r=n.ordered==null?!0:n.ordered,i=this.base.transactionAsyncLocalStorage?.getStore();(!n||!n.hasOwnProperty("session"))&&i?.session!=null&&(n={...n,session:i.session});let a=this.base.now(),s=null;if(r){let o=[];for(let f of e){if(typeof f.model!="string"&&!f.model?.[LO])throw new mi("Must specify model in Connection.prototype.bulkWrite() operations");let u=f.model[LO]?f.model:this.model(f.model);if(f.name==null)throw new mi("Must specify operation name in Connection.prototype.bulkWrite()");if(!FO.cast.hasOwnProperty(f.name))throw new mi(`Unrecognized bulkWrite() operation name ${f.name}`);await FO.cast[f.name](u,f,n,a),o.push({...f,namespace:u.namespace()})}s=await this.client.bulkWrite(o,n)}else{let o=[],f=[],u=[],c=[],d=[];for(let p=0;p<e.length;++p){let h=e[p];if(typeof h.model!="string"&&!h.model?.[LO]){let M=new mi("Must specify model in Connection.prototype.bulkWrite() operations");u.push({index:p,error:M}),d[p]=M;continue}let v;try{v=h.model[LO]?h.model:this.model(h.model)}catch(M){u.push({index:p,error:M});continue}if(h.name==null){let M=new mi("Must specify operation name in Connection.prototype.bulkWrite()");u.push({index:p,error:M}),d[p]=M;continue}if(!FO.cast.hasOwnProperty(h.name)){let M=new mi(`Unrecognized bulkWrite() operation name ${h.name}`);u.push({index:p,error:M}),d[p]=M;continue}let E=null;try{E=FO.cast[h.name](v,h,n,a)}catch(M){u.push({index:p,error:M}),d[p]=M;continue}UBt(E)?c.push(E.then(()=>{o.push({...h,namespace:v.namespace()}),f.push(p)},M=>{u.push({index:p,error:M}),d[p]=M})):(o.push({...h,namespace:v.namespace()}),f.push(p))}if(c.length>0&&await Promise.all(c),u=u.sort((p,h)=>p.index-h.index).map(p=>p.error),o.length===0){if(n.throwOnValidationError&&u.length)throw new NTe(u,d,h,"bulkWrite");let p=this.base.driver.get().BulkWriteResult,h=new p(LBt(),!1);return xY(h,u,d)}let l;[s,l]=await this.client.bulkWrite(o,n).then(p=>[p,null]).catch(p=>[null,p]);for(let p=0;p<f.length;++p)d[f[p]]=null;if(l&&u.length>0&&(xY(l,u,d),l.mongoose=l.mongoose||{},l.mongoose.validationErrors=u),u.length>0){if(n.throwOnValidationError)throw new NTe(u,d,s,"bulkWrite");xY(s,u,d)}}return s};At.prototype.createCollections=async function(e={}){let n={},r={},{continueOnError:i}=e;delete e.continueOnError;for(let a of Object.values(this.models))try{n[a.modelName]=await a.createCollection({})}catch(s){if(i)n[a.modelName]=s;else{r[a.modelName]=s;break}}if(!i&&Object.keys(r).length){let a=Object.entries(r).map(([o,f])=>`${o}: ${f.message}`).join(", ");throw new qBt(a,r)}return n};At.prototype.withSession=async function(e){if(arguments.length===0)throw new Error("Please provide an executor function");return await this.client.withSession(e)};At.prototype.startSession=async function(e){if(arguments.length>=2&&typeof arguments[1]=="function")throw new mi("Connection.prototype.startSession() no longer accepts a callback");return await this._waitForConnect(),this.client.startSession(e)};At.prototype.transaction=function(e,n){return this.startSession().then(r=>(r[I7]=new Map,r.withTransaction(()=>HBt(e,r,this.base),n).then(i=>(delete r[I7],i)).catch(i=>{throw delete r[I7],i}).finally(()=>{r.endSession().catch(()=>{})})))};async function HBt(t,e,n){try{return n.transactionAsyncLocalStorage==null?await t(e):await new Promise(i=>{n.transactionAsyncLocalStorage.run({session:e},()=>i(t(e)))})}catch(r){throw WBt(e),r}}function WBt(t){for(let e of t[I7].keys()){let n=t[I7].get(e);n.hasOwnProperty("isNew")&&(e.$isNew=n.isNew),n.hasOwnProperty("versionKey")&&e.set(e.schema.options.versionKey,n.versionKey),n.modifiedPaths.length>0&&e.$__.activePaths.states.modify==null&&(e.$__.activePaths.states.modify={});for(let r of n.modifiedPaths){let i=e.$__.activePaths.paths[r];i!=null&&delete e.$__.activePaths[i][r],e.$__.activePaths.paths[r]="modify",e.$__.activePaths.states.modify[r]=!0}for(let r of n.atomics.keys()){let i=e.$__getValue(r);i!=null&&(i[jBt]=n.atomics.get(r))}}}At.prototype.dropCollection=async function(e){if(arguments.length>=2&&typeof arguments[1]=="function")throw new mi("Connection.prototype.dropCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.dropCollection(e)};At.prototype._waitForConnect=async function(e){if((this.readyState===Pi.connecting||this.readyState===Pi.disconnected)&&this._shouldBufferCommands()){let n=this._getBufferTimeoutMS(),r=null,i=!1,a={},s=new Promise(o=>{a.fn=o,this._queue.push(a)});if(e?await s:await Promise.race([s,new Promise(o=>{r=setTimeout(()=>{i=!0,o()},n)})]),i){let o=this._queue.indexOf(a);o!==-1&&this._queue.splice(o,1);let f="Connection operation buffering timed out after "+n+"ms";throw new mi(f)}else r!=null&&clearTimeout(r)}};At.prototype._getBufferTimeoutMS=function(){return this.config.bufferTimeoutMS!=null?this.config.bufferTimeoutMS:this.base!=null&&this.base.get("bufferTimeoutMS")!=null?this.base.get("bufferTimeoutMS"):1e4};At.prototype.listCollections=async function(){return await this._waitForConnect(),await this.db.listCollections().toArray()};At.prototype.listDatabases=async function(){throw new mi("listDatabases() not implemented by driver")};At.prototype.dropDatabase=async function(){if(arguments.length>=1&&typeof arguments[0]=="function")throw new mi("Connection.prototype.dropDatabase() no longer accepts a callback");await this._waitForConnect();for(let e of Object.values(this.models))delete e.$init;return this.db.dropDatabase()};At.prototype._shouldBufferCommands=function(){return this.config.bufferCommands!=null?this.config.bufferCommands:this.base.get("bufferCommands")!=null?this.base.get("bufferCommands"):!0};At.prototype.error=function(e,n){return n?(n(e),null):(this.listeners("error").length>0&&this.emit("error",e),Promise.reject(e))};At.prototype.onOpen=function(){this.readyState=Pi.connected;for(let t of this._queue)t.fn.apply(t.ctx,t.args);this._queue=[];for(let t in this.collections)CY.object.hasOwnProperty(this.collections,t)&&this.collections[t].onOpen();this.emit("open")};At.prototype.openUri=async function(e,n){if((this.readyState===Pi.connecting||this.readyState===Pi.connected)&&this._connectionString===e)return this;this._closeCalled=!1;let r=!1;n&&"_fireAndForget"in n&&(r=n._fireAndForget,delete n._fireAndForget);try{GBt.apply(arguments)}catch(i){throw r||(this.$initialConnection=Promise.reject(i)),i}this.$initialConnection=this.createClient(e,n).then(()=>this).catch(i=>{throw this.readyState=Pi.disconnected,this.listeners("error").length>0&&$Te(()=>this.emit("error",i)),i});for(let i of Object.values(this.models))i.init().catch(function(){});if(r)return this;try{await this.$initialConnection}catch(i){throw BTe(i)}return this};At.prototype.on=function(e,n){return e==="error"&&this.$initialConnection&&this.$initialConnection.catch(()=>{}),TY.prototype.on.call(this,e,n)};At.prototype.once=function(e,n){return e==="error"&&this.$initialConnection&&this.$initialConnection.catch(()=>{}),TY.prototype.once.call(this,e,n)};function GBt(t,e,n){if(typeof e=="function"&&n==null)throw new mi("Connection.prototype.openUri() no longer accepts a callback");if(typeof n=="function")throw new mi("Connection.prototype.openUri() no longer accepts a callback")}function BTe(t){if(t?.name==="MongoServerSelectionError"){let e=t;t=new kBt,t.assimilateError(e)}return t}At.prototype.destroy=async function(e){if(typeof e=="function"||arguments.length===2&&typeof arguments[1]=="function")throw new mi("Connection.prototype.destroy() no longer accepts a callback");return e!=null&&typeof e=="object"?this.$wasForceClosed=!!e.force:this.$wasForceClosed=!!e,this._close(e,!0)};At.prototype.close=async function(e){if(typeof e=="function"||arguments.length===2&&typeof arguments[1]=="function")throw new mi("Connection.prototype.close() no longer accepts a callback");e!=null&&typeof e=="object"?this.$wasForceClosed=!!e.force:this.$wasForceClosed=!!e,this._lastHeartbeatAt!=null&&(this._lastHeartbeatAt=null);for(let n of Object.values(this.models))delete n.$init;return this._close(e,!1)};At.prototype._close=async function(e,n){let r=this,i=this._closeCalled;this._closeCalled=!0,this._destroyCalled=n,this.client!=null&&(this.client._closeCalled=!0,this.client._destroyCalled=n);let a=this;switch(this.readyState){case Pi.disconnected:n&&this.base.connections.indexOf(a)!==-1&&this.base.connections.splice(this.base.connections.indexOf(a),1),i||(await this.doClose(e),this.onClose(e));break;case Pi.connected:this.readyState=Pi.disconnecting,await this.doClose(e),n&&r.base.connections.indexOf(a)!==-1&&this.base.connections.splice(this.base.connections.indexOf(a),1),this.onClose(e);break;case Pi.connecting:return new Promise((s,o)=>{let f=()=>{this.removeListener("open",f),this.removeListener("error",f),n?this.destroy(e).then(s,o):this.close(e).then(s,o)};this.once("open",f),this.once("error",f)});case Pi.disconnecting:return new Promise(s=>{this.once("close",()=>{n&&this.base.connections.indexOf(a)!==-1&&this.base.connections.splice(this.base.connections.indexOf(a),1),s()})})}return this};At.prototype.doClose=function(){throw new Error("Connection#doClose unimplemented by driver")};At.prototype.onClose=function(e){this.readyState=Pi.disconnected;for(let r in this.collections)CY.object.hasOwnProperty(this.collections,r)&&this.collections[r].onClose(e);this.emit("close",e);let n=typeof e=="object"&&e!==null?e.force:e;for(let r of this.otherDbs)this._destroyCalled?r.destroy({force:n,skipCloseClient:!0}):r.close({force:n,skipCloseClient:!0})};At.prototype.collection=function(t,e){let n={autoIndex:this.config.autoIndex!=null?this.config.autoIndex:this.base.options.autoIndex,autoCreate:this.config.autoCreate!=null?this.config.autoCreate:this.base.options.autoCreate,autoSearchIndex:this.config.autoSearchIndex!=null?this.config.autoSearchIndex:this.base.options.autoSearchIndex};e=Object.assign({},n,e?$Bt(e):{}),e.$wasForceClosed=this.$wasForceClosed;let r=this.base&&this.base.__driver&&this.base.__driver.Collection||BBt.get().Collection;return t in this.collections||(this.collections[t]=new r(t,this,e)),this.collections[t]};At.prototype.plugin=function(t,e){return this.plugins.push([t,e]),this};At.prototype.model=function(e,n,r,i){if(!(this instanceof At))throw new mi("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead");let a;if(typeof e=="function"&&(a=e,e=a.name),typeof n=="string"&&(r=n,n=!1),CY.isObject(n)&&(n.instanceOfSchema?n instanceof this.base.Schema||(n=n._clone(this.base.Schema)):n=new RBt(n)),n&&!n.instanceOfSchema)throw new Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");let s={cache:!1,overwriteModels:this.base.options.overwriteModels},o=Object.assign(s,i,{connection:this});if(this.models[e]&&!r&&o.overwriteModels!==!0){if(n&&n.instanceOfSchema&&n!==this.models[e].schema)throw new mi.OverwriteModelError(e);return this.models[e]}let f;if(n&&n.instanceOfSchema)return NBt(n,this.plugins,null,"$connectionPluginsApplied"),f=this.base._model(a||e,n,r,o),this.models[e]||(this.models[e]=f),f.init().catch(function(){}),f;if(this.models[e]&&r)return f=this.models[e],n=f.prototype.schema,f.__subclass(this,n,r);if(arguments.length===1){if(f=this.models[e],!f)throw new mi.MissingSchemaError(e);return f}if(!f)throw new mi.MissingSchemaError(e);return this===f.prototype.db&&(!r||r===f.collection.name)?(this.models[e]||(this.models[e]=f),f):(this.models[e]=f.__subclass(this,n,r),this.models[e])};At.prototype.deleteModel=function(e){if(typeof e=="string"){let n=this.model(e);if(n==null)return this;let r=n.collection.name;delete this.models[e],delete this.collections[r],this.emit("deleteModel",n)}else if(e instanceof RegExp){let n=e,r=this.modelNames();for(let i of r)n.test(i)&&this.deleteModel(i)}else throw new Error('First parameter to `deleteModel()` must be a string or regexp, got "'+e+'"');return this};At.prototype.watch=function(e,n){let r=a=>{$Te(()=>{if(this.readyState===Pi.connecting)this.once("open",function(){let s=this.db.watch(e,n);a(null,s)});else{let s=this.db.watch(e,n);a(null,s)}})};return new PBt(r,e,n)};At.prototype.asPromise=async function(){try{return await this.$initialConnection,this}catch(e){throw BTe(e)}};At.prototype.modelNames=function(){return Object.keys(this.models)};At.prototype.shouldAuthenticate=function(){return this.user!=null&&(this.pass!=null||this.authMechanismDoesNotRequirePassword())};At.prototype.authMechanismDoesNotRequirePassword=function(){return this.options&&this.options.auth?zBt.indexOf(this.options.auth.authMechanism)>=0:!0};At.prototype.optionsProvideAuthenticationData=function(e){return e&&e.user&&(e.pass||this.authMechanismDoesNotRequirePassword())};At.prototype.getClient=function(){return this.client};At.prototype.setClient=function(){throw new mi("Connection#setClient not implemented by driver")};At.prototype.createClient=function(){throw new mi("Connection#createClient not implemented by driver")};At.prototype.syncIndexes=async function(e={}){let n={},r={},{continueOnError:i}=e;delete e.continueOnError;for(let a of Object.values(this.models))try{n[a.modelName]=await a.syncIndexes(e)}catch(s){if(i)n[a.modelName]=s;else{r[a.modelName]=s;break}}if(!i&&Object.keys(r).length){let a=Object.entries(r).map(([o,f])=>`${o}: ${f.message}`).join(", ");throw new DBt(a,r)}return n};At.STATES=Pi;FTe.exports=At});var IY=y((_un,KBt)=>{KBt.exports={name:"mongoose",description:"Mongoose MongoDB ODM",version:"9.0.0",author:"Guillermo Rauch <guillermo@learnboost.com>",keywords:["mongodb","document","model","schema","database","odm","data","datastore","query","nosql","orm","db"],type:"commonjs",license:"MIT",dependencies:{kareem:"3.0.0",mongodb:"~7.0",mpath:"0.9.0",mquery:"6.0.0",ms:"2.1.3",sift:"17.1.3"},devDependencies:{"@ark/attest":"0.53.0","@mongodb-js/mongodb-downloader":"^1.0.0",acquit:"1.4.0","acquit-ignore":"0.2.1","acquit-require":"0.1.1",ajv:"8.17.1","broken-link-checker":"^0.7.8",cheerio:"1.1.2",dox:"1.0.0",eslint:"9.25.1","eslint-plugin-markdown":"^5.1.0","eslint-plugin-mocha-no-only":"1.2.0",express:"^4.19.2","fs-extra":"~11.3.0","highlight.js":"11.11.1","lodash.isequal":"4.5.0","lodash.isequalwith":"4.4.0","markdownlint-cli2":"^0.18.1",marked:"15.x",mkdirp:"^3.0.1",mocha:"11.7.4",moment:"2.30.1","mongodb-memory-server":"10.3.0","mongodb-runner":"^6.0.0","mongodb-client-encryption":"~7.0",ncp:"^2.0.0",nyc:"15.1.0",pug:"3.0.3",sinon:"21.0.0",tsd:"0.33.0",typescript:"5.9.3","typescript-eslint":"^8.31.1",uuid:"11.1.0"},directories:{lib:"./lib/mongoose"},scripts:{"docs:clean":"npm run docs:clean:stable","docs:clean:stable":"rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:clean:5x":"rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:clean:6x":"rimraf index.html && rimraf -rf ./docs/6.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp","docs:copy:tmp":"mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/","docs:copy:tmp:5x":"rimraf ./docs/5.x && ncp ./tmp ./docs/5.x","docs:copy:tmp:6x":"rimraf ./docs/6.x && ncp ./tmp ./docs/6.x","docs:generate":"node ./scripts/website.js","docs:generate:sponsorData":"node ./scripts/loadSponsorData.js","docs:test":"npm run docs:generate","docs:view":"node ./scripts/static.js","docs:prepare:publish:stable":"git checkout gh-pages && git merge master && npm run docs:generate","docs:prepare:publish:5x":"git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x","docs:prepare:publish:6x":"git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x","docs:prepare:publish:7x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/7.x && mv ./tmp ./docs/7.x","docs:prepare:publish:8x":"git checkout gh-pages && git merge 8.x && npm run docs:generate","docs:check-links":"blc http://127.0.0.1:8089 -ro",lint:"eslint .","lint-js":"eslint . --ext .js --ext .cjs","lint-ts":"eslint . --ext .ts","lint-md":'markdownlint-cli2 "**/*.md" "#node_modules" "#benchmarks"',release:"git pull && git push origin master --tags && npm publish","release-5x":"git pull origin 5.x && git push origin 5.x && git push origin 5.x --tags && npm publish --tag 5x","release-6x":"git pull origin 6.x && git push origin 6.x && git push origin 6.x --tags && npm publish --tag 6x",mongo:"node ./tools/repl.js","publish-7x":"npm publish --tag 7x","create-separate-require-instance":"rm -rf ./node_modules/mongoose-separate-require-instance && node ./scripts/create-tarball && tar -xzf mongoose.tgz -C ./node_modules && mv ./node_modules/package ./node_modules/mongoose-separate-require-instance",test:"mocha --exit ./test/*.test.js","test-deno":"deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs","test-rs":"START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js","test-tsd":"node ./test/types/check-types-filename && tsd --full","setup-test-encryption":"node scripts/setup-encryption-tests.js","test-encryption":"mocha --exit ./test/encryption/*.test.js",tdd:"mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}","test-coverage":"nyc --reporter=html --reporter=text npm test","ts-benchmark":"cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check","attest-benchmark":"node ./benchmarks/typescript/infer.bench.mts"},main:"./index.js",types:"./types/index.d.ts",engines:{node:">=20.19.0"},bugs:{url:"https://github.com/Automattic/mongoose/issues/new"},repository:{type:"git",url:"git://github.com/Automattic/mongoose.git"},homepage:"https://mongoosejs.com",config:{mongodbMemoryServer:{disablePostinstall:!0}},funding:{type:"opencollective",url:"https://opencollective.com/mongoose"},tsd:{directory:"test/types",compilerOptions:{esModuleInterop:!1,strict:!0,allowSyntheticDefaultImports:!0,strictPropertyInitialization:!1,noImplicitAny:!1,strictNullChecks:!0,module:"commonjs",target:"ES2022"}}}});var qTe=y((Aun,LTe)=>{"use strict";var YBt=Qr(),ZBt=i0();function XBt(t,e){let n=e||{},r=n.readPreference?n.readPreference:tFt(t),i=YBt(n);return r&&r!=="primary"&&r!=="primaryPreferred"?JBt(r,i):i}function JBt(t,e){if(QBt(e)&&eFt(t))rFt();else return nFt(e)}function QBt(t){let e=t.config&&t.config.autoIndex,{autoCreate:n,autoIndex:r}=t;return!!(e||n||r)}function eFt(t){return t==="secondary"||t==="secondaryPreferred"}function tFt(t){let n=/(?:&|\?)readPreference=(\w+)(?:&|$)/.exec(t);return n?n[1]:null}function nFt(t){return t.config={autoIndex:!1},t.autoCreate=!1,t.autoIndex=!1,t}function rFt(){throw new ZBt('MongoDB prohibits index creation on connections that read from non-primary replicas. Connections that set "readPreference" to "secondary" or "secondaryPreferred" may not opt-in to the following connection options: autoCreate, autoIndex')}LTe.exports=XBt});var jTe=y(UTe=>{"use strict";UTe.setTimeout=setTimeout});var GTe=y((Eun,WTe)=>{"use strict";var VTe=OY(),hm=i0(),Ao=z4(),zTe=Pp(),iFt=IY(),aFt=qTe(),sFt=jTe().setTimeout,HTe=Vt(),oFt=im();function dc(){VTe.apply(this,arguments),this._listening=!1,this._lastHeartbeatAt=null}dc.STATES=Ao;Object.setPrototypeOf(dc.prototype,VTe.prototype);dc.prototype.useDb=function(t,e){if(e=e||{},e.useCache&&this.relatedDbs[t])return this.relatedDbs[t];let n=new this.constructor;n.name=t,n.base=this.base,n.collections={},n.models={},n.replica=this.replica,n.config=Object.assign({},this.config,n.config),n.name=this.name,n.options=this.options,n._readyState=this._readyState,n._closeCalled=this._closeCalled,n._hasOpened=this._hasOpened,n._listening=!1,n._parent=this,n.host=this.host,n.port=this.port,n.user=this.user,n.pass=this.pass;let r=this;n.client=r.client,this.db&&this._readyState===Ao.connected?i():this._queue.push({fn:i});function i(){n.client=r.client,n.db=r.client.db(t),n._lastHeartbeatAt=r._lastHeartbeatAt,n.onOpen()}return n.name=t,this.otherDbs.push(n),n.otherDbs.push(this),e&&e.useCache&&(this.relatedDbs[n.name]=n,n.relatedDbs=this.relatedDbs),n};dc.prototype.aggregate=function(e,n){return new this.base.Aggregate(null,this).append(e).option(n??{})};dc.prototype.removeDb=function(e){let n=this.otherDbs.filter(r=>r.name===e);if(!n.length)throw new hm(`No connections to database "${e}" found`);for(let r of n)r._closeCalled=!0,r._destroyCalled=!0,r._readyState=Ao.disconnected,r.$wasForceClosed=!0;delete this.relatedDbs[e],this.otherDbs=this.otherDbs.filter(r=>r.name!==e)};dc.prototype.doClose=async function(e){if(this.client==null)return this;let n=!1;return e!=null&&typeof e=="object"&&(n=e.skipCloseClient,e=e.force),n?this:(await this.client.close(e),await new Promise(r=>sFt(r,1)),this)};dc.prototype.listDatabases=async function(){return await this._waitForConnect(),await this.db.admin().listDatabases()};dc.prototype.createClient=async function(e,n){if(typeof e!="string")throw new hm(`The \`uri\` parameter to \`openUri()\` must be a string, got "${typeof e}". Make sure the first parameter to \`mongoose.connect()\` or \`mongoose.createConnection()\` is a string.`);if(this._destroyCalled)throw new hm("Connection has been closed and destroyed, and cannot be used for re-opening the connection. Please create a new connection with `mongoose.createConnection()` or `mongoose.connect()`.");if((this.readyState===Ao.connecting||this.readyState===Ao.connected)&&this._connectionString!==e)throw new hm("Can't call `openUri()` on an active connection with different connection strings. Make sure you aren't calling `mongoose.connect()` multiple times. See: https://mongoosejs.com/docs/connections.html#multiple_connections");if(n=aFt(e,n),n){let o=n.config&&n.config.autoIndex!=null?n.config.autoIndex:n.autoIndex;o!=null&&(this.config.autoIndex=o!==!1,delete n.config,delete n.autoIndex),"autoCreate"in n&&(this.config.autoCreate=!!n.autoCreate,delete n.autoCreate),"sanitizeFilter"in n&&(this.config.sanitizeFilter=n.sanitizeFilter,delete n.sanitizeFilter),"autoSearchIndex"in n&&(this.config.autoSearchIndex=n.autoSearchIndex,delete n.autoSearchIndex),"bufferTimeoutMS"in n&&(this.config.bufferTimeoutMS=n.bufferTimeoutMS,delete n.bufferTimeoutMS),(n.user||n.pass)&&(n.auth=n.auth||{},n.auth.username=n.user,n.auth.password=n.pass,this.user=n.user,this.pass=n.pass),delete n.user,delete n.pass,n.bufferCommands!=null&&(this.config.bufferCommands=n.bufferCommands,delete n.bufferCommands)}else n={};this._connectionOptions=n;let r=n.dbName;r!=null&&(this.$dbName=r),delete n.dbName,HTe.hasUserDefinedProperty(n,"driverInfo")||(n.driverInfo={name:"Mongoose",version:iFt.version});let{schemaMap:i,encryptedFieldsMap:a}=this._buildEncryptionSchemas();if((Object.keys(i).length>0||Object.keys(a).length)&&!n.autoEncryption)throw new Error("Must provide `autoEncryption` when connecting with encrypted schemas.");Object.keys(i).length>0&&(n.autoEncryption.schemaMap=i),Object.keys(a).length>0&&(n.autoEncryption.encryptedFieldsMap=a),this.readyState=Ao.connecting,this._connectionString=e;let s;try{s=new zTe.MongoClient(e,n)}catch(o){throw this.readyState=Ao.disconnected,o}this.client=s,s.setMaxListeners(0),await s.connect(),MY(this,s,n,r);for(let o of this.otherDbs)MY(o,s,{},o.name);return this};dc.prototype._buildEncryptionSchemas=function(){let t={},e={},n=Object.values(this.models).filter(a=>a.schema._hasEncryptedFields());for(let a of n){let{schema:s,collection:{collectionName:o}}=a,f=`${this.$dbName}.${o}`,u=s.encryptionType()==="csfle"?e:t;if(u[f]??=new oFt({},{encryptionType:s.encryptionType()}),s.discriminatorMapping&&!s.discriminatorMapping.isRoot){let d=s._baseSchema;s.eachPath(l=>{if(!d.path(l)&&u[f]._hasEncryptedField(l))throw new Error(`Cannot have duplicate keys in discriminators with encryption. key=${l}`)})}u[f].add(s)}let r=Object.fromEntries(Object.entries(e).map(([a,s])=>[a,s._buildSchemaMap()])),i=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,s._buildEncryptedFields()]));return{schemaMap:r,encryptedFieldsMap:i}};dc.prototype.setClient=function(e){if(!(e instanceof zTe.MongoClient))throw new hm("Must call `setClient()` with an instance of MongoClient");if(this.readyState!==Ao.disconnected)throw new hm("Cannot call `setClient()` on a connection that is already connected.");if(e.topology==null)throw new hm("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.");this._connectionString=e.s.url,MY(this,e,{},e.s.options.dbName);for(let n of Object.values(this.models))n.init().catch(function(){});return this};function MY(t,e,n,r){let i=r!=null?e.db(r):e.db();t.db=i,t.client=e,t.host=e&&e.s&&e.s.options&&e.s.options.hosts&&e.s.options.hosts[0]&&e.s.options.hosts[0].host||void 0,t.port=e&&e.s&&e.s.options&&e.s.options.hosts&&e.s.options.hosts[0]&&e.s.options.hosts[0].port||void 0,t.name=r??i.databaseName,t._closeCalled=e._closeCalled;let a=()=>{t.readyState!==Ao.connected&&(t.readyState=Ao.connected,t.emit("reconnect"),t.emit("reconnected"),t.onOpen())},s=e&&e.topology&&e.topology.description&&e.topology.description.type||"";s==="Single"?e.on("serverDescriptionChanged",o=>{o.newDescription.type==="Unknown"?t.readyState=Ao.disconnected:a()}):s.startsWith("ReplicaSet")&&e.on("topologyDescriptionChanged",o=>{let f=o.newDescription;t.readyState===Ao.connected&&f.type!=="ReplicaSetWithPrimary"?t.readyState=Ao.disconnected:t.readyState===Ao.disconnected&&f.type==="ReplicaSetWithPrimary"&&a()}),t._lastHeartbeatAt=null,e.on("serverHeartbeatSucceeded",()=>{t._lastHeartbeatAt=Date.now();for(let o of t.otherDbs)o._lastHeartbeatAt=t._lastHeartbeatAt}),n.monitorCommands&&(e.on("commandStarted",o=>t.emit("commandStarted",o)),e.on("commandFailed",o=>t.emit("commandFailed",o)),e.on("commandSucceeded",o=>t.emit("commandSucceeded",o))),t.onOpen();for(let o in t.collections)HTe.object.hasOwnProperty(t.collections,o)&&t.collections[o].onOpen()}WTe.exports=dc});var KTe=y(M7=>{"use strict";M7.BulkWriteResult=bbe();M7.Collection=fve();M7.Connection=GTe();M7.ClientEncryption=Pp().ClientEncryption});var ZTe=y((xun,YTe)=>{"use strict";var fFt=Object.freeze(["allowDiskUse","applyPluginsToChildSchemas","applyPluginsToDiscriminators","autoCreate","autoIndex","autoSearchIndex","bufferCommands","bufferTimeoutMS","cloneSchemas","createInitialConnection","debug","forceRepopulate","id","maxTimeMS","objectIdGetter","overwriteModels","returnOriginal","runValidators","sanitizeFilter","sanitizeProjection","selectPopulatedPaths","setDefaultsOnInsert","strict","strictPopulate","strictQuery","timestamps.createdAt.immutable","toJSON","toObject","transactionAsyncLocalStorage","translateAliases","updatePipeline"]);YTe.exports=fFt});var JTe=y((Tun,XTe)=>{"use strict";var uFt=on(),qO=class extends uFt{constructor(e){let n=e.map(r=>r.message).join(", ");n.length>50&&(n=n.slice(0,50)+"..."),super(`eachAsync() finished with ${e.length} errors: ${n}`),this.errors=e}};Object.defineProperty(qO.prototype,"name",{value:"EachAsyncMultiError"});XTe.exports=qO});var RY=y((Cun,eCe)=>{"use strict";var cFt=JTe(),PY=xp();eCe.exports=async function(e,n,r){let i=r.parallel||1,a=r.batchSize,s=r.signal,o=r.continueOnError,f=[],u=lFt(),c=!1;return new Promise((p,h)=>{if(s!=null){if(s.aborted)return p(null);s.addEventListener("abort",()=>(c=!0,p(null)),{once:!0})}if(a!=null){if(typeof a!="number")throw new TypeError("batchSize must be a number");if(Number.isInteger(a)){if(a<1)throw new TypeError("batchSize must be at least 1")}else throw new TypeError("batchSize must be an integer")}d((v,E)=>{if(v!=null)return h(v);p(E)})});function d(p){let h=0,v=0,E=null;for(let D=0;D<i;++D)u(M());function M(){let D=[],$=!1;return N;function N(V){if($||c)return V();if(E)return V();e(function(j,K){if(E!=null)return V();if(j!=null)if(j.name==="MongoCursorExhaustedError")K=null;else if(o)f.push(j);else return E=j,p(j),V();if(K==null){if($=!0,h<=0){let B=o?QTe(f):E;p(B)}else a&&D.length&&l(D,v++,W);return V()}if(++h,PY(()=>V()),a&&D.push(K),a&&D.length!==a){PY(()=>u(N));return}let Y=a?D:K;function W(B){if(a?(h-=D.length,D=[]):--h,B!=null)if(o)f.push(B);else return E=B,p(B);if(($||c)&&h<=0){let _=o?QTe(f):E;return p(_)}PY(()=>u(N))}l(Y,v++,W)})}}}function l(p,h,v){let E;try{E=n(p,h)}catch(M){return v(M)}E&&typeof E.then=="function"?E.then(function(){v(null)},function(M){v(M||new Error("`eachAsync()` promise rejected without error"))}):v(null)}};function lFt(){let t=[],e=null,n=0;return function(a){if(e===null&&t.length===0)return e=n++,a(r);t.push(a)};function r(){t.length!==0?(e=n++,t.shift()(r)):e=null}}function QTe(t){return t.length===0?null:new cFt(t)}});var fCe=y((Oun,oCe)=>{"use strict";var P7=on(),rCe=Q("stream").Readable,dFt=RY(),iCe=Z9(),pFt=Zh(),kY=xp(),{once:hFt}=Q("events"),aCe=Q("util");function wo(t){rCe.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.skipped=!1,this.query=t,this._closed=!1;let e=t.model;this._mongooseOptions={},this._transforms=[],this.model=e,this.options={};let n=r=>{if(r!=null){if(r instanceof pFt.skipWrappedFunction){let i=r.args[0];if(i!=null&&(!Array.isArray(i)||i.length)){let a=new P7('Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "'+aCe.inspect(i)+'".');this._markError(a),this.listeners("error").length>0&&this.emit("error",a);return}this.skipped=!0,this.emit("cursor",null);return}this._markError(r),this.listeners("error").length>0&&this.emit("error",r);return}Object.assign(this.options,t._optionsForExec()),this._transforms=this._transforms.concat(t._transforms.slice()),this.options.transform&&this._transforms.push(this.options.transform),this.options.batchSize&&(this.options._populateBatchSize=Math.min(this.options.batchSize,5e3)),t._mongooseOptions._asyncIterator&&(this._mongooseOptions._asyncIterator=!0),e.collection._shouldBufferCommands()&&e.collection.buffer?e.collection.queue.push([()=>tCe(t,this)]):tCe(t,this)};e.hooks.execPre("find",t).then(()=>n(null),r=>n(r))}aCe.inherits(wo,rCe);function tCe(t,e){try{let n=t.model.collection.find(t._conditions,e.options);e.cursor=n,e.emit("cursor",n)}catch(n){e._markError(n),e.listeners("error").length>0&&e.emit("error",e._error)}}wo.prototype._read=function(){VO(this,(t,e)=>{if(t)return this.emit("error",t);if(!e){this.push(null),this.cursor.close(function(n){if(n)return this.emit("error",n)});return}this.push(e)})};wo.prototype.getDriverCursor=async function(){return this.cursor?this.cursor:(await hFt(this,"cursor"),this.cursor)};Object.defineProperty(wo.prototype,"map",{value:function(t){return this._transforms.push(t),this},enumerable:!0,configurable:!0,writable:!0});wo.prototype._markError=function(t){return this._error=t,this};wo.prototype.close=async function(){if(typeof arguments[0]=="function")throw new P7("QueryCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close(),this._closed=!0,this.emit("close")}catch(e){throw this.listeners("error").length>0&&this.emit("error",e),e}};wo.prototype._destroy=function(e,n){let r=null;return this.cursor?r=Promise.resolve():r=new Promise(i=>{this.once("cursor",i)}),r.then(()=>{this.cursor.close()}).then(()=>{this._closed=!0,n()}).catch(i=>{n(i)}),this};wo.prototype.rewind=function(){return sCe(this,()=>{this.cursor.rewind()}),this};wo.prototype.next=async function(){if(typeof arguments[0]=="function")throw new P7("QueryCursor.prototype.next() no longer accepts a callback");if(this._closed)throw new P7("Cannot call `next()` on a closed cursor");return new Promise((e,n)=>{VO(this,function(r,i){if(r)return n(r);e(i)})})};wo.prototype.eachAsync=function(t,e){if(typeof arguments[2]=="function")throw new P7("QueryCursor.prototype.eachAsync() no longer accepts a callback");return typeof e=="function"&&(e={}),e=e||{},dFt(n=>VO(this,n),t,e)};wo.prototype.options;wo.prototype.addCursorFlag=function(t,e){return sCe(this,()=>{this.cursor.addCursorFlag(t,e)}),this};Symbol.asyncIterator!=null&&(wo.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this});function VO(t,e){let n=e;if(n=function(r,i){return r?e(r):i===null?t._mongooseOptions._asyncIterator?e(null,{done:!0}):e(null,null):(t._transforms.length&&i!==null&&(i=t._transforms.reduce(function(a,s){return s.call(t,a)},i)),t._mongooseOptions._asyncIterator?e(null,{value:i,done:!1}):e(null,i))},t._error)return kY(function(){n(t._error)});if(t.skipped)return kY(()=>n(null,null));if(t.cursor)if(t.query._mongooseOptions.populate&&!t._pop&&(t._pop=iCe.preparePopulationOptionsMQ(t.query,t.query._mongooseOptions),t._pop.__noPromise=!0),t.query._mongooseOptions.populate&&t.options._populateBatchSize>1){if(t._batchDocs&&t._batchDocs.length)return UO(t,t._batchDocs.shift(),t._pop,n);if(t._batchExhausted)return n(null,null);t._batchDocs=[],t.cursor.next().then(r=>{jO.call({ctx:t,callback:n},null,r)},r=>{jO.call({ctx:t,callback:n},r)});return}else return t.cursor.next().then(r=>{if(!r){n(null,null);return}if(!t.query._mongooseOptions.populate)return UO(t,r,null,n);UO(t,r,t._pop,(i,a)=>{if(i!=null)return n(i);t.query.model.populate(a,t._pop).then(s=>n(null,s),s=>n(s))})},r=>{n(r)});else t.once("error",e),t.once("cursor",function(r){if(t.removeListener("error",e),r==null)return t.skipped?e(null,null):void 0;VO(t,e)})}function jO(t,e){if(t)return this.callback(t);if(!e)return this.ctx._batchExhausted=!0,nCe.call(this);this.ctx._batchDocs.push(e),this.ctx._batchDocs.length<this.ctx.options._populateBatchSize?kY(()=>this.ctx.cursor.next().then(n=>{jO.call(this,null,n)},n=>{jO.call(this,n)})):nCe.call(this)}function nCe(){if(!this.ctx._batchDocs.length)return this.callback(null,null);this.ctx.query.model.populate(this.ctx._batchDocs,this.ctx._pop).then(()=>{UO(this.ctx,this.ctx._batchDocs.shift(),this.ctx._pop,this.callback)},t=>{this.callback(t)})}function UO(t,e,n,r){if(t.query._mongooseOptions.lean)return t.model.hooks.execPost("find",t.query,[[e]]).then(()=>r(null,e),f=>r(f));let{model:i,_fields:a,_userProvidedFields:s,options:o}=t.query;iCe.createModelAndInit(i,e,a,s,o,n,(f,u)=>{if(f!=null)return r(f);t.model.hooks.execPost("find",t.query,[[u]]).then(()=>r(null,u),c=>r(c))})}function sCe(t,e){if(t.cursor)return e();t.once("cursor",function(n){n!=null&&e()})}oCe.exports=wo});var NY=y((Iun,cCe)=>{"use strict";var DY=Vt();function mFt(t,e,n){uCe(t,e,n,"maxTimeMS")}function yFt(t,e,n){uCe(t,e,n,"allowDiskUse")}cCe.exports={applyGlobalMaxTimeMS:mFt,applyGlobalDiskUse:yFt};function uCe(t,e,n,r){DY.hasUserDefinedProperty(t,r)||(DY.hasUserDefinedProperty(e,r)?t[r]=e[r]:DY.hasUserDefinedProperty(n,r)&&(t[r]=n[r]))}});var $Y=y((Mun,lCe)=>{"use strict";lCe.exports=function(e,n){if(n.readConcern!==void 0||n&&n.session&&n.session.transaction)return;let r=e.options?.readConcern?.level;r!=null&&(n.readConcern={level:r})}});var BY=y((Pun,dCe)=>{"use strict";dCe.exports=function(e,n){if(n.writeConcern!=null||n&&n.session&&n.session.transaction)return;let r=e.options.writeConcern??{};Object.keys(r).length!=0?(n.writeConcern={},!("w"in n)&&r.w!=null&&(n.writeConcern.w=r.w),!("j"in n)&&r.j!=null&&(n.writeConcern.j=r.j),!("wtimeout"in n)&&r.wtimeout!=null&&(n.writeConcern.wtimeout=r.wtimeout)):(!("w"in n)&&r.w!=null&&(n.w=r.w),!("j"in n)&&r.j!=null&&(n.j=r.j),!("wtimeout"in n)&&r.wtimeout!=null&&(n.wtimeout=r.wtimeout))}});var mCe=y((Run,hCe)=>{"use strict";var pCe=c7();hCe.exports=function(e,n,r){if(!Object.keys(r).some(pCe))return n.castForQuery(null,r,e);let a=Object.keys(r),s=a.length;for(;s--;){let o=a[s],f=r[o];if(o==="$not"){if(f&&n&&!n.embeddedSchemaType&&!n.Constructor){let u=Object.keys(f);if(u.length&&pCe(u[0]))for(let c of Object.keys(f))f[c]=n.castForQuery(c,f[c],e);else r[o]=n.castForQuery(o,f,e);continue}}else r[o]=n.castForQuery(o,f,e)}return r}});var bCe=y((kun,yCe)=>{"use strict";var bFt=/^\d+$/;yCe.exports=function(e,n,r){let i=e.path(n);if(i!=null)return i;let a=n.split("."),s="",o=!1;for(let f of a)if(!(o&&bFt.test(f))){if(s=s.length===0?f:s+"."+f,i=e.path(s),i?.schema)e=i.schema,!o&&i.$isMongooseDocumentArray&&(o=!0),r&&r[s]&&(e=e.discriminators[r[s]]??e),s="";else if(i?.instance==="Mixed")break}return i}});var wCe=y((Dun,ACe)=>{"use strict";var gFt=mCe(),gCe=s7(),vCe=bCe(),vFt=dY();ACe.exports=function(e){let n=e.options.arrayFilters;if(!Array.isArray(n))return;let r=e.getUpdate(),i=e.schema,a=vFt(r),s=i.options.strict;e._mongooseOptions.strict!=null&&(s=e._mongooseOptions.strict),e.model&&e.model.base.options.strictQuery!=null&&(s=e.model.base.options.strictQuery),i._userProvidedOptions.strictQuery!=null&&(s=i._userProvidedOptions.strictQuery),e._mongooseOptions.strictQuery!=null&&(s=e._mongooseOptions.strictQuery),_Ce(n,i,s,a,e)};function _Ce(t,e,n,r,i){let a={};for(let s of t){if(s==null)throw new Error(`Got null array filter in ${t}`);let o=Object.keys(s).filter(h=>s[h]!=null);if(o.length===0)continue;let f=o[0];if(f==="$and"||f==="$or"){for(let h of o)_Ce(s[h],e,n,r,i);continue}let u=f.indexOf("."),c=u===-1?f:f.substring(0,u);if(r[c]==null)continue;let d=gCe(r[c]),l=vCe(e,d,a),p=l!=null?l.schema:null;p!=null&&p.discriminators!=null&&s[c+"."+p.options.discriminatorKey]&&(p=p.discriminators[s[c+"."+p.options.discriminatorKey]]||p,a[d]=s[c+"."+p.options.discriminatorKey]);for(let h of o){if(r[h]===null||Object.keys(r).length===0)continue;let v=h.indexOf("."),E=v===-1?null:h.substring(v),M;if(E==null||p==null?M=l:(E=gCe(E),M=vCe(p,E,a)),M==null){if(!n)return;let D=E==null?d+".0":d+".0"+E;throw new Error(`Could not find path "${D}" in schema`)}typeof s[h]=="object"?s[h]=gFt(i,M,s[h]):s[h]=M.castForQuery(null,s[h])}}}});var zO=y((Nun,ECe)=>{"use strict";var _Ft=My(),AFt=Ey();ECe.exports=function t(e){if(e==null)return!1;let n=Object.keys(e),r=n.length;if(r===0)return!1;for(let i=0;i<r;++i){let a=n[i];if(!a.startsWith("+")&&_Ft(e[a])&&e[a])return AFt(e[a])?t(e[a]):!!e[a]}return!1}});var xCe=y(($un,SCe)=>{"use strict";SCe.exports=function(e,n){return e===n||n.startsWith(e+".")}});var TCe=y(zi=>{"use strict";var FY=["__proto__","constructor","prototype"],HO=zi.clone=function t(e,n){if(e==null)return e;if(Array.isArray(e))return zi.cloneArray(e,n);if(e.constructor){if(/ObjectI[dD]$/.test(e.constructor.name))return typeof e.clone=="function"?e.clone():new e.constructor(e.id);if(e.constructor.name==="ReadPreference")return new e.constructor(e.mode,t(e.tags,n));if(e._bsontype=="Binary"&&e.buffer&&e.value)return typeof e.clone=="function"?e.clone():new e.constructor(e.value(!0),e.sub_type);if(e.constructor.name==="Date"||e.constructor.name==="Function")return new e.constructor(+e);if(e.constructor.name==="RegExp")return new RegExp(e);if(e.constructor.name==="Buffer")return Buffer.from(e)}if(EFt(e))return zi.cloneObject(e,n);if(e.valueOf)return e.valueOf()};zi.cloneObject=function(e,n){let r=n&&n.minimize,i={},a=Object.keys(e),s=a.length,o=!1,f,u="",c=0;for(c=0;c<s;++c)u=a[c],FY.indexOf(u)===-1&&(f=HO(e[u],n),(!r||typeof f<"u")&&(o||(o=!0),i[u]=f));return r?o&&i:i};zi.cloneArray=function(e,n){let r=[],i=e.length,a=0;for(;a<i;a++)r.push(HO(e[a],n));return r};zi.merge=function t(e,n){let r=Object.keys(n);for(let i of r)FY.indexOf(i)===-1&&(typeof e[i]>"u"?e[i]=n[i]:zi.isObject(n[i])?t(e[i],n[i]):e[i]=n[i])};zi.mergeClone=function t(e,n){let r=Object.keys(n);for(let i of r)FY.indexOf(i)===-1&&(typeof e[i]>"u"?e[i]=HO(n[i]):zi.isObject(n[i])?t(e[i],n[i]):e[i]=HO(n[i]))};zi.readPref=function(e){switch(e){case"p":e="primary";break;case"pp":e="primaryPreferred";break;case"s":e="secondary";break;case"sp":e="secondaryPreferred";break;case"n":e="nearest";break}return e};zi.readConcern=function(e){if(typeof e=="string"){switch(e){case"l":e="local";break;case"a":e="available";break;case"m":e="majority";break;case"lz":e="linearizable";break;case"s":e="snapshot";break}e={level:e}}return e};var wFt=Object.prototype.toString;zi.toString=function(t){return wFt.call(t)};var EFt=zi.isObject=function(t){return zi.toString(t)=="[object Object]"};zi.keys=Object.keys;zi.create=typeof Object.create=="function"?Object.create:SFt;function SFt(t){if(arguments.length>1)throw new Error("Adding properties is not supported");function e(){}return e.prototype=t,new e}zi.inherits=function(t,e){t.prototype=zi.create(e.prototype),t.prototype.constructor=t};zi.isArgumentsObject=function(t){return Object.prototype.toString.call(t)==="[object Arguments]"}});var OCe=y(CCe=>{"use strict";var Hr=CCe;Hr.distinct=function(t){if(t._fields&&Object.keys(t._fields).length>0)return"field selection and slice";let e=Object.keys(Hr.distinct),n;return e.every(function(r){return t.options[r]?(n=r,!1):!0}),n};Hr.distinct.select=Hr.distinct.slice=Hr.distinct.sort=Hr.distinct.limit=Hr.distinct.skip=Hr.distinct.batchSize=Hr.distinct.hint=Hr.distinct.tailable=!0;Hr.findOneAndUpdate=Hr.findOneAndDelete=function(t){let e=Object.keys(Hr.findOneAndUpdate),n;return e.every(function(r){return t.options[r]?(n=r,!1):!0}),n};Hr.findOneAndUpdate.limit=Hr.findOneAndUpdate.skip=Hr.findOneAndUpdate.batchSize=Hr.findOneAndUpdate.tailable=!0;Hr.findOneAndReplace=function(t){let e=Object.keys(Hr.findOneAndUpdate),n;return e.every(function(r){return t.options[r]?(n=r,!1):!0}),n};Hr.countDocuments=function(t){if(t._fields&&Object.keys(t._fields).length>0)return"field selection and slice";let e=Object.keys(Hr.countDocuments),n;return e.every(function(r){return t.options[r]?(n=r,!1):!0}),n};Hr.countDocuments.slice=Hr.countDocuments.batchSize=Hr.countDocuments.tailable=!0});var LY=y((pc,ICe)=>{"use strict";pc.isNode=typeof process<"u"&&typeof ICe=="object"&&typeof global=="object"&&typeof Buffer=="function"&&process.argv;pc.isMongo=!pc.isNode&&typeof printjson=="function"&&typeof ObjectId=="function"&&typeof rs=="function"&&typeof sh=="function";pc.isBrowser=!pc.isNode&&!pc.isMongo&&typeof window<"u";pc.type=pc.isNode?"node":pc.isMongo?"mongo":pc.isBrowser?"browser":"unknown"});var R7=y((MCe,PCe)=>{"use strict";var qY=["find","findOne","updateMany","updateOne","replaceOne","countDocuments","estimatedDocumentCount","distinct","findOneAndDelete","findOneAndReplace","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function UY(){}for(let t=0,e=qY.length;t<e;++t){let n=qY[t];UY.prototype[n]=xFt(n)}PCe.exports=MCe=UY;UY.methods=qY;function xFt(t){return function(){throw new Error("collection."+t+" not implemented")}}});var DCe=y((RCe,kCe)=>{"use strict";var TFt=R7(),jY=class extends TFt{constructor(e){super(),this.collection=e,this.collectionName=e.collectionName}async find(e,n){return this.collection.find(e,n).toArray()}async findOne(e,n){return this.collection.findOne(e,n)}async countDocuments(e,n){return this.collection.countDocuments(e,n)}async estimatedDocumentCount(e,n){return this.collection.estimatedDocumentCount(e,n)}async distinct(e,n,r){return this.collection.distinct(e,n,r)}async updateMany(e,n,r){return this.collection.updateMany(e,n,r)}async updateOne(e,n,r){return this.collection.updateOne(e,n,r)}async replaceOne(e,n,r){return this.collection.replaceOne(e,n,r)}async deleteOne(e,n){return this.collection.deleteOne(e,n)}async deleteMany(e,n){return this.collection.deleteMany(e,n)}async findOneAndDelete(e,n){return this.collection.findOneAndDelete(e,n)}async findOneAndUpdate(e,n,r){return this.collection.findOneAndUpdate(e,n,r)}async findOneAndReplace(e,n,r){return this.collection.findOneAndReplace(e,n,r)}findCursor(e,n){return this.collection.find(e,n)}};kCe.exports=RCe=jY});var $Ce=y((qun,NCe)=>{"use strict";var VY=LY();if(VY.type=="unknown")throw new Error("Unknown environment");NCe.exports=VY.isNode?DCe():VY.isMongo?R7():R7()});var GY=y((LCe,qCe)=>{"use strict";var CFt=Q("assert"),FCe=Q("util"),jn=TCe(),C1=FCe.debuglog("mquery");function ge(t,e){if(!(this instanceof ge))return new ge(t,e);let n=this.constructor.prototype;this.op=n.op||void 0,this.options=Object.assign({},n.options),this._conditions=n._conditions?jn.clone(n._conditions):{},this._fields=n._fields?jn.clone(n._fields):void 0,this._updateDoc=n._updateDoc?jn.clone(n._updateDoc):void 0,this._path=n._path||void 0,this._distinctDoc=n._distinctDoc||void 0,this._collection=n._collection||void 0,this._traceFunction=n._traceFunction||void 0,e&&this.setOptions(e),t&&this.find(t)}ge.prototype.toConstructor=function(){function e(r,i){if(!(this instanceof e))return new e(r,i);ge.call(this,r,i)}jn.inherits(e,ge);let n=e.prototype;return n.options={},n.setOptions(this.options),n.op=this.op,n._conditions=jn.clone(this._conditions),n._fields=jn.clone(this._fields),n._updateDoc=jn.clone(this._updateDoc),n._path=this._path,n._distinctDoc=this._distinctDoc,n._collection=this._collection,n._traceFunction=this._traceFunction,e};ge.prototype.setOptions=function(t){if(!(t&&jn.isObject(t)))return this;let e=jn.keys(t),n;for(let r=0;r<e.length;++r)if(n=e[r],typeof this[n]=="function"){let i=Array.isArray(t[n])?t[n]:[t[n]];this[n].apply(this,i)}else this.options[n]=t[n];return this};ge.prototype.collection=function(e){return this._collection=new ge.Collection(e),this};ge.prototype.collation=function(t){return this.options.collation=t,this};ge.prototype.$where=function(t){return this._conditions.$where=t,this};ge.prototype.where=function(){if(!arguments.length)return this;this.op||(this.op="find");let t=typeof arguments[0];if(t=="string")return this._path=arguments[0],arguments.length===2&&(this._conditions[this._path]=arguments[1]),this;if(t=="object"&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw new TypeError("path must be a string or object")};ge.prototype.equals=function(e){this._ensurePath("equals");let n=this._path;return this._conditions[n]=e,this};ge.prototype.eq=function(e){this._ensurePath("eq");let n=this._path;return this._conditions[n]=e,this};ge.prototype.or=function(e){let n=this._conditions.$or||(this._conditions.$or=[]);return Array.isArray(e)||(e=[e]),n.push.apply(n,e),this};ge.prototype.nor=function(e){let n=this._conditions.$nor||(this._conditions.$nor=[]);return Array.isArray(e)||(e=[e]),n.push.apply(n,e),this};ge.prototype.and=function(e){let n=this._conditions.$and||(this._conditions.$and=[]);return Array.isArray(e)||(e=[e]),n.push.apply(n,e),this};"gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function(t){ge.prototype[t]=function(){let e,n;arguments.length===1?(this._ensurePath(t),n=arguments[0],e=this._path):(n=arguments[1],e=arguments[0]);let r=this._conditions[e]===null||typeof this._conditions[e]=="object"?this._conditions[e]:this._conditions[e]={};return r["$"+t]=n,this}});ge.prototype.mod=function(){let t,e;arguments.length===1?(this._ensurePath("mod"),t=arguments[0],e=this._path):arguments.length===2&&!Array.isArray(arguments[1])?(this._ensurePath("mod"),t=[arguments[0],arguments[1]],e=this._path):arguments.length===3?(t=[arguments[1],arguments[2]],e=arguments[0]):(t=arguments[1],e=arguments[0]);let n=this._conditions[e]||(this._conditions[e]={});return n.$mod=t,this};ge.prototype.exists=function(){let t,e;arguments.length===0?(this._ensurePath("exists"),t=this._path,e=!0):arguments.length===1?typeof arguments[0]=="boolean"?(this._ensurePath("exists"),t=this._path,e=arguments[0]):(t=arguments[0],e=!0):arguments.length===2&&(t=arguments[0],e=arguments[1]);let n=this._conditions[t]||(this._conditions[t]={});return n.$exists=e,this};ge.prototype.elemMatch=function(){if(arguments[0]==null)throw new TypeError("Invalid argument");let t,e,n;if(typeof arguments[0]=="function")this._ensurePath("elemMatch"),e=this._path,t=arguments[0];else if(jn.isObject(arguments[0]))this._ensurePath("elemMatch"),e=this._path,n=arguments[0];else if(typeof arguments[1]=="function")e=arguments[0],t=arguments[1];else if(arguments[1]&&jn.isObject(arguments[1]))e=arguments[0],n=arguments[1];else throw new TypeError("Invalid argument");t&&(n=new ge,t(n),n=n._conditions);let r=this._conditions[e]||(this._conditions[e]={});return r.$elemMatch=n,this};ge.prototype.within=function(){if(this._ensurePath("within"),this._geoComparison="$geoWithin",arguments.length===0)return this;if(arguments.length===2)return this.box.apply(this,arguments);if(2<arguments.length)return this.polygon.apply(this,arguments);let e=arguments[0];if(!e)throw new TypeError("Invalid argument");if(e.center)return this.circle(e);if(e.box)return this.box.apply(this,e.box);if(e.polygon)return this.polygon.apply(this,e.polygon);if(e.type&&e.coordinates)return this.geometry(e);throw new TypeError("Invalid argument")};ge.prototype.box=function(){let t,e;if(arguments.length===3)t=arguments[0],e=[arguments[1],arguments[2]];else if(arguments.length===2)this._ensurePath("box"),t=this._path,e=[arguments[0],arguments[1]];else throw new TypeError("Invalid argument");let n=this._conditions[t]||(this._conditions[t]={});return n[this._geoComparison||"$geoWithin"]={$box:e},this};ge.prototype.polygon=function(){let t,e;typeof arguments[0]=="string"?(t=Array.from(arguments),e=t.shift()):(this._ensurePath("polygon"),e=this._path,t=Array.from(arguments));let n=this._conditions[e]||(this._conditions[e]={});return n[this._geoComparison||"$geoWithin"]={$polygon:t},this};ge.prototype.circle=function(){let t,e;if(arguments.length===1)this._ensurePath("circle"),t=this._path,e=arguments[0];else if(arguments.length===2)t=arguments[0],e=arguments[1];else throw new TypeError("Invalid argument");if(!("radius"in e&&e.center))throw new Error("center and radius are required");let n=this._conditions[t]||(this._conditions[t]={}),r=e.spherical?"$centerSphere":"$center",i=this._geoComparison||"$geoWithin";return n[i]={},n[i][r]=[e.center,e.radius],"unique"in e&&(n[i].$uniqueDocs=!!e.unique),this};ge.prototype.near=function(){let e,n;if(this._geoComparison="$near",arguments.length===0)return this;if(arguments.length===1)this._ensurePath("near"),e=this._path,n=arguments[0];else if(arguments.length===2)e=arguments[0],n=arguments[1];else throw new TypeError("Invalid argument");if(!n.center)throw new Error("center is required");let r=this._conditions[e]||(this._conditions[e]={}),i=n.spherical?"$nearSphere":"$near";if(Array.isArray(n.center)){r[i]=n.center;let a="maxDistance"in n?n.maxDistance:null;a!=null&&(r.$maxDistance=a),n.minDistance!=null&&(r.$minDistance=n.minDistance)}else{if(n.center.type!="Point"||!Array.isArray(n.center.coordinates))throw new Error(FCe.format("Invalid GeoJSON specified for %s",i));r[i]={$geometry:n.center},"maxDistance"in n&&(r[i].$maxDistance=n.maxDistance),"minDistance"in n&&(r[i].$minDistance=n.minDistance)}return this};ge.prototype.intersects=function(){if(this._ensurePath("intersects"),this._geoComparison="$geoIntersects",arguments.length===0)return this;let e=arguments[0];if(e!=null&&e.type&&e.coordinates)return this.geometry(e);throw new TypeError("Invalid argument")};ge.prototype.geometry=function(){if(!(this._geoComparison=="$within"||this._geoComparison=="$geoWithin"||this._geoComparison=="$near"||this._geoComparison=="$geoIntersects"))throw new Error("geometry() must come after `within()`, `intersects()`, or `near()");let e,n;if(arguments.length===1)this._ensurePath("geometry"),n=this._path,e=arguments[0];else throw new TypeError("Invalid argument");if(!(e.type&&Array.isArray(e.coordinates)))throw new TypeError("Invalid argument");let r=this._conditions[n]||(this._conditions[n]={});return r[this._geoComparison]={$geometry:e},this};ge.prototype.select=function(){let e=arguments[0];if(!e)return this;if(arguments.length!==1)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");let n=this._fields||(this._fields={}),r=typeof e,i,a;if((r=="string"||jn.isArgumentsObject(e))&&typeof e.length=="number"||Array.isArray(e)){for(r=="string"&&(e=e.split(/\s+/)),i=0,a=e.length;i<a;++i){let s=e[i];if(!s)continue;let o=s[0]=="-"?0:1;o===0&&(s=s.substring(1)),n[s]=o}return this}if(jn.isObject(e)){let s=jn.keys(e);for(i=0;i<s.length;++i)n[s[i]]=e[s[i]];return this}throw new TypeError("Invalid select() argument. Must be string or object.")};ge.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let t,e;if(arguments.length===1){let r=arguments[0];if(typeof r=="object"&&!Array.isArray(r)){let i=Object.keys(r),a=i.length;for(let s=0;s<a;++s)this.slice(i[s],r[i[s]]);return this}this._ensurePath("slice"),t=this._path,e=arguments[0]}else arguments.length===2?typeof arguments[0]=="number"?(this._ensurePath("slice"),t=this._path,e=[arguments[0],arguments[1]]):(t=arguments[0],e=arguments[1]):arguments.length===3&&(t=arguments[0],e=[arguments[1],arguments[2]]);let n=this._fields||(this._fields={});return n[t]={$slice:e},this};ge.prototype.sort=function(t){if(!t)return this;let e,n,r;this._validate("sort");let i=typeof t;if(Array.isArray(t)){for(n=t.length,e=0;e<t.length;++e){if(!Array.isArray(t[e]))throw new Error("Invalid sort() argument, must be array of arrays");OFt(this.options,t[e][0],t[e][1])}return this}if(arguments.length===1&&i=="string"){for(t=t.split(/\s+/),n=t.length,e=0;e<n;++e){if(r=t[e],!r)continue;let a=r[0]=="-"?-1:1;a===-1&&(r=r.substring(1)),BCe(this.options,r,a)}return this}if(jn.isObject(t)){let a=jn.keys(t);for(e=0;e<a.length;++e)r=a[e],BCe(this.options,r,t[r]);return this}if(typeof Map<"u"&&t instanceof Map)return IFt(this.options,t),this;throw new TypeError("Invalid sort() argument. Must be a string, object, or array.")};var zY={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function BCe(t,e,n){if(Array.isArray(t.sort))throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let r;if(n&&n.$meta){r=t.sort||(t.sort={}),r[e]={$meta:n.$meta};return}r=t.sort||(t.sort={});let i=String(n||1).toLowerCase();if(i=zY[i],!i)throw new TypeError("Invalid sort value: { "+e+": "+n+" }");r[e]=i}function OFt(t,e,n){if(t.sort=t.sort||[],!Array.isArray(t.sort))throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let r=String(n||1).toLowerCase();if(r=zY[r],!r)throw new TypeError("Invalid sort value: [ "+e+", "+n+" ]");t.sort.push([e,r])}function IFt(t,e){if(t.sort=t.sort||new Map,!(t.sort instanceof Map))throw new TypeError("Can't mix sort syntaxes. Use either array or object or map consistently");e.forEach(function(n,r){let i=String(n||1).toLowerCase();if(i=zY[i],!i)throw new TypeError("Invalid sort value: < "+r+": "+n+" >");t.sort.set(r,i)})}["limit","skip","batchSize","comment"].forEach(function(t){ge.prototype[t]=function(e){return this._validate(t),this.options[t]=e,this}});ge.prototype.maxTime=ge.prototype.maxTimeMS=function(t){return this._validate("maxTime"),this.options.maxTimeMS=t,this};ge.prototype.hint=function(){if(arguments.length===0)return this;this._validate("hint");let t=arguments[0];if(jn.isObject(t)){let e=this.options.hint||(this.options.hint={});for(let n in t)e[n]=t[n];return this}if(typeof t=="string")return this.options.hint=t,this;throw new TypeError("Invalid hint. "+t)};ge.prototype.j=function(e){return this.options.j=e,this};ge.prototype.slaveOk=function(t){return this.options.slaveOk=arguments.length?!!t:!0,this};ge.prototype.read=ge.prototype.setReadPreference=function(t){return arguments.length>1&&!ge.prototype.read.deprecationWarningIssued&&(console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),ge.prototype.read.deprecationWarningIssued=!0),this.options.readPreference=jn.readPref(t),this};ge.prototype.readConcern=ge.prototype.r=function(t){return this.options.readConcern=jn.readConcern(t),this};ge.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=arguments.length?!!arguments[0]:!0,this};ge.prototype.writeConcern=ge.prototype.w=function(e){return typeof e=="object"?(typeof e.j<"u"&&(this.options.j=e.j),typeof e.w<"u"&&(this.options.w=e.w),typeof e.wtimeout<"u"&&(this.options.wtimeout=e.wtimeout)):this.options.w=e==="m"?"majority":e,this};ge.prototype.wtimeout=ge.prototype.wTimeout=function(e){return this.options.wtimeout=e,this};ge.prototype.merge=function(t){if(!t)return this;if(!ge.canMerge(t))throw new TypeError("Invalid argument. Expected instanceof mquery or plain object");return t instanceof ge?(t._conditions&&jn.merge(this._conditions,t._conditions),t._fields&&(this._fields||(this._fields={}),jn.merge(this._fields,t._fields)),t.options&&(this.options||(this.options={}),jn.merge(this.options,t.options)),t._updateDoc&&(this._updateDoc||(this._updateDoc={}),jn.mergeClone(this._updateDoc,t._updateDoc)),t._distinctDoc&&(this._distinctDoc=t._distinctDoc),this):(jn.merge(this._conditions,t),this)};ge.prototype.find=function(t){return this.op="find",ge.canMerge(t)&&this.merge(t),this};ge.prototype._find=async function(){let e=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),C1("find",this._collection.collectionName,e,n),this._collection.find(e,n)};ge.prototype.cursor=function(e){if(this.op){if(this.op!=="find")throw new TypeError(".cursor only support .find method")}else this.find(e);let n=this._conditions,r=this._optionsForExec();return this.$useProjection?r.projection=this._fieldsForExec():r.fields=this._fieldsForExec(),C1("findCursor",this._collection.collectionName,n,r),this._collection.findCursor(n,r)};ge.prototype.findOne=function(t){return this.op="findOne",ge.canMerge(t)&&this.merge(t),this};ge.prototype._findOne=async function(){let e=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),C1("findOne",this._collection.collectionName,e,n),this._collection.findOne(e,n)};ge.prototype.countDocuments=function(t){return this.op="countDocuments",this._validate(),ge.canMerge(t)&&this.merge(t),this};ge.prototype._countDocuments=async function(){let e=this._conditions,n=this._optionsForExec();return C1("countDocuments",this._collection.collectionName,e,n),this._collection.countDocuments(e,n)};ge.prototype.estimatedDocumentCount=function(){return this.op="estimatedDocumentCount",this._validate(),this};ge.prototype._estimatedDocumentCount=async function(){let e=this._conditions,n=this._optionsForExec();return C1("estimatedDocumentCount",this._collection.collectionName,e,n),this._collection.estimatedDocumentCount(e,n)};ge.prototype.distinct=function(t,e){return this.op="distinct",this._validate(),!e&&typeof t=="string"&&(e=t,t=void 0),typeof e=="string"&&(this._distinctDoc=e),ge.canMerge(t)&&this.merge(t),this};ge.prototype._distinct=async function(){if(!this._distinctDoc)throw new Error("No value for `distinct` has been declared");let e=this._conditions,n=this._optionsForExec();return this._collection.distinct(this._distinctDoc,e,n)};ge.prototype.updateMany=function(e,n,r){return HY(this,"updateMany",e,n,r)};ge.prototype._updateMany=async function(){return WY(this,"updateMany")};ge.prototype.updateOne=function(e,n,r){return HY(this,"updateOne",e,n,r)};ge.prototype._updateOne=async function(){return WY(this,"updateOne")};ge.prototype.replaceOne=function(e,n,r){return this.setOptions({overwrite:!0}),HY(this,"replaceOne",e,n,r)};ge.prototype._replaceOne=async function(){return WY(this,"replaceOne")};function HY(t,e,n,r,i){return t.op=e,ge.canMerge(n)&&t.merge(n),r&&t._mergeUpdate(r),jn.isObject(i)&&t.setOptions(i),t}async function WY(t,e){let n=t._optionsForExec(),r=t._conditions,i=t._updateForExec();return C1(e,t._collection.collectionName,r,i,n),t._collection[e](r,i,n)}ge.prototype.deleteOne=function(t){return this.op="deleteOne",ge.canMerge(t)&&this.merge(t),this};ge.prototype._deleteOne=async function(){let t=this._optionsForExec();delete t.justOne;let e=this._conditions;return C1("deleteOne",this._collection.collectionName,e,t),this._collection.deleteOne(e,t)};ge.prototype.deleteMany=function(t){return this.op="deleteMany",ge.canMerge(t)&&this.merge(t),this};ge.prototype._deleteMany=async function(){let t=this._optionsForExec();delete t.justOne;let e=this._conditions;return this._collection.deleteMany(e,t)};ge.prototype.findOneAndUpdate=function(t,e,n){return this.op="findOneAndUpdate",this._validate(),ge.canMerge(t)&&this.merge(t),e&&this._mergeUpdate(e),n&&this.setOptions(n),this};ge.prototype._findOneAndUpdate=async function(){let t=this._conditions,e=this._updateForExec(),n=this._optionsForExec();return this._collection.findOneAndUpdate(t,e,n)};ge.prototype.findOneAndReplace=function(t,e,n){return this.op="findOneAndReplace",this._validate(),ge.canMerge(t)&&this.merge(t),e&&(this._updateDoc=e,this.options=this.options||{},this.options.overwrite=!0),n&&this.setOptions(n),this};ge.prototype._findOneAndReplace=async function(){let t=this._conditions,e=this._updateForExec(),n=this._optionsForExec();return C1("findOneAndReplace",this._collection.collectionName,t,e,n),this._collection.findOneAndReplace(t,e,n)};ge.prototype.findOneAndDelete=function(t,e){return this.op="findOneAndDelete",this._validate(),ge.canMerge(t)&&this.merge(t),e&&this.setOptions(e),this};ge.prototype._findOneAndDelete=async function(){let t=this._optionsForExec(),e=this._conditions;return C1("findOneAndDelete",this._collection.collectionName,e,t),this._collection.findOneAndDelete(e,t)};ge.prototype.setTraceFunction=function(t){return this._traceFunction=t,this};ge.prototype.exec=async function(e){typeof e=="string"&&(this.op=e),CFt.ok(this.op,"Missing query type: (find, etc)");let n="_"+this.op;if(typeof this[n]!="function")throw new TypeError(`this[${n}] is not a function`);return this[n]()};ge.prototype.then=async function(t,e){return this.exec().then(t,e)};ge.prototype.cursor=function(){if(this.op!="find")throw new Error("cursor() is only available for find");let t=this._conditions,e=this._optionsForExec();return this.$useProjection?e.projection=this._fieldsForExec():e.fields=this._fieldsForExec(),this._collection.findCursor(t,e)};ge.prototype.selected=function(){return!!(this._fields&&Object.keys(this._fields).length>0)};ge.prototype.selectedInclusively=function(){if(!this._fields)return!1;let e=Object.keys(this._fields);if(e.length===0)return!1;for(let n=0;n<e.length;++n){let r=e[n];if(this._fields[r]===0||this._fields[r]&&typeof this._fields[r]=="object"&&this._fields[r].$meta)return!1}return!0};ge.prototype.selectedExclusively=function(){if(!this._fields)return!1;let e=Object.keys(this._fields);if(e.length===0)return!1;for(let n=0;n<e.length;++n){let r=e[n];if(this._fields[r]===0)return!0}return!1};ge.prototype._mergeUpdate=function(t){this._updateDoc||(this._updateDoc={}),t instanceof ge?t._updateDoc&&jn.mergeClone(this._updateDoc,t._updateDoc):jn.mergeClone(this._updateDoc,t)};ge.prototype._optionsForExec=function(){return jn.clone(this.options)};ge.prototype._fieldsForExec=function(){return jn.clone(this._fields)};ge.prototype._updateForExec=function(){let t=this._updateDoc==null?{}:jn.clone(this._updateDoc),e=jn.keys(t),n={};for(let r of e){if(this.options.overwrite){n[r]=t[r];continue}r[0]!=="$"?(n.$set||(t.$set?n.$set=t.$set:n.$set={}),n.$set[r]=t[r],~e.indexOf("$set")||e.push("$set")):r==="$set"&&n.$set||(n[r]=t[r])}return this._compiledUpdate=n,n};ge.prototype._ensurePath=function(t){if(!this._path){let e=t+"() must be used after where() when called with these arguments";throw new Error(e)}};ge.permissions=OCe();ge._isPermitted=function(t,e){let n=ge.permissions[e];return n?n[t]!==!0:!0};ge.prototype._validate=function(t){let e,n;if(t===void 0){if(n=ge.permissions[this.op],typeof n!="function")return!0;e=n(this)}else ge._isPermitted(t,this.op)||(e=t);if(e)throw new Error(e+" cannot be used with "+this.op)};ge.canMerge=function(t){return t instanceof ge||jn.isObject(t)};ge.setGlobalTraceFunction=function(t){ge.traceFunction=t};ge.utils=jn;ge.env=LY();ge.Collection=$Ce();ge.BaseCollection=R7();qCe.exports=LCe=ge});var KY=y((Uun,UCe)=>{"use strict";UCe.exports=function(e,n){if(typeof e==="string"&&(e=e.split(/\s+/)),!Array.isArray(e)&&Object.prototype.toString.call(e)!=="[object Arguments]")return e;let i=e.length,a={};for(let s=0;s<i;++s){let o=e[s];if(!o)continue;let f=o[0]=="-"?0:1;!n&&f===0&&(o=o.substring(1)),a[o]=f}return a}});var zCe=y((jun,VCe)=>{"use strict";VCe.exports=function(e,n){let r=Object.keys(e).map(i=>Object.keys(e[i])).reduce((i,a)=>i.concat(a),[]);return n.filter(i=>jCe(i,r))};function jCe(t,e){let n=Object.keys(t)[0];if(n==="$and"||n==="$or")return Array.isArray(t[n])?t[n].find(a=>jCe(a,e))!=null:!1;let r=n.indexOf("."),i=r===-1?n:n.slice(0,r);return e.find(a=>a.includes("$["+i+"]"))!=null}});var WO=y((Vun,HCe)=>{"use strict";HCe.exports=function(e){if(typeof e!="object"||e===null)return!1;let n=Object.keys(e),r=n.length;for(let i=0;i<r;++i)if(n[i][0]==="$")return!0;return!1}});var YY=y((zun,WCe)=>{"use strict";var MFt=WO(),{trustedSymbol:PFt}=Sy();WCe.exports=function t(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e)){for(let r of e)t(r);return e}let n=Object.keys(e);for(let r of n){let i=e[r];if(!(i!=null&&i[PFt])){if(r==="$and"||r==="$or"){t(i);continue}if(MFt(i)){let a=Object.keys(i);if(a.length===1&&a[0]==="$eq")continue;e[r]={$eq:e[r]}}}}return e}});var KCe=y((Hun,GCe)=>{"use strict";GCe.exports=function(e){if(e==null)return;let n=Object.keys(e);for(let r=0;r<n.length;++r)typeof e[n[r]]=="string"&&(e[n[r]]=1)}});var XCe=y((Wun,ZCe)=>{"use strict";var RFt=Py(),kFt=zO();ZCe.exports=function(e,n,r){if(r==null)return;let i=Object.keys(r);if(n=n||{},kFt(e))for(let a of i){YCe(n,a)?n[a]===0&&delete e[a]:e[a]=1;let s=r[a]?.refPath;typeof s=="string"&&(YCe(n,s)?n[s]===0&&delete e[s]:e[s]=1)}else if(RFt(e))for(let a of i){n[a]==null&&delete e[a];let s=r[a]?.refPath;typeof s=="string"&&n[s]==null&&delete e[s]}};function YCe(t,e){let n=e.split("."),r=n.length,i=n[0];for(let a=1;a<r;++a){if(t[i]!=null||t[i+".$"]!=null)return!0;i+="."+n[a]}return t[i]!=null||t[i+".$"]!=null}});var tOe=y((Gun,eOe)=>{"use strict";var JCe=Jh(),DFt=s7(),QCe=OC().flatten;eOe.exports=async function(e,n,r,i){let a=Object.keys(r||{}),s={},o={},f={},u={},c=a.length,d=!1,l,p;for(let V=0;V<c;++V)if(a[V].startsWith("$")){if(d=!0,a[V]==="$push"||a[V]==="$addToSet"){let W=Object.keys(r[a[V]]);for(let B=0;B<W.length;++B)l=r[a[V]][W[B]],l&&l.$each?u[W[B]]=(u[W[B]]||[]).concat(l.$each):u[W[B]]=(u[W[B]]||[]).concat([l]);continue}let j=QCe(r[a[V]],null,null,n),K=Object.keys(j),Y=K.length;for(let W=0;W<Y;++W){let B=DFt(K[W]);p=a[V],!B.includes("$")&&(p==="$set"||p==="$setOnInsert"||p==="$pull"||p==="$pullAll"?(o[B]=j[K[W]],f[B]=p==="$pull"||p==="$pullAll"):p==="$unset"&&(o[B]=void 0),s[B]=!0)}}d||(o=QCe(r,null,null,n),s=Object.keys(o));let h=Object.keys(o),v=h.length,E=[],M=[],D=[],$=e;for(let V=0;V<v;++V){let j=o[h[V]],K=n._getSchema(h[V]);if(K!=null&&!(K.instance==="Mixed"&&K.path!==h[V]))if(j&&Array.isArray(j.$in))j.$in.forEach((Y,W)=>{E.push(K.doValidate(Y,$,{updateValidator:!0}).catch(B=>{B.path=h[W]+".$in."+W,M.push(B)}))});else{if(f[h[V]]&&K.$isMongooseArray)continue;if(K.$isMongooseDocumentArrayElement&&j!=null&&j.$__!=null)D.push(h[V]),E.push(K.doValidate(j,$,{updateValidator:!0}).catch(Y=>{if(Y.errors)for(let W of Object.keys(Y.errors)){let B=Y.errors[W];B.path=h[V]+"."+W,M.push(B)}else Y.path=h[V],M.push(Y)}));else{if(D.find(W=>h[V].startsWith(W+".")))continue;K.$isSingleNested&&D.push(h[V]),E.push(K.doValidate(j,$,{updateValidator:!0}).catch(W=>{K.schema!=null&&K.schema.options.storeSubdocValidationError===!1&&W instanceof JCe||W&&(W.path=h[V],M.push(W))}))}}}let N=Object.keys(u);for(let V of N){let j=n._getSchema(V);if(j&&j.$isMongooseDocumentArray)E.push(j.doValidate(u[V],i&&i.context==="query"?e:null).catch(K=>{K.path=V,M.push(K)}));else{j=n._getSchema(V+".0");for(let K of u[V])E.push(j.doValidate(K,i&&i.context==="query"?e:null,{updateValidator:!0}).catch(Y=>{Y.path=V,M.push(Y)}))}}if(await Promise.all(E),M.length){let V=new JCe(null);for(let j of M)V.addError(j.path,j);throw V}}});var ZO=y((Kun,mOe)=>{"use strict";var D7=fs(),NFt=iC(),XY=Zh(),Hi=on(),O1=wC(),nOe=fCe(),rOe=Jh(),{applyGlobalMaxTimeMS:N7,applyGlobalDiskUse:$7}=NY(),$Ft=tK(),BFt=$Y(),FFt=BY(),LFt=om(),qFt=wCe(),KO=f7(),UFt=_Y(),Eo=Qr(),jFt=W0(),B7=Z9(),VFt=oc().internalToObjectOptions,zFt=Py(),HFt=zO(),WFt=PC(),iOe=xCe(),sOe=s0(),YO=GY(),GFt=KY(),KFt=zCe(),YFt=YY(),ZFt=KCe(),XFt=XCe(),oOe=wY(),GO=Kh(),JFt=tOe(),k7=Q("util"),Ar=Vt(),QFt=o7().queryMiddlewareFunctions,eLt=new Set(["allowDiskUse","batchSize","collation","comment","explain","hint","j","lean","limit","maxTimeMS","populate","projection","read","select","skip","slice","sort","tailable","w","writeConcern","wtimeout"]),tLt=new Map([["countDocuments","_countDocuments"],["distinct","__distinct"],["estimatedDocumentCount","_estimatedDocumentCount"],["find","_find"],["findOne","_findOne"],["findOneAndReplace","_findOneAndReplace"],["findOneAndUpdate","_findOneAndUpdate"],["replaceOne","_replaceOne"],["updateMany","_updateMany"],["updateOne","_updateOne"],["deleteMany","_deleteMany"],["deleteOne","_deleteOne"],["findOneAndDelete","_findOneAndDelete"]]);function me(t,e,n,r){this._mongooseOptions||(this._mongooseOptions={}),e=e||{},this._transforms=[],this._hooks=new XY,this._execCount=0;let i=Object.keys(e);for(let s of i)this._mongooseOptions[s]=e[s];r&&(this.mongooseCollection=r),n&&(this.model=n,this.schema=n.schema),this.model&&this.model._mapreduce&&this.lean(),YO.call(this,null,e),r&&this.collection(r),t&&this.find(t),this.options=this.options||{},this.$useProjection=!0;let a=this&&this.schema&&this.schema.options&&this.schema.options.collation||null;a!=null&&(this.options.collation=a)}function fOe(t){if(t==null||typeof t!="object"||Object.keys(t).length===0)return!0;for(let e of["$and","$or","$nor"])if(Array.isArray(t[e])&&(t[e].length===0||t[e].every(n=>fOe(n))))return!0;return!1}function eb(t,e){if(e&&e.requireFilter&&fOe(t))throw new Error("Empty or invalid filter not allowed with requireFilter enabled")}me.prototype=new YO;me.prototype.constructor=me;me.prototype.count=void 0;me.prototype.findOneAndRemove=void 0;me.base=YO.prototype;Object.defineProperty(me.prototype,"_distinct",{configurable:!0,writable:!0,enumerable:!0,value:void 0});me.use$geoWithin=YO.use$geoWithin;me.prototype.toConstructor=function(){let e=this.model,n=this.mongooseCollection,r=function(s,o){if(!(this instanceof r))return new r(s,o);this._mongooseOptions=Eo(i._mongooseOptions),me.call(this,s,o||null,e,n)};k7.inherits(r,e.Query);let i=r.prototype;i.options={};let a=Object.assign({},this.options);return a.sort!=null&&(i.sort(a.sort),delete a.sort),i.setOptions(a),i.op=this.op,i._conditions=Eo(this._conditions),i._fields=Eo(this._fields),i._update=Eo(this._update,{flattenDecimals:!1}),i._path=this._path,i._distinct=this._distinct,i._collection=this._collection,i._mongooseOptions=this._mongooseOptions,r};me.prototype.clone=function(){let t=this.model,e=this.mongooseCollection,n=new this.model.Query({},{},t,e),r=Object.assign({},this.options);return r.sort!=null&&(n.sort(r.sort),delete r.sort),n.setOptions(r),n.op=this.op,n._conditions=Eo(this._conditions),n._fields=Eo(this._fields),n._update=Eo(this._update,{flattenDecimals:!1}),n._path=this._path,n._distinct=this._distinct,n._collection=this._collection,n._mongooseOptions=this._mongooseOptions,n};me.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let t,e;if(arguments.length===1){let r=arguments[0];if(typeof r=="object"&&!Array.isArray(r)){let i=Object.keys(r),a=i.length;for(let s=0;s<a;++s)this.slice(i[s],r[i[s]]);return this}this._ensurePath("slice"),t=this._path,e=arguments[0]}else arguments.length===2?typeof arguments[0]=="number"?(this._ensurePath("slice"),t=this._path,e=[arguments[0],arguments[1]]):(t=arguments[0],e=arguments[1]):arguments.length===3&&(t=arguments[0],e=[arguments[1],arguments[2]]);let n={};return n[t]={$slice:e},this.select(n),this};var nLt=new Set(QFt);me.prototype._validateOp=function(){if(this.op!=null&&!nLt.has(this.op)&&this.error(new Error('Query has invalid `op`: "'+this.op+'"')),this.op!=="estimatedDocumentCount"&&this._conditions==null)throw new O1(this._conditions,"filter",this.op)};me.prototype.mod=function(){let t,e;arguments.length===1?(this._ensurePath("mod"),t=arguments[0],e=this._path):arguments.length===2&&!Array.isArray(arguments[1])?(this._ensurePath("mod"),t=[arguments[0],arguments[1]],e=this._path):arguments.length===3?(t=[arguments[1],arguments[2]],e=arguments[0]):(t=arguments[1],e=arguments[0]);let n=this._conditions[e]||(this._conditions[e]={});return n.$mod=t,this};me.prototype.limit=function(e){if(this._validate("limit"),typeof e=="string")try{e=KO(e)}catch{throw new D7("Number",e,"limit")}return this.options.limit=e,this};me.prototype.skip=function(e){if(this._validate("skip"),typeof e=="string")try{e=KO(e)}catch{throw new D7("Number",e,"skip")}return this.options.skip=e,this};me.prototype.projection=function(t){return arguments.length===0?this._fields:(this._fields={},this._userProvidedFields={},this.select(t),this._fields)};me.prototype.select=function(){let e=arguments[0];if(!e)return this;if(arguments.length!==1)throw new Error("Invalid select: select only takes 1 argument");this._validate("select");let n=this._fields||(this._fields={}),r=this._userProvidedFields||(this._userProvidedFields={}),i;this.model!=null&&Ar.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection")?i=this.model.db.options.sanitizeProjection:this.model!=null&&Ar.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection")?i=this.model.base.options.sanitizeProjection:i=this._mongooseOptions.sanitizeProjection;function a(s){return typeof s=="string"&&i?s=1:s}if(e=GFt(e,!0),Ar.isObject(e)){if(this.selectedInclusively())Object.entries(e).forEach(([s,o])=>{o?(n["-"+s]!=null&&delete n["-"+s],n[s]=r[s]=a(o)):Object.keys(r).forEach(f=>{iOe(s,f)&&(delete n[f],delete r[f])})});else if(this.selectedExclusively())Object.entries(e).forEach(([s,o])=>{o?Object.keys(r).forEach(f=>{iOe(s,f)&&(delete n[f],delete r[f])}):(n["+"+s]!=null&&delete n["+"+s],n[s]=r[s]=a(o))});else{let s=Object.keys(e);for(let o=0;o<s.length;++o){let f=e[s[o]],u=s[o];n[u]=a(f),r[u]=a(f)}}return this}throw new TypeError("Invalid select() argument. Must be string or object.")};me.prototype.schemaLevelProjections=function(e){return this._mongooseOptions.schemaLevelProjections=e,this};me.prototype.sanitizeProjection=function(e){return this._mongooseOptions.sanitizeProjection=e,this};me.prototype.read=function(e,n){return typeof e=="string"?(e=$Ft(e),this.options.readPreference={mode:e,tags:n}):this.options.readPreference=e,this};me.prototype.toString=function(){return this.op==="count"||this.op==="countDocuments"||this.op==="find"||this.op==="findOne"||this.op==="deleteMany"||this.op==="deleteOne"||this.op==="findOneAndDelete"||this.op==="remove"?`${this.model.modelName}.${this.op}(${k7.inspect(this._conditions)})`:this.op==="distinct"?`${this.model.modelName}.distinct('${this._distinct}', ${k7.inspect(this._conditions)})`:this.op==="findOneAndReplace"||this.op==="findOneAndUpdate"||this.op==="replaceOne"||this.op==="update"||this.op==="updateMany"||this.op==="updateOne"?`${this.model.modelName}.${this.op}(${k7.inspect(this._conditions)}, ${k7.inspect(this._update)})`:`${this.model.modelName}.${this.op}()`};me.prototype.session=function(e){return e==null&&delete this.options.session,this.options.session=e,this};me.prototype.writeConcern=function(e){return e==null?(delete this.options.writeConcern,this):(this.options.writeConcern=e,this)};me.prototype.w=function(e){return e==null&&delete this.options.w,this.options.writeConcern!=null?this.options.writeConcern.w=e:this.options.w=e,this};me.prototype.j=function(e){return e==null&&delete this.options.j,this.options.writeConcern!=null?this.options.writeConcern.j=e:this.options.j=e,this};me.prototype.wtimeout=function(e){return e==null&&delete this.options.wtimeout,this.options.writeConcern!=null?this.options.writeConcern.wtimeout=e:this.options.wtimeout=e,this};me.prototype.getOptions=function(){return this.options};me.prototype.setOptions=function(t,e){if(e)return this._mongooseOptions=t&&Eo(t)||{},this.options=t||{},"populate"in t&&this.populate(this._mongooseOptions),this;if(t==null)return this;if(typeof t!="object")throw new Error('Options must be an object, got "'+t+'"');if(t=Object.assign({},t),Array.isArray(t.populate)){let n=t.populate;delete t.populate;let r=n.length;for(let i=0;i<r;++i)this.populate(n[i])}if("setDefaultsOnInsert"in t&&(this._mongooseOptions.setDefaultsOnInsert=t.setDefaultsOnInsert,delete t.setDefaultsOnInsert),"overwriteDiscriminatorKey"in t&&(this._mongooseOptions.overwriteDiscriminatorKey=t.overwriteDiscriminatorKey,delete t.overwriteDiscriminatorKey),"overwriteImmutable"in t&&(this._mongooseOptions.overwriteImmutable=t.overwriteImmutable,delete t.overwriteImmutable),"updatePipeline"in t&&(this._mongooseOptions.updatePipeline=t.updatePipeline,delete t.updatePipeline),"sanitizeProjection"in t&&(t.sanitizeProjection&&!this._mongooseOptions.sanitizeProjection&&ZFt(this._fields),this._mongooseOptions.sanitizeProjection=t.sanitizeProjection,delete t.sanitizeProjection),"sanitizeFilter"in t&&(this._mongooseOptions.sanitizeFilter=t.sanitizeFilter,delete t.sanitizeFilter),"timestamps"in t&&(this._mongooseOptions.timestamps=t.timestamps,delete t.timestamps),"defaults"in t&&(this._mongooseOptions.defaults=t.defaults),"translateAliases"in t&&(this._mongooseOptions.translateAliases=t.translateAliases,delete t.translateAliases),"schemaLevelProjections"in t&&(this._mongooseOptions.schemaLevelProjections=t.schemaLevelProjections,delete t.schemaLevelProjections),t.lean==null&&this.schema&&"lean"in this.schema.options&&(this._mongooseOptions.lean=this.schema.options.lean),typeof t.limit=="string")try{t.limit=KO(t.limit)}catch{throw new D7("Number",t.limit,"limit")}if(typeof t.skip=="string")try{t.skip=KO(t.skip)}catch{throw new D7("Number",t.skip,"skip")}for(let n of Object.keys(t))if(eLt.has(n)){let r=Array.isArray(t[n])?t[n]:[t[n]];this[n].apply(this,r)}else this.options[n]=t[n];return this};me.prototype.explain=function(e){return arguments.length===0?this.options.explain=!0:e===!1?delete this.options.explain:this.options.explain=e,this};me.prototype.allowDiskUse=function(t){return arguments.length===0?this.options.allowDiskUse=!0:t===!1?delete this.options.allowDiskUse:this.options.allowDiskUse=t,this};me.prototype.maxTimeMS=function(t){return this.options.maxTimeMS=t,this};me.prototype.getFilter=function(){return this._conditions};me.prototype.getQuery=function(){return this._conditions};me.prototype.setQuery=function(t){this._conditions=t};me.prototype.getUpdate=function(){return this._update};me.prototype.setUpdate=function(t){this._update=t};me.prototype._fieldsForExec=function(){return this._fields==null||Object.keys(this._fields).length===0?null:Eo(this._fields)};me.prototype._updateForExec=function(){let t=Eo(this._update,{transform:!1,depopulate:!0}),e=Object.keys(t),n=e.length,r={};for(;n--;){let i=e[n];i[0]!=="$"?(r.$set||(t.$set?r.$set=t.$set:r.$set={}),r.$set[i]=t[i],e.splice(n,1),~e.indexOf("$set")||e.push("$set")):i==="$set"&&r.$set||(r[i]=t[i])}return r};me.prototype._optionsForExec=function(t){let e=Eo(this.options);if(delete e.populate,t=t||this.model,!t)return e;BFt(t.schema,e),FFt(t.schema,e);let n=this.model?.db?.base.transactionAsyncLocalStorage?.getStore();!this.options.hasOwnProperty("session")&&n?.session!=null&&(e.session=n.session);let r=t&&t.schema&&t.schema.options&&t.schema.options.read;if(!("readPreference"in e)&&r&&(e.readPreference=r),e.upsert!==void 0&&(e.upsert=!!e.upsert),e.writeConcern&&(e.j&&(e.writeConcern.j=e.j,delete e.j),e.w&&(e.writeConcern.w=e.w,delete e.w),e.wtimeout&&(e.writeConcern.wtimeout=e.wtimeout,delete e.wtimeout)),this._applyPaths(),this._fields!=null){this._fields=this._castFields(this._fields);let i=this._fieldsForExec();i!=null&&(e.projection=i)}if(this._mongooseOptions.populate){if(e.readPreference)for(let i of Object.values(this._mongooseOptions.populate))i.options?.readPreference===void 0&&(i.options||(i.options={}),i.options.readPreference=e.readPreference);if(e.readConcern)for(let i of Object.values(this._mongooseOptions.populate))i.options?.readConcern===void 0&&(i.options||(i.options={}),i.options.readConcern=e.readConcern)}return e};me.prototype.lean=function(t){return this._mongooseOptions.lean=arguments.length?t:!0,this};me.prototype.set=function(t,e){if(typeof t=="object"){let n=Object.keys(t);for(let r of n)this.set(r,t[r]);return this}return this._update=this._update||{},t in this._update&&delete this._update[t],this._update.$set=this._update.$set||{},this._update.$set[t]=e,this};me.prototype.get=function(e){let n=this._update;if(n==null)return;let r=n.$set;if(r==null||Ar.hasUserDefinedProperty(n,e))return n[e];if(Ar.hasUserDefinedProperty(r,e))return r[e]};me.prototype.error=function(e){return arguments.length===0?this._error:(this._error=e,this)};me.prototype._unsetCastError=function(){if(!(this._error==null||!(this._error instanceof D7)))return this.error(null)};me.prototype.mongooseOptions=function(t){return arguments.length>0&&(this._mongooseOptions=t),this._mongooseOptions};me.prototype._castConditions=function(){let t;this.model?.db.options?.sanitizeFilter!=null?t=this.model.db.options.sanitizeFilter:this.model?.base.options?.sanitizeFilter!=null?t=this.model.base.options.sanitizeFilter:t=this._mongooseOptions.sanitizeFilter,t&&YFt(this._conditions);try{this.cast(this.model),this._unsetCastError()}catch(e){this.error(e)}};function uOe(t){try{qFt(t)}catch(e){t.error(e)}}me.prototype._find=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let e=this._mongooseOptions,n=this._userProvidedFields||{};N7(this.options,this.model.db.options,this.model.base.options),$7(this.options,this.model.db.options,this.model.base.options);let r={session:this&&this.options&&this.options.session||null,lean:e.lean||null},i=this._optionsForExec(),a=this._conditions,s=i.projection,o=await this.mongooseCollection.find(a,i);if(i.explain)return o.explain();let f=await o.toArray();if(f.length===0)return f;if(!e.populate){let c=this.schema.options.versionKey;return e.lean&&e.lean.versionKey===!1&&c&&f.forEach(d=>{c in d&&delete d[c]}),e.lean?lOe(this.model.schema,f,null,r):this._completeMany(f,s,n,r)}let u=B7.preparePopulationOptionsMQ(this,e);return e.lean?this.model.populate(f,u):(f=await this._completeMany(f,s,n,r),await this.model.populate(f,u),f)};me.prototype.find=function(t){if(typeof t=="function"||typeof arguments[1]=="function")throw new Hi("Query.prototype.find() no longer accepts a callback");return this.op="find",I1(t)?(this.merge(t),F7(this)):t!=null&&this.error(new O1(t,"filter","find")),this};me.prototype.merge=function(t){if(!t)return t===null&&(this._conditions=null),this;this._conditions=this._conditions??{};let e={overwrite:!0};return t instanceof me?(t._conditions&&(e.omit={},this._conditions&&this._conditions.$and&&t._conditions.$and&&(e.omit.$and=!0,this._conditions.$and=this._conditions.$and.concat(t._conditions.$and)),this._conditions&&this._conditions.$or&&t._conditions.$or&&(e.omit.$or=!0,this._conditions.$or=this._conditions.$or.concat(t._conditions.$or)),Ar.merge(this._conditions,t._conditions,e)),t._fields&&(this._fields||(this._fields={}),Ar.merge(this._fields,t._fields,e)),t.options&&(this.options||(this.options={}),Ar.merge(this.options,t.options,e)),t._update&&(this._update||(this._update={}),Ar.mergeClone(this._update,t._update)),t._distinct&&(this._distinct=t._distinct),Ar.merge(this._mongooseOptions,t._mongooseOptions),this):this.model!=null&&t instanceof this.model.base.Types.ObjectId?(Ar.merge(this._conditions,{_id:t},e),this):(t&&t.$__&&(t=t.toObject(VFt)),e.omit={},Array.isArray(t.$and)&&(e.omit.$and=!0,this._conditions||(this._conditions={}),this._conditions.$and=(this._conditions.$and||[]).concat(t.$and.map(n=>Ar.isPOJO(n)?Ar.merge({},n):n))),Array.isArray(t.$or)&&(e.omit.$or=!0,this._conditions||(this._conditions={}),this._conditions.$or=(this._conditions.$or||[]).concat(t.$or.map(n=>Ar.isPOJO(n)?Ar.merge({},n):n))),Ar.merge(this._conditions,t,e),this)};me.prototype.collation=function(t){return this.options==null&&(this.options={}),this.options.collation=t,this};me.prototype._completeOne=function(t,e,n,r){if(!t&&!this.options.includeResultMetadata)return r(null,null);let i=this.model,a=this._userProvidedFields||{},s=this._mongooseOptions,o=this.options;if(!o.lean&&s.lean&&(o.lean=s.lean),o.explain)return r(null,t);if(!s.populate){let u=this.schema.options.versionKey;return s.lean&&s.lean.versionKey===!1&&u&&u in t&&delete t[u],s.lean?JY(i.schema,t,null,e,o,r):aOe(i,t,e,o,n,a,null,r)}let f=B7.preparePopulationOptionsMQ(this,this._mongooseOptions);if(s.lean)return i.populate(t,f).then(u=>{JY(i.schema,u,null,e,o,r)},u=>{r(u)});aOe(i,t,e,o,n,a,[],(u,c)=>{if(u!=null)return r(u);i.populate(c,f).then(d=>{r(null,d)},d=>{r(d)})})};me.prototype._completeMany=async function(e,n,r,i){let a=this.model;return Promise.all(e.map(s=>new Promise((o,f)=>{let u=s;s=B7.createModel(a,s,n,r),i.session!=null&&s.$session(i.session),s.$init(u,i,c=>{if(c!=null)return f(c);o(s)})})))};me.prototype._findOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();N7(this.options,this.model.db.options,this.model.base.options),$7(this.options,this.model.db.options,this.model.base.options);let e=this._optionsForExec(),n=await this.mongooseCollection.findOne(this._conditions,e);return new Promise((r,i)=>{this._completeOne(n,null,e.projection,(a,s)=>{if(a)return i(a);r(s)})})};me.prototype.findOne=function(t,e,n){if(typeof t=="function"||typeof e=="function"||typeof n=="function"||typeof arguments[3]=="function")throw new Hi("Query.prototype.findOne() no longer accepts a callback");return this.op="findOne",n&&this.setOptions(n),e&&this.select(e),I1(t)?(this.merge(t),F7(this)):t!=null&&this.error(new O1(t,"filter","findOne")),this};me.prototype._countDocuments=async function(){this._applyTranslateAliases();try{this.cast(this.model)}catch(r){this.error(r)}if(this.error())throw this.error();N7(this.options,this.model.db.options,this.model.base.options),$7(this.options,this.model.db.options,this.model.base.options);let e=this._optionsForExec(),n=this._conditions;return this.mongooseCollection.countDocuments(n,e)};me.prototype._applyTranslateAliases=function(){let e=!1;"translateAliases"in this._mongooseOptions?e=this._mongooseOptions.translateAliases:this.model?.schema?._userProvidedOptions?.translateAliases!=null?e=this.model.schema._userProvidedOptions.translateAliases:this.model?.base?.options?.translateAliases!=null&&(e=this.model.base.options.translateAliases),e&&this.model?.schema?.aliases&&Object.keys(this.model.schema.aliases).length>0&&(this.model.translateAliases(this._conditions,!0),this.model.translateAliases(this._fields,!0),this.model.translateAliases(this._update,!0),this._distinct!=null&&this.model.schema.aliases[this._distinct]!=null&&(this._distinct=this.model.schema.aliases[this._distinct]))};me.prototype._estimatedDocumentCount=async function(){if(this.error())throw this.error();let e=this._optionsForExec();return this.mongooseCollection.estimatedDocumentCount(e)};me.prototype.estimatedDocumentCount=function(t){if(typeof t=="function"||typeof arguments[1]=="function")throw new Hi("Query.prototype.estimatedDocumentCount() no longer accepts a callback");return this.op="estimatedDocumentCount",t!=null&&this.setOptions(t),this};me.prototype.countDocuments=function(t,e){if(typeof t=="function"||typeof e=="function"||typeof arguments[2]=="function")throw new Hi("Query.prototype.countDocuments() no longer accepts a callback");return this.op="countDocuments",I1(t)&&this.merge(t),e!=null&&this.setOptions(e),this};me.prototype.__distinct=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();N7(this.options,this.model.db.options,this.model.base.options),$7(this.options,this.model.db.options,this.model.base.options);let e=this._optionsForExec();return this.mongooseCollection.distinct(this._distinct,this._conditions,e)};me.prototype.distinct=function(t,e,n){if(typeof t=="function"||typeof e=="function"||typeof n=="function"||typeof arguments[3]=="function")throw new Hi("Query.prototype.distinct() no longer accepts a callback");return this.op="distinct",I1(e)?(this.merge(e),F7(this)):e!=null&&this.error(new O1(e,"filter","distinct")),t!=null&&(this._distinct=t),n!=null&&this.setOptions(n),this};me.prototype.sort=function(t,e){if(arguments.length>2)throw new Error("sort() takes at most 2 arguments");if(e!=null&&typeof e!="object")throw new Error("sort() options argument must be an object or nullish");this.options.sort==null&&(this.options.sort={}),e&&e.override&&(this.options.sort={});let n=this.options.sort;if(typeof t=="string"){let r=t.indexOf(" ")===-1?[t]:t.split(" ");for(let i of r){let a=i[0]=="-"?-1:1;a===-1&&(i=i.slice(1)),!GO.has(i)&&(n[i]=a)}}else if(Array.isArray(t))for(let r of t){if(!Array.isArray(r))throw new TypeError("Invalid sort() argument, must be array of arrays");let i=""+r[0];GO.has(i)||(n[i]=ZY(r[1],i))}else if(typeof t=="object"&&t!=null&&!(t instanceof Map))for(let r of Object.keys(t))GO.has(r)||(n[r]=ZY(t[r],r));else if(t instanceof Map)for(let r of t.keys())r=""+r,!GO.has(r)&&(n[r]=ZY(t.get(r),r));else if(t!=null)throw new TypeError("Invalid sort() argument. Must be a string, object, array, or map.");return this};function ZY(t,e){if(t===1||t==="asc"||t==="ascending")return 1;if(t===-1||t==="desc"||t==="descending")return-1;if(t?.$meta!=null)return{$meta:t.$meta};throw new TypeError("Invalid sort value: { "+e+": "+t+" }")}me.prototype.deleteOne=function(e,n){if(typeof e=="function"||typeof n=="function"||typeof arguments[2]=="function")throw new Hi("Query.prototype.deleteOne() no longer accepts a callback");return this.op="deleteOne",this.setOptions(n),I1(e)?(this.merge(e),F7(this)):e!=null&&this.error(new O1(e,"filter","deleteOne")),this};me.prototype._deleteOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),eb(this._conditions,this.options),this.error()!=null)throw this.error();let e=this._optionsForExec();return this.mongooseCollection.deleteOne(this._conditions,e)};me.prototype.deleteMany=function(t,e){if(typeof t=="function"||typeof e=="function"||typeof arguments[2]=="function")throw new Hi("Query.prototype.deleteMany() no longer accepts a callback");return this.setOptions(e),this.op="deleteMany",I1(t)?(this.merge(t),F7(this)):t!=null&&this.error(new O1(t,"filter","deleteMany")),this};me.prototype._deleteMany=async function(){if(this._applyTranslateAliases(),this._castConditions(),eb(this._conditions,this.options),this.error()!=null)throw this.error();let e=this._optionsForExec();return this.mongooseCollection.deleteMany(this._conditions,e)};function aOe(t,e,n,r,i,a,s,o){if(r.includeResultMetadata&&e==null)return f(null),null;B7.createModelAndInit(t,e,i,a,r,s,f);function f(u,c){if(u)return o(u);if(r.includeResultMetadata)return e&&c?(r.session!=null&&c.$session(r.session),n.value=c):n.value=null,o(null,n);r.session!=null&&c.$session(r.session),o(null,c)}}function F7(t){if(!t||!t.model||!t.model.schema)return;let e=t.model.schema;e&&e.discriminatorMapping&&!e.discriminatorMapping.isRoot&&(t._conditions[e.discriminatorMapping.key]=e.discriminatorMapping.value)}me.prototype.findOneAndUpdate=function(t,e,n){if(typeof t=="function"||typeof e=="function"||typeof n=="function"||typeof arguments[3]=="function")throw new Hi("Query.prototype.findOneAndUpdate() no longer accepts a callback");switch(this.op="findOneAndUpdate",this._validate(),arguments.length){case 2:n=void 0;break;case 1:e=t,t=n=void 0;break}I1(t)?this.merge(t):t!=null&&this.error(new O1(t,"filter","findOneAndUpdate")),n=n?Eo(n):{},n.projection&&(this.select(n.projection),delete n.projection),n.fields&&(this.select(n.fields),delete n.fields);let r=this?.model?.base?.options?.returnOriginal;n.new==null&&n.returnDocument==null&&n.returnOriginal==null&&r!=null&&(n.returnOriginal=r);let i=this?.model?.base?.options?.updatePipeline;return n.updatePipeline==null&&i!=null&&(n.updatePipeline=i),this.setOptions(n),e&&this._mergeUpdate(e),this};me.prototype._findOneAndUpdate=async function(){if(this._applyTranslateAliases(),this._castConditions(),eb(this._conditions,this.options),uOe(this),this.error())throw this.error();N7(this.options,this.model.db.options,this.model.base.options),$7(this.options,this.model.db.options,this.model.base.options),"strict"in this.options&&(this._mongooseOptions.strict=this.options.strict);let e=this._optionsForExec(this.model);cOe(e),this._update=this._castUpdate(this._update);let n=Object.assign({},e,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});if(this._update=oOe(this._conditions,this.model.schema,this._update,n),!this._update||Object.keys(this._update).length===0)if(e.upsert){let s=Eo(this._update);delete s._id,this._update={$set:s}}else return this._execCount=0,await this._findOne();else{if(this._update instanceof Error)throw this._update;this._update.$set&&Object.keys(this._update.$set).length===0&&delete this._update.$set}QY(this,"runValidators",!1)&&await this.validate(this._update,e,!1),this._update.toBSON&&(this._update=this._update.toBSON());let i=await this.mongooseCollection.findOneAndUpdate(this._conditions,this._update,e);for(let s of this._transforms)i=s(i);let a=e.includeResultMetadata?i.value:i;return new Promise((s,o)=>{this._completeOne(a,i,e.projection,(f,u)=>{if(f)return o(f);s(u)})})};me.prototype.findOneAndDelete=function(t,e){if(typeof t=="function"||typeof e=="function"||typeof arguments[2]=="function")throw new Hi("Query.prototype.findOneAndDelete() no longer accepts a callback");return this.op="findOneAndDelete",this._validate(),I1(t)&&this.merge(t),e&&this.setOptions(e),this};me.prototype._findOneAndDelete=async function(){if(this._applyTranslateAliases(),this._castConditions(),eb(this._conditions,this.options),this.error()!=null)throw this.error();let e=this.options.includeResultMetadata,n=this._conditions,r=this._optionsForExec(this.model),i=await this.mongooseCollection.findOneAndDelete(n,r);for(let s of this._transforms)i=s(i);let a=e?i.value:i;return new Promise((s,o)=>{this._completeOne(a,i,r.projection,(f,u)=>{if(f)return o(f);s(u)})})};me.prototype.findOneAndReplace=function(t,e,n){if(typeof t=="function"||typeof e=="function"||typeof n=="function"||typeof arguments[4]=="function")throw new Hi("Query.prototype.findOneAndReplace() no longer accepts a callback");this.op="findOneAndReplace",this._validate(),I1(t)?this.merge(t):t!=null&&this.error(new O1(t,"filter","findOneAndReplace")),e!=null&&this._mergeUpdate(e),n=n||{};let r=this?.model?.base?.options?.returnOriginal;return n.new==null&&n.returnDocument==null&&n.returnOriginal==null&&r!=null&&(n.returnOriginal=r),this.setOptions(n),this};me.prototype._findOneAndReplace=async function(){if(this._applyTranslateAliases(),this._castConditions(),eb(this._conditions,this.options),this.error()!=null)throw this.error();"strict"in this.options&&(this._mongooseOptions.strict=this.options.strict,delete this.options.strict);let e=this._conditions,n=this._optionsForExec();cOe(n);let r=this.options.includeResultMetadata,i={skipId:!0};"strict"in this._mongooseOptions&&(i.strict=this._mongooseOptions.strict);let a=QY(this,"runValidators",!1);try{let f=new this.model(this._update,null,i);if(a)await f.validate();else if(f.$__.validationError)throw f.$__.validationError;this._update=f.toBSON()}catch(f){if(f instanceof rOe)throw f;let u=new rOe;throw u.errors[f.path]=f,u}let s=await this.mongooseCollection.findOneAndReplace(e,this._update,n);for(let f of this._transforms)s=f(s);let o=r?s.value:s;return new Promise((f,u)=>{this._completeOne(o,s,n.projection,(c,d)=>{if(c)return u(c);f(d)})})};me.prototype.findById=function(t,e,n){return this.findOne({_id:t},e,n)};me.prototype.findByIdAndUpdate=function(t,e,n){return this.findOneAndUpdate({_id:t},e,n)};me.prototype.findByIdAndDelete=function(t,e){return this.findOneAndDelete({_id:t},e)};function cOe(t){"new"in t&&(t.returnDocument=t.new?"after":"before",delete t.new),"returnOriginal"in t&&(t.returnDocument=t.returnOriginal?"before":"after",delete t.returnOriginal),typeof t.returnDocument=="string"&&(t.returnOriginal=t.returnDocument==="before")}function QY(t,e,n){let r=t._optionsForExec(t.model);return e in r?r[e]:e in t.model.base.options?t.model.base.options[e]:n}function JY(t,e,n,r,i,a){if(i.lean&&typeof i.lean.transform=="function"){i.lean.transform(e);for(let s=0;s<t.childSchemas.length;s++){let o=n?n+"."+t.childSchemas[s].model.path:t.childSchemas[s].model.path,f=t.childSchemas[s].schema,u=sOe.get(o,e);if(u!=null){if(Array.isArray(u))for(let c=0;c<u.length;c++)i.lean.transform(u[c]);else i.lean.transform(u);JY(f,u,o,r,i)}}return a?a(null,e):void 0}return i.includeResultMetadata?a(null,r):a(null,e)}function lOe(t,e,n,r){if(r.lean&&typeof r.lean.transform=="function"){for(let i of e)r.lean.transform(i);for(let i=0;i<t.childSchemas.length;i++){let a=n?n+"."+t.childSchemas[i].model.path:t.childSchemas[i].model.path,s=t.childSchemas[i].schema,o=sOe.get(a,e);if(o!=null){o=o.flat();for(let f=0;f<o.length;f++)r.lean.transform(o[f]);lOe(s,o,a,r)}}}return e}me.prototype._mergeUpdate=function(t){if(!this._mongooseOptions.updatePipeline&&Array.isArray(t))throw new Hi("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(this._update||(this._update=Array.isArray(t)?[]:{}),!(t==null||typeof t=="object"&&Object.keys(t).length===0))if(t instanceof me){if(Array.isArray(this._update))throw new Hi("Cannot mix array and object updates");t._update&&Ar.mergeClone(this._update,t._update)}else if(Array.isArray(t)){if(!Array.isArray(this._update))throw new Hi("Cannot mix array and object updates");this._update=this._update.concat(t)}else{if(Array.isArray(this._update))throw new Hi("Cannot mix array and object updates");Ar.mergeClone(this._update,t)}};async function eZ(t){if(this._applyTranslateAliases(),this._castConditions(),eb(this._conditions,this.options),uOe(this),this.error()!=null)throw this.error();let e=this._conditions,n=this._optionsForExec(this.model);this._update=Eo(this._update,n);let r=t==="replaceOne";if(r)this._update=new this.model(this._update,null,{skipId:!0});else{if(this._update=this._castUpdate(this._update),this._update==null||Object.keys(this._update).length===0)return{acknowledged:!1};let a=Object.assign({},n,{setDefaultsOnInsert:this._mongooseOptions.setDefaultsOnInsert});this._update=oOe(this._conditions,this.model.schema,this._update,a)}return Array.isArray(n.arrayFilters)&&(n.arrayFilters=KFt(this._update,n.arrayFilters)),QY(this,"runValidators",!1)&&await this.validate(this._update,n,r),this._update.toBSON&&(this._update=this._update.toBSON()),this.mongooseCollection[t](e,this._update,n)}me.prototype.validate=async function(e,n,r){if(typeof arguments[3]=="function")throw new Hi("Query.prototype.validate() no longer accepts a callback");await pOe(this,"validate"),r?await e.$validate():await JFt(this,this.model.schema,e,n),await dOe(this,null,null,"validate")};me.prototype._updateMany=async function(){return eZ.call(this,"updateMany")};me.prototype._updateOne=async function(){return eZ.call(this,"updateOne")};me.prototype._replaceOne=async function(){return eZ.call(this,"replaceOne")};me.prototype.updateMany=function(t,e,n,r){return typeof n=="function"?(r=n,n=void 0):typeof e=="function"?(r=e,e=t,t={},n=void 0):typeof t=="function"?(r=t,t=void 0,e=void 0,n=void 0):typeof t=="object"&&!e&&!n&&!r&&(e=t,t=void 0,n=void 0,r=void 0),tZ(this,"updateMany",t,e,n,r)};me.prototype.updateOne=function(t,e,n,r){return typeof n=="function"?(r=n,n=void 0):typeof e=="function"?(r=e,e=t,t={},n=void 0):typeof t=="function"?(r=t,t=void 0,e=void 0,n=void 0):typeof t=="object"&&!e&&!n&&!r&&(e=t,t=void 0,n=void 0,r=void 0),tZ(this,"updateOne",t,e,n,r)};me.prototype.replaceOne=function(t,e,n,r){return typeof n=="function"?(r=n,n=void 0):typeof e=="function"?(r=e,e=t,t={},n=void 0):typeof t=="function"?(r=t,t=void 0,e=void 0,n=void 0):typeof t=="object"&&!e&&!n&&!r&&(e=t,t=void 0,n=void 0,r=void 0),tZ(this,"replaceOne",t,e,n,r)};function tZ(t,e,n,r,i,a){t.op=e,r=r||{},i!=null&&"strict"in i&&(t._mongooseOptions.strict=i.strict),!(n instanceof me)&&n!=null&&n.toString()!=="[object Object]"?t.error(new O1(n,"filter",e)):t.merge(n);let s=t?.model?.base?.options?.updatePipeline;return s!=null&&(i==null||i.updatePipeline==null)&&(i=i||{},i.updatePipeline=s),Ar.isObject(i)&&t.setOptions(i),t._mergeUpdate(r),a&&t.exec(a),t}me.prototype.transform=function(t){return this._transforms.push(t),this};me.prototype.orFail=function(t){return this.transform(e=>{switch(this.op){case"find":if(e.length===0)throw Qy(t,this);break;case"findOne":if(e==null)throw Qy(t,this);break;case"replaceOne":case"updateMany":case"updateOne":if(e&&e.matchedCount===0)throw Qy(t,this);break;case"findOneAndDelete":case"findOneAndUpdate":case"findOneAndReplace":if(this.options.includeResultMetadata&&e!=null&&e.value==null)throw Qy(t,this);if(!this.options.includeResultMetadata&&e==null)throw Qy(t,this);break;case"deleteMany":case"deleteOne":if(e.deletedCount===0)throw Qy(t,this);break;default:break}return e}),this};function Qy(t,e){return typeof t=="function"&&(t=t.call(e)),t==null&&(t=new NFt(e.getQuery(),e.model.modelName)),t}me.prototype.isPathSelectedInclusive=function(t){return WFt(this._fields,t)};me.prototype.exec=async function(e){if(typeof e=="function"||arguments.length>=2&&typeof arguments[1]=="function")throw new Hi("Query.prototype.exec() no longer accepts a callback");if(this._validateOp(),typeof e=="string"&&(this.op=e),this.op==null)throw new Hi("Query must have `op` before executing");if(this.model==null)throw new Hi("Query must have an associated model before executing");let n=tLt.get(this.op);if(!n)throw new Hi('Query has invalid `op`: "'+this.op+'"');if(this.options&&this.options.sort&&typeof this.options.sort=="object"&&this.options.sort.hasOwnProperty(""))throw new Error('Invalid field "" passed to sort()');if(this._execCount>0){let s=this.toString();throw s.length>60&&(s=s.slice(0,60)+"..."),new Hi("Query was already executed: "+s)}this._execCount++;let r=null;try{await this._hooks.execPre("exec",this,[])}catch(s){if(s instanceof XY.skipWrappedFunction)r=s;else throw s}let i,a=null;try{await pOe(this),i=r?r.args[0]:await this[n]();for(let s of this._transforms)i=s(i)}catch(s){s instanceof XY.skipWrappedFunction?i=s.args[0]:a=s,a=this.model.schema._transformDuplicateKeyError(a)}return i=await dOe(this,i,a),await this._hooks.execPost("exec",this,[]),i};function dOe(t,e,n,r){if(t._queryMiddleware==null){if(n!=null)throw n;return e}let i=n?{error:n}:{};return t._queryMiddleware.execPost(r||t.op,t,[e],i).then(a=>a[0])}function pOe(t,e){if(t._queryMiddleware!=null)return t._queryMiddleware.execPre(e||t.op,t,[])}me.prototype.then=function(t,e){return this.exec().then(t,e)};me.prototype.catch=function(t){return this.exec().then(null,t)};me.prototype.finally=function(t){return this.exec().finally(t)};me.prototype[Symbol.toStringTag]=function(){return`Query { ${this.op} }`};me.prototype.pre=function(t){return this._hooks.pre("exec",t),this};me.prototype.post=function(t){return this._hooks.post("exec",t),this};me.prototype._castUpdate=function(e){let n=this.schema,r=n.options.discriminatorKey,i=n._baseSchema?n._baseSchema:n;if(this._mongooseOptions.overwriteDiscriminatorKey&&e[r]!=null&&i.discriminators){let s=Object.values(i.discriminators).find(o=>o.discriminatorMapping.value===e[r]);s!=null&&(n=s)}let a;return"upsert"in this.options&&(a=this.options.upsert),UFt(n,e,{strict:this._mongooseOptions.strict,upsert:a,arrayFilters:this.options.arrayFilters,overwriteDiscriminatorKey:this._mongooseOptions.overwriteDiscriminatorKey,overwriteImmutable:this._mongooseOptions.overwriteImmutable},this,this._conditions)};me.prototype.populate=function(){let t=Array.from(arguments);if(!t.some(Boolean))return this;let e=Ar.populate.apply(null,t),n=this._mongooseOptions;if(n.lean!=null){let i=n.lean;for(let a of e)(a&&a.options&&a.options.lean)==null&&(a.options=a.options||{},a.options.lean=i)}Ar.isObject(n.populate)||(n.populate={});let r=n.populate;for(let i of e){let a=i.path;r[a]&&r[a].populate&&i.populate&&(i.populate=r[a].populate.concat(i.populate)),r[i.path]=i}return this};me.prototype.getPopulatedPaths=function(){let e=this._mongooseOptions.populate||{},n=Object.keys(e);for(let r of Object.keys(e)){let i=e[r];Array.isArray(i.populate)&&hOe(n,i.populate,r+".")}return n};function hOe(t,e,n){for(let r of e)t.push(n+r.path),Array.isArray(r.populate)&&hOe(t,r.populate,n+r.path+".")}me.prototype.cast=function(t,e){e||(e=this._conditions),t=t||this.model;let n=t.schema.options.discriminatorKey;e!=null&&e.hasOwnProperty(n)&&(t=jFt(t.discriminators,e[n])||t);let r={upsert:this.options&&this.options.upsert};this.options&&("strict"in this.options&&(r.strict=this.options.strict),"strictQuery"in this.options&&(r.strictQuery=this.options.strictQuery)),"sanitizeFilter"in this._mongooseOptions&&(r.sanitizeFilter=this._mongooseOptions.sanitizeFilter);try{return LFt(t.schema,e,r,this)}catch(i){throw typeof i.setModel=="function"&&i.setModel(t),i}};me.prototype._castFields=function(e){let n,r,i,a,s;if(e){i=Object.keys(e),r=[];for(let o=0;o<i.length;++o)a=i[o],e[a].$elemMatch&&(n||(n={}),n[a]=e[a],r.push(a))}if(n){try{s=this.cast(this.model,n)}catch(o){return o}for(let o=0;o<r.length;++o)a=r[o],e[a]=s[a]}return e};me.prototype._applyPaths=function(){if(!this.model)return;this._fields=this._fields||{};let e;this.model!=null&&Ar.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection")?e=this.model.db.options.sanitizeProjection:this.model!=null&&Ar.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection")?e=this.model.base.options.sanitizeProjection:e=this._mongooseOptions.sanitizeProjection,(this._mongooseOptions.schemaLevelProjections??!0)&&B7.applyPaths(this._fields,this.model.schema,e);let r=!0;"selectPopulatedPaths"in this.model.base.options&&(r=this.model.base.options.selectPopulatedPaths),"selectPopulatedPaths"in this.model.schema.options&&(r=this.model.schema.options.selectPopulatedPaths),r&&XFt(this._fields,this._userProvidedFields,this._mongooseOptions.populate)};me.prototype.cursor=function(e){e&&this.setOptions(e);try{this.cast(this.model)}catch(n){return new nOe(this)._markError(n)}return new nOe(this)};me.prototype.tailable=function(t,e){if(t!=null&&typeof t.constructor=="function"&&t.constructor.name==="Object"&&(e=t,t=!0),t===void 0&&(t=!0),e&&typeof e=="object")for(let n of Object.keys(e))n==="awaitData"||n==="awaitdata"?this.options.awaitData=!!e[n]:this.options[n]=e[n];return this.options.tailable=arguments.length?!!t:!0,this};me.prototype.near=function(){let t=[],e=this._mongooseOptions.nearSphere;if(arguments.length===1)if(Array.isArray(arguments[0]))t.push({center:arguments[0],spherical:e});else if(typeof arguments[0]=="string")t.push(arguments[0]);else if(Ar.isObject(arguments[0]))typeof arguments[0].spherical!="boolean"&&(arguments[0].spherical=e),t.push(arguments[0]);else throw new TypeError("invalid argument");else if(arguments.length===2)if(typeof arguments[0]=="number"&&typeof arguments[1]=="number")t.push({center:[arguments[0],arguments[1]],spherical:e});else if(typeof arguments[0]=="string"&&Array.isArray(arguments[1]))t.push(arguments[0]),t.push({center:arguments[1],spherical:e});else if(typeof arguments[0]=="string"&&Ar.isObject(arguments[1]))t.push(arguments[0]),typeof arguments[1].spherical!="boolean"&&(arguments[1].spherical=e),t.push(arguments[1]);else throw new TypeError("invalid argument");else if(arguments.length===3)if(typeof arguments[0]=="string"&&typeof arguments[1]=="number"&&typeof arguments[2]=="number")t.push(arguments[0]),t.push({center:[arguments[1],arguments[2]],spherical:e});else throw new TypeError("invalid argument");else throw new TypeError("invalid argument");return me.base.near.apply(this,t)};me.prototype.nearSphere=function(){return this._mongooseOptions.nearSphere=!0,this.near.apply(this,arguments),this};me.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this.cursor()};me.prototype.box=function(t,e){return!Array.isArray(t)&&Ar.isObject(t)&&(e=t.ur,t=t.ll),me.base.box.call(this,t,e)};me.prototype.center=me.base.circle;me.prototype.centerSphere=function(){arguments[0]!=null&&typeof arguments[0].constructor=="function"&&arguments[0].constructor.name==="Object"&&(arguments[0].spherical=!0),arguments[1]!=null&&typeof arguments[1].constructor=="function"&&arguments[1].constructor.name==="Object"&&(arguments[1].spherical=!0),me.base.circle.apply(this,arguments)};me.prototype.selectedInclusively=function(){return HFt(this._fields)};me.prototype.selectedExclusively=function(){return zFt(this._fields)};me.prototype.model;function I1(t){return t instanceof me||Ar.isObject(t)||t===null}mOe.exports=me});var _Oe=y((Yun,vOe)=>{"use strict";var L7=on(),bOe=Q("stream").Readable,rLt=RY(),iLt=xp(),aLt=Zh(),gOe=Q("util");function So(t){bOe.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this.agg=t,this._transforms=[];let e=t._connection,n=t._model;delete t.options.cursor.useMongooseAggCursor,this._mongooseOptions={},e?(this.cursor=e.db.aggregate(t._pipeline,t.options||{}),setImmediate(()=>this.emit("cursor",this.cursor))):sLt(n,this,t)}gOe.inherits(So,bOe);function sLt(t,e,n){t.collection.buffer?t.collection.emitter.once("queue",function(){t.hooks.execPre("aggregate",n).then(()=>r(null),i=>r(i))}):t.hooks.execPre("aggregate",n).then(()=>r(null),i=>r(i));function r(i){if(i!=null){oLt(e,i);return}typeof n.options?.cursor?.transform=="function"&&e._transforms.push(n.options.cursor.transform),e.cursor=t.collection.aggregate(n._pipeline,n.options||{}),e.emit("cursor",e.cursor)}}function oLt(t,e){if(e instanceof aLt.skipWrappedFunction){let n=e.args[0];if(n!=null&&(!Array.isArray(n)||n.length)){let r=new L7('Cannot `skipMiddlewareFunction()` with a value when using `.aggregate().cursor()`, value must be nullish or empty array, got "'+gOe.inspect(n)+'".');t._markError(r),t.listeners("error").length>0&&t.emit("error",r);return}t.emit("cursor",null);return}t._markError(e),t.listeners("error").length>0&&t.emit("error",e)}So.prototype._read=function(){let t=this;XO(this,function(e,n){if(e)return t.emit("error",e);if(!n){t.push(null),t.cursor.close(function(r){if(r)return t.emit("error",r)});return}t.push(n)})};if(Symbol.asyncIterator!=null){let t="Mongoose does not support using async iterators with an existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation";So.prototype[Symbol.asyncIterator]=function(){throw new L7(t)}}Object.defineProperty(So.prototype,"map",{value:function(t){return this._transforms.push(t),this},enumerable:!0,configurable:!0,writable:!0});So.prototype._markError=function(t){return this._error=t,this};So.prototype.close=async function(){if(typeof arguments[0]=="function")throw new L7("AggregationCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close()}catch(e){throw this.listeners("error").length>0&&this.emit("error",e),e}this.emit("close")};So.prototype._destroy=function(e,n){let r=null;return this.cursor?r=Promise.resolve():r=new Promise(i=>{this.once("cursor",i)}),r.then(()=>this.cursor.close()).then(()=>{this._closed=!0,n()}).catch(i=>{n(i)}),this};So.prototype.next=async function(){if(typeof arguments[0]=="function")throw new L7("AggregationCursor.prototype.next() no longer accepts a callback");return new Promise((e,n)=>{XO(this,(r,i)=>{if(r!=null)return n(r);e(i)})})};So.prototype.eachAsync=function(t,e){if(typeof arguments[2]=="function")throw new L7("AggregationCursor.prototype.eachAsync() no longer accepts a callback");let n=this;return typeof e=="function"&&(e={}),e=e||{},rLt(function(r){return XO(n,r)},t,e)};Symbol.asyncIterator!=null&&(So.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()});So.prototype._transformForAsyncIterator=function(){return this._transforms.indexOf(yOe)===-1&&this.map(yOe),this};So.prototype.transformNull=function(t){return arguments.length===0&&(t=!0),this._mongooseOptions.transformNull=t,this};function yOe(t){return t==null?{done:!0}:{value:t,done:!1}}So.prototype.addCursorFlag=function(t,e){let n=this;return fLt(this,function(){n.cursor.addCursorFlag(t,e)}),this};function fLt(t,e){if(t.cursor)return e();t.once("cursor",function(){e()})}function XO(t,e){let n=e;if(t._transforms.length&&(n=function(r,i){if(r||i===null&&!t._mongooseOptions.transformNull)return e(r,i);e(r,t._transforms.reduce(function(a,s){return s(a)},i))}),t._error)return iLt(function(){n(t._error)});if(t.cursor)return t.cursor.next().then(r=>{if(!r)return n(null,null);n(null,r)},r=>n(r));t.once("error",e),t.once("cursor",function(){XO(t,e)})}vOe.exports=So});var nZ=y((Zun,AOe)=>{"use strict";AOe.exports=function(e,n,r){let i=n&&n.discriminatorMapping;if(r=r||"",i&&!i.isRoot){let a=e,s=(r.length>0?r+".":r)+i.key,o=i.value;if(a[0]!=null&&a[0].$match&&(a[0].$match[s]===void 0||a[0].$match[s]===o))a[0].$match[s]=o;else if(a[0]!=null&&a[0].$geoNear)a[0].$geoNear.query=a[0].$geoNear.query||{},a[0].$geoNear.query[s]=o;else if(a[0]!=null&&a[0].$search)if(a[1]&&a[1].$match!=null)a[1].$match[s]=a[1].$match[s]||o;else{let f={};f[s]=o,a.splice(1,0,{$match:f})}else{let f={};f[s]=o,a.unshift({$match:f})}}}});var EOe=y((Xun,wOe)=>{"use strict";wOe.exports=function t(e){if(Array.isArray(e))for(let n of e){if(n==null)continue;let r=n.$group||n.$bucket||n.$bucketAuto;if(r!=null)for(let a of Object.keys(r))uLt(r[a]);let i=Object.keys(n)[0];if(i&&typeof n[i]=="object"){let a=n[i];for(let s of Object.keys(a))a[s]!=null&&a[s].$function!=null&&typeof a[s].$function.body=="function"&&(a[s].$function.body=a[s].$function.body.toString())}if(n.$facet!=null)for(let a of Object.keys(n.$facet))t(n.$facet[a])}};function uLt(t){if(!(t==null||t.$accumulator==null))for(let e of["init","accumulate","merge","finalize"])typeof t.$accumulator[e]=="function"&&(t.$accumulator[e]=String(t.$accumulator[e]))}});var iZ=y((Jun,OOe)=>{"use strict";var TOe=_Oe(),mm=on(),COe=ZO(),{applyGlobalMaxTimeMS:cLt,applyGlobalDiskUse:lLt}=NY(),dLt=Qr(),pLt=Ds(),rZ=nZ(),hLt=EOe(),SOe=Vt(),{modelSymbol:mLt}=ct(),yLt=COe.prototype.read,bLt=COe.prototype.readConcern,xOe=new Set(["$$DESCEND","$$PRUNE","$$KEEP"]);function bn(t,e){this._pipeline=[],e==null||e[mLt]?this._model=e:this._connection=e,this.options={},arguments.length===1&&Array.isArray(t)&&this.append.apply(this,t)}bn.prototype.options;bn.prototype._optionsForExec=function(){let t=this.options||{},e=this.model()?.db?.base.transactionAsyncLocalStorage?.getStore();return!t.hasOwnProperty("session")&&e?.session!=null&&(t.session=e.session),t};bn.prototype.model=function(t){return arguments.length===0?this._model:(this._model=t,t.schema!=null&&(this.options.readPreference==null&&t.schema.options.read!=null&&(this.options.readPreference=t.schema.options.read),this.options.collation==null&&t.schema.options.collation!=null&&(this.options.collation=t.schema.options.collation)),t)};bn.prototype.append=function(){let t=arguments.length===1&&Array.isArray(arguments[0])?arguments[0]:[...arguments];if(!t.every(gLt))throw new Error("Arguments must be aggregate pipeline operators");return this._pipeline=this._pipeline.concat(t),this};bn.prototype.addFields=function(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error("Invalid addFields() argument. Must be an object");return this.append({$addFields:Object.assign({},t)})};bn.prototype.project=function(t){let e={};if(typeof t=="object"&&!Array.isArray(t))Object.keys(t).forEach(function(n){e[n]=t[n]});else if(arguments.length===1&&typeof t=="string")t.split(/\s+/).forEach(function(n){if(!n)return;let r=n[0]==="-"?0:1;r===0&&(n=n.substring(1)),e[n]=r});else throw new Error("Invalid project() argument. Must be string or object");return this.append({$project:e})};bn.prototype.near=function(t){if(t==null)throw new mm("Aggregate `near()` must be called with non-nullish argument");if(t.near==null)throw new mm("Aggregate `near()` argument must have a `near` property");let e=Array.isArray(t.near)?t.near:t.near.coordinates;if(typeof t.near=="object"&&(!Array.isArray(e)||e.length<2||e.find(r=>typeof r!="number")))throw new mm(`Aggregate \`near()\` argument has invalid coordinates, got "${e}"`);let n={};return n.$geoNear=t,this.append(n)};"group match skip limit out densify fill".split(" ").forEach(function(t){bn.prototype[t]=function(e){let n={};return n["$"+t]=e,this.append(n)}});bn.prototype.unwind=function(){let t=[...arguments],e=[];for(let n of t)if(n&&typeof n=="object")e.push({$unwind:n});else if(typeof n=="string")e.push({$unwind:n[0]==="$"?n:"$"+n});else throw new Error('Invalid arg "'+n+'" to unwind(), must be string or object');return this.append.apply(this,e)};bn.prototype.replaceRoot=function(t){let e;return typeof t=="string"?e=t.startsWith("$")?t:"$"+t:e=t,this.append({$replaceRoot:{newRoot:e}})};bn.prototype.count=function(t){return this.append({$count:t})};bn.prototype.sortByCount=function(t){if(t&&typeof t=="object")return this.append({$sortByCount:t});if(typeof t=="string")return this.append({$sortByCount:t[0]==="$"?t:"$"+t});throw new TypeError('Invalid arg "'+t+'" to sortByCount(), must be string or object')};bn.prototype.lookup=function(t){return this.append({$lookup:t})};bn.prototype.graphLookup=function(t){let e={};if(t){if(!SOe.isObject(t))throw new TypeError("Invalid graphLookup() argument. Must be an object.");SOe.mergeClone(e,t);let n=e.startWith;n&&typeof n=="string"&&(e.startWith=e.startWith.startsWith("$")?e.startWith:"$"+e.startWith)}return this.append({$graphLookup:e})};bn.prototype.sample=function(t){return this.append({$sample:{size:t}})};bn.prototype.sort=function(t){let e={};if(pLt(t)==="Object"){let n=["desc","descending",-1];Object.keys(t).forEach(function(r){if(t[r]instanceof Object&&t[r].$meta){e[r]=t[r];return}e[r]=n.indexOf(t[r])===-1?1:-1})}else if(arguments.length===1&&typeof t=="string")t.split(/\s+/).forEach(function(n){if(!n)return;let r=n[0]==="-"?-1:1;r===-1&&(n=n.substring(1)),e[n]=r});else throw new TypeError("Invalid sort() argument. Must be a string or object.");return this.append({$sort:e})};bn.prototype.unionWith=function(t){return this.append({$unionWith:t})};bn.prototype.read=function(t,e){return yLt.call(this,t,e),this};bn.prototype.readConcern=function(t){return bLt.call(this,t),this};bn.prototype.redact=function(t,e,n){if(arguments.length===3){if(typeof e=="string"&&!xOe.has(e)||typeof n=="string"&&!xOe.has(n))throw new Error("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP");t={$cond:{if:t,then:e,else:n}}}else if(arguments.length!==1)throw new TypeError("Invalid arguments");return this.append({$redact:t})};bn.prototype.explain=async function(e){if(typeof e=="function"||typeof arguments[1]=="function")throw new mm("Aggregate.prototype.explain() no longer accepts a callback");let n=this._model;if(!this._pipeline.length)throw new Error("Aggregate has empty pipeline");rZ(this._pipeline,this._model.schema);try{await n.hooks.execPre("aggregate",this)}catch(a){return await n.hooks.execPost("aggregate",this,[null],{error:a})}let r=n.collection.aggregate(this._pipeline,this.options);e==null&&(e=!0);let i=null;try{i=await r.explain(e)}catch(a){return await n.hooks.execPost("aggregate",this,[null],{error:a})}return await n.hooks.execPost("aggregate",this,[i],{error:null}),i};bn.prototype.allowDiskUse=function(t){return this.options.allowDiskUse=t,this};bn.prototype.hint=function(t){return this.options.hint=t,this};bn.prototype.session=function(t){return t==null?delete this.options.session:this.options.session=t,this};bn.prototype.option=function(t){for(let e in t)this.options[e]=t[e];return this};bn.prototype.cursor=function(t){return this._optionsForExec(),this.options.cursor=t||{},new TOe(this)};bn.prototype.collation=function(t){return this.options.collation=t,this};bn.prototype.facet=function(t){return this.append({$facet:t})};bn.prototype.search=function(t){return this.append({$search:t})};bn.prototype.pipeline=function(){return this._pipeline};bn.prototype.exec=async function(){if(!this._model&&!this._connection)throw new Error("Aggregate not bound to any Model");if(typeof arguments[0]=="function")throw new mm("Aggregate.prototype.exec() no longer accepts a callback");if(this._connection){if(!this._pipeline.length)throw new mm("Aggregate has empty pipeline");return this._optionsForExec(),await(await this._connection.client.db().aggregate(this._pipeline,this.options)).toArray()}let e=this._model,n=this._model.collection;if(cLt(this.options,e.db.options,e.base.options),lLt(this.options,e.db.options,e.base.options),this._optionsForExec(),this.options&&this.options.cursor)return new TOe(this);rZ(this._pipeline,this._model.schema),hLt(this._pipeline);try{await e.hooks.execPre("aggregate",this)}catch(a){return await e.hooks.execPost("aggregate",this,[null],{error:a})}if(!this._pipeline.length)throw new mm("Aggregate has empty pipeline");let r=dLt(this.options||{}),i;try{i=await(await n.aggregate(this._pipeline,r)).toArray()}catch(a){return await e.hooks.execPost("aggregate",this,[null],{error:a})}return await e.hooks.execPost("aggregate",this,[i],{error:null}),i};bn.prototype.then=function(t,e){return this.exec().then(t,e)};bn.prototype.catch=function(t){return this.exec().then(null,t)};bn.prototype.finally=function(t){return this.exec().finally(t)};bn.prototype[Symbol.asyncIterator]=function(){return this.cursor({useMongooseAggCursor:!0}).transformNull()._transformForAsyncIterator()};function gLt(t){if(typeof t!="object"||t===null)return!1;let e=Object.keys(t);return e.length===1&&e[0][0]==="$"}bn._prepareDiscriminatorPipeline=rZ;OOe.exports=bn});var MOe=y((Qun,IOe)=>{"use strict";var vLt=Qr(),JO=class{constructor(e){e!=null&&Object.assign(this,vLt(e))}};JO.prototype.__subdocs=null;IOe.exports=JO});var ROe=y((ecn,POe)=>{"use strict";POe.exports=function t(e,n){let r=Object.keys(n.paths),i=r.length;for(let a=0;a<i;++a){let s="",o=r[a],f=n.paths[o],u=f.splitPath(),c=u.length,d=e;for(let l=0;l<c&&d!=null;++l){let p=u[l];if(s+=(s.length?".":"")+p,l===c-1){if(typeof d[p]<"u"){f.$isSingleNested?t(d[p],f.schema):f.$isMongooseDocumentArray&&Array.isArray(d[p])&&d[p].forEach(v=>t(v,f.schema));break}let h=f.getDefault(e,!1,{skipCast:!0});typeof h<"u"&&(d[p]=h,f.$isSingleNested?t(h,f.schema):f.$isMongooseDocumentArray&&Array.isArray(h)&&h.forEach(v=>t(v,f.schema)))}else d[p]==null&&(d[p]={}),d=d[p]}}}});var sZ=y((tcn,kOe)=>{"use strict";kOe.exports=aZ;function aZ(t,e=new WeakSet,n=!1){if(!e.has(t)){e.add(t);for(let r of Object.keys(t.paths)){let i=t.paths[r];if(i.schema&&(aZ(i.schema,e),!!i.schema._applyDiscriminators&&!(i._appliedDiscriminators&&!n))){for(let a of i.schema._applyDiscriminators.keys()){let{schema:s,options:o}=i.schema._applyDiscriminators.get(a);aZ(s,e),i.discriminator(a,s,n?{...o,overwriteExisting:!0}:o)}i._appliedDiscriminators=!0}}}}});var NOe=y((ncn,DOe)=>{"use strict";DOe.exports=q7;q7.middlewareFunctions=["deleteOne","remove","save","updateOne","validate","init"];var _Lt=new Set(q7.middlewareFunctions.flatMap(t=>[t,`$__${t}`]));function q7(t,e,n){n=n||{};let r={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},i=n.decorateDoc?t:t.prototype;t.$appliedHooks=!0;for(let f of Object.keys(e.paths)){let u=e.paths[f],c=null,d=oZ(u);if(d)c=d.childModel,u=d.type;else continue;if(!c.$appliedHooks&&(q7(c,u.schema,{...n,decorateDoc:!1,isChildSchema:!0}),c.discriminators!=null)){let l=Object.keys(c.discriminators);for(let p of l)q7(c.discriminators[p],c.discriminators[p].schema,n)}}let a=e._getDocumentMiddleware();t._middleware=a,i.$__init=a.createWrapperSync("init",i.$__init,null,r);let s=Object.keys(e.methods),o=Object.assign({},r,{checkForPromise:!0});for(let f of s){if(_Lt.has(f)||!a.hasHooks(f))continue;let u=i[f];i[`$__${f}`]=i[f],i[f]=a.createWrapper(f,u,null,o)}}function oZ(t){if(t.$isSingleNested||t.$isMongooseDocumentArray)return{childModel:t.Constructor,type:t};if(t.instance==="Array"){let e=t.getEmbeddedSchemaType();if(e)return oZ(e)}if(t.instance==="Map"){let e=t.getEmbeddedSchemaType();if(e)return oZ(e)}return null}});var BOe=y((rcn,$Oe)=>{"use strict";var ALt=di(),wLt=Vt();$Oe.exports=function t(e,n){let r=fZ();function i(a,s){Object.defineProperty(e.prototype,a,{get:function(){let o={};for(let f in s.methods[a])o[f]=s.methods[a][f].bind(this);return o},configurable:!0})}for(let a of Object.keys(n.methods)){let s=n.methods[a];if(n.tree.hasOwnProperty(a))throw new Error('You have a method and a property in your schema both named "'+a+'"');if(typeof s=="function"&&r.prototype[a]===s){delete n.methods[a];continue}n.reserved[a]&&!ALt(n,`methodOptions.${a}.suppressWarning`,!1)&&wLt.warn(`mongoose: the method name "${a}" is used by mongoose internally, overwriting it may cause bugs. If you're sure you know what you're doing, you can suppress this error by using \`schema.method('${a}', fn, { suppressWarning: true })\`.`),typeof s=="function"?e.prototype[a]=s:i(a,n)}e.$appliedMethods=!0;for(let a of Object.keys(n.paths)){let s=n.paths[a];s.$isSingleNested&&!s.Constructor.$appliedMethods&&t(s.Constructor,s.schema),s.$isMongooseDocumentArray&&!s.Constructor.$appliedMethods&&t(s.Constructor,s.schema)}}});var qOe=y((icn,LOe)=>{"use strict";var FOe=pG(),ELt=Py(),SLt=zO(),tI=Vt().isPOJO;LOe.exports=function(e,n,r){if(n==null||e==null)return e;let i=null;return SLt(n)?i=!1:ELt(n)&&(i=!0),i==null?e:i?(r=r||FOe(n),QO(e,n,r)):(r=r||FOe(n),eI(e,n,r))};function QO(t,e,n,r,i){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>QO(s,e,n,r,i));let a={...t};r=i?r||{}:e;for(let s of Object.keys(a)){let o=i?i+"."+s:s;e.hasOwnProperty(o)||r.hasOwnProperty(s)?tI(e[o])||tI(r[s])?a[s]=QO(a[s],e,n,r[s],o):delete a[s]:n[o]&&(a[s]=QO(a[s],e,n,r[s],o))}return a}function eI(t,e,n,r,i){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>eI(s,e,n,r,i));let a={...t};r=i?r||{}:e;for(let s of Object.keys(a)){let o=i?i+"."+s:s;if(e.hasOwnProperty(o)||r.hasOwnProperty(s)){(tI(e[o])||tI(r[s]))&&(a[s]=eI(a[s],e,n,r[s],o));continue}else n[o]?a[s]=eI(a[s],e,n,r[s],o):delete a[s]}return a}});var jOe=y((acn,UOe)=>{"use strict";UOe.exports=function(e){let n=!1;for(let r of Object.keys(e))e[r]==="text"&&(n=!0);return n}});var zOe=y((scn,VOe)=>{"use strict";var xLt=jOe();VOe.exports=function(e,n,r){xLt(e)||r.hasOwnProperty("collation")&&!n.hasOwnProperty("collation")&&(n.collation=r.collation)}});var WOe=y((ocn,HOe)=>{"use strict";var{queryMiddlewareFunctions:TLt,aggregateMiddlewareFunctions:CLt,modelMiddlewareFunctions:OLt,documentMiddlewareFunctions:ILt}=o7(),MLt=Array.from(new Set([...TLt,...CLt,...OLt,...ILt]));HOe.exports=function(e,n,r){n=n.filter(i=>MLt.indexOf(i.name)!==-1?!!i.model:i.model!==!1);for(let i of Object.keys(r))if(n.hasHooks(i)){let a=e[i];e[i]=n.createWrapper(i,a)}}});var KOe=y((fcn,GOe)=>{"use strict";GOe.exports=function(e,n){for(let r in n.statics)e[r]=n.statics[r]}});var QOe=y((ucn,JOe)=>{"use strict";var YOe=ZC(),PLt=s0();JOe.exports=ZOe;function ZOe(t,e,n){return e==null?e:(RLt(t,e,n),XOe(t,e,n))}function RLt(t,e,n){for(let r of t.childSchemas){let i=r.model.path,a=r.schema;if(!i)continue;let s=PLt.get(i,e);s==null||Array.isArray(s)&&s.flat(1/0).length===0||ZOe(a,s,n)}}function XOe(t,e,n){if(e==null||typeof e!="object")return;if(Array.isArray(e)){for(let o of e)XOe(t,o,n);return}if(t.discriminators&&Object.keys(t.discriminators).length>0)for(let o of Object.keys(t.discriminators)){let f=t.discriminators[o],u=f.discriminatorMapping.key,c=f.discriminatorMapping.value;if(e[u]==c){t=f;break}}let r=YOe(t.options.timestamps,"createdAt"),i=YOe(t.options.timestamps,"updatedAt"),a=n?.currentTime,s=null;a!=null?s=a():t.base?.now?s=t.base.now():s=new Date,r&&e[r]==null&&!n?.isUpdate&&(e[r]=s),i&&(e[i]=s)}});var nIe=y((ccn,tIe)=>{"use strict";var kLt=s0();tIe.exports=eIe;function eIe(t,e,n){if(e==null)return e;let r=n,i=null;if(Array.isArray(n)){r=[],i=[];for(let a of n)a.length===1?i.push(a[0]):r.push(a)}return DLt(t,e,r),uZ(t,e,i)}function DLt(t,e,n){let r=!1;for(let i of t.childSchemas){let a=i.model.path,s=i.schema;if(!a)continue;let o=kLt.get(a,e);if(o==null||Array.isArray(o)&&o.flat(1/0).length===0)continue;let f=null;if(Array.isArray(n)){f=[];for(let u of n)u[0]==a&&f.push(u.slice(1));if(f.length===0)continue}eIe(s,o,f),r=!0}n&&n.length&&!r&&uZ(t,e,n)}function uZ(t,e,n){if(!(e==null||typeof e!="object")){if(Array.isArray(e)){for(let r of e)uZ(t,r,n);return}if(t.discriminators&&Object.keys(t.discriminators).length>0)for(let r of Object.keys(t.discriminators)){let i=t.discriminators[r],a=i.discriminatorMapping.key,s=i.discriminatorMapping.value;if(e[a]==s){t=i;break}}n==null&&(n=Object.keys(t.virtuals));for(let r of n){if(t.virtuals[r]==null)continue;let i=t.virtuals[r],a=Array.isArray(r)?r:r.indexOf(".")===-1?[r]:r.split("."),s=e;for(let u=0;u<a.length-1;++u)s[a[u]]=a[u]in s?s[a[u]]:{},s=s[a[u]];let o=i.applyGetters(s[a[a.length-1]],e);i.options&&(i.options.ref||i.options.refPath)&&o===void 0&&(i.options.justOne?o=null:o=[]),s[a[a.length-1]]=o}}}});var nI=y((lcn,rIe)=>{"use strict";rIe.exports=function t(e){return this instanceof t?(this.val=e,this):new t(e)}});var U7=y((dcn,iIe)=>{"use strict";iIe.exports=new WeakMap});var fIe=y((pcn,oIe)=>{"use strict";var NLt=Qr(),aIe=U7(),$Lt=ct().modelSymbol,BLt=Vt();oIe.exports=sIe;var rI=Symbol("mongoose#assignRawDocsToIdStructure#hasArray");function sIe(t,e,n,r,i){let a=[],s=r.isVirtual&&r.justOne&&t.length>1?!1:r.sort&&t.length>1,o=r.$nullIfNotFound,f,u,c;BLt.isMongooseArray(t)&&(t=t.__array);let d=0,l=t.length;if(s&&i&&r[rI]===void 0){r[rI]=!1;for(let p in n)if(Array.isArray(n[p])){r[rI]=!0;break}}for(d=0;d<l;++d){if(c=t[d],Array.isArray(c)){sIe(c,e,n,r,!0),a.push(c);continue}if(c===null&&s===!1){a.push(c);continue}if(u=String(c),f=e[u],r.clone&&f!=null)if(r.lean){let p=aIe.get(f);f=NLt(f),aIe.set(f,p)}else f=f.constructor.hydrate(f._doc);if(i)if(f)if(s){let p=n[u];r[rI]?a.push(f):a[p]=f}else a.push(f);else c!=null&&c[$Lt]!=null?a.push(c):a.push(r.retainNullValues||o?null:c);else a[d]=f||null}t.length=0,a.length&&a.forEach(function(p,h){t[h]=p})}});var cZ=y((hcn,uIe)=>{"use strict";uIe.exports=iI;function iI(t,e){if(t.virtuals[e])return{virtual:t.virtuals[e],path:void 0};let n=e.split("."),r="",i="";for(let a=0;a<n.length;++a){if(r+=(r.length>0?".":"")+n[a],t.virtuals[r]){if(a===n.length-1)return{virtual:t.virtuals[r],path:i};continue}if(!t.nested[r]){if(t.paths[r]&&t.paths[r].schema){t=t.paths[r].schema;let s=n.slice(a+1).join(".");if(t.virtuals[s]){if(a===n.length-2)return{virtual:t.virtuals[s],nestedSchemaPath:[i,r].filter(o=>!!o).join(".")};continue}if(a+1<n.length&&t.discriminators)for(let o of Object.keys(t.discriminators)){let f=iI(t.discriminators[o],s);if(f!=null){let u=[i,r,f.nestedSchemaPath].filter(c=>!!c).join(".");return{virtual:f.virtual,nestedSchemaPath:u}}}i+=(i.length>0?".":"")+r,r="";continue}else if(t.paths[r]?.$isSchemaMap&&t.paths[r].$__schemaType?.schema){t=t.paths[r].$__schemaType.schema,++a;let s=n.slice(a+1).join(".");if(t.virtuals[s]){if(a===n.length-2)return{virtual:t.virtuals[s],nestedSchemaPath:[i,r,"$*"].filter(o=>!!o).join(".")};continue}if(a+1<n.length&&t.discriminators)for(let o of Object.keys(t.discriminators)){let f=iI(t.discriminators[o],s);if(f!=null){let u=[i,r,f.nestedSchemaPath,"$*"].filter(c=>!!c).join(".");return{virtual:f.virtual,nestedSchemaPath:u}}}i+=(i.length>0?".":"")+"$*"+r,r=""}if(t.discriminators)for(let s of Object.keys(t.discriminators)){let o=iI(t.discriminators[s],e);if(o)return o}return null}}}});var lIe=y((aI,cIe)=>{(function(t,e){typeof aI=="object"&&typeof cIe<"u"?e(aI):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.sift={}))})(aI,(function(t){"use strict";var e=function(F,z){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,X){H.__proto__=X}||function(H,X){for(var pe in X)Object.prototype.hasOwnProperty.call(X,pe)&&(H[pe]=X[pe])},e(F,z)};function n(F,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");e(F,z);function H(){this.constructor=F}F.prototype=z===null?Object.create(z):(H.prototype=z.prototype,new H)}typeof SuppressedError=="function"&&SuppressedError;var r=function(F){var z="[object "+F+"]";return function(H){return i(H)===z}},i=function(F){return Object.prototype.toString.call(F)},a=function(F){return F instanceof Date?F.getTime():o(F)?F.map(a):F&&typeof F.toJSON=="function"?F.toJSON():F},s=function(F){return F??null},o=r("Array"),f=r("Object"),u=r("Function"),c=function(F,z){return F.hasOwnProperty(z)&&!u(F[z])},d=function(F){return F&&(F.constructor===Object||F.constructor===Array||F.constructor.toString()==="function Object() { [native code] }"||F.constructor.toString()==="function Array() { [native code] }")&&!F.toJSON},l=function(F,z){if(F==null&&F==z||F===z)return!0;if(Object.prototype.toString.call(F)!==Object.prototype.toString.call(z))return!1;if(o(F)){if(F.length!==z.length)return!1;for(var H=0,X=F.length;H<X;H++)if(!l(F[H],z[H]))return!1;return!0}else if(f(F)){if(Object.keys(F).length!==Object.keys(z).length)return!1;for(var pe in F)if(!l(F[pe],z[pe]))return!1;return!0}return!1},p=function(F,z,H,X,pe,ie){var te=z[X];if(o(F)&&isNaN(Number(te))&&!c(F,te)){for(var he=0,fe=F.length;he<fe;he++)if(!p(F[he],z,H,X,he,F))return!1}return X===z.length||F==null?H(F,pe,ie,X===0,X===z.length):p(F[te],z,H,X+1,te,F)},h=(function(){function F(z,H,X,pe){this.params=z,this.owneryQuery=H,this.options=X,this.name=pe,this.init()}return F.prototype.init=function(){},F.prototype.reset=function(){this.done=!1,this.keep=!1},F})(),v=(function(F){n(z,F);function z(H,X,pe,ie){var te=F.call(this,H,X,pe)||this;return te.children=ie,te}return z.prototype.reset=function(){this.keep=!1,this.done=!1;for(var H=0,X=this.children.length;H<X;H++)this.children[H].reset()},z.prototype.childrenNext=function(H,X,pe,ie,te){for(var he=!0,fe=!0,ce=0,le=this.children.length;ce<le;ce++){var Le=this.children[ce];if(Le.done||Le.next(H,X,pe,ie,te),Le.keep||(fe=!1),Le.done){if(!Le.keep)break}else he=!1}this.done=he,this.keep=fe},z})(h),E=(function(F){n(z,F);function z(H,X,pe,ie,te){var he=F.call(this,H,X,pe,ie)||this;return he.name=te,he}return z})(v),M=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.next=function(H,X,pe,ie){this.childrenNext(H,X,pe,ie)},z})(v),D=(function(F){n(z,F);function z(H,X,pe,ie,te){var he=F.call(this,X,pe,ie,te)||this;return he.keyPath=H,he.propop=!0,he._nextNestedValue=function(fe,ce,le,Le,ze){return he.childrenNext(fe,ce,le,Le,ze),!he.done},he}return z.prototype.next=function(H,X,pe){p(H,this.keyPath,this._nextNestedValue,0,X,pe)},z})(v),$=function(F,z){if(F instanceof Function)return F;if(F instanceof RegExp)return function(X){var pe=typeof X=="string"&&F.test(X);return F.lastIndex=0,pe};var H=a(F);return function(X){return z(H,a(X))}},N=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.init=function(){this._test=$(this.params,this.options.compare)},z.prototype.next=function(H,X,pe){(!Array.isArray(pe)||pe.hasOwnProperty(X))&&this._test(H,X,pe)&&(this.done=!0,this.keep=!0)},z})(h),V=function(F,z,H){return new N(F,z,H)},j=function(F){return function(z,H,X,pe){return F(z,H,X,pe)}},K=function(F){return j(function(z,H,X,pe){var ie=typeof a(z),te=F(z);return new N(function(he){var fe=s(he);return typeof a(fe)===ie&&te(fe)},H,X,pe)})},Y=function(F,z,H,X){var pe=X.operations[F];return pe||W(F),pe(z,H,X,F)},W=function(F){throw new Error("Unsupported operation: ".concat(F))},B=function(F,z){for(var H in F)if(z.operations.hasOwnProperty(H)||H.charAt(0)==="$")return!0;return!1},_=function(F,z,H,X,pe){if(B(z,pe)){var ie=x(z,H,pe),te=ie[0],he=ie[1];if(he.length)throw new Error("Property queries must contain only operations, or exact objects.");return new D(F,z,X,pe,te)}return new D(F,z,X,pe,[new N(z,X,pe)])},C=function(F,z,H){z===void 0&&(z=null);var X=H===void 0?{}:H,pe=X.compare,ie=X.operations,te={compare:pe||l,operations:Object.assign({},ie||{})},he=x(F,null,te),fe=he[0],ce=he[1],le=[];return fe.length&&le.push(new D([],F,z,te,fe)),le.push.apply(le,ce),le.length===1?le[0]:new M(F,z,te,le)},x=function(F,z,H){var X=[],pe=[];if(!d(F))return X.push(new N(F,F,H)),[X,pe];for(var ie in F)if(H.operations.hasOwnProperty(ie)){var te=Y(ie,F[ie],F,H);if(te&&!te.propop&&z&&!H.operations[z])throw new Error("Malformed query. ".concat(ie," cannot be matched against property."));te!=null&&X.push(te)}else ie.charAt(0)==="$"?W(ie):pe.push(_(ie.split("."),F[ie],ie,F,H));return[X,pe]},b=function(F){return function(z,H,X){return F.reset(),F.next(z,H,X),F.keep}},w=function(F,z){return z===void 0&&(z={}),b(C(F,null,z))},S=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.init=function(){this._test=$(this.params,this.options.compare)},z.prototype.reset=function(){F.prototype.reset.call(this),this.keep=!0},z.prototype.next=function(H){this._test(H)&&(this.done=!0,this.keep=!1)},z})(h),P=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.init=function(){if(!this.params||typeof this.params!="object")throw new Error("Malformed query. $elemMatch must by an object.");this._queryOperation=C(this.params,this.owneryQuery,this.options)},z.prototype.reset=function(){F.prototype.reset.call(this),this._queryOperation.reset()},z.prototype.next=function(H){if(o(H)){for(var X=0,pe=H.length;X<pe;X++){this._queryOperation.reset();var ie=H[X];this._queryOperation.next(ie,X,H,!1),this.keep=this.keep||this._queryOperation.keep}this.done=!0}else this.done=!1,this.keep=!1},z})(h),I=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.init=function(){this._queryOperation=C(this.params,this.owneryQuery,this.options)},z.prototype.reset=function(){F.prototype.reset.call(this),this._queryOperation.reset()},z.prototype.next=function(H,X,pe,ie){this._queryOperation.next(H,X,pe,ie),this.done=this._queryOperation.done,this.keep=!this._queryOperation.keep},z})(h),A=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.init=function(){},z.prototype.next=function(H){o(H)&&H.length===this.params&&(this.done=!0,this.keep=!0)},z})(h),R=function(F){if(F.length===0)throw new Error("$and/$or/$nor must be a nonempty array")},q=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!1,H}return z.prototype.init=function(){var H=this;R(this.params),this._ops=this.params.map(function(X){return C(X,null,H.options)})},z.prototype.reset=function(){this.done=!1,this.keep=!1;for(var H=0,X=this._ops.length;H<X;H++)this._ops[H].reset()},z.prototype.next=function(H,X,pe){for(var ie=!1,te=!1,he=0,fe=this._ops.length;he<fe;he++){var ce=this._ops[he];if(ce.next(H,X,pe),ce.keep){ie=!0,te=ce.keep;break}}this.keep=te,this.done=ie},z})(h),T=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!1,H}return z.prototype.next=function(H,X,pe){F.prototype.next.call(this,H,X,pe),this.keep=!this.keep},z})(q),L=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.init=function(){var H=this,X=Array.isArray(this.params)?this.params:[this.params];this._testers=X.map(function(pe){if(B(pe,H.options))throw new Error("cannot nest $ under ".concat(H.name.toLowerCase()));return $(pe,H.options.compare)})},z.prototype.next=function(H,X,pe){for(var ie=!1,te=!1,he=0,fe=this._testers.length;he<fe;he++){var ce=this._testers[he];if(ce(H)){ie=!0,te=!0;break}}this.keep=te,this.done=ie},z})(h),be=(function(F){n(z,F);function z(H,X,pe,ie){var te=F.call(this,H,X,pe,ie)||this;return te.propop=!0,te._in=new L(H,X,pe,ie),te}return z.prototype.next=function(H,X,pe,ie){this._in.next(H,X,pe),o(pe)&&!ie?this._in.keep?(this.keep=!1,this.done=!0):X==pe.length-1&&(this.keep=!0,this.done=!0):(this.keep=!this._in.keep,this.done=!0)},z.prototype.reset=function(){F.prototype.reset.call(this),this._in.reset()},z})(h),de=(function(F){n(z,F);function z(){var H=F!==null&&F.apply(this,arguments)||this;return H.propop=!0,H}return z.prototype.next=function(H,X,pe,ie,te){te?pe.hasOwnProperty(X)===this.params&&(this.done=!0,this.keep=!0):(this.done=!0,this.keep=!this.params)},z})(h),Ee=(function(F){n(z,F);function z(H,X,pe,ie){var te=F.call(this,H,X,pe,H.map(function(he){return C(he,X,pe)}),ie)||this;return te.propop=!1,R(H),te}return z.prototype.next=function(H,X,pe,ie){this.childrenNext(H,X,pe,ie)},z})(E),rt=(function(F){n(z,F);function z(H,X,pe,ie){var te=F.call(this,H,X,pe,H.map(function(he){return C(he,X,pe)}),ie)||this;return te.propop=!0,te}return z.prototype.next=function(H,X,pe,ie){this.childrenNext(H,X,pe,ie)},z})(E),qe=function(F,z,H){return new N(F,z,H)},et=function(F,z,H,X){return new S(F,z,H,X)},Vn=function(F,z,H,X){return new q(F,z,H,X)},st=function(F,z,H,X){return new T(F,z,H,X)},tt=function(F,z,H,X){return new P(F,z,H,X)},bi=function(F,z,H,X){return new be(F,z,H,X)},gt=function(F,z,H,X){return new L(F,z,H,X)},wt=K(function(F){return function(z){return z!=null&&z<F}}),ti=K(function(F){return function(z){return z===F||z<=F}}),ut=K(function(F){return function(z){return z!=null&&z>F}}),lt=K(function(F){return function(z){return z===F||z>=F}}),rr=function(F,z,H){var X=F[0],pe=F[1];return new N(function(ie){return a(ie)%X===pe},z,H)},dt=function(F,z,H,X){return new de(F,z,H,X)},Tt=function(F,z,H){return new N(new RegExp(F,z.$options),z,H)},ps=function(F,z,H,X){return new I(F,z,H,X)},It={number:function(F){return typeof F=="number"},string:function(F){return typeof F=="string"},bool:function(F){return typeof F=="boolean"},array:function(F){return Array.isArray(F)},null:function(F){return F===null},timestamp:function(F){return F instanceof Date}},nt=function(F,z,H){return new N(function(X){if(typeof F=="string"){if(!It[F])throw new Error("Type alias does not exist");return It[F](X)}return X!=null?X instanceof F||X.constructor===F:!1},z,H)},ja=function(F,z,H,X){return new Ee(F,z,H,X)},pt=function(F,z,H,X){return new rt(F,z,H,X)},St=function(F,z,H){return new A(F,z,H,"$size")},an=function(){return null},Ct=function(F,z,H){var X;if(u(F))X=F;else if(!process.env.CSP_ENABLED)X=new Function("obj","return "+F);else throw new Error('In CSP mode, sift does not support strings in "$where" condition');return new N(function(pe){return X.bind(pe)(pe)},z,H)},xt=Object.freeze({__proto__:null,$Size:A,$all:pt,$and:ja,$elemMatch:tt,$eq:qe,$exists:dt,$gt:ut,$gte:lt,$in:gt,$lt:wt,$lte:ti,$mod:rr,$ne:et,$nin:bi,$nor:st,$not:ps,$options:an,$or:Vn,$regex:Tt,$size:St,$type:nt,$where:Ct}),ee=function(F,z,H){var X=H===void 0?{}:H,pe=X.compare,ie=X.operations;return C(F,z,{compare:pe,operations:Object.assign({},xt,ie||{})})},J=function(F,z){z===void 0&&(z={});var H=ee(F,null,z);return b(H)};t.$Size=A,t.$all=pt,t.$and=ja,t.$elemMatch=tt,t.$eq=qe,t.$exists=dt,t.$gt=ut,t.$gte=lt,t.$in=gt,t.$lt=wt,t.$lte=ti,t.$mod=rr,t.$ne=et,t.$nin=bi,t.$nor=st,t.$not=ps,t.$options=an,t.$or=Vn,t.$regex=Tt,t.$size=St,t.$type=nt,t.$where=Ct,t.EqualsOperation=N,t.createDefaultQueryOperation=ee,t.createEqualsOperation=V,t.createOperationTester=b,t.createQueryOperation=C,t.createQueryTester=w,t.default=J,Object.defineProperty(t,"__esModule",{value:!0})}))});var pIe=y((mcn,lZ)=>{var dIe=lIe();lZ.exports=dIe.default;Object.assign(lZ.exports,dIe)});var vIe=y((ycn,gIe)=>{"use strict";var FLt=XC(),LLt=nI(),qLt=fIe(),sI=di(),ULt=cZ(),bIe=U7(),hIe=KC(),jLt=_G(),dZ=s0(),mIe=pIe().default,oI=Vt(),{populateModelSymbol:VLt}=ct();gIe.exports=function(e){let n=Object.assign({},sI(e,"allOptions.options.options"),sI(e,"allOptions.options")),r=Object.assign({},e.options,n,{justOne:e.justOne,isVirtual:e.isVirtual});r.$nullIfNotFound=e.isVirtual;let i=e.populatedModel,a=[].concat(e.rawIds);e.allIds=[].concat(e.allIds),qLt(e.rawIds,e.rawDocs,e.rawOrder,r);let s=e.docs,o=e.rawIds,f=e.options,u=e.count&&e.isVirtual,c,d=0;function l(p){if(++d,u)return p;if(p instanceof LLt)return p.val;if(p===void 0)return p;let h=e.allIds[c];if(e.path.endsWith(".$*"))return j7(p,f,r,h);if(e.justOne===!0&&Array.isArray(p)){let v=[];for(let E of p){let M=bIe.get(E);(M==null||M===i)&&v.push(E)}for(;p.length>v.length;)Array.prototype.pop.apply(p,[]);for(let E=0;E<v.length;++E)p[E]=v[E];return j7(p[0],f,r,h)}else{if(e.justOne===!1&&!Array.isArray(p))return j7([p],f,r,h);if(e.justOne===!0&&!Array.isArray(p)&&Array.isArray(h))return j7(p,f,r,p==null?p:h[d-1])}return j7(p,f,r,h)}for(c=0;c<s.length;++c){d=0;let p=e.path.endsWith(".$*")?e.path.slice(0,-3):e.path,h=dZ.get(p,s[c],hIe);if(h==null&&!ULt(e.originalModel.schema,p))continue;let v;u?v=zLt(o[c]):Array.isArray(e.match)?v=Array.isArray(o[c])?o[c].filter(V=>V==null||mIe(e.match[c])(V)):[o[c]].filter(V=>V==null||mIe(e.match[c])(V))[0]:v=o[c];let E=e.originalModel.schema,M=sI(s[c],"$__",null)!=null,D=M?h instanceof Map:oI.isPOJO(h);if(D=D&&sI(E._getSchema(p),"$isSchemaMap"),!e.isVirtual&&D){let V=h instanceof Map?Array.from(h.keys()):Object.keys(h);v=v.reduce((j,K,Y)=>(j.set(V[Y],K),j),new Map)}if(M&&Array.isArray(v))for(let V of v)V!=null&&V.$__!=null&&(V.$__.parent=s[c]);else M&&v!=null&&v.$__!=null&&(v.$__.parent=s[c]);if(e.isVirtual&&M){s[c].$populated(p,e.justOne?a[0]:a,e.allOptions),Array.isArray(v)&&(v=v.map(V=>V??void 0)),dZ.set(p,v,s[c],function(j,K,Y){return arguments.length>=3?(j[K]=Y,j[K]):j instanceof Map&&K==="$*"?[...j.values()]:j[K]},l,!1);continue}let $=p.split("."),N=s[c];for(let V=0;V<$.length-1&&!(Array.isArray(N)&&!oI.isArrayIndex($[V])||$[V]==="$*");++V){if(N[$[V]]==null){let j=$.slice(0,V+1).join("."),K=E._getSchema(j);if(v==null&&K!=null&&K.$isMongooseArray)break;N[$[V]]={}}if(N=N[$[V]],typeof N!="object")break}s[c].$__&&(e.allOptions.options[VLt]=e.allOptions.model,s[c].$populated(p,e.unpopulatedValues[c],e.allOptions.options),v!=null&&v.$__!=null&&(v.$__.wasPopulated={value:e.unpopulatedValues[c]}),v instanceof Map&&!v.$isMongooseMap&&(v=new FLt(v,p,s[c],s[c].schema.path(p).$__schemaType))),dZ.set(p,v,s[c],hIe,l,!1),s[c].$__&&jLt(s[c],[e.allOptions.options])}};function zLt(t){return Array.isArray(t)?t.some(e=>Array.isArray(e)||e===null)?t.map(e=>e==null?0:Array.isArray(e)?e.filter(n=>n!=null).length:1):t.filter(e=>e!=null).length:t==null?0:1}function j7(t,e,n,r){let i=typeof n.transform=="function",a=i?n.transform:s=>s;if(Array.isArray(t)){let s=[],o=t.length;for(let c=0;c<o;++c){let d=t[c],l=Array.isArray(r)?r[c]:r;if(!(!pZ(d)&&(!n.retainNullValues||d!=null)&&!i)){{if(!n.retainNullValues&&d==null)continue;i&&(d=a(pZ(d)?d:null,l))}if(yIe(d,e),s.push(d),e.originalLimit&&s.length>=e.originalLimit)break}}let f=s.length;for(;t.length>f;)Array.prototype.pop.apply(t,[]);let u=0;if(oI.isMongooseArray(t))for(u=0;u<f;++u)t.set(u,s[u],!0);else for(u=0;u<f;++u)t[u]=s[u];return t}return pZ(t)||oI.isPOJO(t)?(yIe(t,e),a(t,r)):t instanceof Map?t:n.justOne===!1?[]:t==null?a(t,r):a(null,r)}function yIe(t,e){t!=null&&e.excludeId&&(typeof t.$__setValue=="function"?delete t._doc._id:delete t._id)}function pZ(t){return t==null?!1:Array.isArray(t)||t.$isMongooseMap||t.$__!=null||bIe.has(t)}});var EIe=y((bcn,wIe)=>{"use strict";var HLt=nI(),WLt=wG(),{trusted:fI}=Sy(),_Ie=WO();wIe.exports=function(e,n,r,i,a){let s=GLt(n);if(r.size===1){let o=Array.from(r)[0],f=i.schema.path(o);if(o!=="_id"||!s._id)e=AIe(e,f,a),s[o]=fI({$in:e});else if(o==="_id"&&s._id){let c=_Ie(s[o])?s[o]:{$eq:s[o]};s[o]={...fI({$in:e}),...c}}let u=WLt(o);for(let c=0;c<u.length-1;++c){let d=u[c];if(s[d]!=null&&s[d].$elemMatch!=null){s[d].$elemMatch[o.slice(d.length+1)]=fI({$in:e}),delete s[o];break}}}else{let o=[];Array.isArray(s.$or)?(s.$and=[{$or:s.$or},{$or:o}],delete s.$or):s.$or=o;for(let f of r)if(f!=="_id"||!s._id){let u=i.schema.path(f);e=AIe(e,u,a),o.push({[f]:{$in:e}})}else if(f==="_id"&&s._id){let u=_Ie(s[f])?s[f]:{$eq:s[f]};s[f]={...fI({$in:e}),...u}}}return s};function AIe(t,e,n){return t=t.filter(r=>!(r instanceof HLt)),n?t.filter(r=>{try{return e.cast(r),!0}catch{return!1}}):t}function GLt(t){return Array.isArray(t)?t.length>1?{$or:[].concat(t.map(e=>Object.assign({},e)))}:Object.assign({},t[0]):Object.assign({},t)}});var xIe=y((gcn,SIe)=>{"use strict";SIe.exports=function(e,n,r){if(e.length===0)return r();let i=e.length,a=null;for(let s of e)n(s,function(o){if(a==null){if(o!=null)return a=o,r(a);if(--i<=0)return r()}})}});var IIe=y((vcn,OIe)=>{"use strict";var TIe=Oy(),KLt=di(),YLt=W0(),CIe=U7(),tb=s0(),ZLt=ct().populateModelSymbol;OIe.exports=function t(e,n,r,i){let a=n.path(i),s=r;if(a)return a;let o=n.discriminatorMapping&&n.discriminatorMapping.key;if(o&&e!=null){if(r!=null&&r[o]!=null){let c=YLt(e.discriminators,r[o]);n=c?c.schema:n}else if(e.discriminators!=null)return Object.keys(e.discriminators).reduce((c,d)=>{let l=e.discriminators[d];return c.concat(t(l,l.schema,null,i))},[])}function f(c,d,l,p){let h=c.length+1,v,E;for(;h--;){if(E=c.slice(0,h).join("."),v=d.path(E),v==null)continue;if(v.embeddedSchemaType||v.schema){if(v.embeddedSchemaType instanceof TIe)return v.embeddedSchemaType;let $=null;if(v.schema!=null&&v.schema.discriminators!=null){let N=v.schema.discriminators,V=E+"."+v.schema.options.discriminatorKey,j=l?tb.get(V,l)||[]:[];$=Object.keys(N).reduce(function(K,Y){let W=N[Y].discriminatorMapping.value;return(r==null||j.indexOf(Y)!==-1||j.indexOf(W)!==-1)&&K.push(N[Y]),K},[])}if(h!==c.length&&v.schema){let N;if(c[h]==="$")return h+1===c.length?v:(N=f(c.slice(h+1),d,l?tb.get(E,l):null,p.concat(c.slice(0,h))),N&&(N.$parentSchemaDocArray=N.$parentSchemaDocArray||(v.schema.$isSingleNested?null:v)),N);if($!=null&&$.length>0){N=[];for(let V of $){let j=f(c.slice(h),V,l?tb.get(E,l):null,p.concat(c.slice(0,h)));j!=null&&(j.$parentSchemaDocArray=j.$parentSchemaDocArray||(v.schema.$isSingleNested?null:v),j.$parentSchemaDocArray&&(N.$parentSchemaDocArray=j.$parentSchemaDocArray),N.push(j))}return N}else return N=f(c.slice(h),v.schema,l?tb.get(E,l):null,p.concat(c.slice(0,h))),N&&(N.$parentSchemaDocArray=N.$parentSchemaDocArray||(v.schema.$isSingleNested?null:v)),N}else if(h!==c.length&&v.$isMongooseArray&&v.embeddedSchemaType.$isMongooseArray){let N=v;for(;N.$isMongooseArray&&!N.$isMongooseDocumentArray;)N=N.embeddedSchemaType;let V=f(c.slice(h),N.schema,null,p.concat(c.slice(0,h)));if(V!=null)return V;if(N.schema.discriminators){let j=[];for(let K of Object.keys(N.schema.discriminators)){let Y=N.schema.discriminators[K]||N.schema,W=f(c.slice(h),Y,null,p.concat(c.slice(0,h)));W!=null&&j.push(W)}if(j.length>0)return j}}}else if(v.$isSchemaMap&&v.$__schemaType instanceof TIe)return v.$__schemaType;let M=p.concat([E]).join(".");if(s!=null&&s.$__&&s.$populated(M,!0)&&h<c.length){let $=s.$populated(M,!0).options[ZLt];if($!=null)return f(c.slice(h),$.schema,l?tb.get(E,l):null,p.concat(c.slice(0,h)))}let D=KLt(s,E);if(D!=null){let $=Array.isArray(D)&&D.length>0?CIe.get(D[0]):CIe.get(D),N=$!=null?$.schema:null;if(N!=null){let V=f(c.slice(h),N,l?tb.get(E,l):null,p.concat(c.slice(0,h)));if(V!=null)return V.$parentSchemaDocArray=V.$parentSchemaDocArray||(N.$isSingleNested?null:N),V}}return v}}let u=i.split(".");for(let c=0;c<u.length;++c)u[c]==="$"&&(u[c]="0");return f(u,n,r,[])}});var NIe=y((_cn,DIe)=>{"use strict";var vZ=i0(),XLt=nI(),JLt=Qr(),Y0=di(),QLt=W0(),eqt=Ds(),MIe=IIe(),tqt=cZ(),V7=KC(),ym=s0(),uI=XG(),La=Vt(),yZ=ct().modelSymbol,hZ=ct().populateModelSymbol,bZ=Qh().schemaMixedSymbol,nqt=oG();DIe.exports=function(e,n,r){let i,a=n.length,s=[],o=r.model&&r.model.modelName||r.model,f,u,c,d={},l=e.schema;if(r._localModel!=null&&r._localModel.schema.nested[r.path])return[];let p=tqt(e.schema,r.path);if((p==null?null:p.virtual)!=null)return rqt(e,n,r,p);let v=MIe(e,l,null,r.path);if(v=Array.isArray(v)?v:[v].filter(D=>D!=null),!(r.strictPopulate===!1||r.options?.strictPopulate===!1)&&v.length===0&&r._localModel!=null)return new nqt(r._fullPath||r.path);for(let D=0;D<a;D++){i=n[D];let $=null;if(i.$__!=null&&i.populated(r.path)&&(r.forceRepopulate!=null?r.forceRepopulate:i.constructor.base.options.forceRepopulate)===!1)continue;let N=i!=null&&i.$__!=null?i.$__schema:l;if(f=MIe(e,N,i,r.path),f!=null&&f.$isMongooseDocumentArray&&f.options.ref==null&&f.options.refPath==null)continue;if(f&&f.$parentSchemaDocArray&&Y0(r,"options.sort")!=null)return new vZ("Cannot populate with `sort` on path "+r.path+" because it is a subproperty of a document array");c=null;let j=!1,K=null,Y=null,W=null;if(f!=null&&f.instance==="Embedded"){if(f.options.ref){let P={localField:r.path+"._id",foreignField:"_id",justOne:!0},I=M(i,f,o,e),A=ym.get(r.path,i),R=ym.get("_id",A);gZ(e,s,d,I.modelNames,r,P,R,i,Y,A)}continue}if(Array.isArray(f)){let P=f;for(let I of P){let A,R;try{R=M(i,I,o,e),A=R.modelNames,j=j||R.isRefPath,K=K||R.refPath,$=R.justOne}catch(q){return q}if(!(j&&!R.isRefPath)&&A){c=c||[];for(let q of A)c.indexOf(q)===-1&&c.push(q)}}}else{try{let P=M(i,f,o,e);c=P.modelNames,j=P.isRefPath,K=K||P.refPath,$=P.justOne,Y=Y0(f,"options.populate",null),j&&(W=c,c=Array.from(new Set(c)))}catch(P){return P}if(!c)continue}let B={},_=r.path,C="_id";if("justOne"in r&&r.justOne!==void 0?$=r.justOne:f&&!f[bZ]&&(r.path.endsWith("."+f.path)||r.path===f.path)&&($=Array.isArray(f)?f.every(P=>!P.$isMongooseArray):!f.$isMongooseArray),!c)continue;B.isVirtual=!1,B.justOne=$,B.localField=_,B.foreignField=C;let x=RIe(i,_,e,r,null,f),b=String(La.getValue(C,i));r._docs[b]=Array.isArray(x)?x.slice():x;let w=Y0(r,"match",null),S=typeof w=="function";S&&(w=w.call(i,i)),AZ(w),B.match=w,B.hasMatchFunction=S,B.isRefPath=j,B.modelNamesInOrder=W,j&&(c=iqt(i,l,B,r,K,x)||c);try{gZ(e,s,d,c,r,B,x,i,Y)}catch(P){return P}}return s;function M(D,$,N,V){let j,K=!1,Y=null,W=$;$&&$.instance==="Array"&&($=$.embeddedSchemaType),$&&$.$isSchemaMap&&($=$.$__schemaType);let B=$&&$.options&&$.options.ref;if(u=$&&$.options&&$.options.refPath,$!=null&&$[bZ]&&!B&&!u&&!N)return{modelNames:null};if(N)j=[N];else if(u!=null){if(typeof u=="function"){let _=r.path.slice(0,r.path.length-$.path.length-1),C=ym.get(_,D,V7),x=Array.isArray(C)?La.array.flatten(C):C?[C]:[];j=new Set;for(let b of x)u=u.call(b,b,r.path),uI(u,D,r.path,l,r._queryProjection).forEach(w=>j.add(w));j=Array.from(j)}else j=uI(u,D,r.path,l,r._queryProjection);K=!0}else{let _,C,x,b,w=V,S=V.schema.options.discriminatorKey;if(!$&&S&&(b=La.getValue(S,D))){let P=QLt(V.discriminators,b)||V;if(P!=null)w=P;else try{w=_Z(V.db,b)}catch(I){return I}x=w.schema._getSchema(r.path),x&&x.embeddedSchemaType&&(x=x.embeddedSchemaType)}else x=$;if(W&&W.path.endsWith(".$*")?Y=!W.$isMongooseArray&&!W._arrayPath:x!=null&&(Y=!x.$isMongooseArray&&!x._arrayPath),(_=Y0(x,"options.ref"))!=null)if(x!=null&&typeof _=="function"&&r.path.endsWith("."+x.path)){j=new Set;let P=r.path.slice(0,r.path.length-x.path.length-1),I=ym.get(P,D,V7),A=Array.isArray(I)?La.array.flatten(I):I?[I]:[];for(let R of A)j.add(mZ(_,R));A.length===0?j=[mZ(_,D)]:j=Array.from(j)}else _=mZ(_,D),j=[_];else if((x=Y0($,"options.refPath"))!=null)if(K=!0,typeof C=="function"){let P=r.path.slice(0,r.path.length-x.path.length-1),I=ym.get(P,D,V7),A=Array.isArray(I)?La.array.flatten(I):I?[I]:[];j=new Set;for(let R of A)C=C.call(R,R,r.path),uI(C,D,r.path,l,r._queryProjection).forEach(q=>j.add(q));j=Array.from(j)}else j=uI(C,D,r.path,l,r._queryProjection)}if(!j)if(r._localModel==null)j=[V.modelName];else return{modelNames:j,justOne:Y,isRefPath:K,refPath:u};return Array.isArray(j)||(j=[j]),{modelNames:j,justOne:Y,isRefPath:K,refPath:u}}};function rqt(t,e,n,r){let i=[],a={},s=r.virtual;for(let o of e){let f=null,u={},c,d=r.nestedSchemaPath?r.nestedSchemaPath+".":"";typeof n.localField=="string"?c=n.localField:typeof s.options.localField=="function"?c=d+s.options.localField.call(o,o):Array.isArray(s.options.localField)?c=s.options.localField.map(D=>d+D):c=d+s.options.localField,u.count=s.options.count,s.options.skip!=null&&!n.hasOwnProperty("skip")&&(n.skip=s.options.skip),s.options.limit!=null&&!n.hasOwnProperty("limit")&&(n.limit=s.options.limit),s.options.perDocumentLimit!=null&&!n.hasOwnProperty("perDocumentLimit")&&(n.perDocumentLimit=s.options.perDocumentLimit);let l=s.options.foreignField;if(!c||!l)return new vZ(`Cannot populate virtual \`${n.path}\` on model \`${t.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`);typeof c=="function"&&(c=c.call(o,o)),typeof l=="function"&&(l=l.call(o,o)),u.isRefPath=!1;let p=null;if("justOne"in n&&n.justOne!==void 0&&(p=n.justOne),r.nestedSchemaPath&&typeof s.options.ref=="function"){let D=La.getValue(r.nestedSchemaPath,o);f=Array.isArray(D)?D.flatMap($=>s._getModelNamesForPopulate($)):s._getModelNamesForPopulate(D)}else f=s._getModelNamesForPopulate(o);s.options.refPath?(p=!!s.options.justOne,u.isRefPath=!0):s.options.ref&&(p=!!s.options.justOne),u.isVirtual=!0,u.virtual=s,u.justOne=p;let h=Y0(u,"virtual.options.match",null)||Y0(u,"virtual.options.options.match",null),v=Y0(n,"match",null)||h,E=typeof v=="function";if(E&&(v=v.call(o,o,u.virtual)),Array.isArray(c)&&Array.isArray(l)&&c.length===l.length){v=Object.assign({},v);for(let D=1;D<c.length;++D)v[l[D]]=kIe(ym.get(c[D],o,V7),t.schema),E=!0;c=c[0],l=l[0]}u.localField=c,u.foreignField=l,u.match=v,u.hasMatchFunction=E,AZ(v);let M=RIe(o,c,t,n,s);try{gZ(t,i,a,f,n,u,M,o)}catch(D){return D}}return i}function gZ(t,e,n,r,i,a,s,o,f,u){let c=i.connection!=null?i.connection:t.db;if(u=u===void 0?s:u,Array.isArray(u)&&(u=La.cloneArrays(u)),r==null)return;let d=La.array.flatten(r),l=d.length;for(;l--;){let p=d[l];if(p==null)continue;let h;if(i.model&&i.model[yZ])h=i.model;else if(p[yZ])h=p,p=h.modelName;else try{h=_Z(c,p)}catch(D){if(s!==void 0)throw D;h=null}let v=s,E=a.modelNamesInOrder?a.modelNamesInOrder:r;a.isRefPath&&Array.isArray(s)&&s.length===E.length&&(v=PIe(s,E,p));let M=i.perDocumentLimit==null?Y0(i,"options.perDocumentLimit",null):i.perDocumentLimit;if(!n[p]||M!=null){let D={model:h};a.isVirtual&&Y0(a.virtual,"options.options")?D.options=JLt(a.virtual.options.options):f!=null&&(D.options=Object.assign({},f)),La.merge(D,i),i[hZ]=h,D[hZ]=h,n[p]={model:h,options:D,match:a.hasMatchFunction?[a.match]:a.match,docs:[o],ids:[v],allIds:[s],unpopulatedValues:[u],localField:new Set([a.localField]),foreignField:new Set([a.foreignField]),justOne:a.justOne,isVirtual:a.isVirtual,virtual:a.virtual,count:a.count,[hZ]:h},e.push(n[p])}else n[p].localField.add(a.localField),n[p].foreignField.add(a.foreignField),n[p].docs.push(o),n[p].ids.push(v),n[p].allIds.push(s),n[p].unpopulatedValues.push(u),a.hasMatchFunction&&n[p].match.push(a.match)}}function _Z(t,e){return t.models[e]==null&&t._parent!=null?_Z(t._parent,e):t.model(e)}function PIe(t,e,n){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(e)?t.flatMap((r,i)=>PIe(r,e[i],n)):[]:e===n?Array.isArray(t)?La.array.flatten(t):[t]:[]}function mZ(t,e){return typeof t=="function"&&!t[yZ]?t.call(e,e):t}function RIe(t,e,n,r,i,a){let s=n.schema._getPathType(e),o=s==="real"?n.schema.path(e):s.schema,f=o&&o.getters?o.getters:[];e=o!=null&&o.instance==="Embedded"?e+"._id":e;let u=Y0(r,"options",{}),c="getters"in u?u.getters:Y0(i,"options.getters",!1);if(f.length!==0&&c){let d=t.$__!=null?t:n.hydrate(t),l=La.getValue(e,t);if(Array.isArray(l)){let p=La.getValue(e.split(".").slice(0,-1),d);return l.map((h,v)=>o.applyGetters(h,p[v]))}else return o.applyGetters(l,d)}else return kIe(ym.get(e,t,V7),a)}function kIe(t,e){if(t!=null&&t.$__!=null)return t._doc._id;if(t!=null&&t._id!=null&&(e==null||!e.$isSchemaMap))return t._id;if(Array.isArray(t)){let n=t.__array!=null?t.__array:t;for(let r=0;r<n.length;++r)n[r]!=null&&n[r].$__!=null&&(n[r]=n[r]._doc._id);return La.isMongooseArray(t)&&t.$schema()?t.$schema()._castForPopulate(t,t.$parent()):[].concat(t)}if(eqt(t)==="Object"&&(e==null||e[bZ]==null)){let n=[];for(let r of Object.keys(t))n.push(t[r]);return n}return t instanceof Map?Array.from(t.values()):t}function iqt(t,e,n,r,i,a){if(!n.isRefPath||i==null)return;let s=i.split("."),o="",f;for(let u=0;u<s.length;++u){let c=s[u];o=o+(o.length===0?"":".")+c;let d=e.path(o);if(d!=null&&d.$isMongooseDocumentArray&&d.Constructor.discriminators!=null&&Object.keys(d.Constructor.discriminators).length!==0){let l=La.getValue(o,t),p=r.path.substring(o.length+1),h=d.Constructor.schema.options.discriminatorKey;f=[];for(let v of l){let E=La.getValue(h,v),M=d.Constructor.discriminators[E],D=M&&M.schema;if(D==null)continue;let $=D.path(p);if($==null||$.options.refPath==null){let V=La.getValue(n.localField.substring(o.length+1),v);a.forEach((j,K)=>{j===V&&(a[K]=XLt(j))});continue}let N=La.getValue(s.slice(u+1).join("."),v);f.push(N)}}}return f}function AZ(t){if(t!=null&&typeof t=="object")for(let e of Object.keys(t)){if(e==="$where")throw new vZ("Cannot use $where filter with populate() match");t[e]!=null&&typeof t[e]=="object"&&AZ(t[e])}}});var BIe=y((Acn,$Ie)=>{"use strict";var aqt=di();$Ie.exports=function(e){if(Array.isArray(e)){let r=Object.keys(e[0]);return r.length===1&&r[0]==="_id"&&e[0]._id!=="hashed"}if(typeof e!="object")return!1;let n=aqt(e,"key",{});return Object.keys(n).length===1&&n.hasOwnProperty("_id")}});var qIe=y((wcn,LIe)=>{"use strict";var cI=di(),FIe=Vt();LIe.exports=function(e,n,r){if(r.textIndexVersion!=null){delete r.key._fts,delete r.key._ftsx;let o={...r.weights,...r.key};if(Object.keys(o).length!==Object.keys(e).length)return!1;for(let f of Object.keys(o)){if(!(f in e))return!1;let u=o[f];if(u!==cI(n,"weights."+f)&&!(u===1&&cI(n,"weights."+f)==null))return!1}return n.default_language!==r.default_language?r.default_language==="english"&&n.default_language==null:!0}let i=["unique","partialFilterExpression","sparse","expireAfterSeconds","collation"];for(let o of i)if(!(!(o in n)&&!(o in r))){if(o==="collation"){if(n[o]==null||r[o]==null)return n[o]==null&&r[o]==null;let f=Object.keys(n.collation),u=n.collation,c=r.collation;for(let d of f)if(cI(u,d)!==cI(c,d))return!1}else if(!FIe.deepEqual(n[o],r[o]))return!1}let a=Object.keys(e),s=Object.keys(r.key);if(a.length!==s.length)return!1;for(let o=0;o<a.length;++o)if(a[o]!==s[o]||!FIe.deepEqual(e[a[o]],r.key[s[o]]))return!1;return!0}});var jIe=y((Ecn,UIe)=>{"use strict";UIe.exports=function(e,n){if(n.timeseries==null)return!1;let{timeField:r,metaField:i}=n.timeseries;return typeof r!="string"||typeof i!="string"?!1:Object.keys(e.key).length===2&&e.key[r]===1&&e.key[i]===1}});var WIe=y((Scn,HIe)=>{"use strict";var sqt=WO();function oqt(t,e){return zIe({baseModelName:t.baseModelName,discriminatorMapping:t.schema.discriminatorMapping,indexes:e,indexesType:"schema"})}function fqt(t,e){return zIe({baseModelName:t.baseModelName,discriminatorMapping:t.schema.discriminatorMapping,indexes:e,indexesType:"db"})}HIe.exports={getRelatedSchemaIndexes:oqt,getRelatedDBIndexes:fqt};function zIe({baseModelName:t,discriminatorMapping:e,indexes:n,indexesType:r}){let i=e&&e.key,a=e&&e.value;return i?t?n.filter(o=>{let f=VIe(o,r);return f&&f[i]===a}):n.filter(o=>{let f=VIe(o,r);return!f||!f[i]||sqt(f[i])&&!("$eq"in f[i])}):n}function VIe(t,e){if(e==="schema"){let n=t[1];return n&&n.partialFilterExpression}return t.partialFilterExpression}});var KIe=y((xcn,GIe)=>{"use strict";GIe.exports=uqt;async function uqt(t,e,n){if(n<=0)throw new Error("Limit must be positive");if(t.length===0)return[];let r=[],i=new Set;for(let a=0;a<t.length;a++){let s=t[a],o=e(s,a);r.push(o),i.add(o);let f=()=>i.delete(o);o.then(f).catch(f),i.size>=n&&await Promise.race(i)}return Promise.all(r)}});var ZIe=y((Tcn,YIe)=>{"use strict";YIe.exports=function t(e,n,r){if(n!=null)for(let i=0;i<n.length;++i)Array.isArray(n[i])?t(e,n[i],r+"."+i):e.push(r+"."+i)}});var tMe=y((Ccn,eMe)=>{"use strict";var XIe=di(),JIe=s0(),QIe=KY();eMe.exports=function(e,n,r){let i=QIe(XIe(n,"select",null),!0)||QIe(XIe(n,"options.select",null),!0);if(i!=null){for(let a of e)if(i.hasOwnProperty("-"+a))for(let s of r)s.$__!=null?JIe.unset(a,s._doc):JIe.unset(a,s)}}});var fZ=y((_Me,AMe)=>{"use strict";var cqt=iZ(),lqt=YW(),Tl=El(),dqt=iC(),EZ=Q("events").EventEmitter,W7=Zh(),pI=fY(),Yt=i0(),pqt=wC(),hqt=rG(),lI=ZO(),mqt=MOe(),SZ=im(),dI=Jh(),cMe=tG(),nMe=nG(),yqt=SC(),bqt=ROe(),gqt=sZ(),vqt=NOe(),lMe=BOe(),_qt=qOe(),Aqt=$Y(),dMe=zOe(),wqt=WOe(),pMe=KOe(),Eqt=QOe(),hMe=BY(),Sqt=nIe(),xqt=vIe(),Tqt=EY(),M1=Qr(),Cqt=EIe(),mMe=AY(),wZ=lY(),yMe=IC(),Oqt=bO(),Iqt=xIe(),G7=di(),Mqt=Ds(),z7=W0(),Pqt=NIe(),rMe=xp(),TZ=oc().internalToObjectOptions,CZ=BIe(),bMe=qIe(),Rqt=jIe(),{getRelatedDBIndexes:kqt,getRelatedSchemaIndexes:Dqt}=WIe(),OZ=QG(),Nqt=PC(),$qt=U7(),Bqt=KIe(),Fqt=nZ(),gMe=ZIe(),Lqt=tMe(),qqt=hY(),iMe=Q("util"),wr=Vt(),Uqt=AG(),jqt=iG(),Vqt=_C(),bm=SY(),gm=Symbol("mongoose#Model#collection"),vm=Symbol("mongoose#Model#db"),vMe=ct().modelSymbol,H7=Symbol("mongoose#Model#subclassed"),{VERSION_INC:hI,VERSION_WHERE:aMe,VERSION_ALL:zqt}=Tl,Hqt=Object.assign({},TZ,{bson:!0});function Se(t,e,n){if(e instanceof SZ)throw new TypeError("2nd argument to `Model` constructor must be a POJO or string, **not** a schema. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");if(typeof t=="string")throw new TypeError("First argument to `Model` constructor must be an object, **not** a string. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");Tl.call(this,t,e,n)}Object.setPrototypeOf(Se.prototype,Tl.prototype);Se.prototype.$isMongooseModelPrototype=!0;Se.prototype.db;Se.useConnection=function(e){if(!e)throw new Error("Please provide a connection.");this.db&&(delete this.db.models[this.modelName],delete this.prototype.db,delete this.prototype[vm],delete this.prototype.collection,delete this.prototype.$collection,delete this.prototype[gm]),this.db=e;let n=e.collection(this.collection.collectionName,e.options);return this.prototype.collection=n,this.prototype.$collection=n,this.prototype[gm]=n,this.prototype.db=e,this.prototype[vm]=e,this.collection=n,this.$__collection=n,e.models[this.modelName]=this,this};Se.prototype.collection;Se.prototype.$__collection;Se.prototype.modelName;Se.prototype.$where;Se.prototype.baseModelName;Se.events;Se._middleware;function xZ(t,e){if(t.$where!=null)for(let n of Object.keys(t.$where))e[n]=t.$where[n]}function Wqt(t,e){let n={};hMe(t.$__schema,e),typeof e.writeConcern<"u"?(n.writeConcern={},"w"in e.writeConcern&&(n.writeConcern.w=e.writeConcern.w),"j"in e.writeConcern&&(n.writeConcern.j=e.writeConcern.j),"wtimeout"in e.writeConcern&&(n.writeConcern.wtimeout=e.writeConcern.wtimeout)):("w"in e&&(n.w=e.w),"j"in e&&(n.j=e.j),"wtimeout"in e&&(n.wtimeout=e.wtimeout)),"checkKeys"in e&&(n.checkKeys=e.checkKeys);let r=t.$session(),i=t[vm].base.transactionAsyncLocalStorage?.getStore();return r!=null?n.session=r:!e.hasOwnProperty("session")&&i?.session!=null&&(n.session=i.session),n}Se.prototype.$__save=async function(e){try{await this._execDocumentPreHooks("save",e)}catch(s){await this._execDocumentPostHooks("save",s);return}let n=null,r=null;try{let s=Wqt(this,e);if(this.$isNew){let o=this.toObject(Hqt);if((o||{})._id===void 0)throw new Yt("document must have an _id before saving");this.$__version(!0,o),this.$__reset(),nb(this,!1),this.$__.inserting=!0,n=await this[gm].insertOne(o,s).catch(f=>{throw nb(this,!0),f})}else{this.$__.inserting=!1;let o=this.$__delta();if(e.pathsToSave){for(let f in o[1].$set)if(!e.pathsToSave.includes(f)){if(e.pathsToSave.some(u=>f.slice(0,u.length)===u&&f.charAt(u.length)==="."))continue;delete o[1].$set[f]}}if(o){r=this.$__where(o[0]),xZ(this,r);let f=o[1];if(this.$__schema.options.minimize){for(let u of Object.values(f))if(u!=null)for(let c of Object.keys(u))u[c]==null||typeof u[c]!="object"||wr.isPOJO(u[c])&&(Uqt(u[c]),Object.keys(u[c]).length===0&&(delete u[c],f.$unset=f.$unset||{},f.$unset[c]=1))}this.$__.modifiedPaths=this.modifiedPaths(),this.$__reset(),nb(this,!1),n=await this[gm].updateOne(r,f,s).catch(u=>{throw this.$__undoReset(),u})}else r=this.$__where(),xZ(this,r),this.$__.version&&this.$__version(r,o),Aqt(this.$__schema,s),n=await this.constructor.collection.findOne(r,s).then(f=>({matchedCount:f?1:0}))}}catch(s){let o=this.$__schema._transformDuplicateKeyError(s);await this._execDocumentPostHooks("save",o);return}let i=0;if((e!=null?e.writeConcern!=null?e.writeConcern.w:e.w:0)!==0){if(n!=null&&(Array.isArray(n)?i=n.length:n.matchedCount!=null?i=n.matchedCount:i=n),this.$__.version&&!this.$__.inserting){let o=hI===(hI&this.$__.version);this.$__.version=void 0;let f=this.$__schema.options.versionKey,u=this.$__getValue(f)||0;if(i<=0){this.$__undoReset();let c=this.$__.$versionError||new cMe(this,u,this.$__.modifiedPaths);await this._execDocumentPostHooks("save",c);return}o&&this.$__setValue(f,u+1)}if(n!=null&&i<=0){this.$__undoReset();let o=new dqt(r,this.constructor.modelName,i,n);await this._execDocumentPostHooks("save",o);return}}this.$__.saving=void 0,this.$__.savedState={},this.$emit("save",this,i),this.constructor.emit("save",this,i),await this._execDocumentPostHooks("save")};function Gqt(t,e,n){let r=t.$__schema.options.versionKey;if(!r)return null;let i=t.$__getValue(r)||0;return new cMe(t,i,e.concat(n))}Se.prototype.save=async function(e){if(typeof e=="function"||typeof arguments[1]=="function")throw new Yt("Model.prototype.save() no longer accepts a callback");let n;if(this.$op="save",this.$__.saving?n=new nMe(this):this.$__.saving=new nMe(this),e=new mqt(e),e.hasOwnProperty("session")&&this.$session(e.session),this.$__.timestamps!=null&&(e.timestamps=this.$__.timestamps),this.$__.$versionError=Gqt(this,this.modifiedPaths(),Object.keys(this.$__.activePaths.getStatePaths("default"))),n)throw this.$__handleReject(n),n;this.$__.saveOptions=e;try{await this.$__save(e)}catch(r){throw this.$__handleReject(r),r}finally{this.$__.saving=null,this.$__.saveOptions=null,this.$__.$versionError=null,this.$op=null}return this};Se.prototype.$save=Se.prototype.save;Se.prototype.$__version=function(t,e){let n=this.$__schema.options.versionKey;if(t===!0){n&&(qqt(e,n,0),this.$__setValue(n,0));return}if(n!==!1&&this.$__isSelected(n)){if(aMe===(aMe&this.$__.version)){let r=this.$__getValue(n);r!=null&&(t[n]=r)}hI===(hI&this.$__.version)&&(G7(e.$set,n,null)!=null?++e.$set[n]:(e.$inc=e.$inc||{},e.$inc[n]=1))}};Se.prototype.increment=function(){return this.$__.version=zqt,this};Se.prototype.$__where=function(e){if(e||(e={}),e._id||(e._id=this._doc._id),this._doc._id===void 0)throw new Yt("No _id found on document!");return e};Se.prototype.deleteOne=function(e){if(typeof e=="function"||typeof arguments[1]=="function")throw new Yt("Model.prototype.deleteOne() no longer accepts a callback");e||(e={}),e.hasOwnProperty("session")&&this.$session(e.session);let n=this,r=this.$__where(),i=n.constructor.deleteOne(r,e);return this.$session()!=null&&("session"in i.options||(i.options.session=this.$session())),i.pre(async function(){let s=await n.constructor._middleware.execPre("deleteOne",n,[n]);if(s?.length!==1||s[0]!==n)throw new Error("Document deleteOne pre hooks cannot overwrite arguments");return n.$where!=null&&this.where(n.$where),s}),i.pre(function(){return Promise.all(n.$getAllSubdocs().map(s=>s.constructor._middleware.execPre("deleteOne",s,[s])))}),i.pre(function(){if(n.$__.isDeleted)throw new W7.skipWrappedFunction}),i.post(function(){return Promise.all(n.$getAllSubdocs().map(s=>s.constructor._middleware.execPost("deleteOne",s,[s])))}),i.post(function(){return n.constructor._middleware.execPost("deleteOne",n,[n],{})}),i};Se.prototype.$model=function(e){return arguments.length===0?this.constructor:this[vm].model(e)};Se.prototype.model=Se.prototype.$model;Se.exists=function(e,n){if(tn(this,"exists"),typeof arguments[2]=="function")throw new Yt("Model.exists() no longer accepts a callback");return this.findOne(e).select({_id:1}).lean().setOptions(n)};Se.discriminator=function(t,e,n){let r;if(typeof t=="function"&&(r=t,t=wr.getFunctionName(r),!(r.prototype instanceof Se)))throw new Yt("The provided class "+t+" must extend Model");n=n||{};let i=wr.isPOJO(n)?n.value:n,a=typeof n.clone=="boolean"?n.clone:!0,s=typeof n.mergePlugins=="boolean"?n.mergePlugins:!0,o=typeof n.overwriteModels=="boolean"?n.overwriteModels:!1;if(tn(this,"discriminator"),wr.isObject(e)&&!e.instanceOfSchema&&(e=new SZ(e)),e instanceof SZ&&a&&(e=e.clone()),e=Oqt(this,t,e,i,s,n.mergeHooks,o),this.db.models[t]&&!e.options.overwriteModels&&!o)throw new hqt(t);e.$isRootDiscriminator=!0,e.$globalPluginsApplied=!0,r=this.db.model(r||t,e,this.$__collection.name),this.discriminators[t]=r;let f=this.discriminators[t];if(Object.setPrototypeOf(f.prototype,this.prototype),Object.defineProperty(f,"baseModelName",{value:this.modelName,configurable:!0,writable:!1}),lMe(f,e),pMe(f,e),this[H7]!=null)for(let u of this[H7])u.discriminators=u.discriminators||{},u.discriminators[t]=r.__subclass(r.db,e,u.collection.name);return f};function tn(t,e){if(t==null||t===global)throw new Yt("`Model."+e+"()` cannot run without a model as `this`. Make sure you are calling `MyModel."+e+"()` where `MyModel` is a Mongoose model.");if(t[vMe]==null)throw new Yt("`Model."+e+"()` cannot run without a model as `this`. Make sure you are not calling `new Model."+e+"()`")}for(let t in EZ.prototype)Se[t]=EZ.prototype[t];Se.init=function(){if(tn(this,"init"),typeof arguments[0]=="function")throw new Yt("Model.init() no longer accepts a callback");if(this.schema.emit("init",this),this.$init!=null)return this.$init;let e=this.db,n=async()=>{if(wr.getOption("autoIndex",this.schema.options,e.config,e.base.options))return await this.ensureIndexes({_automatic:!0})},r=async()=>{if(wr.getOption("autoSearchIndex",this.schema.options,e.config,e.base.options))return await this.createSearchIndexes()},i=async()=>{let o=wr.getOption("autoCreate",this.schema.options,e.config);if(o==null&&(await e._waitForConnect(!0),o=wr.getOption("autoCreate",this.schema.options,e.config,e.base.options)),!!o)return await this.createCollection()};this.$init=i().then(()=>n()).then(()=>r());let a=this.$init.catch,s=this;return this.$init.catch=function(){return s.$caught=!0,a.apply(s.$init,arguments)},this.$init};Se.createCollection=async function(e){if(tn(this,"createCollection"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new Yt("Model.createCollection() no longer accepts a callback");[e]=await this.hooks.execPre("createCollection",this,[e]).catch(o=>{if(o instanceof W7.skipWrappedFunction)return[o];throw o});let n=this&&this.schema&&this.schema.options&&this.schema.options.collectionOptions;n!=null&&(e=Object.assign({},n,e));let r=this&&this.schema&&this.schema.options&&this.schema.options.collation;r!=null&&(e=Object.assign({collation:r},e));let i=this&&this.schema&&this.schema.options&&this.schema.options.capped;i!=null&&(typeof i=="number"?e=Object.assign({capped:!0,size:i},e):typeof i=="object"&&(e=Object.assign({capped:!0},i,e)));let a=this&&this.schema&&this.schema.options&&this.schema.options.timeseries;a!=null&&(e=Object.assign({timeseries:a},e),e.expireAfterSeconds!=null||(e.expires!=null?wr.expires(e):this.schema.options.expireAfterSeconds!=null?e.expireAfterSeconds=this.schema.options.expireAfterSeconds:this.schema.options.expires!=null&&(e.expires=this.schema.options.expires,wr.expires(e))));let s=this&&this.schema&&this.schema.options&&this.schema.options.clusteredIndex;s!=null&&(e=Object.assign({clusteredIndex:{...s,unique:!0}},e));try{e instanceof W7.skipWrappedFunction||await this.db.createCollection(this.$__collection.collectionName,e)}catch(o){o!=null&&(o.name!=="MongoServerError"||o.code!==48)&&await this.hooks.execPost("createCollection",this,[null],{error:o})}return await this.hooks.execPost("createCollection",this,[this.$__collection]),this.$__collection};Se.syncIndexes=async function(e){if(tn(this,"syncIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new Yt("Model.syncIndexes() no longer accepts a callback");if(e?.autoCreate??this.schema.options?.autoCreate??this.db.config.autoCreate??this.db.base?.options?.autoCreate??!0)try{await this.createCollection()}catch(a){if(a!=null&&(a.name!=="MongoServerError"||a.code!==48))throw a}let r=await this.diffIndexes({indexOptionsToCreate:!0}),i=await this.cleanIndexes({...e,toDrop:r.toDrop});return await this.createIndexes({...e,toCreate:r.toCreate}),i};Se.createSearchIndex=async function(e){return tn(this,"createSearchIndex"),await this.$__collection.createSearchIndex(e)};Se.updateSearchIndex=async function(e,n){return tn(this,"updateSearchIndex"),await this.$__collection.updateSearchIndex(e,n)};Se.dropSearchIndex=async function(e){return tn(this,"dropSearchIndex"),await this.$__collection.dropSearchIndex(e)};Se.listSearchIndexes=async function(e){return tn(this,"listSearchIndexes"),await(await this.$__collection.listSearchIndexes(e)).toArray()};Se.diffIndexes=async function(e){if(typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new Yt("Model.syncIndexes() no longer accepts a callback");let n=this,r=await n.listIndexes().catch(f=>{if(f.codeName!="NamespaceNotFound")throw f});r===void 0&&(r=[]),r=kqt(n,r);let i=n.schema,a=Dqt(n,i.indexes()),s=Yqt(i,a,r),o=Kqt(i,a,r,s,e);return{toDrop:s,toCreate:o}};function Kqt(t,e,n,r,i){let a=[],s=i?.indexOptionsToCreate??!1;for(let[o,f]of e){let u=!1,c=OZ(t,M1(f));for(let d of n)if(!CZ(d)&&bMe(o,c,d)&&!r.includes(d.name)){u=!0;break}u||(s?a.push([o,f]):a.push(o))}return a}function Yqt(t,e,n){let r=[];for(let i of n){let a=!1;if(!CZ(i)&&!Rqt(i,t.options)){for(let[s,o]of e){let f=OZ(t,M1(o));if(dMe(s,f,t.options),bMe(s,f,i)){a=!0;break}}a||r.push(i.name)}}return r}Se.cleanIndexes=async function(e){if(tn(this,"cleanIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new Yt("Model.cleanIndexes() no longer accepts a callback");let n=this;if(Array.isArray(e&&e.toDrop))return await sMe(e.toDrop,n,e);let r=await n.diffIndexes();return await sMe(r.toDrop,n,e)};async function sMe(t,e,n){if(t.length===0)return[];let r=e.$__collection;return n&&n.hideIndexes?await Promise.all(t.map(i=>e.db.db.command({collMod:r.collectionName,index:{name:i,hidden:!0}}))):await Promise.all(t.map(i=>r.dropIndex(i))),t}Se.listIndexes=async function(){if(tn(this,"listIndexes"),typeof arguments[0]=="function")throw new Yt("Model.listIndexes() no longer accepts a callback");return this.$__collection.buffer&&await new Promise(e=>{this.$__collection.addQueue(e)}),this.$__collection.listIndexes().toArray()};Se.ensureIndexes=async function(e){if(tn(this,"ensureIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new Yt("Model.ensureIndexes() no longer accepts a callback");await new Promise((n,r)=>{Zqt(this,e,i=>{if(i!=null)return r(i);n()})})};Se.createIndexes=async function(e){if(tn(this,"createIndexes"),typeof arguments[0]=="function"||typeof arguments[1]=="function")throw new Yt("Model.createIndexes() no longer accepts a callback");return this.ensureIndexes(e)};function Zqt(t,e,n){let r=Array.isArray(e?.toCreate)?e.toCreate:t.schema.indexes(),i;e=e||{};let a=function(d){d&&!t.$caught&&t.emit("error",d),t.emit("index",d||i),n&&n(d||i)};for(let d of r)CZ(d)&&wr.warn('mongoose: Cannot specify a custom index on `_id` for model name "'+t.modelName+'", MongoDB does not allow overwriting the default `_id` index. See https://bit.ly/mongodb-id-index');if(!r.length){rMe(function(){a()});return}let s=function(d,l,p,h){t.emit("index-single-done",d,l,p,h)},o=function(d,l){t.emit("index-single-start",d,l)},f=t.schema._baseSchema,u=f?f.indexes():[];rMe(function(){e._automatic&&!t.collection.collection?t.collection.addQueue(c,[]):c()});function c(){if(e._automatic&&(t.schema.options.autoIndex===!1||t.schema.options.autoIndex==null&&t.db.config.autoIndex===!1))return a();let d=r.shift();if(!d)return a();if(e._automatic&&d[1]._autoIndex===!1||u.find(v=>wr.deepEqual(v,d)))return c();let l=M1(d[0]),p=M1(d[1]);delete p._autoIndex,OZ(t.schema,p),hMe(t.schema,p),dMe(l,p,t.schema.options),o(l,e);let h=null;try{h=t.collection.createIndex(l,p)}catch(v){i||(i=v),t.$caught||t.emit("error",v),s(v,l,p),c();return}h.then(v=>{s(null,l,p,v),c()},v=>{i||(i=v),t.$caught||t.emit("error",v),s(v,l,p),c()})}}Se.createSearchIndexes=async function(){tn(this,"createSearchIndexes");let e=[];for(let n of this.schema._searchIndexes)e.push(await this.createSearchIndex(n));return e};Se.schema;Se.db;Se.collection;Se.$__collection;Se.base;Se.discriminators;Se.translateAliases=function(e,n){tn(this,"translateAliases");let r=(i,a)=>{let s,o=[],f=i.split("."),u=this.schema;for(let d in f){let l=f[d];if(u&&u.aliases[l]){if(s=u.aliases[l],n&&s in e)throw new Yt(`Provided object has both field "${l}" and its alias "${s}"`);o.push(s)}else s=l,o.push(l);u&&u.paths[s]?u=u.paths[s].schema:u=null}let c=o.join(".");return e instanceof Map?e.set(c,a):e[c]=a,c!==i&&(e instanceof Map?e.delete(i):delete e[i]),e};if(typeof e=="object"){if(e instanceof Map)for(let i of new Map(e))e=r(i[0],i[1]);else for(let i of Object.keys(e))if(e=r(i,e[i]),i[0]==="$")if(Array.isArray(e[i]))for(let a in e[i])e[i][a]=this.translateAliases(e[i][a]);else this.translateAliases(e[i]);return e}else return e};Se.deleteOne=function(e,n){if(tn(this,"deleteOne"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.prototype.deleteOne() no longer accepts a callback");let r=new this.Query({},{},this,this.$__collection);return r.setOptions(n),r.deleteOne(e)};Se.deleteMany=function(e,n){if(tn(this,"deleteMany"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.deleteMany() no longer accepts a callback");let r=new this.Query({},{},this,this.$__collection);return r.setOptions(n),r.deleteMany(e)};Se.find=function(e,n,r){if(tn(this,"find"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new Yt("Model.find() no longer accepts a callback");let i=new this.Query({},{},this,this.$__collection);return i.select(n),i.setOptions(r),i.find(e)};Se.findById=function(e,n,r){if(tn(this,"findById"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.findById() no longer accepts a callback");return this.findOne({_id:e},n,r)};Se.findOne=function(e,n,r){if(tn(this,"findOne"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.findOne() no longer accepts a callback");let i=new this.Query({},{},this,this.$__collection);return i.select(n),i.setOptions(r),i.findOne(e)};Se.estimatedDocumentCount=function(e){return tn(this,"estimatedDocumentCount"),new this.Query({},{},this,this.$__collection).estimatedDocumentCount(e)};Se.countDocuments=function(e,n){if(tn(this,"countDocuments"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.countDocuments() no longer accepts a callback");let r=new this.Query({},{},this,this.$__collection);return n!=null&&r.setOptions(n),r.countDocuments(e)};Se.distinct=function(e,n,r){if(tn(this,"distinct"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.distinct() no longer accepts a callback");let i=new this.Query({},{},this,this.$__collection);return r!=null&&i.setOptions(r),i.distinct(e,n)};Se.where=function(e,n){tn(this,"where");let r=new this.Query({},{},this,this.$__collection).find({});return r.where.apply(r,arguments)};Se.$where=function(){tn(this,"$where");let e=new this.Query({},{},this,this.$__collection).find({});return e.$where.apply(e,arguments)};Se.findOneAndUpdate=function(t,e,n){if(tn(this,"findOneAndUpdate"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new Yt("Model.findOneAndUpdate() no longer accepts a callback");let r;n&&(r=n.fields||n.projection),e=M1(e,{depopulate:!0,_isNested:!0}),mMe(e,n,this.schema.options.versionKey);let i=new this.Query({},{},this,this.$__collection);return i.select(r),i.findOneAndUpdate(t,e,n)};Se.findByIdAndUpdate=function(t,e,n){if(tn(this,"findByIdAndUpdate"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new Yt("Model.findByIdAndUpdate() no longer accepts a callback");return t instanceof Tl&&(t=t._doc._id),this.findOneAndUpdate.call(this,{_id:t},e,n)};Se.findOneAndDelete=function(t,e){if(tn(this,"findOneAndDelete"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.findOneAndDelete() no longer accepts a callback");let n;e&&(n=e.select,e.select=void 0);let r=new this.Query({},{},this,this.$__collection);return r.select(n),r.findOneAndDelete(t,e)};Se.findByIdAndDelete=function(t,e){if(tn(this,"findByIdAndDelete"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function")throw new Yt("Model.findByIdAndDelete() no longer accepts a callback");return this.findOneAndDelete({_id:t},e)};Se.findOneAndReplace=function(t,e,n){if(tn(this,"findOneAndReplace"),typeof arguments[0]=="function"||typeof arguments[1]=="function"||typeof arguments[2]=="function"||typeof arguments[3]=="function")throw new Yt("Model.findOneAndReplace() no longer accepts a callback");let r;n&&(r=n.select,n.select=void 0);let i=new this.Query({},{},this,this.$__collection);return i.select(r),i.findOneAndReplace(t,e,n)};Se.create=async function(e,n){if(typeof n=="function"||typeof arguments[2]=="function")throw new Yt("Model.create() no longer accepts a callback");tn(this,"create");let r,i=this.schema.options.discriminatorKey;if(Array.isArray(e))r=e,n=n!=null&&typeof n=="object"?n:{};else{let o=arguments[arguments.length-1];if(n={},typeof o=="function"||typeof n=="function"||typeof arguments[2]=="function")throw new Yt("Model.create() no longer accepts a callback");r=[...arguments],r.length>1&&!o&&r.pop(),r.length===2&&r[0]!=null&&r[1]!=null&&r[0].session==null&&o&&Mqt(o.session)==="ClientSession"&&!this.schema.path("session")&&wr.warn("WARNING: to pass a `session` to `Model.create()` in Mongoose, you **must** pass an array as the first argument. See: https://mongoosejs.com/docs/api/model.html#Model.create()")}if(r.length===0)return Array.isArray(e)?[]:null;let a=[],s=typeof n.aggregateErrors=="boolean"?!n.aggregateErrors:!0;if(delete n.aggregateErrors,n.session&&!n.ordered&&r.length>1)throw new Yt("Cannot call `create()` with a session and multiple documents unless `ordered: true` is set");if(n.ordered){for(let o=0;o<r.length;o++)try{let f=r[o],u=this.discriminators&&f[i]!=null?this.discriminators[f[i]]||z7(this.discriminators,f[i]):this;if(u==null)throw new Yt(`Discriminator "${f[i]}" not found for model "${this.modelName}"`);let c=f;c instanceof u||(c=new u(c)),await c.$save(n),a.push(c)}catch(f){if(!s)a.push(f);else throw f}return a}else if(!s)a=await Promise.allSettled(r.map(async o=>{let f=this.discriminators&&o[i]!=null?this.discriminators[o[i]]||z7(this.discriminators,o[i]):this;if(f==null)throw new Yt(`Discriminator "${o[i]}" not found for model "${this.modelName}"`);let u=o;return u instanceof f||(u=new f(u)),await u.$save(n),u})),a=a.map(o=>o.status==="fulfilled"?o.value:o.reason);else{let o=null;if(a=await Promise.all(r.map(async f=>{let u=this.discriminators&&f[i]!=null?this.discriminators[f[i]]||z7(this.discriminators,f[i]):this;if(u==null)throw new Yt(`Discriminator "${f[i]}" not found for model "${this.modelName}"`);try{let c=f;return c instanceof u||(c=new u(c)),await c.$save(n),c}catch(c){o||(o=c)}})),o)throw o}return!Array.isArray(e)&&r.length===1?a[0]:a};Se.insertOne=async function(e,n){tn(this,"insertOne");let r=this.schema.options.discriminatorKey,i=this.discriminators&&e[r]!=null?this.discriminators[e[r]]||z7(this.discriminators,e[r]):this;if(i==null)throw new Yt(`Discriminator "${e[r]}" not found for model "${this.modelName}"`);return e instanceof i||(e=new i(e)),await e.$save(n)};Se.watch=function(t,e){tn(this,"watch"),e=e||{};let n=e?.hydrate!==void 0?wr.omit(e,["hydrate"]):{...e};e.model=this;let r=i=>{if(t=t||[],Fqt(t,this.schema,"fullDocument"),this.$__collection.buffer)this.$__collection.addQueue(()=>{if(this.closed)return;let a=this.$__collection.watch(t,n);i(null,a)});else{let a=this.$__collection.watch(t,n);i(null,a)}};return new lqt(r,t,e)};Se.startSession=function(){return tn(this,"startSession"),this.db.startSession.apply(this.db,arguments)};Se.insertMany=async function(e,n){if(tn(this,"insertMany"),typeof n=="function"||typeof arguments[2]=="function")throw new Yt("Model.insertMany() no longer accepts a callback");try{[e]=await this._middleware.execPre("insertMany",this,[e])}catch(N){await this._middleware.execPost("insertMany",this,[e],{error:N})}n=n||{};let r=this,i=n.limit||1e3,a=!!n.rawResult,s=typeof n.ordered=="boolean"?n.ordered:!0,o=typeof n.throwOnValidationError=="boolean"?n.throwOnValidationError:!1,f=!!n.lean,u=this.db.base.transactionAsyncLocalStorage?.getStore();(!n||!n.hasOwnProperty("session"))&&u?.session!=null&&(n={...n,session:u.session}),Array.isArray(e)||(e=[e]);let c=[],d=new Map,l=s?null:new Array(e.length);async function p(N,V){if(f)return N;let j=!1;if(!(N instanceof r)){if(N!=null&&typeof N!="object")throw new pqt(N,"arr."+V,"insertMany");N=new r(N),j=!0}return n.session!=null&&N.$session(n.session),N.$validate(j?{_skipParallelValidateCheck:!0}:null).then(()=>N).catch(K=>{if(s===!1){K.index=V,c.push(K),d.set(K,V),l[V]=K;return}throw K})}let h=await Bqt(e,p,i),v=new Map,E=new Map;for(let N=0;N<h.length;++N)v.set(h[N],N);let M=h.filter(function(N){return N!=null});for(let N=0;N<M.length;++N)E.set(N,v.get(M[N]));if(c.length>0&&c.sort((N,V)=>d.get(N)-d.get(V)),M.length===0){if(o)throw new pI(c,l,null,"insertMany");if(a){let N={acknowledged:!0,insertedCount:0,insertedIds:{}};return bm(N,c,c),N}return[]}let D=f?M:M.map(function(N){return N.$__schema.options.versionKey&&(N[N.$__schema.options.versionKey]=0),(!n||n.timestamps!==!1)&&N.initializeTimestamps&&(!N.$__||N.$__.timestamps!==!1)&&N.initializeTimestamps(),N.$__hasOnlyPrimitiveValues()?N.$__toObjectShallow():N.toObject(TZ)}),$;try{$=await this.$__collection.insertMany(D,n)}catch(N){N.writeErrors==null&&(N.result&&N.result.result&&N.result.result.writeErrors)!=null&&(N.writeErrors=N.result.result.writeErrors);let V=N&&N.writeErrors,j=new Set((N&&N.writeErrors||[]).map(Y=>Y.index));if(N.writeErrors!=null)for(let Y=0;Y<N.writeErrors.length;++Y){let W=E.get(N.writeErrors[Y].index);N.writeErrors[Y]={...N.writeErrors[Y],index:W},s||(l[W]=N.writeErrors[Y])}if(!s){for(let Y=0;Y<l.length;++Y)l[Y]===void 0&&(l[Y]=h[Y]);N.results=l}let K=-1;N.insertedDocs=M.filter((Y,W)=>{let B=!V||j.has(W);if(s){if(K>-1)return W<K;B&&(K=W)}return!B}).map(function(W){return f||(W.$__reset(),nb(W,!1)),W}),a&&s===!1&&bm(N,c,l),await this._middleware.execPost("insertMany",this,[e],{error:N})}if(!f)for(let N of M)N.$__reset(),nb(N,!1);if(s===!1&&o&&c.length>0){for(let N=0;N<l.length;++N)l[N]===void 0&&(l[N]=h[N]);throw new pI(c,l,$,"insertMany")}if(a){if(s===!1){for(let N=0;N<l.length;++N)l[N]===void 0&&(l[N]=h[N]);bm($,c,l)}return $}return n.populate!=null?this.populate(M,n.populate).catch(N=>{throw N!=null&&(N.insertedDocs=M),N}):await this._middleware.execPost("insertMany",this,[M]).then(N=>N[0])};function nb(t,e){t.$isNew=e,t.$emit("isNew",e),t.constructor.emit("isNew",e);let n=t.$getAllSubdocs({useCache:!0});for(let r of n)r.$isNew=e,r.$emit("isNew",e)}Se.bulkWrite=async function(e,n){if(tn(this,"bulkWrite"),typeof n=="function"||typeof arguments[2]=="function")throw new Yt("Model.bulkWrite() no longer accepts a callback");if(n=n||{},[e,n]=await this.hooks.execPre("bulkWrite",this,[e,n]).catch(o=>{if(o instanceof W7.skipWrappedFunction)return[o];throw o}),e instanceof W7.skipWrappedFunction)return e.args[0];let r=n.ordered==null?!0:n.ordered;if(e.length===0){let o=this.base.driver.get().BulkWriteResult,f=new o(wZ(),!1);return f.n=0,bm(f,[],[]),f}let i=n?._skipCastBulkWrite?[]:e.map(o=>Tqt(this,o,n)),a=this.db.base.transactionAsyncLocalStorage?.getStore();(!n||!n.hasOwnProperty("session"))&&a?.session!=null&&(n={...n,session:a.session});let s=null;if(r){await new Promise((o,f)=>{Iqt(i,(u,c)=>u(c),u=>{if(u)return f(u);o()})});try{s=await this.$__collection.bulkWrite(e,n)}catch(o){await this.hooks.execPost("bulkWrite",this,[null],{error:o})}}else{let o=[],f=[],u=[];i.length>0?(o=await Promise.all(e.map((p,h)=>h>=i.length?h:new Promise(v=>{i[h](E=>{E==null?v(h):(f.push({index:h,error:E}),u[h]=E),v()})}))),o=o.filter(p=>p!=null)):o=e.map((p,h)=>h),f=f.sort((p,h)=>p.index-h.index).map(p=>p.error);let c=o.sort().map(p=>e[p]);if(c.length===0){if(n.throwOnValidationError&&f.length)throw new pI(f,u,s,"bulkWrite");let p=this.base.driver.get().BulkWriteResult,h=new p(wZ(),!1);return h.result=wZ(),bm(h,f,u),h}let d;[s,d]=await this.$__collection.bulkWrite(c,n).then(p=>[p,null]).catch(p=>[null,p]);let l={};if(d?.writeErrors)for(let p of d.writeErrors)l[p.err.index]=p;for(let p=0;p<o.length;++p)u[o[p]]=l[p]??null;if(d&&(f.length>0&&bm(d,f,u),await this.hooks.execPost("bulkWrite",this,[null],{error:d})),f.length>0){if(n.throwOnValidationError)throw new pI(f,u,s,"bulkWrite");bm(s,f,u)}}return await this.hooks.execPost("bulkWrite",this,[s]),s};Se.bulkSave=async function(e,n){if(n=n||{},n.timestamps!=null)for(let c of e)c.$__.saveOptions=c.$__.saveOptions||{},c.$__.saveOptions.timestamps=n.timestamps;else for(let c of e)c.$__.timestamps!=null&&(c.$__.saveOptions=c.$__.saveOptions||{},c.$__.saveOptions.timestamps=c.$__.timestamps);await Promise.all(e.map(c=>Xqt(c,n)));let r=this.buildBulkWriteOperations(e,n),i={skipValidation:!0,_skipCastBulkWrite:!0,...n},{bulkWriteResult:a,bulkWriteError:s}=await this.bulkWrite(r,i).then(c=>({bulkWriteResult:c,bulkWriteError:null}),c=>({bulkWriteResult:null,bulkWriteError:c}));if(s!=null&&s.name!=="MongoBulkWriteError")throw s;let o=a?.matchedCount??0,f=a?.insertedCount??0;if(r.length>0&&o+f<r.length&&!s)throw new jqt(this.modelName,e,a);let u=[];for(let c=0;c<e.length;c++){let d=e[c];(s&&s.writeErrors.find(p=>(p.err.op._id||p.err.op.q._id).toString()===d._doc._id.toString()))==null&&u.push(d)}if(await Promise.all(u.map(c=>Jqt(c))),s!=null)throw s;return a};async function Xqt(t,e){let[n]=await t.schema.s.hooks.execPre("save",t,[e]);if(n!==e)throw new Error('Cannot overwrite options in pre("save") hook on bulkSave()')}async function Jqt(t){return t.$isNew&&nb(t,!1),t.$__reset(),t.schema.s.hooks.execPost("save",t,[t])}Se.applyDefaults=function t(e){if(e==null)return e;if(e.$__!=null){yqt(e,e.$__.fields,e.$__.exclude);for(let n of e.$getAllSubdocs())t(n,n.$__.fields,n.$__.exclude);return e}return bqt(e,this.schema),e};Se.applyVirtuals=function(e,n){return e==null||e.$__!=null||Sqt(this.schema,e,n),e};Se.applyTimestamps=function(e,n){return e==null||e.$__!=null||Eqt(this.schema,e,n),e};Se.castObject=function(e,n){n=n||{};let r={},i=this.schema,a=i.options.discriminatorKey;i.discriminators!=null&&e!=null&&e[a]!=null&&(i=yMe(i,e[a])||i);let s=Object.keys(i.paths);for(let f of s){let u=i.path(f);if(!u||!u.$isMongooseArray)continue;let c=G7(e,f);gMe(s,c,f)}let o=null;for(let f of s){let u=i.path(f);if(u==null)continue;let c=G7(e,f,void 0);if(c==null)continue;let d=f.indexOf(".")===-1?[f]:f.split("."),l=r;for(let p=0;p<d.length-1;++p)l[d[p]]==null&&(l[d[p]]=isNaN(d[p+1])?{}:[]),l=l[d[p]];if(u.$isMongooseDocumentArray){let p=u.options?.castNonArrays??u.constructor.options.castNonArrays;if(!Array.isArray(c)){p?l[d[d.length-1]]=[Se.castObject.call(u.Constructor,c)]:n.ignoreCastErrors||(o=o||new dI,o.addError(f,new Vqt(f,c)));continue}}if(u.$isSingleNested||u.$isMongooseDocumentArrayElement){try{c=Se.castObject.call(u.Constructor,c)}catch(p){n.ignoreCastErrors||(o=o||new dI,o.addError(f,p));continue}l[d[d.length-1]]=c;continue}try{c=u.cast(c),l[d[d.length-1]]=c}catch(p){n.ignoreCastErrors||(o=o||new dI,o.addError(f,p));continue}}if(o!=null)throw o;return r};Se.buildBulkWriteOperations=function(e,n){if(!Array.isArray(e))throw new Error(`bulkSave expects an array of documents to be passed, received \`${e}\` instead`);return i(),e.map((a,s)=>{if(!n.skipValidation){if(!(a instanceof Tl))throw new Error(`documents.${s} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`);if(n.validateBeforeSave==null||n.validateBeforeSave){let c=a.validateSync();if(c!=null)throw c}}if(a.isNew){let c={insertOne:{document:a}};return wr.injectTimestampsOption(c.insertOne,n.timestamps),c}let f=a.$__delta();if(f!=null&&!wr.isEmptyObject(f[0])){let c=a.$__where(f[0]),d=f[1];xZ(a,c);let l=this.schema.options.shardKey;if(l){let h=Object.keys(l),v=h.length;for(let E=0;E<v;++E)c[h[E]]=a[h[E]]}a.$__version(c,f);let p={updateOne:{filter:c,update:d}};return wr.injectTimestampsOption(p.updateOne,n.timestamps),p}return null}).filter(a=>a!==null);function i(){n=n||{},n.skipValidation==null&&(n.skipValidation=!1)}};Se.hydrate=function(t,e,n){if(tn(this,"hydrate"),n?.virtuals&&n?.hydratedPopulatedDocs===!1)throw new Yt("Cannot set `hydratedPopulatedDocs` option to false if `virtuals` option is truthy because `virtuals: true` also sets populated virtuals");e!=null&&(t!=null&&t.$__!=null&&(t=t.toObject(TZ)),t=_qt(t,e));let r=Z9().createModel(this,t,e);return r.$init(t,n),r};Se.updateMany=function(e,n,r){if(tn(this,"updateMany"),n==null)throw new Yt("updateMany `update` parameter cannot be nullish");return IZ(this,"updateMany",e,n,r)};Se.updateOne=function(e,n,r){return tn(this,"updateOne"),IZ(this,"updateOne",e,n,r)};Se.replaceOne=function(e,n,r){tn(this,"replaceOne");let i=this&&this.schema&&this.schema.options&&this.schema.options.versionKey||null;return i&&!n[i]&&(n[i]=0),IZ(this,"replaceOne",e,n,r)};function IZ(t,e,n,r,i){let a=new t.Query({},{},t,t.collection);n instanceof Tl?n=n.toObject():n=M1(n),i=typeof i=="function"?i:M1(i);let s=t&&t.schema&&t.schema.options&&t.schema.options.versionKey||null;return mMe(r,i,s),a[e](n,r,i)}Se.aggregate=function(e,n){if(tn(this,"aggregate"),typeof n=="function"||typeof arguments[2]=="function")throw new Yt("Model.aggregate() no longer accepts a callback");let r=new cqt(e||[]);return r.model(this),n!=null&&r.option(n),r};Se.validate=async function(e,n,r){if((arguments.length<3||arguments.length===3&&typeof arguments[2]=="function")&&(r=e),typeof r=="function"||typeof arguments[3]=="function")throw new Yt("Model.validate() no longer accepts a callback");let i=this.schema,a=i.options.discriminatorKey;i.discriminators!=null&&e!=null&&e[a]!=null&&(i=yMe(i,e[a])||i);let s=Object.keys(i.paths);if(n!=null){let u=typeof n=="string"?new Set(n.split(" ")):Array.isArray(n)?new Set(n):new Set(s);s=s.filter(c=>{if(n.pathsToSkip){if(Array.isArray(n.pathsToSkip)){if(n.pathsToSkip.find(p=>p==c))return!1}else if(typeof n.pathsToSkip=="string"&&n.pathsToSkip.includes(c))return!1}let d=c.split("."),l=d[0];for(let p of d){if(u.has(l))return!0;l+="."+p}return u.has(c)})}for(let u of s){let c=i.path(u);if(!c||!c.$isMongooseArray||c.$isMongooseDocumentArray)continue;let d=G7(e,u);gMe(s,d,u)}let o=null;s=new Set(s);try{e=this.castObject(e)}catch(u){o=u;for(let c of Object.keys(o.errors||{}))s.delete(c)}let f=[];for(let u of s){let c=i.path(u);if(c==null)continue;let d=u.indexOf(".")===-1?[u]:u.split("."),l=e;for(let h=0;h<d.length-1;++h)l=l[d[h]];let p=G7(e,u,void 0);f.push(c.doValidate(p,r,{path:u}).catch(h=>{o=o||new dI,o.addError(u,h)}))}if(await Promise.all(f),o!=null)throw o;return e};Se.populate=async function(e,n){if(tn(this,"populate"),typeof n=="function"||typeof arguments[2]=="function")throw new Yt("Model.populate() no longer accepts a callback");if(n=wr.populate(n),n.length===0)return e;if(n.find(r=>r.ordered))for(let r of n)await oMe(this,e,r);else{let r=[];for(let i of n)r.push(oMe(this,e,i));await Promise.all(r)}return e};var Qqt=/\s?-_id\s?/,eUt=/\s?-_id\s?/g;async function oMe(t,e,n){if(n.strictPopulate==null&&(n._localModel!=null&&n._localModel.schema._userProvidedOptions.strictPopulate!=null?n.strictPopulate=n._localModel.schema._userProvidedOptions.strictPopulate:(n._localModel!=null&&t.base.options.strictPopulate!=null||t.base.options.strictPopulate!=null)&&(n.strictPopulate=t.base.options.strictPopulate)),Array.isArray(e)||(e=[e]),e.length===0||e.every(wr.isNullOrUndefined))return;let r=Pqt(t,e,n);if(r instanceof Yt)throw r;let i=r.length,a=[];function s(u){return u!==void 0}let o=!1,f=[];for(let u=0;u<i;++u){let c=r[u],d=c.options.select,l=wr.array.flatten(c.ids,s);l=wr.array.unique(l);let p={};if(p.sort=c&&c.options&&c.options.options&&c.options.options.sort||void 0,p.excludeId=Qqt.test(d)||d&&d._id===0,c.options&&c.options.options&&c.options.options.lean&&c.options.options.lean.transform&&(c.options.options._leanTransform=c.options.options.lean.transform,c.options.options.lean=!0),l.length===0||l.every(wr.isNullOrUndefined)){uMe(t,[],c,p);continue}o=!0,typeof n.foreignField=="string"&&(c.foreignField.clear(),c.foreignField.add(n.foreignField));let h=Cqt(l,c.match,c.foreignField,c.model,c.options.skipInvalidIds);p.excludeId&&(typeof d=="string"?d=d.replace(eUt," "):Array.isArray(d)?d=d.filter(v=>v!=="-_id"):(d={...d},delete d._id)),c.options.options&&c.options.options.limit!=null?p.originalLimit=c.options.options.limit:c.options.limit!=null&&(p.originalLimit=c.options.limit),f.push([c,h,d,p])}if(!o){if(r.length!==0)return;if(n.populate!=null){let u=wr.populate(n.populate).map(c=>Object.assign({},c,{path:n.path+"."+c.path}));return t.populate(e,u)}return}if(n.ordered)for(let u of f)await fMe.apply(null,u).then(c=>{a=a.concat(c)});else{let u=[];for(let c of f)u.push(fMe.apply(null,c).then(d=>{a=a.concat(d)}));await Promise.all(u)}for(let u of f){let c=u[0],d=u[3];for(let l of a)c.options._childDocs.push(l);uMe(t,a,c,d)}for(let u of f)Lqt(u[0].foreignField,u[0].options,a);for(let u of f){let c=u[0];if(c.options&&c.options.options&&c.options.options._leanTransform)for(let d of a)c.options.options._leanTransform(d)}}function fMe(t,e,n){let r=M1(t.options.populate),i={};t.options.skip!==void 0&&(i.skip=t.options.skip),t.options.limit!==void 0&&(i.limit=t.options.limit),t.options.perDocumentLimit!==void 0&&(i.perDocumentLimit=t.options.perDocumentLimit),Object.assign(i,t.options.options),t.count&&delete i.skip,i.perDocumentLimit!=null?(i.limit=i.perDocumentLimit,delete i.perDocumentLimit):i.limit!=null&&(i.limit=i.limit*t.ids.length);let a=t.model.find(e,n,i);for(let s of t.foreignField)s!=="_id"&&a.selectedInclusively()&&!Nqt(a._fields,s)&&a.select(s);if(t.count)for(let s of t.foreignField)a.select(s);if(r){t.model.baseModelName!=null&&(Array.isArray(r)?r.forEach(o=>{o.strictPopulate=!1}):typeof r=="string"?r={path:r,strictPopulate:!1}:r.strictPopulate=!1);let s=t.options._fullPath||t.options.path;if(Array.isArray(r))for(let o of r)o._fullPath=s+"."+o.path;else typeof r=="object"&&(r._fullPath=s+"."+r.path);a.populate(r)}return a.exec().then(s=>{for(let o of s)$qt.set(o,t.model);return s})}function uMe(t,e,n,r){let i=n.options,a=n.isVirtual,s=n.justOne,o,f=i&&i.options&&i.options.lean||!1,u=e.length,c={},d={},l,p,h=M1(n.allIds);for(let v=0;v<u;v++)if(p=e[v],p!=null)for(let E of n.foreignField){if(o=wr.getValue(E,p),Array.isArray(o)){o=wr.array.unique(wr.array.flatten(o));for(let M of o)M instanceof Tl&&(M=M._doc._id),l=String(M),d[l]?Array.isArray(d[l])?(d[l].push(p),c[l].push(v)):(d[l]=[d[l],p],c[l]=[c[l],v]):a&&!s?(d[l]=[p],c[l]=[v]):(d[l]=p,c[l]=v)}else o instanceof Tl&&(o=o._doc._id),l=String(o),d[l]?Array.isArray(d[l])?(d[l].push(p),c[l].push(v)):(a||d[l].constructor!==p.constructor||(d[l]instanceof Tl?String(d[l]._doc._id):String(d[l]._id))!==(p instanceof Tl?String(p._doc._id):String(p._id)))&&(d[l]=[d[l],p],c[l]=[c[l],v]):(d[l]=p,c[l]=v);f||(p.$__.wasPopulated=p.$__.wasPopulated||{value:o})}xqt({originalModel:t,rawIds:n.isVirtual?h:n.allIds,allIds:h,unpopulatedValues:n.unpopulatedValues,foreignField:n.foreignField,rawDocs:d,rawOrder:c,docs:n.docs,path:i.path,options:r,justOne:n.justOne,isVirtual:n.isVirtual,allOptions:n,populatedModel:n.model,lean:f,virtual:n.virtual,count:n.count,match:n.match})}Se.compile=function(e,n,r,i,a){if(n.options.versionKey!==!1&&!n.paths[n.options.versionKey]){let d={};d[n.options.versionKey]=Number,n.add(d)}let o;typeof e=="function"&&e.prototype instanceof Se?(o=e,e=o.name,n.loadClass(o,!1),o.prototype.$isMongooseModelPrototype=!0):o=function d(l,p,h){if(d.hooks.execPreSync("createModel",l),!(this instanceof d))return new d(l,p,h);let v=d.schema.options.discriminatorKey;if(d.discriminators==null||l==null||l[v]==null){Se.call(this,l,p,h);return}let E=d.discriminators[l[v]]||z7(d.discriminators,l[v]);if(E!=null)return new E(l,p,h);Se.call(this,l,p,h)},o.hooks=n.s.hooks.clone(),o.base=a,o.modelName=e,o.prototype instanceof Se||(Object.setPrototypeOf(o,Se),Object.setPrototypeOf(o.prototype,Se.prototype)),o.model=function(l){return this.db.model(l)},o.db=i,o.prototype.db=i,o.prototype[vm]=i,o.discriminators=o.prototype.discriminators=void 0,o[vMe]=!0,o.events=new EZ,n._preCompile();let u={schemaUserProvidedOptions:n._userProvidedOptions||{},capped:n.options.capped,Promise:o.base.Promise,modelName:e};n.options.autoCreate!==void 0&&(u.autoCreate=n.options.autoCreate);let c=i.collection(r,u);return o.prototype.collection=c,o.prototype.$collection=c,o.prototype[gm]=c,o.prototype.$__setSchema(n),lMe(o,n),pMe(o,n),vqt(o,n),wqt(o,n.s.hooks,n.statics),o.schema=o.prototype.$__schema,o.collection=c,o.$__collection=c,o.Query=function(){lI.apply(this,arguments)},Object.setPrototypeOf(o.Query.prototype,lI.prototype),o.Query.base=lI.base,o.Query.prototype.constructor=lI,o._applyQueryMiddleware(),tUt(o,n.query),o};Se.clientEncryption=function(){let e=this.base.driver.get().ClientEncryption;if(!e)throw new Error("The mongodb driver must be used to obtain a ClientEncryption object.");let n=this.collection?.conn?.client;if(!n)return null;let r=n.options.autoEncryption;if(!r)return null;let{keyVaultNamespace:i,keyVaultClient:a,kmsProviders:s,credentialProviders:o,proxyOptions:f,tlsOptions:u}=r;return new e(a??n,{keyVaultNamespace:i,kmsProviders:s,credentialProviders:o,proxyOptions:f,tlsOptions:u})};Se.$__updateConnection=function(e){this.db=e,this.prototype.db=e,this.prototype[vm]=e;let n=e.collection(this.collection.collectionName,this.collection.opts);this.prototype.collection=n,this.prototype.$collection=n,this.prototype[gm]=n,this.collection=n,this.$__collection=n};function tUt(t,e){for(let n in e)t.Query.prototype[n]=e[n]}Se.__subclass=function(e,n,r){let i=this,a=function c(d,l,p){if(!(this instanceof c))return new c(d,l,p);i.call(this,d,l,p)};if(Object.setPrototypeOf(a,i),Object.setPrototypeOf(a.prototype,i.prototype),a.db=e,a.prototype.db=e,a.prototype[vm]=e,i[H7]=i[H7]||[],i[H7].push(a),i.discriminators!=null){a.discriminators={};for(let c of Object.keys(i.discriminators))a.discriminators[c]=i.discriminators[c].__subclass(i.db,i.discriminators[c].schema,r)}let s=n&&typeof n!="string"?n:i.prototype.$__schema,o=s.options||{},f=s._userProvidedOptions||{};r||(r=i.prototype.$__schema.get("collection")||wr.toCollectionName(i.modelName,this.base.pluralize()));let u={schemaUserProvidedOptions:f,capped:s&&o.capped};return a.prototype.collection=e.collection(r,u),a.prototype.$collection=a.prototype.collection,a.prototype[gm]=a.prototype.collection,a.collection=a.prototype.collection,a.$__collection=a.collection,a.init().catch(()=>{}),a};Se.recompileSchema=function(){if(this.prototype.$__setSchema(this.schema),this.schema._applyDiscriminators!=null)for(let e of this.schema._applyDiscriminators.keys())this.discriminator(e,this.schema._applyDiscriminators.get(e));delete this.schema._defaultToObjectOptionsMap,gqt(this.schema,new WeakSet,!0)};Se.inspect=function(){return`Model { ${this.modelName} }`};Se.namespace=function(){return this.db.name+"."+this.collection.collectionName};iMe.inspect.custom&&(Se[iMe.inspect.custom]=Se.inspect);Se._applyQueryMiddleware=function(){let e=this.Query,n=this.schema.s.hooks.filter(r=>{let i=nUt(r);return r.name==="validate"?!!i.query:r.name==="deleteOne"||r.name==="updateOne"?!!i.query||Object.keys(i).length===0:r.query!=null||r.document!=null?!!r.query:!0});e.prototype._queryMiddleware=n};function nUt(t){let e={};return t.hasOwnProperty("query")&&(e.query=t.query),t.hasOwnProperty("document")&&(e.document=t.document),e}AMe.exports=_Me=Se});var EMe=y((K7,wMe)=>{"use strict";wMe.exports=aUt;K7.pluralization=[[/human$/gi,"humans"],[/(m|wom)an$/gi,"$1en"],[/(pe)rson$/gi,"$1ople"],[/(child)$/gi,"$1ren"],[/^(ox)$/gi,"$1en"],[/(ax|test)is$/gi,"$1es"],[/(octop|cact|foc|fung|nucle)us$/gi,"$1i"],[/(alias|status|virus)$/gi,"$1es"],[/(bu)s$/gi,"$1ses"],[/(buffal|tomat|potat)o$/gi,"$1oes"],[/([ti])um$/gi,"$1a"],[/sis$/gi,"ses"],[/(?:([^f])fe|([lr])f)$/gi,"$1$2ves"],[/(hive)$/gi,"$1s"],[/([^aeiouy]|qu)y$/gi,"$1ies"],[/(x|ch|ss|sh)$/gi,"$1es"],[/(matr|vert|ind)ix|ex$/gi,"$1ices"],[/([m|l])ouse$/gi,"$1ice"],[/(kn|w|l)ife$/gi,"$1ives"],[/(quiz)$/gi,"$1zes"],[/^goose$/i,"geese"],[/s$/gi,"s"],[/([^a-z])$/,"$1"],[/$/gi,"s"]];var rUt=K7.pluralization;K7.uncountables=["advice","energy","excretion","digestion","cooperation","health","justice","labour","machinery","equipment","information","pollution","sewage","paper","money","species","series","rain","rice","fish","sheep","moose","deer","news","expertise","status","media"];var iUt=K7.uncountables;function aUt(t){let e;return t=t.toLowerCase(),!~iUt.indexOf(t)&&(e=rUt.filter(function(n){return t.match(n[0])}),e[0])?t.replace(e[0][0],e[0][1]):t}});var OMe=y((Ocn,CMe)=>{"use strict";var TMe=on(),SMe=Q("util"),xMe=QW(),o6=class t extends TMe{constructor(){super(""),this.errors={}}toString(){return xMe(this)}inspect(){return Object.assign(new Error(this.message),this)}addError(e,n){if(n instanceof t){let{errors:r}=n;for(let i of Object.keys(r))this.addError(i,r[i]);return}this.errors[e]=n,this.message=xMe(this)}};SMe.inspect.custom&&(o6.prototype[SMe.inspect.custom]=o6.prototype.inspect);Object.defineProperty(o6.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(o6.prototype,"name",{value:"SetOptionError"});var MZ=class extends TMe{constructor(e){super(`"${e}" is not a valid option to set`)}};o6.SetOptionInnerError=MZ;CMe.exports=o6});var MMe=y(()=>{"use strict";var IMe=Vt();typeof jest<"u"&&!process.env.SUPPRESS_JEST_WARNINGS&&(typeof window<"u"&&IMe.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's default jsdom test environment. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning."),setTimeout.clock!=null&&typeof setTimeout.clock.Date=="function"&&IMe.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's mock timers enabled. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning."))});var LMe=y((BMe,FMe)=>{"use strict";var sUt=El(),oUt=Q("events").EventEmitter,PZ=Zh(),P1=im(),fUt=li(),Y7=l7(),uUt=YC(),yI=z4(),PMe=ZTe(),cUt=$y(),lUt=ZO(),RMe=fZ(),dUt=uY(),pUt=NK(),kMe=DO(),hUt=EMe(),RZ=Vt(),mUt=IY(),yUt=om(),bUt=iZ(),gUt=Sy().trusted,vUt=YY(),_Ut=Da(),rb=on(),mI=OMe(),AUt=sZ(),DMe=Symbol.for("mongoose:default"),NMe=Symbol("mongoose:defaultConnection");MMe();var wUt=/^[0-9A-Fa-f]{24}$/,{AsyncLocalStorage:$Me}=Q("async_hooks");function Ue(t){if(this.connections=[],this.nextConnectionId=0,this.models={},this.events=new oUt,this.__driver=kMe.get(),this.options=Object.assign({pluralization:!0,autoIndex:!0,autoCreate:!0,autoSearchIndex:!1},t),(RZ.getOption("createInitialConnection",this.options)??!0)&&this.__driver!=null&&kZ(this),this.options.pluralization&&(this._pluralize=hUt),!t||!t[DMe]){let n=this;this.Schema=function(){return this.base=n,P1.apply(this,arguments)},this.Schema.prototype=Object.create(P1.prototype),Object.assign(this.Schema,P1),this.Schema.base=this,this.Schema.Types=Object.assign({},P1.Types)}else for(let n of["Schema","model"])this[n]=Ue.prototype[n];this.Schema.prototype.base=this,t?.transactionAsyncLocalStorage&&(this.transactionAsyncLocalStorage=new $Me),Object.defineProperty(this,"plugins",{configurable:!1,enumerable:!0,writable:!1,value:Object.values(pUt).map(n=>[n,{deduplicate:!0}])})}Ue.prototype.cast=yUt;Ue.prototype.STATES=yI;Ue.prototype.ConnectionStates=yI;Ue.prototype.driver=kMe;Ue.prototype.setDriver=function(e){let n=this instanceof Ue?this:ls;if(n.__driver===e)return n;if(n.connections&&n.connections.find(s=>s.readyState!==yI.disconnected)){let s="Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver";throw new rb(s)}if(n.__driver=e,Array.isArray(e.plugins))for(let s of e.plugins)typeof s=="function"&&n.plugin(s);e.SchemaTypes!=null&&Object.assign(ls.Schema.Types,e.SchemaTypes);let i=e.Connection,a=n.connections[0];if(n.connections=[new i(n)],n.connections[0].models=n.models,a==null)return n;for(let s of Object.values(n.models))s.db===a&&s.$__updateConnection(n.connections[0]);return n};Ue.prototype.set=function(e,n){let r=this instanceof Ue?this:ls;if(arguments.length===1&&typeof e!="object"){if(PMe.indexOf(e)===-1){let s=new mI;throw s.addError(e,new mI.SetOptionInnerError(e)),s}return r.options[e]}let i={};arguments.length===2&&(i={[e]:n}),arguments.length===1&&typeof e=="object"&&(i=e);let a;for(let[s,o]of Object.entries(i)){if(PMe.indexOf(s)===-1){a||(a=new mI),a.addError(s,new mI.SetOptionInnerError(s));continue}r.options[s]=o,s==="objectIdGetter"?o?Object.defineProperty(r.Types.ObjectId.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}):delete r.Types.ObjectId.prototype._id:s==="transactionAsyncLocalStorage"?o&&!r.transactionAsyncLocalStorage?r.transactionAsyncLocalStorage=new $Me:!o&&r.transactionAsyncLocalStorage&&delete r.transactionAsyncLocalStorage:s==="createInitialConnection"&&(o&&!r.connection?kZ(r):o===!1&&r.connection&&r.connection[NMe]&&r.connection.readyState===yI.disconnected&&Object.keys(r.connection.models).length===0&&r.connections.shift())}if(a)throw a;return r};Ue.prototype.get=Ue.prototype.set;Ue.prototype.createConnection=function(e,n){let r=this instanceof Ue?this:ls,i=r.__driver.Connection,a=new i(r);return r.connections.push(a),r.nextConnectionId++,r.events.emit("createConnection",a),arguments.length>0&&a.openUri(e,{...n,_fireAndForget:!0}),a};Ue.prototype.connect=async function(e,n){if(typeof n=="function"||arguments.length>=3&&typeof arguments[2]=="function")throw new rb("Mongoose.prototype.connect() no longer accepts a callback");let r=this instanceof Ue?this:ls;return r.connection==null&&kZ(r),r.connection.openUri(e,n).then(()=>r)};Ue.prototype.disconnect=async function(){if(arguments.length>=1&&typeof arguments[0]=="function")throw new rb("Mongoose.prototype.disconnect() no longer accepts a callback");let e=this instanceof Ue?this:ls;e.connections.length<=0||await Promise.all(e.connections.map(r=>r.close()))};Ue.prototype.startSession=function(){let e=this instanceof Ue?this:ls;return e.connection.startSession.apply(e.connection,arguments)};Ue.prototype.pluralize=function(e){let n=this instanceof Ue?this:ls;return arguments.length>0&&(n._pluralize=e),n._pluralize};Ue.prototype.model=function(e,n,r,i){let a=this instanceof Ue?this:ls;if(typeof n=="string"&&(r=n,n=!1),arguments.length===1){let u=a.models[e];if(!u)throw new a.Error.MissingSchemaError(e);return u}if(RZ.isObject(n)&&!(n instanceof P1)&&(n=new P1(n)),n&&!(n instanceof P1))throw new a.Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");i=i||{};let s=n;n&&(a.get("cloneSchemas")&&(n=n.clone()),a._applyPlugins(n));let o=a.options.hasOwnProperty("overwriteModels")?a.options.overwriteModels:i.overwriteModels;if(a.models.hasOwnProperty(e)&&i.cache!==!1&&o!==!0){if(s&&s.instanceOfSchema&&s!==a.models[e].schema)throw new a.Error.OverwriteModelError(e);if(r&&r!==a.models[e].collection.name){let u=a.models[e];return n=u.prototype.schema,u.__subclass(a.connection,n,r)}return a.models[e]}if(n==null)throw new a.Error.MissingSchemaError(e);let f=a._model(e,n,r,i);return a.connection.models[e]=f,a.models[e]=f,f};Ue.prototype._model=function(e,n,r,i){let a=this instanceof Ue?this:ls,s;if(typeof e=="function"&&(s=e,e=s.name,!(s.prototype instanceof RMe)))throw new a.Error("The provided class "+e+" must extend Model");n&&(a.get("cloneSchemas")&&(n=n.clone()),a._applyPlugins(n)),(n==null||!("pluralization"in n.options))&&(n.options.pluralization=a.options.pluralization),r||(r=n.get("collection")||RZ.toCollectionName(e,a.pluralize())),AUt(n);let o=i.connection||a.connection;if(s=a.Model.compile(s||e,n,r,o,a),s.init().catch(function(){}),o.emit("model",s),n._applyDiscriminators!=null)for(let f of n._applyDiscriminators.keys()){let{schema:u,options:c}=n._applyDiscriminators.get(f);s.discriminator(f,u,c)}return s};Ue.prototype.deleteModel=function(e){let n=this instanceof Ue?this:ls;return n.connection.deleteModel(e),delete n.models[e],n};Ue.prototype.modelNames=function(){let e=this instanceof Ue?this:ls;return Object.keys(e.models)};Ue.prototype._applyPlugins=function(e,n){let r=this instanceof Ue?this:ls;n=n||{},n.applyPluginsToDiscriminators=r.options&&r.options.applyPluginsToDiscriminators||!1,n.applyPluginsToChildSchemas=typeof(r.options&&r.options.applyPluginsToChildSchemas)=="boolean"?r.options.applyPluginsToChildSchemas:!0,dUt(e,r.plugins,n,"$globalPluginsApplied")};Ue.prototype.plugin=function(e,n){let r=this instanceof Ue?this:ls;return r.plugins.push([e,n]),r};Ue.prototype.__defineGetter__("connection",function(){return this.connections[0]});Ue.prototype.__defineSetter__("connection",function(t){t instanceof this.__driver.Connection&&(this.connections[0]=t,this.models=t.models)});Ue.prototype.connections;Ue.prototype.nextConnectionId;Ue.prototype.Aggregate=bUt;Ue.prototype.BaseCollection=RU();Object.defineProperty(Ue.prototype,"Collection",{get:function(){return this.__driver.Collection},set:function(t){this.__driver.Collection=t}});Object.defineProperty(Ue.prototype,"Connection",{get:function(){return this.__driver.Connection},set:function(t){t!==this.__driver.Connection&&(this.__driver.Connection=t)}});Ue.prototype.BaseConnection=OY();Ue.prototype.version=mUt.version;Ue.prototype.Mongoose=Ue;Ue.prototype.Schema=P1;Ue.prototype.SchemaType=fUt;Ue.prototype.SchemaTypes=P1.Types;Ue.prototype.VirtualType=uUt;Ue.prototype.Types=cUt;Ue.prototype.Query=lUt;Ue.prototype.Model=RMe;Ue.prototype.Document=sUt;Ue.prototype.ObjectId=Y7.ObjectId;Ue.prototype.isValidObjectId=function(e){return(this instanceof Ue?this:ls).Types.ObjectId.isValid(e)};Ue.prototype.isObjectIdOrHexString=function(e){return _Ut(e,"ObjectId")||typeof e=="string"&&wUt.test(e)};Ue.prototype.syncIndexes=function(e){return(this instanceof Ue?this:ls).connection.syncIndexes(e)};Ue.prototype.Decimal128=Y7.Decimal128;Ue.prototype.Mixed=Y7.Mixed;Ue.prototype.Date=Y7.Date;Ue.prototype.Number=Y7.Number;Ue.prototype.Error=rb;Ue.prototype.MongooseError=rb;Ue.prototype.now=function(){return new Date};Ue.prototype.CastError=rb.CastError;Ue.prototype.SchemaTypeOptions=bo();Ue.prototype.mquery=GY();Ue.prototype.sanitizeFilter=vUt;Ue.prototype.trusted=gUt;Ue.prototype.skipMiddlewareFunction=PZ.skipWrappedFunction;Ue.prototype.overwriteMiddlewareResult=PZ.overwriteResult;Ue.prototype.overwriteMiddlewareArguments=PZ.overwriteArguments;Ue.prototype.omitUndefined=fK();function kZ(t){if(t.connection)return;let e=t.createConnection();e[NMe]=!0,e.models=t.models}var ls=FMe.exports=BMe=new Ue({[DMe]:!0})});var jMe=y((Pcn,UMe)=>{"use strict";var qMe=KTe();DO().set(qMe);var DZ=LMe();DZ.setDriver(qMe);DZ.Mongoose.prototype.mongo=Pp();UMe.exports=DZ});var NZ=y((Rcn,Lt)=>{"use strict";var Ut=jMe();Lt.exports=Ut;Lt.exports.default=Ut;Lt.exports.mongoose=Ut;Lt.exports.cast=Ut.cast;Lt.exports.STATES=Ut.STATES;Lt.exports.setDriver=Ut.setDriver;Lt.exports.set=Ut.set;Lt.exports.get=Ut.get;Lt.exports.createConnection=Ut.createConnection;Lt.exports.connect=Ut.connect;Lt.exports.disconnect=Ut.disconnect;Lt.exports.startSession=Ut.startSession;Lt.exports.pluralize=Ut.pluralize;Lt.exports.model=Ut.model;Lt.exports.deleteModel=Ut.deleteModel;Lt.exports.modelNames=Ut.modelNames;Lt.exports.plugin=Ut.plugin;Lt.exports.connections=Ut.connections;Lt.exports.version=Ut.version;Lt.exports.Aggregate=Ut.Aggregate;Lt.exports.Mongoose=Ut.Mongoose;Lt.exports.Schema=Ut.Schema;Lt.exports.SchemaType=Ut.SchemaType;Lt.exports.SchemaTypes=Ut.SchemaTypes;Lt.exports.VirtualType=Ut.VirtualType;Lt.exports.Types=Ut.Types;Lt.exports.Query=Ut.Query;Lt.exports.Model=Ut.Model;Lt.exports.Document=Ut.Document;Lt.exports.ObjectId=Ut.ObjectId;Lt.exports.isValidObjectId=Ut.isValidObjectId;Lt.exports.isObjectIdOrHexString=Ut.isObjectIdOrHexString;Lt.exports.syncIndexes=Ut.syncIndexes;Lt.exports.Decimal128=Ut.Decimal128;Lt.exports.Mixed=Ut.Mixed;Lt.exports.Date=Ut.Date;Lt.exports.Number=Ut.Number;Lt.exports.Error=Ut.Error;Lt.exports.MongooseError=Ut.MongooseError;Lt.exports.now=Ut.now;Lt.exports.CastError=Ut.CastError;Lt.exports.SchemaTypeOptions=Ut.SchemaTypeOptions;Lt.exports.mongo=Ut.mongo;Lt.exports.mquery=Ut.mquery;Lt.exports.sanitizeFilter=Ut.sanitizeFilter;Lt.exports.trusted=Ut.trusted;Lt.exports.skipMiddlewareFunction=Ut.skipMiddlewareFunction;Lt.exports.overwriteMiddlewareResult=Ut.overwriteMiddlewareResult});var KMe=y((s1n,GMe)=>{var WMe=Q("stream").Stream,rjt=Q("util");GMe.exports=mc;function mc(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}rjt.inherits(mc,WMe);mc.create=function(t,e){var n=new this;e=e||{};for(var r in e)n[r]=e[r];n.source=t;var i=t.emit;return t.emit=function(){return n._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),n.pauseStream&&t.pause(),n};Object.defineProperty(mc.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});mc.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};mc.prototype.resume=function(){this._released||this.release(),this.source.resume()};mc.prototype.pause=function(){this.source.pause()};mc.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};mc.prototype.pipe=function(){var t=WMe.prototype.pipe.apply(this,arguments);return this.resume(),t};mc.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};mc.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var JMe=y((o1n,XMe)=>{var ijt=Q("util"),ZMe=Q("stream").Stream,YMe=KMe();XMe.exports=yi;function yi(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}ijt.inherits(yi,ZMe);yi.create=function(t){var e=new this;t=t||{};for(var n in t)e[n]=t[n];return e};yi.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};yi.prototype.append=function(t){var e=yi.isStreamLike(t);if(e){if(!(t instanceof YMe)){var n=YMe.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=n}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};yi.prototype.pipe=function(t,e){return ZMe.prototype.pipe.call(this,t,e),this.resume(),t};yi.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};yi.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(n){var r=yi.isStreamLike(n);r&&(n.on("data",this._checkDataSize.bind(this)),this._handleErrors(n)),this._pipeNext(n)}.bind(this))};yi.prototype._pipeNext=function(t){this._currentStream=t;var e=yi.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var n=t;this.write(n),this._getNext()};yi.prototype._handleErrors=function(t){var e=this;t.on("error",function(n){e._emitError(n)})};yi.prototype.write=function(t){this.emit("data",t)};yi.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};yi.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};yi.prototype.end=function(){this._reset(),this.emit("end")};yi.prototype.destroy=function(){this._reset(),this.emit("close")};yi.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};yi.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};yi.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};yi.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var QMe=y((f1n,ajt)=>{ajt.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var tPe=y((u1n,ePe)=>{ePe.exports=QMe()});var iPe=y(To=>{"use strict";var RI=tPe(),sjt=Q("path").extname,nPe=/^\s*([^;\s]*)(?:;|\s|$)/,ojt=/^text\//i;To.charset=rPe;To.charsets={lookup:rPe};To.contentType=fjt;To.extension=ujt;To.extensions=Object.create(null);To.lookup=cjt;To.types=Object.create(null);ljt(To.extensions,To.types);function rPe(t){if(!t||typeof t!="string")return!1;var e=nPe.exec(t),n=e&&RI[e[1].toLowerCase()];return n&&n.charset?n.charset:e&&ojt.test(e[1])?"UTF-8":!1}function fjt(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?To.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var n=To.charset(e);n&&(e+="; charset="+n.toLowerCase())}return e}function ujt(t){if(!t||typeof t!="string")return!1;var e=nPe.exec(t),n=e&&To.extensions[e[1].toLowerCase()];return!n||!n.length?!1:n[0]}function cjt(t){if(!t||typeof t!="string")return!1;var e=sjt("x."+t).toLowerCase().substr(1);return e&&To.types[e]||!1}function ljt(t,e){var n=["nginx","apache",void 0,"iana"];Object.keys(RI).forEach(function(i){var a=RI[i],s=a.extensions;if(!(!s||!s.length)){t[i]=s;for(var o=0;o<s.length;o++){var f=s[o];if(e[f]){var u=n.indexOf(RI[e[f]].source),c=n.indexOf(a.source);if(e[f]!=="application/octet-stream"&&(u>c||u===c&&e[f].substr(0,12)==="application/"))continue}e[f]=i}}})}});var sPe=y((l1n,aPe)=>{aPe.exports=djt;function djt(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}});var tX=y((d1n,fPe)=>{var oPe=sPe();fPe.exports=pjt;function pjt(t){var e=!1;return oPe(function(){e=!0}),function(r,i){e?t(r,i):oPe(function(){t(r,i)})}}});var nX=y((p1n,uPe)=>{uPe.exports=hjt;function hjt(t){Object.keys(t.jobs).forEach(mjt.bind(t)),t.jobs={}}function mjt(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}});var rX=y((h1n,lPe)=>{var cPe=tX(),yjt=nX();lPe.exports=bjt;function bjt(t,e,n,r){var i=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[i]=gjt(e,i,t[i],function(a,s){i in n.jobs&&(delete n.jobs[i],a?yjt(n):n.results[i]=s,r(a,n.results))})}function gjt(t,e,n,r){var i;return t.length==2?i=t(n,cPe(r)):i=t(n,e,cPe(r)),i}});var iX=y((m1n,dPe)=>{dPe.exports=vjt;function vjt(t,e){var n=!Array.isArray(t),r={index:0,keyedList:n||e?Object.keys(t):null,jobs:{},results:n?{}:[],size:n?Object.keys(t).length:t.length};return e&&r.keyedList.sort(n?e:function(i,a){return e(t[i],t[a])}),r}});var aX=y((y1n,pPe)=>{var _jt=nX(),Ajt=tX();pPe.exports=wjt;function wjt(t){Object.keys(this.jobs).length&&(this.index=this.size,_jt(this),Ajt(t)(null,this.results))}});var mPe=y((b1n,hPe)=>{var Ejt=rX(),Sjt=iX(),xjt=aX();hPe.exports=Tjt;function Tjt(t,e,n){for(var r=Sjt(t);r.index<(r.keyedList||t).length;)Ejt(t,e,r,function(i,a){if(i){n(i,a);return}if(Object.keys(r.jobs).length===0){n(null,r.results);return}}),r.index++;return xjt.bind(r,n)}});var sX=y((g1n,kI)=>{var yPe=rX(),Cjt=iX(),Ojt=aX();kI.exports=Ijt;kI.exports.ascending=bPe;kI.exports.descending=Mjt;function Ijt(t,e,n,r){var i=Cjt(t,n);return yPe(t,e,i,function a(s,o){if(s){r(s,o);return}if(i.index++,i.index<(i.keyedList||t).length){yPe(t,e,i,a);return}r(null,i.results)}),Ojt.bind(i,r)}function bPe(t,e){return t<e?-1:t>e?1:0}function Mjt(t,e){return-1*bPe(t,e)}});var vPe=y((v1n,gPe)=>{var Pjt=sX();gPe.exports=Rjt;function Rjt(t,e,n){return Pjt(t,e,null,n)}});var APe=y((_1n,_Pe)=>{_Pe.exports={parallel:mPe(),serial:vPe(),serialOrdered:sX()}});var oX=y((A1n,wPe)=>{"use strict";wPe.exports=Object});var SPe=y((w1n,EPe)=>{"use strict";EPe.exports=Error});var TPe=y((E1n,xPe)=>{"use strict";xPe.exports=EvalError});var OPe=y((S1n,CPe)=>{"use strict";CPe.exports=RangeError});var MPe=y((x1n,IPe)=>{"use strict";IPe.exports=ReferenceError});var RPe=y((T1n,PPe)=>{"use strict";PPe.exports=SyntaxError});var DI=y((C1n,kPe)=>{"use strict";kPe.exports=TypeError});var NPe=y((O1n,DPe)=>{"use strict";DPe.exports=URIError});var BPe=y((I1n,$Pe)=>{"use strict";$Pe.exports=Math.abs});var LPe=y((M1n,FPe)=>{"use strict";FPe.exports=Math.floor});var UPe=y((P1n,qPe)=>{"use strict";qPe.exports=Math.max});var VPe=y((R1n,jPe)=>{"use strict";jPe.exports=Math.min});var HPe=y((k1n,zPe)=>{"use strict";zPe.exports=Math.pow});var GPe=y((D1n,WPe)=>{"use strict";WPe.exports=Math.round});var YPe=y((N1n,KPe)=>{"use strict";KPe.exports=Number.isNaN||function(e){return e!==e}});var XPe=y(($1n,ZPe)=>{"use strict";var kjt=YPe();ZPe.exports=function(e){return kjt(e)||e===0?e:e<0?-1:1}});var QPe=y((B1n,JPe)=>{"use strict";JPe.exports=Object.getOwnPropertyDescriptor});var fX=y((F1n,eRe)=>{"use strict";var NI=QPe();if(NI)try{NI([],"length")}catch{NI=null}eRe.exports=NI});var nRe=y((L1n,tRe)=>{"use strict";var $I=Object.defineProperty||!1;if($I)try{$I({},"a",{value:1})}catch{$I=!1}tRe.exports=$I});var uX=y((q1n,rRe)=>{"use strict";rRe.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,n);if(o.value!==i||o.enumerable!==!0)return!1}return!0}});var sRe=y((U1n,aRe)=>{"use strict";var iRe=typeof Symbol<"u"&&Symbol,Djt=uX();aRe.exports=function(){return typeof iRe!="function"||typeof Symbol!="function"||typeof iRe("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Djt()}});var cX=y((j1n,oRe)=>{"use strict";oRe.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var lX=y((V1n,fRe)=>{"use strict";var Njt=oX();fRe.exports=Njt.getPrototypeOf||null});var lRe=y((z1n,cRe)=>{"use strict";var $jt="Function.prototype.bind called on incompatible ",Bjt=Object.prototype.toString,Fjt=Math.max,Ljt="[object Function]",uRe=function(e,n){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var a=0;a<n.length;a+=1)r[a+e.length]=n[a];return r},qjt=function(e,n){for(var r=[],i=n||0,a=0;i<e.length;i+=1,a+=1)r[a]=e[i];return r},Ujt=function(t,e){for(var n="",r=0;r<t.length;r+=1)n+=t[r],r+1<t.length&&(n+=e);return n};cRe.exports=function(e){var n=this;if(typeof n!="function"||Bjt.apply(n)!==Ljt)throw new TypeError($jt+n);for(var r=qjt(arguments,1),i,a=function(){if(this instanceof i){var c=n.apply(this,uRe(r,arguments));return Object(c)===c?c:this}return n.apply(e,uRe(r,arguments))},s=Fjt(0,n.length-r.length),o=[],f=0;f<s;f++)o[f]="$"+f;if(i=Function("binder","return function ("+Ujt(o,",")+"){ return binder.apply(this,arguments); }")(a),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i}});var rv=y((H1n,dRe)=>{"use strict";var jjt=lRe();dRe.exports=Function.prototype.bind||jjt});var BI=y((W1n,pRe)=>{"use strict";pRe.exports=Function.prototype.call});var dX=y((G1n,hRe)=>{"use strict";hRe.exports=Function.prototype.apply});var yRe=y((K1n,mRe)=>{"use strict";mRe.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var gRe=y((Y1n,bRe)=>{"use strict";var Vjt=rv(),zjt=dX(),Hjt=BI(),Wjt=yRe();bRe.exports=Wjt||Vjt.call(Hjt,zjt)});var _Re=y((Z1n,vRe)=>{"use strict";var Gjt=rv(),Kjt=DI(),Yjt=BI(),Zjt=gRe();vRe.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new Kjt("a function is required");return Zjt(Gjt,Yjt,e)}});var TRe=y((X1n,xRe)=>{"use strict";var Xjt=_Re(),ARe=fX(),ERe;try{ERe=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var pX=!!ERe&&ARe&&ARe(Object.prototype,"__proto__"),SRe=Object,wRe=SRe.getPrototypeOf;xRe.exports=pX&&typeof pX.get=="function"?Xjt([pX.get]):typeof wRe=="function"?function(e){return wRe(e==null?e:SRe(e))}:!1});var PRe=y((J1n,MRe)=>{"use strict";var CRe=cX(),ORe=lX(),IRe=TRe();MRe.exports=CRe?function(e){return CRe(e)}:ORe?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return ORe(e)}:IRe?function(e){return IRe(e)}:null});var FI=y((Q1n,RRe)=>{"use strict";var Jjt=Function.prototype.call,Qjt=Object.prototype.hasOwnProperty,eVt=rv();RRe.exports=eVt.call(Jjt,Qjt)});var LRe=y((epn,FRe)=>{"use strict";var gn,tVt=oX(),nVt=SPe(),rVt=TPe(),iVt=OPe(),aVt=MPe(),db=RPe(),lb=DI(),sVt=NPe(),oVt=BPe(),fVt=LPe(),uVt=UPe(),cVt=VPe(),lVt=HPe(),dVt=GPe(),pVt=XPe(),$Re=Function,hX=function(t){try{return $Re('"use strict"; return ('+t+").constructor;")()}catch{}},iv=fX(),hVt=nRe(),mX=function(){throw new lb},mVt=iv?(function(){try{return arguments.callee,mX}catch{try{return iv(arguments,"callee").get}catch{return mX}}})():mX,ub=sRe()(),ya=PRe(),yVt=lX(),bVt=cX(),BRe=dX(),av=BI(),cb={},gVt=typeof Uint8Array>"u"||!ya?gn:ya(Uint8Array),wm={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?gn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?gn:ArrayBuffer,"%ArrayIteratorPrototype%":ub&&ya?ya([][Symbol.iterator]()):gn,"%AsyncFromSyncIteratorPrototype%":gn,"%AsyncFunction%":cb,"%AsyncGenerator%":cb,"%AsyncGeneratorFunction%":cb,"%AsyncIteratorPrototype%":cb,"%Atomics%":typeof Atomics>"u"?gn:Atomics,"%BigInt%":typeof BigInt>"u"?gn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?gn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?gn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?gn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":nVt,"%eval%":eval,"%EvalError%":rVt,"%Float16Array%":typeof Float16Array>"u"?gn:Float16Array,"%Float32Array%":typeof Float32Array>"u"?gn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?gn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?gn:FinalizationRegistry,"%Function%":$Re,"%GeneratorFunction%":cb,"%Int8Array%":typeof Int8Array>"u"?gn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?gn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?gn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ub&&ya?ya(ya([][Symbol.iterator]())):gn,"%JSON%":typeof JSON=="object"?JSON:gn,"%Map%":typeof Map>"u"?gn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ub||!ya?gn:ya(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":tVt,"%Object.getOwnPropertyDescriptor%":iv,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?gn:Promise,"%Proxy%":typeof Proxy>"u"?gn:Proxy,"%RangeError%":iVt,"%ReferenceError%":aVt,"%Reflect%":typeof Reflect>"u"?gn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?gn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ub||!ya?gn:ya(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?gn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ub&&ya?ya(""[Symbol.iterator]()):gn,"%Symbol%":ub?Symbol:gn,"%SyntaxError%":db,"%ThrowTypeError%":mVt,"%TypedArray%":gVt,"%TypeError%":lb,"%Uint8Array%":typeof Uint8Array>"u"?gn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?gn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?gn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?gn:Uint32Array,"%URIError%":sVt,"%WeakMap%":typeof WeakMap>"u"?gn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?gn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?gn:WeakSet,"%Function.prototype.call%":av,"%Function.prototype.apply%":BRe,"%Object.defineProperty%":hVt,"%Object.getPrototypeOf%":yVt,"%Math.abs%":oVt,"%Math.floor%":fVt,"%Math.max%":uVt,"%Math.min%":cVt,"%Math.pow%":lVt,"%Math.round%":dVt,"%Math.sign%":pVt,"%Reflect.getPrototypeOf%":bVt};if(ya)try{null.error}catch(t){kRe=ya(ya(t)),wm["%Error.prototype%"]=kRe}var kRe,vVt=function t(e){var n;if(e==="%AsyncFunction%")n=hX("async function () {}");else if(e==="%GeneratorFunction%")n=hX("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=hX("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&ya&&(n=ya(i.prototype))}return wm[e]=n,n},DRe={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sv=rv(),LI=FI(),_Vt=sv.call(av,Array.prototype.concat),AVt=sv.call(BRe,Array.prototype.splice),NRe=sv.call(av,String.prototype.replace),qI=sv.call(av,String.prototype.slice),wVt=sv.call(av,RegExp.prototype.exec),EVt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,SVt=/\\(\\)?/g,xVt=function(e){var n=qI(e,0,1),r=qI(e,-1);if(n==="%"&&r!=="%")throw new db("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new db("invalid intrinsic syntax, expected opening `%`");var i=[];return NRe(e,EVt,function(a,s,o,f){i[i.length]=o?NRe(f,SVt,"$1"):s||a}),i},TVt=function(e,n){var r=e,i;if(LI(DRe,r)&&(i=DRe[r],r="%"+i[0]+"%"),LI(wm,r)){var a=wm[r];if(a===cb&&(a=vVt(r)),typeof a>"u"&&!n)throw new lb("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:a}}throw new db("intrinsic "+e+" does not exist!")};FRe.exports=function(e,n){if(typeof e!="string"||e.length===0)throw new lb("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new lb('"allowMissing" argument must be a boolean');if(wVt(/^%?[^%]*%?$/,e)===null)throw new db("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=xVt(e),i=r.length>0?r[0]:"",a=TVt("%"+i+"%",n),s=a.name,o=a.value,f=!1,u=a.alias;u&&(i=u[0],AVt(r,_Vt([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var l=r[c],p=qI(l,0,1),h=qI(l,-1);if((p==='"'||p==="'"||p==="`"||h==='"'||h==="'"||h==="`")&&p!==h)throw new db("property names with quotes must have matching quotes");if((l==="constructor"||!d)&&(f=!0),i+="."+l,s="%"+i+"%",LI(wm,s))o=wm[s];else if(o!=null){if(!(l in o)){if(!n)throw new lb("base intrinsic for "+e+" exists, but the property is not available.");return}if(iv&&c+1>=r.length){var v=iv(o,l);d=!!v,d&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[l]}else d=LI(o,l),o=o[l];d&&!f&&(wm[s]=o)}}return o}});var URe=y((tpn,qRe)=>{"use strict";var CVt=uX();qRe.exports=function(){return CVt()&&!!Symbol.toStringTag}});var zRe=y((npn,VRe)=>{"use strict";var OVt=LRe(),jRe=OVt("%Object.defineProperty%",!0),IVt=URe()(),MVt=FI(),PVt=DI(),UI=IVt?Symbol.toStringTag:null;VRe.exports=function(e,n){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new PVt("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");UI&&(r||!MVt(e,UI))&&(jRe?jRe(e,UI,{configurable:!i,enumerable:!1,value:n,writable:!1}):e[UI]=n)}});var WRe=y((rpn,HRe)=>{"use strict";HRe.exports=function(t,e){return Object.keys(e).forEach(function(n){t[n]=t[n]||e[n]}),t}});var KRe=y((ipn,GRe)=>{"use strict";var vX=JMe(),RVt=Q("util"),yX=Q("path"),kVt=Q("http"),DVt=Q("https"),NVt=Q("url").parse,$Vt=Q("fs"),BVt=Q("stream").Stream,FVt=Q("crypto"),bX=iPe(),LVt=APe(),qVt=zRe(),f6=FI(),gX=WRe();function Nn(t){if(!(this instanceof Nn))return new Nn(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],vX.call(this),t=t||{};for(var e in t)this[e]=t[e]}RVt.inherits(Nn,vX);Nn.LINE_BREAK=`\r
107
- `;Nn.DEFAULT_CONTENT_TYPE="application/octet-stream";Nn.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var r=vX.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,n),a=this._multiPartFooter();r(i),r(e),r(a),this._trackLength(i,e,n)};Nn.prototype._trackLength=function(t,e,n){var r=0;n.knownLength!=null?r+=Number(n.knownLength):Buffer.isBuffer(e)?r=e.length:typeof e=="string"&&(r=Buffer.byteLength(e)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(t)+Nn.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&f6(e,"httpVersion"))&&!(e instanceof BVt))&&(n.knownLength||this._valuesToMeasure.push(e))};Nn.prototype._lengthRetriever=function(t,e){f6(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):$Vt.stat(t.path,function(n,r){if(n){e(n);return}var i=r.size-(t.start?t.start:0);e(null,i)}):f6(t,"httpVersion")?e(null,Number(t.headers["content-length"])):f6(t,"httpModule")?(t.on("response",function(n){t.pause(),e(null,Number(n.headers["content-length"]))}),t.resume()):e("Unknown stream")};Nn.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var r=this._getContentDisposition(e,n),i=this._getContentType(e,n),a="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(r||[]),"Content-Type":[].concat(i||[])};typeof n.header=="object"&&gX(s,n.header);var o;for(var f in s)if(f6(s,f)){if(o=s[f],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(a+=f+": "+o.join("; ")+Nn.LINE_BREAK)}return"--"+this.getBoundary()+Nn.LINE_BREAK+a+Nn.LINE_BREAK};Nn.prototype._getContentDisposition=function(t,e){var n;if(typeof e.filepath=="string"?n=yX.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?n=yX.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&f6(t,"httpVersion")&&(n=yX.basename(t.client._httpMessage.path||"")),n)return'filename="'+n+'"'};Nn.prototype._getContentType=function(t,e){var n=e.contentType;return!n&&t&&t.name&&(n=bX.lookup(t.name)),!n&&t&&t.path&&(n=bX.lookup(t.path)),!n&&t&&t.readable&&f6(t,"httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=bX.lookup(e.filepath||e.filename)),!n&&t&&typeof t=="object"&&(n=Nn.DEFAULT_CONTENT_TYPE),n};Nn.prototype._multiPartFooter=function(){return function(t){var e=Nn.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e)}.bind(this)};Nn.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Nn.LINE_BREAK};Nn.prototype.getHeaders=function(t){var e,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)f6(t,e)&&(n[e.toLowerCase()]=t[e]);return n};Nn.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Nn.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Nn.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?t=Buffer.concat([t,this._streams[n]]):t=Buffer.concat([t,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Nn.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Nn.prototype._generateBoundary=function(){this._boundary="--------------------------"+FVt.randomBytes(12).toString("hex")};Nn.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Nn.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Nn.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}LVt.parallel(this._valuesToMeasure,this._lengthRetriever,function(n,r){if(n){t(n);return}r.forEach(function(i){e+=i}),t(null,e)})};Nn.prototype.submit=function(t,e){var n,r,i={method:"post"};return typeof t=="string"?(t=NVt(t),r=gX({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(r=gX(t,i),r.port||(r.port=r.protocol==="https:"?443:80)),r.headers=this.getHeaders(t.headers),r.protocol==="https:"?n=DVt.request(r):n=kVt.request(r),this.getLength(function(a,s){if(a&&a!=="Unknown stream"){this._error(a);return}if(s&&n.setHeader("Content-Length",s),this.pipe(n),e){var o,f=function(u,c){return n.removeListener("error",f),n.removeListener("response",o),e.call(this,u,c)};o=f.bind(this,null),n.on("error",f),n.on("response",o)}}.bind(this)),n};Nn.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Nn.prototype.toString=function(){return"[object FormData]"};qVt(Nn.prototype,"FormData");GRe.exports=Nn});import*as X0 from"fs";import*as ov from"path";import*as YRe from"os";function pb(){let t=UVt;return process.env.TRUEBIT_ENV==="local"?t=jVt:process.env.TRUEBIT_ENV==="staging"?t=zVt:process.env.TRUEBIT_ENV==="testnet"&&(t=VVt),t}function ZRe(t=pb()){let e=Cl(),n=ov.join(e,".truebit"),r=ov.join(n,"secret.json");X0.existsSync(n)||X0.mkdirSync(n,{recursive:!0}),X0.writeFileSync(r,JSON.stringify(t,null,2),{encoding:"utf8"})}function Bs(){let t=Cl(),e=ov.join(t,".truebit","secret.json");if(!X0.existsSync(e))return null;let n=X0.readFileSync(e,{encoding:"utf8"});try{return JSON.parse(n)}catch(r){return console.error("Error parsing secret config file:",r),null}}function fv(t){let e=Cl(),n=ov.join(e,".truebit","secret.json");if(!X0.existsSync(n))return;let r=X0.readFileSync(n,{encoding:"utf8"});try{let a={...JSON.parse(r),...t};X0.writeFileSync(n,JSON.stringify(a,null,2),{encoding:"utf8"})}catch(i){console.error("Error updating secret config file:",i)}}function Cl(){return process.env.TRUEBIT_PATH||(process.env.TRUEBIT_PATH=YRe.homedir()),process.env.TRUEBIT_PATH}function zt(t){let e=Bs();if(e&&t in e)return e[t]}function jI(){let t=Bs();if(!t){console.error("Secret config file does not exist.");return}let e=!1,n=["privateKey","address"];for(let i of n)i in t||(t[i]="",e=!0);let r=["httpAdapterURL","hubURL","defaultLanguage","blockchainEnv","Nitro_URL"];for(let i of r)if(!(i in t)||t[i]===""){let a=pb()[i];t[i]=a||"",e=!0}e&&(fv(t),console.log("Configuration has been updated with default values for missing properties."))}function XRe(){let t="ed9005372c18624701ec0998cd12bd22";return(process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="staging"||process.env.TRUEBIT_ENV==="testnet")&&(t="6de18f3bc3d0865f3b4a3676ae16908d"),t}var UVt,jVt,VVt,zVt,qa=_c(()=>{"use strict";UVt={httpAdapterURL:"https://worker01-prod.truebit.network/http-adapter/",hubURL:"https://run.truebit.network/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"production",eula:"",RPC_URL:"",Nitro_URL:"https://tee.truebit.network:8002/"},jVt={httpAdapterURL:"http://localhost:3000/",hubURL:"http://localhost:5000/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"local",eula:"",RPC_URL:"",Nitro_URL:"https://tee-dev.truebit.network:8002/"},VVt={httpAdapterURL:"http://localhost:3000/",hubURL:"http://localhost:5000/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"testnet",eula:"",RPC_URL:"",Nitro_URL:"https://tee-dev.truebit.network:8002/"},zVt={httpAdapterURL:"https://worker01-staging.truebit.network/http-adapter/",hubURL:"https://staging.truebit.network/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"staging",eula:"",RPC_URL:"",Nitro_URL:"https://tee-stg.truebit.network:8002/"}});import Ua from"chalk";var nr,R1=_c(()=>{"use strict";qa();nr=class t{static EULA_TERMS_LINK="https://truebit.io/terms/";static SETUP_INTRODUCTION=`
107
+ `;Nn.DEFAULT_CONTENT_TYPE="application/octet-stream";Nn.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var r=vX.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,n),a=this._multiPartFooter();r(i),r(e),r(a),this._trackLength(i,e,n)};Nn.prototype._trackLength=function(t,e,n){var r=0;n.knownLength!=null?r+=Number(n.knownLength):Buffer.isBuffer(e)?r=e.length:typeof e=="string"&&(r=Buffer.byteLength(e)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(t)+Nn.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&f6(e,"httpVersion"))&&!(e instanceof BVt))&&(n.knownLength||this._valuesToMeasure.push(e))};Nn.prototype._lengthRetriever=function(t,e){f6(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):$Vt.stat(t.path,function(n,r){if(n){e(n);return}var i=r.size-(t.start?t.start:0);e(null,i)}):f6(t,"httpVersion")?e(null,Number(t.headers["content-length"])):f6(t,"httpModule")?(t.on("response",function(n){t.pause(),e(null,Number(n.headers["content-length"]))}),t.resume()):e("Unknown stream")};Nn.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var r=this._getContentDisposition(e,n),i=this._getContentType(e,n),a="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(r||[]),"Content-Type":[].concat(i||[])};typeof n.header=="object"&&gX(s,n.header);var o;for(var f in s)if(f6(s,f)){if(o=s[f],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(a+=f+": "+o.join("; ")+Nn.LINE_BREAK)}return"--"+this.getBoundary()+Nn.LINE_BREAK+a+Nn.LINE_BREAK};Nn.prototype._getContentDisposition=function(t,e){var n;if(typeof e.filepath=="string"?n=yX.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?n=yX.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&f6(t,"httpVersion")&&(n=yX.basename(t.client._httpMessage.path||"")),n)return'filename="'+n+'"'};Nn.prototype._getContentType=function(t,e){var n=e.contentType;return!n&&t&&t.name&&(n=bX.lookup(t.name)),!n&&t&&t.path&&(n=bX.lookup(t.path)),!n&&t&&t.readable&&f6(t,"httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=bX.lookup(e.filepath||e.filename)),!n&&t&&typeof t=="object"&&(n=Nn.DEFAULT_CONTENT_TYPE),n};Nn.prototype._multiPartFooter=function(){return function(t){var e=Nn.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e)}.bind(this)};Nn.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Nn.LINE_BREAK};Nn.prototype.getHeaders=function(t){var e,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)f6(t,e)&&(n[e.toLowerCase()]=t[e]);return n};Nn.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Nn.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Nn.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?t=Buffer.concat([t,this._streams[n]]):t=Buffer.concat([t,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Nn.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Nn.prototype._generateBoundary=function(){this._boundary="--------------------------"+FVt.randomBytes(12).toString("hex")};Nn.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Nn.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Nn.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}LVt.parallel(this._valuesToMeasure,this._lengthRetriever,function(n,r){if(n){t(n);return}r.forEach(function(i){e+=i}),t(null,e)})};Nn.prototype.submit=function(t,e){var n,r,i={method:"post"};return typeof t=="string"?(t=NVt(t),r=gX({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(r=gX(t,i),r.port||(r.port=r.protocol==="https:"?443:80)),r.headers=this.getHeaders(t.headers),r.protocol==="https:"?n=DVt.request(r):n=kVt.request(r),this.getLength(function(a,s){if(a&&a!=="Unknown stream"){this._error(a);return}if(s&&n.setHeader("Content-Length",s),this.pipe(n),e){var o,f=function(u,c){return n.removeListener("error",f),n.removeListener("response",o),e.call(this,u,c)};o=f.bind(this,null),n.on("error",f),n.on("response",o)}}.bind(this)),n};Nn.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Nn.prototype.toString=function(){return"[object FormData]"};qVt(Nn.prototype,"FormData");GRe.exports=Nn});import*as X0 from"fs";import*as ov from"path";import*as YRe from"os";function pb(){let t=UVt;return process.env.TRUEBIT_ENV==="local"?t=jVt:process.env.TRUEBIT_ENV==="staging"?t=zVt:process.env.TRUEBIT_ENV==="testnet"&&(t=VVt),t}function ZRe(t=pb()){let e=Cl(),n=ov.join(e,".truebit"),r=ov.join(n,"secret.json");X0.existsSync(n)||X0.mkdirSync(n,{recursive:!0}),X0.writeFileSync(r,JSON.stringify(t,null,2),{encoding:"utf8"})}function Bs(){let t=Cl(),e=ov.join(t,".truebit","secret.json");if(!X0.existsSync(e))return null;let n=X0.readFileSync(e,{encoding:"utf8"});try{return JSON.parse(n)}catch(r){return console.error("Error parsing secret config file:",r),null}}function fv(t){let e=Cl(),n=ov.join(e,".truebit","secret.json");if(!X0.existsSync(n))return;let r=X0.readFileSync(n,{encoding:"utf8"});try{let a={...JSON.parse(r),...t};X0.writeFileSync(n,JSON.stringify(a,null,2),{encoding:"utf8"})}catch(i){console.error("Error updating secret config file:",i)}}function Cl(){return process.env.TRUEBIT_PATH||(process.env.TRUEBIT_PATH=YRe.homedir()),process.env.TRUEBIT_PATH}function zt(t){let e=Bs();if(e&&t in e)return e[t]}function jI(){let t=Bs();if(!t){console.error("Secret config file does not exist.");return}let e=!1,n=["privateKey","address"];for(let i of n)i in t||(t[i]="",e=!0);let r=["httpAdapterURL","hubURL","defaultLanguage","blockchainEnv","Nitro_URL"];for(let i of r)if(!(i in t)||t[i]===""){let a=pb()[i];t[i]=a||"",e=!0}e&&(fv(t),console.log("Configuration has been updated with default values for missing properties."))}function XRe(){let t="ed9005372c18624701ec0998cd12bd22";return(process.env.TRUEBIT_ENV==="local"||process.env.TRUEBIT_ENV==="staging"||process.env.TRUEBIT_ENV==="testnet")&&(t="6de18f3bc3d0865f3b4a3676ae16908d"),t}var UVt,jVt,VVt,zVt,qa=_c(()=>{"use strict";UVt={httpAdapterURL:"https://worker01-prod.truebit.network/http-adapter/",hubURL:"https://run.truebit.network/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"production",eula:"",RPC_URL:"",Nitro_URL:"https://tee.truebit.network/"},jVt={httpAdapterURL:"http://localhost:3000/",hubURL:"http://localhost:5000/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"local",eula:"",RPC_URL:"",Nitro_URL:"https://tee-dev.truebit.network/"},VVt={httpAdapterURL:"http://localhost:3000/",hubURL:"http://localhost:5000/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"testnet",eula:"",RPC_URL:"",Nitro_URL:"https://tee-dev.truebit.network/"},zVt={httpAdapterURL:"https://worker01-staging.truebit.network/http-adapter/",hubURL:"https://staging.truebit.network/",defaultLanguage:"rs",privateKey:"",address:"",blockchainEnv:"staging",eula:"",RPC_URL:"",Nitro_URL:"https://tee-stg.truebit.network/"}});import Ua from"chalk";var nr,R1=_c(()=>{"use strict";qa();nr=class t{static EULA_TERMS_LINK="https://truebit.io/terms/";static SETUP_INTRODUCTION=`
108
108
  Your all-in-one solution to develop, build, test, and deploy tasks seamlessly.
109
109
  Let's get started by setting up your account and configuring your wallet.
110
110
  We'll guide you through each step to ensure a smooth experience.
@@ -241,7 +241,7 @@ ${n.data.payload.instrumentedTaskId}`);else throw"Malformed instrumentation serv
241
241
  `),console.log(Rr.white("Wallet Address: ")+Rr.yellow(e)),console.log(Rr.white("Subscription Tier: ")+Rr.green(s.userSubscription.toUpperCase())),s.maxSolutions!==void 0&&console.log(Rr.white("Max Solutions: ")+Rr.green(`${s.maxSolutions}`)),s.quotaMax===0)console.log(Rr.white("Monthly Quota: ")+Rr.green("UNLIMITED")),s.currentUsage!==void 0&&console.log(Rr.white("Current Usage: ")+Rr.yellow(`${s.currentUsage} executions`));else{if(console.log(Rr.white("Monthly Quota: ")+Rr.green(`${s.quotaMax} executions`)),s.currentUsage!==void 0&&(console.log(Rr.white("Current Usage: ")+Rr.yellow(`${s.currentUsage} executions`)),s.remaining!==void 0)){let c=s.remaining===0?Rr.red:s.remaining<s.quotaMax*.2?Rr.yellow:Rr.green;console.log(Rr.white("Remaining: ")+c(`${s.remaining} executions`))}console.log(Rr.white("Quota Resets On: ")+Rr.yellow(u))}console.log(`
242
242
  `+Rr.cyan("=".repeat(60))+`
243
243
  `)}catch(t){throw t instanceof Error?console.error(Rr.red("Error fetching quota status: ")+t.message):console.error(Rr.red("Error fetching quota status: ")+String(t)),t}}qX();c0();async function rDe(t){try{console.log("Fetching execution status...");let n=await(await Ol()).get(`api/execution/${t}`).catch(J0);if(n.data.message)throw n.data.message;console.log("Task execution status: ",n.data.status),n.data.output&&console.log("Task execution output: ",n.data.output)}catch(e){console.error(`Couldn't fetch execution status for executionId ${t}: ${e}`)}}var iDe=Rt(_x(),1),yv=class{tokens=[];authInputs;parse(e,n){let r=this.parseKeyValuePairs(n);if(e.length==0){this.authInputs=r;return}let i=Object.keys(r);if(e.every(a=>i.includes(a))){let a={};for(let s of e)a[s]=r[s];this.authInputs=a}else throw new Error(`Invalid authString: ${e} are required`)}parseKeyValuePairs(e){try{let n=e.split(","),r={};for(let i of n){let[a,s]=i.split(":");r[a.trim()]=s.trim()}return r}catch{throw new Error("Invalid auth string")}}},iM=class extends yv{tokens=["accessKey","secretKey"];constructor(e){super(),this.parse(this.tokens,e)}authHeaders(e){return iDe.default.sign(e,{accessKeyId:this.authInputs.accessKey,secretAccessKey:this.authInputs.secretKey}).headers||{}}},aM=class extends yv{tokens=["username","password"];constructor(e){super(),this.parse(this.tokens,e)}authHeaders(e){return{Authorization:`Basic ${btoa(`${this.authInputs.username}:${this.authInputs.password}`)}`}}},sM=class extends yv{tokens=[];constructor(e){super(),this.parse([],e)}authHeaders(e){return{...this.authInputs}}};var vc;(function(t){t.AWS_SIGNATURE="aws-signature",t.BASIC_AUTH="basic-auth",t.CUSTOM_HEADER="custom-header"})(vc||(vc={}));var UX=(t,e)=>{switch(t){case vc.AWS_SIGNATURE:return new iM(e);case vc.BASIC_AUTH:return new aM(e);case vc.CUSTOM_HEADER:return new sM(e);default:throw new Error(`Invalid authentication method specified. Should be one of <${Object.values(vc)}>`)}};import Rzt from"chalk";import{ethers as kzt}from"ethers";c0();import*as oM from"crypto";async function Mzt(t){try{return(await t.get("/getkey")).data}catch(e){throw new Error(`Failed to get encryption key: ${e}`)}}function Pzt(t,e){try{let n=Buffer.from(e,"base64"),r=oM.randomBytes(16),i=oM.createCipheriv("aes-256-cbc",n,r),a=Buffer.concat([i.update(t,"utf8"),i.final()]);return n.fill(0),{encrypted_authString:a.toString("base64"),iv:r.toString("base64")}}catch(n){throw n instanceof Error?new Error(`Failed to encrypt credentials: ${n.message}`):new Error(`Failed to encrypt credentials: ${n}`)}}async function aDe(t,e){let n=await Mzt(t),r=Pzt(e,n.plaintext_key);return{encrypted_authString:r.encrypted_authString,encrypted_data_key:n.encrypted_key,iv:r.iv}}async function sDe(t,e,n,r,i,a,s){console.log("Deploying the API Authentication Credentials");try{if(!qke(a))throw"Invalid private key provided";if(!kzt.isAddress(s))throw"Invalid address provided";if(UX(r,i),!Sb(t))throw"Invalid taskId";let o=await JRe();console.log("Encrypting credentials...");let f=await aDe(o,i);await o.post("credentials",{taskId:t,namespace:e,taskName:n,method:r,encrypted_authString:f.encrypted_authString,encrypted_data_key:f.encrypted_data_key,iv:f.iv}).catch(J0),console.log("The encrypted credentials were deployed "+Rzt.green("Successfully"))}catch(o){throw console.log(o),`There was an Error deploying credentials:
244
- Couldn't push api credentials to remote server: ${o}`}}import{inspect as bWt}from"util";import ds from"ora";import{v4 as gWt}from"uuid";import{ethers as AM}from"ethers";var oDe={name:"@truebit/cli",version:"1.120.0-beta.233",private:!1,description:"truebit-cli is a basic command line that allows interaction between users and truebit nextgen node.",author:{name:"Truebit Co.",url:"https://truebit.io/"},license:"https://truebit.io/terms/",repository:{type:"git",url:"https://github.com/TruebitProtocol"},homepage:"https://truebit.io/",main:"build/index.mjs",module:"build/index.mjs",types:"build/types/index.d.ts",type:"module",scripts:{prebuild:"rimraf build logs","prebuild:dev":"rimraf build logs","build:dev":"tsc && chmod +x build/index.mjs",build:"NODE_ENV=production node esbuild.config.mjs && chmod +x build/index.mjs",dev:"export NODE_ENV=development && npx nodemon",test:"vitest run --passWithNoTests tests/"},dependencies:{axios:"1.13.2",chalk:"5.6.2",colors:"1.4.0",commander:"14.0.2",ethers:"6.15.0",figlet:"1.9.4","form-data":"4.0.5","openapi-enforcer":"1.23.0",ora:"9.0.0","public-ip":"8.0.0","ts-retry":"6.0.0",uuid:"13.0.0"},bin:{truebit:"build/index.mjs"},files:["build"],devDependencies:{"@types/figlet":"1.7.0","@vitest/coverage-v8":"3.2.4",esbuild:"0.27.0",typescript:"5.9.3",vitest:"3.2.4"},engines:{node:">=22.13.0"}};qa();c0();yp();qa();import{createInterface as qzt}from"node:readline/promises";import $1 from"chalk";c0();import bv from"axios";import{ethers as jX}from"ethers";import{randomBytes as Nzt}from"crypto";import{v4 as $zt}from"uuid";qa();import{ethers as fM}from"ethers";async function fDe(t,e=zt("blockchainEnv")){mv(t);let n=Pr(e,Mt.AVAX),r=fM.keccak256(fM.toUtf8Bytes(t));return await n.authorization.registerAuthorization(r),r}async function uM(t,e,n=zt("blockchainEnv"),r=zt("address")){mv(t);let i=Pr(n,Mt.AVAX),a=await i.authorization.getEIP712Domain(),s=await i.authorization.nonces(r),o=Math.floor(Date.now()/1e3)+3600,f={RegisterMeta:[{name:"user",type:"address"},{name:"apiKeyHash",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},u=fM.keccak256(fM.toUtf8Bytes(t)),c={user:r,apiKeyHash:u,nonce:Number(s),deadline:o},d=await i.utils.signMeta(a,f,c);return(await jke(r,u,o,d,e)).status==201?u:null}qa();yp();import{isTooManyTries as uDe,retryAsync as cDe}from"ts-retry";var lDe="0x0000000000000000000000000000000000000000";async function dDe(t){let e=!0;return t===""?(e=!1,console.log("An email address is required. Please provide your email address to proceed.")):new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?await Bzt(t)&&(e=!1,console.log("The provided email address is already in use. Please enter a different email address.")):(e=!1,console.log("The email address provided is not valid. Please try again.")),e}function Om(t){return t==="Y"||t==="N"}function pDe(t){return!jX.isAddress(t)||t.length!==42||!t.startsWith("0x")}async function hDe(){let t=await Fzt();try{if(!await uM(t,!0))throw Error("The API key could not been registered.")}catch(e){let n=e.message;if(n)throw Error(`There was an error registering the API key -> ${n}`)}return t}async function mDe(){let t=await Lzt();try{if(!await tM(t,!0))throw Error("The namespace could not been registered.")}catch(e){let n=e.message,r=n?n.match(/execution reverted: "(.*?)" /)?.[1]:null;if(r)throw Error(`There was an error registering the namespace -> ${r}`);if(n)throw Error(`There was an error registering the namespace -> ${n}`)}return t}async function Bzt(t){let e=await Co();try{return(await e.get(`userexistence/${t}`)).data===!0}catch(n){if(bv.isAxiosError(n)&&n.response?.status===404&&typeof n.response?.data?.message=="string"&&n.response.data.message.includes("User not found"))return!1;throw n}}async function cM(t,e){try{let n={message:"I am a Truebit User"};if(!e)throw Error("Secret.json does not exists");let r=e.privateKey,i=e.address,a=Za.createSignedBody(n,r,i);return(await(await Co()).get(`user/${t}`,{headers:{"truebit-auth":JSON.stringify(a)}})).data}catch(n){if(bv.isAxiosError(n)&&n.response?.status===401&&n.response?.data.message.includes("Entitlement Validation Error")||bv.isAxiosError(n)&&n.response?.status==404&&n.response?.data.message&&n.response?.data.message.includes("User not found"))return null;throw bv.isAxiosError(n)?n.response?Error(`The server responding with an error -> ${n.response.data.message||n.response.status+" - "+n.response.statusText}`):n.request?Error(`The server is not responding -> ${n.message}`):Error(`There was an error in the communication with the server -> ${n.message}`):Error(typeof n=="string"?`There was an error in the communication with the server -> ${n}`:"There was an error in the communication with the server.")}}async function yDe(t){try{return await(await Co()).post("user/register",t)}catch(e){throw bv.isAxiosError(e)?e.response?Error(`The server responding with an error -> ${e.response.data.message||e.response.status+" - "+e.response.statusText}`):e.request?Error(`The server is not responding -> ${e.message}`):Error(`There was an error in the communication with the server -> ${e.message}`):Error(typeof e=="string"?`There was an error in the communication with the server -> ${e}`:"There was an error in the communication with the server.")}}async function Fzt(){let t=zt("blockchainEnv"),e=Pr(t,Mt.AVAX),n="";try{await cDe(async()=>{n=$zt();let r=jX.keccak256(jX.toUtf8Bytes(n));return await e.authorization.getPayerAddress(r)===lDe},{delay:500,maxTry:5,until:r=>r===!0})}catch(r){throw uDe(r)?Error("Attempts to generate unique Api Key for the user exhausted."):r}return n}async function Lzt(){let t=zt("blockchainEnv"),e=Pr(t,Mt.AVAX),n="";try{await cDe(async()=>(n=Nzt(4).toString("hex"),await e.taskRegistry.getNamespaceOwner(n)===lDe),{delay:500,maxTry:5,until:r=>r===!0})}catch(r){throw uDe(r)?Error("Attempts to generate unique namespace for the user exhausted."):r}return n}function bDe(t){t.fullNameAnswer="",t.emailAddressAnswer="",t.companyNameAnswer="",t.jobPositionAnswer="",t.eulaAnswer="",t.confirmRegistration=""}yp();R1();import Uzt from"ora";import*as lM from"os";async function gDe(t,e,n){let r=Bs(),i=r!==null,a=0,s,o=qzt({input:process.stdin,output:process.stdout,terminal:!0});switch(i&&(pDe(r.address)?a=1:(s=await cM(r.address,r),s?a=2:a=3)),a){case 1:console.log("The wallet set in the configuration must be a valid ethereum address. (ENS not supported yet)");break;case 2:console.log(nr.SETUP_STEP1_SCENARIO1_P2(s));break;case 3:{console.log(nr.SETUP_STEP2_SCENARIO3_P1),console.log();let f={user_ip:t,date_time:Ri(),os_version:lM.type+"_"+lM.release,node_version:process.version,cli_version:e};await n.sendEventToMixpanel("user_registration_begin",f);let u={confirmRegistration:"",fullNameAnswer:"",emailAddressAnswer:"",companyNameAnswer:"",jobPositionAnswer:"",eulaAnswer:""};try{for(;u.confirmRegistration!="Y";){for(u.fullNameAnswer=(await o.question($1.bold(" 1. Full Name: "))).trim();u.fullNameAnswer==="";)console.log("Your full name is required. Please provide your first and last name to proceed."),u.fullNameAnswer=(await o.question($1.bold(" 1. Full Name: "))).trim();for(u.emailAddressAnswer=(await o.question($1.bold(" 2. Email Address: "))).trim();!await dDe(u.emailAddressAnswer);)u.emailAddressAnswer=(await o.question($1.bold(" 2. Email Address: "))).trim();for(u.companyNameAnswer=(await o.question($1.bold(" 3. Company Name: "))).trim(),u.jobPositionAnswer=(await o.question($1.bold(" 4. Job Position: "))).trim();!Om(u.eulaAnswer);)u.eulaAnswer=(await o.question($1.bold(` 5. Accept EULA? [Y|N] (${nr.EULA_TERMS_LINK}): `))).toUpperCase();if(u.eulaAnswer=="N"){console.log(nr.EULA_REGISTRATION_NO_ACCEPTED);break}for(;!Om(u.confirmRegistration);)console.log(`
244
+ Couldn't push api credentials to remote server: ${o}`}}import{inspect as bWt}from"util";import ds from"ora";import{v4 as gWt}from"uuid";import{ethers as AM}from"ethers";var oDe={name:"@truebit/cli",version:"1.120.0-beta.234",private:!1,description:"truebit-cli is a basic command line that allows interaction between users and truebit nextgen node.",author:{name:"Truebit Co.",url:"https://truebit.io/"},license:"https://truebit.io/terms/",repository:{type:"git",url:"https://github.com/TruebitProtocol"},homepage:"https://truebit.io/",main:"build/index.mjs",module:"build/index.mjs",types:"build/types/index.d.ts",type:"module",scripts:{prebuild:"rimraf build logs","prebuild:dev":"rimraf build logs","build:dev":"tsc && chmod +x build/index.mjs",build:"NODE_ENV=production node esbuild.config.mjs && chmod +x build/index.mjs",dev:"export NODE_ENV=development && npx nodemon",test:"vitest run --passWithNoTests tests/"},dependencies:{axios:"1.13.2",chalk:"5.6.2",colors:"1.4.0",commander:"14.0.2",ethers:"6.15.0",figlet:"1.9.4","form-data":"4.0.5","openapi-enforcer":"1.23.0",ora:"9.0.0","public-ip":"8.0.0","ts-retry":"6.0.0",uuid:"13.0.0"},bin:{truebit:"build/index.mjs"},files:["build"],devDependencies:{"@types/figlet":"1.7.0","@vitest/coverage-v8":"3.2.4",esbuild:"0.27.0",typescript:"5.9.3",vitest:"3.2.4"},engines:{node:">=22.13.0"}};qa();c0();yp();qa();import{createInterface as qzt}from"node:readline/promises";import $1 from"chalk";c0();import bv from"axios";import{ethers as jX}from"ethers";import{randomBytes as Nzt}from"crypto";import{v4 as $zt}from"uuid";qa();import{ethers as fM}from"ethers";async function fDe(t,e=zt("blockchainEnv")){mv(t);let n=Pr(e,Mt.AVAX),r=fM.keccak256(fM.toUtf8Bytes(t));return await n.authorization.registerAuthorization(r),r}async function uM(t,e,n=zt("blockchainEnv"),r=zt("address")){mv(t);let i=Pr(n,Mt.AVAX),a=await i.authorization.getEIP712Domain(),s=await i.authorization.nonces(r),o=Math.floor(Date.now()/1e3)+3600,f={RegisterMeta:[{name:"user",type:"address"},{name:"apiKeyHash",type:"string"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},u=fM.keccak256(fM.toUtf8Bytes(t)),c={user:r,apiKeyHash:u,nonce:Number(s),deadline:o},d=await i.utils.signMeta(a,f,c);return(await jke(r,u,o,d,e)).status==201?u:null}qa();yp();import{isTooManyTries as uDe,retryAsync as cDe}from"ts-retry";var lDe="0x0000000000000000000000000000000000000000";async function dDe(t){let e=!0;return t===""?(e=!1,console.log("An email address is required. Please provide your email address to proceed.")):new RegExp(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?await Bzt(t)&&(e=!1,console.log("The provided email address is already in use. Please enter a different email address.")):(e=!1,console.log("The email address provided is not valid. Please try again.")),e}function Om(t){return t==="Y"||t==="N"}function pDe(t){return!jX.isAddress(t)||t.length!==42||!t.startsWith("0x")}async function hDe(){let t=await Fzt();try{if(!await uM(t,!0))throw Error("The API key could not been registered.")}catch(e){let n=e.message;if(n)throw Error(`There was an error registering the API key -> ${n}`)}return t}async function mDe(){let t=await Lzt();try{if(!await tM(t,!0))throw Error("The namespace could not been registered.")}catch(e){let n=e.message,r=n?n.match(/execution reverted: "(.*?)" /)?.[1]:null;if(r)throw Error(`There was an error registering the namespace -> ${r}`);if(n)throw Error(`There was an error registering the namespace -> ${n}`)}return t}async function Bzt(t){let e=await Co();try{return(await e.get(`userexistence/${t}`)).data===!0}catch(n){if(bv.isAxiosError(n)&&n.response?.status===404&&typeof n.response?.data?.message=="string"&&n.response.data.message.includes("User not found"))return!1;throw n}}async function cM(t,e){try{let n={message:"I am a Truebit User"};if(!e)throw Error("Secret.json does not exists");let r=e.privateKey,i=e.address,a=Za.createSignedBody(n,r,i);return(await(await Co()).get(`user/${t}`,{headers:{"truebit-auth":JSON.stringify(a)}})).data}catch(n){if(bv.isAxiosError(n)&&n.response?.status===401&&n.response?.data.message.includes("Entitlement Validation Error")||bv.isAxiosError(n)&&n.response?.status==404&&n.response?.data.message&&n.response?.data.message.includes("User not found"))return null;throw bv.isAxiosError(n)?n.response?Error(`The server responding with an error -> ${n.response.data.message||n.response.status+" - "+n.response.statusText}`):n.request?Error(`The server is not responding -> ${n.message}`):Error(`There was an error in the communication with the server -> ${n.message}`):Error(typeof n=="string"?`There was an error in the communication with the server -> ${n}`:"There was an error in the communication with the server.")}}async function yDe(t){try{return await(await Co()).post("user/register",t)}catch(e){throw bv.isAxiosError(e)?e.response?Error(`The server responding with an error -> ${e.response.data.message||e.response.status+" - "+e.response.statusText}`):e.request?Error(`The server is not responding -> ${e.message}`):Error(`There was an error in the communication with the server -> ${e.message}`):Error(typeof e=="string"?`There was an error in the communication with the server -> ${e}`:"There was an error in the communication with the server.")}}async function Fzt(){let t=zt("blockchainEnv"),e=Pr(t,Mt.AVAX),n="";try{await cDe(async()=>{n=$zt();let r=jX.keccak256(jX.toUtf8Bytes(n));return await e.authorization.getPayerAddress(r)===lDe},{delay:500,maxTry:5,until:r=>r===!0})}catch(r){throw uDe(r)?Error("Attempts to generate unique Api Key for the user exhausted."):r}return n}async function Lzt(){let t=zt("blockchainEnv"),e=Pr(t,Mt.AVAX),n="";try{await cDe(async()=>(n=Nzt(4).toString("hex"),await e.taskRegistry.getNamespaceOwner(n)===lDe),{delay:500,maxTry:5,until:r=>r===!0})}catch(r){throw uDe(r)?Error("Attempts to generate unique namespace for the user exhausted."):r}return n}function bDe(t){t.fullNameAnswer="",t.emailAddressAnswer="",t.companyNameAnswer="",t.jobPositionAnswer="",t.eulaAnswer="",t.confirmRegistration=""}yp();R1();import Uzt from"ora";import*as lM from"os";async function gDe(t,e,n){let r=Bs(),i=r!==null,a=0,s,o=qzt({input:process.stdin,output:process.stdout,terminal:!0});switch(i&&(pDe(r.address)?a=1:(s=await cM(r.address,r),s?a=2:a=3)),a){case 1:console.log("The wallet set in the configuration must be a valid ethereum address. (ENS not supported yet)");break;case 2:console.log(nr.SETUP_STEP1_SCENARIO1_P2(s));break;case 3:{console.log(nr.SETUP_STEP2_SCENARIO3_P1),console.log();let f={user_ip:t,date_time:Ri(),os_version:lM.type+"_"+lM.release,node_version:process.version,cli_version:e};await n.sendEventToMixpanel("user_registration_begin",f);let u={confirmRegistration:"",fullNameAnswer:"",emailAddressAnswer:"",companyNameAnswer:"",jobPositionAnswer:"",eulaAnswer:""};try{for(;u.confirmRegistration!="Y";){for(u.fullNameAnswer=(await o.question($1.bold(" 1. Full Name: "))).trim();u.fullNameAnswer==="";)console.log("Your full name is required. Please provide your first and last name to proceed."),u.fullNameAnswer=(await o.question($1.bold(" 1. Full Name: "))).trim();for(u.emailAddressAnswer=(await o.question($1.bold(" 2. Email Address: "))).trim();!await dDe(u.emailAddressAnswer);)u.emailAddressAnswer=(await o.question($1.bold(" 2. Email Address: "))).trim();for(u.companyNameAnswer=(await o.question($1.bold(" 3. Company Name: "))).trim(),u.jobPositionAnswer=(await o.question($1.bold(" 4. Job Position: "))).trim();!Om(u.eulaAnswer);)u.eulaAnswer=(await o.question($1.bold(` 5. Accept EULA? [Y|N] (${nr.EULA_TERMS_LINK}): `))).toUpperCase();if(u.eulaAnswer=="N"){console.log(nr.EULA_REGISTRATION_NO_ACCEPTED);break}for(;!Om(u.confirmRegistration);)console.log(`
245
245
  Is the information provided above correct?`),u.confirmRegistration=(await o.question($1.bold("Press [Y] to confirm or [N] to edit: "))).toUpperCase();u.confirmRegistration=="N"&&(console.log(`
246
246
  Please provide the following information:`),bDe(u))}}catch(l){if(l.name==="AbortError"||l.message.includes("Ctrl+C")){let p=l.message,h=f;h.error_details=p,h.date_time=Ri();let v={fullname:u.fullNameAnswer,email:u.emailAddressAnswer,company:u.companyNameAnswer,role:u.jobPositionAnswer};h.user_info=JSON.stringify(v),await n.sendEventToMixpanel("user_registration_failed",h),process.exit(0)}}if(u.eulaAnswer=="N")break;let c=f;console.log(),console.log("By completing registration, you'll be automatically subscribed to our newsletter."),console.log("To opt-out, please follow the steps described in our documentation portal."),console.log();let d=Uzt({text:$1.bold("... registering your account."),stream:process.stdout}).start();try{let l=await mDe(),p=await hDe(),h={name:u.fullNameAnswer,email:u.emailAddressAnswer,walletAddress:r?.address,company:u.companyNameAnswer,jobDescription:u.jobPositionAnswer,EULA:Za.createSignedBody({ip:await WI(),date:new Date().toISOString()},r.privateKey),defaultNamespace:l,defaultApiKey:p};await yDe(h),d.stop(),console.log(nr.SETUP_STEP2_SCENARIO3_P2(u,r.address,l,p)),c.distinct_id=h.walletAddress,c.date_time=Ri(),c.fullname=h.name,c.email=h.email,c.company=h.company,c.role=h.jobDescription,c.namespace=h.defaultNamespace,c.api_key=p,c.wallet_address=h.walletAddress,await n.sendEventToMixpanel("user_registration_success",c),await n.registerUserMixpanel(c.wallet_address,jzt(c))}catch(l){d.stop();let p=l.message,h=f;h.error_details=p,h.date_time=Ri();let v={fullname:u.fullNameAnswer,email:u.emailAddressAnswer,company:u.companyNameAnswer,role:u.jobPositionAnswer};h.user_info=JSON.stringify(v),await n.sendEventToMixpanel("user_registration_failed",h);let E=p?p.match(/CreateUserValidation - (.*?.*)/)?.[1]:null;if(E)throw Error(E);if(p.includes("Sender doesn't have enough funds to send tx"))throw Error("We are currently experiencing technical difficulties. Please try again later.");console.error(nr.SETUP_STEP2_UNHANDLED_ERROR),process.exit(1)}finally{d.clear()}break}default:throw Error("An unexpected error occurred.")}o.close()}function jzt(t){return{apiKey:t.api_key,name:t.fullname,email:t.email,ip:t.user_ip,company:t.company,role:t.role,namespace:t.namespace,walletAddress:t.wallet_address}}import{setDefaultAutoSelectFamily as vWt}from"node:net";import Vzt from"chalk";qa();R1();import{createInterface as zzt}from"node:readline/promises";import*as dM from"os";async function vDe(t,e,n){let r=Bs(),i=r!==null,a=0;switch(i?i&&!r.eula?a=2:a=3:a=1,a){case 1:case 2:{let s=zzt({input:process.stdin,output:process.stdout,terminal:!0}),o="",f={user_ip:t,date_time:Ri(),os_version:dM.type+"_"+dM.release,node_version:process.version,cli_version:e};for(console.log(nr.EULA_INSTALLATION);!Om(o);)o=(await s.question(Vzt.bold(`
247
247
  Have you read, and do you accept the Terms of Use? [Y|N]: `))).toUpperCase(),await n.sendEventToMixpanel("TOS_shown",f);if(o=="N")throw f.date_time=Ri(),await n.sendEventToMixpanel("TOS_rejected",f),nr.EULA_INSTALLATION_NO_ACCEPTED;f.date_time=Ri(),await n.sendEventToMixpanel("TOS_accepted",f);let u=Math.round(new Date().getTime()).toString();if(a===1){let c={...pb(),eula:u};ZRe(c)}else a===2&&fv({eula:u});s.close()}break;case 3:default:break}}qa();R1();async function ef(t=!1){let e=Bs(),n=e!==null,r=null,i=0;switch(n?n&&(!e.privateKey||!e.address)?i=2:(r=await cM(e.address,e),r?i=4:i=3):i=1,i){case 1:case 2:case 3:console.log(nr.USER_NO_REGISTERED),process.exit(1);break;case 4:t&&console.log(`You are logged in as: ${r?.name} - ${r?.email}`);break}}import{createInterface as Hzt}from"node:readline/promises";R1();qa();import Wzt from"chalk";async function _De(){console.log(Wzt.bold(`